Aller au contenu

watchWalletStatus

Ce contenu n’est pas encore disponible dans votre langue.

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

Defined in: actions/watchWalletStatus.ts:23

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, or rejecting if the wallet cannot be reached before it

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");
}
});