Solana
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Solana
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
getBlocks returns the list of slots that actually produced a confirmed block between a startSlot and an endSlot on Solana, the high-throughput Proof-of-Stake chain whose native token is SOL. Because Solana advances at roughly 400 ms per slot and not every slot yields a block, this method is how indexers find the real, non-empty slots to fetch rather than guessing slot numbers. The result is a plain array of u64 slot numbers; any slot in the range that is missing from the array was skipped. If you omit endSlot, it defaults to the latest slot. Call it against https://solana.therpc.io/YOUR_API_KEY as a JSON-RPC 2.0 POST, then feed each returned slot into getBlock.
getBlock on a slot that has no data.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | startSlot | integer | Sim | First slot of the range. |
| 2 | endSlot | integer | Não | Last slot of the range (defaults to the latest). |
| 3 | config | object | Não | Options: commitment. |
| Tipo | Descrição |
|---|---|
| array | Array of u64 confirmed slot numbers in the range. |
| Código | Mensagem | Causa |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32004 | Block not available for slot | The slot is not in this node's ledger (purged, skipped, or behind first available block). Use an archival endpoint for deep history. |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
startSlot and endSlot is capped (around 500,000 slots). For wider history, chunk the request into successive ranges instead of asking for the whole span at once.