Type Alias: EventCallback<T>
type EventCallback<T> = (payload: SDKEventPayloads[T]) => void;
Defined in: types.ts:160
Type-safe callback for BrowserSDK event listeners.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
T extends SDKEvent | SDKEvent | The event name. When provided, the callback parameter is narrowed to the matching SDKEventPayloads entry. |
Parameters
| Parameter | Type |
|---|---|
payload | SDKEventPayloads[T] |
Returns
void
Example
const onAccount: EventCallback<'accountChanged'> = (account) => {
console.log(account.address); // WalletAccount
};