@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,425 @@
|
|
|
1
|
+
import { createBigDecimal } from '@0xtorch/big-decimal'
|
|
2
|
+
import type {
|
|
3
|
+
ActionType,
|
|
4
|
+
CryptoCurrencyPrice,
|
|
5
|
+
NormalAction,
|
|
6
|
+
} from '@0xtorch/core'
|
|
7
|
+
import type { Chain } from '../../chains'
|
|
8
|
+
import { createEvmAccount } from '../../creates/createEvmAccount'
|
|
9
|
+
import type { EvmAccount, LowerHex, TransactionDecoded } from '../../types'
|
|
10
|
+
import { isHex, toLowerHex } from '../../types'
|
|
11
|
+
import type {
|
|
12
|
+
ActionGeneratorSpecificTokenTransfer,
|
|
13
|
+
ActionTransferGeneratorFromTokenTransfer,
|
|
14
|
+
ActionTransferGeneratorFromTokenTransferWithCondition,
|
|
15
|
+
TokenTransferConditionAddress,
|
|
16
|
+
} from './types'
|
|
17
|
+
|
|
18
|
+
export const generateActionBySpecificTokenTransferGenerator = <
|
|
19
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
20
|
+
>(
|
|
21
|
+
generator: ActionGeneratorSpecificTokenTransfer,
|
|
22
|
+
chain: Chain,
|
|
23
|
+
transaction: TransactionDecoded<Price>,
|
|
24
|
+
): NormalAction<ActionType, EvmAccount, Price> => {
|
|
25
|
+
const mut_transfers: NormalAction<
|
|
26
|
+
ActionType,
|
|
27
|
+
EvmAccount,
|
|
28
|
+
Price
|
|
29
|
+
>['transfers'][number][] = []
|
|
30
|
+
for (const transfer of generator.transfers) {
|
|
31
|
+
switch (transfer.type) {
|
|
32
|
+
case 'token-transfer': {
|
|
33
|
+
const actionTransfers = generateActionTransfersFromTokenTransfer(
|
|
34
|
+
chain,
|
|
35
|
+
transaction,
|
|
36
|
+
transfer,
|
|
37
|
+
)
|
|
38
|
+
mut_transfers.push(...actionTransfers)
|
|
39
|
+
break
|
|
40
|
+
}
|
|
41
|
+
case 'token-transfer-with-condition': {
|
|
42
|
+
const actionTransfers =
|
|
43
|
+
generateActionTransfersFromTokenTransferWithCondition(
|
|
44
|
+
chain,
|
|
45
|
+
transaction,
|
|
46
|
+
transfer,
|
|
47
|
+
)
|
|
48
|
+
mut_transfers.push(...actionTransfers)
|
|
49
|
+
break
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
type: 'NormalAction',
|
|
55
|
+
action: generator.action,
|
|
56
|
+
evidence: 'contract',
|
|
57
|
+
timestamp: Number(transaction.block.timestamp) * 1000,
|
|
58
|
+
comment: generator.comment,
|
|
59
|
+
app: transaction.app,
|
|
60
|
+
transfers: mut_transfers,
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const generateActionTransfersFromTokenTransfer = <
|
|
65
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
66
|
+
>(
|
|
67
|
+
chain: Chain,
|
|
68
|
+
transaction: TransactionDecoded<Price>,
|
|
69
|
+
generator: ActionTransferGeneratorFromTokenTransfer,
|
|
70
|
+
): NormalAction<ActionType, EvmAccount, Price>['transfers'][number][] => {
|
|
71
|
+
const {
|
|
72
|
+
chainId,
|
|
73
|
+
value,
|
|
74
|
+
nativeTokenPrice,
|
|
75
|
+
erc20Transfers,
|
|
76
|
+
erc721Transfers,
|
|
77
|
+
erc1155Transfers,
|
|
78
|
+
internalTransactions,
|
|
79
|
+
} = transaction
|
|
80
|
+
const { token, transferIndex, target } = generator
|
|
81
|
+
|
|
82
|
+
const getTarget = (from: LowerHex, to: LowerHex) => {
|
|
83
|
+
switch (target) {
|
|
84
|
+
case 'from': {
|
|
85
|
+
return from
|
|
86
|
+
}
|
|
87
|
+
case 'to': {
|
|
88
|
+
return to
|
|
89
|
+
}
|
|
90
|
+
case 'none': {
|
|
91
|
+
return ''
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const getDirection = () => {
|
|
96
|
+
switch (target) {
|
|
97
|
+
case 'from': {
|
|
98
|
+
return 'out'
|
|
99
|
+
}
|
|
100
|
+
case 'to': {
|
|
101
|
+
return 'in'
|
|
102
|
+
}
|
|
103
|
+
case 'none': {
|
|
104
|
+
return 'none'
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
const direction = getDirection()
|
|
109
|
+
|
|
110
|
+
switch (token) {
|
|
111
|
+
case 'erc1155': {
|
|
112
|
+
if (transferIndex === 'any') {
|
|
113
|
+
return erc1155Transfers.map((transfer) => ({
|
|
114
|
+
target: getTarget(transfer.from, transfer.to),
|
|
115
|
+
direction,
|
|
116
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
117
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
118
|
+
asset: transfer.nft,
|
|
119
|
+
amount: createBigDecimal(transfer.value),
|
|
120
|
+
price: undefined as Price,
|
|
121
|
+
}))
|
|
122
|
+
} else {
|
|
123
|
+
const transfer = erc1155Transfers[transferIndex]
|
|
124
|
+
return [
|
|
125
|
+
{
|
|
126
|
+
target: getTarget(transfer.from, transfer.to),
|
|
127
|
+
direction,
|
|
128
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
129
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
130
|
+
asset: transfer.nft,
|
|
131
|
+
amount: createBigDecimal(transfer.value),
|
|
132
|
+
price: undefined as Price,
|
|
133
|
+
},
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
case 'erc20': {
|
|
138
|
+
if (transferIndex === 'any') {
|
|
139
|
+
return erc20Transfers.map((transfer) => ({
|
|
140
|
+
target: getTarget(transfer.from, transfer.to),
|
|
141
|
+
direction,
|
|
142
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
143
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
144
|
+
asset: transfer.token.currency,
|
|
145
|
+
amount: createBigDecimal(transfer.value, transfer.token.decimals),
|
|
146
|
+
price: transfer.price,
|
|
147
|
+
}))
|
|
148
|
+
} else {
|
|
149
|
+
const transfer = erc20Transfers[transferIndex]
|
|
150
|
+
return [
|
|
151
|
+
{
|
|
152
|
+
target: getTarget(transfer.from, transfer.to),
|
|
153
|
+
direction,
|
|
154
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
155
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
156
|
+
asset: transfer.token.currency,
|
|
157
|
+
amount: createBigDecimal(transfer.value, transfer.token.decimals),
|
|
158
|
+
price: transfer.price,
|
|
159
|
+
},
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
case 'erc721': {
|
|
164
|
+
if (transferIndex === 'any') {
|
|
165
|
+
return erc721Transfers.map((transfer) => ({
|
|
166
|
+
target: getTarget(transfer.from, transfer.to),
|
|
167
|
+
direction,
|
|
168
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
169
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
170
|
+
asset: transfer.nft,
|
|
171
|
+
amount: createBigDecimal(1n),
|
|
172
|
+
price: undefined as Price,
|
|
173
|
+
}))
|
|
174
|
+
} else {
|
|
175
|
+
const transfer = erc721Transfers[transferIndex]
|
|
176
|
+
return [
|
|
177
|
+
{
|
|
178
|
+
target: getTarget(transfer.from, transfer.to),
|
|
179
|
+
direction,
|
|
180
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
181
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
182
|
+
asset: transfer.nft,
|
|
183
|
+
amount: createBigDecimal(1n),
|
|
184
|
+
price: undefined as Price,
|
|
185
|
+
},
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
case 'value': {
|
|
190
|
+
const from = toLowerHex(transaction.from)
|
|
191
|
+
const to = transaction.to === null ? '0x' : toLowerHex(transaction.to)
|
|
192
|
+
return [
|
|
193
|
+
{
|
|
194
|
+
target: getTarget(from, to),
|
|
195
|
+
direction,
|
|
196
|
+
from: createEvmAccount({ address: from, chainId }),
|
|
197
|
+
to: createEvmAccount({ address: to, chainId }),
|
|
198
|
+
asset: chain.nativeToken.currency,
|
|
199
|
+
amount: createBigDecimal(value, chain.nativeToken.decimals),
|
|
200
|
+
price: nativeTokenPrice,
|
|
201
|
+
},
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
case 'internal': {
|
|
205
|
+
if (transferIndex === 'any') {
|
|
206
|
+
return internalTransactions.map((transfer) => ({
|
|
207
|
+
target: getTarget(transfer.from, transfer.to ?? '0x'),
|
|
208
|
+
direction,
|
|
209
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
210
|
+
to: createEvmAccount({ address: transfer.to ?? '0x', chainId }),
|
|
211
|
+
asset: chain.nativeToken.currency,
|
|
212
|
+
amount: createBigDecimal(transfer.value, chain.nativeToken.decimals),
|
|
213
|
+
price: nativeTokenPrice,
|
|
214
|
+
}))
|
|
215
|
+
} else {
|
|
216
|
+
const transfer = internalTransactions[transferIndex]
|
|
217
|
+
return [
|
|
218
|
+
{
|
|
219
|
+
target: getTarget(transfer.from, transfer.to ?? '0x'),
|
|
220
|
+
direction,
|
|
221
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
222
|
+
to: createEvmAccount({ address: transfer.to ?? '0x', chainId }),
|
|
223
|
+
asset: chain.nativeToken.currency,
|
|
224
|
+
amount: createBigDecimal(
|
|
225
|
+
transfer.value,
|
|
226
|
+
chain.nativeToken.decimals,
|
|
227
|
+
),
|
|
228
|
+
price: nativeTokenPrice,
|
|
229
|
+
},
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const generateActionTransfersFromTokenTransferWithCondition = <
|
|
237
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
238
|
+
>(
|
|
239
|
+
chain: Chain,
|
|
240
|
+
transaction: TransactionDecoded<Price>,
|
|
241
|
+
generator: ActionTransferGeneratorFromTokenTransferWithCondition,
|
|
242
|
+
): NormalAction<ActionType, EvmAccount, Price>['transfers'][number][] => {
|
|
243
|
+
const {
|
|
244
|
+
chainId,
|
|
245
|
+
nativeTokenPrice,
|
|
246
|
+
erc20Transfers,
|
|
247
|
+
erc721Transfers,
|
|
248
|
+
erc1155Transfers,
|
|
249
|
+
internalTransactions,
|
|
250
|
+
} = transaction
|
|
251
|
+
const { token, conditions, target } = generator
|
|
252
|
+
|
|
253
|
+
const getTarget = (from: LowerHex, to: LowerHex) => {
|
|
254
|
+
switch (target) {
|
|
255
|
+
case 'from': {
|
|
256
|
+
return from
|
|
257
|
+
}
|
|
258
|
+
case 'to': {
|
|
259
|
+
return to
|
|
260
|
+
}
|
|
261
|
+
case 'none': {
|
|
262
|
+
return ''
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const getDirection = () => {
|
|
267
|
+
switch (target) {
|
|
268
|
+
case 'from': {
|
|
269
|
+
return 'out'
|
|
270
|
+
}
|
|
271
|
+
case 'to': {
|
|
272
|
+
return 'in'
|
|
273
|
+
}
|
|
274
|
+
case 'none': {
|
|
275
|
+
return 'none'
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const direction = getDirection()
|
|
280
|
+
|
|
281
|
+
switch (token) {
|
|
282
|
+
case 'erc1155': {
|
|
283
|
+
return erc1155Transfers
|
|
284
|
+
.filter((transfer) =>
|
|
285
|
+
isMatchConditions(transfer, transaction, conditions),
|
|
286
|
+
)
|
|
287
|
+
.map((transfer) => ({
|
|
288
|
+
target: getTarget(transfer.from, transfer.to),
|
|
289
|
+
direction,
|
|
290
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
291
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
292
|
+
asset: transfer.nft,
|
|
293
|
+
amount: createBigDecimal(transfer.value),
|
|
294
|
+
price: undefined as Price,
|
|
295
|
+
}))
|
|
296
|
+
}
|
|
297
|
+
case 'erc20': {
|
|
298
|
+
return erc20Transfers
|
|
299
|
+
.filter((transfer) =>
|
|
300
|
+
isMatchConditions(transfer, transaction, conditions),
|
|
301
|
+
)
|
|
302
|
+
.map((transfer) => ({
|
|
303
|
+
target: getTarget(transfer.from, transfer.to),
|
|
304
|
+
direction,
|
|
305
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
306
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
307
|
+
asset: transfer.token.currency,
|
|
308
|
+
amount: createBigDecimal(transfer.value, transfer.token.decimals),
|
|
309
|
+
price: transfer.price,
|
|
310
|
+
}))
|
|
311
|
+
}
|
|
312
|
+
case 'erc721': {
|
|
313
|
+
return erc721Transfers
|
|
314
|
+
.filter((transfer) =>
|
|
315
|
+
isMatchConditions(transfer, transaction, conditions),
|
|
316
|
+
)
|
|
317
|
+
.map((transfer) => ({
|
|
318
|
+
target: getTarget(transfer.from, transfer.to),
|
|
319
|
+
direction,
|
|
320
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
321
|
+
to: createEvmAccount({ address: transfer.to, chainId }),
|
|
322
|
+
asset: transfer.nft,
|
|
323
|
+
amount: createBigDecimal(1n),
|
|
324
|
+
price: undefined as Price,
|
|
325
|
+
}))
|
|
326
|
+
}
|
|
327
|
+
case 'internal': {
|
|
328
|
+
return internalTransactions
|
|
329
|
+
.filter((transfer) =>
|
|
330
|
+
isMatchConditions(transfer, transaction, conditions),
|
|
331
|
+
)
|
|
332
|
+
.map((transfer) => ({
|
|
333
|
+
target: getTarget(transfer.from, transfer.to ?? '0x'),
|
|
334
|
+
direction,
|
|
335
|
+
from: createEvmAccount({ address: transfer.from, chainId }),
|
|
336
|
+
to: createEvmAccount({ address: transfer.to ?? '0x', chainId }),
|
|
337
|
+
asset: chain.nativeToken.currency,
|
|
338
|
+
amount: createBigDecimal(transfer.value, chain.nativeToken.decimals),
|
|
339
|
+
price: nativeTokenPrice,
|
|
340
|
+
}))
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const isMatchConditions = <Price extends CryptoCurrencyPrice | undefined>(
|
|
346
|
+
transfer: {
|
|
347
|
+
readonly from: LowerHex
|
|
348
|
+
readonly to: LowerHex | undefined
|
|
349
|
+
},
|
|
350
|
+
transaction: TransactionDecoded<Price>,
|
|
351
|
+
conditions: readonly TokenTransferConditionAddress[],
|
|
352
|
+
): boolean => {
|
|
353
|
+
const { from, to, logs } = transaction
|
|
354
|
+
const lowerFrom = toLowerHex(from)
|
|
355
|
+
const lowerTo = toLowerHex(to ?? '0x')
|
|
356
|
+
|
|
357
|
+
return conditions.every((condition) => {
|
|
358
|
+
switch (condition.condition.type) {
|
|
359
|
+
case 'from': {
|
|
360
|
+
switch (condition.type) {
|
|
361
|
+
case 'from': {
|
|
362
|
+
return transfer.from === lowerFrom
|
|
363
|
+
}
|
|
364
|
+
case 'to': {
|
|
365
|
+
return transfer.to === lowerFrom
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return false
|
|
369
|
+
}
|
|
370
|
+
case 'to': {
|
|
371
|
+
switch (condition.type) {
|
|
372
|
+
case 'from': {
|
|
373
|
+
return transfer.from === lowerTo
|
|
374
|
+
}
|
|
375
|
+
case 'to': {
|
|
376
|
+
return transfer.to === lowerTo
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
return false
|
|
380
|
+
}
|
|
381
|
+
case 'fix-value': {
|
|
382
|
+
switch (condition.type) {
|
|
383
|
+
case 'from': {
|
|
384
|
+
return transfer.from === condition.condition.value
|
|
385
|
+
}
|
|
386
|
+
case 'to': {
|
|
387
|
+
return transfer.to === condition.condition.value
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return false
|
|
391
|
+
}
|
|
392
|
+
case 'log': {
|
|
393
|
+
const signature = condition.condition.signature
|
|
394
|
+
const indexedCount = condition.condition.indexedCount
|
|
395
|
+
const index = condition.condition.index
|
|
396
|
+
const log = logs.filter(
|
|
397
|
+
(log) =>
|
|
398
|
+
log.log.topics[0] === signature &&
|
|
399
|
+
log.log.topics.length - 1 === indexedCount,
|
|
400
|
+
)[index]
|
|
401
|
+
if (
|
|
402
|
+
log === undefined ||
|
|
403
|
+
log.type === 'LogOriginal' ||
|
|
404
|
+
log.log.args.length <= condition.condition.argIndex
|
|
405
|
+
) {
|
|
406
|
+
return false
|
|
407
|
+
}
|
|
408
|
+
const value = String(log.log.args[condition.condition.argIndex].value)
|
|
409
|
+
if (!isHex(value)) {
|
|
410
|
+
return false
|
|
411
|
+
}
|
|
412
|
+
const lowerValue = toLowerHex(value)
|
|
413
|
+
switch (condition.type) {
|
|
414
|
+
case 'from': {
|
|
415
|
+
return transfer.from === lowerValue
|
|
416
|
+
}
|
|
417
|
+
case 'to': {
|
|
418
|
+
return transfer.to === lowerValue
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
return false
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
})
|
|
425
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createAnalyzeByJsonRule } from './analyze'
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import type { ActionType } from '@0xtorch/core'
|
|
2
|
+
import type { LowerHex } from '../../types'
|
|
3
|
+
|
|
4
|
+
// normal action 変換用の mapper object
|
|
5
|
+
export type AnalyzeRule = {
|
|
6
|
+
readonly chainId: number | undefined
|
|
7
|
+
readonly from: LowerHex[] | undefined
|
|
8
|
+
readonly to: LowerHex[] | undefined
|
|
9
|
+
readonly value: 'plus' | 'zero' | undefined
|
|
10
|
+
readonly functionSignature: LowerHex
|
|
11
|
+
readonly functionInterface: string | undefined
|
|
12
|
+
readonly logsPatterns: readonly LogsPattern[]
|
|
13
|
+
readonly internalsPatterns: readonly InternalsPattern[] | undefined
|
|
14
|
+
readonly parameterMatchPatterns: readonly ParameterMatchPattern[] | undefined
|
|
15
|
+
readonly generators: readonly ActionGenerator[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
type ParameterMatchPattern = {
|
|
19
|
+
readonly base: ParameterBase
|
|
20
|
+
readonly compare: ParameterIndex
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type ParameterBase =
|
|
24
|
+
| ParameterIndexDefault
|
|
25
|
+
| ParameterIndexFunction
|
|
26
|
+
| ParameterBaseLog
|
|
27
|
+
| ParameterBaseInternal
|
|
28
|
+
|
|
29
|
+
type ParameterBaseLog = {
|
|
30
|
+
readonly type: 'log'
|
|
31
|
+
readonly signature: LowerHex
|
|
32
|
+
readonly indexedCount: number
|
|
33
|
+
readonly index: number
|
|
34
|
+
readonly argIndex: number
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type ParameterBaseInternal = {
|
|
38
|
+
readonly type: 'internal'
|
|
39
|
+
readonly index: number
|
|
40
|
+
readonly key: 'from' | 'to' | 'value'
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type ParameterIndex =
|
|
44
|
+
| ParameterIndexDefault
|
|
45
|
+
| ParameterIndexFunction
|
|
46
|
+
| ParameterIndexLog
|
|
47
|
+
| ParameterIndexInternal
|
|
48
|
+
|
|
49
|
+
type ParameterIndexDefault = {
|
|
50
|
+
readonly type: 'from' | 'to' | 'value'
|
|
51
|
+
}
|
|
52
|
+
type ParameterIndexFunction = {
|
|
53
|
+
readonly type: 'function'
|
|
54
|
+
readonly argIndex: number
|
|
55
|
+
}
|
|
56
|
+
type ParameterIndexLog = {
|
|
57
|
+
readonly type: 'log'
|
|
58
|
+
readonly signature: LowerHex
|
|
59
|
+
readonly indexedCount: number
|
|
60
|
+
readonly index: 'some' | 'every' | number
|
|
61
|
+
readonly argIndex: number
|
|
62
|
+
}
|
|
63
|
+
type ParameterIndexInternal = {
|
|
64
|
+
readonly type: 'internal'
|
|
65
|
+
readonly index: 'some' | 'every' | number
|
|
66
|
+
readonly key: 'from' | 'to' | 'value'
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type LogsPattern = LogsPatternExact | LogsPatternPartial
|
|
70
|
+
type LogsPatternExact = {
|
|
71
|
+
readonly matchType: 'exact'
|
|
72
|
+
readonly items: readonly {
|
|
73
|
+
readonly signature: LowerHex
|
|
74
|
+
readonly indexedCount: number
|
|
75
|
+
readonly args:
|
|
76
|
+
| readonly {
|
|
77
|
+
readonly type: 'to-lower-string-value'
|
|
78
|
+
readonly index: number
|
|
79
|
+
readonly value: string
|
|
80
|
+
}[]
|
|
81
|
+
| undefined
|
|
82
|
+
// TODO 別の log と同一の値か、みたいなところも理想としては条件として渡したい
|
|
83
|
+
}[]
|
|
84
|
+
}
|
|
85
|
+
type LogsPatternPartial = {
|
|
86
|
+
readonly matchType: 'partial'
|
|
87
|
+
readonly signature: LowerHex
|
|
88
|
+
readonly indexedCount: number
|
|
89
|
+
/** undefined の場合は 1つ以上の任意の数の一致する log を持つ */
|
|
90
|
+
readonly logCount: number | undefined
|
|
91
|
+
readonly args:
|
|
92
|
+
| readonly {
|
|
93
|
+
readonly type: 'to-lower-string-value'
|
|
94
|
+
readonly index: number
|
|
95
|
+
readonly value: string
|
|
96
|
+
}[]
|
|
97
|
+
| undefined
|
|
98
|
+
// TODO 別の log と同一の値か、みたいなところも理想としては条件として渡したい
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
type InternalsPattern = InternalsPatternPartial
|
|
102
|
+
|
|
103
|
+
type InternalsPatternPartial = {
|
|
104
|
+
readonly type: 'partial'
|
|
105
|
+
readonly from: LowerHex | undefined
|
|
106
|
+
readonly to: LowerHex | undefined
|
|
107
|
+
readonly value: 'plus' | 'zero' | undefined
|
|
108
|
+
/** undefined の場合は 1つ以上の任意の数の一致する internal transaction を持つ */
|
|
109
|
+
readonly count: number | undefined
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// 一旦 token transfer の index 指定で生成できるようにするが、後から他の方法でも生成できるようにする
|
|
113
|
+
type ActionGenerator =
|
|
114
|
+
| ActionGeneratorAnyTokenTransfer
|
|
115
|
+
| ActionGeneratorAnyLog
|
|
116
|
+
| ActionGeneratorSpecificTokenTransfer
|
|
117
|
+
|
|
118
|
+
/** 指定した token type の 全ての token transfer を個別に指定した action として生成する generator */
|
|
119
|
+
export type ActionGeneratorAnyTokenTransfer = {
|
|
120
|
+
readonly type: 'any-token-transfer'
|
|
121
|
+
readonly token: 'erc20' | 'erc721' | 'erc1155'
|
|
122
|
+
readonly action: ActionType
|
|
123
|
+
readonly comment: string | undefined
|
|
124
|
+
readonly target: 'from' | 'to' | 'none'
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** 指定した全ての log を個別に指定した action として生成する generator */
|
|
128
|
+
export type ActionGeneratorAnyLog = {
|
|
129
|
+
readonly type: 'any-log'
|
|
130
|
+
readonly action: ActionType
|
|
131
|
+
readonly comment: string | undefined
|
|
132
|
+
readonly target: 'from' | 'to' | 'none'
|
|
133
|
+
readonly signature: LowerHex
|
|
134
|
+
readonly indexedCount: number
|
|
135
|
+
readonly token: ActionGeneratorAnyLogToken
|
|
136
|
+
readonly from: ActionGeneratorAnyLogAddress
|
|
137
|
+
readonly to: ActionGeneratorAnyLogAddress
|
|
138
|
+
readonly amount: ActionGeneratorAnyLogAmount
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
type ActionGeneratorAnyLogToken = ActionGeneratorAnyLogTokenNative
|
|
142
|
+
|
|
143
|
+
type ActionGeneratorAnyLogTokenNative = {
|
|
144
|
+
readonly token: 'native'
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export type ActionGeneratorAnyLogAddress =
|
|
148
|
+
| ActionGeneratorAnyLogAddressDefault
|
|
149
|
+
| ActionGeneratorAnyLogAddressFixValue
|
|
150
|
+
| ActionGeneratorAnyLogAddressTarget
|
|
151
|
+
| ActionGeneratorAnyLogAddressLog
|
|
152
|
+
|
|
153
|
+
type ActionGeneratorAnyLogAddressDefault = {
|
|
154
|
+
readonly type: 'from' | 'to'
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
type ActionGeneratorAnyLogAddressFixValue = {
|
|
158
|
+
readonly type: 'fix-value'
|
|
159
|
+
readonly value: LowerHex
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
type ActionGeneratorAnyLogAddressTarget = {
|
|
163
|
+
readonly type: 'target'
|
|
164
|
+
readonly argIndex: number
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
type ActionGeneratorAnyLogAddressLog = {
|
|
168
|
+
readonly type: 'log'
|
|
169
|
+
readonly signature: LowerHex
|
|
170
|
+
readonly indexedCount: number
|
|
171
|
+
readonly index: number
|
|
172
|
+
readonly argIndex: number
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export type ActionGeneratorAnyLogAmount =
|
|
176
|
+
| ActionGeneratorAnyLogAmountDefault
|
|
177
|
+
| ActionGeneratorAnyLogAmountFixValue
|
|
178
|
+
| ActionGeneratorAnyLogAmountTarget
|
|
179
|
+
| ActionGeneratorAnyLogAmountLog
|
|
180
|
+
|
|
181
|
+
type ActionGeneratorAnyLogAmountDefault = {
|
|
182
|
+
readonly type: 'value'
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
type ActionGeneratorAnyLogAmountFixValue = {
|
|
186
|
+
readonly type: 'fix-value'
|
|
187
|
+
readonly value: bigint
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
type ActionGeneratorAnyLogAmountTarget = {
|
|
191
|
+
readonly type: 'target'
|
|
192
|
+
readonly argIndex: number
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
type ActionGeneratorAnyLogAmountLog = {
|
|
196
|
+
readonly type: 'log'
|
|
197
|
+
readonly signature: LowerHex
|
|
198
|
+
readonly indexedCount: number
|
|
199
|
+
readonly index: number
|
|
200
|
+
readonly argIndex: number
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** 個別の token transfer 毎に指定した action を生成する generator */
|
|
204
|
+
export type ActionGeneratorSpecificTokenTransfer = {
|
|
205
|
+
readonly type: 'specific-token-transfer'
|
|
206
|
+
readonly action: ActionType
|
|
207
|
+
readonly comment: string | undefined
|
|
208
|
+
readonly transfers: readonly ActionTransferGenerator[]
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
type ActionTransferGenerator =
|
|
212
|
+
| ActionTransferGeneratorFromTokenTransfer
|
|
213
|
+
| ActionTransferGeneratorFromTokenTransferWithCondition
|
|
214
|
+
|
|
215
|
+
export type ActionTransferGeneratorFromTokenTransfer = {
|
|
216
|
+
readonly type: 'token-transfer'
|
|
217
|
+
readonly token: 'erc20' | 'erc721' | 'erc1155' | 'value' | 'internal'
|
|
218
|
+
readonly transferIndex: 'any' | number
|
|
219
|
+
readonly target: 'from' | 'to' | 'none'
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export type ActionTransferGeneratorFromTokenTransferWithCondition = {
|
|
223
|
+
readonly type: 'token-transfer-with-condition'
|
|
224
|
+
readonly token: 'erc20' | 'erc721' | 'erc1155' | 'internal'
|
|
225
|
+
readonly conditions: readonly TokenTransferCondition[]
|
|
226
|
+
readonly target: 'from' | 'to' | 'none'
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
type TokenTransferCondition = TokenTransferConditionAddress
|
|
230
|
+
|
|
231
|
+
export type TokenTransferConditionAddress = {
|
|
232
|
+
readonly type: 'from' | 'to'
|
|
233
|
+
readonly condition: ConditionAddress
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
type ConditionAddress =
|
|
237
|
+
| ActionGeneratorAnyLogAddressDefault
|
|
238
|
+
| ActionGeneratorAnyLogAddressFixValue
|
|
239
|
+
| ActionGeneratorAnyLogAddressLog
|