Fix linter and prettier
This commit is contained in:
@@ -19,7 +19,8 @@
|
|||||||
"pr": 501
|
"pr": 501
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"note": "Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder",
|
"note":
|
||||||
|
"Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder",
|
||||||
"pr": 510
|
"pr": 510
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@@ -882,13 +882,19 @@ export class ExchangeWrapper extends ContractWrapper {
|
|||||||
* @param stateLayer Optional, desired blockchain state layer (defaults to latest).
|
* @param stateLayer Optional, desired blockchain state layer (defaults to latest).
|
||||||
* @return OrderState of the signedOrder
|
* @return OrderState of the signedOrder
|
||||||
*/
|
*/
|
||||||
public async getOrderStateAsync(signedOrder: SignedOrder, stateLayer: BlockParamLiteral = BlockParamLiteral.Latest): Promise<OrderState> {
|
public async getOrderStateAsync(
|
||||||
|
signedOrder: SignedOrder,
|
||||||
|
stateLayer: BlockParamLiteral = BlockParamLiteral.Latest,
|
||||||
|
): Promise<OrderState> {
|
||||||
const simpleBalanceAndProxyAllowanceFetcher = new SimpleBalanceAndProxyAllowanceFetcher(
|
const simpleBalanceAndProxyAllowanceFetcher = new SimpleBalanceAndProxyAllowanceFetcher(
|
||||||
this._tokenWrapper,
|
this._tokenWrapper,
|
||||||
stateLayer,
|
stateLayer,
|
||||||
);
|
);
|
||||||
const simpleOrderFilledCancelledFetcher = new SimpleOrderFilledCancelledFetcher(this, stateLayer);
|
const simpleOrderFilledCancelledFetcher = new SimpleOrderFilledCancelledFetcher(this, stateLayer);
|
||||||
const orderStateUtils = new OrderStateUtils(simpleBalanceAndProxyAllowanceFetcher, simpleOrderFilledCancelledFetcher);
|
const orderStateUtils = new OrderStateUtils(
|
||||||
|
simpleBalanceAndProxyAllowanceFetcher,
|
||||||
|
simpleOrderFilledCancelledFetcher,
|
||||||
|
);
|
||||||
const orderState = orderStateUtils.getOrderStateAsync(signedOrder);
|
const orderState = orderStateUtils.getOrderStateAsync(signedOrder);
|
||||||
return orderState;
|
return orderState;
|
||||||
}
|
}
|
||||||
|
@@ -2,8 +2,8 @@ import { BlockParamLiteral } from '@0xproject/types';
|
|||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
|
|
||||||
import { BalanceAndProxyAllowanceFetcher } from '../abstract/balance_and_proxy_allowance_fetcher';
|
import { BalanceAndProxyAllowanceFetcher } from '../abstract/balance_and_proxy_allowance_fetcher';
|
||||||
|
import { TokenWrapper } from '../contract_wrappers/token_wrapper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy on read store for balances/proxyAllowances of tokens/accounts
|
* Copy on read store for balances/proxyAllowances of tokens/accounts
|
||||||
@@ -60,7 +60,11 @@ export class BalanceAndProxyAllowanceLazyStore implements BalanceAndProxyAllowan
|
|||||||
const methodOpts = {
|
const methodOpts = {
|
||||||
defaultBlock: this._defaultBlock,
|
defaultBlock: this._defaultBlock,
|
||||||
};
|
};
|
||||||
const proxyAllowance = await this._tokenWrapper.getProxyAllowanceAsync(tokenAddress, userAddress, methodOpts);
|
const proxyAllowance = await this._tokenWrapper.getProxyAllowanceAsync(
|
||||||
|
tokenAddress,
|
||||||
|
userAddress,
|
||||||
|
methodOpts,
|
||||||
|
);
|
||||||
this.setProxyAllowance(tokenAddress, userAddress, proxyAllowance);
|
this.setProxyAllowance(tokenAddress, userAddress, proxyAllowance);
|
||||||
}
|
}
|
||||||
const cachedProxyAllowance = this._proxyAllowance[tokenAddress][userAddress];
|
const cachedProxyAllowance = this._proxyAllowance[tokenAddress][userAddress];
|
||||||
|
@@ -2,8 +2,8 @@ import { BlockParamLiteral } from '@0xproject/types';
|
|||||||
import { BigNumber } from '@0xproject/utils';
|
import { BigNumber } from '@0xproject/utils';
|
||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
|
|
||||||
import { OrderFilledCancelledFetcher } from '../abstract/order_filled_cancelled_fetcher';
|
import { OrderFilledCancelledFetcher } from '../abstract/order_filled_cancelled_fetcher';
|
||||||
|
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy on read store for filled/cancelled taker amounts
|
* Copy on read store for filled/cancelled taker amounts
|
||||||
@@ -45,7 +45,10 @@ export class OrderFilledCancelledLazyStore implements OrderFilledCancelledFetche
|
|||||||
const methodOpts = {
|
const methodOpts = {
|
||||||
defaultBlock: this._defaultBlock,
|
defaultBlock: this._defaultBlock,
|
||||||
};
|
};
|
||||||
const cancelledTakerAmount = await this._exchangeWrapper.getCancelledTakerAmountAsync(orderHash, methodOpts);
|
const cancelledTakerAmount = await this._exchangeWrapper.getCancelledTakerAmountAsync(
|
||||||
|
orderHash,
|
||||||
|
methodOpts,
|
||||||
|
);
|
||||||
this.setCancelledTakerAmount(orderHash, cancelledTakerAmount);
|
this.setCancelledTakerAmount(orderHash, cancelledTakerAmount);
|
||||||
}
|
}
|
||||||
const cachedCancelled = this._cancelledTakerAmount[orderHash];
|
const cachedCancelled = this._cancelledTakerAmount[orderHash];
|
||||||
|
@@ -3,9 +3,9 @@ import { BigNumber } from '@0xproject/utils';
|
|||||||
import * as _ from 'lodash';
|
import * as _ from 'lodash';
|
||||||
|
|
||||||
import { ZeroEx } from '../0x';
|
import { ZeroEx } from '../0x';
|
||||||
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
|
|
||||||
import { BalanceAndProxyAllowanceFetcher } from '../abstract/balance_and_proxy_allowance_fetcher';
|
import { BalanceAndProxyAllowanceFetcher } from '../abstract/balance_and_proxy_allowance_fetcher';
|
||||||
import { OrderFilledCancelledFetcher } from '../abstract/order_filled_cancelled_fetcher';
|
import { OrderFilledCancelledFetcher } from '../abstract/order_filled_cancelled_fetcher';
|
||||||
|
import { ExchangeWrapper } from '../contract_wrappers/exchange_wrapper';
|
||||||
import { RemainingFillableCalculator } from '../order_watcher/remaining_fillable_calculator';
|
import { RemainingFillableCalculator } from '../order_watcher/remaining_fillable_calculator';
|
||||||
import { ExchangeContractErrs, OrderRelevantState, OrderState, OrderStateInvalid, OrderStateValid } from '../types';
|
import { ExchangeContractErrs, OrderRelevantState, OrderState, OrderStateInvalid, OrderStateValid } from '../types';
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user