Solana
Solana
Solana
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
blockSubscribe opens a Solana PubSub subscription that pushes a full block object — its transactions, rewards paid in SOL (lamports), and metadata — each time a new block is produced. Solana confirms a block roughly every 400ms at very high throughput, so this is a firehose of the freshest on-chain state. You can take every block with the "all" filter or narrow to blocks that touch a given account or program. The matching JSON-RPC endpoint is https://solana.therpc.io/YOUR_API_KEY, and you stop the stream by passing the returned subscription id to blockUnsubscribe.
getBlock calls.{ mentionsAccountOrProgram: pubkey } — for example a Jupiter or Raydium program id.transactionDetails ("signatures" or "none") and showRewards: false for a lighter, lower-bandwidth feed.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | filter | object | Oui | "all" | { mentionsAccountOrProgram: pubkey }. |
| 2 | config | object | Non | Options: commitment, encoding, transactionDetails, showRewards, maxSupportedTransactionVersion. |
| Type | Description |
|---|---|
| integer | A numeric subscription id. blockNotification pushes a block object like getBlock. |
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
--rpc-pubsub-enable-block-subscription flag and providers often gate it. Check availability before you build on it.maxSupportedTransactionVersion: 0 in the config, or versioned (v0) transactions in a block will cause the notification to error out.wss PubSub connection, and you stop it by passing the subscription id to blockUnsubscribe.