useNetwork
Core Functionality
State Properties
interface NetworkState {
// Currently active network ID (e.g., 'mainnet', 'testnet')
activeNetwork: string
// Complete network configuration object
networkConfig: Record<string, NetworkConfig>
// Configuration for the currently active network
activeNetworkConfig: NetworkConfig
}
interface NetworkConfig {
// Algod node configuration
algod: {
token: string | algosdk.AlgodTokenHeader | algosdk.CustomTokenHeader
baseServer: string
port?: string | number
headers?: Record<string, string>
}
// Optional network identifiers
genesisHash?: string
genesisId?: string
isTestnet?: boolean
caipChainId?: string
}Methods
Framework-Specific Usage
Method Details
setActiveNetwork
updateAlgodConfig
resetNetworkConfig
Error Handling
TypeScript Support
See Also
Last updated