RAILGUN Reloaded
    Preparing search index...

    Events

    on() subscribes to a typed event and returns an unsubscribe function. The event names are the keys of "@railgun-reloaded/wallet-sdk/node".RailgunEventMap: sync:start, sync:progress, sync:complete, sync:error, balance:update, and error.

    const stop = client.on(
    'balance:update',
    ({ walletId, chainId, balances, notesAdded, notesSpent }) => {
    render(balances)
    },
    { walletId, chainId: 8453 }
    )

    stop()
    • balance:update fires after decrypt() or sync() changes the notes of a wallet. The payload is the full balance, not a delta.
    • A run that changes no note does not fire balance:update. Use sync:complete to know that a run finished.
    • A handler is synchronous. When a handler throws, the client emits error. The method that caused the event does not fail.
    • The filter is optional. The handler runs only when each field in the filter matches the payload.

    close() removes every subscriber.