programSubscribe - Solana

programSubscribe. Enables developers to subscribe to real-time updates for specific program accounts

programSubscribe - solana [Value: 10CU]
Enables to subscribe to real-time updates for specific program accounts
Use cases

Use cases

  • Subscribe to program events with specific filters
  • Monitor program activities for real-time updates
  • Receive notifications for program-related transactions
Constraints

Constraints

  • Requires active WebSocket connection
  • Subscription may be terminated if not maintained
  • Potential delays in receiving updates
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
wscat -c wss://solana.drpc.org \
# wait for connection
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "programSubscribe",
  "params": [
    "11111111111111111111111111111111",
    {
      "encoding": "base64",
      "commitment": "finalized"
    }
  ]
}
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "subscription_id"
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersobject
object
filtersobject
Specifies the criteria for receiving log results based on the type of transaction or account involved. Only one filter can be applied per method call.
encodingstring
Specifies the format for the returned account data. The available options are 'base58', 'base64', 'base64+zstd', and 'jsonParsed'.
  • base58 - This format is slower and is typically used for small amounts of data.
  • base64 - A more common encoding format that is faster and suitable for larger amounts of data.
  • base64+zstd - Base64 encoding with Zstandard compression for efficiency.
  • jsonParsed - Returns the data in a parsed JSON format, useful for human-readable output.
commitmentstring
Defines the level of assurance required for the data returned by the query.
  • finalized - The query returns the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized.
  • confirmed - The query returns the most recent block that has been voted on by the supermajority of the cluster.
  • processed - The query returns its most recent block, though the block may not be complete.

Response

200
An object containing the account data that has changed

Response params

object
idinteger
jsonrpcstring
resultobject