diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-08 19:56:10 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-08 19:56:10 +0800 |
commit | 1d64b542d8eecb4d6c63a5faa04150d3110d2fd5 (patch) | |
tree | f13b6c8aa85217b6cddba3d57b2e5307d9c89b63 /src/contract_wrappers/exchange_wrapper.ts | |
parent | e60153a4fbb732a6f11cb216743764060c579cdd (diff) | |
download | dexon-0x-contracts-1d64b542d8eecb4d6c63a5faa04150d3110d2fd5.tar dexon-0x-contracts-1d64b542d8eecb4d6c63a5faa04150d3110d2fd5.tar.gz dexon-0x-contracts-1d64b542d8eecb4d6c63a5faa04150d3110d2fd5.tar.bz2 dexon-0x-contracts-1d64b542d8eecb4d6c63a5faa04150d3110d2fd5.tar.lz dexon-0x-contracts-1d64b542d8eecb4d6c63a5faa04150d3110d2fd5.tar.xz dexon-0x-contracts-1d64b542d8eecb4d6c63a5faa04150d3110d2fd5.tar.zst dexon-0x-contracts-1d64b542d8eecb4d6c63a5faa04150d3110d2fd5.zip |
Rename CallOpts to MethodOpts
Diffstat (limited to 'src/contract_wrappers/exchange_wrapper.ts')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index 9d73a4ede..c6632175c 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -27,7 +27,7 @@ import { LogFillContractEventArgs, LogCancelContractEventArgs, LogWithDecodedArgs, - CallOpts, + MethodOpts, } from '../types'; import {assert} from '../utils/assert'; import {utils} from '../utils/utils'; @@ -86,14 +86,15 @@ export class ExchangeWrapper extends ContractWrapper { * subtracting the unavailable amount from the total order takerAmount. * @param orderHash The hex encoded orderHash for which you would like to retrieve the * unavailable takerAmount. - * @param callOpts ${FABIOS_COMMENT} + * @param methodOpts ${FABIOS_COMMENT} * @return The amount of the order (in taker tokens) that has either been filled or canceled. */ - public async getUnavailableTakerAmountAsync(orderHash: string, callOpts?: CallOpts): Promise<BigNumber.BigNumber> { + public async getUnavailableTakerAmountAsync(orderHash: string, + methodOpts?: MethodOpts): Promise<BigNumber.BigNumber> { assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema); const exchangeContract = await this._getExchangeContractAsync(); - const defaultBlock = _.isUndefined(callOpts) ? undefined : callOpts.defaultBlock; + const defaultBlock = _.isUndefined(methodOpts) ? undefined : methodOpts.defaultBlock; let unavailableTakerTokenAmount = await exchangeContract.getUnavailableTakerTokenAmount.callAsync( orderHash, defaultBlock, ); @@ -104,14 +105,14 @@ export class ExchangeWrapper extends ContractWrapper { /** * Retrieve the takerAmount of an order that has already been filled. * @param orderHash The hex encoded orderHash for which you would like to retrieve the filled takerAmount. - * @param callOpts ${FABIOS_COMMENT} + * @param methodOpts ${FABIOS_COMMENT} * @return The amount of the order (in taker tokens) that has already been filled. */ - public async getFilledTakerAmountAsync(orderHash: string, callOpts?: CallOpts): Promise<BigNumber.BigNumber> { + public async getFilledTakerAmountAsync(orderHash: string, methodOpts?: MethodOpts): Promise<BigNumber.BigNumber> { assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema); const exchangeContract = await this._getExchangeContractAsync(); - const defaultBlock = _.isUndefined(callOpts) ? undefined : callOpts.defaultBlock; + const defaultBlock = _.isUndefined(methodOpts) ? undefined : methodOpts.defaultBlock; let fillAmountInBaseUnits = await exchangeContract.filled.callAsync(orderHash, defaultBlock); // Wrap BigNumbers returned from web3 with our own (later) version of BigNumber fillAmountInBaseUnits = new BigNumber(fillAmountInBaseUnits); @@ -121,14 +122,14 @@ export class ExchangeWrapper extends ContractWrapper { * Retrieve the takerAmount of an order that has been cancelled. * @param orderHash The hex encoded orderHash for which you would like to retrieve the * cancelled takerAmount. - * @param callOpts ${FABIOS_COMMENT} + * @param methodOpts ${FABIOS_COMMENT} * @return The amount of the order (in taker tokens) that has been cancelled. */ - public async getCanceledTakerAmountAsync(orderHash: string, callOpts?: CallOpts): Promise<BigNumber.BigNumber> { + public async getCanceledTakerAmountAsync(orderHash: string, methodOpts?: MethodOpts): Promise<BigNumber.BigNumber> { assert.doesConformToSchema('orderHash', orderHash, schemas.orderHashSchema); const exchangeContract = await this._getExchangeContractAsync(); - const defaultBlock = _.isUndefined(callOpts) ? undefined : callOpts.defaultBlock; + const defaultBlock = _.isUndefined(methodOpts) ? undefined : methodOpts.defaultBlock; let cancelledAmountInBaseUnits = await exchangeContract.cancelled.callAsync(orderHash, defaultBlock); // Wrap BigNumbers returned from web3 with our own (later) version of BigNumber cancelledAmountInBaseUnits = new BigNumber(cancelledAmountInBaseUnits); |