Solana
Solana
Solana
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
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.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | pubkey | string | Sí | Base-58 program id whose owned accounts to return. |
| 2 | config | object | No | Options: commitment, encoding, dataSlice, withContext, minContextSlot, filters (≤4: memcmp {offset,bytes,encoding} / dataSize / tokenAccountState). |
| Tipo | Descripción |
|---|---|
| array | Array of { pubkey, account:{ data, executable, lamports, owner, rentEpoch, space } } (wrapped in RpcResponse when withContext is set). |
| Código | Mensaje | 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. |
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.