Subscribe
Events version 2 uses colon-separated names. Legacy event names are not supported.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Subscribe to wallet changes and query activity.
import { subscribe, type ArksatProvider } from '@arksat/wallet-sdk'
export function watchWallet(provider: ArksatProvider, refresh: () => void) {
const stops = [
subscribe(provider, 'balance:changed', refresh),
subscribe(provider, 'assets:changed', refresh),
subscribe(provider, 'account:changed', refresh),
subscribe(provider, 'network:changed', refresh),
subscribe(provider, 'wallet:locked', refresh),
subscribe(provider, 'connection:disconnected', refresh),
]
return () => stops.forEach(stop => stop())
}
| Event | Payload |
|---|---|
| account:changed | string[] |
| network:changed | mainnet or mutinynet |
| balance:changed / assets:changed | ArksatDataEvent or null |
| transaction:updated / transfer:received / transfer:settled | ArksatTransactionEvent |
| connection:connected | Empty object |
| connection:disconnected | message field |
| wallet:locked / wallet:unlocked | null |
await client.connect({ read: ['transactions'] })
const history = await client.getTransactionHistory({ limit: 50, offset: 0 })
import { waitForTransaction } from '@arksat/wallet-sdk'
const tx = await waitForTransaction(provider, txid, { signal })