diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-26 04:53:35 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-26 04:53:35 +0800 |
commit | e55d8802e10afd20791aafd2b0958b674f9c0408 (patch) | |
tree | 2098b97d44c3ebad6d62035628c1819927f1451f /packages | |
parent | 3adc6b6daa16bb1dc80a8c4109b0bed56f937ea0 (diff) | |
download | dexon-sol-tools-e55d8802e10afd20791aafd2b0958b674f9c0408.tar dexon-sol-tools-e55d8802e10afd20791aafd2b0958b674f9c0408.tar.gz dexon-sol-tools-e55d8802e10afd20791aafd2b0958b674f9c0408.tar.bz2 dexon-sol-tools-e55d8802e10afd20791aafd2b0958b674f9c0408.tar.lz dexon-sol-tools-e55d8802e10afd20791aafd2b0958b674f9c0408.tar.xz dexon-sol-tools-e55d8802e10afd20791aafd2b0958b674f9c0408.tar.zst dexon-sol-tools-e55d8802e10afd20791aafd2b0958b674f9c0408.zip |
Rework OrderState to have more simple definition
Diffstat (limited to 'packages')
-rw-r--r-- | packages/instant/src/types.ts | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/packages/instant/src/types.ts b/packages/instant/src/types.ts index ad8794c94..63b49cb26 100644 --- a/packages/instant/src/types.ts +++ b/packages/instant/src/types.ts @@ -16,22 +16,14 @@ export enum OrderProcessState { FAILURE = 'Failure', } -interface RegularOrderState { +interface OrderStateWithoutTx { processState: OrderProcessState.NONE | OrderProcessState.AWAITING_SIGNATURE; } -interface ProcessingOrderState { - processState: OrderProcessState.PROCESSING; +interface OrderStateWithTx { + processState: OrderProcessState.PROCESSING | OrderProcessState.SUCCESS | OrderProcessState.FAILURE; txHash: string; } -interface SuccessfulOrderState { - processState: OrderProcessState.SUCCESS; - txHash: string; -} -interface FailureOrderState { - processState: OrderProcessState.FAILURE; - txHash: string; -} -export type OrderState = RegularOrderState | ProcessingOrderState | SuccessfulOrderState | FailureOrderState; +export type OrderState = OrderStateWithoutTx | OrderStateWithTx; export enum DisplayStatus { Present, |