diff options
author | Fabio Berger <me@fabioberger.com> | 2018-09-25 23:10:13 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-09-25 23:10:13 +0800 |
commit | 9eecf3683b674f0753e508476c4c21eb32625f18 (patch) | |
tree | 7098726b4a8189a29d01295d1f23a0df35ebafdb /packages/order-utils/src | |
parent | 7570f3db513f1b728e27cdd6273642ab999adbcc (diff) | |
download | dexon-sol-tools-9eecf3683b674f0753e508476c4c21eb32625f18.tar dexon-sol-tools-9eecf3683b674f0753e508476c4c21eb32625f18.tar.gz dexon-sol-tools-9eecf3683b674f0753e508476c4c21eb32625f18.tar.bz2 dexon-sol-tools-9eecf3683b674f0753e508476c4c21eb32625f18.tar.lz dexon-sol-tools-9eecf3683b674f0753e508476c4c21eb32625f18.tar.xz dexon-sol-tools-9eecf3683b674f0753e508476c4c21eb32625f18.tar.zst dexon-sol-tools-9eecf3683b674f0753e508476c4c21eb32625f18.zip |
Add transactionHash to OrderState and emit it from OrderWatcher subscription
Diffstat (limited to 'packages/order-utils/src')
-rw-r--r-- | packages/order-utils/src/order_state_utils.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/order-utils/src/order_state_utils.ts b/packages/order-utils/src/order_state_utils.ts index 8398776aa..9b21ef6e9 100644 --- a/packages/order-utils/src/order_state_utils.ts +++ b/packages/order-utils/src/order_state_utils.ts @@ -114,7 +114,7 @@ export class OrderStateUtils { * @return State relevant to the signedOrder, as well as whether the signedOrder is "valid". * Validity is defined as a non-zero amount of the order can still be filled. */ - public async getOpenOrderStateAsync(signedOrder: SignedOrder): Promise<OrderState> { + public async getOpenOrderStateAsync(signedOrder: SignedOrder, transactionHash?: string): Promise<OrderState> { const orderRelevantState = await this.getOpenOrderRelevantStateAsync(signedOrder); const orderHash = orderHashUtils.getOrderHashHex(signedOrder); const isOrderCancelled = await this._orderFilledCancelledFetcher.isOrderCancelledAsync(orderHash); @@ -134,6 +134,7 @@ export class OrderStateUtils { isValid: true, orderHash, orderRelevantState, + transactionHash, }; return orderState; } else { @@ -141,6 +142,7 @@ export class OrderStateUtils { isValid: false, orderHash, error: orderValidationResult.error, + transactionHash, }; return orderState; } |