accountSubscribe
Subscribe to an account to receive notifications when the lamports or data for a given account public key changes. Returns a subscription ID that can be used to unsubscribe.
Authorizations
Body
jsonrpcstring · enumRequiredExample:
JSON-RPC protocol version
2.0
Possible values: idstringRequiredExample:
Request identifier
1
methodstring · enumRequiredExample:
The method name
accountSubscribe
Possible values: Responses
101
WebSocket notification
application/json
200
Subscription successful
application/json
post
POST / HTTP/1.1
Host: rpc.solanavibestation.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 110
{
"jsonrpc": "2.0",
"id": 1,
"method": "accountSubscribe",
"params": [
"CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12"
]
}
{
"jsonrpc": "2.0",
"method": "accountNotification",
"params": {
"result": {
"context": {
"slot": 123456789
},
"value": {
"data": [
"",
"base64"
],
"executable": false,
"lamports": 1000000000,
"owner": "11111111111111111111111111111111",
"rentEpoch": 361
}
},
"subscription": 23784
}
}
Last updated