Solana
accountSubscribe10 kredi
Subscribes to notifications when an account's lamports or data change (WebSocket).
Parametreler
| Ad | Tür | Açıklama |
|---|---|---|
| pubkey | string | Account public key (base-58). |
| config | Object | Optional configuration object. commitment: processed | confirmed | finalized (default finalized); encoding: base58 | base64 | base64+zstd | binary | jsonParsed (default binary); dataSlice: { offset, length } (not with jsonParsed). (isteğe bağlı) |
Dönüş değeri
Tür
integer
Subscription id (integer). Pass it to accountUnsubscribe; notifications arrive as accountNotification messages.
Kod örnekleri
wscat -c wss://holy-burned-sky-solana-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7
> {"jsonrpc":"2.0","id":1,"method":"accountSubscribe","params":["CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12",{"encoding":"jsonParsed","commitment":"finalized"}]}