Skip to main content

Disconnecting from a Wallet

The follwing examples show how to properly disconnect from a wallet.

warning

If you are using the P2P transport, it is not recommended to manually disconnect from the transport. Doing so may interrupt the syncing process, resulting in an error message indicating "Syncing stopped manually."

Live Editor
import { DAppClient } from "@airgap/beacon-sdk";
const dAppClient = new DAppClient({ name: "Beacon Docs" });

dAppClient
  .disconnect()
  .then(() => {
    const account = await dAppClient.getActiveAccount();
    console.log("Active Account", account);
  })
  .catch((err) => console.error(err.message));
Loading...