Account
useWalletSubscription
Software Development Kits
[EVM] React Components SDK
- Overview
- Getting started
- Theming
- Wallet connect
- Framework Guides
- Page Components
- Block Components
[EVM] React Hooks SDK
[EVM] Core SDK
[EVM] Perp SDK
Account
useWalletSubscription
Subscribe to on-chain events (e.g. transaction completed) for connected wallet.
Example
useWalletSubscription({
onMessage: (data: any) => {
const { side, transStatus } = data;
if (transStatus === "COMPLETED") {
let msg = `${side} completed`;
toast.success(msg);
} else if (transStatus === "FAILED") {
let msg = `${side} failed`;
toast.error(msg);
}
}
});
On this page