Solana
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Solana
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
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.| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | pubkey | string | نعم | Base-58 account address to read. |
| 2 | config | object | لا | Options: commitment, encoding (base58|base64|base64+zstd|jsonParsed), dataSlice {offset,length}, minContextSlot. |
| النوع | الوصف |
|---|---|
| object | RpcResponse wrapping { data, executable, lamports, owner, rentEpoch, space } or null if the account does not exist. |
| الكود | الرسالة | السبب |
|---|---|---|
-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.