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/fetchers/simple_order_filled_cancelled_fetcher.ts | |
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/fetchers/simple_order_filled_cancelled_fetcher.ts')
-rw-r--r-- | packages/0x.js/src/fetchers/simple_order_filled_cancelled_fetcher.ts | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/packages/0x.js/src/fetchers/simple_order_filled_cancelled_fetcher.ts b/packages/0x.js/src/fetchers/simple_order_filled_cancelled_fetcher.ts index e24f02726..1c8aec1a1 100644 --- a/packages/0x.js/src/fetchers/simple_order_filled_cancelled_fetcher.ts +++ b/packages/0x.js/src/fetchers/simple_order_filled_cancelled_fetcher.ts @@ -5,20 +5,24 @@ import {OrderFilledCancelledFetcher} from '../abstract/order_filled_cancelled_fe import {ExchangeWrapper} from '../contract_wrappers/exchange_wrapper'; export class SimpleOrderFilledCancelledFetcher implements OrderFilledCancelledFetcher { - private _exchange: ExchangeWrapper; - constructor(exchange: ExchangeWrapper) { - this._exchange = exchange; + private _exchangeWrapper: ExchangeWrapper; + private _defaultBlock: BlockParamLiteral; + constructor(exchange: ExchangeWrapper, defaultBlock: BlockParamLiteral) { + this._exchangeWrapper = exchange; + this._defaultBlock = defaultBlock; } public async getFilledTakerAmountAsync(orderHash: string): Promise<BigNumber> { const methodOpts = { - defaultBlock: BlockParamLiteral.Pending, + defaultBlock: this._defaultBlock, }; - return this._exchange.getFilledTakerAmountAsync(orderHash, methodOpts); + const filledTakerAmount = this._exchangeWrapper.getFilledTakerAmountAsync(orderHash, methodOpts); + return filledTakerAmount; } public async getCancelledTakerAmountAsync(orderHash: string): Promise<BigNumber> { const methodOpts = { - defaultBlock: BlockParamLiteral.Pending, + defaultBlock: this._defaultBlock, }; - return this._exchange.getCancelledTakerAmountAsync(orderHash, methodOpts); + const cancelledTakerAmount = this._exchangeWrapper.getCancelledTakerAmountAsync(orderHash, methodOpts); + return cancelledTakerAmount; } } |