aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts22
-rw-r--r--packages/contract-wrappers/src/types.ts4
2 files changed, 24 insertions, 2 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts
index 6857dcd69..1e06d191c 100644
--- a/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/order_validator_wrapper.ts
@@ -5,7 +5,7 @@ import { ContractAbi } from 'ethereum-types';
import * as _ from 'lodash';
import { artifacts } from '../artifacts';
-import { OrdersAndTradersInfo } from '../types';
+import { OrderAndTraderInfo, OrdersAndTradersInfo } from '../types';
import { assert } from '../utils/assert';
import { ContractWrapper } from './contract_wrapper';
@@ -26,7 +26,25 @@ export class OrderValidatorWrapper extends ContractWrapper {
super(web3Wrapper, networkId);
}
/**
- * Get and object conforming to OrdersAndTradersInfo containing on-chain information of the provided orders and addresses
+ * Get and object conforming to OrderAndTraderInfo containing on-chain information of the provided order and address
+ * @return OrderAndTraderInfo
+ */
+ public async getOrderAndTraderInfoAsync(order: SignedOrder, takerAddress: string): Promise<OrderAndTraderInfo> {
+ assert.doesConformToSchema('order', order, schemas.signedOrderSchema);
+ assert.isETHAddressHex('takerAddress', takerAddress);
+ const OrderValidatorContractInstance = await this._getOrderValidatorContractAsync();
+ const orderAndTraderInfo = await OrderValidatorContractInstance.getOrderAndTraderInfo.callAsync(
+ order,
+ takerAddress,
+ );
+ const result = {
+ orderInfo: orderAndTraderInfo[0],
+ traderInfo: orderAndTraderInfo[1],
+ };
+ return result;
+ }
+ /**
+ * Get an object conforming to OrdersAndTradersInfo containing on-chain information of the provided orders and addresses
* @return OrdersAndTradersInfo
*/
public async getOrdersAndTradersInfoAsync(
diff --git a/packages/contract-wrappers/src/types.ts b/packages/contract-wrappers/src/types.ts
index efc102a33..e73a09fe3 100644
--- a/packages/contract-wrappers/src/types.ts
+++ b/packages/contract-wrappers/src/types.ts
@@ -204,3 +204,7 @@ export interface OrdersAndTradersInfo {
ordersInfo: OrderInfo[];
tradersInfo: TraderInfo[];
}
+export interface OrderAndTraderInfo {
+ orderInfo: OrderInfo;
+ traderInfo: TraderInfo;
+}