OTC Endpoints
The endpoints below allow you to interact with OTC.
Contract Name
OTCTrade
Mainnet Addresses
Network | Contract Address |
Arbitrum |
|
Base |
|
Bitlayer |
|
Ethereum |
|
Polygon |
|
BSC |
|
Berachain Bartio |
|
Smart Contract Interface
1. Get the Nonce of the User's Order
Retrieve the nonce of a user's order, required for creating an order.
Function:
nonces(address maker) returns (uint256)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Creator Address |
Response Parameter
Parameter Name | Type | Description |
|
| User order nonce |
2. Calculate the Hash of the Order
Calculate the hash of an order, necessary when creating it.
Function:
hashOrder(Order memory order) returns (bytes32)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Created order |
Response Parameter
Parameter Name | Type | Description |
|
| User order hash |
3. Perform Multi-for-Multi Asset Swap
Use the signed order information to conduct a multi-asset swap.
Function:
swap(Order memory order_)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order information from centralized interface |
| Yes |
| Platform currency to pay as handling fee |
Order Structure
Parameter Name | Required | Type | Description |
| Yes |
| Address of the asset's owner (order signer) |
| Yes |
| Address of the person specifying the transaction |
| Yes |
| Array of swapped assets |
| Yes |
| Array of assets being swapped in |
| Yes |
| Deadline for the order validity period |
| Yes |
| Signed transaction data |
Asset Structure in Order
Parameter Name | Required | Type | Description |
| Yes |
| Token address |
| Yes |
| Token type (e.g., ERC20, ERC721) |
| Yes |
| ERC20 quantity or ERC721 ID |
4. Cancel Order
Allows the order creator to cancel an order.
Function:
cancelOrder(Order memory order)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| Order information from centralized interface |
5. Cancel Multiple Orders
Allows the order creator to cancel multiple orders in one call.
Function:
cancelMultipleOrders(Order[] memory orders)
Request Parameter
Parameter Name | Required | Type | Description |
| Yes |
| List of order information from centralized interface |
6. Cancel All Orders
Allows the creator to cancel all of their orders.
Function:
cancelAllOrders()
Request Parameters
This function does not take any parameters.
7. Obtain the Minimum Native Currency Fee
Returns the minimum platform fee charged in native currency.
Function:
feeMinAmount() returns (uint256)
Response Parameter
Parameter Name | Type | Description |
|
| Minimum native currency platform fee |
Last updated