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

Field
Type
Description

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

Field
Type
Description

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

Best Practices

  1. Reuse connections - Subscribe to multiple addresses on one WebSocket

  2. Handle reconnection - Re-subscribe to all topics after reconnecting

  3. Validate addresses - Verify bech32 format before subscribing

  4. Clean up - Unsubscribe when addresses are no longer needed

Last updated

Was this helpful?