@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,147 @@
|
|
|
1
|
+
/* eslint-disable unicorn/filename-case */
|
|
2
|
+
import type { Config, CryptoCurrency, CryptoCurrencyPrice } from '@0xtorch/core'
|
|
3
|
+
import { toLowerHex } from '../types'
|
|
4
|
+
import { getTransactionDetail } from './getTransactionDetail'
|
|
5
|
+
import type {
|
|
6
|
+
GetTransactionFullCustomParametersPDA,
|
|
7
|
+
GetTransactionFullCustomReturnType,
|
|
8
|
+
} from './types'
|
|
9
|
+
|
|
10
|
+
export const getTransactionFullCustomWithPDA = async (
|
|
11
|
+
parameters: GetTransactionFullCustomParametersPDA,
|
|
12
|
+
config?: Config,
|
|
13
|
+
): Promise<
|
|
14
|
+
GetTransactionFullCustomReturnType<GetTransactionFullCustomParametersPDA>
|
|
15
|
+
> => {
|
|
16
|
+
const timeoutTimestamp =
|
|
17
|
+
Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout)
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
chain,
|
|
21
|
+
hash,
|
|
22
|
+
appDataSource,
|
|
23
|
+
priceDataSource,
|
|
24
|
+
fiat,
|
|
25
|
+
decoder,
|
|
26
|
+
analyzer,
|
|
27
|
+
} = parameters
|
|
28
|
+
|
|
29
|
+
// get transaction detail
|
|
30
|
+
const transactionDetail = await getTransactionDetail(chain, hash, config)
|
|
31
|
+
if (transactionDetail === undefined) {
|
|
32
|
+
return undefined
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// decode
|
|
36
|
+
const decodedData = await decoder.decode(
|
|
37
|
+
{
|
|
38
|
+
chain,
|
|
39
|
+
transactions: [transactionDetail],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
timeout: timeoutTimestamp - Date.now(),
|
|
43
|
+
logger: config?.logger,
|
|
44
|
+
},
|
|
45
|
+
)
|
|
46
|
+
const transactionDecoded = decodedData.transactions[0]
|
|
47
|
+
|
|
48
|
+
// get data from datasources
|
|
49
|
+
const mut_currencies: CryptoCurrency[] = [chain.nativeToken.currency]
|
|
50
|
+
for (const { token } of transactionDecoded.erc20Transfers) {
|
|
51
|
+
if (token.currency.market.coingeckoId === undefined) {
|
|
52
|
+
continue
|
|
53
|
+
}
|
|
54
|
+
if (mut_currencies.some((currency) => currency.id === token.currency.id)) {
|
|
55
|
+
continue
|
|
56
|
+
}
|
|
57
|
+
mut_currencies.push(token.currency)
|
|
58
|
+
}
|
|
59
|
+
const currencies = mut_currencies
|
|
60
|
+
|
|
61
|
+
const timestampMs = Number(transactionDecoded.block.timestamp) * 1000
|
|
62
|
+
const from = timestampMs - 1000 * 60 * 60
|
|
63
|
+
const to = timestampMs + 1000 * 60 * 60
|
|
64
|
+
|
|
65
|
+
const timeoutForDataSources = timeoutTimestamp - Date.now()
|
|
66
|
+
const [app, prices] = await Promise.all([
|
|
67
|
+
// get app
|
|
68
|
+
appDataSource === undefined || transactionDecoded.to === null
|
|
69
|
+
? undefined
|
|
70
|
+
: appDataSource.getApp(chain.id, toLowerHex(transactionDecoded.to), {
|
|
71
|
+
timeout: timeoutForDataSources,
|
|
72
|
+
logger: config?.logger,
|
|
73
|
+
}),
|
|
74
|
+
// get native token prices
|
|
75
|
+
priceDataSource.getHistoricalPrices(
|
|
76
|
+
{
|
|
77
|
+
targetCurrencies: currencies,
|
|
78
|
+
vsCurrency: fiat,
|
|
79
|
+
from,
|
|
80
|
+
to,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
timeout: timeoutForDataSources,
|
|
84
|
+
logger: config?.logger,
|
|
85
|
+
},
|
|
86
|
+
),
|
|
87
|
+
])
|
|
88
|
+
|
|
89
|
+
const closestPrices = currencies.map((currency) =>
|
|
90
|
+
prices
|
|
91
|
+
.filter((price) => price.cryptoCurrencyId === currency.id)
|
|
92
|
+
.reduce(
|
|
93
|
+
(closestPrice: CryptoCurrencyPrice | undefined, price) =>
|
|
94
|
+
closestPrice === undefined ||
|
|
95
|
+
Math.abs(price.timestamp - timestampMs) <
|
|
96
|
+
Math.abs(closestPrice.timestamp - timestampMs)
|
|
97
|
+
? price
|
|
98
|
+
: closestPrice,
|
|
99
|
+
undefined,
|
|
100
|
+
),
|
|
101
|
+
)
|
|
102
|
+
const nativeTokenPrice = closestPrices.find(
|
|
103
|
+
(price) =>
|
|
104
|
+
price !== undefined &&
|
|
105
|
+
price.cryptoCurrencyId === chain.nativeToken.currency.id,
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
const transactionForAnalyzer = {
|
|
109
|
+
...transactionDecoded,
|
|
110
|
+
app,
|
|
111
|
+
nativeTokenPrice,
|
|
112
|
+
internalTransactions: transactionDecoded.internalTransactions.map(
|
|
113
|
+
(internalTransaction) => ({
|
|
114
|
+
...internalTransaction,
|
|
115
|
+
price: nativeTokenPrice,
|
|
116
|
+
}),
|
|
117
|
+
),
|
|
118
|
+
erc20Transfers: transactionDecoded.erc20Transfers.map((transfer) => ({
|
|
119
|
+
...transfer,
|
|
120
|
+
price: closestPrices.find(
|
|
121
|
+
(price) =>
|
|
122
|
+
price !== undefined &&
|
|
123
|
+
price.cryptoCurrencyId === transfer.token.currency.id,
|
|
124
|
+
),
|
|
125
|
+
})),
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// analyze
|
|
129
|
+
const { actions, accountActions } = await analyzer.analyze(
|
|
130
|
+
{
|
|
131
|
+
chain,
|
|
132
|
+
transaction: transactionForAnalyzer,
|
|
133
|
+
accountAddresses: [],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
timeout: timeoutTimestamp - Date.now(),
|
|
137
|
+
logger: config?.logger,
|
|
138
|
+
},
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
...transactionForAnalyzer,
|
|
143
|
+
accountAddresses: [],
|
|
144
|
+
actions,
|
|
145
|
+
accountActions,
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Config } from '@0xtorch/core'
|
|
2
|
+
import { toLowerHex } from '../types'
|
|
3
|
+
import { getTransactionDetail } from './getTransactionDetail'
|
|
4
|
+
import type {
|
|
5
|
+
GetTransactionFullCustomParametersAllUndefined,
|
|
6
|
+
GetTransactionFullCustomReturnType,
|
|
7
|
+
} from './types'
|
|
8
|
+
|
|
9
|
+
export const getTransactionFullCustomWithAllUndefined = async (
|
|
10
|
+
parameters: GetTransactionFullCustomParametersAllUndefined,
|
|
11
|
+
config?: Config,
|
|
12
|
+
): Promise<
|
|
13
|
+
GetTransactionFullCustomReturnType<GetTransactionFullCustomParametersAllUndefined>
|
|
14
|
+
> => {
|
|
15
|
+
const timeoutTimestamp =
|
|
16
|
+
Date.now() + (config?.timeout === undefined ? 60_000 : config.timeout)
|
|
17
|
+
|
|
18
|
+
const { chain, hash, appDataSource } = parameters
|
|
19
|
+
const transactionDetail = await getTransactionDetail(chain, hash, config)
|
|
20
|
+
if (transactionDetail === undefined) {
|
|
21
|
+
return undefined
|
|
22
|
+
}
|
|
23
|
+
const app =
|
|
24
|
+
appDataSource === undefined || transactionDetail.to === null
|
|
25
|
+
? undefined
|
|
26
|
+
: await appDataSource.getApp(chain.id, toLowerHex(transactionDetail.to), {
|
|
27
|
+
timeout: timeoutTimestamp - Date.now(),
|
|
28
|
+
logger: config?.logger,
|
|
29
|
+
})
|
|
30
|
+
if (transactionDetail === undefined) {
|
|
31
|
+
return undefined
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
...transactionDetail,
|
|
36
|
+
app,
|
|
37
|
+
nativeTokenPrice: undefined,
|
|
38
|
+
}
|
|
39
|
+
}
|
package/src/index.cts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./index.mts')
|
package/src/index.mts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export { erc1155Abi, erc20Abi, erc721Abi, wethAbi } from './abis'
|
|
2
|
+
export {
|
|
3
|
+
analyzeAxieMarketplace,
|
|
4
|
+
analyzeGasFee,
|
|
5
|
+
analyzeSeaport,
|
|
6
|
+
analyzeSwap,
|
|
7
|
+
analyzeTransfer,
|
|
8
|
+
analyzer,
|
|
9
|
+
createAnalyzeByJsonRule,
|
|
10
|
+
} from './analyzer'
|
|
11
|
+
export type { AnalyzeParameters, AnalyzeReturnType, Analyzer } from './analyzer'
|
|
12
|
+
export type { AppDataSource } from './apps'
|
|
13
|
+
export {
|
|
14
|
+
arbitrumOneHttpRpcs,
|
|
15
|
+
arbitrumOneWebsocketRpcUrls,
|
|
16
|
+
astarHttpRpcs,
|
|
17
|
+
astarWebsocketRpcUrls,
|
|
18
|
+
avalancheCHttpRpcs,
|
|
19
|
+
avalancheCWebsocketRpcUrls,
|
|
20
|
+
baseHttpRpcs,
|
|
21
|
+
baseWebsocketRpcUrls,
|
|
22
|
+
bscHttpRpcs,
|
|
23
|
+
bscWebsocketRpcUrls,
|
|
24
|
+
createArbitrumOneChain,
|
|
25
|
+
createArbitrumOneChainCustom,
|
|
26
|
+
createAstarChain,
|
|
27
|
+
createAstarChainCustom,
|
|
28
|
+
createAvalancheCChain,
|
|
29
|
+
createAvalancheCChainCustom,
|
|
30
|
+
createBaseChain,
|
|
31
|
+
createBaseChainCustom,
|
|
32
|
+
createBscChain,
|
|
33
|
+
createBscChainCustom,
|
|
34
|
+
createEthereumChain,
|
|
35
|
+
createEthereumChainCustom,
|
|
36
|
+
createFantomChain,
|
|
37
|
+
createFantomChainCustom,
|
|
38
|
+
createLineaChain,
|
|
39
|
+
createLineaChainCustom,
|
|
40
|
+
createMantleChainCustom,
|
|
41
|
+
createMetisChainCustom,
|
|
42
|
+
createMoonbeamChain,
|
|
43
|
+
createMoonbeamChainCustom,
|
|
44
|
+
createMoonriverChain,
|
|
45
|
+
createMoonriverChainCustom,
|
|
46
|
+
createOptimismChain,
|
|
47
|
+
createOptimismChainCustom,
|
|
48
|
+
createPolygonPosChain,
|
|
49
|
+
createPolygonPosChainCustom,
|
|
50
|
+
createRoninChain,
|
|
51
|
+
createRoninChainCustom,
|
|
52
|
+
ethereumHttpRpcs,
|
|
53
|
+
ethereumWebsocketRpcUrls,
|
|
54
|
+
fantomHttpRpcs,
|
|
55
|
+
fantomWebsocketRpcUrls,
|
|
56
|
+
getBlockOfTimestampByDefillama,
|
|
57
|
+
lineaHttpRpcs,
|
|
58
|
+
lineaWebsocketRpcUrls,
|
|
59
|
+
mantleHttpRpcs,
|
|
60
|
+
mantleWebsocketRpcUrls,
|
|
61
|
+
metisHttpRpcs,
|
|
62
|
+
metisWebsocketRpcUrls,
|
|
63
|
+
moonbeamHttpRpcs,
|
|
64
|
+
moonbeamWebsocketRpcUrls,
|
|
65
|
+
moonriverHttpRpcs,
|
|
66
|
+
moonriverWebsocketRpcUrls,
|
|
67
|
+
optimismHttpRpcs,
|
|
68
|
+
optimismWebsocketRpcUrls,
|
|
69
|
+
polygonPosHttpRpcs,
|
|
70
|
+
polygonPosWebsocketRpcUrls,
|
|
71
|
+
roninHttpRpcs,
|
|
72
|
+
roninWebsocketRpcUrls,
|
|
73
|
+
} from './chains'
|
|
74
|
+
export type { Chain } from './chains'
|
|
75
|
+
export {
|
|
76
|
+
decoder,
|
|
77
|
+
parseErc1155TransferSingleLogs,
|
|
78
|
+
parseErc20TransferLogs,
|
|
79
|
+
parseErc721TransferLogs,
|
|
80
|
+
} from './decoder'
|
|
81
|
+
export type { Decoder } from './decoder'
|
|
82
|
+
export { createEtherscan, createRoninExplorer } from './explorers'
|
|
83
|
+
export type { Explorer } from './explorers'
|
|
84
|
+
export {
|
|
85
|
+
getAccountsTransactionFulls,
|
|
86
|
+
getAccountsTransactionFullsCustom,
|
|
87
|
+
} from './getAccountsTransactionFulls'
|
|
88
|
+
export {
|
|
89
|
+
getTransactionFull,
|
|
90
|
+
getTransactionFullCustom,
|
|
91
|
+
} from './getTransactionFull'
|
|
92
|
+
export { isHex, parsedLogSchema, toLowerHex } from './types'
|
|
93
|
+
export type {
|
|
94
|
+
Erc1155Token,
|
|
95
|
+
Erc1155Transfer,
|
|
96
|
+
Erc20Token,
|
|
97
|
+
Erc20Transfer,
|
|
98
|
+
Erc721Token,
|
|
99
|
+
Erc721Transfer,
|
|
100
|
+
EvmAccount,
|
|
101
|
+
Hex,
|
|
102
|
+
InputData,
|
|
103
|
+
InternalTransaction,
|
|
104
|
+
LogData,
|
|
105
|
+
LowerHex,
|
|
106
|
+
TransactionDecoded,
|
|
107
|
+
TransactionDetail,
|
|
108
|
+
TransactionFull,
|
|
109
|
+
TransactionSource,
|
|
110
|
+
} from './types'
|
package/src/tests.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isIntegrationTest = process.env.INTEGRATION_TEST === 'true'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Nft } from '@0xtorch/core'
|
|
2
|
+
import type { LowerHex } from './hex'
|
|
3
|
+
|
|
4
|
+
export type Erc1155Token = {
|
|
5
|
+
readonly contractAddress: LowerHex
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type Erc1155Transfer = {
|
|
9
|
+
readonly type: 'Erc1155Transfer'
|
|
10
|
+
readonly logIndex: number
|
|
11
|
+
readonly token: Erc1155Token
|
|
12
|
+
readonly from: LowerHex
|
|
13
|
+
readonly to: LowerHex
|
|
14
|
+
readonly id: bigint
|
|
15
|
+
readonly value: bigint
|
|
16
|
+
readonly nft: Nft
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CryptoCurrency, CryptoCurrencyPrice } from '@0xtorch/core'
|
|
2
|
+
import type { LowerHex } from './hex'
|
|
3
|
+
|
|
4
|
+
export type Erc20Token = {
|
|
5
|
+
readonly contractAddress: LowerHex
|
|
6
|
+
readonly name: string
|
|
7
|
+
readonly symbol: string
|
|
8
|
+
readonly decimals: number
|
|
9
|
+
readonly currency: CryptoCurrency
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type Erc20Transfer<
|
|
13
|
+
Price extends CryptoCurrencyPrice | undefined = undefined,
|
|
14
|
+
> = {
|
|
15
|
+
readonly type: 'Erc20Transfer'
|
|
16
|
+
readonly logIndex: number
|
|
17
|
+
readonly token: Erc20Token
|
|
18
|
+
readonly from: LowerHex
|
|
19
|
+
readonly to: LowerHex
|
|
20
|
+
readonly value: bigint
|
|
21
|
+
readonly price: Price
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Nft } from '@0xtorch/core'
|
|
2
|
+
import type { LowerHex } from './hex'
|
|
3
|
+
|
|
4
|
+
export type Erc721Token = {
|
|
5
|
+
readonly contractAddress: LowerHex
|
|
6
|
+
readonly name: string
|
|
7
|
+
readonly symbol: string
|
|
8
|
+
readonly baseUri?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type Erc721Transfer = {
|
|
12
|
+
readonly type: 'Erc721Transfer'
|
|
13
|
+
readonly logIndex: number
|
|
14
|
+
readonly token: Erc721Token
|
|
15
|
+
readonly from: LowerHex
|
|
16
|
+
readonly to: LowerHex
|
|
17
|
+
readonly tokenId: bigint
|
|
18
|
+
readonly nft: Nft
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Account } from '@0xtorch/core'
|
|
2
|
+
import type { Chain } from '../chains'
|
|
3
|
+
import type { Prettify } from '../utils'
|
|
4
|
+
import type { LowerHex } from './hex'
|
|
5
|
+
|
|
6
|
+
export type EvmAccount = Prettify<
|
|
7
|
+
Account<'evm'> & {
|
|
8
|
+
readonly id: `evm_${Chain['id']}_${LowerHex}`
|
|
9
|
+
readonly chainId: number
|
|
10
|
+
readonly address: LowerHex
|
|
11
|
+
}
|
|
12
|
+
>
|
package/src/types/hex.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type { Erc1155Token, Erc1155Transfer } from './erc1155'
|
|
2
|
+
export type { Erc20Token, Erc20Transfer } from './erc20'
|
|
3
|
+
export type { Erc721Token, Erc721Transfer } from './erc721'
|
|
4
|
+
export type { EvmAccount } from './evmAccount'
|
|
5
|
+
export { isHex, toLowerHex } from './hex'
|
|
6
|
+
export type { Hex, LowerHex } from './hex'
|
|
7
|
+
export type { InputData } from './input'
|
|
8
|
+
export type { InternalTransaction } from './internalTransaction'
|
|
9
|
+
export { parsedLogSchema } from './log'
|
|
10
|
+
export type { DecodedLog, LogData } from './log'
|
|
11
|
+
export type {
|
|
12
|
+
TransactionDecoded,
|
|
13
|
+
TransactionDetail,
|
|
14
|
+
TransactionFull,
|
|
15
|
+
TransactionSource,
|
|
16
|
+
} from './transaction'
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Hex, LowerHex } from './hex'
|
|
2
|
+
|
|
3
|
+
export type Argument = {
|
|
4
|
+
readonly name: string
|
|
5
|
+
readonly type: string
|
|
6
|
+
readonly value: unknown
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type InputFunction = {
|
|
10
|
+
readonly name: string
|
|
11
|
+
readonly args: readonly Argument[] | undefined
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type InputOriginal = {
|
|
15
|
+
readonly type: 'original'
|
|
16
|
+
readonly address: LowerHex
|
|
17
|
+
readonly data: Hex
|
|
18
|
+
}
|
|
19
|
+
type InputDecoded = {
|
|
20
|
+
readonly type: 'decoded'
|
|
21
|
+
readonly address: LowerHex
|
|
22
|
+
readonly data: Hex
|
|
23
|
+
readonly function: InputFunction
|
|
24
|
+
/** contract address of ABI source */
|
|
25
|
+
readonly source: LowerHex
|
|
26
|
+
}
|
|
27
|
+
export type InputData = InputOriginal | InputDecoded
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CryptoCurrency, CryptoCurrencyPrice } from '@0xtorch/core'
|
|
2
|
+
import type { Hex, LowerHex } from './hex'
|
|
3
|
+
|
|
4
|
+
export type InternalTransaction<Price extends CryptoCurrencyPrice | undefined> =
|
|
5
|
+
{
|
|
6
|
+
readonly type: 'InternalTransaction'
|
|
7
|
+
readonly transactionHash: Hex
|
|
8
|
+
readonly from: LowerHex
|
|
9
|
+
readonly to: LowerHex | undefined
|
|
10
|
+
readonly contractAddress: LowerHex | undefined
|
|
11
|
+
readonly txType: string
|
|
12
|
+
readonly value: bigint
|
|
13
|
+
readonly gas: bigint
|
|
14
|
+
readonly gasUsed: bigint
|
|
15
|
+
readonly isError: boolean
|
|
16
|
+
readonly input: string | undefined
|
|
17
|
+
readonly currency: CryptoCurrency
|
|
18
|
+
readonly price: Price
|
|
19
|
+
}
|
package/src/types/log.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Log } from 'viem'
|
|
2
|
+
import { z } from 'zod'
|
|
3
|
+
import type { LowerHex } from './hex'
|
|
4
|
+
import { isHex, toLowerHex } from './hex'
|
|
5
|
+
|
|
6
|
+
export type LogData = LogOriginal | LogDecoded
|
|
7
|
+
|
|
8
|
+
type LogOriginal = {
|
|
9
|
+
readonly type: 'LogOriginal'
|
|
10
|
+
readonly log: Log<bigint, number, false>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type LogDecoded = {
|
|
14
|
+
readonly type: 'decoded'
|
|
15
|
+
readonly log: DecodedLog
|
|
16
|
+
/** contract address of ABI source */
|
|
17
|
+
readonly source: LowerHex
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type DecodedLog = z.infer<typeof decodedLogSchema> & {
|
|
21
|
+
readonly type: 'DecodedLog'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const logSchema = z.object({
|
|
25
|
+
address: z
|
|
26
|
+
.string()
|
|
27
|
+
.regex(/^0x[\dA-Fa-f]{40}$/)
|
|
28
|
+
.transform((x) => (isHex(x) ? toLowerHex(x) : '0x')),
|
|
29
|
+
blockHash: z
|
|
30
|
+
.string()
|
|
31
|
+
.regex(/^0x[\dA-Fa-f]*$/)
|
|
32
|
+
.transform((x) => (isHex(x) ? x : '0x')),
|
|
33
|
+
blockNumber: z.bigint(),
|
|
34
|
+
data: z
|
|
35
|
+
.string()
|
|
36
|
+
.regex(/^0x[\dA-Fa-f]*$/)
|
|
37
|
+
.transform((x) => (isHex(x) ? x : '0x')),
|
|
38
|
+
logIndex: z.number().int(),
|
|
39
|
+
transactionHash: z
|
|
40
|
+
.string()
|
|
41
|
+
.regex(/^0x[\dA-Fa-f]{64}$/)
|
|
42
|
+
.transform((x) => (isHex(x) ? x : '0x')),
|
|
43
|
+
transactionIndex: z.number().int(),
|
|
44
|
+
removed: z.boolean(),
|
|
45
|
+
topics: z.array(
|
|
46
|
+
z
|
|
47
|
+
.string()
|
|
48
|
+
.regex(/^0x[\dA-Fa-f]{64}$/)
|
|
49
|
+
.transform((x) => (isHex(x) ? x : '0x')),
|
|
50
|
+
),
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const parsedLogSchema = logSchema.extend({
|
|
54
|
+
eventName: z.string(),
|
|
55
|
+
args: z.record(z.unknown()),
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
export const decodedLogSchema = logSchema.extend({
|
|
59
|
+
eventName: z.string(),
|
|
60
|
+
args: z.array(
|
|
61
|
+
z.object({
|
|
62
|
+
indexed: z.boolean(),
|
|
63
|
+
name: z.string(),
|
|
64
|
+
type: z.string(),
|
|
65
|
+
value: z.unknown(),
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
68
|
+
})
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AccountAction,
|
|
3
|
+
AccountActionType,
|
|
4
|
+
ActionType,
|
|
5
|
+
App,
|
|
6
|
+
CryptoCurrencyPrice,
|
|
7
|
+
NormalAction,
|
|
8
|
+
} from '@0xtorch/core'
|
|
9
|
+
import type { Block, BlockTag, Transaction, TransactionReceipt } from 'viem'
|
|
10
|
+
import type { Prettify } from '../utils'
|
|
11
|
+
import type { Erc1155Transfer } from './erc1155'
|
|
12
|
+
import type { Erc20Transfer } from './erc20'
|
|
13
|
+
import type { Erc721Transfer } from './erc721'
|
|
14
|
+
import type { EvmAccount } from './evmAccount'
|
|
15
|
+
import type { LowerHex } from './hex'
|
|
16
|
+
import type { InputFunction } from './input'
|
|
17
|
+
import type { InternalTransaction } from './internalTransaction'
|
|
18
|
+
import type { LogData } from './log'
|
|
19
|
+
|
|
20
|
+
export type TransactionSource = `evm_${number}_${LowerHex}`
|
|
21
|
+
|
|
22
|
+
export type TransactionDetail = Prettify<
|
|
23
|
+
Omit<Transaction<bigint, number, false>, 'type'> &
|
|
24
|
+
Omit<TransactionReceipt, 'type'> & {
|
|
25
|
+
readonly type: Transaction['type']
|
|
26
|
+
readonly chainId: number
|
|
27
|
+
readonly block: Block<bigint, false, Exclude<BlockTag, 'pending'>>
|
|
28
|
+
readonly internalTransactions: readonly InternalTransaction<undefined>[]
|
|
29
|
+
}
|
|
30
|
+
>
|
|
31
|
+
|
|
32
|
+
export type TransactionDecoded<Price extends CryptoCurrencyPrice | undefined> =
|
|
33
|
+
Prettify<
|
|
34
|
+
Omit<TransactionDetail, 'logs' | 'internalTransactions'> & {
|
|
35
|
+
readonly function: InputFunction | undefined
|
|
36
|
+
readonly internalTransactions: readonly InternalTransaction<Price>[]
|
|
37
|
+
readonly erc20Transfers: readonly Erc20Transfer<Price>[]
|
|
38
|
+
readonly erc721Transfers: readonly Erc721Transfer[]
|
|
39
|
+
readonly erc1155Transfers: readonly Erc1155Transfer[]
|
|
40
|
+
readonly logs: readonly LogData[]
|
|
41
|
+
readonly app: App | undefined
|
|
42
|
+
readonly nativeTokenPrice: Price
|
|
43
|
+
}
|
|
44
|
+
>
|
|
45
|
+
|
|
46
|
+
export type TransactionFull<
|
|
47
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
48
|
+
Decoded extends boolean,
|
|
49
|
+
Analyzed extends boolean,
|
|
50
|
+
> = Omit<TransactionDetail, 'logs' | 'internalTransactions'> & {
|
|
51
|
+
readonly app: App | undefined
|
|
52
|
+
readonly nativeTokenPrice: Price
|
|
53
|
+
readonly internalTransactions: readonly InternalTransaction<Price>[]
|
|
54
|
+
} & (Decoded extends true
|
|
55
|
+
? {
|
|
56
|
+
readonly function: InputFunction | undefined
|
|
57
|
+
readonly erc20Transfers: readonly Erc20Transfer<Price>[]
|
|
58
|
+
readonly erc721Transfers: readonly Erc721Transfer[]
|
|
59
|
+
readonly erc1155Transfers: readonly Erc1155Transfer[]
|
|
60
|
+
readonly logs: readonly LogData[]
|
|
61
|
+
}
|
|
62
|
+
: Pick<TransactionDetail, 'logs'>) &
|
|
63
|
+
(Analyzed extends true
|
|
64
|
+
? {
|
|
65
|
+
readonly accountAddresses: readonly LowerHex[]
|
|
66
|
+
readonly actions: readonly NormalAction<
|
|
67
|
+
ActionType,
|
|
68
|
+
EvmAccount | undefined,
|
|
69
|
+
Price
|
|
70
|
+
>[]
|
|
71
|
+
readonly accountActions: readonly AccountAction<
|
|
72
|
+
AccountActionType,
|
|
73
|
+
TransactionSource,
|
|
74
|
+
EvmAccount | undefined,
|
|
75
|
+
Price
|
|
76
|
+
>[]
|
|
77
|
+
}
|
|
78
|
+
: unknown)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description Combines members of an intersection into a readable type.
|
|
3
|
+
*
|
|
4
|
+
* @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}
|
|
5
|
+
* @example
|
|
6
|
+
* Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
|
|
7
|
+
* => { a: string, b: string, c: number, d: bigint }
|
|
8
|
+
*/
|
|
9
|
+
export type Prettify<T> = {
|
|
10
|
+
[K in keyof T]: T[K]
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
12
|
+
} & {}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Enable latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
|
|
10
|
+
// Bundler mode
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
// Best practices
|
|
17
|
+
"strict": true,
|
|
18
|
+
"skipLibCheck": true,
|
|
19
|
+
"noFallthroughCasesInSwitch": true,
|
|
20
|
+
|
|
21
|
+
// Some stricter flags (disabled by default)
|
|
22
|
+
"noUnusedLocals": false,
|
|
23
|
+
"noUnusedParameters": false,
|
|
24
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
25
|
+
|
|
26
|
+
"types": ["bun-types"]
|
|
27
|
+
}
|
|
28
|
+
}
|