Account Subscriptions
Subscribe to real-time updates for specific blockchain addresses. Receive notifications when account balances change or nonces are updated.
Subscribe
ws.send(JSON.stringify({
action: 'subscribe',
topic: 'address/erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th'
}));Topic Format
address/{bech32_address}The address must be a valid MultiversX bech32 address starting with erd1.
Subscription Confirmation
{
"action": "subscribe",
"status": "ok",
"topic": "address/erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"
}Account Update Events
When an account's state changes, you receive an update:
Response Fields
topic
string
The subscribed topic
type
string
Event type (accountDelta)
data.address
string
The account address
data.nonce
number
Current account nonce
data.shardId
number
Shard where account resides
data.balances
array
Changed token balances
Balance Object
token
string
Token identifier or "EGLD"
balance
string
Current balance in atomic units
Use Cases
Wallet Balance Monitoring
Transaction Confirmation Detection
Portfolio Tracker
Multiple Subscriptions
You can subscribe to multiple addresses on the same connection:
Unsubscribe
Error Handling
Invalid Address
Topic Limit Reached
Each connection can subscribe to a maximum of 100 topics. Unsubscribe from unused addresses to stay within limits.
Best Practices
Reuse connections - Subscribe to multiple addresses on one WebSocket
Handle reconnection - Re-subscribe to all topics after reconnecting
Validate addresses - Verify bech32 format before subscribing
Clean up - Unsubscribe when addresses are no longer needed
Last updated
Was this helpful?