aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/utils
diff options
context:
space:
mode:
authorGreg Hysen <greg.hysen@gmail.com>2018-05-17 07:57:02 +0800
committerGreg Hysen <greg.hysen@gmail.com>2018-05-19 08:01:06 +0800
commit636dae6a797ecdbdea186c1590ee35eec4521f41 (patch)
tree5fe9e188dad0c2aae34cdaf253b94f08aa7476c4 /packages/contracts/src/utils
parentc8f65a1bf9c664b21ee21b08a3a91881d7f3dce1 (diff)
downloaddexon-sol-tools-636dae6a797ecdbdea186c1590ee35eec4521f41.tar
dexon-sol-tools-636dae6a797ecdbdea186c1590ee35eec4521f41.tar.gz
dexon-sol-tools-636dae6a797ecdbdea186c1590ee35eec4521f41.tar.bz2
dexon-sol-tools-636dae6a797ecdbdea186c1590ee35eec4521f41.tar.lz
dexon-sol-tools-636dae6a797ecdbdea186c1590ee35eec4521f41.tar.xz
dexon-sol-tools-636dae6a797ecdbdea186c1590ee35eec4521f41.tar.zst
dexon-sol-tools-636dae6a797ecdbdea186c1590ee35eec4521f41.zip
The OrderInfo struct is now returned by the getOrderInfo function
Diffstat (limited to 'packages/contracts/src/utils')
-rw-r--r--packages/contracts/src/utils/exchange_wrapper.ts8
-rw-r--r--packages/contracts/src/utils/types.ts6
2 files changed, 9 insertions, 5 deletions
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts
index 5b026fce0..7032db386 100644
--- a/packages/contracts/src/utils/exchange_wrapper.ts
+++ b/packages/contracts/src/utils/exchange_wrapper.ts
@@ -9,7 +9,7 @@ import { constants } from './constants';
import { formatters } from './formatters';
import { LogDecoder } from './log_decoder';
import { orderUtils } from './order_utils';
-import { AssetProxyId, SignedOrder, SignedTransaction } from './types';
+import { AssetProxyId, OrderInfo, SignedOrder, SignedTransaction } from './types';
export class ExchangeWrapper {
private _exchange: ExchangeContract;
@@ -225,10 +225,8 @@ export class ExchangeWrapper {
const filledAmount = new BigNumber(await this._exchange.filled.callAsync(orderHashHex));
return filledAmount;
}
- public async getOrderInfoAsync(
- signedOrder: SignedOrder,
- ): Promise<[number /* orderStatus */, string /* orderHash */, BigNumber /* orderTakerAssetAmountFilled */]> {
- const orderInfo: [number, string, BigNumber] = await this._exchange.getOrderInfo.callAsync(signedOrder);
+ public async getOrderInfoAsync(signedOrder: SignedOrder): Promise<OrderInfo> {
+ const orderInfo = (await this._exchange.getOrderInfo.callAsync(signedOrder)) as OrderInfo;
return orderInfo;
}
public async matchOrdersAsync(
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index 0e3b2c9a8..518776214 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -174,3 +174,9 @@ export interface TransferAmountsByMatchOrders {
feeReceivedLeft: BigNumber;
feeReceivedRight: BigNumber;
}
+
+export interface OrderInfo {
+ orderStatus: number;
+ orderHash: string;
+ orderFilledAmount: BigNumber;
+}