@0x:contracts-exchange
Added getOrdersInfo
back into the exchange
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
@@ -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[],
|
||||
|
Reference in New Issue
Block a user