Solana
Solana
Solana
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.
| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | pubkey | string | 是 | Base-58 program id to watch. |
| 2 | config | object | 否 | Options: commitment, encoding, filters (memcmp/dataSize, like getProgramAccounts). |
| 类型 | 描述 |
|---|---|
| integer | A numeric subscription id. programNotification pushes { pubkey, account } for each changed account. |
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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.