Solana
Solana
Solana
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
On Solana, every smart contract is a program that owns a set of data accounts, and programSubscribe opens a PubSub subscription that pushes a notification whenever any account owned by a given program changes. Each notification carries the changed account's pubkey and its new state — lamport balance and program data — so you can watch an entire program's account set at once instead of subscribing to addresses one by one. The matching JSON-RPC endpoint is https://solana.therpc.io/YOUR_API_KEY, and you stop the stream by passing the returned subscription id to programUnsubscribe.
| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | pubkey | string | Sí | Base-58 program id to watch. |
| 2 | config | object | No | Options: commitment, encoding, filters (memcmp/dataSize, like getProgramAccounts). |
| Tipo | Descripción |
|---|---|
| integer | A numeric subscription id. programNotification pushes { pubkey, account } for each changed account. |
| 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. |
filters (dataSize and/or memcmp, exactly as with getProgramAccounts) to narrow the stream to the accounts you care about.programUnsubscribe with it to stop and free the slot.