Enclave Cross’ streaming WebSocket API to get public price updates and an account’s fill and order status updates.
These channels can be subscribed to without authenticating.
The latest prices for supported price pairs. All messages will have the update type. The data field will contain the following:
{"op": "subscribe", "channel": "prices"}
pair
base
- The base coin of the currency pairquote
- The quote coin of the currency pairprice
- The price for one base coin in quote coinstime
- The time the latest price was updatedExample price update message:
{
"type": "update",
"channel": "prices",
"data": {
"pair": {
"base": "AVAX",
"quote": "USDC"
},
"price": "13.879000015258789",
"time": "2022-11-15T16:18:12.049289984Z"
}
}
These channels require the user to first authenticate with an API key.
The order channel streams order status changes for your account. You can subscribe with the following message after logging in:
{"op": "subscribe", "channel": "orders"}
You can expect a message to be sent when the following occur:
Example response:
{
"type": "update",
"channel": "orders",
"data": {
"accountId": "99627194178829804007",
"orderCategory": "CN",
"customerOrderId": "8649352166794",
"internalOrderId": "1",
"pair": {
"base": "AVAX",
"quote": "USDC"
},
"side": "SELL",
"isCancelled": false,
"isFilled": false,
"size": "0.1",
"filledSize": "0",
"remainingSize": "0.1",
"exchangedSize": "0",
"updatedAt": "2022-11-15T19:58:21.810627137Z",
}
}
The fills channel streams order fills for your account. You can subscribe with the following message after logging in: