Endpoints
Websockets are available on mainnet and devnet with the following URLs:
Mainnet wss://mainnet.helius-rpc.com/?api-key=<API_KEY>
Devnet wss://devnet.helius-rpc.com/?api-key=<API_KEY>
Websockets have a 10-minute inactivity timer; implementing health checks and sending pings every minute is heavily recommended to keep the websocket connection alive.
Authorizations
Your Helius API key. You can get one for free in the dashboard .
Body
Account Pubkey, as base-58 encoded string.
Encoding format for account data. Can be base58
, base64
, base64+zstd
, or jsonParsed
.
base58
is slow
jsonParsed
encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data
If jsonParsed
is requested but a parser cannot be found, the field falls back to binary encoding, detectable when the data field is type string.
The commitment level for the subscription. Can be finalized
, confirmed
, or processed
.
Response
Subscription id (needed to unsubscribe)
{
"jsonrpc" : "2.0" ,
"id" : 1 ,
"method" : "accountSubscribe" ,
"params" : [
"CM78CPUeXjn8o3yroDHxUtKsZZgoy4GPkPPXfouKNH12" ,
{
"encoding" : "jsonParsed" ,
"commitment" : "finalized"
}
]
}
Response
Message (base58)
Message (jsonParsed)
{
"jsonrpc" : "2.0" ,
"result" : 23784 ,
"id" : 1
}