Skip to main content

Network

Defines the network configuration object:


type Network = {
name: string;
chainId: string;
chainPrefix?: string;
rpc: string;
rest: string;
gasPrice?: string;
bip44?: BIP44;
defaultCurrency?: NetworkCurrency;
stakeCurrency?: NetworkCurrency;
feeCurrencies?: NetworkCurrency[];
features?: string[];
bech32Config?: Bech32Config;
evm?: {
deriveCosmosAddress: (address: string) => string;
fromEthChainToCosmosChain: (chainId: number) => string;
};
};

stakeCurrency, feeCurrencies​

If you don't provide a currency configuration, defaultCurrency will be used to configure all other currency types. If a defaultCurrency is not provided, the wallet provider's default will be used.

bech32Config​

If you don't provide a bech32Config, one will be generated for you based on the chainPrefix. If a chainPrefix default is not provided, the wallet provider's default will be used.

evm​

If you don't define the evm configuration, the network will not support the evm compatbile features.


Bech32Config​

Defines the bech32 configuration object:


export type Bech32Config = {
bech32PrefixAccAddr: string;
bech32PrefixAccPub: string;
bech32PrefixValAddr: string;
bech32PrefixValPub: string;
bech32PrefixConsAddr: string;
bech32PrefixConsPub: string;
};

BIP44​

Defines the bip44 configuration object:


export type BIP44 = {
coinType: number;
};

NetworkCurrency​

Defines the network currency configuration object:


export type NetworkCurrency = {
coinDenom: string;
coinMinimalDenom: string;
coinDecimals: number;
coinGeckoId?: string;
gasPriceStep?: {
low: number;
average: number;
high: number;
};
};