@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 @@
|
|
|
1
|
+
export const baseCoinsUrl = 'https://coins.llama.fi' as const
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test'
|
|
2
|
+
import { getBlockOfTimestamp } from './getBlockOfTimestamp'
|
|
3
|
+
|
|
4
|
+
describe('getBlockOfTimestamp', () => {
|
|
5
|
+
it('should return the block number', async () => {
|
|
6
|
+
const blockNumber = await getBlockOfTimestamp({
|
|
7
|
+
chain: 'ethereum',
|
|
8
|
+
timestamp: Math.floor(Date.now() / 1000),
|
|
9
|
+
})
|
|
10
|
+
expect(blockNumber).toBeGreaterThan(0n)
|
|
11
|
+
})
|
|
12
|
+
})
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import { rest } from '@0xtorch/core'
|
|
3
|
+
import { z } from 'zod'
|
|
4
|
+
import { baseCoinsUrl } from './constants'
|
|
5
|
+
|
|
6
|
+
type GetBlockOfTimestampParameters = {
|
|
7
|
+
readonly chain: string
|
|
8
|
+
/** UNIX timestamp */
|
|
9
|
+
readonly timestamp: number
|
|
10
|
+
readonly logger?: Logger
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getBlockOfTimestamp = async ({
|
|
14
|
+
chain,
|
|
15
|
+
timestamp,
|
|
16
|
+
logger,
|
|
17
|
+
}: GetBlockOfTimestampParameters): Promise<bigint> => {
|
|
18
|
+
const { height } = await rest(`${baseCoinsUrl}/block/${chain}/${timestamp}`, {
|
|
19
|
+
schema: z.object({
|
|
20
|
+
height: z.number().int().positive().transform(BigInt),
|
|
21
|
+
timestamp: z.number().int().positive(),
|
|
22
|
+
}),
|
|
23
|
+
logger,
|
|
24
|
+
})
|
|
25
|
+
return height
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getBlockOfTimestamp } from './getBlockOfTimestamp'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getBlockOfTimestamp as getBlockOfTimestampByDefillama } from './defillama'
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export {
|
|
2
|
+
arbitrumOneHttpRpcs,
|
|
3
|
+
arbitrumOneWebsocketRpcUrls,
|
|
4
|
+
astarHttpRpcs,
|
|
5
|
+
astarWebsocketRpcUrls,
|
|
6
|
+
avalancheCHttpRpcs,
|
|
7
|
+
avalancheCWebsocketRpcUrls,
|
|
8
|
+
baseHttpRpcs,
|
|
9
|
+
baseWebsocketRpcUrls,
|
|
10
|
+
bscHttpRpcs,
|
|
11
|
+
bscWebsocketRpcUrls,
|
|
12
|
+
createArbitrumOneChain,
|
|
13
|
+
createArbitrumOneChainCustom,
|
|
14
|
+
createAstarChain,
|
|
15
|
+
createAstarChainCustom,
|
|
16
|
+
createAvalancheCChain,
|
|
17
|
+
createAvalancheCChainCustom,
|
|
18
|
+
createBaseChain,
|
|
19
|
+
createBaseChainCustom,
|
|
20
|
+
createBscChain,
|
|
21
|
+
createBscChainCustom,
|
|
22
|
+
createEthereumChain,
|
|
23
|
+
createEthereumChainCustom,
|
|
24
|
+
createFantomChain,
|
|
25
|
+
createFantomChainCustom,
|
|
26
|
+
createLineaChain,
|
|
27
|
+
createLineaChainCustom,
|
|
28
|
+
createMantleChainCustom,
|
|
29
|
+
createMetisChainCustom,
|
|
30
|
+
createMoonbeamChain,
|
|
31
|
+
createMoonbeamChainCustom,
|
|
32
|
+
createMoonriverChain,
|
|
33
|
+
createMoonriverChainCustom,
|
|
34
|
+
createOptimismChain,
|
|
35
|
+
createOptimismChainCustom,
|
|
36
|
+
createPolygonPosChain,
|
|
37
|
+
createPolygonPosChainCustom,
|
|
38
|
+
createRoninChain,
|
|
39
|
+
createRoninChainCustom,
|
|
40
|
+
ethereumHttpRpcs,
|
|
41
|
+
ethereumWebsocketRpcUrls,
|
|
42
|
+
fantomHttpRpcs,
|
|
43
|
+
fantomWebsocketRpcUrls,
|
|
44
|
+
lineaHttpRpcs,
|
|
45
|
+
lineaWebsocketRpcUrls,
|
|
46
|
+
mantleHttpRpcs,
|
|
47
|
+
mantleWebsocketRpcUrls,
|
|
48
|
+
metisHttpRpcs,
|
|
49
|
+
metisWebsocketRpcUrls,
|
|
50
|
+
moonbeamHttpRpcs,
|
|
51
|
+
moonbeamWebsocketRpcUrls,
|
|
52
|
+
moonriverHttpRpcs,
|
|
53
|
+
moonriverWebsocketRpcUrls,
|
|
54
|
+
optimismHttpRpcs,
|
|
55
|
+
optimismWebsocketRpcUrls,
|
|
56
|
+
polygonPosHttpRpcs,
|
|
57
|
+
polygonPosWebsocketRpcUrls,
|
|
58
|
+
roninHttpRpcs,
|
|
59
|
+
roninWebsocketRpcUrls,
|
|
60
|
+
} from './definitions'
|
|
61
|
+
export { getBlockOfTimestampByDefillama } from './externals'
|
|
62
|
+
export type { Chain, HttpRpc } from './types'
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CryptoCurrency } from '@0xtorch/core'
|
|
2
|
+
import type { Client } from '../../clients'
|
|
3
|
+
import type { Explorer } from '../../explorers'
|
|
4
|
+
|
|
5
|
+
export type Chain = {
|
|
6
|
+
readonly id: number
|
|
7
|
+
readonly network: string
|
|
8
|
+
readonly name: string
|
|
9
|
+
readonly nativeToken: ChainNativeToken
|
|
10
|
+
readonly explorer: Explorer
|
|
11
|
+
readonly client: Client
|
|
12
|
+
readonly blockTime: number | undefined
|
|
13
|
+
readonly coingeckoId: string | undefined
|
|
14
|
+
readonly defillamaId: string | undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type ChainNativeToken = {
|
|
18
|
+
readonly name: string
|
|
19
|
+
readonly symbol: string
|
|
20
|
+
readonly decimals: number
|
|
21
|
+
readonly currency: CryptoCurrency
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createViemClient } from './viemClient'
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { AbiEvent } from 'abitype'
|
|
3
|
+
import type {
|
|
4
|
+
Abi,
|
|
5
|
+
ContractFunctionName,
|
|
6
|
+
GetLogsReturnType,
|
|
7
|
+
MulticallParameters,
|
|
8
|
+
MulticallReturnType,
|
|
9
|
+
ReadContractParameters,
|
|
10
|
+
ReadContractReturnType,
|
|
11
|
+
Chain as ViemChain,
|
|
12
|
+
} from 'viem'
|
|
13
|
+
import type { HttpRpc } from '../../chains'
|
|
14
|
+
import type { LowerHex } from '../../types'
|
|
15
|
+
import {
|
|
16
|
+
estimateFeesPerGas,
|
|
17
|
+
getBalance,
|
|
18
|
+
getBlock,
|
|
19
|
+
getBlockNumber,
|
|
20
|
+
getEventLogs,
|
|
21
|
+
getTransaction,
|
|
22
|
+
getTransactionCount,
|
|
23
|
+
getTransactionReceipt,
|
|
24
|
+
multicall,
|
|
25
|
+
readContract,
|
|
26
|
+
} from '../externals/viem'
|
|
27
|
+
import { defineClient } from './defineClient'
|
|
28
|
+
|
|
29
|
+
type CreateViemClientParameters<TChain extends ViemChain> = {
|
|
30
|
+
readonly chain: TChain
|
|
31
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const createViemClient = <TChain extends ViemChain>({
|
|
35
|
+
chain,
|
|
36
|
+
httpRpcs,
|
|
37
|
+
}: CreateViemClientParameters<TChain>) =>
|
|
38
|
+
defineClient({
|
|
39
|
+
httpRpcCount: httpRpcs.length,
|
|
40
|
+
estimateFeesPerGas: async (config) =>
|
|
41
|
+
estimateFeesPerGas({ chain, httpRpcs }, config),
|
|
42
|
+
getBalance: async (address, config) =>
|
|
43
|
+
getBalance({ chain, httpRpcs, address }, config),
|
|
44
|
+
getBlock: async (blockNumber, config) =>
|
|
45
|
+
getBlock({ chain, httpRpcs, blockNumber }, config),
|
|
46
|
+
getBlockNumber: async (config) =>
|
|
47
|
+
getBlockNumber({ chain, httpRpcs }, config),
|
|
48
|
+
getEventLogs: async <const TAbiEvent extends AbiEvent>(
|
|
49
|
+
parameters: {
|
|
50
|
+
readonly contractAddress: LowerHex
|
|
51
|
+
readonly event: TAbiEvent
|
|
52
|
+
readonly fromBlock: bigint
|
|
53
|
+
readonly toBlock: bigint
|
|
54
|
+
},
|
|
55
|
+
config?: {
|
|
56
|
+
readonly timeout?: number
|
|
57
|
+
readonly logger?: Logger
|
|
58
|
+
},
|
|
59
|
+
): Promise<GetLogsReturnType<TAbiEvent>> =>
|
|
60
|
+
getEventLogs({ ...parameters, chain, httpRpcs }, config),
|
|
61
|
+
getTransaction: (hash, config) =>
|
|
62
|
+
getTransaction({ chain, httpRpcs, hash }, config),
|
|
63
|
+
getTransactionCount: async (address, config) =>
|
|
64
|
+
getTransactionCount({ chain, httpRpcs, address }, config),
|
|
65
|
+
getTransactionReceipt: async (hash, config) =>
|
|
66
|
+
getTransactionReceipt({ chain, httpRpcs, hash }, config),
|
|
67
|
+
multicall: async <const TContracts extends readonly unknown[]>(
|
|
68
|
+
parameters: MulticallParameters<TContracts>,
|
|
69
|
+
config?: {
|
|
70
|
+
readonly timeout?: number
|
|
71
|
+
readonly logger?: Logger
|
|
72
|
+
},
|
|
73
|
+
): Promise<MulticallReturnType<TContracts>> =>
|
|
74
|
+
multicall({ chain, httpRpcs, parameters }, config),
|
|
75
|
+
readContract: async <
|
|
76
|
+
const TAbi extends Abi | readonly unknown[],
|
|
77
|
+
const TFunctionName extends ContractFunctionName<TAbi, 'pure' | 'view'>,
|
|
78
|
+
>(
|
|
79
|
+
parameters: ReadContractParameters<TAbi, TFunctionName>,
|
|
80
|
+
config?: {
|
|
81
|
+
readonly timeout?: number
|
|
82
|
+
readonly logger?: Logger
|
|
83
|
+
},
|
|
84
|
+
): Promise<ReadContractReturnType<TAbi, TFunctionName>> =>
|
|
85
|
+
readContract({ chain, httpRpcs, parameters }, config),
|
|
86
|
+
})
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { FeeValues, Chain as ViemChain } from 'viem'
|
|
3
|
+
import type { HttpRpc } from '../../../chains'
|
|
4
|
+
import { createViemClient } from './middleware'
|
|
5
|
+
|
|
6
|
+
type EstimateFeesPerGasParameters = {
|
|
7
|
+
readonly chain: ViemChain
|
|
8
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const estimateFeesPerGas = async (
|
|
12
|
+
{ chain, httpRpcs }: EstimateFeesPerGasParameters,
|
|
13
|
+
config?: {
|
|
14
|
+
readonly timeout?: number
|
|
15
|
+
readonly logger?: Logger
|
|
16
|
+
},
|
|
17
|
+
): Promise<FeeValues> =>
|
|
18
|
+
createViemClient(chain, httpRpcs).wrapper(
|
|
19
|
+
async (client) => await client.estimateFeesPerGas(),
|
|
20
|
+
undefined,
|
|
21
|
+
config?.timeout,
|
|
22
|
+
config?.logger,
|
|
23
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { Chain as ViemChain } from 'viem'
|
|
3
|
+
import type { HttpRpc } from '../../../chains'
|
|
4
|
+
import type { LowerHex } from '../../../types'
|
|
5
|
+
import { createViemClient } from './middleware'
|
|
6
|
+
|
|
7
|
+
type GetBalanceParameters = {
|
|
8
|
+
readonly chain: ViemChain
|
|
9
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
10
|
+
readonly address: LowerHex
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getBalance = async (
|
|
14
|
+
{ chain, httpRpcs, address }: GetBalanceParameters,
|
|
15
|
+
config?: {
|
|
16
|
+
readonly timeout?: number
|
|
17
|
+
readonly logger?: Logger
|
|
18
|
+
},
|
|
19
|
+
): Promise<bigint> =>
|
|
20
|
+
createViemClient(chain, httpRpcs).wrapper<bigint>(
|
|
21
|
+
async (client) => await client.getBalance({ address }),
|
|
22
|
+
undefined,
|
|
23
|
+
config?.timeout,
|
|
24
|
+
config?.logger,
|
|
25
|
+
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { Block, Chain as ViemChain } from 'viem'
|
|
3
|
+
import type { HttpRpc } from '../../../chains'
|
|
4
|
+
import { createViemClient } from './middleware'
|
|
5
|
+
|
|
6
|
+
type GetBlockParameters = {
|
|
7
|
+
readonly chain: ViemChain
|
|
8
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
9
|
+
readonly blockNumber: bigint
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const getBlock = async (
|
|
13
|
+
{ chain, httpRpcs, blockNumber }: GetBlockParameters,
|
|
14
|
+
config?: {
|
|
15
|
+
readonly timeout?: number
|
|
16
|
+
readonly logger?: Logger
|
|
17
|
+
},
|
|
18
|
+
): Promise<Block<bigint, false, 'latest'>> =>
|
|
19
|
+
createViemClient(chain, httpRpcs).wrapper(
|
|
20
|
+
async (client) =>
|
|
21
|
+
(await client.getBlock({ blockNumber })) as Block<
|
|
22
|
+
bigint,
|
|
23
|
+
false,
|
|
24
|
+
'latest'
|
|
25
|
+
>,
|
|
26
|
+
{ onlyArchive: true },
|
|
27
|
+
config?.timeout,
|
|
28
|
+
config?.logger,
|
|
29
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { Chain as ViemChain } from 'viem'
|
|
3
|
+
import type { HttpRpc } from '../../../chains'
|
|
4
|
+
import { createViemClient } from './middleware'
|
|
5
|
+
|
|
6
|
+
type GetBlockNumberParameters = {
|
|
7
|
+
readonly chain: ViemChain
|
|
8
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getBlockNumber = async (
|
|
12
|
+
{ chain, httpRpcs }: GetBlockNumberParameters,
|
|
13
|
+
config?: {
|
|
14
|
+
readonly timeout?: number
|
|
15
|
+
readonly logger?: Logger
|
|
16
|
+
},
|
|
17
|
+
): Promise<bigint> =>
|
|
18
|
+
createViemClient(chain, httpRpcs).wrapper<bigint>(
|
|
19
|
+
async (client) => await client.getBlockNumber(),
|
|
20
|
+
undefined,
|
|
21
|
+
config?.timeout,
|
|
22
|
+
config?.logger,
|
|
23
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test'
|
|
2
|
+
import { polygon } from 'viem/chains'
|
|
3
|
+
import { polygonPosHttpRpcs } from '../../../chains'
|
|
4
|
+
import { getEventLogs } from './getEventLogs'
|
|
5
|
+
import { relayEvent } from './tests'
|
|
6
|
+
|
|
7
|
+
describe('getEventLogs', () => {
|
|
8
|
+
it('test', async () => {
|
|
9
|
+
const toBlock = 50_000_000n
|
|
10
|
+
const fromBlock = toBlock - 5000n + 1n
|
|
11
|
+
const logs = await getEventLogs({
|
|
12
|
+
chain: polygon,
|
|
13
|
+
httpRpcs: polygonPosHttpRpcs,
|
|
14
|
+
contractAddress: '0x88dcdc47d2f83a99cf0000fdf667a468bb958a78',
|
|
15
|
+
event: relayEvent,
|
|
16
|
+
fromBlock,
|
|
17
|
+
toBlock,
|
|
18
|
+
})
|
|
19
|
+
console.debug(logs)
|
|
20
|
+
expect(logs).toBeDefined()
|
|
21
|
+
})
|
|
22
|
+
})
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { AbiEvent } from 'abitype'
|
|
3
|
+
import type { GetLogsReturnType, Chain as ViemChain } from 'viem'
|
|
4
|
+
import type { HttpRpc } from '../../../chains'
|
|
5
|
+
import type { LowerHex } from '../../../types'
|
|
6
|
+
import { createViemClient } from './middleware'
|
|
7
|
+
|
|
8
|
+
type GetEventLogsParameters<TAbiEvent extends AbiEvent> = {
|
|
9
|
+
readonly chain: ViemChain
|
|
10
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
11
|
+
readonly contractAddress: LowerHex
|
|
12
|
+
readonly event: TAbiEvent
|
|
13
|
+
readonly fromBlock: bigint
|
|
14
|
+
readonly toBlock: bigint
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const getEventLogs = async <const TAbiEvent extends AbiEvent>(
|
|
18
|
+
{
|
|
19
|
+
chain,
|
|
20
|
+
httpRpcs,
|
|
21
|
+
contractAddress,
|
|
22
|
+
event,
|
|
23
|
+
fromBlock,
|
|
24
|
+
toBlock,
|
|
25
|
+
}: GetEventLogsParameters<TAbiEvent>,
|
|
26
|
+
config?: {
|
|
27
|
+
readonly timeout?: number
|
|
28
|
+
readonly logger?: Logger
|
|
29
|
+
},
|
|
30
|
+
): Promise<GetLogsReturnType<TAbiEvent>> =>
|
|
31
|
+
createViemClient(chain, httpRpcs).getLogs(
|
|
32
|
+
{
|
|
33
|
+
address: contractAddress,
|
|
34
|
+
event,
|
|
35
|
+
fromBlock,
|
|
36
|
+
toBlock,
|
|
37
|
+
},
|
|
38
|
+
config?.timeout,
|
|
39
|
+
config?.logger,
|
|
40
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { Transaction, Chain as ViemChain } from 'viem'
|
|
3
|
+
import type { HttpRpc } from '../../../chains'
|
|
4
|
+
import type { Hex } from '../../../types'
|
|
5
|
+
import { createViemClient } from './middleware'
|
|
6
|
+
|
|
7
|
+
type GetTransactionParameters = {
|
|
8
|
+
readonly chain: ViemChain
|
|
9
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
10
|
+
readonly hash: Hex
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getTransaction = async (
|
|
14
|
+
{ chain, httpRpcs, hash }: GetTransactionParameters,
|
|
15
|
+
config?: {
|
|
16
|
+
readonly timeout?: number
|
|
17
|
+
readonly logger?: Logger
|
|
18
|
+
},
|
|
19
|
+
): Promise<Transaction> =>
|
|
20
|
+
createViemClient(chain, httpRpcs).wrapper(
|
|
21
|
+
async (client) => (await client.getTransaction({ hash })) as Transaction,
|
|
22
|
+
{ onlyArchive: true },
|
|
23
|
+
config?.timeout,
|
|
24
|
+
config?.logger,
|
|
25
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { Chain as ViemChain } from 'viem'
|
|
3
|
+
import type { HttpRpc } from '../../../chains'
|
|
4
|
+
import type { Hex } from '../../../types'
|
|
5
|
+
import { createViemClient } from './middleware'
|
|
6
|
+
|
|
7
|
+
type GetTransactionCountParameters = {
|
|
8
|
+
readonly chain: ViemChain
|
|
9
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
10
|
+
readonly address: Hex
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getTransactionCount = async (
|
|
14
|
+
{ chain, httpRpcs, address }: GetTransactionCountParameters,
|
|
15
|
+
config?: {
|
|
16
|
+
readonly timeout?: number
|
|
17
|
+
readonly logger?: Logger
|
|
18
|
+
},
|
|
19
|
+
): Promise<number> =>
|
|
20
|
+
createViemClient(chain, httpRpcs).wrapper(
|
|
21
|
+
async (client) => await client.getTransactionCount({ address }),
|
|
22
|
+
undefined,
|
|
23
|
+
config?.timeout,
|
|
24
|
+
config?.logger,
|
|
25
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Logger } from '@0xtorch/core'
|
|
2
|
+
import type { TransactionReceipt, Chain as ViemChain } from 'viem'
|
|
3
|
+
import type { HttpRpc } from '../../../chains'
|
|
4
|
+
import type { Hex } from '../../../types'
|
|
5
|
+
import { createViemClient } from './middleware'
|
|
6
|
+
|
|
7
|
+
type GetTransactionReceiptParameters = {
|
|
8
|
+
readonly chain: ViemChain
|
|
9
|
+
readonly httpRpcs: readonly HttpRpc[]
|
|
10
|
+
readonly hash: Hex
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const getTransactionReceipt = async (
|
|
14
|
+
{ chain, httpRpcs, hash }: GetTransactionReceiptParameters,
|
|
15
|
+
config?: {
|
|
16
|
+
readonly timeout?: number
|
|
17
|
+
readonly logger?: Logger
|
|
18
|
+
},
|
|
19
|
+
): Promise<TransactionReceipt> =>
|
|
20
|
+
createViemClient(chain, httpRpcs).wrapper<TransactionReceipt>(
|
|
21
|
+
async (client) => await client.getTransactionReceipt({ hash }),
|
|
22
|
+
{ onlyArchive: true },
|
|
23
|
+
config?.timeout,
|
|
24
|
+
config?.logger,
|
|
25
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { estimateFeesPerGas } from './estimateFeesPerGas'
|
|
2
|
+
export { getBalance } from './getBalance'
|
|
3
|
+
export { getBlock } from './getBlock'
|
|
4
|
+
export { getBlockNumber } from './getBlockNumber'
|
|
5
|
+
export { getEventLogs } from './getEventLogs'
|
|
6
|
+
export { getTransaction } from './getTransaction'
|
|
7
|
+
export { getTransactionCount } from './getTransactionCount'
|
|
8
|
+
export { getTransactionReceipt } from './getTransactionReceipt'
|
|
9
|
+
export { multicall } from './multicall'
|
|
10
|
+
export { readContract } from './readContract'
|