@sentio/sdk-bundle 2.44.3 → 2.44.4-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/aptos/builtin/0x1.js +1 -1
- package/lib/aptos/builtin/0x3.js +1 -1
- package/lib/aptos/builtin/index.js +1 -1
- package/lib/aptos/codegen/index.js +9 -9
- package/lib/aptos/codegen/index.js.map +1 -1
- package/lib/aptos/ext/index.js +1 -1
- package/lib/aptos/index.js +1 -1
- package/lib/aptos/network.d.ts.map +1 -1
- package/lib/{chunk-JSAYWFRM.js → chunk-6VELGYNR.js} +2 -2
- package/lib/{chunk-Z46LGJE2.js → chunk-ABLESLV7.js} +2 -2
- package/lib/{chunk-LWWZZ3VD.js → chunk-B7YDBLBV.js} +2 -2
- package/lib/{chunk-AZTU3RH7.js → chunk-CPSB2UZQ.js} +2 -2
- package/lib/{chunk-Y6QA2AK2.js → chunk-F7Q5QB6Q.js} +2 -2
- package/lib/{chunk-Z3BDII4O.js → chunk-G3ZGY3OS.js} +2 -2
- package/lib/{chunk-4XUN2MHT.js → chunk-HDNVG6V3.js} +2 -2
- package/lib/{chunk-BTKJOALH.js → chunk-IOV7WAT6.js} +2 -2
- package/lib/{chunk-RCUUZHUG.js → chunk-MAXAKVBP.js} +12 -12
- package/lib/{chunk-RCUUZHUG.js.map → chunk-MAXAKVBP.js.map} +1 -1
- package/lib/{chunk-LTVKTBHO.js → chunk-MB75AKO3.js} +2 -2
- package/lib/{chunk-CNL6UJ7C.js → chunk-QUNXEV6Z.js} +2 -2
- package/lib/{chunk-AQU5WWON.js → chunk-QW2MPHP5.js} +2 -2
- package/lib/{chunk-AQU5WWON.js.map → chunk-QW2MPHP5.js.map} +1 -1
- package/lib/{chunk-YW7MDOGO.js → chunk-RVQBDYQ2.js} +2 -2
- package/lib/{chunk-V7BXBDG7.js → chunk-VO57HTCG.js} +2 -2
- package/lib/{chunk-E333Q3OG.js → chunk-WQV3TSRA.js} +2 -2
- package/lib/{chunk-GR3GN3NC.js → chunk-YVDAQU2U.js} +2 -2
- package/lib/{chunk-TIOVAWYM.js → chunk-YX4LDK5Y.js} +2 -2
- package/lib/{chunk-4ADBI657.js → chunk-ZI5N3H3K.js} +2 -2
- package/lib/eth/builtin/eacaggregatorproxy.js +1 -1
- package/lib/eth/builtin/erc1155.js +1 -1
- package/lib/eth/builtin/erc20.js +1 -1
- package/lib/eth/builtin/erc721.js +1 -1
- package/lib/eth/builtin/index.js +1 -1
- package/lib/eth/builtin/weth9.js +1 -1
- package/lib/eth/codegen/index.js +1 -1
- package/lib/eth/index.js +1 -1
- package/lib/fuel/index.js +1 -1
- package/lib/solana/builtin/index.js +1 -1
- package/lib/solana/index.js +1 -1
- package/lib/stark/codegen/index.js +1 -1
- package/lib/stark/index.js +1 -1
- package/lib/sui/builtin/0x1.js +1 -1
- package/lib/sui/builtin/0x2.js +1 -1
- package/lib/sui/builtin/0x3.js +1 -1
- package/lib/sui/builtin/index.js +1 -1
- package/lib/sui/codegen/index.js +1 -1
- package/lib/sui/ext/index.js +1 -1
- package/lib/sui/index.js +1 -1
- package/lib/testing/index.js +1 -1
- package/lib/utils/index.js +1 -1
- package/package.json +2 -2
- package/src/aptos/codegen/codegen.ts +11 -5
- package/src/aptos/network.ts +5 -2
- /package/lib/{chunk-JSAYWFRM.js.map → chunk-6VELGYNR.js.map} +0 -0
- /package/lib/{chunk-Z46LGJE2.js.map → chunk-ABLESLV7.js.map} +0 -0
- /package/lib/{chunk-LWWZZ3VD.js.map → chunk-B7YDBLBV.js.map} +0 -0
- /package/lib/{chunk-AZTU3RH7.js.map → chunk-CPSB2UZQ.js.map} +0 -0
- /package/lib/{chunk-Y6QA2AK2.js.map → chunk-F7Q5QB6Q.js.map} +0 -0
- /package/lib/{chunk-Z3BDII4O.js.map → chunk-G3ZGY3OS.js.map} +0 -0
- /package/lib/{chunk-4XUN2MHT.js.map → chunk-HDNVG6V3.js.map} +0 -0
- /package/lib/{chunk-BTKJOALH.js.map → chunk-IOV7WAT6.js.map} +0 -0
- /package/lib/{chunk-LTVKTBHO.js.map → chunk-MB75AKO3.js.map} +0 -0
- /package/lib/{chunk-CNL6UJ7C.js.map → chunk-QUNXEV6Z.js.map} +0 -0
- /package/lib/{chunk-YW7MDOGO.js.map → chunk-RVQBDYQ2.js.map} +0 -0
- /package/lib/{chunk-V7BXBDG7.js.map → chunk-VO57HTCG.js.map} +0 -0
- /package/lib/{chunk-E333Q3OG.js.map → chunk-WQV3TSRA.js.map} +0 -0
- /package/lib/{chunk-GR3GN3NC.js.map → chunk-YVDAQU2U.js.map} +0 -0
- /package/lib/{chunk-TIOVAWYM.js.map → chunk-YX4LDK5Y.js.map} +0 -0
- /package/lib/{chunk-4ADBI657.js.map → chunk-ZI5N3H3K.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/.pnpm/@sentio+chain@2.1.11/node_modules/@sentio/chain/src/chain-id.ts","../../../node_modules/.pnpm/@sentio+chain@2.1.11/node_modules/@sentio/chain/src/chain-info.ts","../../../node_modules/.pnpm/@sentio+chain@2.1.11/node_modules/@sentio/chain/src/chain-name.ts","../../../node_modules/.pnpm/@sentio+chain@2.1.11/node_modules/@sentio/chain/src/index.ts"],"sourcesContent":["// copy from https://github.com/DefiLlama/chainlist/blob/main/constants/chainIds.js\n// and https://besu.hyperledger.org/en/stable/Concepts/NetworkID-And-ChainID/\n\nexport enum ChainType {\n SOLANA = 'solana',\n SUI = 'sui',\n APTOS = 'aptos',\n ETH = 'evm',\n BTC = 'btc'\n}\n\nexport enum EthChainId { // Any modify to this must also be modify in EthChainName\n ETHEREUM = '1',\n OPTIMISM = '10',\n CRONOS = '25',\n BINANCE = '56',\n POLYGON = '137',\n MANTA_PACIFIC = '169',\n XLAYER_TESTNET = '195',\n XLAYER_MAINNET = '196',\n B2_MAINNET = '223',\n FANTOM = '250',\n FRAXTAL = '252',\n KUCOIN = '321',\n CRONOS_ZKEVM = '388',\n ZKSYNC_ERA = '324',\n CRONOS_TESTNET = '338',\n ASTAR = '592',\n LYRA = '957',\n POLYGON_ZKEVM = '1101',\n CONFLUX = '1030',\n METIS = '1088',\n MOONBEAM = '1284',\n UNCHAIN_SEPOLIA = '1301',\n SONEIUM_TESTNET = '1946',\n BEVM = '11501',\n MERLIN_MAINNET = '4200',\n MANTLE = '5000',\n BASE = '8453',\n LUMIO_TESTNET = '9990',\n HOLESKY = '17000',\n ASTAR_ZKEVM = '3776',\n MOVEMENT_EVM_TESTNET = '30732',\n MODE = '34443',\n ARBITRUM = '42161',\n AVALANCHE = '43114',\n ZIRCUIT_TESTNET = '48899',\n ZIRCUIT_MAINNET = '48900',\n BOB = '60808',\n LINEA = '59144',\n SONIC_TESTNET = '64165',\n BLAST = '81457',\n CHILIZ = '88888',\n TAIKO = '167000',\n TAIKO_TESTNET = '167008',\n BITLAYER = '200901',\n SCROLL = '534352',\n ZKLINK_NOVA = '810180',\n SEPOLIA = '11155111',\n AURORA = '1313161554',\n BLAST_SEPOLIA = '168587773'\n}\n\nexport enum AptosChainId {\n APTOS_MAINNET = 'aptos_mainnet',\n APTOS_TESTNET = 'aptos_testnet',\n // APTOS_DEVNET = 'aptos_devnet',\n APTOS_MOVEMENT_TESTNET = 'aptos_m2_testnet', // TODO remove\n APTOS_MOVEMENT_PORTO = 'aptos_movement_porto',\n APTOS_MOVEMENT_MAINNET = 'aptos_movement_mainnet'\n}\n\nexport enum SuiChainId {\n SUI_MAINNET = 'sui_mainnet',\n SUI_TESTNET = 'sui_testnet',\n // SUI_DEVNET = 'sui_devnet',\n SUI_MOVEMENT_TESTNET = 'sui_m2_testnet',\n SUI_MOVEMENT_MAINNET = 'sui_m2_mainnet'\n}\n\nexport enum SolanaChainId {\n SOLANA_MAINNET = 'sol_mainnet',\n SOLANA_DEVNET = 'sol_devnet',\n SOLANA_TESTNET = 'sol_testnet',\n SOLANA_PYTH = 'sol_pyth'\n}\nexport enum FuelChainId {\n FUEL_MAINNET = 'fuel_mainnet',\n FUEL_TESTNET = 'fuel_testnet'\n}\n\nexport enum CosmosChainId {\n INJECTIVE_MAINNET = 'injective_mainnet',\n INJECTIVE_TESTNET = 'injective_testnet'\n}\n\nexport enum StarknetChainId {\n STARKNET_MAINNET = 'starknet_mainnet',\n STARKNET_SEPOLIA = 'starknet_sepolia'\n}\n\nexport enum BTCChainId {\n BTC_MAINNET = 'btc_mainnet',\n BTC_TESTNET = 'btc_testnet'\n}\n\nexport type ChainId =\n | EthChainId\n | AptosChainId\n | SuiChainId\n | SolanaChainId\n | FuelChainId\n | CosmosChainId\n | StarknetChainId\n | BTCChainId\nexport const ChainId = {\n ...EthChainId,\n ...AptosChainId,\n ...SuiChainId,\n ...SolanaChainId,\n ...FuelChainId,\n ...CosmosChainId,\n ...StarknetChainId,\n ...BTCChainId\n}\n\nexport function getChainType(chainId?: string | number): ChainType {\n const id = String(chainId).toLowerCase()\n if (id.startsWith('sol')) {\n return ChainType.SOLANA\n }\n if (id.startsWith('sui')) {\n return ChainType.SUI\n }\n if (id.startsWith('apt')) {\n return ChainType.APTOS\n }\n if (id.startsWith('btc')) {\n return ChainType.BTC\n }\n return ChainType.ETH\n}\n","import { AptosChainId, BTCChainId, ChainId, EthChainId, SolanaChainId, SuiChainId } from './chain-id'\n\nexport enum ExplorerApiType {\n ETHERSCAN = 'etherscan',\n BLOCKSCOUT = 'blockscout',\n L2SCAN = 'l2scan',\n OKLINK = 'oklink'\n}\n\nexport type ChainInfo = {\n name: string\n chainId: ChainId\n explorerUrl: string\n}\n\nexport type EthChainInfo = ChainInfo & {\n mainnetChainId?: EthChainId\n chainId: EthChainId\n tokenAddress: string // native token address\n tokenSymbol: string // native token symbol\n tokenDecimals: number // native token decimals\n priceTokenAddress: string // token address for price\n wrappedTokenAddress: string // wrapped token address with contract, normally Wxxx (Wrapped xxx)\n\n explorerApiType?: string\n explorerApi?: string\n blockscoutUrl?: string\n}\n\n/**\n * EVM chains\n */\nexport const EthChainInfo: Record<EthChainId | string, EthChainInfo> = {\n [EthChainId.ETHEREUM]: {\n name: 'Ethereum',\n chainId: EthChainId.ETHEREUM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://etherscan.io',\n explorerApi: 'https://api.etherscan.io',\n blockscoutUrl: 'https://eth.blockscout.com'\n },\n [EthChainId.SEPOLIA]: {\n name: 'Sepolia',\n chainId: EthChainId.SEPOLIA,\n mainnetChainId: EthChainId.ETHEREUM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x1ef5f52bdbe11af2377c58ecc914a8c72ea807cf',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://sepolia.etherscan.io',\n explorerApi: 'https://api-sepolia.etherscan.io',\n blockscoutUrl: 'https://eth-sepolia.blockscout.com'\n },\n [EthChainId.HOLESKY]: {\n name: 'Holesky',\n chainId: EthChainId.HOLESKY,\n mainnetChainId: EthChainId.ETHEREUM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x94373a4919B3240D86eA41593D5eBa789FEF3848',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://holesky.etherscan.io',\n explorerApi: 'https://api-holesky.etherscan.io',\n blockscoutUrl: 'https://eth-holesky.blockscout.com'\n },\n [EthChainId.BINANCE]: {\n name: 'Binance',\n chainId: EthChainId.BINANCE,\n priceTokenAddress: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',\n tokenSymbol: 'BNB',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://bscscan.com',\n explorerApi: 'https://api.bscscan.com'\n },\n [EthChainId.POLYGON]: {\n name: 'Polygon',\n chainId: EthChainId.POLYGON,\n priceTokenAddress: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC\n tokenSymbol: 'MATIC',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://polygonscan.com',\n explorerApi: 'https://api.polygonscan.com'\n // blockscoutBlockPrefix: 'https://polygon.blockscout.com/block/',\n },\n [EthChainId.ARBITRUM]: {\n name: 'Arbitrum',\n chainId: EthChainId.ARBITRUM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://arbiscan.io',\n explorerApi: 'https://api.arbiscan.io'\n },\n [EthChainId.AVALANCHE]: {\n name: 'Avalanche',\n chainId: EthChainId.AVALANCHE,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://snowtrace.io',\n explorerApi: 'https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan'\n },\n [EthChainId.POLYGON_ZKEVM]: {\n name: 'Polygon zkEVM',\n chainId: EthChainId.POLYGON_ZKEVM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://zkevm.polygonscan.com',\n explorerApi: 'https://api-zkevm.polygonscan.com'\n },\n [EthChainId.MOONBEAM]: {\n name: 'Moonbeam',\n chainId: EthChainId.MOONBEAM,\n priceTokenAddress: '0xacc15dc74880c9944775448304b263d191c6077f', // WGLMR\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xacc15dc74880c9944775448304b263d191c6077f',\n tokenSymbol: 'GLMR',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://moonscan.io',\n explorerApi: 'https://api-moonbeam.moonscan.io'\n },\n [EthChainId.ASTAR]: {\n name: 'Astar',\n chainId: EthChainId.ASTAR,\n priceTokenAddress: '0xaeaaf0e2c81af264101b9129c00f4440ccf0f720', // WASTR\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xaeaaf0e2c81af264101b9129c00f4440ccf0f720',\n tokenSymbol: 'ASTR',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerUrl: 'https://astar.blockscout.com',\n explorerApi: 'https://astar.blockscout.com'\n },\n [EthChainId.ASTAR_ZKEVM]: {\n name: 'Astar zkEVM',\n chainId: EthChainId.ASTAR_ZKEVM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xE9CC37904875B459Fa5D0FE37680d36F1ED55e38',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://astar-zkevm.explorer.startale.com',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://astar-zkevm.explorer.startale.com'\n },\n [EthChainId.LINEA]: {\n name: 'Linea',\n chainId: EthChainId.LINEA,\n priceTokenAddress: '0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f', // WETH\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://lineascan.build',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.lineascan.build'\n },\n [EthChainId.SCROLL]: {\n name: 'Scroll',\n chainId: EthChainId.SCROLL,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x5300000000000000000000000000000000000004', // TODO questionable\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://scrollscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.scrollscan.com'\n },\n [EthChainId.TAIKO]: {\n name: 'Taiko Mainnet',\n chainId: EthChainId.TAIKO,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xA51894664A773981C6C112C43ce576f315d5b1B6',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://taikoscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.taikoscan.io'\n },\n [EthChainId.TAIKO_TESTNET]: {\n name: 'Taiko Testnet',\n chainId: EthChainId.TAIKO_TESTNET,\n mainnetChainId: EthChainId.TAIKO,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xae2C46ddb314B9Ba743C6dEE4878F151881333D9',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://hekla.taikoscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api-hekla.taikoscan.io'\n },\n [EthChainId.XLAYER_TESTNET]: {\n name: 'X Layer Testnet',\n chainId: EthChainId.XLAYER_TESTNET,\n mainnetChainId: EthChainId.XLAYER_MAINNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xa749ad81913cdc19881ebeb64631df72be708335',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://www.oklink.com/xlayer-test',\n explorerApiType: ExplorerApiType.OKLINK,\n explorerApi: 'https://www.oklink.com/api/v5/explorer'\n },\n [EthChainId.XLAYER_MAINNET]: {\n name: 'X Layer Mainnet',\n chainId: EthChainId.XLAYER_MAINNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x5a77f1443d16ee5761d310e38b62f77f726bc71c',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://www.oklink.com/xlayer',\n explorerApiType: ExplorerApiType.OKLINK,\n explorerApi: 'https://www.oklink.com/api/v5/explorer'\n },\n [EthChainId.BLAST]: {\n name: 'Blast Mainnet',\n chainId: EthChainId.BLAST,\n priceTokenAddress: '0x4300000000000000000000000000000000000004',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4300000000000000000000000000000000000004',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://blastscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.blastscan.io'\n },\n [EthChainId.BLAST_SEPOLIA]: {\n name: 'Blast Mainnet',\n chainId: EthChainId.BLAST_SEPOLIA,\n mainnetChainId: EthChainId.BLAST,\n priceTokenAddress: '0x4200000000000000000000000000000000000023',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000023',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://sepolia.blastscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api-sepolia.blastscan.io'\n },\n [EthChainId.BASE]: {\n name: 'Base',\n chainId: EthChainId.BASE,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://basescan.org',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.basescan.org'\n },\n [EthChainId.ZKSYNC_ERA]: {\n name: 'zkSync Era',\n chainId: EthChainId.ZKSYNC_ERA,\n priceTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenAddress: '0x000000000000000000000000000000000000800A',\n wrappedTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.zksync.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://block-explorer-api.mainnet.zksync.io'\n },\n [EthChainId.ZIRCUIT_TESTNET]: {\n name: 'Zircuit Testnet',\n chainId: EthChainId.ZIRCUIT_TESTNET,\n mainnetChainId: EthChainId.ZIRCUIT_MAINNET,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.testnet.zircuit.com'\n },\n [EthChainId.ZIRCUIT_MAINNET]: {\n name: 'Zircuit Mainnet',\n chainId: EthChainId.ZIRCUIT_MAINNET,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.zircuit.com'\n },\n [EthChainId.FANTOM]: {\n name: 'Fantom Opera',\n chainId: EthChainId.FANTOM,\n priceTokenAddress: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83', // WFTM\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83',\n tokenSymbol: 'WFTM',\n tokenDecimals: 18,\n explorerUrl: 'https://ftmscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.ftmscan.com'\n },\n [EthChainId.OPTIMISM]: {\n name: 'Optimism Mainnet',\n chainId: EthChainId.OPTIMISM,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://optimistic.etherscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api-optimistic.etherscan.io'\n },\n [EthChainId.CRONOS]: {\n name: 'Cronos Mainnet',\n chainId: EthChainId.CRONOS,\n priceTokenAddress: '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23', // WCRO\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23',\n tokenSymbol: 'CRO',\n tokenDecimals: 18,\n explorerUrl: 'https://cronoscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.cronoscan.com'\n },\n [EthChainId.CRONOS_TESTNET]: {\n name: 'Cronos Testnet',\n chainId: EthChainId.CRONOS_TESTNET,\n mainnetChainId: EthChainId.CRONOS,\n priceTokenAddress: '0x6a3173618859c7cd40faf6921b5e9eb6a76f1fd4', // WCRO\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x6a3173618859c7cd40faf6921b5e9eb6a76f1fd4',\n tokenSymbol: 'CRO',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.cronos.org/testnet'\n },\n [EthChainId.BITLAYER]: {\n name: 'Bitlayer Mainnet',\n chainId: EthChainId.BITLAYER,\n priceTokenAddress: '0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f', // WBTC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f',\n tokenSymbol: 'BTC',\n tokenDecimals: 18,\n explorerUrl: 'https://www.btrscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.btrscan.com/scan'\n },\n [EthChainId.MANTA_PACIFIC]: {\n name: 'Manta Pacific',\n chainId: EthChainId.MANTA_PACIFIC,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x0Dc808adcE2099A9F62AA87D9670745AbA741746',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://pacific-explorer.manta.network',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://pacific-explorer.manta.network'\n },\n [EthChainId.MANTLE]: {\n name: 'Mantle',\n chainId: EthChainId.MANTLE,\n priceTokenAddress: '0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8', // WMNT\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8',\n tokenSymbol: 'MNT',\n tokenDecimals: 18,\n explorerUrl: 'https://mantlescan.xyz',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.mantlescan.xyz'\n },\n [EthChainId.B2_MAINNET]: {\n name: 'B2 Mainnet',\n chainId: EthChainId.B2_MAINNET,\n priceTokenAddress: '0x4200000000000000000000000000000000000006', // WBTC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'BTC',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.bsquared.network',\n explorerApiType: ExplorerApiType.L2SCAN,\n explorerApi: 'https://explorer.bsquared.network/api'\n },\n [EthChainId.MODE]: {\n name: 'Mode Mainnet',\n chainId: EthChainId.MODE,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://modescan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan'\n },\n [EthChainId.BOB]: {\n name: 'Bob Mainnet',\n chainId: EthChainId.BOB,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.gobob.xyz',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer.gobob.xyz'\n },\n [EthChainId.FRAXTAL]: {\n name: 'Fraxtal Mainnet',\n chainId: EthChainId.FRAXTAL,\n priceTokenAddress: '0x0000000000000000000000000000000000000000', // wfrxETH\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xFC00000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://fraxscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.fraxscan.com'\n },\n [EthChainId.KUCOIN]: {\n name: 'KCC Mainnet',\n chainId: EthChainId.KUCOIN,\n priceTokenAddress: '0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521', // WCCS\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521',\n tokenSymbol: 'KCS',\n tokenDecimals: 18,\n explorerUrl: 'https://scan.kcc.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://scan.kcc.io'\n },\n [EthChainId.CONFLUX]: {\n name: 'Conflux eSpace',\n chainId: EthChainId.CONFLUX,\n priceTokenAddress: '0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b', // WCFX\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b',\n tokenSymbol: 'CFX',\n tokenDecimals: 18,\n explorerUrl: 'https://evm.confluxscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://evmapi.confluxscan.io'\n },\n [EthChainId.METIS]: {\n name: 'Metis',\n chainId: EthChainId.METIS,\n priceTokenAddress: '0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481', // WMETIS\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481',\n tokenSymbol: 'METIS',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.metis.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/'\n },\n [EthChainId.BEVM]: {\n name: 'BEVM',\n chainId: EthChainId.BEVM,\n priceTokenAddress: '0xB5136FEba197f5fF4B765E5b50c74db717796dcD', // WBTC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xB5136FEba197f5fF4B765E5b50c74db717796dcD',\n tokenSymbol: 'BTC',\n tokenDecimals: 18,\n explorerUrl: 'https://scan.bevm.io',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://scan.bevm.io'\n },\n [EthChainId.MERLIN_MAINNET]: {\n name: 'Merlin Mainnet',\n chainId: EthChainId.MERLIN_MAINNET,\n priceTokenAddress: '0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA', // WBTC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA',\n tokenSymbol: 'BTC',\n tokenDecimals: 18,\n explorerUrl: 'https://scan.merlinchain.io',\n explorerApiType: ExplorerApiType.L2SCAN,\n explorerApi: 'https://scan.merlinchain.io/api'\n },\n [EthChainId.LUMIO_TESTNET]: {\n name: 'Lumio Testnet',\n chainId: EthChainId.LUMIO_TESTNET,\n priceTokenAddress: '0x1F3dBeBA2513E87642750a278649dc828d054971',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x1F3dBeBA2513E87642750a278649dc828d054971',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.testnet.imola.movementlabs.xyz',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer.testnet.imola.movementlabs.xyz'\n },\n [EthChainId.MOVEMENT_EVM_TESTNET]: {\n name: 'Movement EVM Testnet',\n chainId: EthChainId.MOVEMENT_EVM_TESTNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x0000000000000000000000000000000000000000', // TODO\n tokenSymbol: 'MOVE',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.testnet.imola.movementlabs.xyz'\n },\n [EthChainId.CHILIZ]: {\n name: 'Chiliz',\n chainId: EthChainId.CHILIZ,\n priceTokenAddress: '0x721EF6871f1c4Efe730Dce047D40D1743B886946',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x721EF6871f1c4Efe730Dce047D40D1743B886946', // WCHZ\n tokenSymbol: 'CHZ',\n tokenDecimals: 18,\n explorerUrl: 'https://chiliscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.routescan.io/v2/network/mainnet/evm/88888/etherscan'\n },\n [EthChainId.ZKLINK_NOVA]: {\n name: 'zkLink Nova',\n chainId: EthChainId.ZKLINK_NOVA,\n priceTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenAddress: '0x000000000000000000000000000000000000800A', //special\n wrappedTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.zklink.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://explorer-api.zklink.io'\n },\n [EthChainId.AURORA]: {\n name: 'Auroa',\n chainId: EthChainId.AURORA,\n priceTokenAddress: '0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB',\n tokenAddress: '0x000000000000000000000000000000000000800A',\n wrappedTokenAddress: '0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.aurora.dev',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer.aurora.dev'\n },\n [EthChainId.SONIC_TESTNET]: {\n name: 'Sonic Testnet',\n chainId: EthChainId.SONIC_TESTNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenSymbol: 'FTM',\n tokenDecimals: 18,\n explorerUrl: 'https://testnet.soniclabs.com',\n explorerApiType: ExplorerApiType.L2SCAN,\n explorerApi: 'https://testnet.soniclabs.com'\n },\n [EthChainId.SONEIUM_TESTNET]: {\n name: 'Soneium Testnet',\n chainId: EthChainId.SONEIUM_TESTNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x728F2745410A56620B50a6E0592743450e08Cac6',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer-testnet.soneium.org',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer-testnet.soneium.org'\n },\n [EthChainId.CRONOS_ZKEVM]: {\n name: 'Cronos zkEVM',\n chainId: EthChainId.CRONOS_ZKEVM,\n priceTokenAddress: '0x000000000000000000000000000000000000800a',\n tokenAddress: '0x000000000000000000000000000000000000800a',\n wrappedTokenAddress: '0xc1bf55ee54e16229d9b369a5502bfe5fc9f20b6d',\n tokenSymbol: 'zkCRO',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.zkevm.cronos.org',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://explorer.zkevm.cronos.org'\n },\n [EthChainId.LYRA]: {\n name: 'Lyra',\n chainId: EthChainId.LYRA,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x15CEcd5190A43C7798dD2058308781D0662e678E',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.lyra.finance',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer.lyra.finance'\n },\n [EthChainId.UNCHAIN_SEPOLIA]: {\n name: 'Unchain Sepolia',\n chainId: EthChainId.UNCHAIN_SEPOLIA,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://unichain-sepolia.blockscout.com',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://unichain-sepolia.blockscout.com'\n }\n}\n\ntype ScanUrlSubType = 'block' | 'address' | 'tx' | 'token'\n\nfunction getEVMChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n // TODO l2scan address might be different\n let subtypeStr: string = subtype\n const supportedChain = EthChainInfo[chainId as ChainId]\n if (!supportedChain) {\n return\n }\n if (supportedChain.explorerApiType === ExplorerApiType.L2SCAN) {\n if (subtype === 'block') {\n subtypeStr = 'blocks'\n }\n }\n return `${supportedChain.explorerUrl}/${subtypeStr}/${hash}`\n}\n\n/**\n * BTC chains\n */\nexport const BTCChainInfo: Record<BTCChainId | string, ChainInfo> = {\n [BTCChainId.BTC_MAINNET]: {\n name: 'Bitcoin Mainnet',\n chainId: BTCChainId.BTC_MAINNET,\n explorerUrl: 'https://mempool.space'\n },\n [BTCChainId.BTC_TESTNET]: {\n name: 'Bitcoin Mainnet',\n chainId: BTCChainId.BTC_TESTNET,\n explorerUrl: 'https://mempool.space/testnet4'\n }\n}\n\nconst BtcSubTypePaths: Record<ScanUrlSubType, string | undefined> = {\n block: 'block',\n address: 'address',\n tx: 'tx',\n token: undefined\n}\n\nfunction getBtcChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n const hostName = BTCChainInfo[chainId]?.explorerUrl\n const subPath = BtcSubTypePaths[subtype]\n if (!hostName || !subPath) {\n return\n }\n return `${hostName}/${subPath}/${hash}`\n}\n\n/**\n * Aptos chains\n */\nexport const AptosChainInfo: Record<\n AptosChainId | string,\n ChainInfo & {\n suffix: string\n }\n> = {\n [AptosChainId.APTOS_MAINNET]: {\n name: 'Aptos Mainnet',\n chainId: AptosChainId.APTOS_MAINNET,\n explorerUrl: 'https://explorer.aptoslabs.com',\n suffix: '?network=mainnet'\n },\n [AptosChainId.APTOS_TESTNET]: {\n name: 'Aptos Testenet',\n chainId: AptosChainId.APTOS_TESTNET,\n explorerUrl: 'https://explorer.aptoslabs.com',\n suffix: '?network=mainnet'\n },\n [AptosChainId.APTOS_MOVEMENT_MAINNET]: {\n name: 'Movement Mainnet Aptos',\n chainId: AptosChainId.APTOS_MOVEMENT_MAINNET,\n explorerUrl: 'https://explorer.movementnetwork.xyz',\n suffix: '?network=mainnet'\n },\n [AptosChainId.APTOS_MOVEMENT_TESTNET]: {\n name: 'Movement Testnet Aptos',\n chainId: AptosChainId.APTOS_MOVEMENT_TESTNET,\n explorerUrl: 'https://explorer.movementnetwork.xyz',\n suffix: '?network=testnet'\n },\n [AptosChainId.APTOS_MOVEMENT_PORTO]: {\n name: 'Movement Porto Aptos',\n chainId: AptosChainId.APTOS_MOVEMENT_PORTO,\n explorerUrl: 'https://explorer.movementnetwork.xyz',\n suffix: '?porto+testnet'\n }\n}\nconst AptosSubTypePaths: Record<ScanUrlSubType, string | undefined> = {\n block: 'block',\n address: 'account',\n tx: 'txn',\n token: undefined\n}\nfunction getAptosChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n const { explorerUrl, suffix } = AptosChainInfo[chainId]\n const subPath = AptosSubTypePaths[subtype]\n if (!subPath) {\n return\n }\n return `${explorerUrl}/${subPath}/${hash}${suffix}`\n}\n\n/**\n * Solana\n */\nexport const SolanaChainInfo: Record<\n SolanaChainId | string,\n ChainInfo & {\n suffix: string\n }\n> = {\n [SolanaChainId.SOLANA_MAINNET]: {\n name: 'Solana Mainnet',\n chainId: SolanaChainId.SOLANA_MAINNET,\n explorerUrl: 'https://solscan.io/',\n suffix: ''\n },\n [SolanaChainId.SOLANA_TESTNET]: {\n name: 'Solana Testnet',\n chainId: SolanaChainId.SOLANA_MAINNET,\n explorerUrl: 'https://solscan.io/',\n suffix: '?cluster=testnet'\n }\n}\n\nconst SolanaSubTypePaths: Record<ScanUrlSubType, string | undefined> = {\n block: 'block',\n address: 'address',\n tx: 'tx',\n token: 'token'\n}\n\nfunction getSolanaChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n const { explorerUrl, suffix } = SolanaChainInfo[chainId]\n const subPath = SolanaSubTypePaths[subtype]\n if (!subPath) {\n return\n }\n return `${explorerUrl}${subPath}/${hash}${suffix}`\n}\n\n/**\n * Sui\n */\nconst SuiChainInfo: Record<SuiChainId | string, ChainInfo> = {\n [SuiChainId.SUI_MAINNET]: {\n name: 'Sui Mainnet',\n chainId: SuiChainId.SUI_MAINNET,\n explorerUrl: 'https://suivision.xyz'\n },\n [SuiChainId.SUI_TESTNET]: {\n name: 'Sui Testnet',\n chainId: SuiChainId.SUI_TESTNET,\n explorerUrl: 'https://testnet.suivision.xyz'\n }\n}\nconst SuibSubTypePaths: Record<ScanUrlSubType, string | undefined> = {\n block: 'checkpoint',\n address: 'account',\n tx: 'txblock',\n token: undefined\n}\n\nfunction getSuiChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n const { explorerUrl } = SuiChainInfo[chainId]\n const subPath = SuibSubTypePaths[subtype]\n if (!subPath) {\n return\n }\n return `${explorerUrl}/${subPath}/${hash}`\n}\n\n/**\n * Generate scan url of target chain and sub types.\n * @param chainId\n * @param hash\n * @param subtype\n * @returns\n */\nexport function getChainExternalUrl(\n chainId?: string | number,\n hash?: string,\n subtype?: ScanUrlSubType\n): string | undefined {\n if (!chainId || !hash || !subtype) {\n return\n }\n const chainIdStr = chainId.toString()\n if (Object.keys(EthChainInfo).includes(chainIdStr)) {\n // EVM\n return getEVMChainScanUrl(chainIdStr, hash, subtype)\n } else if (Object.keys(BTCChainInfo).includes(chainIdStr)) {\n // BTC\n return getBtcChainScanUrl(chainIdStr, hash, subtype)\n } else if (Object.keys(AptosChainInfo).includes(chainIdStr)) {\n // Aptos\n return getAptosChainScanUrl(chainIdStr, hash, subtype)\n } else if (Object.keys(SolanaChainInfo).includes(chainIdStr)) {\n // Solana\n return getSolanaChainScanUrl(chainIdStr, hash, subtype)\n } else if (Object.keys(SuiChainInfo).includes(chainIdStr)) {\n // Sui\n return getSuiChainScanUrl(chainIdStr, hash, subtype)\n }\n return\n}\n\nexport function getChainBlockscoutUrl(\n chainId?: string | number,\n hash?: string,\n subtype?: ScanUrlSubType\n): string | undefined {\n if (!chainId || !hash || !subtype) {\n return\n }\n const supportedChain = EthChainInfo[chainId as ChainId]\n if (!supportedChain) {\n return\n }\n if (!supportedChain.blockscoutUrl) {\n return\n }\n return `${supportedChain.blockscoutUrl}/${subtype}/${hash}`\n}\n","import { ChainId } from './chain-id'\nimport { EthChainInfo } from './chain-info'\n\nexport const CHAIN_MAP: Record<string, string> = {\n [ChainId.APTOS_MOVEMENT_MAINNET]: 'Movement Mainnet Aptos',\n [ChainId.APTOS_MOVEMENT_TESTNET]: 'Movement Testnet Aptos',\n [ChainId.APTOS_MOVEMENT_PORTO]: 'Movement Porto Aptos',\n [ChainId.SUI_MOVEMENT_MAINNET]: 'Movement Mainnet Sui',\n [ChainId.SUI_MOVEMENT_TESTNET]: 'Movement Testnet Sui',\n [ChainId.BTC_MAINNET]: 'Bitcoin Mainnet',\n [ChainId.BTC_TESTNET]: 'Bitcoin Testnet'\n}\n\nfor (const [key, value] of Object.entries(ChainId)) {\n if (CHAIN_MAP[value]) {\n continue\n }\n\n const chainInfo = EthChainInfo[value]\n if (chainInfo) {\n CHAIN_MAP[value] = chainInfo.name\n continue\n }\n\n const parts = key.split('_')\n CHAIN_MAP[value] = parts\n .map((part, index) => {\n return part[0] + part.slice(1).toLowerCase()\n })\n .join(' ')\n}\n\nexport function getChainName(chainId: string | number | null | undefined): string {\n if (typeof chainId === 'number') {\n chainId = chainId.toString()\n }\n if (chainId) {\n const name = CHAIN_MAP[chainId]\n if (name) {\n return name\n }\n }\n return chainId || ''\n}\n\n/**\n * @deprecated use getChainExternalUrl instead TODO(dazhan) to clean up\n * @param chainId\n * @param hash\n * @param subtype\n * @returns\n */\nexport function getChainScanUrl(\n chainId?: string | number,\n hash?: string,\n subtype?: 'block' | 'address' | 'transaction'\n): string | undefined {\n const chainName = getChainName(chainId)\n if (chainName === 'Ethereum') {\n if (subtype === 'block') {\n return `https://etherscan.io/block/${hash}`\n } else if (subtype === 'address') {\n return `https://etherscan.io/address/${hash}`\n } else {\n return `https://etherscan.io/tx/${hash}`\n }\n }\n if (chainName === 'Polygon') {\n if (subtype === 'block') {\n return `https://polygonscan.com/block/${hash}`\n } else if (subtype === 'address') {\n return `https://polygonscan.com/address/${hash}`\n } else {\n return `https://polygonscan.com/tx/${hash}`\n }\n }\n if (chainName.startsWith('Aptos ')) {\n let suffix = '?network=mainnet'\n if (chainName.includes('Testnet')) {\n suffix = '?network=testnet'\n } else if (chainName.includes('Devnet')) {\n suffix = '?network=devnet'\n }\n\n if (subtype === 'block') {\n return `https://explorer.aptoslabs.com/block/${hash}/${suffix}`\n } else if (subtype === 'address') {\n return `https://explorer.aptoslabs.com/account/${hash}/${suffix}`\n } else {\n return `https://explorer.aptoslabs.com/txn/${hash}/${suffix}`\n }\n }\n if (chainName.startsWith('Solana ')) {\n if (subtype === 'block') {\n return `https://explorer.solana.com/block/${hash}`\n } else if (subtype === 'address') {\n return `https://explorer.solana.com/address/${hash}`\n } else {\n return `https://explorer.solana.io/tx/${hash}`\n }\n }\n if (chainName.startsWith('Sui ')) {\n if (subtype === 'block') {\n return `https://suivision.xyz/checkpoint/${hash}`\n } else if (subtype === 'address') {\n return `https://suivision.xyz/account/${hash}`\n } else {\n return `https://suivision.xyz/txblock/${hash}`\n }\n }\n return undefined\n}\n","export * from './chain-id'\nexport * from './chain-info'\nexport * from './chain-name'\n"],"mappings":";oRAGA,IAAYA,GAAZ,SAAYA,EAAS,CACnBA,EAAA,OAAA,SACAA,EAAA,IAAA,MACAA,EAAA,MAAA,QACAA,EAAA,IAAA,MACAA,EAAA,IAAA,KACF,GANYA,IAASC,EAAA,UAATD,EAAS,CAAA,EAAA,EAQrB,IAAYE,GAAZ,SAAYA,EAAU,CACpBA,EAAA,SAAA,IACAA,EAAA,SAAA,KACAA,EAAA,OAAA,KACAA,EAAA,QAAA,KACAA,EAAA,QAAA,MACAA,EAAA,cAAA,MACAA,EAAA,eAAA,MACAA,EAAA,eAAA,MACAA,EAAA,WAAA,MACAA,EAAA,OAAA,MACAA,EAAA,QAAA,MACAA,EAAA,OAAA,MACAA,EAAA,aAAA,MACAA,EAAA,WAAA,MACAA,EAAA,eAAA,MACAA,EAAA,MAAA,MACAA,EAAA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,mBACAD,EAAU,SAAS,QAAQ,IACpCC,EAAS,mBAGPF,IAAY,QACP,wCAAwCD,KAAQG,IAC9CF,IAAY,UACd,0CAA0CD,KAAQG,IAElD,sCAAsCH,KAAQG,IAGzD,GAAID,EAAU,WAAW,SAAS,EAChC,OAAID,IAAY,QACP,qCAAqCD,IACnCC,IAAY,UACd,uCAAuCD,IAEvC,iCAAiCA,IAG5C,GAAIE,EAAU,WAAW,MAAM,EAC7B,OAAID,IAAY,QACP,oCAAoCD,IAClCC,IAAY,UACd,iCAAiCD,IAEjC,iCAAiCA,GAI9C,CA3DAX,EAAA,gBAAAU,yfCpDAK,EAAA,IAAAC,CAAA,EACAD,EAAA,IAAAC,CAAA,EACAD,EAAA,IAAAC,CAAA","names":["ChainType","exports","EthChainId","AptosChainId","SuiChainId","SolanaChainId","FuelChainId","CosmosChainId","StarknetChainId","BTCChainId","getChainType","chainId","id","chain_id_1","ExplorerApiType","exports","getEVMChainScanUrl","chainId","hash","subtype","subtypeStr","supportedChain","BtcSubTypePaths","getBtcChainScanUrl","hostName","subPath","AptosSubTypePaths","getAptosChainScanUrl","explorerUrl","suffix","SolanaSubTypePaths","getSolanaChainScanUrl","SuiChainInfo","SuibSubTypePaths","getSuiChainScanUrl","getChainExternalUrl","chainIdStr","getChainBlockscoutUrl","chain_id_1","chain_info_1","exports","key","value","chainInfo","parts","part","index","getChainName","chainId","name","getChainScanUrl","hash","subtype","chainName","suffix","__exportStar","exports"]}
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/.pnpm/@sentio+chain@2.1.12/node_modules/@sentio/chain/src/chain-id.ts","../../../node_modules/.pnpm/@sentio+chain@2.1.12/node_modules/@sentio/chain/src/chain-info.ts","../../../node_modules/.pnpm/@sentio+chain@2.1.12/node_modules/@sentio/chain/src/chain-name.ts","../../../node_modules/.pnpm/@sentio+chain@2.1.12/node_modules/@sentio/chain/src/index.ts"],"sourcesContent":["// copy from https://github.com/DefiLlama/chainlist/blob/main/constants/chainIds.js\n// and https://besu.hyperledger.org/en/stable/Concepts/NetworkID-And-ChainID/\n\nexport enum ChainType {\n SOLANA = 'solana',\n SUI = 'sui',\n APTOS = 'aptos',\n ETH = 'evm',\n BTC = 'btc'\n}\n\nexport enum EthChainId { // Any modify to this must also be modify in EthChainName\n ETHEREUM = '1',\n OPTIMISM = '10',\n CRONOS = '25',\n BINANCE = '56',\n POLYGON = '137',\n MANTA_PACIFIC = '169',\n XLAYER_TESTNET = '195',\n XLAYER_MAINNET = '196',\n B2_MAINNET = '223',\n FANTOM = '250',\n FRAXTAL = '252',\n KUCOIN = '321',\n CRONOS_ZKEVM = '388',\n ZKSYNC_ERA = '324',\n CRONOS_TESTNET = '338',\n ASTAR = '592',\n LYRA = '957',\n POLYGON_ZKEVM = '1101',\n CONFLUX = '1030',\n METIS = '1088',\n MOONBEAM = '1284',\n UNCHAIN_SEPOLIA = '1301',\n SONEIUM_TESTNET = '1946',\n BEVM = '11501',\n MERLIN_MAINNET = '4200',\n MANTLE = '5000',\n BASE = '8453',\n LUMIO_TESTNET = '9990',\n HOLESKY = '17000',\n ASTAR_ZKEVM = '3776',\n MOVEMENT_EVM_TESTNET = '30732',\n MODE = '34443',\n ARBITRUM = '42161',\n AVALANCHE = '43114',\n ZIRCUIT_TESTNET = '48899',\n ZIRCUIT_MAINNET = '48900',\n BOB = '60808',\n LINEA = '59144',\n SONIC_TESTNET = '64165',\n BLAST = '81457',\n CHILIZ = '88888',\n TAIKO = '167000',\n TAIKO_TESTNET = '167008',\n BITLAYER = '200901',\n SCROLL = '534352',\n ZKLINK_NOVA = '810180',\n SEPOLIA = '11155111',\n AURORA = '1313161554',\n BLAST_SEPOLIA = '168587773'\n}\n\nexport enum AptosChainId {\n APTOS_MAINNET = 'aptos_mainnet',\n APTOS_TESTNET = 'aptos_testnet',\n // APTOS_DEVNET = 'aptos_devnet',\n APTOS_MOVEMENT_TESTNET = 'aptos_m2_testnet', // TODO remove\n APTOS_MOVEMENT_PORTO = 'aptos_movement_porto',\n APTOS_MOVEMENT_MAINNET = 'aptos_movement_mainnet'\n}\n\nexport enum SuiChainId {\n SUI_MAINNET = 'sui_mainnet',\n SUI_TESTNET = 'sui_testnet',\n // SUI_DEVNET = 'sui_devnet',\n SUI_MOVEMENT_TESTNET = 'sui_m2_testnet',\n SUI_MOVEMENT_MAINNET = 'sui_m2_mainnet'\n}\n\nexport enum SolanaChainId {\n SOLANA_MAINNET = 'sol_mainnet',\n SOLANA_DEVNET = 'sol_devnet',\n SOLANA_TESTNET = 'sol_testnet',\n SOLANA_PYTH = 'sol_pyth'\n}\nexport enum FuelChainId {\n FUEL_MAINNET = 'fuel_mainnet',\n FUEL_TESTNET = 'fuel_testnet'\n}\n\nexport enum CosmosChainId {\n INJECTIVE_MAINNET = 'injective_mainnet',\n INJECTIVE_TESTNET = 'injective_testnet'\n}\n\nexport enum StarknetChainId {\n STARKNET_MAINNET = 'starknet_mainnet',\n STARKNET_SEPOLIA = 'starknet_sepolia'\n}\n\nexport enum BTCChainId {\n BTC_MAINNET = 'btc_mainnet',\n BTC_TESTNET = 'btc_testnet'\n}\n\nexport type ChainId =\n | EthChainId\n | AptosChainId\n | SuiChainId\n | SolanaChainId\n | FuelChainId\n | CosmosChainId\n | StarknetChainId\n | BTCChainId\nexport const ChainId = {\n ...EthChainId,\n ...AptosChainId,\n ...SuiChainId,\n ...SolanaChainId,\n ...FuelChainId,\n ...CosmosChainId,\n ...StarknetChainId,\n ...BTCChainId\n}\n\nexport function getChainType(chainId?: string | number): ChainType {\n const id = String(chainId).toLowerCase()\n if (id.startsWith('sol')) {\n return ChainType.SOLANA\n }\n if (id.startsWith('sui')) {\n return ChainType.SUI\n }\n if (id.startsWith('apt')) {\n return ChainType.APTOS\n }\n if (id.startsWith('btc')) {\n return ChainType.BTC\n }\n return ChainType.ETH\n}\n","import { AptosChainId, BTCChainId, ChainId, EthChainId, SolanaChainId, SuiChainId } from './chain-id'\n\nexport enum ExplorerApiType {\n ETHERSCAN = 'etherscan',\n BLOCKSCOUT = 'blockscout',\n L2SCAN = 'l2scan',\n OKLINK = 'oklink'\n}\n\nexport type ChainInfo = {\n name: string\n chainId: ChainId\n explorerUrl: string\n}\n\nexport type EthChainInfo = ChainInfo & {\n mainnetChainId?: EthChainId\n chainId: EthChainId\n tokenAddress: string // native token address\n tokenSymbol: string // native token symbol\n tokenDecimals: number // native token decimals\n priceTokenAddress: string // token address for price\n wrappedTokenAddress: string // wrapped token address with contract, normally Wxxx (Wrapped xxx)\n\n explorerApiType?: string\n explorerApi?: string\n blockscoutUrl?: string\n}\n\n/**\n * EVM chains\n */\nexport const EthChainInfo: Record<EthChainId | string, EthChainInfo> = {\n [EthChainId.ETHEREUM]: {\n name: 'Ethereum',\n chainId: EthChainId.ETHEREUM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://etherscan.io',\n explorerApi: 'https://api.etherscan.io',\n blockscoutUrl: 'https://eth.blockscout.com'\n },\n [EthChainId.SEPOLIA]: {\n name: 'Sepolia',\n chainId: EthChainId.SEPOLIA,\n mainnetChainId: EthChainId.ETHEREUM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x1ef5f52bdbe11af2377c58ecc914a8c72ea807cf',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://sepolia.etherscan.io',\n explorerApi: 'https://api-sepolia.etherscan.io',\n blockscoutUrl: 'https://eth-sepolia.blockscout.com'\n },\n [EthChainId.HOLESKY]: {\n name: 'Holesky',\n chainId: EthChainId.HOLESKY,\n mainnetChainId: EthChainId.ETHEREUM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x94373a4919B3240D86eA41593D5eBa789FEF3848',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://holesky.etherscan.io',\n explorerApi: 'https://api-holesky.etherscan.io',\n blockscoutUrl: 'https://eth-holesky.blockscout.com'\n },\n [EthChainId.BINANCE]: {\n name: 'Binance',\n chainId: EthChainId.BINANCE,\n priceTokenAddress: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c',\n tokenSymbol: 'BNB',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://bscscan.com',\n explorerApi: 'https://api.bscscan.com'\n },\n [EthChainId.POLYGON]: {\n name: 'Polygon',\n chainId: EthChainId.POLYGON,\n priceTokenAddress: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC\n tokenSymbol: 'MATIC',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://polygonscan.com',\n explorerApi: 'https://api.polygonscan.com'\n // blockscoutBlockPrefix: 'https://polygon.blockscout.com/block/',\n },\n [EthChainId.ARBITRUM]: {\n name: 'Arbitrum',\n chainId: EthChainId.ARBITRUM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://arbiscan.io',\n explorerApi: 'https://api.arbiscan.io'\n },\n [EthChainId.AVALANCHE]: {\n name: 'Avalanche',\n chainId: EthChainId.AVALANCHE,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://snowtrace.io',\n explorerApi: 'https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan'\n },\n [EthChainId.POLYGON_ZKEVM]: {\n name: 'Polygon zkEVM',\n chainId: EthChainId.POLYGON_ZKEVM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://zkevm.polygonscan.com',\n explorerApi: 'https://api-zkevm.polygonscan.com'\n },\n [EthChainId.MOONBEAM]: {\n name: 'Moonbeam',\n chainId: EthChainId.MOONBEAM,\n priceTokenAddress: '0xacc15dc74880c9944775448304b263d191c6077f', // WGLMR\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xacc15dc74880c9944775448304b263d191c6077f',\n tokenSymbol: 'GLMR',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerUrl: 'https://moonscan.io',\n explorerApi: 'https://api-moonbeam.moonscan.io'\n },\n [EthChainId.ASTAR]: {\n name: 'Astar',\n chainId: EthChainId.ASTAR,\n priceTokenAddress: '0xaeaaf0e2c81af264101b9129c00f4440ccf0f720', // WASTR\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xaeaaf0e2c81af264101b9129c00f4440ccf0f720',\n tokenSymbol: 'ASTR',\n tokenDecimals: 18,\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerUrl: 'https://astar.blockscout.com',\n explorerApi: 'https://astar.blockscout.com'\n },\n [EthChainId.ASTAR_ZKEVM]: {\n name: 'Astar zkEVM',\n chainId: EthChainId.ASTAR_ZKEVM,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xE9CC37904875B459Fa5D0FE37680d36F1ED55e38',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://astar-zkevm.explorer.startale.com',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://astar-zkevm.explorer.startale.com'\n },\n [EthChainId.LINEA]: {\n name: 'Linea',\n chainId: EthChainId.LINEA,\n priceTokenAddress: '0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f', // WETH\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://lineascan.build',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.lineascan.build'\n },\n [EthChainId.SCROLL]: {\n name: 'Scroll',\n chainId: EthChainId.SCROLL,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x5300000000000000000000000000000000000004', // TODO questionable\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://scrollscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.scrollscan.com'\n },\n [EthChainId.TAIKO]: {\n name: 'Taiko Mainnet',\n chainId: EthChainId.TAIKO,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xA51894664A773981C6C112C43ce576f315d5b1B6',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://taikoscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.taikoscan.io'\n },\n [EthChainId.TAIKO_TESTNET]: {\n name: 'Taiko Testnet',\n chainId: EthChainId.TAIKO_TESTNET,\n mainnetChainId: EthChainId.TAIKO,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xae2C46ddb314B9Ba743C6dEE4878F151881333D9',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://hekla.taikoscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api-hekla.taikoscan.io'\n },\n [EthChainId.XLAYER_TESTNET]: {\n name: 'X Layer Testnet',\n chainId: EthChainId.XLAYER_TESTNET,\n mainnetChainId: EthChainId.XLAYER_MAINNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xa749ad81913cdc19881ebeb64631df72be708335',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://www.oklink.com/xlayer-test',\n explorerApiType: ExplorerApiType.OKLINK,\n explorerApi: 'https://www.oklink.com/api/v5/explorer'\n },\n [EthChainId.XLAYER_MAINNET]: {\n name: 'X Layer Mainnet',\n chainId: EthChainId.XLAYER_MAINNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x5a77f1443d16ee5761d310e38b62f77f726bc71c',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://www.oklink.com/xlayer',\n explorerApiType: ExplorerApiType.OKLINK,\n explorerApi: 'https://www.oklink.com/api/v5/explorer'\n },\n [EthChainId.BLAST]: {\n name: 'Blast Mainnet',\n chainId: EthChainId.BLAST,\n priceTokenAddress: '0x4300000000000000000000000000000000000004',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4300000000000000000000000000000000000004',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://blastscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.blastscan.io'\n },\n [EthChainId.BLAST_SEPOLIA]: {\n name: 'Blast Mainnet',\n chainId: EthChainId.BLAST_SEPOLIA,\n mainnetChainId: EthChainId.BLAST,\n priceTokenAddress: '0x4200000000000000000000000000000000000023',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000023',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://sepolia.blastscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api-sepolia.blastscan.io'\n },\n [EthChainId.BASE]: {\n name: 'Base',\n chainId: EthChainId.BASE,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://basescan.org',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.basescan.org'\n },\n [EthChainId.ZKSYNC_ERA]: {\n name: 'zkSync Era',\n chainId: EthChainId.ZKSYNC_ERA,\n priceTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenAddress: '0x000000000000000000000000000000000000800A',\n wrappedTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.zksync.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://block-explorer-api.mainnet.zksync.io'\n },\n [EthChainId.ZIRCUIT_TESTNET]: {\n name: 'Zircuit Testnet',\n chainId: EthChainId.ZIRCUIT_TESTNET,\n mainnetChainId: EthChainId.ZIRCUIT_MAINNET,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.testnet.zircuit.com'\n },\n [EthChainId.ZIRCUIT_MAINNET]: {\n name: 'Zircuit Mainnet',\n chainId: EthChainId.ZIRCUIT_MAINNET,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.zircuit.com'\n },\n [EthChainId.FANTOM]: {\n name: 'Fantom Opera',\n chainId: EthChainId.FANTOM,\n priceTokenAddress: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83', // WFTM\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83',\n tokenSymbol: 'WFTM',\n tokenDecimals: 18,\n explorerUrl: 'https://ftmscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.ftmscan.com'\n },\n [EthChainId.OPTIMISM]: {\n name: 'Optimism Mainnet',\n chainId: EthChainId.OPTIMISM,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://optimistic.etherscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api-optimistic.etherscan.io'\n },\n [EthChainId.CRONOS]: {\n name: 'Cronos Mainnet',\n chainId: EthChainId.CRONOS,\n priceTokenAddress: '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23', // WCRO\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23',\n tokenSymbol: 'CRO',\n tokenDecimals: 18,\n explorerUrl: 'https://cronoscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.cronoscan.com'\n },\n [EthChainId.CRONOS_TESTNET]: {\n name: 'Cronos Testnet',\n chainId: EthChainId.CRONOS_TESTNET,\n mainnetChainId: EthChainId.CRONOS,\n priceTokenAddress: '0x6a3173618859c7cd40faf6921b5e9eb6a76f1fd4', // WCRO\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x6a3173618859c7cd40faf6921b5e9eb6a76f1fd4',\n tokenSymbol: 'CRO',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.cronos.org/testnet'\n },\n [EthChainId.BITLAYER]: {\n name: 'Bitlayer Mainnet',\n chainId: EthChainId.BITLAYER,\n priceTokenAddress: '0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f', // WBTC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f',\n tokenSymbol: 'BTC',\n tokenDecimals: 18,\n explorerUrl: 'https://www.btrscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.btrscan.com/scan'\n },\n [EthChainId.MANTA_PACIFIC]: {\n name: 'Manta Pacific',\n chainId: EthChainId.MANTA_PACIFIC,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x0Dc808adcE2099A9F62AA87D9670745AbA741746',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://pacific-explorer.manta.network',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://pacific-explorer.manta.network'\n },\n [EthChainId.MANTLE]: {\n name: 'Mantle',\n chainId: EthChainId.MANTLE,\n priceTokenAddress: '0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8', // WMNT\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x78c1b0c915c4faa5fffa6cabf0219da63d7f4cb8',\n tokenSymbol: 'MNT',\n tokenDecimals: 18,\n explorerUrl: 'https://mantlescan.xyz',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.mantlescan.xyz'\n },\n [EthChainId.B2_MAINNET]: {\n name: 'B2 Mainnet',\n chainId: EthChainId.B2_MAINNET,\n priceTokenAddress: '0x4200000000000000000000000000000000000006', // WBTC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'BTC',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.bsquared.network',\n explorerApiType: ExplorerApiType.L2SCAN,\n explorerApi: 'https://explorer.bsquared.network/api'\n },\n [EthChainId.MODE]: {\n name: 'Mode Mainnet',\n chainId: EthChainId.MODE,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://modescan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.routescan.io/v2/network/mainnet/evm/34443/etherscan'\n },\n [EthChainId.BOB]: {\n name: 'Bob Mainnet',\n chainId: EthChainId.BOB,\n priceTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.gobob.xyz',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer.gobob.xyz'\n },\n [EthChainId.FRAXTAL]: {\n name: 'Fraxtal Mainnet',\n chainId: EthChainId.FRAXTAL,\n priceTokenAddress: '0x0000000000000000000000000000000000000000', // wfrxETH\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xFC00000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://fraxscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.fraxscan.com'\n },\n [EthChainId.KUCOIN]: {\n name: 'KCC Mainnet',\n chainId: EthChainId.KUCOIN,\n priceTokenAddress: '0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521', // WCCS\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4446Fc4eb47f2f6586f9fAAb68B3498F86C07521',\n tokenSymbol: 'KCS',\n tokenDecimals: 18,\n explorerUrl: 'https://scan.kcc.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://scan.kcc.io'\n },\n [EthChainId.CONFLUX]: {\n name: 'Conflux eSpace',\n chainId: EthChainId.CONFLUX,\n priceTokenAddress: '0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b', // WCFX\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x14b2d3bc65e74dae1030eafd8ac30c533c976a9b',\n tokenSymbol: 'CFX',\n tokenDecimals: 18,\n explorerUrl: 'https://evm.confluxscan.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://evmapi.confluxscan.io'\n },\n [EthChainId.METIS]: {\n name: 'Metis',\n chainId: EthChainId.METIS,\n priceTokenAddress: '0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481', // WMETIS\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x75cb093E4D61d2A2e65D8e0BBb01DE8d89b53481',\n tokenSymbol: 'METIS',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.metis.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.routescan.io/v2/network/mainnet/evm/1088/etherscan/'\n },\n [EthChainId.BEVM]: {\n name: 'BEVM',\n chainId: EthChainId.BEVM,\n priceTokenAddress: '0xB5136FEba197f5fF4B765E5b50c74db717796dcD', // WBTC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xB5136FEba197f5fF4B765E5b50c74db717796dcD',\n tokenSymbol: 'BTC',\n tokenDecimals: 18,\n explorerUrl: 'https://scan.bevm.io',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://scan.bevm.io'\n },\n [EthChainId.MERLIN_MAINNET]: {\n name: 'Merlin Mainnet',\n chainId: EthChainId.MERLIN_MAINNET,\n priceTokenAddress: '0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA', // WBTC\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0xF6D226f9Dc15d9bB51182815b320D3fBE324e1bA',\n tokenSymbol: 'BTC',\n tokenDecimals: 18,\n explorerUrl: 'https://scan.merlinchain.io',\n explorerApiType: ExplorerApiType.L2SCAN,\n explorerApi: 'https://scan.merlinchain.io/api'\n },\n [EthChainId.LUMIO_TESTNET]: {\n name: 'Lumio Testnet',\n chainId: EthChainId.LUMIO_TESTNET,\n priceTokenAddress: '0x1F3dBeBA2513E87642750a278649dc828d054971',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x1F3dBeBA2513E87642750a278649dc828d054971',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.testnet.imola.movementlabs.xyz',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer.testnet.imola.movementlabs.xyz'\n },\n [EthChainId.MOVEMENT_EVM_TESTNET]: {\n name: 'Movement EVM Testnet',\n chainId: EthChainId.MOVEMENT_EVM_TESTNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x0000000000000000000000000000000000000000', // TODO\n tokenSymbol: 'MOVE',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.testnet.imola.movementlabs.xyz'\n },\n [EthChainId.CHILIZ]: {\n name: 'Chiliz',\n chainId: EthChainId.CHILIZ,\n priceTokenAddress: '0x721EF6871f1c4Efe730Dce047D40D1743B886946',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x721EF6871f1c4Efe730Dce047D40D1743B886946', // WCHZ\n tokenSymbol: 'CHZ',\n tokenDecimals: 18,\n explorerUrl: 'https://chiliscan.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.routescan.io/v2/network/mainnet/evm/88888/etherscan'\n },\n [EthChainId.ZKLINK_NOVA]: {\n name: 'zkLink Nova',\n chainId: EthChainId.ZKLINK_NOVA,\n priceTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenAddress: '0x000000000000000000000000000000000000800A', //special\n wrappedTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.zklink.io',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://explorer-api.zklink.io'\n },\n [EthChainId.AURORA]: {\n name: 'Auroa',\n chainId: EthChainId.AURORA,\n priceTokenAddress: '0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB',\n tokenAddress: '0x000000000000000000000000000000000000800A',\n wrappedTokenAddress: '0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.aurora.dev',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer.aurora.dev'\n },\n [EthChainId.SONIC_TESTNET]: {\n name: 'Sonic Testnet',\n chainId: EthChainId.SONIC_TESTNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x000000000000000000000000000000000000800A',\n tokenSymbol: 'S',\n tokenDecimals: 18,\n explorerUrl: 'https://scan.soniclabs.com',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://api.routescan.io/v2/network/testnet/evm/64165/etherscan'\n },\n [EthChainId.SONEIUM_TESTNET]: {\n name: 'Soneium Testnet',\n chainId: EthChainId.SONEIUM_TESTNET,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x728F2745410A56620B50a6E0592743450e08Cac6',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer-testnet.soneium.org',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer-testnet.soneium.org'\n },\n [EthChainId.CRONOS_ZKEVM]: {\n name: 'Cronos zkEVM',\n chainId: EthChainId.CRONOS_ZKEVM,\n priceTokenAddress: '0x000000000000000000000000000000000000800a',\n tokenAddress: '0x000000000000000000000000000000000000800a',\n wrappedTokenAddress: '0xc1bf55ee54e16229d9b369a5502bfe5fc9f20b6d',\n tokenSymbol: 'zkCRO',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.zkevm.cronos.org',\n explorerApiType: ExplorerApiType.ETHERSCAN,\n explorerApi: 'https://explorer.zkevm.cronos.org'\n },\n [EthChainId.LYRA]: {\n name: 'Lyra',\n chainId: EthChainId.LYRA,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x15CEcd5190A43C7798dD2058308781D0662e678E',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://explorer.lyra.finance',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://explorer.lyra.finance'\n },\n [EthChainId.UNCHAIN_SEPOLIA]: {\n name: 'Unchain Sepolia',\n chainId: EthChainId.UNCHAIN_SEPOLIA,\n priceTokenAddress: '0x0000000000000000000000000000000000000000',\n tokenAddress: '0x0000000000000000000000000000000000000000',\n wrappedTokenAddress: '0x4200000000000000000000000000000000000006',\n tokenSymbol: 'ETH',\n tokenDecimals: 18,\n explorerUrl: 'https://unichain-sepolia.blockscout.com',\n explorerApiType: ExplorerApiType.BLOCKSCOUT,\n explorerApi: 'https://unichain-sepolia.blockscout.com'\n }\n}\n\ntype ScanUrlSubType = 'block' | 'address' | 'tx' | 'token'\n\nfunction getEVMChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n // TODO l2scan address might be different\n let subtypeStr: string = subtype\n const supportedChain = EthChainInfo[chainId as ChainId]\n if (!supportedChain) {\n return\n }\n if (supportedChain.explorerApiType === ExplorerApiType.L2SCAN) {\n if (subtype === 'block') {\n subtypeStr = 'blocks'\n }\n }\n return `${supportedChain.explorerUrl}/${subtypeStr}/${hash}`\n}\n\n/**\n * BTC chains\n */\nexport const BTCChainInfo: Record<BTCChainId | string, ChainInfo> = {\n [BTCChainId.BTC_MAINNET]: {\n name: 'Bitcoin Mainnet',\n chainId: BTCChainId.BTC_MAINNET,\n explorerUrl: 'https://mempool.space'\n },\n [BTCChainId.BTC_TESTNET]: {\n name: 'Bitcoin Mainnet',\n chainId: BTCChainId.BTC_TESTNET,\n explorerUrl: 'https://mempool.space/testnet4'\n }\n}\n\nconst BtcSubTypePaths: Record<ScanUrlSubType, string | undefined> = {\n block: 'block',\n address: 'address',\n tx: 'tx',\n token: undefined\n}\n\nfunction getBtcChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n const hostName = BTCChainInfo[chainId]?.explorerUrl\n const subPath = BtcSubTypePaths[subtype]\n if (!hostName || !subPath) {\n return\n }\n return `${hostName}/${subPath}/${hash}`\n}\n\n/**\n * Aptos chains\n */\nexport const AptosChainInfo: Record<\n AptosChainId | string,\n ChainInfo & {\n suffix: string\n }\n> = {\n [AptosChainId.APTOS_MAINNET]: {\n name: 'Aptos Mainnet',\n chainId: AptosChainId.APTOS_MAINNET,\n explorerUrl: 'https://explorer.aptoslabs.com',\n suffix: '?network=mainnet'\n },\n [AptosChainId.APTOS_TESTNET]: {\n name: 'Aptos Testenet',\n chainId: AptosChainId.APTOS_TESTNET,\n explorerUrl: 'https://explorer.aptoslabs.com',\n suffix: '?network=mainnet'\n },\n [AptosChainId.APTOS_MOVEMENT_MAINNET]: {\n name: 'Movement Mainnet Aptos',\n chainId: AptosChainId.APTOS_MOVEMENT_MAINNET,\n explorerUrl: 'https://explorer.movementnetwork.xyz',\n suffix: '?network=mainnet'\n },\n [AptosChainId.APTOS_MOVEMENT_TESTNET]: {\n name: 'Movement Testnet Aptos',\n chainId: AptosChainId.APTOS_MOVEMENT_TESTNET,\n explorerUrl: 'https://explorer.movementnetwork.xyz',\n suffix: '?network=testnet'\n },\n [AptosChainId.APTOS_MOVEMENT_PORTO]: {\n name: 'Movement Porto Aptos',\n chainId: AptosChainId.APTOS_MOVEMENT_PORTO,\n explorerUrl: 'https://explorer.movementnetwork.xyz',\n suffix: '?porto+testnet'\n }\n}\nconst AptosSubTypePaths: Record<ScanUrlSubType, string | undefined> = {\n block: 'block',\n address: 'account',\n tx: 'txn',\n token: undefined\n}\nfunction getAptosChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n const { explorerUrl, suffix } = AptosChainInfo[chainId]\n const subPath = AptosSubTypePaths[subtype]\n if (!subPath) {\n return\n }\n return `${explorerUrl}/${subPath}/${hash}${suffix}`\n}\n\n/**\n * Solana\n */\nexport const SolanaChainInfo: Record<\n SolanaChainId | string,\n ChainInfo & {\n suffix: string\n }\n> = {\n [SolanaChainId.SOLANA_MAINNET]: {\n name: 'Solana Mainnet',\n chainId: SolanaChainId.SOLANA_MAINNET,\n explorerUrl: 'https://solscan.io/',\n suffix: ''\n },\n [SolanaChainId.SOLANA_TESTNET]: {\n name: 'Solana Testnet',\n chainId: SolanaChainId.SOLANA_MAINNET,\n explorerUrl: 'https://solscan.io/',\n suffix: '?cluster=testnet'\n }\n}\n\nconst SolanaSubTypePaths: Record<ScanUrlSubType, string | undefined> = {\n block: 'block',\n address: 'address',\n tx: 'tx',\n token: 'token'\n}\n\nfunction getSolanaChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n const { explorerUrl, suffix } = SolanaChainInfo[chainId]\n const subPath = SolanaSubTypePaths[subtype]\n if (!subPath) {\n return\n }\n return `${explorerUrl}${subPath}/${hash}${suffix}`\n}\n\n/**\n * Sui\n */\nconst SuiChainInfo: Record<SuiChainId | string, ChainInfo> = {\n [SuiChainId.SUI_MAINNET]: {\n name: 'Sui Mainnet',\n chainId: SuiChainId.SUI_MAINNET,\n explorerUrl: 'https://suivision.xyz'\n },\n [SuiChainId.SUI_TESTNET]: {\n name: 'Sui Testnet',\n chainId: SuiChainId.SUI_TESTNET,\n explorerUrl: 'https://testnet.suivision.xyz'\n }\n}\nconst SuibSubTypePaths: Record<ScanUrlSubType, string | undefined> = {\n block: 'checkpoint',\n address: 'account',\n tx: 'txblock',\n token: undefined\n}\n\nfunction getSuiChainScanUrl(chainId: string | number, hash: string, subtype: ScanUrlSubType) {\n const { explorerUrl } = SuiChainInfo[chainId]\n const subPath = SuibSubTypePaths[subtype]\n if (!subPath) {\n return\n }\n return `${explorerUrl}/${subPath}/${hash}`\n}\n\n/**\n * Generate scan url of target chain and sub types.\n * @param chainId\n * @param hash\n * @param subtype\n * @returns\n */\nexport function getChainExternalUrl(\n chainId?: string | number,\n hash?: string,\n subtype?: ScanUrlSubType\n): string | undefined {\n if (!chainId || !hash || !subtype) {\n return\n }\n const chainIdStr = chainId.toString()\n if (Object.keys(EthChainInfo).includes(chainIdStr)) {\n // EVM\n return getEVMChainScanUrl(chainIdStr, hash, subtype)\n } else if (Object.keys(BTCChainInfo).includes(chainIdStr)) {\n // BTC\n return getBtcChainScanUrl(chainIdStr, hash, subtype)\n } else if (Object.keys(AptosChainInfo).includes(chainIdStr)) {\n // Aptos\n return getAptosChainScanUrl(chainIdStr, hash, subtype)\n } else if (Object.keys(SolanaChainInfo).includes(chainIdStr)) {\n // Solana\n return getSolanaChainScanUrl(chainIdStr, hash, subtype)\n } else if (Object.keys(SuiChainInfo).includes(chainIdStr)) {\n // Sui\n return getSuiChainScanUrl(chainIdStr, hash, subtype)\n }\n return\n}\n\nexport function getChainBlockscoutUrl(\n chainId?: string | number,\n hash?: string,\n subtype?: ScanUrlSubType\n): string | undefined {\n if (!chainId || !hash || !subtype) {\n return\n }\n const supportedChain = EthChainInfo[chainId as ChainId]\n if (!supportedChain) {\n return\n }\n if (!supportedChain.blockscoutUrl) {\n return\n }\n return `${supportedChain.blockscoutUrl}/${subtype}/${hash}`\n}\n","import { ChainId } from './chain-id'\nimport { EthChainInfo } from './chain-info'\n\nexport const CHAIN_MAP: Record<string, string> = {\n [ChainId.APTOS_MOVEMENT_MAINNET]: 'Movement Mainnet Aptos',\n [ChainId.APTOS_MOVEMENT_TESTNET]: 'Movement Testnet Aptos',\n [ChainId.APTOS_MOVEMENT_PORTO]: 'Movement Porto Aptos',\n [ChainId.SUI_MOVEMENT_MAINNET]: 'Movement Mainnet Sui',\n [ChainId.SUI_MOVEMENT_TESTNET]: 'Movement Testnet Sui',\n [ChainId.BTC_MAINNET]: 'Bitcoin Mainnet',\n [ChainId.BTC_TESTNET]: 'Bitcoin Testnet'\n}\n\nfor (const [key, value] of Object.entries(ChainId)) {\n if (CHAIN_MAP[value]) {\n continue\n }\n\n const chainInfo = EthChainInfo[value]\n if (chainInfo) {\n CHAIN_MAP[value] = chainInfo.name\n continue\n }\n\n const parts = key.split('_')\n CHAIN_MAP[value] = parts\n .map((part, index) => {\n return part[0] + part.slice(1).toLowerCase()\n })\n .join(' ')\n}\n\nexport function getChainName(chainId: string | number | null | undefined): string {\n if (typeof chainId === 'number') {\n chainId = chainId.toString()\n }\n if (chainId) {\n const name = CHAIN_MAP[chainId]\n if (name) {\n return name\n }\n }\n return chainId || ''\n}\n\n/**\n * @deprecated use getChainExternalUrl instead TODO(dazhan) to clean up\n * @param chainId\n * @param hash\n * @param subtype\n * @returns\n */\nexport function getChainScanUrl(\n chainId?: string | number,\n hash?: string,\n subtype?: 'block' | 'address' | 'transaction'\n): string | undefined {\n const chainName = getChainName(chainId)\n if (chainName === 'Ethereum') {\n if (subtype === 'block') {\n return `https://etherscan.io/block/${hash}`\n } else if (subtype === 'address') {\n return `https://etherscan.io/address/${hash}`\n } else {\n return `https://etherscan.io/tx/${hash}`\n }\n }\n if (chainName === 'Polygon') {\n if (subtype === 'block') {\n return `https://polygonscan.com/block/${hash}`\n } else if (subtype === 'address') {\n return `https://polygonscan.com/address/${hash}`\n } else {\n return `https://polygonscan.com/tx/${hash}`\n }\n }\n if (chainName.startsWith('Aptos ')) {\n let suffix = '?network=mainnet'\n if (chainName.includes('Testnet')) {\n suffix = '?network=testnet'\n } else if (chainName.includes('Devnet')) {\n suffix = '?network=devnet'\n }\n\n if (subtype === 'block') {\n return `https://explorer.aptoslabs.com/block/${hash}/${suffix}`\n } else if (subtype === 'address') {\n return `https://explorer.aptoslabs.com/account/${hash}/${suffix}`\n } else {\n return `https://explorer.aptoslabs.com/txn/${hash}/${suffix}`\n }\n }\n if (chainName.startsWith('Solana ')) {\n if (subtype === 'block') {\n return `https://explorer.solana.com/block/${hash}`\n } else if (subtype === 'address') {\n return `https://explorer.solana.com/address/${hash}`\n } else {\n return `https://explorer.solana.io/tx/${hash}`\n }\n }\n if (chainName.startsWith('Sui ')) {\n if (subtype === 'block') {\n return `https://suivision.xyz/checkpoint/${hash}`\n } else if (subtype === 'address') {\n return `https://suivision.xyz/account/${hash}`\n } else {\n return `https://suivision.xyz/txblock/${hash}`\n }\n }\n return undefined\n}\n","export * from './chain-id'\nexport * from './chain-info'\nexport * from './chain-name'\n"],"mappings":";oRAGA,IAAYA,GAAZ,SAAYA,EAAS,CACnBA,EAAA,OAAA,SACAA,EAAA,IAAA,MACAA,EAAA,MAAA,QACAA,EAAA,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GAAW,EACpB,CAXAR,EAAA,aAAAO,EAoBA,SAAgBG,EACdF,EACAG,EACAC,EAA6C,CAE7C,IAAMC,EAAYN,EAAaC,CAAO,EACtC,GAAIK,IAAc,WAChB,OAAID,IAAY,QACP,8BAA8BD,IAC5BC,IAAY,UACd,gCAAgCD,IAEhC,2BAA2BA,IAGtC,GAAIE,IAAc,UAChB,OAAID,IAAY,QACP,iCAAiCD,IAC/BC,IAAY,UACd,mCAAmCD,IAEnC,8BAA8BA,IAGzC,GAAIE,EAAU,WAAW,QAAQ,EAAG,CAClC,IAAIC,EAAS,mBAOb,OANID,EAAU,SAAS,SAAS,EAC9BC,EAAS,mBACAD,EAAU,SAAS,QAAQ,IACpCC,EAAS,mBAGPF,IAAY,QACP,wCAAwCD,KAAQG,IAC9CF,IAAY,UACd,0CAA0CD,KAAQG,IAElD,sCAAsCH,KAAQG,IAGzD,GAAID,EAAU,WAAW,SAAS,EAChC,OAAID,IAAY,QACP,qCAAqCD,IACnCC,IAAY,UACd,uCAAuCD,IAEvC,iCAAiCA,IAG5C,GAAIE,EAAU,WAAW,MAAM,EAC7B,OAAID,IAAY,QACP,oCAAoCD,IAClCC,IAAY,UACd,iCAAiCD,IAEjC,iCAAiCA,GAI9C,CA3DAX,EAAA,gBAAAU,yfCpDAK,EAAA,IAAAC,CAAA,EACAD,EAAA,IAAAC,CAAA,EACAD,EAAA,IAAAC,CAAA","names":["ChainType","exports","EthChainId","AptosChainId","SuiChainId","SolanaChainId","FuelChainId","CosmosChainId","StarknetChainId","BTCChainId","getChainType","chainId","id","chain_id_1","ExplorerApiType","exports","getEVMChainScanUrl","chainId","hash","subtype","subtypeStr","supportedChain","BtcSubTypePaths","getBtcChainScanUrl","hostName","subPath","AptosSubTypePaths","getAptosChainScanUrl","explorerUrl","suffix","SolanaSubTypePaths","getSolanaChainScanUrl","SuiChainInfo","SuibSubTypePaths","getSuiChainScanUrl","getChainExternalUrl","chainIdStr","getChainBlockscoutUrl","chain_id_1","chain_info_1","exports","key","value","chainInfo","parts","part","index","getChainName","chainId","name","getChainScanUrl","hash","subtype","chainName","suffix","__exportStar","exports"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
|
|
2
|
-
import{c as Ne}from"./chunk-JSAYWFRM.js";import{e as Ae}from"./chunk-TIOVAWYM.js";import{U as Pe,_ as Ee,a as ae,i as Ce}from"./chunk-Y6QA2AK2.js";import{a as nt}from"./chunk-AQU5WWON.js";import{Sc as Ie,dc as K}from"./chunk-24SCJPBI.js";import{d as tt,e as it,g as Se,h as be,i as Oe,j as oe}from"./chunk-6GD6B22G.js";async function Y(n,e){let t=await n.getBlock(e);if(!t)throw new Error(`Block ${e} not found.`);return t}async function Vt(n,e,t){let i=Math.floor(e.getTime()/1e3),r=await Y(n,"latest"),a=(await Y(n,t!==void 0?t:0)).number,c=r.number;for(;a<=c;){let u=Math.floor((a+c)/2),f=await Y(n,u);if(f.timestamp===i)return f.number;f.timestamp<i?a=u+1:c=u-1}return(await Y(n,c)).number}import("process").then(n=>n.stdout.write(""));function Ut(n){let e=BigInt(0);for(let t=0;t<n.length;t++)e=e*BigInt(256)+BigInt(n[t]);return e}import("process").then(n=>n.stdout.write(""));var Fe={};tt(Fe,{NATIVE_ETH:()=>st,getER20NormalizedAmount:()=>at,getERC20TokenInfo:()=>Le});var z=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xe=new Set,ce=typeof process=="object"&&process?process:{},Re=(n,e,t,i)=>{typeof ce.emitWarning=="function"?ce.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`)},Z=globalThis.AbortController,Te=globalThis.AbortSignal;if(typeof Z>"u"){Te=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,r){this._onabort.push(r)}},Z=class{constructor(){e()}signal=new Te;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i)}}};let n=ce.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,Re("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var rt=n=>!xe.has(n),Qt=Symbol("type"),v=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),ve=n=>v(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?$:null:null,$=class extends Array{constructor(e){super(e),this.fill(0)}},V,M=class{heap;length;static create(e){let t=ve(e);if(!t)return[];oe(M,V,!0);let i=new M(e,t);return oe(M,V,!1),i}constructor(e,t){if(!be(M,V))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},X=M;V=new WeakMap,Oe(X,V,!1);var D=class{#m;#f;#p;#_;#x;#R;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#g;#n;#i;#e;#c;#u;#a;#s;#w;#o;#y;#S;#h;#b;#E;#l;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#h,sizes:e.#y,keyMap:e.#n,keyList:e.#i,valList:e.#e,next:e.#c,prev:e.#u,get head(){return e.#a},get tail(){return e.#s},free:e.#w,isBackgroundFetch:t=>e.#t(t),backgroundFetch:(t,i,r,s)=>e.#L(t,i,r,s),moveToTail:t=>e.#T(t),indexes:t=>e.#O(t),rindexes:t=>e.#I(t),isStale:t=>e.#d(t)}}get max(){return this.#m}get maxSize(){return this.#f}get calculatedSize(){return this.#g}get size(){return this.#r}get fetchMethod(){return this.#x}get memoMethod(){return this.#R}get dispose(){return this.#p}get disposeAfter(){return this.#_}constructor(e){let{max:t=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:w,maxSize:b=0,maxEntrySize:E=0,sizeCalculation:_,fetchMethod:I,memoMethod:h,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:p,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:O,ignoreFetchAbort:A}=e;if(t!==0&&!v(t))throw new TypeError("max option must be a nonnegative integer");let N=t?ve(t):Array;if(!N)throw new Error("invalid max value: "+t);if(this.#m=t,this.#f=b,this.maxEntrySize=E||this.#f,this.sizeCalculation=_,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(h!==void 0&&typeof h!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#R=h,I!==void 0&&typeof I!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=I,this.#E=!!I,this.#n=new Map,this.#i=new Array(t).fill(void 0),this.#e=new Array(t).fill(void 0),this.#c=new N(t),this.#u=new N(t),this.#a=0,this.#s=0,this.#w=X.create(t),this.#r=0,this.#g=0,typeof l=="function"&&(this.#p=l),typeof u=="function"?(this.#_=u,this.#o=[]):(this.#_=void 0,this.#o=void 0),this.#b=!!this.#p,this.#l=!!this.#_,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!w,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#f!==0&&!v(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!v(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!p,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=v(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!v(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#F()}if(this.#m===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#m&&!this.#f){let T="LRU_CACHE_UNBOUNDED";rt(T)&&(xe.add(T),Re("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",T,D))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#F(){let e=new $(this.#m),t=new $(this.#m);this.#h=e,this.#S=t,this.#B=(s,o,a=z.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#d(s)&&this.#C(this.#i[s],"expire")},o+1);c.unref&&c.unref()}},this.#N=s=>{t[s]=e[s]!==0?z.now():0},this.#P=(s,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=i||r();let l=s.now-c;s.remainingTTL=a-l}};let i=0,r=()=>{let s=z.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#n.get(s);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(i||r())-c;return a-l},this.#d=s=>{let o=t[s],a=e[s];return!!a&&!!o&&(i||r())-o>a}}#N=()=>{};#P=()=>{};#B=()=>{};#d=()=>!1;#$(){let e=new $(this.#m);this.#g=0,this.#y=e,this.#A=t=>{this.#g-=e[t],e[t]=0},this.#J=(t,i,r,s)=>{if(this.#t(i))return 0;if(!v(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,t),!v(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#v=(t,i,r)=>{if(e[t]=i,this.#f){let s=this.#f-e[t];for(;this.#g>s;)this.#D(!0)}this.#g+=e[t],r&&(r.entrySize=i,r.totalCalculatedSize=this.#g)}}#A=e=>{};#v=(e,t,i)=>{};#J=(e,t,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#s;!(!this.#k(t)||((e||!this.#d(t))&&(yield t),t===this.#a));)t=this.#u[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#a;!(!this.#k(t)||((e||!this.#d(t))&&(yield t),t===this.#s));)t=this.#c[t]}#k(e){return e!==void 0&&this.#n.get(this.#i[e])===e}*entries(){for(let e of this.#O())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#i[e],this.#e[e]])}*rentries(){for(let e of this.#I())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#i[e],this.#e[e]])}*keys(){for(let e of this.#O()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#I()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t)}}*values(){for(let e of this.#O())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#I())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#O()){let r=this.#e[i],s=this.#t(r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,this.#i[i],this))return this.get(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#O()){let r=this.#e[i],s=this.#t(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#I()){let r=this.#e[i],s=this.#t(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#I({allowStale:!0}))this.#d(t)&&(this.#C(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#n.get(e);if(t===void 0)return;let i=this.#e[t],r=this.#t(i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if(this.#h&&this.#S){let o=this.#h[t],a=this.#S[t];if(o&&a){let c=o-(z.now()-a);s.ttl=c,s.start=Date.now()}}return this.#y&&(s.size=this.#y[t]),s}dump(){let e=[];for(let t of this.#O({allowStale:!0})){let i=this.#i[t],r=this.#e[t],s=this.#t(r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#h&&this.#S){o.ttl=this.#h[t];let a=z.now()-this.#S[t];o.start=Math.floor(Date.now()-a)}this.#y&&(o.size=this.#y[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let r=Date.now()-i.start;i.start=z.now()-r}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#J(e,t,i.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#C(e,"set"),this;let f=this.#r===0?void 0:this.#n.get(e);if(f===void 0)f=this.#r===0?this.#s:this.#w.length!==0?this.#w.pop():this.#r===this.#m?this.#D(!1):this.#r,this.#i[f]=e,this.#e[f]=t,this.#n.set(e,f),this.#c[this.#s]=f,this.#u[f]=this.#s,this.#s=f,this.#r++,this.#v(f,u,c),c&&(c.set="add"),l=!1;else{this.#T(f);let w=this.#e[f];if(t!==w){if(this.#E&&this.#t(w)){w.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:b}=w;b!==void 0&&!o&&(this.#b&&this.#p?.(b,e,"set"),this.#l&&this.#o?.push([b,e,"set"]))}else o||(this.#b&&this.#p?.(w,e,"set"),this.#l&&this.#o?.push([w,e,"set"]));if(this.#A(f),this.#v(f,u,c),this.#e[f]=t,c){c.set="replace";let b=w&&this.#t(w)?w.__staleWhileFetching:w;b!==void 0&&(c.oldValue=b)}}else c&&(c.set="update")}if(r!==0&&!this.#h&&this.#F(),this.#h&&(l||this.#B(f,r,s),c&&this.#P(c,f)),!o&&this.#l&&this.#o){let w=this.#o,b;for(;b=w?.shift();)this.#_?.(...b)}return this}pop(){try{for(;this.#r;){let e=this.#e[this.#a];if(this.#D(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#l&&this.#o){let e=this.#o,t;for(;t=e?.shift();)this.#_?.(...t)}}}#D(e){let t=this.#a,i=this.#i[t],r=this.#e[t];return this.#E&&this.#t(r)?r.__abortController.abort(new Error("evicted")):(this.#b||this.#l)&&(this.#b&&this.#p?.(r,i,"evict"),this.#l&&this.#o?.push([r,i,"evict"])),this.#A(t),e&&(this.#i[t]=void 0,this.#e[t]=void 0,this.#w.push(t)),this.#r===1?(this.#a=this.#s=0,this.#w.length=0):this.#a=this.#c[t],this.#n.delete(i),this.#r--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=t,s=this.#n.get(e);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#d(s))r&&(r.has="stale",this.#P(r,s));else return i&&this.#N(s),r&&(r.has="hit",this.#P(r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,r=this.#n.get(e);if(r===void 0||!i&&this.#d(r))return;let s=this.#e[r];return this.#t(s)?s.__staleWhileFetching:s}#L(e,t,i,r){let s=t===void 0?void 0:this.#e[t];if(this.#t(s))return s;let o=new Z,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:r},l=(_,I=!1)=>{let{aborted:h}=o.signal,m=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(h&&!I?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,m&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),h&&!m&&!I)return f(o.signal.reason);let p=b;return this.#e[t]===b&&(_===void 0?p.__staleWhileFetching?this.#e[t]=p.__staleWhileFetching:this.#C(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,_,c.options))),_},u=_=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=_),f(_)),f=_=>{let{aborted:I}=o.signal,h=I&&i.allowStaleOnFetchAbort,m=h||i.allowStaleOnFetchRejection,p=m||i.noDeleteOnFetchRejection,y=b;if(this.#e[t]===b&&(!p||y.__staleWhileFetching===void 0?this.#C(e,"fetch"):h||(this.#e[t]=y.__staleWhileFetching)),m)return i.status&&y.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),y.__staleWhileFetching;if(y.__returned===y)throw _},w=(_,I)=>{let h=this.#x?.(e,s,c);h&&h instanceof Promise&&h.then(m=>_(m===void 0?void 0:m),I),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=m=>l(m,!0)))})};i.status&&(i.status.fetchDispatched=!0);let b=new Promise(w).then(l,u),E=Object.assign(b,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,E,{...c.options,status:void 0}),t=this.#n.get(e)):this.#e[t]=E,E}#t(e){if(!this.#E)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Z}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:b=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:_,forceRefresh:I=!1,status:h,signal:m}=t;if(!this.#E)return h&&(h.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:h});let p={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:E,ignoreFetchAbort:b,status:h,signal:m},y=this.#n.get(e);if(y===void 0){h&&(h.fetch="miss");let O=this.#L(e,y,p,_);return O.__returned=O}else{let O=this.#e[y];if(this.#t(O)){let Q=i&&O.__staleWhileFetching!==void 0;return h&&(h.fetch="inflight",Q&&(h.returnedStale=!0)),Q?O.__staleWhileFetching:O.__returned=O}let A=this.#d(y);if(!I&&!A)return h&&(h.fetch="hit"),this.#T(y),r&&this.#N(y),h&&this.#P(h,y),O;let N=this.#L(e,y,p,_),q=N.__staleWhileFetching!==void 0&&i;return h&&(h.fetch=A?"stale":"refresh",q&&A&&(h.returnedStale=!0)),q?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#R;if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=i(e,a,{options:o,context:r});return this.set(e,c,o),c}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#n.get(e);if(a!==void 0){let c=this.#e[a],l=this.#t(c);return o&&this.#P(o,a),this.#d(a)?(o&&(o.get="stale"),l?(o&&i&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?c.__staleWhileFetching:void 0):(s||this.#C(e,"expire"),o&&i&&(o.returnedStale=!0),i?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#T(a),r&&this.#N(a),c))}else o&&(o.get="miss")}#z(e,t){this.#u[t]=e,this.#c[e]=t}#T(e){e!==this.#s&&(e===this.#a?this.#a=this.#c[e]:this.#z(this.#u[e],this.#c[e]),this.#z(this.#s,e),this.#s=e)}delete(e){return this.#C(e,"delete")}#C(e,t){let i=!1;if(this.#r!==0){let r=this.#n.get(e);if(r!==void 0)if(i=!0,this.#r===1)this.#M(t);else{this.#A(r);let s=this.#e[r];if(this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#b||this.#l)&&(this.#b&&this.#p?.(s,e,t),this.#l&&this.#o?.push([s,e,t])),this.#n.delete(e),this.#i[r]=void 0,this.#e[r]=void 0,r===this.#s)this.#s=this.#u[r];else if(r===this.#a)this.#a=this.#c[r];else{let o=this.#u[r];this.#c[o]=this.#c[r];let a=this.#c[r];this.#u[a]=this.#u[r]}this.#r--,this.#w.push(r)}}if(this.#l&&this.#o?.length){let r=this.#o,s;for(;s=r?.shift();)this.#_?.(...s)}return i}clear(){return this.#M("delete")}#M(e){for(let t of this.#I({allowStale:!0})){let i=this.#e[t];if(this.#t(i))i.__abortController.abort(new Error("deleted"));else{let r=this.#i[t];this.#b&&this.#p?.(i,r,e),this.#l&&this.#o?.push([i,r,e])}}if(this.#n.clear(),this.#e.fill(void 0),this.#i.fill(void 0),this.#h&&this.#S&&(this.#h.fill(0),this.#S.fill(0)),this.#y&&this.#y.fill(0),this.#a=0,this.#s=0,this.#w.length=0,this.#g=0,this.#r=0,this.#l&&this.#o){let t=this.#o,i;for(;i=t?.shift();)this.#_?.(...i)}}};var st={symbol:"ETH",decimal:18,name:"Native ETH"},De=new D({max:1e4,ttl:1e3*60*60});async function ot(n,e,t){return{symbol:await n,name:await e,decimal:Number(await t)}}async function Le(n,e){let t;n instanceof Ie?t=n.getChainId():t=n||Pe.EthChainId.ETHEREUM;let i=t+e,r=De.get(i);if(r)return r;let s=Ee(t,e),o=Ne(t,e),a="";try{a=await s.name()}catch{a=ae(await o.name())}let c="";try{c=await s.symbol()}catch{c=ae(await o.symbol())}let l=await s.decimals(),u=ot(c,a,l);return De.set(i,u),u}async function at(n,e,t){let i=await Le(n,e);return K(t,i.decimal)}import("process").then(n=>n.stdout.write(""));import Ve from"fs";var g=class extends Error{constructor(e,t,i,...r){Array.isArray(t)&&(t=t.join(" ").trim()),super(t),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,g),this.code=e;for(let s of r)for(let o in s){let a=s[o];this[o]=Buffer.isBuffer(a)?a.toString(i.encoding):a==null?a:JSON.parse(JSON.stringify(a))}}};var Be=function(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)};var ee=function(n){let e=[];for(let t=0,i=n.length;t<i;t++){let r=n[t];if(r==null||r===!1)e[t]={disabled:!0};else if(typeof r=="string")e[t]={name:r};else if(Be(r)){if(typeof r.name!="string")throw new g("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${t}`,"when column is an object literal"]);e[t]=r}else throw new g("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(r)} at position ${t}`])}return e};var le=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let t=this.length+e.length;if(t>=this.size&&(this.resize(),t>=this.size))throw Error("INVALID_BUFFER_STATE");let i=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),i.copy(this.buf,e.length),this.length+=e.length}else{let t=this.length++;t===this.size&&this.resize();let i=this.clone();this.buf[0]=e,i.copy(this.buf,1,0,t)}}append(e){let t=this.length++;t===this.size&&this.resize(),this.buf[t]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let t=Buffer.allocUnsafe(this.size);this.buf.copy(t,0,0,e),this.buf=t}toString(e){return e?this.buf.slice(0,this.length).toString(e):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},fe=le;var ct=12,lt=13,ft=10,ut=32,ht=9,Je=function(n){return{bomSkipped:!1,bufBytesStart:0,castField:n.cast_function,commenting:!1,error:void 0,enabled:n.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(n.escape)&&Buffer.isBuffer(n.quote)&&Buffer.compare(n.escape,n.quote)===0,expectedRecordLength:Array.isArray(n.columns)?n.columns.length:void 0,field:new fe(20),firstLineToHeaders:n.cast_first_line_to_header,needMoreDataSize:Math.max(n.comment!==null?n.comment.length:0,...n.delimiter.map(e=>e.length),n.quote!==null?n.quote.length:0),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new fe(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:n.record_delimiter.length===0?0:Math.max(...n.record_delimiter.map(e=>e.length)),trimChars:[Buffer.from(" ",n.encoding)[0],Buffer.from(" ",n.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:[Buffer.from(Buffer.from([lt],"utf8").toString(),n.encoding),Buffer.from(Buffer.from([ft],"utf8").toString(),n.encoding),Buffer.from(Buffer.from([ct],"utf8").toString(),n.encoding),Buffer.from(Buffer.from([ut],"utf8").toString(),n.encoding),Buffer.from(Buffer.from([ht],"utf8").toString(),n.encoding)]}};var ke=function(n){return n.replace(/([A-Z])/g,function(e,t){return"_"+t.toLowerCase()})};var ue=function(n){let e={};for(let i in n)e[ke(i)]=n[i];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new g("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new g("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new g("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(i){let r=Date.parse(i);return isNaN(r)?i:new Date(r)};else if(typeof e.cast_date!="function")throw new g("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=null,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=ee(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new g("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new g("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new g("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new g("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new g("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);let t=JSON.stringify(e.delimiter);if(Array.isArray(e.delimiter)||(e.delimiter=[e.delimiter]),e.delimiter.length===0)throw new g("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${t}`],e);if(e.delimiter=e.delimiter.map(function(i){if(i==null||i===!1)return Buffer.from(",",e.encoding);if(typeof i=="string"&&(i=Buffer.from(i,e.encoding)),!Buffer.isBuffer(i)||i.length===0)throw new g("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${t}`],e);return i}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(n.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(n.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(n.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new g("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new g("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new g("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new g("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new g("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(i,r){if(typeof i!="string"&&!Buffer.isBuffer(i))throw new g("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${r},`,`got ${JSON.stringify(i)}`],e);if(i.length===0)throw new g("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${r},`,`got ${JSON.stringify(i)}`],e);return typeof i=="string"&&(i=Buffer.from(i,e.encoding)),i}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&n.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&n.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(n.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(n.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(n.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(n.to_line)}`);return e};var ze=function(n){return n.every(e=>e==null||e.toString&&e.toString().trim()==="")},dt=13,mt=10,G={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},Me=function(n={}){let e={bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},t=ue(n);return{info:e,original_options:n,options:t,state:Je(t),__needMoreData:function(i,r,s){if(s)return!1;let{encoding:o,escape:a,quote:c}=this.options,{quoting:l,needMoreDataSize:u,recordDelimiterMaxLength:f}=this.state,w=r-i-1,b=Math.max(u,f===0?Buffer.from(`\r
|
|
2
|
+
import{c as Ne}from"./chunk-6VELGYNR.js";import{e as Ae}from"./chunk-YX4LDK5Y.js";import{U as Pe,_ as Ee,a as ae,i as Ce}from"./chunk-F7Q5QB6Q.js";import{a as nt}from"./chunk-QW2MPHP5.js";import{Sc as Ie,dc as K}from"./chunk-24SCJPBI.js";import{d as tt,e as it,g as Se,h as be,i as Oe,j as oe}from"./chunk-6GD6B22G.js";async function Y(n,e){let t=await n.getBlock(e);if(!t)throw new Error(`Block ${e} not found.`);return t}async function Vt(n,e,t){let i=Math.floor(e.getTime()/1e3),r=await Y(n,"latest"),a=(await Y(n,t!==void 0?t:0)).number,c=r.number;for(;a<=c;){let u=Math.floor((a+c)/2),f=await Y(n,u);if(f.timestamp===i)return f.number;f.timestamp<i?a=u+1:c=u-1}return(await Y(n,c)).number}import("process").then(n=>n.stdout.write(""));function Ut(n){let e=BigInt(0);for(let t=0;t<n.length;t++)e=e*BigInt(256)+BigInt(n[t]);return e}import("process").then(n=>n.stdout.write(""));var Fe={};tt(Fe,{NATIVE_ETH:()=>st,getER20NormalizedAmount:()=>at,getERC20TokenInfo:()=>Le});var z=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,xe=new Set,ce=typeof process=="object"&&process?process:{},Re=(n,e,t,i)=>{typeof ce.emitWarning=="function"?ce.emitWarning(n,e,t,i):console.error(`[${t}] ${e}: ${n}`)},Z=globalThis.AbortController,Te=globalThis.AbortSignal;if(typeof Z>"u"){Te=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(i,r){this._onabort.push(r)}},Z=class{constructor(){e()}signal=new Te;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(let r of this.signal._onabort)r(i);this.signal.onabort?.(i)}}};let n=ce.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{n&&(n=!1,Re("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}var rt=n=>!xe.has(n),Qt=Symbol("type"),v=n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),ve=n=>v(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?$:null:null,$=class extends Array{constructor(e){super(e),this.fill(0)}},V,M=class{heap;length;static create(e){let t=ve(e);if(!t)return[];oe(M,V,!0);let i=new M(e,t);return oe(M,V,!1),i}constructor(e,t){if(!be(M,V))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},X=M;V=new WeakMap,Oe(X,V,!1);var D=class{#m;#f;#p;#_;#x;#R;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#r;#g;#n;#i;#e;#c;#u;#a;#s;#w;#o;#y;#S;#h;#b;#E;#l;static unsafeExposeInternals(e){return{starts:e.#S,ttls:e.#h,sizes:e.#y,keyMap:e.#n,keyList:e.#i,valList:e.#e,next:e.#c,prev:e.#u,get head(){return e.#a},get tail(){return e.#s},free:e.#w,isBackgroundFetch:t=>e.#t(t),backgroundFetch:(t,i,r,s)=>e.#L(t,i,r,s),moveToTail:t=>e.#T(t),indexes:t=>e.#O(t),rindexes:t=>e.#I(t),isStale:t=>e.#d(t)}}get max(){return this.#m}get maxSize(){return this.#f}get calculatedSize(){return this.#g}get size(){return this.#r}get fetchMethod(){return this.#x}get memoMethod(){return this.#R}get dispose(){return this.#p}get disposeAfter(){return this.#_}constructor(e){let{max:t=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:w,maxSize:b=0,maxEntrySize:E=0,sizeCalculation:_,fetchMethod:I,memoMethod:h,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:p,allowStaleOnFetchRejection:y,allowStaleOnFetchAbort:O,ignoreFetchAbort:A}=e;if(t!==0&&!v(t))throw new TypeError("max option must be a nonnegative integer");let N=t?ve(t):Array;if(!N)throw new Error("invalid max value: "+t);if(this.#m=t,this.#f=b,this.maxEntrySize=E||this.#f,this.sizeCalculation=_,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(h!==void 0&&typeof h!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#R=h,I!==void 0&&typeof I!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#x=I,this.#E=!!I,this.#n=new Map,this.#i=new Array(t).fill(void 0),this.#e=new Array(t).fill(void 0),this.#c=new N(t),this.#u=new N(t),this.#a=0,this.#s=0,this.#w=X.create(t),this.#r=0,this.#g=0,typeof l=="function"&&(this.#p=l),typeof u=="function"?(this.#_=u,this.#o=[]):(this.#_=void 0,this.#o=void 0),this.#b=!!this.#p,this.#l=!!this.#_,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!w,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!y,this.allowStaleOnFetchAbort=!!O,this.ignoreFetchAbort=!!A,this.maxEntrySize!==0){if(this.#f!==0&&!v(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!v(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#$()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!p,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=v(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!v(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#F()}if(this.#m===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#m&&!this.#f){let T="LRU_CACHE_UNBOUNDED";rt(T)&&(xe.add(T),Re("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",T,D))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#F(){let e=new $(this.#m),t=new $(this.#m);this.#h=e,this.#S=t,this.#B=(s,o,a=z.now())=>{if(t[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let c=setTimeout(()=>{this.#d(s)&&this.#C(this.#i[s],"expire")},o+1);c.unref&&c.unref()}},this.#N=s=>{t[s]=e[s]!==0?z.now():0},this.#P=(s,o)=>{if(e[o]){let a=e[o],c=t[o];if(!a||!c)return;s.ttl=a,s.start=c,s.now=i||r();let l=s.now-c;s.remainingTTL=a-l}};let i=0,r=()=>{let s=z.now();if(this.ttlResolution>0){i=s;let o=setTimeout(()=>i=0,this.ttlResolution);o.unref&&o.unref()}return s};this.getRemainingTTL=s=>{let o=this.#n.get(s);if(o===void 0)return 0;let a=e[o],c=t[o];if(!a||!c)return 1/0;let l=(i||r())-c;return a-l},this.#d=s=>{let o=t[s],a=e[s];return!!a&&!!o&&(i||r())-o>a}}#N=()=>{};#P=()=>{};#B=()=>{};#d=()=>!1;#$(){let e=new $(this.#m);this.#g=0,this.#y=e,this.#A=t=>{this.#g-=e[t],e[t]=0},this.#J=(t,i,r,s)=>{if(this.#t(i))return 0;if(!v(r))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,t),!v(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#v=(t,i,r)=>{if(e[t]=i,this.#f){let s=this.#f-e[t];for(;this.#g>s;)this.#D(!0)}this.#g+=e[t],r&&(r.entrySize=i,r.totalCalculatedSize=this.#g)}}#A=e=>{};#v=(e,t,i)=>{};#J=(e,t,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#s;!(!this.#k(t)||((e||!this.#d(t))&&(yield t),t===this.#a));)t=this.#u[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#r)for(let t=this.#a;!(!this.#k(t)||((e||!this.#d(t))&&(yield t),t===this.#s));)t=this.#c[t]}#k(e){return e!==void 0&&this.#n.get(this.#i[e])===e}*entries(){for(let e of this.#O())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#i[e],this.#e[e]])}*rentries(){for(let e of this.#I())this.#e[e]!==void 0&&this.#i[e]!==void 0&&!this.#t(this.#e[e])&&(yield[this.#i[e],this.#e[e]])}*keys(){for(let e of this.#O()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#I()){let t=this.#i[e];t!==void 0&&!this.#t(this.#e[e])&&(yield t)}}*values(){for(let e of this.#O())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#I())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#O()){let r=this.#e[i],s=this.#t(r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,this.#i[i],this))return this.get(this.#i[i],t)}}forEach(e,t=this){for(let i of this.#O()){let r=this.#e[i],s=this.#t(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#i[i],this)}}rforEach(e,t=this){for(let i of this.#I()){let r=this.#e[i],s=this.#t(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#i[i],this)}}purgeStale(){let e=!1;for(let t of this.#I({allowStale:!0}))this.#d(t)&&(this.#C(this.#i[t],"expire"),e=!0);return e}info(e){let t=this.#n.get(e);if(t===void 0)return;let i=this.#e[t],r=this.#t(i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if(this.#h&&this.#S){let o=this.#h[t],a=this.#S[t];if(o&&a){let c=o-(z.now()-a);s.ttl=c,s.start=Date.now()}}return this.#y&&(s.size=this.#y[t]),s}dump(){let e=[];for(let t of this.#O({allowStale:!0})){let i=this.#i[t],r=this.#e[t],s=this.#t(r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let o={value:s};if(this.#h&&this.#S){o.ttl=this.#h[t];let a=z.now()-this.#S[t];o.start=Math.floor(Date.now()-a)}this.#y&&(o.size=this.#y[t]),e.unshift([i,o])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let r=Date.now()-i.start;i.start=z.now()-r}this.set(t,i.value,i)}}set(e,t,i={}){if(t===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=i,{noUpdateTTL:l=this.noUpdateTTL}=i,u=this.#J(e,t,i.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#C(e,"set"),this;let f=this.#r===0?void 0:this.#n.get(e);if(f===void 0)f=this.#r===0?this.#s:this.#w.length!==0?this.#w.pop():this.#r===this.#m?this.#D(!1):this.#r,this.#i[f]=e,this.#e[f]=t,this.#n.set(e,f),this.#c[this.#s]=f,this.#u[f]=this.#s,this.#s=f,this.#r++,this.#v(f,u,c),c&&(c.set="add"),l=!1;else{this.#T(f);let w=this.#e[f];if(t!==w){if(this.#E&&this.#t(w)){w.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:b}=w;b!==void 0&&!o&&(this.#b&&this.#p?.(b,e,"set"),this.#l&&this.#o?.push([b,e,"set"]))}else o||(this.#b&&this.#p?.(w,e,"set"),this.#l&&this.#o?.push([w,e,"set"]));if(this.#A(f),this.#v(f,u,c),this.#e[f]=t,c){c.set="replace";let b=w&&this.#t(w)?w.__staleWhileFetching:w;b!==void 0&&(c.oldValue=b)}}else c&&(c.set="update")}if(r!==0&&!this.#h&&this.#F(),this.#h&&(l||this.#B(f,r,s),c&&this.#P(c,f)),!o&&this.#l&&this.#o){let w=this.#o,b;for(;b=w?.shift();)this.#_?.(...b)}return this}pop(){try{for(;this.#r;){let e=this.#e[this.#a];if(this.#D(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#l&&this.#o){let e=this.#o,t;for(;t=e?.shift();)this.#_?.(...t)}}}#D(e){let t=this.#a,i=this.#i[t],r=this.#e[t];return this.#E&&this.#t(r)?r.__abortController.abort(new Error("evicted")):(this.#b||this.#l)&&(this.#b&&this.#p?.(r,i,"evict"),this.#l&&this.#o?.push([r,i,"evict"])),this.#A(t),e&&(this.#i[t]=void 0,this.#e[t]=void 0,this.#w.push(t)),this.#r===1?(this.#a=this.#s=0,this.#w.length=0):this.#a=this.#c[t],this.#n.delete(i),this.#r--,t}has(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=t,s=this.#n.get(e);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#d(s))r&&(r.has="stale",this.#P(r,s));else return i&&this.#N(s),r&&(r.has="hit",this.#P(r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{allowStale:i=this.allowStale}=t,r=this.#n.get(e);if(r===void 0||!i&&this.#d(r))return;let s=this.#e[r];return this.#t(s)?s.__staleWhileFetching:s}#L(e,t,i,r){let s=t===void 0?void 0:this.#e[t];if(this.#t(s))return s;let o=new Z,{signal:a}=i;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:i,context:r},l=(_,I=!1)=>{let{aborted:h}=o.signal,m=i.ignoreFetchAbort&&_!==void 0;if(i.status&&(h&&!I?(i.status.fetchAborted=!0,i.status.fetchError=o.signal.reason,m&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),h&&!m&&!I)return f(o.signal.reason);let p=b;return this.#e[t]===b&&(_===void 0?p.__staleWhileFetching?this.#e[t]=p.__staleWhileFetching:this.#C(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.set(e,_,c.options))),_},u=_=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=_),f(_)),f=_=>{let{aborted:I}=o.signal,h=I&&i.allowStaleOnFetchAbort,m=h||i.allowStaleOnFetchRejection,p=m||i.noDeleteOnFetchRejection,y=b;if(this.#e[t]===b&&(!p||y.__staleWhileFetching===void 0?this.#C(e,"fetch"):h||(this.#e[t]=y.__staleWhileFetching)),m)return i.status&&y.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),y.__staleWhileFetching;if(y.__returned===y)throw _},w=(_,I)=>{let h=this.#x?.(e,s,c);h&&h instanceof Promise&&h.then(m=>_(m===void 0?void 0:m),I),o.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(_(void 0),i.allowStaleOnFetchAbort&&(_=m=>l(m,!0)))})};i.status&&(i.status.fetchDispatched=!0);let b=new Promise(w).then(l,u),E=Object.assign(b,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,E,{...c.options,status:void 0}),t=this.#n.get(e)):this.#e[t]=E,E}#t(e){if(!this.#E)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Z}async fetch(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:w=this.allowStaleOnFetchRejection,ignoreFetchAbort:b=this.ignoreFetchAbort,allowStaleOnFetchAbort:E=this.allowStaleOnFetchAbort,context:_,forceRefresh:I=!1,status:h,signal:m}=t;if(!this.#E)return h&&(h.fetch="get"),this.get(e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:h});let p={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:E,ignoreFetchAbort:b,status:h,signal:m},y=this.#n.get(e);if(y===void 0){h&&(h.fetch="miss");let O=this.#L(e,y,p,_);return O.__returned=O}else{let O=this.#e[y];if(this.#t(O)){let Q=i&&O.__staleWhileFetching!==void 0;return h&&(h.fetch="inflight",Q&&(h.returnedStale=!0)),Q?O.__staleWhileFetching:O.__returned=O}let A=this.#d(y);if(!I&&!A)return h&&(h.fetch="hit"),this.#T(y),r&&this.#N(y),h&&this.#P(h,y),O;let N=this.#L(e,y,p,_),q=N.__staleWhileFetching!==void 0&&i;return h&&(h.fetch=A?"stale":"refresh",q&&A&&(h.returnedStale=!0)),q?N.__staleWhileFetching:N.__returned=N}}async forceFetch(e,t={}){let i=await this.fetch(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let i=this.#R;if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:s,...o}=t,a=this.get(e,o);if(!s&&a!==void 0)return a;let c=i(e,a,{options:o,context:r});return this.set(e,c,o),c}get(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,a=this.#n.get(e);if(a!==void 0){let c=this.#e[a],l=this.#t(c);return o&&this.#P(o,a),this.#d(a)?(o&&(o.get="stale"),l?(o&&i&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),i?c.__staleWhileFetching:void 0):(s||this.#C(e,"expire"),o&&i&&(o.returnedStale=!0),i?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#T(a),r&&this.#N(a),c))}else o&&(o.get="miss")}#z(e,t){this.#u[t]=e,this.#c[e]=t}#T(e){e!==this.#s&&(e===this.#a?this.#a=this.#c[e]:this.#z(this.#u[e],this.#c[e]),this.#z(this.#s,e),this.#s=e)}delete(e){return this.#C(e,"delete")}#C(e,t){let i=!1;if(this.#r!==0){let r=this.#n.get(e);if(r!==void 0)if(i=!0,this.#r===1)this.#M(t);else{this.#A(r);let s=this.#e[r];if(this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#b||this.#l)&&(this.#b&&this.#p?.(s,e,t),this.#l&&this.#o?.push([s,e,t])),this.#n.delete(e),this.#i[r]=void 0,this.#e[r]=void 0,r===this.#s)this.#s=this.#u[r];else if(r===this.#a)this.#a=this.#c[r];else{let o=this.#u[r];this.#c[o]=this.#c[r];let a=this.#c[r];this.#u[a]=this.#u[r]}this.#r--,this.#w.push(r)}}if(this.#l&&this.#o?.length){let r=this.#o,s;for(;s=r?.shift();)this.#_?.(...s)}return i}clear(){return this.#M("delete")}#M(e){for(let t of this.#I({allowStale:!0})){let i=this.#e[t];if(this.#t(i))i.__abortController.abort(new Error("deleted"));else{let r=this.#i[t];this.#b&&this.#p?.(i,r,e),this.#l&&this.#o?.push([i,r,e])}}if(this.#n.clear(),this.#e.fill(void 0),this.#i.fill(void 0),this.#h&&this.#S&&(this.#h.fill(0),this.#S.fill(0)),this.#y&&this.#y.fill(0),this.#a=0,this.#s=0,this.#w.length=0,this.#g=0,this.#r=0,this.#l&&this.#o){let t=this.#o,i;for(;i=t?.shift();)this.#_?.(...i)}}};var st={symbol:"ETH",decimal:18,name:"Native ETH"},De=new D({max:1e4,ttl:1e3*60*60});async function ot(n,e,t){return{symbol:await n,name:await e,decimal:Number(await t)}}async function Le(n,e){let t;n instanceof Ie?t=n.getChainId():t=n||Pe.EthChainId.ETHEREUM;let i=t+e,r=De.get(i);if(r)return r;let s=Ee(t,e),o=Ne(t,e),a="";try{a=await s.name()}catch{a=ae(await o.name())}let c="";try{c=await s.symbol()}catch{c=ae(await o.symbol())}let l=await s.decimals(),u=ot(c,a,l);return De.set(i,u),u}async function at(n,e,t){let i=await Le(n,e);return K(t,i.decimal)}import("process").then(n=>n.stdout.write(""));import Ve from"fs";var g=class extends Error{constructor(e,t,i,...r){Array.isArray(t)&&(t=t.join(" ").trim()),super(t),Error.captureStackTrace!==void 0&&Error.captureStackTrace(this,g),this.code=e;for(let s of r)for(let o in s){let a=s[o];this[o]=Buffer.isBuffer(a)?a.toString(i.encoding):a==null?a:JSON.parse(JSON.stringify(a))}}};var Be=function(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)};var ee=function(n){let e=[];for(let t=0,i=n.length;t<i;t++){let r=n[t];if(r==null||r===!1)e[t]={disabled:!0};else if(typeof r=="string")e[t]={name:r};else if(Be(r)){if(typeof r.name!="string")throw new g("CSV_OPTION_COLUMNS_MISSING_NAME",["Option columns missing name:",`property "name" is required at position ${t}`,"when column is an object literal"]);e[t]=r}else throw new g("CSV_INVALID_COLUMN_DEFINITION",["Invalid column definition:","expect a string or a literal object,",`got ${JSON.stringify(r)} at position ${t}`])}return e};var le=class{constructor(e=100){this.size=e,this.length=0,this.buf=Buffer.allocUnsafe(e)}prepend(e){if(Buffer.isBuffer(e)){let t=this.length+e.length;if(t>=this.size&&(this.resize(),t>=this.size))throw Error("INVALID_BUFFER_STATE");let i=this.buf;this.buf=Buffer.allocUnsafe(this.size),e.copy(this.buf,0),i.copy(this.buf,e.length),this.length+=e.length}else{let t=this.length++;t===this.size&&this.resize();let i=this.clone();this.buf[0]=e,i.copy(this.buf,1,0,t)}}append(e){let t=this.length++;t===this.size&&this.resize(),this.buf[t]=e}clone(){return Buffer.from(this.buf.slice(0,this.length))}resize(){let e=this.length;this.size=this.size*2;let t=Buffer.allocUnsafe(this.size);this.buf.copy(t,0,0,e),this.buf=t}toString(e){return e?this.buf.slice(0,this.length).toString(e):Uint8Array.prototype.slice.call(this.buf.slice(0,this.length))}toJSON(){return this.toString("utf8")}reset(){this.length=0}},fe=le;var ct=12,lt=13,ft=10,ut=32,ht=9,Je=function(n){return{bomSkipped:!1,bufBytesStart:0,castField:n.cast_function,commenting:!1,error:void 0,enabled:n.from_line===1,escaping:!1,escapeIsQuote:Buffer.isBuffer(n.escape)&&Buffer.isBuffer(n.quote)&&Buffer.compare(n.escape,n.quote)===0,expectedRecordLength:Array.isArray(n.columns)?n.columns.length:void 0,field:new fe(20),firstLineToHeaders:n.cast_first_line_to_header,needMoreDataSize:Math.max(n.comment!==null?n.comment.length:0,...n.delimiter.map(e=>e.length),n.quote!==null?n.quote.length:0),previousBuf:void 0,quoting:!1,stop:!1,rawBuffer:new fe(100),record:[],recordHasError:!1,record_length:0,recordDelimiterMaxLength:n.record_delimiter.length===0?0:Math.max(...n.record_delimiter.map(e=>e.length)),trimChars:[Buffer.from(" ",n.encoding)[0],Buffer.from(" ",n.encoding)[0]],wasQuoting:!1,wasRowDelimiter:!1,timchars:[Buffer.from(Buffer.from([lt],"utf8").toString(),n.encoding),Buffer.from(Buffer.from([ft],"utf8").toString(),n.encoding),Buffer.from(Buffer.from([ct],"utf8").toString(),n.encoding),Buffer.from(Buffer.from([ut],"utf8").toString(),n.encoding),Buffer.from(Buffer.from([ht],"utf8").toString(),n.encoding)]}};var ke=function(n){return n.replace(/([A-Z])/g,function(e,t){return"_"+t.toLowerCase()})};var ue=function(n){let e={};for(let i in n)e[ke(i)]=n[i];if(e.encoding===void 0||e.encoding===!0)e.encoding="utf8";else if(e.encoding===null||e.encoding===!1)e.encoding=null;else if(typeof e.encoding!="string"&&e.encoding!==null)throw new g("CSV_INVALID_OPTION_ENCODING",["Invalid option encoding:","encoding must be a string or null to return a buffer,",`got ${JSON.stringify(e.encoding)}`],e);if(e.bom===void 0||e.bom===null||e.bom===!1)e.bom=!1;else if(e.bom!==!0)throw new g("CSV_INVALID_OPTION_BOM",["Invalid option bom:","bom must be true,",`got ${JSON.stringify(e.bom)}`],e);if(e.cast_function=null,e.cast===void 0||e.cast===null||e.cast===!1||e.cast==="")e.cast=void 0;else if(typeof e.cast=="function")e.cast_function=e.cast,e.cast=!0;else if(e.cast!==!0)throw new g("CSV_INVALID_OPTION_CAST",["Invalid option cast:","cast must be true or a function,",`got ${JSON.stringify(e.cast)}`],e);if(e.cast_date===void 0||e.cast_date===null||e.cast_date===!1||e.cast_date==="")e.cast_date=!1;else if(e.cast_date===!0)e.cast_date=function(i){let r=Date.parse(i);return isNaN(r)?i:new Date(r)};else if(typeof e.cast_date!="function")throw new g("CSV_INVALID_OPTION_CAST_DATE",["Invalid option cast_date:","cast_date must be true or a function,",`got ${JSON.stringify(e.cast_date)}`],e);if(e.cast_first_line_to_header=null,e.columns===!0)e.cast_first_line_to_header=void 0;else if(typeof e.columns=="function")e.cast_first_line_to_header=e.columns,e.columns=!0;else if(Array.isArray(e.columns))e.columns=ee(e.columns);else if(e.columns===void 0||e.columns===null||e.columns===!1)e.columns=!1;else throw new g("CSV_INVALID_OPTION_COLUMNS",["Invalid option columns:","expect an array, a function or true,",`got ${JSON.stringify(e.columns)}`],e);if(e.group_columns_by_name===void 0||e.group_columns_by_name===null||e.group_columns_by_name===!1)e.group_columns_by_name=!1;else{if(e.group_columns_by_name!==!0)throw new g("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","expect an boolean,",`got ${JSON.stringify(e.group_columns_by_name)}`],e);if(e.columns===!1)throw new g("CSV_INVALID_OPTION_GROUP_COLUMNS_BY_NAME",["Invalid option group_columns_by_name:","the `columns` mode must be activated."],e)}if(e.comment===void 0||e.comment===null||e.comment===!1||e.comment==="")e.comment=null;else if(typeof e.comment=="string"&&(e.comment=Buffer.from(e.comment,e.encoding)),!Buffer.isBuffer(e.comment))throw new g("CSV_INVALID_OPTION_COMMENT",["Invalid option comment:","comment must be a buffer or a string,",`got ${JSON.stringify(e.comment)}`],e);if(e.comment_no_infix===void 0||e.comment_no_infix===null||e.comment_no_infix===!1)e.comment_no_infix=!1;else if(e.comment_no_infix!==!0)throw new g("CSV_INVALID_OPTION_COMMENT",["Invalid option comment_no_infix:","value must be a boolean,",`got ${JSON.stringify(e.comment_no_infix)}`],e);let t=JSON.stringify(e.delimiter);if(Array.isArray(e.delimiter)||(e.delimiter=[e.delimiter]),e.delimiter.length===0)throw new g("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${t}`],e);if(e.delimiter=e.delimiter.map(function(i){if(i==null||i===!1)return Buffer.from(",",e.encoding);if(typeof i=="string"&&(i=Buffer.from(i,e.encoding)),!Buffer.isBuffer(i)||i.length===0)throw new g("CSV_INVALID_OPTION_DELIMITER",["Invalid option delimiter:","delimiter must be a non empty string or buffer or array of string|buffer,",`got ${t}`],e);return i}),e.escape===void 0||e.escape===!0?e.escape=Buffer.from('"',e.encoding):typeof e.escape=="string"?e.escape=Buffer.from(e.escape,e.encoding):(e.escape===null||e.escape===!1)&&(e.escape=null),e.escape!==null&&!Buffer.isBuffer(e.escape))throw new Error(`Invalid Option: escape must be a buffer, a string or a boolean, got ${JSON.stringify(e.escape)}`);if(e.from===void 0||e.from===null)e.from=1;else if(typeof e.from=="string"&&/\d+/.test(e.from)&&(e.from=parseInt(e.from)),Number.isInteger(e.from)){if(e.from<0)throw new Error(`Invalid Option: from must be a positive integer, got ${JSON.stringify(n.from)}`)}else throw new Error(`Invalid Option: from must be an integer, got ${JSON.stringify(e.from)}`);if(e.from_line===void 0||e.from_line===null)e.from_line=1;else if(typeof e.from_line=="string"&&/\d+/.test(e.from_line)&&(e.from_line=parseInt(e.from_line)),Number.isInteger(e.from_line)){if(e.from_line<=0)throw new Error(`Invalid Option: from_line must be a positive integer greater than 0, got ${JSON.stringify(n.from_line)}`)}else throw new Error(`Invalid Option: from_line must be an integer, got ${JSON.stringify(n.from_line)}`);if(e.ignore_last_delimiters===void 0||e.ignore_last_delimiters===null)e.ignore_last_delimiters=!1;else if(typeof e.ignore_last_delimiters=="number")e.ignore_last_delimiters=Math.floor(e.ignore_last_delimiters),e.ignore_last_delimiters===0&&(e.ignore_last_delimiters=!1);else if(typeof e.ignore_last_delimiters!="boolean")throw new g("CSV_INVALID_OPTION_IGNORE_LAST_DELIMITERS",["Invalid option `ignore_last_delimiters`:","the value must be a boolean value or an integer,",`got ${JSON.stringify(e.ignore_last_delimiters)}`],e);if(e.ignore_last_delimiters===!0&&e.columns===!1)throw new g("CSV_IGNORE_LAST_DELIMITERS_REQUIRES_COLUMNS",["The option `ignore_last_delimiters`","requires the activation of the `columns` option"],e);if(e.info===void 0||e.info===null||e.info===!1)e.info=!1;else if(e.info!==!0)throw new Error(`Invalid Option: info must be true, got ${JSON.stringify(e.info)}`);if(e.max_record_size===void 0||e.max_record_size===null||e.max_record_size===!1)e.max_record_size=0;else if(!(Number.isInteger(e.max_record_size)&&e.max_record_size>=0))if(typeof e.max_record_size=="string"&&/\d+/.test(e.max_record_size))e.max_record_size=parseInt(e.max_record_size);else throw new Error(`Invalid Option: max_record_size must be a positive integer, got ${JSON.stringify(e.max_record_size)}`);if(e.objname===void 0||e.objname===null||e.objname===!1)e.objname=void 0;else if(Buffer.isBuffer(e.objname)){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty buffer");e.encoding===null||(e.objname=e.objname.toString(e.encoding))}else if(typeof e.objname=="string"){if(e.objname.length===0)throw new Error("Invalid Option: objname must be a non empty string")}else if(typeof e.objname!="number")throw new Error(`Invalid Option: objname must be a string or a buffer, got ${e.objname}`);if(e.objname!==void 0){if(typeof e.objname=="number"){if(e.columns!==!1)throw Error("Invalid Option: objname index cannot be combined with columns or be defined as a field")}else if(e.columns===!1)throw Error("Invalid Option: objname field must be combined with columns or be defined as an index")}if(e.on_record===void 0||e.on_record===null)e.on_record=void 0;else if(typeof e.on_record!="function")throw new g("CSV_INVALID_OPTION_ON_RECORD",["Invalid option `on_record`:","expect a function,",`got ${JSON.stringify(e.on_record)}`],e);if(e.on_skip!==void 0&&e.on_skip!==null&&typeof e.on_skip!="function")throw new Error(`Invalid Option: on_skip must be a function, got ${JSON.stringify(e.on_skip)}`);if(e.quote===null||e.quote===!1||e.quote==="")e.quote=null;else if(e.quote===void 0||e.quote===!0?e.quote=Buffer.from('"',e.encoding):typeof e.quote=="string"&&(e.quote=Buffer.from(e.quote,e.encoding)),!Buffer.isBuffer(e.quote))throw new Error(`Invalid Option: quote must be a buffer or a string, got ${JSON.stringify(e.quote)}`);if(e.raw===void 0||e.raw===null||e.raw===!1)e.raw=!1;else if(e.raw!==!0)throw new Error(`Invalid Option: raw must be true, got ${JSON.stringify(e.raw)}`);if(e.record_delimiter===void 0)e.record_delimiter=[];else if(typeof e.record_delimiter=="string"||Buffer.isBuffer(e.record_delimiter)){if(e.record_delimiter.length===0)throw new g("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);e.record_delimiter=[e.record_delimiter]}else if(!Array.isArray(e.record_delimiter))throw new g("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer,",`got ${JSON.stringify(e.record_delimiter)}`],e);if(e.record_delimiter=e.record_delimiter.map(function(i,r){if(typeof i!="string"&&!Buffer.isBuffer(i))throw new g("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a string, a buffer or array of string|buffer",`at index ${r},`,`got ${JSON.stringify(i)}`],e);if(i.length===0)throw new g("CSV_INVALID_OPTION_RECORD_DELIMITER",["Invalid option `record_delimiter`:","value must be a non empty string or buffer",`at index ${r},`,`got ${JSON.stringify(i)}`],e);return typeof i=="string"&&(i=Buffer.from(i,e.encoding)),i}),typeof e.relax_column_count!="boolean")if(e.relax_column_count===void 0||e.relax_column_count===null)e.relax_column_count=!1;else throw new Error(`Invalid Option: relax_column_count must be a boolean, got ${JSON.stringify(e.relax_column_count)}`);if(typeof e.relax_column_count_less!="boolean")if(e.relax_column_count_less===void 0||e.relax_column_count_less===null)e.relax_column_count_less=!1;else throw new Error(`Invalid Option: relax_column_count_less must be a boolean, got ${JSON.stringify(e.relax_column_count_less)}`);if(typeof e.relax_column_count_more!="boolean")if(e.relax_column_count_more===void 0||e.relax_column_count_more===null)e.relax_column_count_more=!1;else throw new Error(`Invalid Option: relax_column_count_more must be a boolean, got ${JSON.stringify(e.relax_column_count_more)}`);if(typeof e.relax_quotes!="boolean")if(e.relax_quotes===void 0||e.relax_quotes===null)e.relax_quotes=!1;else throw new Error(`Invalid Option: relax_quotes must be a boolean, got ${JSON.stringify(e.relax_quotes)}`);if(typeof e.skip_empty_lines!="boolean")if(e.skip_empty_lines===void 0||e.skip_empty_lines===null)e.skip_empty_lines=!1;else throw new Error(`Invalid Option: skip_empty_lines must be a boolean, got ${JSON.stringify(e.skip_empty_lines)}`);if(typeof e.skip_records_with_empty_values!="boolean")if(e.skip_records_with_empty_values===void 0||e.skip_records_with_empty_values===null)e.skip_records_with_empty_values=!1;else throw new Error(`Invalid Option: skip_records_with_empty_values must be a boolean, got ${JSON.stringify(e.skip_records_with_empty_values)}`);if(typeof e.skip_records_with_error!="boolean")if(e.skip_records_with_error===void 0||e.skip_records_with_error===null)e.skip_records_with_error=!1;else throw new Error(`Invalid Option: skip_records_with_error must be a boolean, got ${JSON.stringify(e.skip_records_with_error)}`);if(e.rtrim===void 0||e.rtrim===null||e.rtrim===!1)e.rtrim=!1;else if(e.rtrim!==!0)throw new Error(`Invalid Option: rtrim must be a boolean, got ${JSON.stringify(e.rtrim)}`);if(e.ltrim===void 0||e.ltrim===null||e.ltrim===!1)e.ltrim=!1;else if(e.ltrim!==!0)throw new Error(`Invalid Option: ltrim must be a boolean, got ${JSON.stringify(e.ltrim)}`);if(e.trim===void 0||e.trim===null||e.trim===!1)e.trim=!1;else if(e.trim!==!0)throw new Error(`Invalid Option: trim must be a boolean, got ${JSON.stringify(e.trim)}`);if(e.trim===!0&&n.ltrim!==!1?e.ltrim=!0:e.ltrim!==!0&&(e.ltrim=!1),e.trim===!0&&n.rtrim!==!1?e.rtrim=!0:e.rtrim!==!0&&(e.rtrim=!1),e.to===void 0||e.to===null)e.to=-1;else if(typeof e.to=="string"&&/\d+/.test(e.to)&&(e.to=parseInt(e.to)),Number.isInteger(e.to)){if(e.to<=0)throw new Error(`Invalid Option: to must be a positive integer greater than 0, got ${JSON.stringify(n.to)}`)}else throw new Error(`Invalid Option: to must be an integer, got ${JSON.stringify(n.to)}`);if(e.to_line===void 0||e.to_line===null)e.to_line=-1;else if(typeof e.to_line=="string"&&/\d+/.test(e.to_line)&&(e.to_line=parseInt(e.to_line)),Number.isInteger(e.to_line)){if(e.to_line<=0)throw new Error(`Invalid Option: to_line must be a positive integer greater than 0, got ${JSON.stringify(n.to_line)}`)}else throw new Error(`Invalid Option: to_line must be an integer, got ${JSON.stringify(n.to_line)}`);return e};var ze=function(n){return n.every(e=>e==null||e.toString&&e.toString().trim()==="")},dt=13,mt=10,G={utf8:Buffer.from([239,187,191]),utf16le:Buffer.from([255,254])},Me=function(n={}){let e={bytes:0,comment_lines:0,empty_lines:0,invalid_field_length:0,lines:1,records:0},t=ue(n);return{info:e,original_options:n,options:t,state:Je(t),__needMoreData:function(i,r,s){if(s)return!1;let{encoding:o,escape:a,quote:c}=this.options,{quoting:l,needMoreDataSize:u,recordDelimiterMaxLength:f}=this.state,w=r-i-1,b=Math.max(u,f===0?Buffer.from(`\r
|
|
3
3
|
`,o).length:f,l?(a===null?0:a.length)+c.length:0,l?c.length+f:0);return w<b},parse:function(i,r,s,o){let{bom:a,comment_no_infix:c,encoding:l,from_line:u,ltrim:f,max_record_size:w,raw:b,relax_quotes:E,rtrim:_,skip_empty_lines:I,to:h,to_line:m}=this.options,{comment:p,escape:y,quote:O,record_delimiter:A}=this.options,{bomSkipped:N,previousBuf:T,rawBuffer:q,escapeIsQuote:Q}=this.state,S;if(T===void 0)if(i===void 0){o();return}else S=i;else T!==void 0&&i===void 0?S=T:S=Buffer.concat([T,i]);if(N===!1)if(a===!1)this.state.bomSkipped=!0;else if(S.length<3){if(r===!1){this.state.previousBuf=S;return}}else{for(let C in G)if(G[C].compare(S,0,G[C].length)===0){let R=G[C].length;this.state.bufBytesStart+=R,S=S.slice(R),this.options=ue({...this.original_options,encoding:C}),{comment:p,escape:y,quote:O}=this.options;break}this.state.bomSkipped=!0}let se=S.length,d;for(d=0;d<se&&!this.__needMoreData(d,se,r);d++){if(this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1),m!==-1&&this.info.lines>m){this.state.stop=!0,o();return}this.state.quoting===!1&&A.length===0&&this.__autoDiscoverRecordDelimiter(S,d)&&(A=this.options.record_delimiter);let C=S[d];if(b===!0&&q.append(C),(C===dt||C===mt)&&this.state.wasRowDelimiter===!1&&(this.state.wasRowDelimiter=!0),this.state.escaping===!0)this.state.escaping=!1;else{if(y!==null&&this.state.quoting===!0&&this.__isEscape(S,d,C)&&d+y.length<se)if(Q){if(this.__isQuote(S,d+y.length)){this.state.escaping=!0,d+=y.length-1;continue}}else{this.state.escaping=!0,d+=y.length-1;continue}if(this.state.commenting===!1&&this.__isQuote(S,d))if(this.state.quoting===!0){let P=S[d+O.length],L=_&&this.__isCharTrimable(S,d+O.length),x=p!==null&&this.__compareBytes(p,S,d+O.length,P),F=this.__isDelimiter(S,d+O.length,P),j=A.length===0?this.__autoDiscoverRecordDelimiter(S,d+O.length):this.__isRecordDelimiter(P,S,d+O.length);if(y!==null&&this.__isEscape(S,d,C)&&this.__isQuote(S,d+y.length))d+=y.length-1;else if(!P||F||j||x||L){this.state.quoting=!1,this.state.wasQuoting=!0,d+=O.length-1;continue}else if(E===!1){let ye=this.__error(new g("CSV_INVALID_CLOSING_QUOTE",["Invalid Closing Quote:",`got "${String.fromCharCode(P)}"`,`at line ${this.info.lines}`,"instead of delimiter, record delimiter, trimable character","(if activated) or comment"],this.options,this.__infoField()));if(ye!==void 0)return ye}else this.state.quoting=!1,this.state.wasQuoting=!0,this.state.field.prepend(O),d+=O.length-1}else if(this.state.field.length!==0){if(E===!1){let P=this.__infoField(),L=Object.keys(G).map(F=>G[F].equals(this.state.field.toString())?F:!1).filter(Boolean)[0],x=this.__error(new g("INVALID_OPENING_QUOTE",["Invalid Opening Quote:",`a quote is found on field ${JSON.stringify(P.column)} at line ${P.lines}, value is ${JSON.stringify(this.state.field.toString(l))}`,L?`(${L} bom)`:void 0],this.options,P,{field:this.state.field}));if(x!==void 0)return x}}else{this.state.quoting=!0,d+=O.length-1;continue}if(this.state.quoting===!1){let P=this.__isRecordDelimiter(C,S,d);if(P!==0){if(this.state.commenting&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0)this.info.comment_lines++;else{if(this.state.enabled===!1&&this.info.lines+(this.state.wasRowDelimiter===!0?1:0)>=u){this.state.enabled=!0,this.__resetField(),this.__resetRecord(),d+=P-1;continue}if(I===!0&&this.state.wasQuoting===!1&&this.state.record.length===0&&this.state.field.length===0){this.info.empty_lines++,d+=P-1;continue}this.info.bytes=this.state.bufBytesStart+d;let F=this.__onField();if(F!==void 0)return F;this.info.bytes=this.state.bufBytesStart+d+P;let j=this.__onRecord(s);if(j!==void 0)return j;if(h!==-1&&this.info.records>=h){this.state.stop=!0,o();return}}this.state.commenting=!1,d+=P-1;continue}if(this.state.commenting)continue;if(p!==null&&(c===!1||this.state.record.length===0&&this.state.field.length===0)&&this.__compareBytes(p,S,d,C)!==0){this.state.commenting=!0;continue}let L=this.__isDelimiter(S,d,C);if(L!==0){this.info.bytes=this.state.bufBytesStart+d;let x=this.__onField();if(x!==void 0)return x;d+=L-1;continue}}}if(this.state.commenting===!1&&w!==0&&this.state.record_length+this.state.field.length>w)return this.__error(new g("CSV_MAX_RECORD_SIZE",["Max Record Size:","record exceed the maximum number of tolerated bytes",`of ${w}`,`at line ${this.info.lines}`],this.options,this.__infoField()));let R=f===!1||this.state.quoting===!0||this.state.field.length!==0||!this.__isCharTrimable(S,d),et=_===!1||this.state.wasQuoting===!1;if(R===!0&&et===!0)this.state.field.append(C);else{if(_===!0&&!this.__isCharTrimable(S,d))return this.__error(new g("CSV_NON_TRIMABLE_CHAR_AFTER_CLOSING_QUOTE",["Invalid Closing Quote:","found non trimable byte after quote",`at line ${this.info.lines}`],this.options,this.__infoField()));R===!1&&(d+=this.__isCharTrimable(S,d)-1);continue}}if(r===!0)if(this.state.quoting===!0){let C=this.__error(new g("CSV_QUOTE_NOT_CLOSED",["Quote Not Closed:",`the parsing is finished with an opening quote at line ${this.info.lines}`],this.options,this.__infoField()));if(C!==void 0)return C}else if(this.state.wasQuoting===!0||this.state.record.length!==0||this.state.field.length!==0){this.info.bytes=this.state.bufBytesStart+d;let C=this.__onField();if(C!==void 0)return C;let R=this.__onRecord(s);if(R!==void 0)return R}else this.state.wasRowDelimiter===!0?this.info.empty_lines++:this.state.commenting===!0&&this.info.comment_lines++;else this.state.bufBytesStart+=d,this.state.previousBuf=S.slice(d);this.state.wasRowDelimiter===!0&&(this.info.lines++,this.state.wasRowDelimiter=!1)},__onRecord:function(i){let{columns:r,group_columns_by_name:s,encoding:o,info:a,from:c,relax_column_count:l,relax_column_count_less:u,relax_column_count_more:f,raw:w,skip_records_with_empty_values:b}=this.options,{enabled:E,record:_}=this.state;if(E===!1)return this.__resetRecord();let I=_.length;if(r===!0){if(b===!0&&ze(_)){this.__resetRecord();return}return this.__firstLineToColumns(_)}if(r===!1&&this.info.records===0&&(this.state.expectedRecordLength=I),I!==this.state.expectedRecordLength){let h=r===!1?new g("CSV_RECORD_INCONSISTENT_FIELDS_LENGTH",["Invalid Record Length:",`expect ${this.state.expectedRecordLength},`,`got ${I} on line ${this.info.lines}`],this.options,this.__infoField(),{record:_}):new g("CSV_RECORD_INCONSISTENT_COLUMNS",["Invalid Record Length:",`columns length is ${r.length},`,`got ${I} on line ${this.info.lines}`],this.options,this.__infoField(),{record:_});if(l===!0||u===!0&&I<this.state.expectedRecordLength||f===!0&&I>this.state.expectedRecordLength)this.info.invalid_field_length++,this.state.error=h;else{let m=this.__error(h);if(m)return m}}if(b===!0&&ze(_)){this.__resetRecord();return}if(this.state.recordHasError===!0){this.__resetRecord(),this.state.recordHasError=!1;return}if(this.info.records++,c===1||this.info.records>=c){let{objname:h}=this.options;if(r!==!1){let m={};for(let p=0,y=_.length;p<y;p++)r[p]===void 0||r[p].disabled||(s===!0&&m[r[p].name]!==void 0?Array.isArray(m[r[p].name])?m[r[p].name]=m[r[p].name].concat(_[p]):m[r[p].name]=[m[r[p].name],_[p]]:m[r[p].name]=_[p]);if(w===!0||a===!0){let p=Object.assign({record:m},w===!0?{raw:this.state.rawBuffer.toString(o)}:{},a===!0?{info:this.__infoRecord()}:{}),y=this.__push(h===void 0?p:[m[h],p],i);if(y)return y}else{let p=this.__push(h===void 0?m:[m[h],m],i);if(p)return p}}else if(w===!0||a===!0){let m=Object.assign({record:_},w===!0?{raw:this.state.rawBuffer.toString(o)}:{},a===!0?{info:this.__infoRecord()}:{}),p=this.__push(h===void 0?m:[_[h],m],i);if(p)return p}else{let m=this.__push(h===void 0?_:[_[h],_],i);if(m)return m}}this.__resetRecord()},__firstLineToColumns:function(i){let{firstLineToHeaders:r}=this.state;try{let s=r===void 0?i:r.call(null,i);if(!Array.isArray(s))return this.__error(new g("CSV_INVALID_COLUMN_MAPPING",["Invalid Column Mapping:","expect an array from column function,",`got ${JSON.stringify(s)}`],this.options,this.__infoField(),{headers:s}));let o=ee(s);this.state.expectedRecordLength=o.length,this.options.columns=o,this.__resetRecord();return}catch(s){return s}},__resetRecord:function(){this.options.raw===!0&&this.state.rawBuffer.reset(),this.state.error=void 0,this.state.record=[],this.state.record_length=0},__onField:function(){let{cast:i,encoding:r,rtrim:s,max_record_size:o}=this.options,{enabled:a,wasQuoting:c}=this.state;if(a===!1)return this.__resetField();let l=this.state.field.toString(r);if(s===!0&&c===!1&&(l=l.trimRight()),i===!0){let[u,f]=this.__cast(l);if(u!==void 0)return u;l=f}this.state.record.push(l),o!==0&&typeof l=="string"&&(this.state.record_length+=l.length),this.__resetField()},__resetField:function(){this.state.field.reset(),this.state.wasQuoting=!1},__push:function(i,r){let{on_record:s}=this.options;if(s!==void 0){let o=this.__infoRecord();try{i=s.call(null,i,o)}catch(a){return a}if(i==null)return}r(i)},__cast:function(i){let{columns:r,relax_column_count:s}=this.options;if(Array.isArray(r)===!0&&s&&this.options.columns.length<=this.state.record.length)return[void 0,void 0];if(this.state.castField!==null)try{let a=this.__infoField();return[void 0,this.state.castField.call(null,i,a)]}catch(a){return[a]}if(this.__isFloat(i))return[void 0,parseFloat(i)];if(this.options.cast_date!==!1){let a=this.__infoField();return[void 0,this.options.cast_date.call(null,i,a)]}return[void 0,i]},__isCharTrimable:function(i,r){return((o,a)=>{let{timchars:c}=this.state;e:for(let l=0;l<c.length;l++){let u=c[l];for(let f=0;f<u.length;f++)if(u[f]!==o[a+f])continue e;return u.length}return 0})(i,r)},__isFloat:function(i){return i-parseFloat(i)+1>=0},__compareBytes:function(i,r,s,o){if(i[0]!==o)return 0;let a=i.length;for(let c=1;c<a;c++)if(i[c]!==r[s+c])return 0;return a},__isDelimiter:function(i,r,s){let{delimiter:o,ignore_last_delimiters:a}=this.options;if(a===!0&&this.state.record.length===this.options.columns.length-1)return 0;if(a!==!1&&typeof a=="number"&&this.state.record.length===a-1)return 0;e:for(let c=0;c<o.length;c++){let l=o[c];if(l[0]===s){for(let u=1;u<l.length;u++)if(l[u]!==i[r+u])continue e;return l.length}}return 0},__isRecordDelimiter:function(i,r,s){let{record_delimiter:o}=this.options,a=o.length;e:for(let c=0;c<a;c++){let l=o[c],u=l.length;if(l[0]===i){for(let f=1;f<u;f++)if(l[f]!==r[s+f])continue e;return l.length}}return 0},__isEscape:function(i,r,s){let{escape:o}=this.options;if(o===null)return!1;let a=o.length;if(o[0]===s){for(let c=0;c<a;c++)if(o[c]!==i[r+c])return!1;return!0}return!1},__isQuote:function(i,r){let{quote:s}=this.options;if(s===null)return!1;let o=s.length;for(let a=0;a<o;a++)if(s[a]!==i[r+a])return!1;return!0},__autoDiscoverRecordDelimiter:function(i,r){let{encoding:s}=this.options,o=[Buffer.from(`\r
|
|
4
4
|
`,s),Buffer.from(`
|
|
5
5
|
`,s),Buffer.from("\r",s)];e:for(let a=0;a<o.length;a++){let c=o[a].length;for(let l=0;l<c;l++)if(o[a][l]!==i[r+l])continue e;return this.options.record_delimiter.push(o[a]),this.state.recordDelimiterMaxLength=o[a].length,o[a].length}return 0},__error:function(i){let{encoding:r,raw:s,skip_records_with_error:o}=this.options,a=typeof i=="string"?new Error(i):i;if(o){this.state.recordHasError=!0,this.options.on_skip!==void 0&&this.options.on_skip(a,s?this.state.rawBuffer.toString(r):void 0);return}else return a},__infoDataSet:function(){return{...this.info,columns:this.options.columns}},__infoRecord:function(){let{columns:i,raw:r,encoding:s}=this.options;return{...this.__infoDataSet(),error:this.state.error,header:i===!0,index:this.state.record.length,raw:r?this.state.rawBuffer.toString(s):void 0}},__infoField:function(){let{columns:i}=this.options,r=Array.isArray(i);return{...this.__infoRecord(),column:r===!0?i.length>this.state.record.length?i[this.state.record.length].name:null:this.state.record.length,quoting:this.state.wasQuoting}}}};var $e=function(n,e={}){typeof n=="string"&&(n=Buffer.from(n));let t=e&&e.objname?{}:[],i=Me(e),r=c=>{i.options.objname===void 0?t.push(c):t[c[0]]=c[1]},s=()=>{},o=i.parse(n,!1,r,s);if(o!==void 0)throw o;let a=i.parse(void 0,!0,r,s);if(a!==void 0)throw a;return t};var he=it(nt(),1);import{createRequire as pt}from"module";import te from"path";var _t=(i=>(i[i.USD=0]="USD",i[i.ETH=1]="ETH",i[i.BTC=2]="BTC",i))(_t||{});function gt(n){let t=pt(import.meta.url).resolve(n),i=te.dirname(t);for(;!Ve.existsSync(te.join(i,"package.json"));)i=te.dirname(i);return i}var ie=class{USD_ORACLE_MAP=new Map;ETH_ORACLE_MAP=new Map;BTC_ORACLE_MAP=new Map;ASSETS_INFOS=new Map;chainId;constructor(e,t){this.chainId=t;let i=gt("@sentio/sdk"),r=te.join(i,"src","utils",e),s=Ve.readFileSync(r,{encoding:"utf-8"}),a=$e(s,{delimiter:",",columns:["Pair","Asset","Type","Address"],skip_empty_lines:!0});for(let c of a){let l=c.Pair.split("/"),u=l[0].trim().toLowerCase(),f=l[1].trim().toLowerCase(),w=c.Address.toLowerCase();f==="usd"?this.USD_ORACLE_MAP.set(u,w):f==="eth"?this.ETH_ORACLE_MAP.set(u,w):f=="btc"?this.BTC_ORACLE_MAP.set(u,w):console.error("wrong asset record:"+JSON.stringify(c))}}async getPrice(e,t="latest",i=0){let r=this.USD_ORACLE_MAP;switch(i){case 1:r=this.ETH_ORACLE_MAP;break;case 2:r=this.BTC_ORACLE_MAP;break;default:}e=e.trim().toLowerCase();let s=r.get(e);if(!s)return{error:"No price feed found for asset"};let o=Ae(this.chainId,s);try{let a=await o.latestAnswer({blockTag:t}),c=this.ASSETS_INFOS.get(e);return c||(c=Number(await o.decimals()),this.ASSETS_INFOS.set(e,c)),{price:K(a,c).toNumber()}}catch(a){return{error:"Price query error for "+e+" failed at "+s+" at chain "+this.chainId+". Details: "+a.toString()}}}},vi=new ie("chainlink-oracles.csv",he.EthChainId.ETHEREUM),Di=new ie("chainlink-oracles-sepolia.csv",he.EthChainId.SEPOLIA);import("process").then(n=>n.stdout.write(""));import{Endpoints as vt,processMetrics as Dt}from"@sentio/runtime";var wt="https://app.sentio.xyz".replace(/\/+$/,""),H=class{configuration;constructor(e={}){this.configuration=e}set config(e){this.configuration=e}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:wt}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||Ge}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return typeof e=="function"?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return typeof e=="function"?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}},yt=new H,pe=class{configuration;middleware;constructor(e=yt){this.configuration=e,this.middleware=e.middleware}withMiddleware(...e){let t=this.clone();return t.middleware=t.middleware.concat(...e),t}withPreMiddleware(...e){let t=e.map(i=>({pre:i}));return this.withMiddleware(...t)}withPostMiddleware(...e){let t=e.map(i=>({post:i}));return this.withMiddleware(...t)}isJsonMime(e){return e?pe.jsonRegex.test(e):!1}async request(e,t){let{url:i,init:r}=await this.createFetchParams(e,t),s=await this.fetchApi(i,r);if(s&&s.status>=200&&s.status<300)return s;throw new de(s,"Response returned an error code")}async createFetchParams(e,t){let i=this.configuration.basePath+e.path;e.query!==void 0&&Object.keys(e.query).length!==0&&(i+="?"+this.configuration.queryParamsStringify(e.query));let r=Object.assign({},this.configuration.headers,e.headers);Object.keys(r).forEach(u=>r[u]===void 0?delete r[u]:{});let s=typeof t=="function"?t:async()=>t,o={method:e.method,headers:r,body:e.body,credentials:this.configuration.credentials},a={...o,...await s({init:o,context:e})},c;bt(a.body)||a.body instanceof URLSearchParams||St(a.body)?c=a.body:this.isJsonMime(r["Content-Type"])?c=JSON.stringify(a.body):c=a.body;let l={...a,body:c};return{url:i,init:l}}fetchApi=async(e,t)=>{let i={url:e,init:t};for(let s of this.middleware)s.pre&&(i=await s.pre({fetch:this.fetchApi,...i})||i);let r;try{r=await(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(s){for(let o of this.middleware)o.onError&&(r=await o.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:s,response:r?r.clone():void 0})||r);if(r===void 0)throw s instanceof Error?new me(s,"The request failed and the interceptors did not return an alternative response"):s}for(let s of this.middleware)s.post&&(r=await s.post({fetch:this.fetchApi,url:i.url,init:i.init,response:r.clone()})||r);return r};clone(){let e=this.constructor,t=new e(this.configuration);return t.middleware=this.middleware.slice(),t}},W=pe;Se(W,"jsonRegex",new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i"));function St(n){return typeof Blob<"u"&&n instanceof Blob}function bt(n){return typeof FormData<"u"&&n instanceof FormData}var de=class extends Error{response;name="ResponseError";constructor(e,t){super(t),this.response=e}},me=class extends Error{cause;name="FetchError";constructor(e,t){super(t),this.cause=e}};function Ge(n,e=""){return Object.keys(n).map(t=>Ue(t,n[t],e)).filter(t=>t.length>0).join("&")}function Ue(n,e,t=""){let i=t+(t.length?`[${n}]`:n);if(e instanceof Array){let r=e.map(s=>encodeURIComponent(String(s))).join(`&${encodeURIComponent(i)}=`);return`${encodeURIComponent(i)}=${r}`}if(e instanceof Set){let r=Array.from(e);return Ue(n,r,t)}return e instanceof Date?`${encodeURIComponent(i)}=${encodeURIComponent(e.toISOString())}`:e instanceof Object?Ge(e,i):`${encodeURIComponent(i)}=${encodeURIComponent(String(e))}`}function qe(n,e){return Object.keys(n).reduce((t,i)=>({...t,[i]:e(n[i])}),{})}var B=class{raw;transformer;constructor(e,t=i=>i){this.raw=e,this.transformer=t}async value(){return this.transformer(await this.raw.json())}};function ne(n){return It(n,!1)}function It(n,e){return n==null?n:{price:n.price==null?void 0:n.price,timestamp:n.timestamp==null?void 0:new Date(n.timestamp)}}function We(n){return Ct(n,!1)}function Ct(n,e){return n==null?n:{results:n.results==null?void 0:n.results.map(ne)}}function He(n){return Pt(n,!1)}function Pt(n,e){return n==null?n:{address:n.address==null?void 0:n.address,chain:n.chain==null?void 0:n.chain}}function J(n){return Et(n,!1)}function Et(n,e){return n==null?n:{symbol:n.symbol==null?void 0:n.symbol,address:n.address==null?void 0:He(n.address)}}function je(n){return Nt(n,!1)}function Nt(n,e){return n==null?n:{coinId:n.coinId==null?void 0:J(n.coinId),price:n.price==null?void 0:We(n.price),error:n.error==null?void 0:n.error}}function Ke(n){return At(n,!1)}function At(n,e){return n==null?n:{prices:n.prices==null?void 0:n.prices.map(je)}}function _e(n){return Tt(n,!1)}function Tt(n,e){return n==null?n:{coinId:n.coinId==null?void 0:J(n.coinId),price:n.price==null?void 0:n.price,timestamp:n.timestamp==null?void 0:new Date(n.timestamp)}}function Ye(n){return xt(n,!1)}function xt(n,e){return n==null?n:{prices:n.prices==null?void 0:n.prices.map(_e),latestPrice:n.latestPrice==null?void 0:_e(n.latestPrice)}}function Xe(n){return Rt(n,!1)}function Rt(n,e){return n==null?n:{coins:n.coins==null?void 0:n.coins.map(J),coinAddressesInChain:n.coinAddressesInChain==null?void 0:qe(n.coinAddressesInChain,J)}}var re=class extends W{async batchGetPricesRaw(e,t){let i={};e.timestamps!=null&&(i.timestamps=e.timestamps);let r={};this.configuration&&this.configuration.apiKey&&(r["api-key"]=await this.configuration.apiKey("api-key"));let s=await this.request({path:"/api/v1/prices/batch",method:"GET",headers:r,query:i},t);return new B(s,o=>Ke(o))}async batchGetPrices(e={},t){return await(await this.batchGetPricesRaw(e,t)).value()}async checkLatestPriceRaw(e){let t={},i={};this.configuration&&this.configuration.apiKey&&(i["api-key"]=await this.configuration.apiKey("api-key"));let r=await this.request({path:"/api/v1/prices/check_latest",method:"GET",headers:i,query:t},e);return new B(r,s=>Ye(s))}async checkLatestPrice(e){return await(await this.checkLatestPriceRaw(e)).value()}async getPriceRaw(e,t){let i={};e.timestamp!=null&&(i.timestamp=e.timestamp.toISOString()),e.coinIdSymbol!=null&&(i["coinId.symbol"]=e.coinIdSymbol),e.coinIdAddressAddress!=null&&(i["coinId.address.address"]=e.coinIdAddressAddress),e.coinIdAddressChain!=null&&(i["coinId.address.chain"]=e.coinIdAddressChain),e.source!=null&&(i.source=e.source);let r={};this.configuration&&this.configuration.apiKey&&(r["api-key"]=await this.configuration.apiKey("api-key"));let s=await this.request({path:"/api/v1/prices",method:"GET",headers:r,query:i},t);return new B(s,o=>ne(o))}async getPrice(e={},t){return await(await this.getPriceRaw(e,t)).value()}async priceListCoinsRaw(e,t){let i={};e.limit!=null&&(i.limit=e.limit),e.offset!=null&&(i.offset=e.offset),e.searchQuery!=null&&(i.searchQuery=e.searchQuery),e.chain!=null&&(i.chain=e.chain);let r={};this.configuration&&this.configuration.apiKey&&(r["api-key"]=await this.configuration.apiKey("api-key"));let s=await this.request({path:"/api/v1/prices/coins",method:"GET",headers:r,query:i},t);return new B(s,o=>Xe(o))}async priceListCoins(e={},t){return await(await this.priceListCoinsRaw(e,t)).value()}};import Lt from"path";import Ft from"fs";import Bt from"os";function Jt(){try{let n=Ft.readFileSync(Lt.join(Bt.homedir(),".sentio","config.json"),"utf8");return JSON.parse(n)["https://app.sentio.xyz"]?.api_keys}catch{}}function we(n=vt.INSTANCE.priceFeedAPI){n.startsWith("http")||(n="http://"+n),n.endsWith("/")&&(n=n.slice(0,-1));let e=new H({basePath:n,apiKey:Jt()});return new re(e)}var k=new D({max:1e5,ttl:1e3*60*60}),U;async function Ze(n,e,t){return U||(U=we()),kt(U,n,e,t)}async function kt(n,e,t,i){let r=ge(e),s=ge(new Date),o;t.symbol?o=`${t.symbol}-${r}`:o=`${t.address?.address}-${t.address?.chain}-${r}`;let a=k.get(o);return a||(Dt.process_pricecall_count.add(1),a=n.getPrice({timestamp:e,coinIdSymbol:t.symbol,coinIdAddressAddress:t.address?.address,coinIdAddressChain:t.address?.chain}).then(l=>{if(l.timestamp)if(ge(l.timestamp)===s)k.delete(o);else{let w=Math.abs(l.timestamp.getTime()-e.getTime())/(1e3*60*60*24),b=i?.toleranceInDays||2;if(w>b){k.delete(o);return}}else k.delete(o);return l.price}).catch(l=>{if(setTimeout(()=>{k.delete(o)},1e3),l.response?.status===404){console.error("price not found for ",JSON.stringify(t)," at ",r);return}throw k.delete(o),l}),k.set(o,a),a)}async function zt(n,e,t,i){return Ze(t,{address:{chain:n,address:e}},i)}async function Mt(n,e,t){return Ze(e,{symbol:n},t)}function ge(n){return[n.getUTCDate(),n.getUTCMonth()+1,n.getUTCFullYear()].join("-")}async function $t(n){U||(U=we());let e=await U.priceListCoins({chain:n,limit:1e3});return e.coinAddressesInChain?Object.entries(e.coinAddressesInChain).map(([t,i])=>(i.symbol=t,i)):[]}import("process").then(n=>n.stdout.write(""));async function _n(n,e=!1){try{return await n}catch(t){if(t instanceof Ce||t.code==="CALL_EXCEPTION"||t.code==="BAD_DATA"){e&&console.error("eth call exception, return undefined",t);return}throw t}}import("process").then(n=>n.stdout.write(""));import("process").then(n=>n.stdout.write(""));export{Vt as a,Ut as b,Fe as c,_t as d,gt as e,vi as f,Di as g,we as h,zt as i,Mt as j,$t as k,_n as l};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-RVQBDYQ2.js.map
|