zic-evm-sdk
Version:
An sdk for interacting with zebec card evm contracts
112 lines (111 loc) • 3.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getATokenAddress = exports.getWethAddress = exports.getUsdcAddress = exports.getZebecCardAddress = exports.CHAINS = exports.ODYSSEY_MAINNET_CHAIN_ID = exports.ODYSSEY_TESTNET_CHAIN_ID = exports.BSC_TESTNET_CHAIN_ID = exports.BSC_CHAIN_ID = exports.BASE_CHAIN_ID = exports.SEPOLIA_CHAIN_ID = exports.MAINNET_CHAIN_ID = void 0;
/**
* Ethereum mainnet chain ID
*/
exports.MAINNET_CHAIN_ID = 1;
/**
* Sepolia chain ID
*/
exports.SEPOLIA_CHAIN_ID = 11155111;
/**
* Base chain ID
*/
exports.BASE_CHAIN_ID = 8453;
/**
* BSC chain ID
*/
exports.BSC_CHAIN_ID = 56;
/**
* BSC testnet chain ID
*/
exports.BSC_TESTNET_CHAIN_ID = 97;
/**
* Odyssey testnet chain ID
*/
exports.ODYSSEY_TESTNET_CHAIN_ID = 131313;
exports.ODYSSEY_MAINNET_CHAIN_ID = 153153;
exports.CHAINS = {
1: "mainnet",
11155111: "sepolia",
8453: "base",
56: "bsc",
97: "bscTestnet",
131313: "odysseyTestnet",
153153: "odyssey",
};
const ZEBEC_CARD_ADDRESS = {
sepolia: "0x00d90625CcaB01eA0e589DFd3C99972180CE609A",
base: "0x1bF6419D8555EafaE79142D309534e8aBd54aBa3",
mainnet: "0xB4f6E946E12200F4E0ba3B352B8DbF0a66635b53",
bsc: "0x1bF6419D8555EafaE79142D309534e8aBd54aBa3",
bscTestnet: "0x9061E6eB59890D33C94B9f517c3dba30621fAB2f",
odysseyTestnet: "0x597fA3656FF24034939edce2d74480c0619F51A7",
odyssey: "0x935D149eCB4E3F3824327e7d4357180a08aE8a15",
};
/**
* Gets ZebecCard contract address for given chainId
* @param chainId
* @returns address
*/
const getZebecCardAddress = (chainId) => {
const chain = exports.CHAINS[chainId];
return ZEBEC_CARD_ADDRESS[chain];
};
exports.getZebecCardAddress = getZebecCardAddress;
const USDC_ADDRESS = {
sepolia: "0x94a9D9AC8a22534E3FaCa9F4e7F2E2cf85d5E4C8",
base: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
mainnet: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
bsc: "0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d",
bscTestnet: "0xF8Dc6f35a10244213096D86c376491042594a84e",
odysseyTestnet: "0x1bF6419D8555EafaE79142D309534e8aBd54aBa3",
odyssey: "0x8aBEE32587864cce7000e6f2820680874eD6100A",
};
/**
* Gets USDC address for given chainId
* @param chainId
* @returns address
*/
const getUsdcAddress = (chainId) => {
const chain = exports.CHAINS[chainId];
return USDC_ADDRESS[chain];
};
exports.getUsdcAddress = getUsdcAddress;
const WETH_ADDRESS = {
sepolia: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",
base: "0x4200000000000000000000000000000000000006",
bsc: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
bscTestnet: "0x094616F0BdFB0b526bD735Bf66Eca0Ad254ca81F",
mainnet: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
odysseyTestnet: "0xF21Cbaf7bD040D686Bd390957770D2ea652E4013",
odyssey: "0xF21Cbaf7bD040D686Bd390957770D2ea652E4013",
};
/**
* Gets WETH address for given chainId
* @param chainId
* @returns address
*/
const getWethAddress = (chainId) => {
const chain = exports.CHAINS[chainId];
return WETH_ADDRESS[chain];
};
exports.getWethAddress = getWethAddress;
const ATOKEN_ADDRESS = {
sepolia: "0x16dA4541aD1807f4443d92D26044C1147406EB80",
base: "0x4e65fE4DbA92790696d040ac24Aa414708F5c0AB",
bsc: "0x00901a076785e0906d1028c7d6372d247bec7d61",
bscTestnet: "0x0000000000000000000000000000000000000000",
mainnet: "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c",
odysseyTestnet: "0x0000000000000000000000000000000000000000",
odyssey: "0x0000000000000000000000000000000000000000",
};
/**
* Gets Aave Usdc token address for supported chains
*/
const getATokenAddress = (chainId) => {
const chain = exports.CHAINS[chainId];
return ATOKEN_ADDRESS[chain];
};
exports.getATokenAddress = getATokenAddress;