TarifsGitHubTableau de bord

Solana

blockSubscribe10 crédits

Subscribes to notifications when a new block reaches confirmed or finalized commitment (WebSocket; unstable, needs a node with block subscription enabled).

Réseau: solana

Paramètres

NomTypeDescription
filterstring | Object"all" for every block, or { mentionsAccountOrProgram: <pubkey> } for blocks with a transaction mentioning that address.
configObjectOptional configuration object. commitment: confirmed | finalized (default finalized; processed is not accepted); encoding: base64 | base58 | json | jsonParsed (default base64); transactionDetails: full | accounts | signatures | none (default full); maxSupportedTransactionVersion: number; showRewards: boolean. (facultatif)

Valeur renvoyée

Type

integer

Subscription id (integer). Pass it to blockUnsubscribe; notifications arrive as blockNotification messages.

Exemples de code

wscat -c wss://holy-burned-sky-solana-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7
> {"jsonrpc":"2.0","id":1,"method":"blockSubscribe","params":[{"mentionsAccountOrProgram":"LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op"},{"commitment":"confirmed","encoding":"base64","transactionDetails":"full","maxSupportedTransactionVersion":0,"showRewards":true}]}