diff options
author | Ara Kevonian <ara@dextroid.io> | 2018-04-17 21:47:36 +0800 |
---|---|---|
committer | Ara Kevonian <ara@dextroid.io> | 2018-04-17 21:47:36 +0800 |
commit | 7d957538b46bbc9cd757d5b9a0351bf27e4e5419 (patch) | |
tree | 6bb5c372c5e6f74b5b69d683658dc17b46c6fcbc /packages/0x.js/src/contract_wrappers | |
parent | 5355da6cad157bb67d1b55a2f8463efe3e072385 (diff) | |
download | dexon-sol-tools-7d957538b46bbc9cd757d5b9a0351bf27e4e5419.tar dexon-sol-tools-7d957538b46bbc9cd757d5b9a0351bf27e4e5419.tar.gz dexon-sol-tools-7d957538b46bbc9cd757d5b9a0351bf27e4e5419.tar.bz2 dexon-sol-tools-7d957538b46bbc9cd757d5b9a0351bf27e4e5419.tar.lz dexon-sol-tools-7d957538b46bbc9cd757d5b9a0351bf27e4e5419.tar.xz dexon-sol-tools-7d957538b46bbc9cd757d5b9a0351bf27e4e5419.tar.zst dexon-sol-tools-7d957538b46bbc9cd757d5b9a0351bf27e4e5419.zip |
Add stateLayer param to getOrderState and clean up variable names
Diffstat (limited to 'packages/0x.js/src/contract_wrappers')
-rw-r--r-- | packages/0x.js/src/contract_wrappers/exchange_wrapper.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts index 5dea70769..eacd3ebf0 100644 --- a/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts +++ b/packages/0x.js/src/contract_wrappers/exchange_wrapper.ts @@ -879,15 +879,18 @@ export class ExchangeWrapper extends ContractWrapper { /** * Gets the latest OrderState of a signedOrder * @param signedOrder The signedOrder + * @param stateLayer Optional, desired blockchain state layer (defaults to latest). + * @return OrderState of the signedOrder */ - public async getOrderStateAsync(signedOrder: SignedOrder): Promise<OrderState> { + public async getOrderStateAsync(signedOrder: SignedOrder, stateLayer: BlockParamLiteral = BlockParamLiteral.Latest): Promise<OrderState> { const simpleBalanceAndProxyAllowanceFetcher = new SimpleBalanceAndProxyAllowanceFetcher( this._tokenWrapper, - BlockParamLiteral.Latest, + stateLayer, ); - const simpleOrderFilledCancelledFetcher = new SimpleOrderFilledCancelledFetcher(this); + const simpleOrderFilledCancelledFetcher = new SimpleOrderFilledCancelledFetcher(this, stateLayer); const orderStateUtils = new OrderStateUtils(simpleBalanceAndProxyAllowanceFetcher, simpleOrderFilledCancelledFetcher); - return orderStateUtils.getOrderStateAsync(signedOrder); + const orderState = orderStateUtils.getOrderStateAsync(signedOrder); + return orderState; } /** * Returns the ZRX token address used by the exchange contract. |