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.
On Solana, every piece of state — wallets, SPL Token balances, and the data accounts owned by programs — lives in an account addressed by a base-58 public key. getAccountInfo reads one such account and returns its full on-chain state and metadata: the raw data, the owning program in owner, the SOL balance in lamports (1 SOL = 1,000,000,000 lamports), the executable flag, rentEpoch, and space. If the address has never been funded or created, the call returns a null value rather than an error. Send the request as a JSON-RPC 2.0 POST with positional params to https://solana.therpc.io/YOUR_API_KEY, choosing base64 for raw bytes or jsonParsed when a program (such as SPL Token) has a known layout you want decoded.
owner and lamports before interacting with it, so you know which program controls it and whether it is funded.encoding: "jsonParsed".null value) before you derive and initialize its PDA, avoiding a "create" instruction on something that is live.dataSlice: { offset, length } to save bandwidth when you read just a header or a single field.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | pubkey | string | Sim | Base-58 account address to read. |
| 2 | config | object | Não | Options: commitment, encoding (base58|base64|base64+zstd|jsonParsed), dataSlice {offset,length}, minContextSlot. |
| Tipo | Descrição |
|---|---|
| object | RpcResponse wrapping { data, executable, lamports, owner, rentEpoch, space } or null if the account does not exist. |
| 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). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
base58 encoding fails for account data larger than 128 bytes. For anything bigger, request base64 (or base64+zstd to compress large payloads).value: null, not an error — branch on null before reading lamports, owner, or data.dataSlice is not valid together with jsonParsed encoding; use dataSlice only with the raw base64/base58 encodings.