@0xtorch/evm 0.0.1
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/README.md +15 -0
- package/dist/import/abis/erc1155.d.ts +245 -0
- package/dist/import/abis/erc1155.d.ts.map +1 -0
- package/dist/import/abis/erc20.d.ts +169 -0
- package/dist/import/abis/erc20.d.ts.map +1 -0
- package/dist/import/abis/erc721.d.ts +267 -0
- package/dist/import/abis/erc721.d.ts.map +1 -0
- package/dist/import/abis/index.d.ts +5 -0
- package/dist/import/abis/index.d.ts.map +1 -0
- package/dist/import/abis/weth.d.ts +214 -0
- package/dist/import/abis/weth.d.ts.map +1 -0
- package/dist/import/absoluteValue.d.mts +3 -0
- package/dist/import/absoluteValue.d.mts.map +1 -0
- package/dist/import/absoluteValue.d.ts +3 -0
- package/dist/import/absoluteValue.d.ts.map +1 -0
- package/dist/import/analyzer/analyze.d.ts +18 -0
- package/dist/import/analyzer/analyze.d.ts.map +1 -0
- package/dist/import/analyzer/analyzer.d.ts +4 -0
- package/dist/import/analyzer/analyzer.d.ts.map +1 -0
- package/dist/import/analyzer/axieMarketplace/analyze.d.ts +4 -0
- package/dist/import/analyzer/axieMarketplace/analyze.d.ts.map +1 -0
- package/dist/import/analyzer/axieMarketplace/index.d.ts +2 -0
- package/dist/import/analyzer/axieMarketplace/index.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/addLiquidity.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/addLiquidity.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/atomicArbitrage.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/atomicArbitrage.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/bridgeFrom.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/bridgeFrom.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/bridgeTo.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/bridgeTo.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/buyNft.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/buyNft.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/createAccountActionByAction.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/createAccountActionByAction.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/deposit.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/deposit.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/depositWithBond.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/depositWithBond.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/freeMintNft.d.ts +53 -0
- package/dist/import/analyzer/createAccountActionByAction/freeMintNft.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/index.d.ts +2 -0
- package/dist/import/analyzer/createAccountActionByAction/index.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/removeLiquidity.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/removeLiquidity.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/spam.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/spam.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/trade.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/trade.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/transactionFee.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/transactionFee.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/transfer.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/transfer.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/withdraw.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/withdraw.d.ts.map +1 -0
- package/dist/import/analyzer/createAccountActionByAction/withdrawWithBond.d.ts +59 -0
- package/dist/import/analyzer/createAccountActionByAction/withdrawWithBond.d.ts.map +1 -0
- package/dist/import/analyzer/gasFee/analyze.d.ts +4 -0
- package/dist/import/analyzer/gasFee/analyze.d.ts.map +1 -0
- package/dist/import/analyzer/gasFee/index.d.ts +2 -0
- package/dist/import/analyzer/gasFee/index.d.ts.map +1 -0
- package/dist/import/analyzer/index.d.ts +10 -0
- package/dist/import/analyzer/index.d.ts.map +1 -0
- package/dist/import/analyzer/json/analyze.d.ts +5 -0
- package/dist/import/analyzer/json/analyze.d.ts.map +1 -0
- package/dist/import/analyzer/json/generatorAnyLog.d.ts +55 -0
- package/dist/import/analyzer/json/generatorAnyLog.d.ts.map +1 -0
- package/dist/import/analyzer/json/generatorAnyTokenTransfer.d.ts +54 -0
- package/dist/import/analyzer/json/generatorAnyTokenTransfer.d.ts.map +1 -0
- package/dist/import/analyzer/json/generatorSpecificTokenTransfer.d.ts +55 -0
- package/dist/import/analyzer/json/generatorSpecificTokenTransfer.d.ts.map +1 -0
- package/dist/import/analyzer/json/index.d.ts +2 -0
- package/dist/import/analyzer/json/index.d.ts.map +1 -0
- package/dist/import/analyzer/json/types.d.ts +177 -0
- package/dist/import/analyzer/json/types.d.ts.map +1 -0
- package/dist/import/analyzer/seaport/analyze.d.ts +4 -0
- package/dist/import/analyzer/seaport/analyze.d.ts.map +1 -0
- package/dist/import/analyzer/seaport/index.d.ts +2 -0
- package/dist/import/analyzer/seaport/index.d.ts.map +1 -0
- package/dist/import/analyzer/seaport/orderFulfilled.d.ts +139 -0
- package/dist/import/analyzer/seaport/orderFulfilled.d.ts.map +1 -0
- package/dist/import/analyzer/spam/analyze.d.ts +4 -0
- package/dist/import/analyzer/spam/analyze.d.ts.map +1 -0
- package/dist/import/analyzer/spam/index.d.ts +2 -0
- package/dist/import/analyzer/spam/index.d.ts.map +1 -0
- package/dist/import/analyzer/swap/analyze.d.ts +4 -0
- package/dist/import/analyzer/swap/analyze.d.ts.map +1 -0
- package/dist/import/analyzer/swap/index.d.ts +2 -0
- package/dist/import/analyzer/swap/index.d.ts.map +1 -0
- package/dist/import/analyzer/swap/traderJoeLBPairSwap.d.ts +108 -0
- package/dist/import/analyzer/swap/traderJoeLBPairSwap.d.ts.map +1 -0
- package/dist/import/analyzer/swap/univ2PairSwap.d.ts +84 -0
- package/dist/import/analyzer/swap/univ2PairSwap.d.ts.map +1 -0
- package/dist/import/analyzer/swap/univ3PoolSwap.d.ts +96 -0
- package/dist/import/analyzer/swap/univ3PoolSwap.d.ts.map +1 -0
- package/dist/import/analyzer/swap/wrappedDeposit.d.ts +36 -0
- package/dist/import/analyzer/swap/wrappedDeposit.d.ts.map +1 -0
- package/dist/import/analyzer/swap/wrappedWithdrawal.d.ts +36 -0
- package/dist/import/analyzer/swap/wrappedWithdrawal.d.ts.map +1 -0
- package/dist/import/analyzer/transfer/analyze.d.ts +4 -0
- package/dist/import/analyzer/transfer/analyze.d.ts.map +1 -0
- package/dist/import/analyzer/transfer/index.d.ts +2 -0
- package/dist/import/analyzer/transfer/index.d.ts.map +1 -0
- package/dist/import/analyzer/types.d.ts +17 -0
- package/dist/import/analyzer/types.d.ts.map +1 -0
- package/dist/import/apps/index.d.ts +2 -0
- package/dist/import/apps/index.d.ts.map +1 -0
- package/dist/import/apps/types.d.ts +6 -0
- package/dist/import/apps/types.d.ts.map +1 -0
- package/dist/import/chains/definitions/arbitrumOne.d.ts +99 -0
- package/dist/import/chains/definitions/arbitrumOne.d.ts.map +1 -0
- package/dist/import/chains/definitions/astar.d.ts +64 -0
- package/dist/import/chains/definitions/astar.d.ts.map +1 -0
- package/dist/import/chains/definitions/avalancheC.d.ts +84 -0
- package/dist/import/chains/definitions/avalancheC.d.ts.map +1 -0
- package/dist/import/chains/definitions/base.d.ts +94 -0
- package/dist/import/chains/definitions/base.d.ts.map +1 -0
- package/dist/import/chains/definitions/bsc.d.ts +144 -0
- package/dist/import/chains/definitions/bsc.d.ts.map +1 -0
- package/dist/import/chains/definitions/defineChain.d.ts +3 -0
- package/dist/import/chains/definitions/defineChain.d.ts.map +1 -0
- package/dist/import/chains/definitions/ethereum.d.ts +129 -0
- package/dist/import/chains/definitions/ethereum.d.ts.map +1 -0
- package/dist/import/chains/definitions/fantom.d.ts +89 -0
- package/dist/import/chains/definitions/fantom.d.ts.map +1 -0
- package/dist/import/chains/definitions/index.d.ts +16 -0
- package/dist/import/chains/definitions/index.d.ts.map +1 -0
- package/dist/import/chains/definitions/linea.d.ts +69 -0
- package/dist/import/chains/definitions/linea.d.ts.map +1 -0
- package/dist/import/chains/definitions/mantle.d.ts +62 -0
- package/dist/import/chains/definitions/mantle.d.ts.map +1 -0
- package/dist/import/chains/definitions/metis.d.ts +52 -0
- package/dist/import/chains/definitions/metis.d.ts.map +1 -0
- package/dist/import/chains/definitions/moonbeam.d.ts +84 -0
- package/dist/import/chains/definitions/moonbeam.d.ts.map +1 -0
- package/dist/import/chains/definitions/moonriver.d.ts +64 -0
- package/dist/import/chains/definitions/moonriver.d.ts.map +1 -0
- package/dist/import/chains/definitions/optimism.d.ts +104 -0
- package/dist/import/chains/definitions/optimism.d.ts.map +1 -0
- package/dist/import/chains/definitions/polygonPos.d.ts +84 -0
- package/dist/import/chains/definitions/polygonPos.d.ts.map +1 -0
- package/dist/import/chains/definitions/ronin.d.ts +49 -0
- package/dist/import/chains/definitions/ronin.d.ts.map +1 -0
- package/dist/import/chains/externals/defillama/constants.d.ts +2 -0
- package/dist/import/chains/externals/defillama/constants.d.ts.map +1 -0
- package/dist/import/chains/externals/defillama/getBlockOfTimestamp.d.ts +10 -0
- package/dist/import/chains/externals/defillama/getBlockOfTimestamp.d.ts.map +1 -0
- package/dist/import/chains/externals/defillama/index.d.ts +2 -0
- package/dist/import/chains/externals/defillama/index.d.ts.map +1 -0
- package/dist/import/chains/externals/index.d.ts +2 -0
- package/dist/import/chains/externals/index.d.ts.map +1 -0
- package/dist/import/chains/index.d.ts +4 -0
- package/dist/import/chains/index.d.ts.map +1 -0
- package/dist/import/chains/types/chain.d.ts +22 -0
- package/dist/import/chains/types/chain.d.ts.map +1 -0
- package/dist/import/chains/types/index.d.ts +3 -0
- package/dist/import/chains/types/index.d.ts.map +1 -0
- package/dist/import/chains/types/rpc.d.ts +7 -0
- package/dist/import/chains/types/rpc.d.ts.map +1 -0
- package/dist/import/clients/definitions/defineClient.d.ts +3 -0
- package/dist/import/clients/definitions/defineClient.d.ts.map +1 -0
- package/dist/import/clients/definitions/index.d.ts +2 -0
- package/dist/import/clients/definitions/index.d.ts.map +1 -0
- package/dist/import/clients/definitions/viemClient.d.ts +59 -0
- package/dist/import/clients/definitions/viemClient.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/estimateFeesPerGas.d.ts +13 -0
- package/dist/import/clients/externals/viem/estimateFeesPerGas.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/getBalance.d.ts +15 -0
- package/dist/import/clients/externals/viem/getBalance.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/getBlock.d.ts +14 -0
- package/dist/import/clients/externals/viem/getBlock.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/getBlockNumber.d.ts +13 -0
- package/dist/import/clients/externals/viem/getBlockNumber.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/getEventLogs.d.ts +19 -0
- package/dist/import/clients/externals/viem/getEventLogs.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/getTransaction.d.ts +15 -0
- package/dist/import/clients/externals/viem/getTransaction.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/getTransactionCount.d.ts +15 -0
- package/dist/import/clients/externals/viem/getTransactionCount.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/getTransactionReceipt.d.ts +15 -0
- package/dist/import/clients/externals/viem/getTransactionReceipt.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/index.d.ts +11 -0
- package/dist/import/clients/externals/viem/index.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/middleware.d.ts +23 -0
- package/dist/import/clients/externals/viem/middleware.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/multicall.d.ts +14 -0
- package/dist/import/clients/externals/viem/multicall.d.ts.map +1 -0
- package/dist/import/clients/externals/viem/readContract.d.ts +14 -0
- package/dist/import/clients/externals/viem/readContract.d.ts.map +1 -0
- package/dist/import/clients/index.d.ts +3 -0
- package/dist/import/clients/index.d.ts.map +1 -0
- package/dist/import/clients/types.d.ts +64 -0
- package/dist/import/clients/types.d.ts.map +1 -0
- package/dist/import/createBigDecimal.d.mts +6 -0
- package/dist/import/createBigDecimal.d.mts.map +1 -0
- package/dist/import/createBigDecimal.d.ts +3 -0
- package/dist/import/createBigDecimal.d.ts.map +1 -0
- package/dist/import/creates/createEvmAccount.d.ts +5 -0
- package/dist/import/creates/createEvmAccount.d.ts.map +1 -0
- package/dist/import/decoder/decode.d.ts +3 -0
- package/dist/import/decoder/decode.d.ts.map +1 -0
- package/dist/import/decoder/decoder.d.ts +3 -0
- package/dist/import/decoder/decoder.d.ts.map +1 -0
- package/dist/import/decoder/index.d.ts +6 -0
- package/dist/import/decoder/index.d.ts.map +1 -0
- package/dist/import/decoder/parseErc1155TransferSingleLogs.d.ts +4 -0
- package/dist/import/decoder/parseErc1155TransferSingleLogs.d.ts.map +1 -0
- package/dist/import/decoder/parseErc20TransferLogs.d.ts +8 -0
- package/dist/import/decoder/parseErc20TransferLogs.d.ts.map +1 -0
- package/dist/import/decoder/parseErc721TransferLogs.d.ts +8 -0
- package/dist/import/decoder/parseErc721TransferLogs.d.ts.map +1 -0
- package/dist/import/decoder/types.d.ts +16 -0
- package/dist/import/decoder/types.d.ts.map +1 -0
- package/dist/import/divide.d.mts +8 -0
- package/dist/import/divide.d.mts.map +1 -0
- package/dist/import/divide.d.ts +3 -0
- package/dist/import/divide.d.ts.map +1 -0
- package/dist/import/equals.d.mts +3 -0
- package/dist/import/equals.d.mts.map +1 -0
- package/dist/import/equals.d.ts +3 -0
- package/dist/import/equals.d.ts.map +1 -0
- package/dist/import/explorers/definitions/blockscout.d.ts +60 -0
- package/dist/import/explorers/definitions/blockscout.d.ts.map +1 -0
- package/dist/import/explorers/definitions/defineExplorer.d.ts +3 -0
- package/dist/import/explorers/definitions/defineExplorer.d.ts.map +1 -0
- package/dist/import/explorers/definitions/etherscan.d.ts +61 -0
- package/dist/import/explorers/definitions/etherscan.d.ts.map +1 -0
- package/dist/import/explorers/definitions/index.d.ts +5 -0
- package/dist/import/explorers/definitions/index.d.ts.map +1 -0
- package/dist/import/explorers/definitions/roninExplorer.d.ts +62 -0
- package/dist/import/explorers/definitions/roninExplorer.d.ts.map +1 -0
- package/dist/import/explorers/definitions/routescan.d.ts +19 -0
- package/dist/import/explorers/definitions/routescan.d.ts.map +1 -0
- package/dist/import/explorers/externals/blockscout/getBlockNumberOfTimestamp.d.ts +11 -0
- package/dist/import/explorers/externals/blockscout/getBlockNumberOfTimestamp.d.ts.map +1 -0
- package/dist/import/explorers/externals/blockscout/getContractByAddress.d.ts +30 -0
- package/dist/import/explorers/externals/blockscout/getContractByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/blockscout/getInternalTransactionsByAddress.d.ts +62 -0
- package/dist/import/explorers/externals/blockscout/getInternalTransactionsByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.d.ts +54 -0
- package/dist/import/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.d.ts.map +1 -0
- package/dist/import/explorers/externals/blockscout/getNormalTransactionsByAddress.d.ts +77 -0
- package/dist/import/explorers/externals/blockscout/getNormalTransactionsByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/blockscout/getTokenTransfersByAddress.d.ts +80 -0
- package/dist/import/explorers/externals/blockscout/getTokenTransfersByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/blockscout/index.d.ts +7 -0
- package/dist/import/explorers/externals/blockscout/index.d.ts.map +1 -0
- package/dist/import/explorers/externals/blockscout/middleware.d.ts +7 -0
- package/dist/import/explorers/externals/blockscout/middleware.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/getBlockNumberOfTimestamp.d.ts +12 -0
- package/dist/import/explorers/externals/etherscan/getBlockNumberOfTimestamp.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/getContractByAddress.d.ts +55 -0
- package/dist/import/explorers/externals/etherscan/getContractByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/getErc1155TokenTransfersByAddress.d.ts +83 -0
- package/dist/import/explorers/externals/etherscan/getErc1155TokenTransfersByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/getErc20TokenTransfersByAddress.d.ts +81 -0
- package/dist/import/explorers/externals/etherscan/getErc20TokenTransfersByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/getErc721TokenTransfersByAddress.d.ts +81 -0
- package/dist/import/explorers/externals/etherscan/getErc721TokenTransfersByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/getInternalTransactionsByAddress.d.ts +62 -0
- package/dist/import/explorers/externals/etherscan/getInternalTransactionsByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.d.ts +55 -0
- package/dist/import/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/getNormalTransactionsByAddress.d.ts +84 -0
- package/dist/import/explorers/externals/etherscan/getNormalTransactionsByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/index.d.ts +9 -0
- package/dist/import/explorers/externals/etherscan/index.d.ts.map +1 -0
- package/dist/import/explorers/externals/etherscan/middleware.d.ts +7 -0
- package/dist/import/explorers/externals/etherscan/middleware.d.ts.map +1 -0
- package/dist/import/explorers/externals/roninExplorer/getInternalTransactionByHash.d.ts +57 -0
- package/dist/import/explorers/externals/roninExplorer/getInternalTransactionByHash.d.ts.map +1 -0
- package/dist/import/explorers/externals/roninExplorer/getNormalTransactionsByAddress.d.ts +70 -0
- package/dist/import/explorers/externals/roninExplorer/getNormalTransactionsByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/roninExplorer/getTokenTransfersByAddress.d.ts +64 -0
- package/dist/import/explorers/externals/roninExplorer/getTokenTransfersByAddress.d.ts.map +1 -0
- package/dist/import/explorers/externals/roninExplorer/index.d.ts +4 -0
- package/dist/import/explorers/externals/roninExplorer/index.d.ts.map +1 -0
- package/dist/import/explorers/externals/roninExplorer/middleware.d.ts +5 -0
- package/dist/import/explorers/externals/roninExplorer/middleware.d.ts.map +1 -0
- package/dist/import/explorers/index.d.ts +3 -0
- package/dist/import/explorers/index.d.ts.map +1 -0
- package/dist/import/explorers/types.d.ts +43 -0
- package/dist/import/explorers/types.d.ts.map +1 -0
- package/dist/import/fix.d.mts +7 -0
- package/dist/import/fix.d.mts.map +1 -0
- package/dist/import/fix.d.ts +3 -0
- package/dist/import/fix.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/getAccountsTransactionFulls.d.ts +15 -0
- package/dist/import/getAccountsTransactionFulls/getAccountsTransactionFulls.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.d.ts +4 -0
- package/dist/import/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/getDecodedTransactionsPrices.d.ts +5 -0
- package/dist/import/getAccountsTransactionFulls/getDecodedTransactionsPrices.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/getHashesAndInternalTxs.d.ts +8 -0
- package/dist/import/getAccountsTransactionFulls/getHashesAndInternalTxs.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/getTransactionDetail.d.ts +5 -0
- package/dist/import/getAccountsTransactionFulls/getTransactionDetail.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/getTransactionDetails.d.ts +5 -0
- package/dist/import/getAccountsTransactionFulls/getTransactionDetails.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/getTransactionsApps.d.ts +8 -0
- package/dist/import/getAccountsTransactionFulls/getTransactionsApps.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/index.d.ts +3 -0
- package/dist/import/getAccountsTransactionFulls/index.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/types.d.ts +87 -0
- package/dist/import/getAccountsTransactionFulls/types.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/withD.d.ts +4 -0
- package/dist/import/getAccountsTransactionFulls/withD.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/withDA.d.ts +4 -0
- package/dist/import/getAccountsTransactionFulls/withDA.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/withP.d.ts +4 -0
- package/dist/import/getAccountsTransactionFulls/withP.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/withPD.d.ts +4 -0
- package/dist/import/getAccountsTransactionFulls/withPD.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/withPDA.d.ts +4 -0
- package/dist/import/getAccountsTransactionFulls/withPDA.d.ts.map +1 -0
- package/dist/import/getAccountsTransactionFulls/withUndefined.d.ts +4 -0
- package/dist/import/getAccountsTransactionFulls/withUndefined.d.ts.map +1 -0
- package/dist/import/getTransactionFull/getTransactionDetail.d.ts +5 -0
- package/dist/import/getTransactionFull/getTransactionDetail.d.ts.map +1 -0
- package/dist/import/getTransactionFull/getTransactionFull.d.ts +11 -0
- package/dist/import/getTransactionFull/getTransactionFull.d.ts.map +1 -0
- package/dist/import/getTransactionFull/getTransactionFullCustom.d.ts +4 -0
- package/dist/import/getTransactionFull/getTransactionFullCustom.d.ts.map +1 -0
- package/dist/import/getTransactionFull/index.d.ts +3 -0
- package/dist/import/getTransactionFull/index.d.ts.map +1 -0
- package/dist/import/getTransactionFull/types.d.ts +63 -0
- package/dist/import/getTransactionFull/types.d.ts.map +1 -0
- package/dist/import/getTransactionFull/withD.d.ts +4 -0
- package/dist/import/getTransactionFull/withD.d.ts.map +1 -0
- package/dist/import/getTransactionFull/withDA.d.ts +4 -0
- package/dist/import/getTransactionFull/withDA.d.ts.map +1 -0
- package/dist/import/getTransactionFull/withP.d.ts +4 -0
- package/dist/import/getTransactionFull/withP.d.ts.map +1 -0
- package/dist/import/getTransactionFull/withPD.d.ts +4 -0
- package/dist/import/getTransactionFull/withPD.d.ts.map +1 -0
- package/dist/import/getTransactionFull/withPDA.d.ts +4 -0
- package/dist/import/getTransactionFull/withPDA.d.ts.map +1 -0
- package/dist/import/getTransactionFull/withUndefined.d.ts +4 -0
- package/dist/import/getTransactionFull/withUndefined.d.ts.map +1 -0
- package/dist/import/greaterThan.d.mts +3 -0
- package/dist/import/greaterThan.d.mts.map +1 -0
- package/dist/import/greaterThan.d.ts +3 -0
- package/dist/import/greaterThan.d.ts.map +1 -0
- package/dist/import/index.d.mts +15 -0
- package/dist/import/index.d.mts.map +1 -0
- package/dist/import/index.d.ts +11 -0
- package/dist/import/index.d.ts.map +1 -0
- package/dist/import/index.mjs +1 -0
- package/dist/import/minus.d.mts +3 -0
- package/dist/import/minus.d.mts.map +1 -0
- package/dist/import/minus.d.ts +3 -0
- package/dist/import/minus.d.ts.map +1 -0
- package/dist/import/plus.d.mts +3 -0
- package/dist/import/plus.d.mts.map +1 -0
- package/dist/import/plus.d.ts +3 -0
- package/dist/import/plus.d.ts.map +1 -0
- package/dist/import/removeTrailingZeros.d.mts +6 -0
- package/dist/import/removeTrailingZeros.d.mts.map +1 -0
- package/dist/import/removeTrailingZeros.d.ts +3 -0
- package/dist/import/removeTrailingZeros.d.ts.map +1 -0
- package/dist/import/times.d.ts +3 -0
- package/dist/import/times.d.ts.map +1 -0
- package/dist/import/toStringBigDecimal.d.mts +6 -0
- package/dist/import/toStringBigDecimal.d.mts.map +1 -0
- package/dist/import/toStringBigDecimal.d.ts +3 -0
- package/dist/import/toStringBigDecimal.d.ts.map +1 -0
- package/dist/import/type.d.mts +5 -0
- package/dist/import/type.d.mts.map +1 -0
- package/dist/import/type.d.ts +5 -0
- package/dist/import/type.d.ts.map +1 -0
- package/dist/import/types/erc1155.d.ts +16 -0
- package/dist/import/types/erc1155.d.ts.map +1 -0
- package/dist/import/types/erc20.d.ts +19 -0
- package/dist/import/types/erc20.d.ts.map +1 -0
- package/dist/import/types/erc721.d.ts +18 -0
- package/dist/import/types/erc721.d.ts.map +1 -0
- package/dist/import/types/evmAccount.d.ts +10 -0
- package/dist/import/types/evmAccount.d.ts.map +1 -0
- package/dist/import/types/hex.d.ts +5 -0
- package/dist/import/types/hex.d.ts.map +1 -0
- package/dist/import/types/index.d.ts +12 -0
- package/dist/import/types/index.d.ts.map +1 -0
- package/dist/import/types/input.d.ts +26 -0
- package/dist/import/types/input.d.ts.map +1 -0
- package/dist/import/types/internalTransaction.d.ts +18 -0
- package/dist/import/types/internalTransaction.d.ts.map +1 -0
- package/dist/import/types/log.d.ts +118 -0
- package/dist/import/types/log.d.ts.map +1 -0
- package/dist/import/types/transaction.d.ts +44 -0
- package/dist/import/types/transaction.d.ts.map +1 -0
- package/dist/import/utils/bigint.d.ts +3 -0
- package/dist/import/utils/bigint.d.ts.map +1 -0
- package/dist/import/utils/index.d.ts +4 -0
- package/dist/import/utils/index.d.ts.map +1 -0
- package/dist/import/utils/timeout.d.ts +2 -0
- package/dist/import/utils/timeout.d.ts.map +1 -0
- package/dist/import/utils/types.d.ts +12 -0
- package/dist/import/utils/types.d.ts.map +1 -0
- package/dist/require/absoluteValue.d.ts +3 -0
- package/dist/require/absoluteValue.d.ts.map +1 -0
- package/dist/require/createBigDecimal.d.ts +6 -0
- package/dist/require/createBigDecimal.d.ts.map +1 -0
- package/dist/require/divide.d.ts +2 -0
- package/dist/require/divide.d.ts.map +1 -0
- package/dist/require/equals.d.ts +3 -0
- package/dist/require/equals.d.ts.map +1 -0
- package/dist/require/fix.d.ts +7 -0
- package/dist/require/fix.d.ts.map +1 -0
- package/dist/require/greaterThan.d.ts +3 -0
- package/dist/require/greaterThan.d.ts.map +1 -0
- package/dist/require/index.cjs +46 -0
- package/dist/require/index.d.cts +2 -0
- package/dist/require/index.d.cts.map +1 -0
- package/dist/require/index.d.ts +11 -0
- package/dist/require/index.d.ts.map +1 -0
- package/dist/require/minus.d.ts +3 -0
- package/dist/require/minus.d.ts.map +1 -0
- package/dist/require/plus.d.ts +3 -0
- package/dist/require/plus.d.ts.map +1 -0
- package/dist/require/removeTrailingZeros.d.ts +6 -0
- package/dist/require/removeTrailingZeros.d.ts.map +1 -0
- package/dist/require/times.d.ts +8 -0
- package/dist/require/times.d.ts.map +1 -0
- package/dist/require/toStringBigDecimal.d.ts +6 -0
- package/dist/require/toStringBigDecimal.d.ts.map +1 -0
- package/dist/require/type.d.ts +5 -0
- package/dist/require/type.d.ts.map +1 -0
- package/package.json +85 -0
- package/src/abis/erc1155.ts +314 -0
- package/src/abis/erc20.ts +222 -0
- package/src/abis/erc721.ts +346 -0
- package/src/abis/index.ts +4 -0
- package/src/abis/weth.ts +153 -0
- package/src/analyzer/analyze.ts +85 -0
- package/src/analyzer/analyzer.ts +5 -0
- package/src/analyzer/axieMarketplace/analyze.ts +326 -0
- package/src/analyzer/axieMarketplace/index.ts +1 -0
- package/src/analyzer/createAccountActionByAction/addLiquidity.ts +60 -0
- package/src/analyzer/createAccountActionByAction/atomicArbitrage.ts +115 -0
- package/src/analyzer/createAccountActionByAction/bridgeFrom.ts +61 -0
- package/src/analyzer/createAccountActionByAction/bridgeTo.ts +61 -0
- package/src/analyzer/createAccountActionByAction/buyNft.ts +106 -0
- package/src/analyzer/createAccountActionByAction/createAccountActionByAction.ts +181 -0
- package/src/analyzer/createAccountActionByAction/deposit.ts +64 -0
- package/src/analyzer/createAccountActionByAction/depositWithBond.ts +60 -0
- package/src/analyzer/createAccountActionByAction/freeMintNft.ts +54 -0
- package/src/analyzer/createAccountActionByAction/index.ts +1 -0
- package/src/analyzer/createAccountActionByAction/removeLiquidity.ts +60 -0
- package/src/analyzer/createAccountActionByAction/spam.ts +79 -0
- package/src/analyzer/createAccountActionByAction/trade.ts +105 -0
- package/src/analyzer/createAccountActionByAction/transactionFee.ts +51 -0
- package/src/analyzer/createAccountActionByAction/transfer.ts +95 -0
- package/src/analyzer/createAccountActionByAction/withdraw.ts +61 -0
- package/src/analyzer/createAccountActionByAction/withdrawWithBond.ts +60 -0
- package/src/analyzer/gasFee/analyze.test.ts +6 -0
- package/src/analyzer/gasFee/analyze.ts +72 -0
- package/src/analyzer/gasFee/index.ts +1 -0
- package/src/analyzer/index.ts +9 -0
- package/src/analyzer/json/analyze.test.ts +1819 -0
- package/src/analyzer/json/analyze.ts +536 -0
- package/src/analyzer/json/generatorAnyLog.ts +207 -0
- package/src/analyzer/json/generatorAnyTokenTransfer.ts +118 -0
- package/src/analyzer/json/generatorSpecificTokenTransfer.ts +425 -0
- package/src/analyzer/json/index.ts +1 -0
- package/src/analyzer/json/types.ts +239 -0
- package/src/analyzer/seaport/analyze.test.ts +2323 -0
- package/src/analyzer/seaport/analyze.ts +917 -0
- package/src/analyzer/seaport/index.ts +1 -0
- package/src/analyzer/seaport/orderFulfilled.ts +131 -0
- package/src/analyzer/spam/analyze.ts +219 -0
- package/src/analyzer/spam/index.ts +1 -0
- package/src/analyzer/swap/analyze.test.ts +2401 -0
- package/src/analyzer/swap/analyze.ts +939 -0
- package/src/analyzer/swap/index.ts +1 -0
- package/src/analyzer/swap/traderJoeLBPairSwap.ts +92 -0
- package/src/analyzer/swap/univ2PairSwap.ts +77 -0
- package/src/analyzer/swap/univ3PoolSwap.ts +83 -0
- package/src/analyzer/swap/wrappedDeposit.ts +51 -0
- package/src/analyzer/swap/wrappedWithdrawal.ts +53 -0
- package/src/analyzer/tests.ts +2 -0
- package/src/analyzer/transfer/analyze.test.ts +6 -0
- package/src/analyzer/transfer/analyze.ts +209 -0
- package/src/analyzer/transfer/index.ts +1 -0
- package/src/analyzer/types.ts +44 -0
- package/src/apps/index.ts +1 -0
- package/src/apps/types.ts +10 -0
- package/src/chains/definitions/arbitrumOne.test.ts +50 -0
- package/src/chains/definitions/arbitrumOne.ts +133 -0
- package/src/chains/definitions/astar.test.ts +51 -0
- package/src/chains/definitions/astar.ts +93 -0
- package/src/chains/definitions/avalancheC.test.ts +50 -0
- package/src/chains/definitions/avalancheC.ts +115 -0
- package/src/chains/definitions/base.test.ts +50 -0
- package/src/chains/definitions/base.ts +125 -0
- package/src/chains/definitions/bsc.test.ts +50 -0
- package/src/chains/definitions/bsc.ts +182 -0
- package/src/chains/definitions/defineChain.ts +7 -0
- package/src/chains/definitions/ethereum.test.ts +50 -0
- package/src/chains/definitions/ethereum.ts +169 -0
- package/src/chains/definitions/fantom.test.ts +50 -0
- package/src/chains/definitions/fantom.ts +123 -0
- package/src/chains/definitions/index.ts +88 -0
- package/src/chains/definitions/linea.test.ts +50 -0
- package/src/chains/definitions/linea.ts +95 -0
- package/src/chains/definitions/mantle.test.ts +50 -0
- package/src/chains/definitions/mantle.ts +75 -0
- package/src/chains/definitions/metis.test.ts +50 -0
- package/src/chains/definitions/metis.ts +60 -0
- package/src/chains/definitions/moonbeam.test.ts +50 -0
- package/src/chains/definitions/moonbeam.ts +117 -0
- package/src/chains/definitions/moonriver.test.ts +50 -0
- package/src/chains/definitions/moonriver.ts +94 -0
- package/src/chains/definitions/optimism.test.ts +50 -0
- package/src/chains/definitions/optimism.ts +139 -0
- package/src/chains/definitions/polygonPos.test.ts +50 -0
- package/src/chains/definitions/polygonPos.ts +121 -0
- package/src/chains/definitions/ronin.test.ts +50 -0
- package/src/chains/definitions/ronin.ts +75 -0
- package/src/chains/definitions/tests.ts +2884 -0
- package/src/chains/externals/defillama/constants.ts +1 -0
- package/src/chains/externals/defillama/getBlockOfTimestamp.test.ts +12 -0
- package/src/chains/externals/defillama/getBlockOfTimestamp.ts +26 -0
- package/src/chains/externals/defillama/index.ts +1 -0
- package/src/chains/externals/index.ts +1 -0
- package/src/chains/index.ts +62 -0
- package/src/chains/types/chain.ts +22 -0
- package/src/chains/types/index.ts +2 -0
- package/src/chains/types/rpc.ts +6 -0
- package/src/clients/definitions/defineClient.ts +7 -0
- package/src/clients/definitions/index.ts +1 -0
- package/src/clients/definitions/viemClient.ts +86 -0
- package/src/clients/externals/viem/estimateFeesPerGas.ts +23 -0
- package/src/clients/externals/viem/getBalance.ts +25 -0
- package/src/clients/externals/viem/getBlock.ts +29 -0
- package/src/clients/externals/viem/getBlockNumber.ts +23 -0
- package/src/clients/externals/viem/getEventLogs.test.ts +22 -0
- package/src/clients/externals/viem/getEventLogs.ts +40 -0
- package/src/clients/externals/viem/getTransaction.ts +25 -0
- package/src/clients/externals/viem/getTransactionCount.ts +25 -0
- package/src/clients/externals/viem/getTransactionReceipt.ts +25 -0
- package/src/clients/externals/viem/index.ts +10 -0
- package/src/clients/externals/viem/middleware.ts +437 -0
- package/src/clients/externals/viem/multicall.test.ts +26 -0
- package/src/clients/externals/viem/multicall.ts +27 -0
- package/src/clients/externals/viem/readContract.test.ts +20 -0
- package/src/clients/externals/viem/readContract.ts +38 -0
- package/src/clients/externals/viem/tests.ts +957 -0
- package/src/clients/index.ts +2 -0
- package/src/clients/types.ts +113 -0
- package/src/creates/createEvmAccount.ts +12 -0
- package/src/decoder/decode.test.ts +324 -0
- package/src/decoder/decode.ts +716 -0
- package/src/decoder/decoder.ts +6 -0
- package/src/decoder/index.ts +5 -0
- package/src/decoder/parseErc1155TransferSingleLogs.ts +40 -0
- package/src/decoder/parseErc20TransferLogs.ts +35 -0
- package/src/decoder/parseErc721TransferLogs.ts +40 -0
- package/src/decoder/tests.ts +502 -0
- package/src/decoder/types.ts +21 -0
- package/src/explorers/definitions/blockscout.test.ts +124 -0
- package/src/explorers/definitions/blockscout.ts +205 -0
- package/src/explorers/definitions/defineExplorer.ts +7 -0
- package/src/explorers/definitions/etherscan.test.ts +123 -0
- package/src/explorers/definitions/etherscan.ts +279 -0
- package/src/explorers/definitions/index.ts +4 -0
- package/src/explorers/definitions/roninExplorer.ts +150 -0
- package/src/explorers/definitions/routescan.ts +57 -0
- package/src/explorers/externals/blockscout/getBlockNumberOfTimestamp.ts +67 -0
- package/src/explorers/externals/blockscout/getContractByAddress.ts +81 -0
- package/src/explorers/externals/blockscout/getInternalTransactionsByAddress.ts +120 -0
- package/src/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.ts +87 -0
- package/src/explorers/externals/blockscout/getNormalTransactionsByAddress.ts +116 -0
- package/src/explorers/externals/blockscout/getTokenTransfersByAddress.ts +127 -0
- package/src/explorers/externals/blockscout/index.ts +6 -0
- package/src/explorers/externals/blockscout/middleware.ts +56 -0
- package/src/explorers/externals/defillama/getBlockNumberOfTimestamp.ts +28 -0
- package/src/explorers/externals/defillama/index.ts +1 -0
- package/src/explorers/externals/etherscan/getBlockNumberOfTimestamp.ts +66 -0
- package/src/explorers/externals/etherscan/getContractByAddress.ts +86 -0
- package/src/explorers/externals/etherscan/getErc1155TokenTransfersByAddress.ts +133 -0
- package/src/explorers/externals/etherscan/getErc20TokenTransfersByAddress.ts +125 -0
- package/src/explorers/externals/etherscan/getErc721TokenTransfersByAddress.ts +125 -0
- package/src/explorers/externals/etherscan/getInternalTransactionsByAddress.ts +117 -0
- package/src/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.ts +91 -0
- package/src/explorers/externals/etherscan/getNormalTransactionsByAddress.ts +122 -0
- package/src/explorers/externals/etherscan/index.ts +8 -0
- package/src/explorers/externals/etherscan/middleware.ts +77 -0
- package/src/explorers/externals/roninExplorer/getInternalTransactionByHash.ts +80 -0
- package/src/explorers/externals/roninExplorer/getNormalTransactionsByAddress.ts +79 -0
- package/src/explorers/externals/roninExplorer/getTokenTransfersByAddress.ts +81 -0
- package/src/explorers/externals/roninExplorer/index.ts +3 -0
- package/src/explorers/externals/roninExplorer/middleware.ts +49 -0
- package/src/explorers/index.ts +7 -0
- package/src/explorers/types.ts +56 -0
- package/src/getAccountsTransactionFulls/getAccountsTransactionFulls.test.ts +22 -0
- package/src/getAccountsTransactionFulls/getAccountsTransactionFulls.ts +46 -0
- package/src/getAccountsTransactionFulls/getAccountsTransactionFullsCustom.ts +106 -0
- package/src/getAccountsTransactionFulls/getDecodedTransactionsPrices.ts +97 -0
- package/src/getAccountsTransactionFulls/getHashesAndInternalTxs.ts +65 -0
- package/src/getAccountsTransactionFulls/getTransactionDetail.ts +49 -0
- package/src/getAccountsTransactionFulls/getTransactionDetails.ts +39 -0
- package/src/getAccountsTransactionFulls/getTransactionsApps.ts +42 -0
- package/src/getAccountsTransactionFulls/index.ts +2 -0
- package/src/getAccountsTransactionFulls/types.ts +122 -0
- package/src/getAccountsTransactionFulls/withD.ts +80 -0
- package/src/getAccountsTransactionFulls/withDA.ts +112 -0
- package/src/getAccountsTransactionFulls/withP.ts +120 -0
- package/src/getAccountsTransactionFulls/withPD.ts +141 -0
- package/src/getAccountsTransactionFulls/withPDA.ts +167 -0
- package/src/getAccountsTransactionFulls/withUndefined.ts +88 -0
- package/src/getContractAbi.ts +15 -0
- package/src/getTransactionFull/getTransactionDetail.ts +47 -0
- package/src/getTransactionFull/getTransactionFull.test.ts +34 -0
- package/src/getTransactionFull/getTransactionFull.ts +30 -0
- package/src/getTransactionFull/getTransactionFullCustom.ts +91 -0
- package/src/getTransactionFull/index.ts +2 -0
- package/src/getTransactionFull/types.ts +98 -0
- package/src/getTransactionFull/withD.ts +57 -0
- package/src/getTransactionFull/withDA.ts +78 -0
- package/src/getTransactionFull/withP.ts +69 -0
- package/src/getTransactionFull/withPD.ts +119 -0
- package/src/getTransactionFull/withPDA.ts +147 -0
- package/src/getTransactionFull/withUndefined.ts +39 -0
- package/src/index.cts +1 -0
- package/src/index.mts +110 -0
- package/src/tests.ts +1 -0
- package/src/types/erc1155.ts +17 -0
- package/src/types/erc20.ts +22 -0
- package/src/types/erc721.ts +19 -0
- package/src/types/evmAccount.ts +12 -0
- package/src/types/hex.test.ts +10 -0
- package/src/types/hex.ts +9 -0
- package/src/types/index.ts +16 -0
- package/src/types/input.ts +27 -0
- package/src/types/internalTransaction.ts +19 -0
- package/src/types/log.ts +68 -0
- package/src/types/transaction.ts +78 -0
- package/src/utils/bigint.ts +5 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/timeout.ts +5 -0
- package/src/utils/types.ts +12 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { ethereum } from '@0xtorch/core'
|
|
2
|
+
import { arbitrum } from 'viem/chains'
|
|
3
|
+
import type { Client } from '../../clients'
|
|
4
|
+
import { createViemClient } from '../../clients'
|
|
5
|
+
import type { Explorer } from '../../explorers'
|
|
6
|
+
import { createEtherscan } from '../../explorers'
|
|
7
|
+
import type { Chain, HttpRpc } from '../types'
|
|
8
|
+
import { defineChain } from './defineChain'
|
|
9
|
+
|
|
10
|
+
export const createArbitrumOneChain = (arbiscanApiKey: string): Chain =>
|
|
11
|
+
createArbitrumOneChainCustom({
|
|
12
|
+
client: createViemClient({
|
|
13
|
+
chain: arbitrum,
|
|
14
|
+
httpRpcs: arbitrumOneHttpRpcs,
|
|
15
|
+
}),
|
|
16
|
+
explorer: createEtherscan({
|
|
17
|
+
name: 'ArbiScan',
|
|
18
|
+
url: 'https://arbiscan.io',
|
|
19
|
+
apiUrl: 'https://api.arbiscan.io/api',
|
|
20
|
+
apiKey: arbiscanApiKey,
|
|
21
|
+
}),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
type CreateArbitrumOneChainParameters<
|
|
25
|
+
TClient extends Client,
|
|
26
|
+
TExplorer extends Explorer,
|
|
27
|
+
> = {
|
|
28
|
+
readonly client: TClient
|
|
29
|
+
readonly explorer: TExplorer
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const createArbitrumOneChainCustom = <
|
|
33
|
+
const TClient extends Client,
|
|
34
|
+
const TExplorer extends Explorer,
|
|
35
|
+
>({
|
|
36
|
+
client,
|
|
37
|
+
explorer,
|
|
38
|
+
}: CreateArbitrumOneChainParameters<TClient, TExplorer>) =>
|
|
39
|
+
defineChain({
|
|
40
|
+
id: 42_161,
|
|
41
|
+
network: 'arbitrum-one',
|
|
42
|
+
name: 'Arbitrum One',
|
|
43
|
+
nativeToken: {
|
|
44
|
+
name: 'Ethereum',
|
|
45
|
+
symbol: 'ETH',
|
|
46
|
+
decimals: 18,
|
|
47
|
+
currency: ethereum,
|
|
48
|
+
},
|
|
49
|
+
explorer,
|
|
50
|
+
client,
|
|
51
|
+
blockTime: 250,
|
|
52
|
+
coingeckoId: 'arbitrum-one',
|
|
53
|
+
defillamaId: 'arbitrum',
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
export const arbitrumOneHttpRpcs = [
|
|
57
|
+
{
|
|
58
|
+
url: 'https://arbitrum.llamarpc.com',
|
|
59
|
+
isArchive: true,
|
|
60
|
+
getLogsIsUsable: true,
|
|
61
|
+
getLogsMaxBlockRange: 80_000n,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
url: 'https://arb1.arbitrum.io/rpc',
|
|
65
|
+
isArchive: true,
|
|
66
|
+
getLogsIsUsable: true,
|
|
67
|
+
getLogsMaxBlockRange: 160_000n,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
url: 'https://rpc.ankr.com/arbitrum',
|
|
71
|
+
isArchive: true,
|
|
72
|
+
getLogsIsUsable: true,
|
|
73
|
+
getLogsMaxBlockRange: 3000n,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
url: 'https://1rpc.io/arb',
|
|
77
|
+
isArchive: true,
|
|
78
|
+
getLogsIsUsable: true,
|
|
79
|
+
getLogsMaxBlockRange: 10_000n,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
url: 'https://arb-pokt.nodies.app',
|
|
83
|
+
isArchive: true,
|
|
84
|
+
getLogsIsUsable: true,
|
|
85
|
+
getLogsMaxBlockRange: 80_000n,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
url: 'https://arbitrum.blockpi.network/v1/rpc/public',
|
|
89
|
+
isArchive: true,
|
|
90
|
+
getLogsIsUsable: true,
|
|
91
|
+
getLogsMaxBlockRange: 1024n,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
url: 'https://endpoints.omniatech.io/v1/arbitrum/one/public',
|
|
95
|
+
isArchive: true,
|
|
96
|
+
getLogsIsUsable: true,
|
|
97
|
+
getLogsMaxBlockRange: 3000n,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
url: 'https://arb-mainnet-public.unifra.io',
|
|
101
|
+
isArchive: true,
|
|
102
|
+
getLogsIsUsable: true,
|
|
103
|
+
getLogsMaxBlockRange: 10_000n,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
url: 'https://arbitrum.api.onfinality.io/public',
|
|
107
|
+
isArchive: true,
|
|
108
|
+
getLogsIsUsable: true,
|
|
109
|
+
getLogsMaxBlockRange: 2000n,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
url: 'https://rpc.arb1.arbitrum.gateway.fm',
|
|
113
|
+
isArchive: true,
|
|
114
|
+
getLogsIsUsable: true,
|
|
115
|
+
getLogsMaxBlockRange: 10_000n,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
url: 'https://arbitrum-one.publicnode.com',
|
|
119
|
+
isArchive: true,
|
|
120
|
+
getLogsIsUsable: true,
|
|
121
|
+
getLogsMaxBlockRange: 40_000n,
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
url: 'https://arbitrum.meowrpc.com',
|
|
125
|
+
isArchive: true,
|
|
126
|
+
getLogsIsUsable: true,
|
|
127
|
+
getLogsMaxBlockRange: 40_000n,
|
|
128
|
+
},
|
|
129
|
+
] as const satisfies readonly HttpRpc[]
|
|
130
|
+
|
|
131
|
+
export const arbitrumOneWebsocketRpcUrls = [
|
|
132
|
+
'wss://arbitrum-one.publicnode.com',
|
|
133
|
+
] as const
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { expect, it } from 'bun:test'
|
|
2
|
+
import { createPublicClient, http } from 'viem'
|
|
3
|
+
import { astar } from 'viem/chains'
|
|
4
|
+
import { astarHttpRpcs } from './astar'
|
|
5
|
+
import { relayEvent } from './tests'
|
|
6
|
+
|
|
7
|
+
it('Should all astarHttpRpcs be the rpc url of the archive node', async () => {
|
|
8
|
+
for (const rpc of astarHttpRpcs) {
|
|
9
|
+
const { url, isArchive, getLogsIsUsable, getLogsMaxBlockRange } = rpc
|
|
10
|
+
console.debug('Checking >', url)
|
|
11
|
+
const client = createPublicClient({
|
|
12
|
+
chain: astar,
|
|
13
|
+
transport: http(url),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
// get latest block number
|
|
17
|
+
const blockNumber = await client.getBlockNumber()
|
|
18
|
+
console.debug('Result getBlockNumber >', blockNumber)
|
|
19
|
+
expect(blockNumber).toBeGreaterThan(0n)
|
|
20
|
+
|
|
21
|
+
// archive
|
|
22
|
+
// - getTransactionReceipt
|
|
23
|
+
// - getBlock
|
|
24
|
+
if (isArchive) {
|
|
25
|
+
const hash =
|
|
26
|
+
'0xd28d2d02d86f11a1ed6d83c102cd0b4e6ec9dc58a028e00f8e9d57138cdbb4a8'
|
|
27
|
+
const blockNumber = 2_579_366n
|
|
28
|
+
const receipt = await client.getTransactionReceipt({ hash })
|
|
29
|
+
console.debug('Result getTransactionReceipt >', receipt.status)
|
|
30
|
+
const block = await client.getBlock({ blockNumber })
|
|
31
|
+
console.debug('Result getBlock >', block.timestamp)
|
|
32
|
+
expect(receipt.transactionHash).toEqual(hash)
|
|
33
|
+
expect(block.number).toEqual(blockNumber)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// getLogs
|
|
37
|
+
// getLogs
|
|
38
|
+
if (getLogsIsUsable) {
|
|
39
|
+
const toBlock = blockNumber - 5n
|
|
40
|
+
const fromBlock = toBlock - getLogsMaxBlockRange + 1n
|
|
41
|
+
const logs = await client.getLogs({
|
|
42
|
+
address: '0x841ce48F9446C8E281D3F1444cB859b4A6D0738C',
|
|
43
|
+
event: relayEvent,
|
|
44
|
+
fromBlock,
|
|
45
|
+
toBlock,
|
|
46
|
+
})
|
|
47
|
+
console.debug('Result getLogs >', logs.length)
|
|
48
|
+
expect(logs).toBeDefined()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}, 60_000)
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { astar } from '@0xtorch/core'
|
|
2
|
+
import { astar as viemAstar } from 'viem/chains'
|
|
3
|
+
import type { Client } from '../../clients'
|
|
4
|
+
import { createViemClient } from '../../clients'
|
|
5
|
+
import type { Explorer } from '../../explorers'
|
|
6
|
+
import { createBlockscout } from '../../explorers'
|
|
7
|
+
import type { Chain, HttpRpc } from '../types'
|
|
8
|
+
import { defineChain } from './defineChain'
|
|
9
|
+
|
|
10
|
+
type CreateAstarChainParameters<
|
|
11
|
+
TClient extends Client,
|
|
12
|
+
TExplorer extends Explorer,
|
|
13
|
+
> = {
|
|
14
|
+
readonly client: TClient
|
|
15
|
+
readonly explorer: TExplorer
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const createAstarChain = (): Chain =>
|
|
19
|
+
createAstarChainCustom({
|
|
20
|
+
client: createViemClient({
|
|
21
|
+
chain: viemAstar,
|
|
22
|
+
httpRpcs: astarHttpRpcs,
|
|
23
|
+
}),
|
|
24
|
+
explorer: createBlockscout({
|
|
25
|
+
name: 'Astar explorer',
|
|
26
|
+
url: 'https://astar.blockscout.com',
|
|
27
|
+
apiUrl: 'https://astar.blockscout.com/api',
|
|
28
|
+
}),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export const createAstarChainCustom = <
|
|
32
|
+
const TClient extends Client,
|
|
33
|
+
const TExplorer extends Explorer,
|
|
34
|
+
>({
|
|
35
|
+
client,
|
|
36
|
+
explorer,
|
|
37
|
+
}: CreateAstarChainParameters<TClient, TExplorer>) =>
|
|
38
|
+
defineChain({
|
|
39
|
+
id: 592,
|
|
40
|
+
network: 'astar-evm',
|
|
41
|
+
name: 'Astar (EVM)',
|
|
42
|
+
nativeToken: {
|
|
43
|
+
name: 'Astar',
|
|
44
|
+
symbol: 'ASTR',
|
|
45
|
+
decimals: 18,
|
|
46
|
+
currency: astar,
|
|
47
|
+
},
|
|
48
|
+
explorer,
|
|
49
|
+
client,
|
|
50
|
+
blockTime: 12_000,
|
|
51
|
+
coingeckoId: 'astar',
|
|
52
|
+
defillamaId: 'astar',
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
export const astarHttpRpcs = [
|
|
56
|
+
{
|
|
57
|
+
url: 'https://evm.astar.network/',
|
|
58
|
+
isArchive: true,
|
|
59
|
+
getLogsIsUsable: true,
|
|
60
|
+
getLogsMaxBlockRange: 20_000n,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
url: 'https://astar.public.blastapi.io',
|
|
64
|
+
isArchive: true,
|
|
65
|
+
getLogsIsUsable: false,
|
|
66
|
+
getLogsMaxBlockRange: 0n,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
url: 'https://astar.api.onfinality.io/public',
|
|
70
|
+
isArchive: true,
|
|
71
|
+
getLogsIsUsable: false,
|
|
72
|
+
getLogsMaxBlockRange: 0n,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
url: 'https://astar-rpc.dwellir.com',
|
|
76
|
+
isArchive: true,
|
|
77
|
+
getLogsIsUsable: true,
|
|
78
|
+
getLogsMaxBlockRange: 10_000n,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
url: 'https://1rpc.io/astr',
|
|
82
|
+
isArchive: false,
|
|
83
|
+
getLogsIsUsable: false,
|
|
84
|
+
getLogsMaxBlockRange: 0n,
|
|
85
|
+
},
|
|
86
|
+
] as const satisfies readonly HttpRpc[]
|
|
87
|
+
|
|
88
|
+
export const astarWebsocketRpcUrls = [
|
|
89
|
+
'wss://rpc.astar.network',
|
|
90
|
+
'wss://astar.public.blastapi.io',
|
|
91
|
+
'wss://astar.api.onfinality.io/public-ws',
|
|
92
|
+
'wss://astar-rpc.dwellir.com',
|
|
93
|
+
] as const
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { expect, it } from 'bun:test'
|
|
2
|
+
import { createPublicClient, http } from 'viem'
|
|
3
|
+
import { avalanche } from 'viem/chains'
|
|
4
|
+
import { avalancheCHttpRpcs } from './avalancheC'
|
|
5
|
+
import { sendMsgEvent as sendMessageEvent } from './tests'
|
|
6
|
+
|
|
7
|
+
it('Should all avalancheCHttpRpcs be the rpc url of the archive node', async () => {
|
|
8
|
+
for (const rpc of avalancheCHttpRpcs) {
|
|
9
|
+
const { url, isArchive, getLogsIsUsable, getLogsMaxBlockRange } = rpc
|
|
10
|
+
console.debug('Checking >', url)
|
|
11
|
+
const client = createPublicClient({
|
|
12
|
+
chain: avalanche,
|
|
13
|
+
transport: http(url),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
// get latest block number
|
|
17
|
+
const blockNumber = await client.getBlockNumber()
|
|
18
|
+
console.debug('Result getBlockNumber >', blockNumber)
|
|
19
|
+
expect(blockNumber).toBeGreaterThan(0n)
|
|
20
|
+
|
|
21
|
+
// archive
|
|
22
|
+
// - getTransactionReceipt
|
|
23
|
+
// - getBlock
|
|
24
|
+
if (isArchive) {
|
|
25
|
+
const hash =
|
|
26
|
+
'0x7a3751bb732d4e1676967237627c3f1cabaf4cede5b97865cfb7d2936f2954ee'
|
|
27
|
+
const blockNumber = 20_249_733n
|
|
28
|
+
const receipt = await client.getTransactionReceipt({ hash })
|
|
29
|
+
console.debug('Result getTransactionReceipt >', receipt.status)
|
|
30
|
+
const block = await client.getBlock({ blockNumber })
|
|
31
|
+
console.debug('Result getBlock >', block.timestamp)
|
|
32
|
+
expect(receipt.transactionHash).toEqual(hash)
|
|
33
|
+
expect(block.number).toEqual(blockNumber)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// getLogs
|
|
37
|
+
if (getLogsIsUsable) {
|
|
38
|
+
const toBlock = blockNumber - 5n
|
|
39
|
+
const fromBlock = toBlock - getLogsMaxBlockRange + 1n
|
|
40
|
+
const logs = await client.getLogs({
|
|
41
|
+
address: '0x9d1b1669c73b033dfe47ae5a0164ab96df25b944',
|
|
42
|
+
event: sendMessageEvent,
|
|
43
|
+
fromBlock,
|
|
44
|
+
toBlock,
|
|
45
|
+
})
|
|
46
|
+
console.debug('Result getLogs >', logs.length)
|
|
47
|
+
expect(logs).toBeDefined()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, 60_000)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { avalanche } from '@0xtorch/core'
|
|
2
|
+
import { avalanche as viemAvalanche } from 'viem/chains'
|
|
3
|
+
import type { Client } from '../../clients'
|
|
4
|
+
import { createViemClient } from '../../clients'
|
|
5
|
+
import type { Explorer } from '../../explorers'
|
|
6
|
+
import { createEtherscan } from '../../explorers'
|
|
7
|
+
import type { Chain, HttpRpc } from '../types'
|
|
8
|
+
import { defineChain } from './defineChain'
|
|
9
|
+
|
|
10
|
+
export const createAvalancheCChain = (snowscanApiKey: string): Chain =>
|
|
11
|
+
createAvalancheCChainCustom({
|
|
12
|
+
client: createViemClient({
|
|
13
|
+
chain: viemAvalanche,
|
|
14
|
+
httpRpcs: avalancheCHttpRpcs,
|
|
15
|
+
}),
|
|
16
|
+
explorer: createEtherscan({
|
|
17
|
+
name: 'Snowscan',
|
|
18
|
+
url: 'https://snowscan.xyz',
|
|
19
|
+
apiUrl: 'https://api.snowscan.xyz/api',
|
|
20
|
+
apiKey: snowscanApiKey,
|
|
21
|
+
}),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
type CreateAvalancheCChainParameters<
|
|
25
|
+
TClient extends Client,
|
|
26
|
+
TExplorer extends Explorer,
|
|
27
|
+
> = {
|
|
28
|
+
readonly client: TClient
|
|
29
|
+
readonly explorer: TExplorer
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const createAvalancheCChainCustom = <
|
|
33
|
+
const TClient extends Client,
|
|
34
|
+
const TExplorer extends Explorer,
|
|
35
|
+
>({
|
|
36
|
+
client,
|
|
37
|
+
explorer,
|
|
38
|
+
}: CreateAvalancheCChainParameters<TClient, TExplorer>) =>
|
|
39
|
+
defineChain({
|
|
40
|
+
id: 43_114,
|
|
41
|
+
network: 'avalanche-c',
|
|
42
|
+
name: 'Avalanche C-Chain',
|
|
43
|
+
nativeToken: {
|
|
44
|
+
name: 'Avalanche',
|
|
45
|
+
symbol: 'AVAX',
|
|
46
|
+
decimals: 18,
|
|
47
|
+
currency: avalanche,
|
|
48
|
+
},
|
|
49
|
+
explorer,
|
|
50
|
+
client,
|
|
51
|
+
blockTime: undefined,
|
|
52
|
+
coingeckoId: 'avalanche',
|
|
53
|
+
defillamaId: 'avax',
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
export const avalancheCHttpRpcs = [
|
|
57
|
+
{
|
|
58
|
+
url: 'https://api.avax.network/ext/bc/C/rpc',
|
|
59
|
+
isArchive: true,
|
|
60
|
+
getLogsIsUsable: true,
|
|
61
|
+
getLogsMaxBlockRange: 2048n,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
url: 'https://avalanche.public-rpc.com',
|
|
65
|
+
isArchive: true,
|
|
66
|
+
getLogsIsUsable: true,
|
|
67
|
+
getLogsMaxBlockRange: 2048n,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
url: 'https://rpc.ankr.com/avalanche',
|
|
71
|
+
isArchive: true,
|
|
72
|
+
getLogsIsUsable: true,
|
|
73
|
+
getLogsMaxBlockRange: 3000n,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
url: 'https://avalanche-c-chain.publicnode.com',
|
|
77
|
+
isArchive: true,
|
|
78
|
+
getLogsIsUsable: true,
|
|
79
|
+
getLogsMaxBlockRange: 20_000n,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
url: 'https://1rpc.io/avax/c',
|
|
83
|
+
isArchive: true,
|
|
84
|
+
getLogsIsUsable: true,
|
|
85
|
+
getLogsMaxBlockRange: 10_000n,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
url: 'https://avalanche.blockpi.network/v1/rpc/public',
|
|
89
|
+
isArchive: true,
|
|
90
|
+
getLogsIsUsable: true,
|
|
91
|
+
getLogsMaxBlockRange: 1024n,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
url: 'https://avalanche.api.onfinality.io/public/ext/bc/C/rpc',
|
|
95
|
+
isArchive: true,
|
|
96
|
+
getLogsIsUsable: true,
|
|
97
|
+
getLogsMaxBlockRange: 2000n,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
url: 'https://endpoints.omniatech.io/v1/avax/mainnet/public',
|
|
101
|
+
isArchive: true,
|
|
102
|
+
getLogsIsUsable: true,
|
|
103
|
+
getLogsMaxBlockRange: 3000n,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
url: 'https://avalanche.drpc.org',
|
|
107
|
+
isArchive: true,
|
|
108
|
+
getLogsIsUsable: true,
|
|
109
|
+
getLogsMaxBlockRange: 2048n,
|
|
110
|
+
},
|
|
111
|
+
] as const satisfies readonly HttpRpc[]
|
|
112
|
+
|
|
113
|
+
export const avalancheCWebsocketRpcUrls = [
|
|
114
|
+
'wss://avalanche-c-chain.publicnode.com',
|
|
115
|
+
] as const
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { expect, it } from 'bun:test'
|
|
2
|
+
import { createPublicClient, http } from 'viem'
|
|
3
|
+
import { base } from 'viem/chains'
|
|
4
|
+
import { baseHttpRpcs } from './base'
|
|
5
|
+
import { sendMsgEvent as sendMessageEvent } from './tests'
|
|
6
|
+
|
|
7
|
+
it('Should all baseHttpRpcs be the rpc url of the archive node', async () => {
|
|
8
|
+
for (const rpc of baseHttpRpcs) {
|
|
9
|
+
const { url, isArchive, getLogsIsUsable, getLogsMaxBlockRange } = rpc
|
|
10
|
+
console.debug('Checking >', url)
|
|
11
|
+
const client = createPublicClient({
|
|
12
|
+
chain: base,
|
|
13
|
+
transport: http(url),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
// get latest block number
|
|
17
|
+
const blockNumber = await client.getBlockNumber()
|
|
18
|
+
console.debug('Result getBlockNumber >', blockNumber)
|
|
19
|
+
expect(blockNumber).toBeGreaterThan(0n)
|
|
20
|
+
|
|
21
|
+
// archive
|
|
22
|
+
// - getTransactionReceipt
|
|
23
|
+
// - getBlock
|
|
24
|
+
if (isArchive) {
|
|
25
|
+
const hash =
|
|
26
|
+
'0x10876f15bf90940a49e89436b16b3e7ab23cd43b56a5559900b5d3b23abd5a8b'
|
|
27
|
+
const blockNumber = 2_121_130n
|
|
28
|
+
const receipt = await client.getTransactionReceipt({ hash })
|
|
29
|
+
console.debug('Result getTransactionReceipt >', receipt.status)
|
|
30
|
+
const block = await client.getBlock({ blockNumber })
|
|
31
|
+
console.debug('Result getBlock >', block.timestamp)
|
|
32
|
+
expect(receipt.transactionHash).toEqual(hash)
|
|
33
|
+
expect(block.number).toEqual(blockNumber)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// getLogs
|
|
37
|
+
if (getLogsIsUsable) {
|
|
38
|
+
const toBlock = blockNumber - 5n
|
|
39
|
+
const fromBlock = toBlock - getLogsMaxBlockRange + 1n
|
|
40
|
+
const logs = await client.getLogs({
|
|
41
|
+
address: '0xaf54be5b6eec24d6bfacf1cce4eaf680a8239398',
|
|
42
|
+
event: sendMessageEvent,
|
|
43
|
+
fromBlock,
|
|
44
|
+
toBlock,
|
|
45
|
+
})
|
|
46
|
+
console.debug('Result getLogs >', logs.length)
|
|
47
|
+
expect(logs).toBeDefined()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, 60_000)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ethereum } from '@0xtorch/core'
|
|
2
|
+
import { base } from 'viem/chains'
|
|
3
|
+
import type { Client } from '../../clients'
|
|
4
|
+
import { createViemClient } from '../../clients'
|
|
5
|
+
import type { Explorer } from '../../explorers'
|
|
6
|
+
import { createEtherscan } from '../../explorers'
|
|
7
|
+
import type { Chain, HttpRpc } from '../types'
|
|
8
|
+
import { defineChain } from './defineChain'
|
|
9
|
+
|
|
10
|
+
export const createBaseChain = (basescanApiKey: string): Chain =>
|
|
11
|
+
createBaseChainCustom({
|
|
12
|
+
client: createViemClient({
|
|
13
|
+
chain: base,
|
|
14
|
+
httpRpcs: baseHttpRpcs,
|
|
15
|
+
}),
|
|
16
|
+
explorer: createEtherscan({
|
|
17
|
+
name: 'BaseScan',
|
|
18
|
+
url: 'https://basescan.org',
|
|
19
|
+
apiUrl: 'https://api.basescan.org/api',
|
|
20
|
+
apiKey: basescanApiKey,
|
|
21
|
+
}),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
type CreateBaseChainParameters<
|
|
25
|
+
TClient extends Client,
|
|
26
|
+
TExplorer extends Explorer,
|
|
27
|
+
> = {
|
|
28
|
+
readonly client: TClient
|
|
29
|
+
readonly explorer: TExplorer
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const createBaseChainCustom = <
|
|
33
|
+
const TClient extends Client,
|
|
34
|
+
const TExplorer extends Explorer,
|
|
35
|
+
>({
|
|
36
|
+
client,
|
|
37
|
+
explorer,
|
|
38
|
+
}: CreateBaseChainParameters<TClient, TExplorer>) =>
|
|
39
|
+
defineChain({
|
|
40
|
+
id: 8453,
|
|
41
|
+
network: 'base',
|
|
42
|
+
name: 'Base',
|
|
43
|
+
nativeToken: {
|
|
44
|
+
name: 'Ethereum',
|
|
45
|
+
symbol: 'ETH',
|
|
46
|
+
decimals: 18,
|
|
47
|
+
currency: ethereum,
|
|
48
|
+
},
|
|
49
|
+
explorer,
|
|
50
|
+
client,
|
|
51
|
+
blockTime: 2000,
|
|
52
|
+
coingeckoId: 'base',
|
|
53
|
+
defillamaId: 'base',
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
export const baseHttpRpcs = [
|
|
57
|
+
{
|
|
58
|
+
url: 'https://mainnet.base.org',
|
|
59
|
+
isArchive: true,
|
|
60
|
+
getLogsIsUsable: true,
|
|
61
|
+
getLogsMaxBlockRange: 2000n,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
url: 'https://developer-access-mainnet.base.org',
|
|
65
|
+
isArchive: true,
|
|
66
|
+
getLogsIsUsable: true,
|
|
67
|
+
getLogsMaxBlockRange: 2000n,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
url: 'https://base.blockpi.network/v1/rpc/public',
|
|
71
|
+
isArchive: true,
|
|
72
|
+
getLogsIsUsable: true,
|
|
73
|
+
getLogsMaxBlockRange: 1024n,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
url: 'https://1rpc.io/base',
|
|
77
|
+
isArchive: true,
|
|
78
|
+
getLogsIsUsable: true,
|
|
79
|
+
getLogsMaxBlockRange: 10_000n,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
url: 'https://base-pokt.nodies.app',
|
|
83
|
+
isArchive: true,
|
|
84
|
+
getLogsIsUsable: true,
|
|
85
|
+
getLogsMaxBlockRange: 40_000n,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
url: 'https://base.gateway.tenderly.co',
|
|
89
|
+
isArchive: true,
|
|
90
|
+
getLogsIsUsable: true,
|
|
91
|
+
getLogsMaxBlockRange: 40_000n,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
url: 'https://gateway.tenderly.co/public/base',
|
|
95
|
+
isArchive: true,
|
|
96
|
+
getLogsIsUsable: true,
|
|
97
|
+
getLogsMaxBlockRange: 80_000n,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
url: 'https://rpc.notadegen.com/base',
|
|
101
|
+
isArchive: true,
|
|
102
|
+
getLogsIsUsable: true,
|
|
103
|
+
getLogsMaxBlockRange: 80_000n,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
url: 'https://base.drpc.org',
|
|
107
|
+
isArchive: true,
|
|
108
|
+
getLogsIsUsable: true,
|
|
109
|
+
getLogsMaxBlockRange: 2000n,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
url: 'https://endpoints.omniatech.io/v1/base/mainnet/public',
|
|
113
|
+
isArchive: true,
|
|
114
|
+
getLogsIsUsable: true,
|
|
115
|
+
getLogsMaxBlockRange: 10_000n,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
url: 'https://base.api.onfinality.io/public',
|
|
119
|
+
isArchive: true,
|
|
120
|
+
getLogsIsUsable: false,
|
|
121
|
+
getLogsMaxBlockRange: 0n,
|
|
122
|
+
},
|
|
123
|
+
] as const satisfies readonly HttpRpc[]
|
|
124
|
+
|
|
125
|
+
export const baseWebsocketRpcUrls = ['wss://base.publicnode.com'] as const
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { expect, it } from 'bun:test'
|
|
2
|
+
import { createPublicClient, http } from 'viem'
|
|
3
|
+
import { bsc } from 'viem/chains'
|
|
4
|
+
import { bscHttpRpcs } from './bsc'
|
|
5
|
+
import { sendMsgEvent as sendMessageEvent } from './tests'
|
|
6
|
+
|
|
7
|
+
it('Should all bscHttpRpcs be the rpc url of the archive node', async () => {
|
|
8
|
+
for (const rpc of bscHttpRpcs) {
|
|
9
|
+
const { url, isArchive, getLogsIsUsable, getLogsMaxBlockRange } = rpc
|
|
10
|
+
console.debug('Checking >', url)
|
|
11
|
+
const client = createPublicClient({
|
|
12
|
+
chain: bsc,
|
|
13
|
+
transport: http(url),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
// get latest block number
|
|
17
|
+
const blockNumber = await client.getBlockNumber()
|
|
18
|
+
console.debug('Result getBlockNumber >', blockNumber)
|
|
19
|
+
expect(blockNumber).toBeGreaterThan(0n)
|
|
20
|
+
|
|
21
|
+
// archive
|
|
22
|
+
// - getTransactionReceipt
|
|
23
|
+
// - getBlock
|
|
24
|
+
if (isArchive) {
|
|
25
|
+
const hash =
|
|
26
|
+
'0x9dfc1fc56d478a949f00133ea5304f757785c45ea1544b2e5d72529600016557'
|
|
27
|
+
const blockNumber = 15_168_926n
|
|
28
|
+
const receipt = await client.getTransactionReceipt({ hash })
|
|
29
|
+
console.debug('Result getTransactionReceipt >', receipt.status)
|
|
30
|
+
const block = await client.getBlock({ blockNumber })
|
|
31
|
+
console.debug('Result getBlock >', block.timestamp)
|
|
32
|
+
expect(receipt.transactionHash).toEqual(hash)
|
|
33
|
+
expect(block.number).toEqual(blockNumber)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// getLogs
|
|
37
|
+
if (getLogsIsUsable) {
|
|
38
|
+
const toBlock = blockNumber - 5n
|
|
39
|
+
const fromBlock = toBlock - getLogsMaxBlockRange + 1n
|
|
40
|
+
const logs = await client.getLogs({
|
|
41
|
+
address: '0x6694340fc020c5e6b96567843da2df01b2ce1eb6',
|
|
42
|
+
event: sendMessageEvent,
|
|
43
|
+
fromBlock,
|
|
44
|
+
toBlock,
|
|
45
|
+
})
|
|
46
|
+
console.debug('Result getLogs >', logs.length)
|
|
47
|
+
expect(logs).toBeDefined()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}, 60_000)
|