Events

Available Events

TyphonEvents

EventWhen
accountChangedUser changes account, changes wallet, and adds new wallet.
networkChangedUser switches between Networks, event.data will have changed Network NetworkId
typhon.on(eventName:TyphonEvents, (event: TyphonEventMessage) => void) : Promise<APIResponse>;
1

TyphonEventMessage

type TyphonEventMessage = {
  data: unknown;
};
1
2
3

Usage example

typhon.on("accountChanged", (event: TyphonEventMessage) => {
  // called when account changes
  // It is recommended to reload the dapp on this event
});

typhon.on("networkChanged", (event: TyphonEventMessage) => {
  // called when network changes
});
1
2
3
4
5
6
7
8