Skip to content

watchWalletStatus

watchWalletStatus(client, callback?): Promise<WalletStatusReturnType>

Defined in: actions/watchWalletStatus.ts:23

Function used to watch the current frak wallet status

FrakClient

The current Frak Client

(status) => void

The callback that will receive any wallet status change

Promise<WalletStatusReturnType>

A promise resolving with the initial wallet status

This function will return the current wallet status, and will listen to any change in the wallet status.

await watchWalletStatus(frakConfig, (status: WalletStatusReturnType) => {
if (status.key === "connected") {
console.log("Wallet connected:", status.wallet);
} else {
console.log("Wallet not connected");
}
});