Network
The Network configuration in Beacon SDK allows developers to specify the blockchain network their application will interact with. This includes using predefined networks like Mainnet or Testnet, as well as defining custom networks and RPC endpoints.
Mainnet With Custom RPC
- Beacon
- Taquito
Example
import { DAppClient, NetworkType } from "@airgap/beacon-sdk"; const dAppClient = new DAppClient({ name: "Beacon Docs" }); // Mainnet with different rpcUrl const result = await dAppClient.requestPermissions({ network: { type: NetworkType.MAINNET, rpcUrl: "https://mainnet.api.tez.ie", }, });
Loading...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { 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); // Mainnet with different rpcUrl const result = await wallet.client.requestPermissions({ network: { type: NetworkType.MAINNET, rpcUrl: "https://mainnet.api.tez.ie", }, });
Loading...
Testnet
- Beacon
- Taquito
Example
import { DAppClient, NetworkType } from "@airgap/beacon-sdk"; const dAppClient = new DAppClient({ name: "Beacon Docs", preferredNetwork: NetworkType.EDONET, }); // Edonet with default rpcUrl const result = await dAppClient.requestPermissions({ network: { type: NetworkType.EDONET, }, });
Loading...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { NetworkType } from "@airgap/beacon-sdk"; const Tezos = new TezosToolkit("https://mainnet.api.tez.ie"); const wallet = new BeaconWallet({ name: "Beacon Docs", preferredNetwork: NetworkType.EDONET, }); Tezos.setWalletProvider(wallet); // Edonet with default rpcUrl const result = await wallet.client.requestPermissions({ network: { type: NetworkType.EDONET, }, });
Loading...
Testnet With Custom RPC
- Beacon
- Taquito
Example
import { DAppClient, NetworkType } from "@airgap/beacon-sdk"; const dAppClient = new DAppClient({ name: "Beacon Docs", preferredNetwork: NetworkType.EDONET, }); // Edonet with different rpcUrl const result = await dAppClient.requestPermissions({ network: { type: NetworkType.EDONET, rpcUrl: "https://testnet-tezos.giganode.io/", }, });
Loading...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { NetworkType } from "@airgap/beacon-sdk"; const Tezos = new TezosToolkit("https://mainnet.api.tez.ie"); const wallet = new BeaconWallet({ name: "Beacon Docs", preferredNetwork: NetworkType.EDONET, }); Tezos.setWalletProvider(wallet); // Edonet with different rpcUrl const result = await wallet.client.requestPermissions({ network: { type: NetworkType.EDONET, rpcUrl: "https://testnet-tezos.giganode.io/", }, });
Loading...
Custom Network
- Beacon
- Taquito
Example
import { DAppClient, NetworkType } from "@airgap/beacon-sdk"; const dAppClient = new DAppClient({ name: "Beacon Docs", preferredNetwork: NetworkType.CUSTOM, }); // Custom network (eg. local development or latest testnet) const result = await dAppClient.requestPermissions({ network: { type: NetworkType.CUSTOM, name: "Local Node", rpcUrl: "http://localhost:8732/", }, });
Loading...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { NetworkType } from "@airgap/beacon-sdk"; const Tezos = new TezosToolkit("https://mainnet.api.tez.ie"); const wallet = new BeaconWallet({ name: "Beacon Docs Taquito", preferredNetwork: NetworkType.CUSTOM, }); Tezos.setWalletProvider(wallet); // Custom network (eg. local development or latest testnet) const result = await wallet.client.requestPermissions({ network: { type: NetworkType.CUSTOM, name: "Local Node", rpcUrl: "http://localhost:8732/", }, });
Loading...