Messages
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": {
"channel": "fundingPayments",
"user": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}
}"{\"jsonrpc\":\"2.0\",\"method\":\"event\",\"params\":{\"channel\":\"fundingPayments@0x...\",\"data\":{}}}"Accounts Channels
funding
WSS
wss://api.hotstuff.trade/ws
/
Subscribe to real-time funding events.
WebSocket URL:
wss://api.hotstuff.trade/ws
Channel: fundingPayments
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
jsonrpc | string | Yes | JSON-RPC version | "2.0" |
id | string | Yes | Request identifier for tracking | "1" |
method | string | Yes | Action to perform | "subscribe" or "unsubscribe" |
channel | string | Yes | Channel name | "fundingPayments" |
user | string | Yes | User wallet address | "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" |
Supported Methods
subscribe- Subscribe to user order updatesunsubscribe- Unsubscribe from user order updates
Authentication
This endpoint requires a valid user wallet address to receive account-specific order updates.Example Request
{
"jsonrpc": "2.0",
"id": "1",
"method": "subscribe",
"params": {
"channel": "fundingPayments",
"user": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}
}
WebSocket Client Examples
Python
import websocket
import json
def on_message(ws, message):
print(f"Received: {message}")
def on_open(ws):
subscribe_msg = {
"jsonrpc": "2.0",
"id": "1",
"method": "subscribe",
"params": {
"channel": "fundingPayments",
"user": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}
}
ws.send(json.dumps(subscribe_msg))
ws = websocket.WebSocketApp("wss://api.hotstuff.trade/ws",
on_message=on_message,
on_open=on_open)
ws.run_forever()
JavaScript
const ws = new WebSocket("wss://api.hotstuff.trade/ws");
ws.onopen = function () {
const subscribeMsg = {
jsonrpc: "2.0",
id: "1",
method: "subscribe",
params: {
channel: "fundingPayments",
user: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
},
};
ws.send(JSON.stringify(subscribeMsg));
};
ws.onmessage = function (event) {
console.log("Received:", event.data);
};
Messages
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": {
"channel": "fundingPayments",
"user": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}
}"{\"jsonrpc\":\"2.0\",\"method\":\"event\",\"params\":{\"channel\":\"fundingPayments@0x...\",\"data\":{}}}"Subscription request
type:object
Send subscribe/unsubscribe request
Funding channel event
type:string
Server-pushed JSON-RPC event (no Example Response on source page; shape follows other account channels).
⌘I