@0x:contracts-exchange Added getOrdersInfo back into the exchange

This commit is contained in:
Alex Towle
2019-08-28 16:42:29 -07:00
parent 13d5a5e2ec
commit e64e0d7421
2 changed files with 20 additions and 0 deletions

View File

@@ -367,4 +367,20 @@ contract MixinWrapperFunctions is
}
return fillResults;
}
/// @dev Fetches information for all passed in orders.
/// @param orders Array of order specifications.
/// @return Array of OrderInfo instances that correspond to each order.
function getOrdersInfo(LibOrder.Order[] memory orders)
public
view
returns (LibOrder.OrderInfo[] memory)
{
uint256 ordersLength = orders.length;
LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](ordersLength);
for (uint256 i = 0; i != ordersLength; i++) {
ordersInfo[i] = getOrderInfo(orders[i]);
}
return ordersInfo;
}
}

View File

@@ -215,6 +215,10 @@ export class ExchangeWrapper {
const orderInfo = await this._exchange.getOrderInfo.callAsync(signedOrder);
return orderInfo;
}
public async getOrdersInfoAsync(signedOrders: SignedOrder[]): Promise<OrderInfo[]> {
const ordersInfo = (await this._exchange.getOrdersInfo.callAsync(signedOrders)) as OrderInfo[];
return ordersInfo;
}
public async batchMatchOrdersAsync(
signedOrdersLeft: SignedOrder[],
signedOrdersRight: SignedOrder[],