@tristeroresearch/mach-sdk
Version:
A TypeScript SDK for integrating with Mach's API.
69 lines • 2.45 kB
TypeScript
export declare const chainNames: {
readonly ethereum: "Ethereum";
readonly optimism: "Optimism";
readonly arbitrum: "Arbitrum";
readonly celo: "Celo";
readonly base: "Base";
readonly polygon: "Polygon";
readonly avalanche: "Avalanche";
readonly sepolia: "Sepolia";
readonly monadtestnet: "Monad Testnet";
};
export declare const chainIds: {
readonly ethereum: 1;
readonly optimism: 10;
readonly arbitrum: 42161;
readonly celo: 42220;
readonly base: 8453;
readonly polygon: 137;
readonly avalanche: 43114;
readonly sepolia: 11155111;
readonly monadtestnet: 10143;
};
/**
* A map of EVM chain IDs to chain names
*/
export declare const chainNamesFromIds: {
[key: number]: string;
};
/**
* A map of EVM chain IDs to LayerZero v1 chain IDs
*/
export declare const lzV1ChainIds: Readonly<Record<number, number>>;
export declare const nativeTokens: {
readonly ethereum: "ETH";
readonly optimism: "ETH";
readonly arbitrum: "ETH";
readonly celo: "CELO";
readonly base: "ETH";
readonly polygon: "MATIC";
readonly avalanche: "AVAX";
readonly sepolia: "ETH";
readonly monadtestnet: "MON";
};
export declare const getChainName: (key: string) => string;
export declare const getChainNameFromId: (id: number) => string;
export declare const getGasToken: (key: string) => string;
export declare const getChainId: (key: string) => number;
export declare const TESTNET_CHAIN_IDS: readonly [11155111, 10143];
export declare const MAINNET_CHAIN_IDS: readonly [1, 10, 42161, 42220, 8453, 137, 43114];
/**
* Checks if a chain ID is a testnet chain ID
* @param chainId - The chain ID to check
* @returns boolean indicating if the chain ID is a testnet chain ID
*/
export declare const isTestnetChain: (chainId: number) => boolean;
/**
* Checks if a chain ID is a mainnet chain ID
* @param chainId - The chain ID to check
* @returns boolean indicating if the chain ID is a mainnet chain ID
*/
export declare const isMainnetChain: (chainId: number) => boolean;
/**
* Validates if a chain ID matches the expected network mode (testnet/mainnet)
* @param chainId - The chain ID to validate
* @param isTestnet - Whether we're in testnet mode
* @returns boolean indicating if the chain is valid for the current mode
*/
export declare const validateChainForMode: (chainId: number, isTestnet: boolean) => boolean;
//# sourceMappingURL=chainInfo.d.ts.map