aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-07-11 11:55:28 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-07-18 03:18:16 +0800
commit02ddfa07a70cd0ac6a3061eca6067ff296f4fa1d (patch)
tree3085f776bb91f3f061c9a808a3b217cae87ff2e7 /packages
parent502287868073eecdea08b3160bd41ef78f5d8583 (diff)
downloaddexon-sol-tools-02ddfa07a70cd0ac6a3061eca6067ff296f4fa1d.tar
dexon-sol-tools-02ddfa07a70cd0ac6a3061eca6067ff296f4fa1d.tar.gz
dexon-sol-tools-02ddfa07a70cd0ac6a3061eca6067ff296f4fa1d.tar.bz2
dexon-sol-tools-02ddfa07a70cd0ac6a3061eca6067ff296f4fa1d.tar.lz
dexon-sol-tools-02ddfa07a70cd0ac6a3061eca6067ff296f4fa1d.tar.xz
dexon-sol-tools-02ddfa07a70cd0ac6a3061eca6067ff296f4fa1d.tar.zst
dexon-sol-tools-02ddfa07a70cd0ac6a3061eca6067ff296f4fa1d.zip
Add getOrdersInfo function
Diffstat (limited to 'packages')
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol16
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol8
2 files changed, 24 insertions, 0 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol
index a16d2f897..d420f7e85 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol
+++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol
@@ -529,4 +529,20 @@ contract MixinWrapperFunctions is
cancelOrder(orders[i]);
}
}
+
+ /// @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 length = orders.length;
+ LibOrder.OrderInfo[] memory ordersInfo = new LibOrder.OrderInfo[](length);
+ for (uint256 i = 0; i < length; i++) {
+ ordersInfo[i] = getOrderInfo(orders[i]);
+ }
+ return ordersInfo;
+ }
}
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol b/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol
index ad7a56a06..56a533646 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol
+++ b/packages/contracts/src/2.0.0/protocol/Exchange/interfaces/IWrapperFunctions.sol
@@ -149,4 +149,12 @@ contract IWrapperFunctions {
/// @param orders Array of order specifications.
function batchCancelOrders(LibOrder.Order[] memory orders)
public;
+
+ /// @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);
}