A WebSocket server implementation that broadcasts messages to both HTTP endpoints and WebSocket clients.
Connect to the WebSocket server to receive real-time broadcast messages:
wss://compactx-disseminator.com/ws
Send messages to be broadcasted to all connected clients:
POST https://compactx-disseminator.com/broadcast
Example request:
{
"chainId": "1",
"compact": {
"arbiter": "0x1234567890123456789012345678901234567890",
"sponsor": "0x1234567890123456789012345678901234567890",
"nonce": "0x1234567890123456789012345678901234567890123456789012345678901234",
"expires": "1000000",
"id": "23499701752147396106288076033874150844871292959348239827687418423535067463557",
"amount": "1000000000000000000",
"mandate": {
"chainId": 1,
"tribunal": "0x1234567890123456789012345678901234567890",
"recipient": "0x1234567890123456789012345678901234567890",
"expires": "1000000",
"token": "0x1234567890123456789012345678901234567890",
"minimumAmount": "1000000000000000000",
"baselinePriorityFee": "1000000000",
"scalingFactor": "1000000000",
"salt": "0x1234567890123456789012345678901234567890123456789012345678901234"
}
},
"sponsorSignature": null,
"allocatorSignature": "0x1234567890123456789012345678901234567890123456789012345678901234123456789012345678901234567890123456789012345678901234567890123456",
"context": {
"dispensation": "1000000000000000000",
"dispensationUSD": "$1000.00",
"spotOutputAmount": "1000000000000000000",
"quoteOutputAmountDirect": "1000000000000000000",
"quoteOutputAmountNet": "990000000000000000",
"deltaAmount": "-95889553740141",
"witnessTypeString": "test",
"witnessHash": "0x1234567890123456789012345678901234567890123456789012345678901234",
"claimHash": "0x1234567890123456789012345678901234567890123456789012345678901234"
}
}
{
"success": true,
"results": {
"http": {
"total": 1,
"failures": 0
},
"websocket": {
"total": 2,
"failures": 0
}
}
}
You can test the WebSocket connection using wscat:
wscat -c wss://compactx-disseminator.com/ws