Skip to main content

Client Info

The following page lists all the different options in Beacon to retrieve and display information about the SDK.

Live Editor
import { BEACON_VERSION, SDK_VERSION } from "@airgap/beacon-sdk";

console.log("SDK Version", SDK_VERSION);
console.log("Beacon Version", BEACON_VERSION);
Live Editor
import { DAppClient } from "@airgap/beacon-sdk";

const dAppClient = new DAppClient({ name: "Beacon Docs" });

console.log(`Connected Accounts:`, await dAppClient.getAccounts());
console.log(`Connected Peers:`, await dAppClient.getPeers());
Live Editor
import { DAppClient, NetworkType } from "@airgap/beacon-sdk";

const dAppClient = new DAppClient({ name: "Beacon Docs" });

const addressLink = await dAppClient.blockExplorer.getAddressLink(
  { type: NetworkType.MAINNET },
console.log("Address Link", addressLink);

const txLink = await dAppClient.blockExplorer.getTransactionLink(
  { type: NetworkType.MAINNET },
console.log("Transaction Link", txLink);

console.log("\n\nConnection Info:\n");
console.log("Status:", dAppClient.connectionStatus);
const accounts = await dAppClient.getAccounts();
console.log("Accounts:", accounts);
const peers = await dAppClient.getPeers();
console.log("Peers:", peers);

console.log("Local Beacon ID:", await dAppClient.beaconId);
const colorMode = await dAppClient.getColorMode();
console.log("Color Mode:", colorMode);
const ownMetadata = await dAppClient.getOwnAppMetadata();
console.log("Own Metadata:", ownMetadata);