aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsuan Lee <boczeratul@gmail.com>2019-03-11 15:24:21 +0800
committerHsuan Lee <boczeratul@gmail.com>2019-03-11 15:24:21 +0800
commit09a2c982da74b347f2eb441f1f5cf593acb7ac88 (patch)
tree5662fdd317c389a6270a5819c4853e8ef9be60f7
parent6c09c43425f7d7ada8e034cf77ba87f97e82d2b0 (diff)
downloaddexon-0x-contracts-dev.tar.gz
dexon-0x-contracts-dev.tar.zst
dexon-0x-contracts-dev.zip
Add orderbook contract interfaceHEADdev
-rw-r--r--contracts/exchange/contracts/src/interfaces/IOrderbook.sol37
1 files changed, 37 insertions, 0 deletions
diff --git a/contracts/exchange/contracts/src/interfaces/IOrderbook.sol b/contracts/exchange/contracts/src/interfaces/IOrderbook.sol
index f42517087..74179d8aa 100644
--- a/contracts/exchange/contracts/src/interfaces/IOrderbook.sol
+++ b/contracts/exchange/contracts/src/interfaces/IOrderbook.sol
@@ -16,7 +16,44 @@
*/
pragma solidity ^0.4.24;
+pragma experimental ABIEncoderV2;
+
+import "@0x/contracts-exchange-libs/contracts/src/LibOrder.sol";
+import "@0x/contracts-exchange-libs/contracts/src/LibFillResults.sol";
contract IOrderbook {
+
+ /// @dev Place a limit order into orderbook.
+ /// @param order Order struct containing order specifications.
+ /// @return Amounts filled and fees paid by maker and taker.
+ function placeLimitOrder(
+ LibOrder.Order memory order
+ )
+ public
+ returns (LibFillResults.FillResults memory fillResults);
+
+ /// @dev Fill orders in orderbook that match desired specifications.
+ /// But unlike 'placeLimitOrder', remaining amount will not be put into orderbook.
+ /// @param order Order struct containing order specifications.
+ /// @return Amounts filled and fees paid by maker and taker.
+ function placeMarketOrder(
+ LibOrder.Order memory order
+ )
+ public
+ returns (LibFillResults.FillResults memory fillResults);
+
+ /// @dev Get a list of valid orders on orderbook of a specific pair.
+ /// @param makerAssetData Maker asset data of the pair.
+ /// @param takerAssetData Taker asset data of the pair.
+ /// @param limit Maximum number of orders to be returned.
+ /// @return Orders of the pair, sorted by price.
+ function getOrders(
+ bytes makerAssetData,
+ bytes takerAssetData,
+ uint8 limit
+ )
+ public
+ view
+ returns (LibOrder.Order[] memory orders);
}