POST
https://prv.gateway.indexer.biya.io
/
injective_spot_exchange_rpc.InjectiveSpotExchangeRPC
/
StreamOrdersHistory
StreamOrdersHistory
curl --request POST \
  --url https://prv.gateway.indexer.biya.io/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamOrdersHistory \
  --header 'Content-Type: application/json' \
  --data '
{
  "subaccount_id": "<string>",
  "market_id": "<string>",
  "order_types": [
    {}
  ],
  "direction": "<string>",
  "state": "<string>"
}
'
Stream updates to historical orders of a spot Market. This endpoint sends real-time updates for historical order changes.
This is a streaming endpoint that requires WebSocket or Server-Sent Events support. The connection will remain open and receive updates in real-time.
subaccount_id
string
required
Subaccount ID (required)
market_id
string
Market ID (optional)
order_types
array
Array of order types (optional)
direction
string
Order direction (optional)
state
string
Order state (optional)

Response

The response is a stream of StreamOrdersHistoryResponse objects:
{
  "order": {
    "order_hash": "string",
    "market_id": "string",
    "is_active": "boolean",
    "subaccount_id": "string",
    "execution_type": "string",
    "order_type": "string",
    "price": "string",
    "trigger_price": "string",
    "quantity": "string",
    "filled_quantity": "string",
    "state": "string",
    "created_at": "number",
    "updated_at": "number",
    "direction": "string",
    "tx_hash": "string",
    "cid": "string"
  },
  "operation_type": "string",
  "timestamp": "number"
}

cURL Example

gRPC-Web streaming endpoints require WebSocket support. Standard curl cannot handle streaming responses.
Using grpcurl:
grpcurl -plaintext -d '{
  "subaccount_id": "0x...",
  "market_id": "0x..."
}' \
  localhost:8088 \
  injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamOrdersHistory
Using websocat:
echo '{"subaccount_id": "0x...", "market_id": "0x..."}' | \
  websocat ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamOrdersHistory
Using wscat:
wscat -c ws://localhost:8088/injective_spot_exchange_rpc.InjectiveSpotExchangeRPC/StreamOrdersHistory
# Then send: {"subaccount_id": "0x...", "market_id": "0x..."}