diff options
author | Fabio Berger <me@fabioberger.com> | 2017-06-08 22:44:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-08 22:44:09 +0800 |
commit | 2195bc61347d6d132b6ce23ec05186c4afa4dd46 (patch) | |
tree | bc1d9fc14206b2241d907f78224b139afcd08aad /src | |
parent | c6645f9f4f470323086d9004cf603a68091d71a3 (diff) | |
parent | 464e761053e1f84a05dbc6af2512effafa8d6350 (diff) | |
download | dexon-sol-tools-2195bc61347d6d132b6ce23ec05186c4afa4dd46.tar dexon-sol-tools-2195bc61347d6d132b6ce23ec05186c4afa4dd46.tar.gz dexon-sol-tools-2195bc61347d6d132b6ce23ec05186c4afa4dd46.tar.bz2 dexon-sol-tools-2195bc61347d6d132b6ce23ec05186c4afa4dd46.tar.lz dexon-sol-tools-2195bc61347d6d132b6ce23ec05186c4afa4dd46.tar.xz dexon-sol-tools-2195bc61347d6d132b6ce23ec05186c4afa4dd46.tar.zst dexon-sol-tools-2195bc61347d6d132b6ce23ec05186c4afa4dd46.zip |
Merge pull request #46 from 0xProject/order-hash-contract
Add getOrderHashHexUsingContractCallAsync
Diffstat (limited to 'src')
-rw-r--r-- | src/contract_wrappers/exchange_wrapper.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index d144d8aad..9cb2332fe 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -342,6 +342,12 @@ export class ExchangeWrapper extends ContractWrapper { const orderHashHex = utils.getOrderHashHex(order, exchangeInstance.address); return orderHashHex; } + private async getOrderHashHexUsingContractCallAsync(order: Order|SignedOrder): Promise<string> { + const exchangeInstance = await this.getExchangeContractAsync(); + const [orderAddresses, orderValues] = ExchangeWrapper.getOrderAddressesAndValues(order); + const orderHashHex = await exchangeInstance.getOrderHash.call(orderAddresses, orderValues); + return orderHashHex; + } private async stopWatchingExchangeLogEventsAsync() { const stopWatchingPromises = _.map(this.exchangeLogEventObjs, logEventObj => { return promisify(logEventObj.stopWatching, logEventObj)(); |