- Client send requests to server as an URL-encoded JSON array, prefixed with
OpenCEX_request_body=
- Void requests methods return null value
- Requests are sent to server in batch, which is executed in parallel
- Maximum batch size = 10 requests
- In case of error, server returns the first failing request
- If all requests succeed, server returns array of returned results
- Authentication is cookie-based
- Captcha-protected request method have an extra
string captcha
argument - Arguments are passed as JSON dictionary, and the order doesn't matter
- Example request:
[{"method": "login", "username": "example", "password": "12345", "captcha": "examplecaptchachallenge"}]
- Example success response:
{"status": "success", "returns": ["an example returned string", 1]}
- Example error response:
{"status": "error", "reason": "Unexpected internal server error (should not reach here)!"}
- Clients must use the POST request method
- Clients must pass
Origin: https://exchange.polyeubitoken.com
header - Clients can send requests to any URL they want
opencex-net-dev.herokuapp.com
andopencex-net-prod.herokuapp.com
are the two servers clients can send requests to- Server sends CORS headers to clients
- All SafeUint values are returned to clients as base-10 string
- Clients pass SafeUint values to server as base-10 or hexadecimal strings
- SafeUint values are arbitary-precision unsigned integers.
PAYABLE - this request method credits or debit customer funds
MARKET - this request method have an impact on the underlying market
AUTHENTICATED - this request method require authentication (e.g trading)
CAPTCHA - this request method requires captcha (e.g register)
PUBLIC - this request method requires no authentication (e.g bid-ask spread)
NODB - this request method does not perform database updates (e.g price checking)
COOKIES - this request method sends session cookies
Credits test shitcoins to the user's trading account (hidden on prod server)
Cancels an order with a given order id
void place_order(string primary, string secondary, SafeUint price, SafeUint amount, int fill_mode, bool buy) AUTHENTICATED PAYABLE MARKET
Places an order
The base/quote part of the trading pair (e.g Dai/PolyEUBI)
The maximum buy price/minimum sell price
The amount of token to buy or sell
The order fill mode (0 - limit, 1 - immediate or cancel, 2 - fill or kill)
True for buy orders, false for sell orders
Gets the bid and ask prices for a trading pair
Tells OpenCEX.NET to check deposit address for deposited funds, and credit them to the customer's account if they are found.
The name of the token the user want to finalize
Returns the user's balances
Returns the user's username
Returns the deposit address for MintME, MATIC, and BNB
Logs the user in
NOTE: renember is intentionally mispelled to maintain frontend compartiability
Registers a new trading account
Logs the user out of their active session
array([string, string, SafeUint, SafeUint, SafeUint, ulong, bool]) load_active_orders() AUTHENTICATED NODB
Returns the user's active orders
array([SafeUint x, SafeUint o, SafeUint h, SafeUint l, SafeUint c]) get_chart(string primary, string secondary) NODB
Returns the candlestick chart data for the last 60 trading days.
Withdraws funds from client's account, or withdraw liquidity from Uniswap.NET liquidity pool
void mint_lp(string primary, string secondary, SafeUint amount0, SafeUint amount1) AUTHENTICATED PAYABLE MARKET
Adds liquidity to an Uniswap.NET liquidity pool
The amount of base tokens to add to liquidity pool
The amount of quote tokens to add to liquidity pool