Skip to main content

Client Info

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

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

console.log("SDK Version", SDK_VERSION);
console.log("Beacon Version", BEACON_VERSION);
Loading...
Example
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());
Loading...
Example
import { DAppClient, NetworkType } from "@airgap/beacon-sdk";

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

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

const txLink = await dAppClient.blockExplorer.getTransactionLink(
  "onzCRJhQ9zPC38TLGhBTghCW7WAJpfUJ2NpwbbQKbW6LeEL8RfK",
  { 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("\n\nDebug:\n");
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);
Loading...