Client Info
The following page lists all the different options in Beacon to retrieve and display information about the SDK.
- Beacon
- Taquito
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 { BEACON_VERSION, SDK_VERSION } from "@airgap/beacon-sdk"; console.log("SDK Version", SDK_VERSION); console.log("Beacon Version", BEACON_VERSION);
Loading...
- Beacon
- Taquito
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 { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; const Tezos = new TezosToolkit("https://mainnet.api.tez.ie"); const wallet = new BeaconWallet({ name: "Beacon Docs Taquito" }); Tezos.setWalletProvider(wallet); console.log(`Connected Accounts:`, await wallet.client.getAccounts()); console.log(`Connected Peers:`, await wallet.client.getPeers());
Loading...
- Beacon
- Taquito
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...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { DAppClient, NetworkType } from "@airgap/beacon-sdk"; const Tezos = new TezosToolkit("https://mainnet.api.tez.ie"); const wallet = new BeaconWallet({ name: "Beacon Docs Taquito" }); Tezos.setWalletProvider(wallet); const addressLink = await wallet.client.blockExplorer.getAddressLink( "tz1MJx9vhaNRSimcuXPK2rW4fLccQnDAnVKJ", { type: NetworkType.MAINNET }, ); console.log("Address Link", addressLink); const txLink = await wallet.client.blockExplorer.getTransactionLink( "onzCRJhQ9zPC38TLGhBTghCW7WAJpfUJ2NpwbbQKbW6LeEL8RfK", { type: NetworkType.MAINNET }, ); console.log("Transaction Link", txLink); console.log("\n\nConnection Info:\n"); console.log("Status:", wallet.client.connectionStatus); const accounts = await wallet.client.getAccounts(); console.log("Accounts:", accounts); const peers = await wallet.client.getPeers(); console.log("Peers:", peers); console.log("\n\nDebug:\n"); console.log("Local Beacon ID:", await wallet.client.beaconId); const colorMode = await wallet.client.getColorMode(); console.log("Color Mode:", colorMode); const ownMetadata = await wallet.client.getOwnAppMetadata(); console.log("Own Metadata:", ownMetadata);
Loading...