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.
sendTransaction. Use the WebSocket PubSub endpoint for the *Subscribe methods when you need real-time push notifications (account changes, logs, slots) instead of polling.-32029 errors with exponential backoff, cache slowly-changing data, and move polling to subscriptions; if you hit limits regularly, consider a plan upgrade.Solana errors come back as standard JSON-RPC error objects, and the table below lists the codes you'll meet: -32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params, -32603 internal error, and the -32000 to -32099 server-error range (which includes the -32029 rate-limit code). One Solana-specific case worth knowing: when sendTransaction fails its preflight, the error carries Simulation-Results data — the simulation logs and the underlying instruction error — so you can inspect exactly why the transaction was rejected before it ever landed. Four habits keep error handling robust: always check the error field before reading result, retry transient failures with exponential backoff, log the code and message for debugging, and set sensible timeouts so a hung call doesn't stall your app.
| Code | Meaning |
|---|---|
-32700 | Parse error |
-32600 | Invalid request |
-32601 | Method not found |
-32602 | Invalid params |
-32603 | Internal error |
-32000 to -32099 | Server error |
sendTransaction returns a signature meaning the transaction was accepted, not yet confirmed. Poll getSignatureStatuses with that signature until confirmationStatus reaches your target commitment (and err is null), or subscribe with signatureSubscribe to be notified instead of polling.getLatestBlockhash immediately before signing, and watch its lastValidBlockHeight against the current getBlockHeight. Once the chain passes that height, the blockhash is no longer valid and the transaction will be dropped, so refresh and resign if needed.maxSupportedTransactionVersion: 0 to getTransaction and getBlock; without it, the call errors on any versioned (v0) transaction it encounters.getAccountInfo calls with one getMultipleAccounts, push real-time needs to WebSocket subscriptions instead of polling, cache static config like getGenesisHash and getEpochSchedule, and pick the lightest commitment that still meets your correctness needs (processed or confirmed over finalized where appropriate).getProgramAccounts with filters (memcmp/dataSize) so it doesn't scan an entire program's account set.chainId to set on Solana.getGenesisHash; each cluster has a distinct genesis hash, so it uniquely identifies mainnet, devnet, or testnet. Note that requestAirdrop only funds accounts on devnet and testnet — it does not work on mainnet.@solana/web3.js. Python: solana-py with solders. Rust: the solana-client crate. Go: gagliardetto/solana-go. See Tools & SDKs for other languages.requestAirdrop, build in error handling from the start, validate connectivity with getHealth and getSlot, then monitor performance before promoting your key to mainnet.