Solana
Solana
Solana
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
On Solana, every program (smart contract) owns the data accounts it manages, and getProgramAccounts returns all accounts owned by a given program id. Each result is a { pubkey, account } pair where the account carries data, owner, lamports (native SOL, 1 SOL = 1,000,000,000 lamports), executable, rentEpoch, and space. Because a busy program — like the SPL Token program or a Raydium or Jupiter program — can own millions of accounts, you almost always narrow the scan with filters (dataSize and memcmp) and trim payloads with dataSlice. Call it as a JSON-RPC 2.0 POST with positional params against https://solana.therpc.io/YOUR_API_KEY.
dataSize: 165 filter plus a memcmp on the mint field.dataSize and a memcmp on a discriminator.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | pubkey | string | 是 | Base-58 program id whose owned accounts to return. |
| 2 | config | object | 否 | Options: commitment, encoding, dataSlice, withContext, minContextSlot, filters (≤4: memcmp {offset,bytes,encoding} / dataSize / tokenAccountState). |
| 类型 | 描述 |
|---|---|
| array | Array of { pubkey, account:{ data, executable, lamports, owner, rentEpoch, space } } (wrapped in RpcResponse when withContext is set). |
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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. |
dataSize plus memcmp and trim each result with dataSlice.memcmp bytes are decoded to at most 128 bytes per filter; encode longer comparison values carefully and split a long match across the offset you actually need.filters, the call scans every account the program owns — never run it unbounded against a busy mainnet program in production.