@mozaic-fi/intent-swapper-sdk-common
Version:
Intent Swapper Common SDK
73 lines (72 loc) • 2.03 kB
TypeScript
import { TokenObject } from '../tokens';
export interface Network {
id: string;
chainId: number;
name: string;
explorerUrl: string;
rpcUrl: string;
nativeToken: TokenObject;
wrappedNativeToken: TokenObject;
multicall3Address: string;
}
export declare const networks: Network[];
export declare const networkMap: Record<number, Network>, networkMapById: Record<string, Network>;
export declare function setNetwork(chainId: number, network: Partial<Network>): void;
export declare function getNetwork(chainId: number): Network;
export declare function toNetworkId(chainId: number): string;
export declare function getNetworkById(networkId: string): Network;
export declare function toChainId(networkId: string): number;
export declare enum ChainId {
mainnet = 1,
optimism = 10,
bnb = 56,
gnosis = 100,
polygon = 137,
zksync = 324,
metis = 1088,
polygonZkevm = 1101,
base = 8453,
iota = 8822,
arbitrum = 42161,
avalanche = 43114,
bera = 80094,
sonic = 146,
hyperEvm = 999,
scroll = 534352,
ape = 33139,
uni = 130,
katana = 747474,
sei = 1329,
world = 480
}
export declare enum NetworkId {
mainnet = "mainnet",
optimism = "optimism",
bnb = "bnb",
gnosis = "gnosis",
polygon = "polygon",
zksync = "zksync",
metis = "metis",
polygonZkevm = "polygonZkevm",
base = "base",
iota = "iota",
arbitrum = "arbitrum",
avalanche = "avalanche",
bera = "bera",
sonic = "sonic",
hyperEvm = "hyperEvm",
scroll = "scroll",
ape = "ape",
uni = "uni",
katana = "katana",
sei = "sei",
world = "world"
}
export declare function isSupportedChainId(chainId: number): boolean;
export declare function isSupportedNetworkId(networkId: string): boolean;
export declare enum ExplorerType {
tx = "tx",
address = "address",
token = "token"
}
export declare function newExplorerUrl(chainId: number, type: 'tx' | 'address' | 'token', data: string): string;