accountSubscribe

accountSubscribe WebSocket Method

post

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 · enumRequired

JSON-RPC protocol version

Example: 2.0Possible values:
idstringRequired

Request identifier

Example: 1
methodstring · enumRequired

The method name

Example: accountSubscribePossible values:
Responses
101
WebSocket notification
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