Opium.Exchange API Reference
Description
Following specification describes the way to connect to opium.exchange relayer of Opium Protocol via REST API and Socket.io endpoint.
REST API allows to fetch login message for authentication, load currently supported products, tokens and maturities, user tokens balance and allowance state, form, sign and cancel orders, etc.
Socket.io endpoint allows to reactively receive updates on current orderbook status and charts. Also using access token it's possible to receive updates on statuses of user's orders, performed trades and current active positions.
Socket.io
socket.io
specification which could be found
here
Authorization
Some of the HTTP and Socket.io endpoints are protected (user-based), thus require to include access token within a request and connection.
Contact: info@opium.team
Version: 1.0.0
Login
Login related endpoints
Returns login (access token) message to sign
Ok
Aggregator
Right now used only to retrieve last synced block
Returns lastSyncedBlock
Success
Meta
Some meta information about backend
Get current configuration
OK
Wallet
Crypto wallet related endpoints
Orderbook
Orderbook related endpoints
Form an order, so it can be used for creating a transaction
To form an EIP712 order message, send order data to /orderbook/formOrder and receive message data and id. Sign EIP712 message and provide id to /orderbook/orders
(no description)
OK
Unauthorized
Forbidden
Unprocessable entity
Too many requests
Accepts signed orders and pushes them to matching engine
(no description)
Created
Unauthorized
Forbidden
Not found
Conflict
Precondition Failed
Unprocessable entity
Too many requests
Get information about order
(no description)
(no description)
(no description)
(no description)
OK
Unauthorized
Forbidden
Unprocessable entity
Cancel order that was not matched
(no description)
(no description)
Accepted
Unauthorized
Forbidden
Not found
Unprocessable entity
Ticker
Tickers related endpoints
Trades
Trades related endpoints
GET /trades/all/address
(no description)
OK
No Content
Forbidden
Orders
Orders related endpoints
GET /orders/all/address
(no description)
OK
No Content
Forbidden
default
Get information about certain type of derivative
(no description)
OK
Query is not provided
Get wallet balance
(no description)
OK
No Content
Tickers
GET /tickers
(no description)
(no description)
(no description)
(no description)
(no description)
(no description)
OK
No content
GET /tickers/data/{hash}
(no description)
OK
Not found
GET /tickers/derivatives
(no description)
OK
No Content