diff options
Diffstat (limited to 'packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts')
-rw-r--r-- | packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts b/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts index 134508057..eebc2b52c 100644 --- a/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts +++ b/packages/0x.js/src/stores/order_filled_cancelled_lazy_store.ts @@ -9,15 +9,17 @@ import { OrderFilledCancelledFetcher } from '../abstract/order_filled_cancelled_ * Copy on read store for filled/cancelled taker amounts */ export class OrderFilledCancelledLazyStore implements OrderFilledCancelledFetcher { - private _exchange: ExchangeWrapper; + private _exchangeWrapper: ExchangeWrapper; + private _defaultBlock: BlockParamLiteral; private _filledTakerAmount: { [orderHash: string]: BigNumber; }; private _cancelledTakerAmount: { [orderHash: string]: BigNumber; }; - constructor(exchange: ExchangeWrapper) { - this._exchange = exchange; + constructor(exchange: ExchangeWrapper, defaultBlock: BlockParamLiteral) { + this._exchangeWrapper = exchange; + this._defaultBlock = defaultBlock; this._filledTakerAmount = {}; this._cancelledTakerAmount = {}; } @@ -26,7 +28,7 @@ export class OrderFilledCancelledLazyStore implements OrderFilledCancelledFetche const methodOpts = { defaultBlock: BlockParamLiteral.Pending, }; - const filledTakerAmount = await this._exchange.getFilledTakerAmountAsync(orderHash, methodOpts); + const filledTakerAmount = await this._exchangeWrapper.getFilledTakerAmountAsync(orderHash, methodOpts); this.setFilledTakerAmount(orderHash, filledTakerAmount); } const cachedFilled = this._filledTakerAmount[orderHash]; @@ -43,7 +45,7 @@ export class OrderFilledCancelledLazyStore implements OrderFilledCancelledFetche const methodOpts = { defaultBlock: BlockParamLiteral.Pending, }; - const cancelledTakerAmount = await this._exchange.getCancelledTakerAmountAsync(orderHash, methodOpts); + const cancelledTakerAmount = await this._exchangeWrapper.getCancelledTakerAmountAsync(orderHash, methodOpts); this.setCancelledTakerAmount(orderHash, cancelledTakerAmount); } const cachedCancelled = this._cancelledTakerAmount[orderHash]; |