ChainId
Last updated
Was this helpful?
Enum representing the chain ID, an unsigned 32-bit integer used so transactions can't be replayed on other chains. Similar in purpose to TransactionVersion.
import { ChainId } from '@stacks/network';
if (network.chainId === ChainId.Mainnet) {
console.log('This is a mainnet network');
}enum ChainId {
Mainnet = 0x00000001,
Testnet = 0x80000000,
}Mainnet
0x00000001
Stacks mainnet chain ID
Testnet
0x80000000
Stacks testnet chain ID (also used by devnet and mocknet)
Last updated
Was this helpful?
Was this helpful?