Guide
Limit Order API Integration Documentation
Overview
This document provides comprehensive integration guidelines for the OpenOcean Limit Order API, based on the implementation in LimitOrder.js. The API allows users to create, manage, and cancel limit orders for token trading on supported blockchain networks.
API Base Information
Base URL
View the current supported chains here.
Token Configuration
Token Approval
Before creating a limit order, users must approve the contract to spend their tokens:
API Endpoints
1. Create Limit Order
Endpoint: POST /v2/{chainId}/limit-order
URL Parameters:
chainId: The blockchain network ID (e.g., 8453 for Base)
Request Body:
Field Descriptions:
makerAsset: Address of the token being soldtakerAsset: Address of the token being boughtmakerAmount: Amount of maker token (in smallest units)takerAmount: Amount of taker token (in smallest units)expireTime: Order expiration timestamp (milliseconds)signature: signMessageorderMaker: User's wallet address
Response:
2. Cancel Limit Order
Endpoint: POST /v2/{chainId}/limit-order/cancelLimitOrder
Request Body:
Field Descriptions:
orderHash: Hash of the order to cancelsignature: signMessage
Response:
3. Get User Orders
Endpoint: GET /v2/{chainId}/limit-order/address/{address}
URL Parameters:
chainId: The blockchain network IDaddress: User's wallet address
Query Parameters:
page: Page number (default: 1)limit: Number of orders per page (default: 100)statuses: Array of order statuses to filter [1,2,5]sortBy: Sort field (default: createDateTime)exclude: Exclude certain orders (default: 0)
Example URL:
Response:
Request/Response Formats
Order Status Codes
1
Pending
Order is pending execution
2
Active
Order is active and can be filled
3
Filled
Order has been completely filled
4
Cancelled
Order has been cancelled
5
Expired
Order has expired
Message Signing Format
For Order Creation:
For Order Cancellation:
Signature Generation
Integration Examples
Complete Order Creation Flow
Order Management
Support
For technical support or questions about the API:
Check the OpenOcean Documentation
Contact the development team
Review error logs and API responses
Last updated