Account Subscriptions

The relayer bridges to mx-notifier to deliver real-time account update events. Use the address/{bech32} topic for unicast notifications on a single address, or the accounts topic to receive all global account updates on one connection.


Subscribe to a Single Address

ws.send(JSON.stringify({
  action: 'subscribe',
  topic: 'address/erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th'
}));

Topic Format

address/{bech32}

The address must be a valid MultiversX bech32 address beginning with erd1. Updates are delivered only to the connection that subscribed β€” they are not broadcast to other connections.

Subscription Confirmation

{
  "action": "subscribe",
  "status": "ok",
  "topic": "address/erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th"
}

Subscribe to All Account Updates

The accounts topic broadcasts every account update across the network to all subscribers. Use it for indexers, analytics tools, or any application that needs a global view of account state changes.

circle-exclamation

What Triggers an Update

An accountDelta event is emitted when any of the following change on-chain for the monitored address:

  • EGLD balance

  • Any ESDT token balance

  • Account nonce (meaning a transaction from this account was executed)


accountDelta Schema

Field Descriptions

Field
Type
Description

type

string

Always "accountDelta"

data.address

string

The bech32 address of the account

data.shardId

number

Shard where this account resides

data.timestamp

number

Block timestamp in milliseconds (Unix epoch)

data.balances

object

Map of token identifier to current balance in atomic units. Key "EGLD" represents the native token.

data.nonce

number

Current account nonce after this block

data.blockHash

string

Hash of the block that triggered this update

data.blockNonce

number

Nonce (height) of the block that triggered this update

circle-info

data.balances contains only the tokens whose balance changed in the triggering block, not the complete account portfolio. Maintain a local state map and apply deltas on each event.


Multiple Address Monitoring

Subscribe to up to 64 address topics per connection. Each subscription is independent; events for different addresses are delivered as separate messages.


Reconnection Pattern

WebSocket connections can drop due to network interruptions. After reconnecting, re-subscribe to all topics to resume updates. The example below implements exponential backoff and automatic re-subscription on close.


Unsubscribe


Error Responses

Invalid Address

Topic Limit Reached

circle-exclamation

Last updated

Was this helpful?