Solana
Solana
Solana
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
getSlot is a Solana JSON-RPC method that returns the current slot the node is processing on the chain that secures SOL. Solana advances roughly one slot every ~400ms, so this u64 is the live cursor of network time. You can pass an optional config object with a commitment (processed, confirmed, or finalized) and minContextSlot to control which view you get. Send it as a JSON-RPC 2.0 POST with positional params to https://solana.therpc.io/YOUR_API_KEY.
minContextSlot on later calls so they only run against a node that is at least this caught up.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | config | object | Non | Options: commitment, minContextSlot. |
| Type | Description |
|---|---|
| integer | u64 current slot. |
| 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. |
commitment: processed advances fastest but is least settled and can be rolled back, while finalized is the most settled. Choose the level that matches your tolerance.