Solana
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Solana
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
getBlock is the core history method on Solana, the high-throughput Proof-of-History and Proof-of-Stake chain whose native token is SOL. Given a slot number, it returns the confirmed block produced at that slot: its blockhash and previousBlockhash, parentSlot, the full list of transactions, any validator rewards paid in lamports (1 SOL = 1,000,000,000 lamports), the blockTime, and the blockHeight. Because Solana advances at roughly 400 ms per slot, blocks accumulate fast, so most callers walk slots returned by getBlocks and pull each one through getBlock. Send the request to https://solana.therpc.io/YOUR_API_KEY as a standard JSON-RPC 2.0 POST with positional params. If the slot was skipped or has been purged from the node ledger, the result is null rather than an error.
transactionDetails: signatures, so you get just the signature list for a slot without downloading full transaction payloads.encoding: jsonParsed.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | slot | integer | نعم | Slot number to fetch. |
| 2 | config | object | لا | Options: commitment (confirmed|finalized), encoding (json|jsonParsed|base58|base64), transactionDetails (full|accounts|signatures|none), maxSupportedTransactionVersion (0), rewards (bool). |
| النوع | الوصف |
|---|---|
| object | { blockhash, previousBlockhash, parentSlot, transactions, rewards, blockTime, blockHeight } or null. |
| الكود | الرسالة | السبب |
|---|---|---|
-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. |
maxSupportedTransactionVersion: 0. Modern Solana blocks contain versioned transactions (address lookup tables), and without this option the call errors on any block that includes one.transactionDetails (accounts, signatures, or none) and rewards: false whenever you do not need the heavy fields.null. For blocks older than the node's retention window, use an archival endpoint instead of treating the null as a failure.