@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,112 @@
|
|
|
1
|
+
/* eslint-disable unicorn/filename-case */
|
|
2
|
+
import type { Config } from '@0xtorch/core'
|
|
3
|
+
import { toLowerHex } from '../types'
|
|
4
|
+
import { getHashesAndInternalTxs } from './getHashesAndInternalTxs'
|
|
5
|
+
import { getTransactionDetails } from './getTransactionDetails'
|
|
6
|
+
import { getTransactionsApps } from './getTransactionsApps'
|
|
7
|
+
import type {
|
|
8
|
+
GetAccountsTransactionFullsCustomParametersDA,
|
|
9
|
+
GetAccountsTransactionFullsCustomReturnType,
|
|
10
|
+
} from './types'
|
|
11
|
+
|
|
12
|
+
export const getAccountsTransactionFullsCustomWithDA = async (
|
|
13
|
+
{
|
|
14
|
+
chain,
|
|
15
|
+
addresses,
|
|
16
|
+
fromBlock,
|
|
17
|
+
toBlock,
|
|
18
|
+
appDataSource,
|
|
19
|
+
decoder,
|
|
20
|
+
analyzer,
|
|
21
|
+
onFetchHashes,
|
|
22
|
+
onFetchTransaction,
|
|
23
|
+
}: GetAccountsTransactionFullsCustomParametersDA,
|
|
24
|
+
config?: Config,
|
|
25
|
+
): Promise<
|
|
26
|
+
GetAccountsTransactionFullsCustomReturnType<GetAccountsTransactionFullsCustomParametersDA>
|
|
27
|
+
> => {
|
|
28
|
+
const timeoutTimestamp =
|
|
29
|
+
Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout)
|
|
30
|
+
|
|
31
|
+
// get transaction hash & internal transaction by explorer
|
|
32
|
+
const { hashes, internalTransactions } = await getHashesAndInternalTxs(
|
|
33
|
+
chain,
|
|
34
|
+
addresses,
|
|
35
|
+
fromBlock,
|
|
36
|
+
toBlock,
|
|
37
|
+
config,
|
|
38
|
+
)
|
|
39
|
+
if (hashes.length === 0) {
|
|
40
|
+
return []
|
|
41
|
+
}
|
|
42
|
+
if (onFetchHashes !== undefined) {
|
|
43
|
+
onFetchHashes(hashes.map((hash) => toLowerHex(hash)))
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// get transaction detail of hashes
|
|
47
|
+
const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now()
|
|
48
|
+
const transactionDetails = await getTransactionDetails(
|
|
49
|
+
chain,
|
|
50
|
+
hashes,
|
|
51
|
+
internalTransactions,
|
|
52
|
+
onFetchTransaction,
|
|
53
|
+
{
|
|
54
|
+
timeout: timeoutForGetTransactionDetail,
|
|
55
|
+
logger: config?.logger,
|
|
56
|
+
},
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
// decode
|
|
60
|
+
const { transactions: transactionsDecoded } = await decoder.decode(
|
|
61
|
+
{
|
|
62
|
+
chain,
|
|
63
|
+
transactions: transactionDetails,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
timeout: timeoutTimestamp - Date.now(),
|
|
67
|
+
logger: config?.logger,
|
|
68
|
+
},
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
// get apps
|
|
72
|
+
const apps = await getTransactionsApps(appDataSource, transactionDetails, {
|
|
73
|
+
timeout: timeoutTimestamp - Date.now(),
|
|
74
|
+
logger: config?.logger,
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
const transactionsForAnalyzer = transactionsDecoded.map((transaction) => {
|
|
78
|
+
const lowerTo =
|
|
79
|
+
transaction.to === null ? undefined : toLowerHex(transaction.to)
|
|
80
|
+
const app = apps.find(({ address }) => address === lowerTo)?.app
|
|
81
|
+
return {
|
|
82
|
+
...transaction,
|
|
83
|
+
app,
|
|
84
|
+
nativeTokenPrice: undefined,
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
// analyze
|
|
89
|
+
const timeoutForAnalyze = timeoutTimestamp - Date.now()
|
|
90
|
+
const analyzedDatas = await Promise.all(
|
|
91
|
+
transactionsForAnalyzer.map((transactionForAnalyzer) =>
|
|
92
|
+
analyzer.analyze(
|
|
93
|
+
{
|
|
94
|
+
chain,
|
|
95
|
+
transaction: transactionForAnalyzer,
|
|
96
|
+
accountAddresses: addresses,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
timeout: timeoutForAnalyze,
|
|
100
|
+
logger: config?.logger,
|
|
101
|
+
},
|
|
102
|
+
),
|
|
103
|
+
),
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
return transactionsForAnalyzer.map((transactionForAnalyzer, index) => ({
|
|
107
|
+
...transactionForAnalyzer,
|
|
108
|
+
accountAddresses: addresses,
|
|
109
|
+
actions: analyzedDatas[index].actions,
|
|
110
|
+
accountActions: analyzedDatas[index].accountActions,
|
|
111
|
+
}))
|
|
112
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { Config, CryptoCurrencyPrice } from '@0xtorch/core'
|
|
2
|
+
import { toLowerHex } from '../types'
|
|
3
|
+
import { getHashesAndInternalTxs } from './getHashesAndInternalTxs'
|
|
4
|
+
import { getTransactionDetails } from './getTransactionDetails'
|
|
5
|
+
import { getTransactionsApps } from './getTransactionsApps'
|
|
6
|
+
import type {
|
|
7
|
+
GetAccountsTransactionFullsCustomParametersP,
|
|
8
|
+
GetAccountsTransactionFullsCustomReturnType,
|
|
9
|
+
} from './types'
|
|
10
|
+
|
|
11
|
+
export const getAccountsTransactionFullsCustomWithP = async (
|
|
12
|
+
{
|
|
13
|
+
chain,
|
|
14
|
+
addresses,
|
|
15
|
+
fromBlock,
|
|
16
|
+
toBlock,
|
|
17
|
+
appDataSource,
|
|
18
|
+
priceDataSource,
|
|
19
|
+
fiat,
|
|
20
|
+
onFetchHashes,
|
|
21
|
+
onFetchTransaction,
|
|
22
|
+
}: GetAccountsTransactionFullsCustomParametersP,
|
|
23
|
+
config?: Config,
|
|
24
|
+
): Promise<
|
|
25
|
+
GetAccountsTransactionFullsCustomReturnType<GetAccountsTransactionFullsCustomParametersP>
|
|
26
|
+
> => {
|
|
27
|
+
const timeoutTimestamp =
|
|
28
|
+
Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout)
|
|
29
|
+
|
|
30
|
+
// get transaction hash & internal transaction by explorer
|
|
31
|
+
const { hashes, internalTransactions } = await getHashesAndInternalTxs(
|
|
32
|
+
chain,
|
|
33
|
+
addresses,
|
|
34
|
+
fromBlock,
|
|
35
|
+
toBlock,
|
|
36
|
+
config,
|
|
37
|
+
)
|
|
38
|
+
if (hashes.length === 0) {
|
|
39
|
+
return []
|
|
40
|
+
}
|
|
41
|
+
if (onFetchHashes !== undefined) {
|
|
42
|
+
onFetchHashes(hashes.map((hash) => toLowerHex(hash)))
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// get transaction detail of hashes
|
|
46
|
+
const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now()
|
|
47
|
+
const transactionDetails = await getTransactionDetails(
|
|
48
|
+
chain,
|
|
49
|
+
hashes,
|
|
50
|
+
internalTransactions,
|
|
51
|
+
onFetchTransaction,
|
|
52
|
+
{
|
|
53
|
+
timeout: timeoutForGetTransactionDetail,
|
|
54
|
+
logger: config?.logger,
|
|
55
|
+
},
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
// native token price timestamp range
|
|
59
|
+
const minTimestamp = transactionDetails.reduce(
|
|
60
|
+
(minTimestamp, { block }) =>
|
|
61
|
+
Math.min(minTimestamp, Number(block.timestamp)),
|
|
62
|
+
Number.MAX_SAFE_INTEGER,
|
|
63
|
+
)
|
|
64
|
+
const maxTimestamp = transactionDetails.reduce(
|
|
65
|
+
(maxTimestamp, { block }) =>
|
|
66
|
+
Math.max(maxTimestamp, Number(block.timestamp)),
|
|
67
|
+
0,
|
|
68
|
+
)
|
|
69
|
+
const from = minTimestamp * 1000 - 1000 * 60 * 60
|
|
70
|
+
const to = maxTimestamp * 1000 + 1000 * 60 * 60
|
|
71
|
+
|
|
72
|
+
const timeoutForDataSource = timeoutTimestamp - Date.now()
|
|
73
|
+
const [apps, prices] = await Promise.all([
|
|
74
|
+
// get apps
|
|
75
|
+
getTransactionsApps(appDataSource, transactionDetails, {
|
|
76
|
+
timeout: timeoutForDataSource,
|
|
77
|
+
logger: config?.logger,
|
|
78
|
+
}),
|
|
79
|
+
// get native token prices
|
|
80
|
+
priceDataSource.getHistoricalPrices(
|
|
81
|
+
{
|
|
82
|
+
targetCurrencies: [chain.nativeToken.currency],
|
|
83
|
+
vsCurrency: fiat,
|
|
84
|
+
from,
|
|
85
|
+
to,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
timeout: timeoutForDataSource,
|
|
89
|
+
logger: config?.logger,
|
|
90
|
+
},
|
|
91
|
+
),
|
|
92
|
+
])
|
|
93
|
+
|
|
94
|
+
return transactionDetails.map((transactionDetail) => {
|
|
95
|
+
const lowerTo =
|
|
96
|
+
transactionDetail.to === null
|
|
97
|
+
? undefined
|
|
98
|
+
: toLowerHex(transactionDetail.to)
|
|
99
|
+
const app = apps.find(({ address }) => address === lowerTo)?.app
|
|
100
|
+
const price = prices.reduce(
|
|
101
|
+
(closestPrice: CryptoCurrencyPrice | undefined, price) =>
|
|
102
|
+
closestPrice === undefined ||
|
|
103
|
+
Math.abs(
|
|
104
|
+
price.timestamp - Number(transactionDetail.block.timestamp) * 1000,
|
|
105
|
+
) <
|
|
106
|
+
Math.abs(
|
|
107
|
+
closestPrice.timestamp -
|
|
108
|
+
Number(transactionDetail.block.timestamp) * 1000,
|
|
109
|
+
)
|
|
110
|
+
? price
|
|
111
|
+
: closestPrice,
|
|
112
|
+
undefined,
|
|
113
|
+
)
|
|
114
|
+
return {
|
|
115
|
+
...transactionDetail,
|
|
116
|
+
app,
|
|
117
|
+
nativeTokenPrice: price,
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/* eslint-disable unicorn/filename-case */
|
|
2
|
+
import type { Config, CryptoCurrencyPrice } from '@0xtorch/core'
|
|
3
|
+
import { toLowerHex } from '../types'
|
|
4
|
+
import { getDecodedTransactionsPrices } from './getDecodedTransactionsPrices'
|
|
5
|
+
import { getHashesAndInternalTxs } from './getHashesAndInternalTxs'
|
|
6
|
+
import { getTransactionDetails } from './getTransactionDetails'
|
|
7
|
+
import { getTransactionsApps } from './getTransactionsApps'
|
|
8
|
+
import type {
|
|
9
|
+
GetAccountsTransactionFullsCustomParametersPD,
|
|
10
|
+
GetAccountsTransactionFullsCustomReturnType,
|
|
11
|
+
} from './types'
|
|
12
|
+
|
|
13
|
+
export const getAccountsTransactionFullsCustomWithPD = async (
|
|
14
|
+
{
|
|
15
|
+
chain,
|
|
16
|
+
addresses,
|
|
17
|
+
fromBlock,
|
|
18
|
+
toBlock,
|
|
19
|
+
appDataSource,
|
|
20
|
+
priceDataSource,
|
|
21
|
+
fiat,
|
|
22
|
+
decoder,
|
|
23
|
+
onFetchHashes,
|
|
24
|
+
onFetchTransaction,
|
|
25
|
+
}: GetAccountsTransactionFullsCustomParametersPD,
|
|
26
|
+
config?: Config,
|
|
27
|
+
): Promise<
|
|
28
|
+
GetAccountsTransactionFullsCustomReturnType<GetAccountsTransactionFullsCustomParametersPD>
|
|
29
|
+
> => {
|
|
30
|
+
const timeoutTimestamp =
|
|
31
|
+
Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout)
|
|
32
|
+
|
|
33
|
+
// get transaction hash & internal transaction by explorer
|
|
34
|
+
const { hashes, internalTransactions } = await getHashesAndInternalTxs(
|
|
35
|
+
chain,
|
|
36
|
+
addresses,
|
|
37
|
+
fromBlock,
|
|
38
|
+
toBlock,
|
|
39
|
+
config,
|
|
40
|
+
)
|
|
41
|
+
if (hashes.length === 0) {
|
|
42
|
+
return []
|
|
43
|
+
}
|
|
44
|
+
if (onFetchHashes !== undefined) {
|
|
45
|
+
onFetchHashes(hashes.map((hash) => toLowerHex(hash)))
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// get transaction detail of hashes
|
|
49
|
+
const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now()
|
|
50
|
+
const transactionDetails = await getTransactionDetails(
|
|
51
|
+
chain,
|
|
52
|
+
hashes,
|
|
53
|
+
internalTransactions,
|
|
54
|
+
onFetchTransaction,
|
|
55
|
+
{
|
|
56
|
+
timeout: timeoutForGetTransactionDetail,
|
|
57
|
+
logger: config?.logger,
|
|
58
|
+
},
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
// decode
|
|
62
|
+
const { transactions: transactionsDecoded } = await decoder.decode(
|
|
63
|
+
{
|
|
64
|
+
chain,
|
|
65
|
+
transactions: transactionDetails,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
timeout: timeoutTimestamp - Date.now(),
|
|
69
|
+
logger: config?.logger,
|
|
70
|
+
},
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
const timeoutForDataSources = timeoutTimestamp - Date.now()
|
|
74
|
+
const [apps, prices] = await Promise.all([
|
|
75
|
+
// get apps
|
|
76
|
+
getTransactionsApps(appDataSource, transactionDetails, {
|
|
77
|
+
timeout: timeoutForDataSources,
|
|
78
|
+
logger: config?.logger,
|
|
79
|
+
}),
|
|
80
|
+
// get prices
|
|
81
|
+
getDecodedTransactionsPrices(
|
|
82
|
+
chain,
|
|
83
|
+
priceDataSource,
|
|
84
|
+
fiat,
|
|
85
|
+
transactionsDecoded,
|
|
86
|
+
{
|
|
87
|
+
timeout: timeoutForDataSources,
|
|
88
|
+
logger: config?.logger,
|
|
89
|
+
},
|
|
90
|
+
),
|
|
91
|
+
])
|
|
92
|
+
|
|
93
|
+
return transactionsDecoded.map((transaction) => {
|
|
94
|
+
const lowerTo =
|
|
95
|
+
transaction.to === null ? undefined : toLowerHex(transaction.to)
|
|
96
|
+
const app = apps.find(({ address }) => address === lowerTo)?.app
|
|
97
|
+
|
|
98
|
+
const timestampMs = Number(transaction.block.timestamp) * 1000
|
|
99
|
+
|
|
100
|
+
const nativeTokenPrice = prices
|
|
101
|
+
.filter(
|
|
102
|
+
({ cryptoCurrencyId }) =>
|
|
103
|
+
cryptoCurrencyId === chain.nativeToken.currency.id,
|
|
104
|
+
)
|
|
105
|
+
.reduce((closestPrice, price) =>
|
|
106
|
+
Math.abs(price.timestamp - timestampMs) <
|
|
107
|
+
Math.abs(closestPrice.timestamp - timestampMs)
|
|
108
|
+
? price
|
|
109
|
+
: closestPrice,
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
...transaction,
|
|
114
|
+
app,
|
|
115
|
+
nativeTokenPrice,
|
|
116
|
+
internalTransactions: transaction.internalTransactions.map(
|
|
117
|
+
(internalTransaction) => ({
|
|
118
|
+
...internalTransaction,
|
|
119
|
+
price: nativeTokenPrice,
|
|
120
|
+
}),
|
|
121
|
+
),
|
|
122
|
+
erc20Transfers: transaction.erc20Transfers.map((transfer) => ({
|
|
123
|
+
...transfer,
|
|
124
|
+
price: prices
|
|
125
|
+
.filter(
|
|
126
|
+
({ cryptoCurrencyId }) =>
|
|
127
|
+
cryptoCurrencyId === transfer.token.currency.id,
|
|
128
|
+
)
|
|
129
|
+
.reduce(
|
|
130
|
+
(closestPrice: CryptoCurrencyPrice | undefined, price) =>
|
|
131
|
+
closestPrice === undefined ||
|
|
132
|
+
Math.abs(price.timestamp - timestampMs) <
|
|
133
|
+
Math.abs(closestPrice.timestamp - timestampMs)
|
|
134
|
+
? price
|
|
135
|
+
: closestPrice,
|
|
136
|
+
undefined,
|
|
137
|
+
),
|
|
138
|
+
})),
|
|
139
|
+
}
|
|
140
|
+
})
|
|
141
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/* eslint-disable unicorn/filename-case */
|
|
2
|
+
import type { Config, CryptoCurrencyPrice } from '@0xtorch/core'
|
|
3
|
+
import { toLowerHex } from '../types'
|
|
4
|
+
import { getDecodedTransactionsPrices } from './getDecodedTransactionsPrices'
|
|
5
|
+
import { getHashesAndInternalTxs } from './getHashesAndInternalTxs'
|
|
6
|
+
import { getTransactionDetails } from './getTransactionDetails'
|
|
7
|
+
import { getTransactionsApps } from './getTransactionsApps'
|
|
8
|
+
import type {
|
|
9
|
+
GetAccountsTransactionFullsCustomParametersPDA,
|
|
10
|
+
GetAccountsTransactionFullsCustomReturnType,
|
|
11
|
+
} from './types'
|
|
12
|
+
|
|
13
|
+
export const getAccountsTransactionFullsCustomWithPDA = async (
|
|
14
|
+
{
|
|
15
|
+
chain,
|
|
16
|
+
addresses,
|
|
17
|
+
fromBlock,
|
|
18
|
+
toBlock,
|
|
19
|
+
appDataSource,
|
|
20
|
+
priceDataSource,
|
|
21
|
+
fiat,
|
|
22
|
+
decoder,
|
|
23
|
+
analyzer,
|
|
24
|
+
onFetchHashes,
|
|
25
|
+
onFetchTransaction,
|
|
26
|
+
}: GetAccountsTransactionFullsCustomParametersPDA,
|
|
27
|
+
config?: Config,
|
|
28
|
+
): Promise<
|
|
29
|
+
GetAccountsTransactionFullsCustomReturnType<GetAccountsTransactionFullsCustomParametersPDA>
|
|
30
|
+
> => {
|
|
31
|
+
const timeoutTimestamp =
|
|
32
|
+
Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout)
|
|
33
|
+
|
|
34
|
+
// get transaction hash & internal transaction by explorer
|
|
35
|
+
const { hashes, internalTransactions } = await getHashesAndInternalTxs(
|
|
36
|
+
chain,
|
|
37
|
+
addresses,
|
|
38
|
+
fromBlock,
|
|
39
|
+
toBlock,
|
|
40
|
+
config,
|
|
41
|
+
)
|
|
42
|
+
if (hashes.length === 0) {
|
|
43
|
+
return []
|
|
44
|
+
}
|
|
45
|
+
if (onFetchHashes !== undefined) {
|
|
46
|
+
onFetchHashes(hashes.map((hash) => toLowerHex(hash)))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// get transaction detail of hashes
|
|
50
|
+
const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now()
|
|
51
|
+
const transactionDetails = await getTransactionDetails(
|
|
52
|
+
chain,
|
|
53
|
+
hashes,
|
|
54
|
+
internalTransactions,
|
|
55
|
+
onFetchTransaction,
|
|
56
|
+
{
|
|
57
|
+
timeout: timeoutForGetTransactionDetail,
|
|
58
|
+
logger: config?.logger,
|
|
59
|
+
},
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
// decode
|
|
63
|
+
const { transactions: transactionsDecoded } = await decoder.decode(
|
|
64
|
+
{
|
|
65
|
+
chain,
|
|
66
|
+
transactions: transactionDetails,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
timeout: timeoutTimestamp - Date.now(),
|
|
70
|
+
logger: config?.logger,
|
|
71
|
+
},
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
const timeoutForDataSources = timeoutTimestamp - Date.now()
|
|
75
|
+
const [apps, prices] = await Promise.all([
|
|
76
|
+
// get apps
|
|
77
|
+
getTransactionsApps(appDataSource, transactionDetails, {
|
|
78
|
+
timeout: timeoutForDataSources,
|
|
79
|
+
logger: config?.logger,
|
|
80
|
+
}),
|
|
81
|
+
// get prices
|
|
82
|
+
getDecodedTransactionsPrices(
|
|
83
|
+
chain,
|
|
84
|
+
priceDataSource,
|
|
85
|
+
fiat,
|
|
86
|
+
transactionsDecoded,
|
|
87
|
+
{
|
|
88
|
+
timeout: timeoutForDataSources,
|
|
89
|
+
logger: config?.logger,
|
|
90
|
+
},
|
|
91
|
+
),
|
|
92
|
+
])
|
|
93
|
+
|
|
94
|
+
const transactionsForAnalyzer = transactionsDecoded.map((transaction) => {
|
|
95
|
+
const lowerTo =
|
|
96
|
+
transaction.to === null ? undefined : toLowerHex(transaction.to)
|
|
97
|
+
const app = apps.find(({ address }) => address === lowerTo)?.app
|
|
98
|
+
const timestampMs = Number(transaction.block.timestamp) * 1000
|
|
99
|
+
const nativeTokenPrice = prices
|
|
100
|
+
.filter(
|
|
101
|
+
({ cryptoCurrencyId }) =>
|
|
102
|
+
cryptoCurrencyId === chain.nativeToken.currency.id,
|
|
103
|
+
)
|
|
104
|
+
.reduce(
|
|
105
|
+
(closestPrice: CryptoCurrencyPrice | undefined, price) =>
|
|
106
|
+
closestPrice === undefined ||
|
|
107
|
+
Math.abs(price.timestamp - timestampMs) <
|
|
108
|
+
Math.abs(closestPrice.timestamp - timestampMs)
|
|
109
|
+
? price
|
|
110
|
+
: closestPrice,
|
|
111
|
+
undefined,
|
|
112
|
+
)
|
|
113
|
+
return {
|
|
114
|
+
...transaction,
|
|
115
|
+
app,
|
|
116
|
+
nativeTokenPrice,
|
|
117
|
+
internalTransactions: transaction.internalTransactions.map(
|
|
118
|
+
(internalTransaction) => ({
|
|
119
|
+
...internalTransaction,
|
|
120
|
+
price: nativeTokenPrice,
|
|
121
|
+
}),
|
|
122
|
+
),
|
|
123
|
+
erc20Transfers: transaction.erc20Transfers.map((transfer) => ({
|
|
124
|
+
...transfer,
|
|
125
|
+
price: prices
|
|
126
|
+
.filter(
|
|
127
|
+
({ cryptoCurrencyId }) =>
|
|
128
|
+
cryptoCurrencyId === transfer.token.currency.id,
|
|
129
|
+
)
|
|
130
|
+
.reduce(
|
|
131
|
+
(closestPrice: CryptoCurrencyPrice | undefined, price) =>
|
|
132
|
+
closestPrice === undefined ||
|
|
133
|
+
Math.abs(price.timestamp - timestampMs) <
|
|
134
|
+
Math.abs(closestPrice.timestamp - timestampMs)
|
|
135
|
+
? price
|
|
136
|
+
: closestPrice,
|
|
137
|
+
undefined,
|
|
138
|
+
),
|
|
139
|
+
})),
|
|
140
|
+
}
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
// analyze
|
|
144
|
+
const timeoutForAnalyzer = timeoutTimestamp - Date.now()
|
|
145
|
+
const analyzedDatas = await Promise.all(
|
|
146
|
+
transactionsForAnalyzer.map((transactionForAnalyzer) =>
|
|
147
|
+
analyzer.analyze(
|
|
148
|
+
{
|
|
149
|
+
chain,
|
|
150
|
+
transaction: transactionForAnalyzer,
|
|
151
|
+
accountAddresses: addresses,
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
timeout: timeoutForAnalyzer,
|
|
155
|
+
logger: config?.logger,
|
|
156
|
+
},
|
|
157
|
+
),
|
|
158
|
+
),
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
return transactionsForAnalyzer.map((transactionForAnalyzer, index) => ({
|
|
162
|
+
...transactionForAnalyzer,
|
|
163
|
+
accountAddresses: addresses,
|
|
164
|
+
actions: analyzedDatas[index].actions,
|
|
165
|
+
accountActions: analyzedDatas[index].accountActions,
|
|
166
|
+
}))
|
|
167
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { Config } from '@0xtorch/core'
|
|
2
|
+
import type { LowerHex } from '../types'
|
|
3
|
+
import { toLowerHex } from '../types'
|
|
4
|
+
import { getHashesAndInternalTxs } from './getHashesAndInternalTxs'
|
|
5
|
+
import { getTransactionDetails } from './getTransactionDetails'
|
|
6
|
+
import type {
|
|
7
|
+
GetAccountsTransactionFullsCustomParametersAllUndefined,
|
|
8
|
+
GetAccountsTransactionFullsCustomReturnType,
|
|
9
|
+
} from './types'
|
|
10
|
+
|
|
11
|
+
export const getAccountsTransactionFullsCustomWithAllUndefined = async (
|
|
12
|
+
{
|
|
13
|
+
chain,
|
|
14
|
+
addresses,
|
|
15
|
+
fromBlock,
|
|
16
|
+
toBlock,
|
|
17
|
+
appDataSource,
|
|
18
|
+
onFetchHashes,
|
|
19
|
+
onFetchTransaction,
|
|
20
|
+
}: GetAccountsTransactionFullsCustomParametersAllUndefined,
|
|
21
|
+
config?: Config,
|
|
22
|
+
): Promise<
|
|
23
|
+
GetAccountsTransactionFullsCustomReturnType<GetAccountsTransactionFullsCustomParametersAllUndefined>
|
|
24
|
+
> => {
|
|
25
|
+
const timeoutTimestamp =
|
|
26
|
+
Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout)
|
|
27
|
+
|
|
28
|
+
// get transaction hash & internal transaction by explorer
|
|
29
|
+
const { hashes, internalTransactions } = await getHashesAndInternalTxs(
|
|
30
|
+
chain,
|
|
31
|
+
addresses,
|
|
32
|
+
fromBlock,
|
|
33
|
+
toBlock,
|
|
34
|
+
config,
|
|
35
|
+
)
|
|
36
|
+
if (hashes.length === 0) {
|
|
37
|
+
return []
|
|
38
|
+
}
|
|
39
|
+
if (onFetchHashes !== undefined) {
|
|
40
|
+
onFetchHashes(hashes.map((hash) => toLowerHex(hash)))
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// get transaction detail of hashes
|
|
44
|
+
const timeoutForGetTransactionDetail = timeoutTimestamp - Date.now()
|
|
45
|
+
const transactionDetails = await getTransactionDetails(
|
|
46
|
+
chain,
|
|
47
|
+
hashes,
|
|
48
|
+
internalTransactions,
|
|
49
|
+
onFetchTransaction,
|
|
50
|
+
{
|
|
51
|
+
timeout: timeoutForGetTransactionDetail,
|
|
52
|
+
logger: config?.logger,
|
|
53
|
+
},
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
// get app of to address
|
|
57
|
+
const toAddresses = [
|
|
58
|
+
...new Set(
|
|
59
|
+
transactionDetails
|
|
60
|
+
.map(({ to }) => (to === null ? undefined : toLowerHex(to)))
|
|
61
|
+
.filter((toAddress): toAddress is LowerHex => toAddress !== undefined),
|
|
62
|
+
),
|
|
63
|
+
]
|
|
64
|
+
const timeoutForGetApps = timeoutTimestamp - Date.now()
|
|
65
|
+
const apps = await Promise.all(
|
|
66
|
+
toAddresses.map((toAddress) =>
|
|
67
|
+
appDataSource === undefined
|
|
68
|
+
? undefined
|
|
69
|
+
: appDataSource.getApp(chain.id, toAddress, {
|
|
70
|
+
timeout: timeoutForGetApps,
|
|
71
|
+
logger: config?.logger,
|
|
72
|
+
}),
|
|
73
|
+
),
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
return transactionDetails.map((transactionDetail) => {
|
|
77
|
+
const appIndex =
|
|
78
|
+
transactionDetail.to === null
|
|
79
|
+
? -1
|
|
80
|
+
: toAddresses.indexOf(toLowerHex(transactionDetail.to))
|
|
81
|
+
const app = appIndex < 0 ? undefined : apps[appIndex]
|
|
82
|
+
return {
|
|
83
|
+
...transactionDetail,
|
|
84
|
+
app,
|
|
85
|
+
nativeTokenPrice: undefined,
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Chain } from './chains'
|
|
2
|
+
import type { Hex } from './types'
|
|
3
|
+
|
|
4
|
+
type GetContractAbiParameters<TChain extends Chain> = {
|
|
5
|
+
readonly chain: TChain
|
|
6
|
+
readonly address: Hex
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const getContractAbi = <TChain extends Chain>(
|
|
10
|
+
parameters: GetContractAbiParameters<TChain>,
|
|
11
|
+
): Promise<string> => {
|
|
12
|
+
// TODO implement
|
|
13
|
+
console.debug(parameters)
|
|
14
|
+
throw new Error('Not implemented')
|
|
15
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Config } from '@0xtorch/core'
|
|
2
|
+
import type { Chain } from '../chains'
|
|
3
|
+
import type { Hex, TransactionDetail } from '../types'
|
|
4
|
+
|
|
5
|
+
export const getTransactionDetail = async (
|
|
6
|
+
chain: Chain,
|
|
7
|
+
hash: Hex,
|
|
8
|
+
config?: Config,
|
|
9
|
+
): Promise<TransactionDetail | undefined> => {
|
|
10
|
+
// transaction 取得
|
|
11
|
+
const [transaction, receipt, internalTransactions] = await Promise.all([
|
|
12
|
+
chain.client.getTransaction(hash, config),
|
|
13
|
+
chain.client.getTransactionReceipt(hash, config),
|
|
14
|
+
chain.explorer.getInternalTransactionOfTransaction({
|
|
15
|
+
hash,
|
|
16
|
+
nativeCurrency: chain.nativeToken.currency,
|
|
17
|
+
logger: config?.logger,
|
|
18
|
+
}),
|
|
19
|
+
])
|
|
20
|
+
if (transaction.blockNumber === null) {
|
|
21
|
+
throw new Error('Transaction is not mined yet')
|
|
22
|
+
}
|
|
23
|
+
const block = await chain.client.getBlock(transaction.blockNumber)
|
|
24
|
+
if (
|
|
25
|
+
block.hash === null ||
|
|
26
|
+
block.logsBloom === null ||
|
|
27
|
+
block.nonce === null ||
|
|
28
|
+
block.number === null
|
|
29
|
+
) {
|
|
30
|
+
throw new Error('Block is not mined yet')
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
...transaction,
|
|
34
|
+
...receipt,
|
|
35
|
+
type: transaction.type,
|
|
36
|
+
chainId: chain.id,
|
|
37
|
+
block: {
|
|
38
|
+
...block,
|
|
39
|
+
hash: block.hash,
|
|
40
|
+
logsBloom: block.logsBloom,
|
|
41
|
+
nonce: block.nonce,
|
|
42
|
+
number: block.number,
|
|
43
|
+
transactions: [],
|
|
44
|
+
},
|
|
45
|
+
internalTransactions,
|
|
46
|
+
}
|
|
47
|
+
}
|