Chains
Chain definitions for Stacks networks.
Predefined Chains
import { mainnet, testnet, devnet, mocknet } from "@secondlayer/stacks/chains";
// Use with clients
const client = createPublicClient({
chain: mainnet,
transport: http(),
});Custom Chain
import { defineChain } from "@secondlayer/stacks/chains";
const custom = defineChain({
id: 0x80000000,
name: "my-network",
network: "testnet",
transactionVersion: 0x80,
peerNetworkId: 0xfaceb00c,
addressVersion: { singleSig: 26, multiSig: 21 },
magicBytes: "T2",
bootAddress: "ST000000000000000000002AMW42H",
nativeCurrency: { name: "Stacks", symbol: "STX", decimals: 6 },
rpcUrls: {
default: { http: ["http://localhost:3999"] },
},
});