Network
The Network configuration in octez.connect 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.
Set the network when you create the DAppClient (or Taquito's BeaconWallet). Since v5, DAppClient.requestPermissions() no longer accepts a network option and throws if one is passed.
Mainnet With Custom RPC
- octez.connect
- taquito
Example
import { DAppClient, NetworkType } from "@tezos-x/octez.connect-sdk"; // Mainnet with different rpcUrl const dAppClient = new DAppClient({ name: "Beacon Docs", network: { type: NetworkType.MAINNET, rpcUrl: "https://rpc.tzbeta.net", }, }); const result = await dAppClient.requestPermissions();
Loading...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { NetworkType } from "@tezos-x/octez.connect-sdk"; const Tezos = new TezosToolkit("https://rpc.tzbeta.net"); // Mainnet with different rpcUrl const wallet = new BeaconWallet({ name: "Beacon Docs Taquito", network: { type: NetworkType.MAINNET, rpcUrl: "https://rpc.tzbeta.net", }, }); Tezos.setWalletProvider(wallet); const result = await wallet.client.requestPermissions();
Loading...
Testnet
- octez.connect
- taquito
Example
import { DAppClient, NetworkType } from "@tezos-x/octez.connect-sdk"; // Shadownet with default rpcUrl const dAppClient = new DAppClient({ name: "Beacon Docs", network: { type: NetworkType.SHADOWNET }, }); const result = await dAppClient.requestPermissions();
Loading...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { NetworkType } from "@tezos-x/octez.connect-sdk"; const Tezos = new TezosToolkit("https://rpc.shadownet.teztnets.com"); // Shadownet with default rpcUrl const wallet = new BeaconWallet({ name: "Beacon Docs Taquito", network: { type: NetworkType.SHADOWNET }, }); Tezos.setWalletProvider(wallet); const result = await wallet.client.requestPermissions();
Loading...
Testnet With Custom RPC
- octez.connect
- taquito
Example
import { DAppClient, NetworkType } from "@tezos-x/octez.connect-sdk"; // Shadownet with different rpcUrl const dAppClient = new DAppClient({ name: "Beacon Docs", network: { type: NetworkType.SHADOWNET, rpcUrl: "https://rpc.tzkt.io/shadownet", }, }); const result = await dAppClient.requestPermissions();
Loading...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { NetworkType } from "@tezos-x/octez.connect-sdk"; const Tezos = new TezosToolkit("https://rpc.tzkt.io/shadownet"); // Shadownet with different rpcUrl const wallet = new BeaconWallet({ name: "Beacon Docs Taquito", network: { type: NetworkType.SHADOWNET, rpcUrl: "https://rpc.tzkt.io/shadownet", }, }); Tezos.setWalletProvider(wallet); const result = await wallet.client.requestPermissions();
Loading...
Custom Network
- octez.connect
- taquito
Example
import { DAppClient, NetworkType } from "@tezos-x/octez.connect-sdk"; // Custom network (eg. local development or latest testnet). // Not every wallet supports custom networks. const dAppClient = new DAppClient({ name: "Beacon Docs", network: { type: NetworkType.CUSTOM, // e.g. a local node at "http://localhost:8732". Here we point to a public // Shadownet RPC so the example can be run as-is. name: "Shadownet (custom)", rpcUrl: "https://rpc.shadownet.teztnets.com", }, }); const result = await dAppClient.requestPermissions();
Loading...
Example
import { TezosToolkit } from "@taquito/taquito"; import { BeaconWallet } from "@taquito/beacon-wallet"; import { NetworkType } from "@tezos-x/octez.connect-sdk"; const Tezos = new TezosToolkit("https://rpc.shadownet.teztnets.com"); // Custom network (eg. local development or latest testnet). // Not every wallet supports custom networks. const wallet = new BeaconWallet({ name: "Beacon Docs Taquito", network: { type: NetworkType.CUSTOM, // e.g. a local node at "http://localhost:8732". Here we point to a public // Shadownet RPC so the example can be run as-is. name: "Shadownet (custom)", rpcUrl: "https://rpc.shadownet.teztnets.com", }, }); Tezos.setWalletProvider(wallet); const result = await wallet.client.requestPermissions();
Loading...