diff options
author | Remco Bloemen <remco@wicked.ventures> | 2018-05-22 20:52:06 +0800 |
---|---|---|
committer | Remco Bloemen <remco@wicked.ventures> | 2018-05-22 21:15:14 +0800 |
commit | b39f75a2e328bc48e99a705973a7b364f3866719 (patch) | |
tree | 63e4fe44cd411b016ccc75ff6e420e43c8834818 /packages/contracts | |
parent | 1dad14f8ea0e463a699d5b2d5f8ccd9532b2ef19 (diff) | |
download | dexon-sol-tools-b39f75a2e328bc48e99a705973a7b364f3866719.tar dexon-sol-tools-b39f75a2e328bc48e99a705973a7b364f3866719.tar.gz dexon-sol-tools-b39f75a2e328bc48e99a705973a7b364f3866719.tar.bz2 dexon-sol-tools-b39f75a2e328bc48e99a705973a7b364f3866719.tar.lz dexon-sol-tools-b39f75a2e328bc48e99a705973a7b364f3866719.tar.xz dexon-sol-tools-b39f75a2e328bc48e99a705973a7b364f3866719.tar.zst dexon-sol-tools-b39f75a2e328bc48e99a705973a7b364f3866719.zip |
Add CancelOrder and MatchOrder types
Diffstat (limited to 'packages/contracts')
-rw-r--r-- | packages/contracts/src/utils/order_utils.ts | 6 | ||||
-rw-r--r-- | packages/contracts/src/utils/types.ts | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/packages/contracts/src/utils/order_utils.ts b/packages/contracts/src/utils/order_utils.ts index 7a482ad9e..8adc6b735 100644 --- a/packages/contracts/src/utils/order_utils.ts +++ b/packages/contracts/src/utils/order_utils.ts @@ -4,7 +4,7 @@ import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; import { crypto } from './crypto'; -import { OrderStruct, SignatureType, SignedOrder, UnsignedOrder } from './types'; +import { CancelOrder, MatchOrder, OrderStruct, SignatureType, SignedOrder, UnsignedOrder } from './types'; export const orderUtils = { createFill: (signedOrder: SignedOrder, takerAssetFillAmount?: BigNumber) => { @@ -15,7 +15,7 @@ export const orderUtils = { }; return fill; }, - createCancel(signedOrder: SignedOrder, takerAssetCancelAmount?: BigNumber) { + createCancel(signedOrder: SignedOrder, takerAssetCancelAmount?: BigNumber): CancelOrder { const cancel = { order: orderUtils.getOrderStruct(signedOrder), takerAssetCancelAmount: takerAssetCancelAmount || signedOrder.takerAssetAmount, @@ -80,7 +80,7 @@ export const orderUtils = { const orderHashHex = `0x${orderHashBuff.toString('hex')}`; return orderHashHex; }, - createMatchOrders(signedOrderLeft: SignedOrder, signedOrderRight: SignedOrder) { + createMatchOrders(signedOrderLeft: SignedOrder, signedOrderRight: SignedOrder): MatchOrder { const fill = { left: orderUtils.getOrderStruct(signedOrderLeft), right: orderUtils.getOrderStruct(signedOrderRight), diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts index 8d81adece..ef86b4f38 100644 --- a/packages/contracts/src/utils/types.ts +++ b/packages/contracts/src/utils/types.ts @@ -197,3 +197,15 @@ export interface ProxyData { tokenAddress?: string; data?: any; } + +export interface CancelOrder { + order: OrderStruct; + takerAssetCancelAmount: BigNumber; +} + +export interface MatchOrder { + left: OrderStruct; + right: OrderStruct; + leftSignature: string; + rightSignature: string; +} |