@0xtorch/evm 0.0.59 → 0.0.61
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/_cjs/analyzer/analyze.js +23 -7
- package/_cjs/analyzer/analyze.js.map +1 -1
- package/_cjs/analyzer/index.js +3 -1
- package/_cjs/analyzer/index.js.map +1 -1
- package/_cjs/analyzer/json/analyze.js +34 -38
- package/_cjs/analyzer/json/analyze.js.map +1 -1
- package/_cjs/analyzer/json/components/comment.js +2 -2
- package/_cjs/analyzer/json/components/comment.js.map +1 -1
- package/_cjs/analyzer/json/components/erc1155.js +4 -6
- package/_cjs/analyzer/json/components/erc1155.js.map +1 -1
- package/_cjs/analyzer/json/components/erc20.js +4 -6
- package/_cjs/analyzer/json/components/erc20.js.map +1 -1
- package/_cjs/analyzer/json/components/erc721.js +3 -5
- package/_cjs/analyzer/json/components/erc721.js.map +1 -1
- package/_cjs/analyzer/json/components/id.js +2 -2
- package/_cjs/analyzer/json/components/id.js.map +1 -1
- package/_cjs/analyzer/json/components/internal.js +4 -6
- package/_cjs/analyzer/json/components/internal.js.map +1 -1
- package/_cjs/analyzer/json/components/logArgument.js +15 -17
- package/_cjs/analyzer/json/components/logArgument.js.map +1 -1
- package/_cjs/analyzer/json/components/transfer.js +4 -6
- package/_cjs/analyzer/json/components/transfer.js.map +1 -1
- package/_cjs/analyzer/json/condition/address.js +1 -1
- package/_cjs/analyzer/json/condition/address.js.map +1 -1
- package/_cjs/analyzer/json/condition/value.js +5 -7
- package/_cjs/analyzer/json/condition/value.js.map +1 -1
- package/_cjs/analyzer/json/generator.js +1 -1
- package/_cjs/analyzer/json/generator.js.map +1 -1
- package/_cjs/analyzer/json/schemas/generator.js +6 -2
- package/_cjs/analyzer/json/schemas/generator.js.map +1 -1
- package/_cjs/analyzer/seaport/analyze.js +82 -106
- package/_cjs/analyzer/seaport/analyze.js.map +1 -1
- package/_cjs/analyzer/swap/analyze.js +5 -7
- package/_cjs/analyzer/swap/analyze.js.map +1 -1
- package/_cjs/analyzer/swap/traderJoeLBPairSwap.js.map +1 -1
- package/_cjs/analyzer/transfer/analyze.js +11 -98
- package/_cjs/analyzer/transfer/analyze.js.map +1 -1
- package/_cjs/analyzer/utils/createTransfersByTransaction.js +52 -0
- package/_cjs/analyzer/utils/createTransfersByTransaction.js.map +1 -0
- package/_cjs/clients/externals/viem/createViemInstance.js +2 -2
- package/_cjs/clients/externals/viem/createViemInstance.js.map +1 -1
- package/_cjs/clients/externals/viem/middleware.js +3 -6
- package/_cjs/clients/externals/viem/middleware.js.map +1 -1
- package/_cjs/decoder/decode.js +3 -3
- package/_cjs/decoder/decode.js.map +1 -1
- package/_cjs/decoder/parseErc1155TransferSingleLogs.js +2 -2
- package/_cjs/decoder/parseErc1155TransferSingleLogs.js.map +1 -1
- package/_cjs/decoder/parseErc20TransferLogs.js +2 -2
- package/_cjs/decoder/parseErc20TransferLogs.js.map +1 -1
- package/_cjs/decoder/parseErc721TransferLogs.js +3 -3
- package/_cjs/decoder/parseErc721TransferLogs.js.map +1 -1
- package/_cjs/decoder/tests.js +1 -1
- package/_cjs/decoder/tests.js.map +1 -1
- package/_cjs/explorers/externals/blockscout/getInternalTransactionsByAddress.js +1 -1
- package/_cjs/explorers/externals/blockscout/getInternalTransactionsByAddress.js.map +1 -1
- package/_cjs/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.js +1 -1
- package/_cjs/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.js.map +1 -1
- package/_cjs/explorers/externals/etherscan/getInternalTransactionsByAddress.js +1 -1
- package/_cjs/explorers/externals/etherscan/getInternalTransactionsByAddress.js.map +1 -1
- package/_cjs/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.js +1 -1
- package/_cjs/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.js.map +1 -1
- package/_cjs/index.js +4 -3
- package/_cjs/index.js.map +1 -1
- package/_cjs/tests.js +6 -2
- package/_cjs/tests.js.map +1 -1
- package/_esm/analyzer/analyze.js +25 -8
- package/_esm/analyzer/analyze.js.map +1 -1
- package/_esm/analyzer/axieMarketplace/analyze.js +1 -1
- package/_esm/analyzer/axieMarketplace/analyze.js.map +1 -1
- package/_esm/analyzer/index.js +1 -0
- package/_esm/analyzer/index.js.map +1 -1
- package/_esm/analyzer/json/analyze.js +34 -38
- package/_esm/analyzer/json/analyze.js.map +1 -1
- package/_esm/analyzer/json/components/comment.js +2 -2
- package/_esm/analyzer/json/components/comment.js.map +1 -1
- package/_esm/analyzer/json/components/erc1155.js +4 -6
- package/_esm/analyzer/json/components/erc1155.js.map +1 -1
- package/_esm/analyzer/json/components/erc20.js +4 -6
- package/_esm/analyzer/json/components/erc20.js.map +1 -1
- package/_esm/analyzer/json/components/erc721.js +3 -5
- package/_esm/analyzer/json/components/erc721.js.map +1 -1
- package/_esm/analyzer/json/components/id.js +2 -2
- package/_esm/analyzer/json/components/id.js.map +1 -1
- package/_esm/analyzer/json/components/internal.js +4 -6
- package/_esm/analyzer/json/components/internal.js.map +1 -1
- package/_esm/analyzer/json/components/logArgument.js +15 -17
- package/_esm/analyzer/json/components/logArgument.js.map +1 -1
- package/_esm/analyzer/json/components/targetAsset.js +1 -1
- package/_esm/analyzer/json/components/targetAsset.js.map +1 -1
- package/_esm/analyzer/json/components/transfer.js +4 -6
- package/_esm/analyzer/json/components/transfer.js.map +1 -1
- package/_esm/analyzer/json/condition/address.js +1 -1
- package/_esm/analyzer/json/condition/address.js.map +1 -1
- package/_esm/analyzer/json/condition/value.js +5 -7
- package/_esm/analyzer/json/condition/value.js.map +1 -1
- package/_esm/analyzer/json/generator.js +1 -1
- package/_esm/analyzer/json/generator.js.map +1 -1
- package/_esm/analyzer/json/schemas/generator.js +6 -2
- package/_esm/analyzer/json/schemas/generator.js.map +1 -1
- package/_esm/analyzer/seaport/analyze.js +92 -116
- package/_esm/analyzer/seaport/analyze.js.map +1 -1
- package/_esm/analyzer/spam/analyze.js +1 -1
- package/_esm/analyzer/spam/analyze.js.map +1 -1
- package/_esm/analyzer/swap/analyze.js +5 -7
- package/_esm/analyzer/swap/analyze.js.map +1 -1
- package/_esm/analyzer/swap/traderJoeLBPairSwap.js +0 -1
- package/_esm/analyzer/swap/traderJoeLBPairSwap.js.map +1 -1
- package/_esm/analyzer/transfer/analyze.js +11 -98
- package/_esm/analyzer/transfer/analyze.js.map +1 -1
- package/_esm/analyzer/utils/createTransfersByTransaction.js +51 -0
- package/_esm/analyzer/utils/createTransfersByTransaction.js.map +1 -0
- package/_esm/clients/externals/viem/createViemInstance.js +3 -3
- package/_esm/clients/externals/viem/createViemInstance.js.map +1 -1
- package/_esm/clients/externals/viem/middleware.js +4 -7
- package/_esm/clients/externals/viem/middleware.js.map +1 -1
- package/_esm/decoder/decode.js +6 -4
- package/_esm/decoder/decode.js.map +1 -1
- package/_esm/decoder/parseErc1155TransferSingleLogs.js +2 -2
- package/_esm/decoder/parseErc1155TransferSingleLogs.js.map +1 -1
- package/_esm/decoder/parseErc20TransferLogs.js +2 -2
- package/_esm/decoder/parseErc20TransferLogs.js.map +1 -1
- package/_esm/decoder/parseErc721TransferLogs.js +3 -3
- package/_esm/decoder/parseErc721TransferLogs.js.map +1 -1
- package/_esm/decoder/tests.js +1 -2
- package/_esm/decoder/tests.js.map +1 -1
- package/_esm/explorers/definitions/etherscan.js +1 -1
- package/_esm/explorers/definitions/etherscan.js.map +1 -1
- package/_esm/explorers/externals/blockscout/getInternalTransactionsByAddress.js +1 -1
- package/_esm/explorers/externals/blockscout/getInternalTransactionsByAddress.js.map +1 -1
- package/_esm/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.js +1 -1
- package/_esm/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.js.map +1 -1
- package/_esm/explorers/externals/etherscan/getInternalTransactionsByAddress.js +1 -1
- package/_esm/explorers/externals/etherscan/getInternalTransactionsByAddress.js.map +1 -1
- package/_esm/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.js +1 -1
- package/_esm/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.js.map +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/tests.js +5 -1
- package/_esm/tests.js.map +1 -1
- package/_types/analyzer/analyze.d.ts +2 -10
- package/_types/analyzer/analyze.d.ts.map +1 -1
- package/_types/analyzer/analyzer.d.ts +1 -9
- package/_types/analyzer/analyzer.d.ts.map +1 -1
- package/_types/analyzer/axieMarketplace/analyze.d.ts +2 -9
- package/_types/analyzer/axieMarketplace/analyze.d.ts.map +1 -1
- package/_types/analyzer/fail/analyze.d.ts +2 -9
- package/_types/analyzer/fail/analyze.d.ts.map +1 -1
- package/_types/analyzer/gasFee/analyze.d.ts +2 -9
- package/_types/analyzer/gasFee/analyze.d.ts.map +1 -1
- package/_types/analyzer/index.d.ts +1 -0
- package/_types/analyzer/index.d.ts.map +1 -1
- package/_types/analyzer/json/analyze.d.ts +2 -9
- package/_types/analyzer/json/analyze.d.ts.map +1 -1
- package/_types/analyzer/json/components/comment.d.ts +1 -9
- package/_types/analyzer/json/components/comment.d.ts.map +1 -1
- package/_types/analyzer/json/components/erc1155.d.ts +2 -18
- package/_types/analyzer/json/components/erc1155.d.ts.map +1 -1
- package/_types/analyzer/json/components/erc1155Raw.d.ts +1 -9
- package/_types/analyzer/json/components/erc1155Raw.d.ts.map +1 -1
- package/_types/analyzer/json/components/erc20.d.ts +2 -18
- package/_types/analyzer/json/components/erc20.d.ts.map +1 -1
- package/_types/analyzer/json/components/erc20Raw.d.ts +1 -9
- package/_types/analyzer/json/components/erc20Raw.d.ts.map +1 -1
- package/_types/analyzer/json/components/erc721.d.ts +2 -18
- package/_types/analyzer/json/components/erc721.d.ts.map +1 -1
- package/_types/analyzer/json/components/erc721Raw.d.ts +1 -9
- package/_types/analyzer/json/components/erc721Raw.d.ts.map +1 -1
- package/_types/analyzer/json/components/id.d.ts +1 -9
- package/_types/analyzer/json/components/id.d.ts.map +1 -1
- package/_types/analyzer/json/components/internal.d.ts +2 -18
- package/_types/analyzer/json/components/internal.d.ts.map +1 -1
- package/_types/analyzer/json/components/internalRaw.d.ts +1 -9
- package/_types/analyzer/json/components/internalRaw.d.ts.map +1 -1
- package/_types/analyzer/json/components/logArgument.d.ts +2 -18
- package/_types/analyzer/json/components/logArgument.d.ts.map +1 -1
- package/_types/analyzer/json/components/logArgumentRaw.d.ts +1 -9
- package/_types/analyzer/json/components/logArgumentRaw.d.ts.map +1 -1
- package/_types/analyzer/json/components/targetAsset.d.ts +1 -9
- package/_types/analyzer/json/components/targetAsset.d.ts.map +1 -1
- package/_types/analyzer/json/components/transfer.d.ts +1 -9
- package/_types/analyzer/json/components/transfer.d.ts.map +1 -1
- package/_types/analyzer/json/condition/address.d.ts +1 -9
- package/_types/analyzer/json/condition/address.d.ts.map +1 -1
- package/_types/analyzer/json/condition/argumentValue.d.ts +1 -9
- package/_types/analyzer/json/condition/argumentValue.d.ts.map +1 -1
- package/_types/analyzer/json/condition/value.d.ts +1 -9
- package/_types/analyzer/json/condition/value.d.ts.map +1 -1
- package/_types/analyzer/json/generator.d.ts +1 -9
- package/_types/analyzer/json/generator.d.ts.map +1 -1
- package/_types/analyzer/json/schemas/generator.d.ts.map +1 -1
- package/_types/analyzer/json/types.d.ts +2 -2
- package/_types/analyzer/json/types.d.ts.map +1 -1
- package/_types/analyzer/parsers/transfer.d.ts +1 -1
- package/_types/analyzer/parsers/transfer.d.ts.map +1 -1
- package/_types/analyzer/seaport/analyze.d.ts +2 -9
- package/_types/analyzer/seaport/analyze.d.ts.map +1 -1
- package/_types/analyzer/spam/analyze.d.ts +2 -9
- package/_types/analyzer/spam/analyze.d.ts.map +1 -1
- package/_types/analyzer/swap/analyze.d.ts +2 -9
- package/_types/analyzer/swap/analyze.d.ts.map +1 -1
- package/_types/analyzer/swap/traderJoeLBPairSwap.d.ts.map +1 -1
- package/_types/analyzer/transfer/analyze.d.ts +2 -9
- package/_types/analyzer/transfer/analyze.d.ts.map +1 -1
- package/_types/analyzer/utils/createTransfersByTransaction.d.ts +5 -0
- package/_types/analyzer/utils/createTransfersByTransaction.d.ts.map +1 -0
- package/_types/chains/definitions/arbitrumOne.d.ts.map +1 -1
- package/_types/chains/definitions/astar.d.ts.map +1 -1
- package/_types/chains/definitions/avalancheC.d.ts.map +1 -1
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/bsc.d.ts.map +1 -1
- package/_types/chains/definitions/defineChain.d.ts.map +1 -1
- package/_types/chains/definitions/ethereum.d.ts.map +1 -1
- package/_types/chains/definitions/fantom.d.ts.map +1 -1
- package/_types/chains/definitions/linea.d.ts.map +1 -1
- package/_types/chains/definitions/mantaPacific.d.ts.map +1 -1
- package/_types/chains/definitions/mantle.d.ts.map +1 -1
- package/_types/chains/definitions/metis.d.ts.map +1 -1
- package/_types/chains/definitions/moonbeam.d.ts.map +1 -1
- package/_types/chains/definitions/moonriver.d.ts.map +1 -1
- package/_types/chains/definitions/oasys.d.ts.map +1 -1
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/polygonPos.d.ts.map +1 -1
- package/_types/chains/definitions/ronin.d.ts.map +1 -1
- package/_types/chains/externals/defillama/getBlockOfTimestamp.d.ts.map +1 -1
- package/_types/clients/definitions/defineClient.d.ts.map +1 -1
- package/_types/clients/definitions/viemClient.d.ts +14 -14
- package/_types/clients/definitions/viemClient.d.ts.map +1 -1
- package/_types/clients/externals/viem/createViemInstance.d.ts +3 -3
- package/_types/clients/externals/viem/createViemInstance.d.ts.map +1 -1
- package/_types/clients/externals/viem/estimateFeesPerGas.d.ts.map +1 -1
- package/_types/clients/externals/viem/getBalance.d.ts.map +1 -1
- package/_types/clients/externals/viem/getBlock.d.ts +1 -1
- package/_types/clients/externals/viem/getBlock.d.ts.map +1 -1
- package/_types/clients/externals/viem/getBlockNumber.d.ts.map +1 -1
- package/_types/clients/externals/viem/getEventLogs.d.ts.map +1 -1
- package/_types/clients/externals/viem/getTransaction.d.ts.map +1 -1
- package/_types/clients/externals/viem/getTransactionCount.d.ts.map +1 -1
- package/_types/clients/externals/viem/getTransactionReceipt.d.ts.map +1 -1
- package/_types/clients/externals/viem/middleware.d.ts.map +1 -1
- package/_types/clients/externals/viem/multicall.d.ts.map +1 -1
- package/_types/clients/externals/viem/readContract.d.ts.map +1 -1
- package/_types/creates/createEvmAccount.d.ts +1 -1
- package/_types/creates/createEvmAccount.d.ts.map +1 -1
- package/_types/decoder/decode.d.ts.map +1 -1
- package/_types/decoder/parseErc1155TransferSingleLogs.d.ts.map +1 -1
- package/_types/decoder/parseErc20TransferLogs.d.ts.map +1 -1
- package/_types/decoder/parseErc721TransferLogs.d.ts.map +1 -1
- package/_types/decoder/tests.d.ts +2 -39
- package/_types/decoder/tests.d.ts.map +1 -1
- package/_types/explorers/definitions/blockscout.d.ts +34 -79
- package/_types/explorers/definitions/blockscout.d.ts.map +1 -1
- package/_types/explorers/definitions/defineExplorer.d.ts.map +1 -1
- package/_types/explorers/definitions/etherscan.d.ts +34 -79
- package/_types/explorers/definitions/etherscan.d.ts.map +1 -1
- package/_types/explorers/definitions/roninExplorer.d.ts +34 -79
- package/_types/explorers/definitions/roninExplorer.d.ts.map +1 -1
- package/_types/explorers/definitions/routescan.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getBlockNumberOfTimestamp.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getContractByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getContractCreations.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getEventLogsByAddressAndTopics.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getInternalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getNormalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getTokenTransfersByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/middleware.d.ts.map +1 -1
- package/_types/explorers/externals/defillama/getBlockNumberOfTimestamp.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getBlockNumberOfTimestamp.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getContractByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getContractCreations.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getErc1155TokenTransfersByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getErc20TokenTransfersByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getErc721TokenTransfersByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getEventLogsByAddressAndTopics.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getInternalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/getNormalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/etherscan/middleware.d.ts.map +1 -1
- package/_types/explorers/externals/roninExplorer/getInternalTransactionByHash.d.ts.map +1 -1
- package/_types/explorers/externals/roninExplorer/getNormalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/roninExplorer/getTokenTransfersByAddress.d.ts.map +1 -1
- package/_types/explorers/externals/roninExplorer/middleware.d.ts.map +1 -1
- package/_types/getContractAbi.d.ts.map +1 -1
- package/_types/getTransactionDetail.d.ts.map +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/tests.d.ts +5 -1
- package/_types/tests.d.ts.map +1 -1
- package/_types/types/hex.d.ts +1 -1
- package/_types/types/hex.d.ts.map +1 -1
- package/_types/types/transaction.d.ts +1 -1
- package/_types/types/transaction.d.ts.map +1 -1
- package/_types/utils/create.d.ts +3 -3
- package/_types/utils/create.d.ts.map +1 -1
- package/_types/utils/types.d.ts.map +1 -1
- package/analyzer/analyze.ts +32 -8
- package/analyzer/axieMarketplace/analyze.ts +2 -2
- package/analyzer/index.ts +1 -0
- package/analyzer/json/analyze.ts +37 -39
- package/analyzer/json/components/comment.ts +4 -2
- package/analyzer/json/components/erc1155.ts +6 -6
- package/analyzer/json/components/erc20.ts +6 -6
- package/analyzer/json/components/erc721.ts +4 -5
- package/analyzer/json/components/id.ts +4 -2
- package/analyzer/json/components/internal.ts +6 -6
- package/analyzer/json/components/logArgument.ts +16 -17
- package/analyzer/json/components/targetAsset.ts +1 -1
- package/analyzer/json/components/transfer.ts +6 -5
- package/analyzer/json/condition/address.ts +1 -1
- package/analyzer/json/condition/value.ts +8 -6
- package/analyzer/json/generator.ts +2 -2
- package/analyzer/json/schemas/generator.ts +6 -2
- package/analyzer/json/types.ts +3 -3
- package/analyzer/parsers/transfer.ts +1 -1
- package/analyzer/seaport/analyze.ts +136 -137
- package/analyzer/spam/analyze.ts +1 -1
- package/analyzer/swap/analyze.ts +6 -6
- package/analyzer/swap/traderJoeLBPairSwap.ts +0 -1
- package/analyzer/transfer/analyze.ts +11 -116
- package/analyzer/utils/createTransfersByTransaction.ts +89 -0
- package/clients/externals/viem/createViemInstance.ts +4 -3
- package/clients/externals/viem/middleware.ts +6 -7
- package/decoder/decode.ts +7 -5
- package/decoder/parseErc1155TransferSingleLogs.ts +3 -3
- package/decoder/parseErc20TransferLogs.ts +2 -2
- package/decoder/parseErc721TransferLogs.ts +3 -3
- package/decoder/tests.ts +2 -2
- package/explorers/definitions/etherscan.ts +1 -1
- package/explorers/externals/blockscout/getInternalTransactionsByAddress.ts +1 -1
- package/explorers/externals/blockscout/getInternalTransactionsByTransactionHash.ts +1 -1
- package/explorers/externals/etherscan/getInternalTransactionsByAddress.ts +1 -1
- package/explorers/externals/etherscan/getInternalTransactionsByTransactionHash.ts +1 -1
- package/index.ts +1 -0
- package/package.json +3 -5
- package/tests.ts +9 -1
- package/types/transaction.ts +1 -1
- package/utils/create.ts +1 -1
- package/utils/types.ts +0 -1
package/analyzer/json/analyze.ts
CHANGED
|
@@ -455,31 +455,30 @@ const getParameterCompareValues = <
|
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
case 'to': {
|
|
471
|
-
return internal.to === undefined
|
|
472
|
-
? undefined
|
|
473
|
-
: {
|
|
474
|
-
values: [internal.to],
|
|
475
|
-
type: 'every',
|
|
476
|
-
}
|
|
458
|
+
}
|
|
459
|
+
if (transaction.internalTransactions.length <= compare.index) {
|
|
460
|
+
return undefined
|
|
461
|
+
}
|
|
462
|
+
const internal = transaction.internalTransactions[compare.index]
|
|
463
|
+
switch (compare.key) {
|
|
464
|
+
case 'from': {
|
|
465
|
+
return {
|
|
466
|
+
values: [internal.from],
|
|
467
|
+
type: 'every',
|
|
477
468
|
}
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
469
|
+
}
|
|
470
|
+
case 'to': {
|
|
471
|
+
return internal.to === undefined
|
|
472
|
+
? undefined
|
|
473
|
+
: {
|
|
474
|
+
values: [internal.to],
|
|
475
|
+
type: 'every',
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
case 'value': {
|
|
479
|
+
return {
|
|
480
|
+
values: [internal.value.toString()],
|
|
481
|
+
type: 'every',
|
|
483
482
|
}
|
|
484
483
|
}
|
|
485
484
|
}
|
|
@@ -511,21 +510,20 @@ const getParameterCompareValues = <
|
|
|
511
510
|
values: values as string[],
|
|
512
511
|
type: compare.index,
|
|
513
512
|
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
}
|
|
513
|
+
}
|
|
514
|
+
if (targetLogs.length <= compare.index) {
|
|
515
|
+
return undefined
|
|
516
|
+
}
|
|
517
|
+
const log = targetLogs[compare.index]
|
|
518
|
+
if (log.type !== 'decoded') {
|
|
519
|
+
return undefined
|
|
520
|
+
}
|
|
521
|
+
if (log.log.args.length <= compare.argIndex) {
|
|
522
|
+
return undefined
|
|
523
|
+
}
|
|
524
|
+
return {
|
|
525
|
+
values: [String(log.log.args[compare.argIndex].value).toLowerCase()],
|
|
526
|
+
type: 'every',
|
|
529
527
|
}
|
|
530
528
|
}
|
|
531
529
|
}
|
|
@@ -24,9 +24,11 @@ export const createCommentByCommentComponent = <
|
|
|
24
24
|
}: CreateCommentByCommentComponentParameters<Price>): string => {
|
|
25
25
|
if (typeof component === 'string') {
|
|
26
26
|
return component
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
|
+
if (typeof component === 'number') {
|
|
28
29
|
return component.toString()
|
|
29
|
-
}
|
|
30
|
+
}
|
|
31
|
+
if (typeof component === 'bigint') {
|
|
30
32
|
return component.toString()
|
|
31
33
|
}
|
|
32
34
|
switch (component.type) {
|
|
@@ -40,12 +40,11 @@ export const getErc1155Component = <
|
|
|
40
40
|
)
|
|
41
41
|
if (component.index === 'any') {
|
|
42
42
|
return filteredTransfers
|
|
43
|
-
} else {
|
|
44
|
-
if (filteredTransfers.length <= component.index) {
|
|
45
|
-
throw new Error('filteredTransfers.length <= component.index')
|
|
46
|
-
}
|
|
47
|
-
return [filteredTransfers[component.index]]
|
|
48
43
|
}
|
|
44
|
+
if (filteredTransfers.length <= component.index) {
|
|
45
|
+
throw new Error('filteredTransfers.length <= component.index')
|
|
46
|
+
}
|
|
47
|
+
return [filteredTransfers[component.index]]
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
type IsMatchErc1155ComponentParameters<
|
|
@@ -124,7 +123,8 @@ export const isMatchErc1155Component = <
|
|
|
124
123
|
})
|
|
125
124
|
if (value === 'plus' && transfer.value <= 0) {
|
|
126
125
|
return false
|
|
127
|
-
}
|
|
126
|
+
}
|
|
127
|
+
if (value !== 'plus' && value !== transfer.value) {
|
|
128
128
|
return false
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -40,12 +40,11 @@ export const getErc20Component = <
|
|
|
40
40
|
)
|
|
41
41
|
if (component.index === 'any') {
|
|
42
42
|
return filteredTransfers
|
|
43
|
-
} else {
|
|
44
|
-
if (filteredTransfers.length <= component.index) {
|
|
45
|
-
throw new Error('filteredTransfers.length <= condition.index')
|
|
46
|
-
}
|
|
47
|
-
return [filteredTransfers[component.index]]
|
|
48
43
|
}
|
|
44
|
+
if (filteredTransfers.length <= component.index) {
|
|
45
|
+
throw new Error('filteredTransfers.length <= condition.index')
|
|
46
|
+
}
|
|
47
|
+
return [filteredTransfers[component.index]]
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
type IsMatchErc20ComponentParameters<
|
|
@@ -121,7 +120,8 @@ export const isMatchErc20Component = <
|
|
|
121
120
|
})
|
|
122
121
|
if (value === 'plus' && transfer.value <= 0) {
|
|
123
122
|
return false
|
|
124
|
-
}
|
|
123
|
+
}
|
|
124
|
+
if (value !== 'plus' && value !== transfer.value) {
|
|
125
125
|
return false
|
|
126
126
|
}
|
|
127
127
|
}
|
|
@@ -37,12 +37,11 @@ export const getErc721Component = <
|
|
|
37
37
|
)
|
|
38
38
|
if (component.index === 'any') {
|
|
39
39
|
return filteredTransfers
|
|
40
|
-
} else {
|
|
41
|
-
if (filteredTransfers.length <= component.index) {
|
|
42
|
-
throw new Error('filteredTransfers.length <= component.index')
|
|
43
|
-
}
|
|
44
|
-
return [filteredTransfers[component.index]]
|
|
45
40
|
}
|
|
41
|
+
if (filteredTransfers.length <= component.index) {
|
|
42
|
+
throw new Error('filteredTransfers.length <= component.index')
|
|
43
|
+
}
|
|
44
|
+
return [filteredTransfers[component.index]]
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
type IsMatchErc721ComponentParameters<
|
|
@@ -24,9 +24,11 @@ export const createIdByIdComponent = <
|
|
|
24
24
|
}: CreateIdByIdComponentParameters<Price>): string => {
|
|
25
25
|
if (typeof component === 'string') {
|
|
26
26
|
return component
|
|
27
|
-
}
|
|
27
|
+
}
|
|
28
|
+
if (typeof component === 'number') {
|
|
28
29
|
return component.toString()
|
|
29
|
-
}
|
|
30
|
+
}
|
|
31
|
+
if (typeof component === 'bigint') {
|
|
30
32
|
return component.toString()
|
|
31
33
|
}
|
|
32
34
|
switch (component.type) {
|
|
@@ -42,12 +42,11 @@ export const getInternalComponent = <
|
|
|
42
42
|
)
|
|
43
43
|
if (component.index === 'any') {
|
|
44
44
|
return filteredInternals
|
|
45
|
-
} else {
|
|
46
|
-
if (filteredInternals.length <= component.index) {
|
|
47
|
-
throw new Error('filteredInternals.length <= component.index')
|
|
48
|
-
}
|
|
49
|
-
return [filteredInternals[component.index]]
|
|
50
45
|
}
|
|
46
|
+
if (filteredInternals.length <= component.index) {
|
|
47
|
+
throw new Error('filteredInternals.length <= component.index')
|
|
48
|
+
}
|
|
49
|
+
return [filteredInternals[component.index]]
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
type IsMatchInternalComponentParameters<
|
|
@@ -109,7 +108,8 @@ export const isMatchInternalComponent = <
|
|
|
109
108
|
})
|
|
110
109
|
if (value === 'plus' && internal.value <= 0) {
|
|
111
110
|
return false
|
|
112
|
-
}
|
|
111
|
+
}
|
|
112
|
+
if (value !== 'plus' && value !== internal.value) {
|
|
113
113
|
return false
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -43,26 +43,25 @@ export const getLogArgumentComponent = <
|
|
|
43
43
|
}
|
|
44
44
|
return log.log.args[component.argIndex].value
|
|
45
45
|
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
46
|
+
}
|
|
47
|
+
if (filteredLogs.length <= component.index) {
|
|
48
|
+
throw new Error('filteredLogs.length <= condition.index')
|
|
49
|
+
}
|
|
50
|
+
const log = filteredLogs[component.index]
|
|
51
|
+
if (log.type !== 'decoded') {
|
|
52
|
+
throw new Error('log is not decoded')
|
|
53
|
+
}
|
|
54
|
+
if (typeof component.argIndex === 'string') {
|
|
55
|
+
switch (component.argIndex) {
|
|
56
|
+
case 'address': {
|
|
57
|
+
return [log.log.address]
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
|
-
if (log.log.args.length <= component.argIndex) {
|
|
62
|
-
throw new Error('log.log.args.length <= condition.argIndex')
|
|
63
|
-
}
|
|
64
|
-
return [log.log.args[component.argIndex].value]
|
|
65
60
|
}
|
|
61
|
+
if (log.log.args.length <= component.argIndex) {
|
|
62
|
+
throw new Error('log.log.args.length <= condition.argIndex')
|
|
63
|
+
}
|
|
64
|
+
return [log.log.args[component.argIndex].value]
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
type IsMatchLogArgumentComponentParameters<
|
|
@@ -2,7 +2,7 @@ import type { CryptoCurrencyPrice, Nft } from '@0xtorch/core'
|
|
|
2
2
|
import type { Chain } from '../../../chains'
|
|
3
3
|
import type { LowerHex, TransactionDecoded } from '../../../types'
|
|
4
4
|
import { isHex, toLowerHex } from '../../../types'
|
|
5
|
-
import {
|
|
5
|
+
import { createErc721NftId, createErc1155NftId } from '../../../utils'
|
|
6
6
|
import type { Target, TargetAssetComponent } from '../types'
|
|
7
7
|
import { getErc1155Component } from './erc1155'
|
|
8
8
|
import { getLogArgumentComponent } from './logArgument'
|
|
@@ -17,9 +17,9 @@ import type {
|
|
|
17
17
|
TransferCustomAmountComponent,
|
|
18
18
|
TransferCustomAssetComponent,
|
|
19
19
|
} from '../types'
|
|
20
|
-
import { getErc1155Component } from './erc1155'
|
|
21
20
|
import { getErc20Component } from './erc20'
|
|
22
21
|
import { getErc721Component } from './erc721'
|
|
22
|
+
import { getErc1155Component } from './erc1155'
|
|
23
23
|
import { getInternalComponent } from './internal'
|
|
24
24
|
import { getLogArgumentComponent } from './logArgument'
|
|
25
25
|
|
|
@@ -539,13 +539,15 @@ const getAmountByTransferCustomAmountComponent = <
|
|
|
539
539
|
// TODO decimals を component で渡すようにする
|
|
540
540
|
decimals: 18,
|
|
541
541
|
}
|
|
542
|
-
}
|
|
542
|
+
}
|
|
543
|
+
if (typeof argument === 'number') {
|
|
543
544
|
return {
|
|
544
545
|
value: BigInt(Math.floor(argument)),
|
|
545
546
|
// TODO decimals を component で渡すようにする
|
|
546
547
|
decimals: 18,
|
|
547
548
|
}
|
|
548
|
-
}
|
|
549
|
+
}
|
|
550
|
+
if (
|
|
549
551
|
typeof argument === 'string' &&
|
|
550
552
|
(/^\d+$/.test(argument) || isHex(argument))
|
|
551
553
|
) {
|
|
@@ -554,9 +556,8 @@ const getAmountByTransferCustomAmountComponent = <
|
|
|
554
556
|
// TODO decimals を component で渡すようにする
|
|
555
557
|
decimals: 18,
|
|
556
558
|
}
|
|
557
|
-
} else {
|
|
558
|
-
throw new Error(`Invalid amount: ${String(argument)}`)
|
|
559
559
|
}
|
|
560
|
+
throw new Error(`Invalid amount: ${String(argument)}`)
|
|
560
561
|
}
|
|
561
562
|
}
|
|
562
563
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CryptoCurrencyPrice } from '@0xtorch/core'
|
|
2
2
|
import type { LowerHex, TransactionDecoded } from '../../../types'
|
|
3
3
|
import { isHex, toLowerHex } from '../../../types'
|
|
4
|
-
import { getErc1155RawComponent } from '../components/erc1155Raw'
|
|
5
4
|
import { getErc20RawComponent } from '../components/erc20Raw'
|
|
6
5
|
import { getErc721RawComponent } from '../components/erc721Raw'
|
|
6
|
+
import { getErc1155RawComponent } from '../components/erc1155Raw'
|
|
7
7
|
import { getInternalRawComponent } from '../components/internalRaw'
|
|
8
8
|
import { getLogArgumentRawComponent } from '../components/logArgumentRaw'
|
|
9
9
|
import type { AddressCondition, Target } from '../types'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CryptoCurrencyPrice } from '@0xtorch/core'
|
|
2
2
|
import type { TransactionDecoded } from '../../../types'
|
|
3
|
-
import { getErc1155RawComponent } from '../components/erc1155Raw'
|
|
4
3
|
import { getErc20RawComponent } from '../components/erc20Raw'
|
|
4
|
+
import { getErc1155RawComponent } from '../components/erc1155Raw'
|
|
5
5
|
import { getInternalRawComponent } from '../components/internalRaw'
|
|
6
6
|
import { getLogArgumentRawComponent } from '../components/logArgumentRaw'
|
|
7
7
|
import type { Target, ValueCondition } from '../types'
|
|
@@ -25,7 +25,8 @@ export const getValueByValueCondition = <
|
|
|
25
25
|
}: GetValueByValueConditionParameters<Price>): 'plus' | bigint => {
|
|
26
26
|
if (typeof condition === 'string') {
|
|
27
27
|
return condition
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
|
+
if (typeof condition === 'bigint') {
|
|
29
30
|
return condition
|
|
30
31
|
}
|
|
31
32
|
switch (condition.type) {
|
|
@@ -64,13 +65,14 @@ export const getValueByValueCondition = <
|
|
|
64
65
|
})
|
|
65
66
|
if (typeof argument === 'bigint') {
|
|
66
67
|
return argument
|
|
67
|
-
}
|
|
68
|
+
}
|
|
69
|
+
if (typeof argument === 'number') {
|
|
68
70
|
return BigInt(Math.floor(argument))
|
|
69
|
-
}
|
|
71
|
+
}
|
|
72
|
+
if (typeof argument === 'string' && /^-?\d+$/.test(argument)) {
|
|
70
73
|
return BigInt(argument)
|
|
71
|
-
} else {
|
|
72
|
-
throw new TypeError('argument is not bigint')
|
|
73
74
|
}
|
|
75
|
+
throw new TypeError('argument is not bigint')
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
}
|
|
@@ -6,17 +6,17 @@ import type {
|
|
|
6
6
|
import { parseBaseNormalActionToNormalAction } from '@0xtorch/core'
|
|
7
7
|
import type { Chain } from '../../chains'
|
|
8
8
|
import type {
|
|
9
|
-
Erc1155Transfer,
|
|
10
9
|
Erc20Transfer,
|
|
11
10
|
Erc721Transfer,
|
|
11
|
+
Erc1155Transfer,
|
|
12
12
|
InternalTransaction,
|
|
13
13
|
LogData,
|
|
14
14
|
TransactionDecoded,
|
|
15
15
|
} from '../../types'
|
|
16
16
|
import { createCommentByCommentComponent } from './components/comment'
|
|
17
|
-
import { isMatchErc1155Component } from './components/erc1155'
|
|
18
17
|
import { isMatchErc20Component } from './components/erc20'
|
|
19
18
|
import { isMatchErc721Component } from './components/erc721'
|
|
19
|
+
import { isMatchErc1155Component } from './components/erc1155'
|
|
20
20
|
import { createIdByIdComponent } from './components/id'
|
|
21
21
|
import { isMatchInternalComponent } from './components/internal'
|
|
22
22
|
import { isMatchLogArgumentComponent } from './components/logArgument'
|
|
@@ -135,7 +135,9 @@ export const valueConditionSchema = z.union([
|
|
|
135
135
|
|
|
136
136
|
export const logArgumentValueConditionSchema = z.union([
|
|
137
137
|
// string
|
|
138
|
-
z
|
|
138
|
+
z
|
|
139
|
+
.string()
|
|
140
|
+
.transform((x) => x.toLowerCase() as Lowercase<string>),
|
|
139
141
|
// transaction from/to
|
|
140
142
|
transactionAddressComponentSchema,
|
|
141
143
|
// transaction value
|
|
@@ -317,7 +319,9 @@ export const transferCustomAmountComponentSchema = z.object({
|
|
|
317
319
|
plus: z.boolean(),
|
|
318
320
|
value: z.union([
|
|
319
321
|
// big-decimal
|
|
320
|
-
z
|
|
322
|
+
z
|
|
323
|
+
.string()
|
|
324
|
+
.regex(/^\d+(\.\d+)?$/),
|
|
321
325
|
// value
|
|
322
326
|
valueComponentSchema,
|
|
323
327
|
// internal
|
package/analyzer/json/types.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { CryptoCurrencyPrice } from '@0xtorch/core'
|
|
2
2
|
import type { z } from 'zod'
|
|
3
3
|
import type {
|
|
4
|
-
Erc1155Transfer,
|
|
5
4
|
Erc20Transfer,
|
|
6
5
|
Erc721Transfer,
|
|
6
|
+
Erc1155Transfer,
|
|
7
7
|
InternalTransaction,
|
|
8
8
|
LogData,
|
|
9
9
|
} from '../../types'
|
|
@@ -24,12 +24,12 @@ import type {
|
|
|
24
24
|
actionGeneratorSchema,
|
|
25
25
|
addressConditionSchema,
|
|
26
26
|
commentComponentSchema,
|
|
27
|
-
erc1155ComponentSchema,
|
|
28
|
-
erc1155RawComponentSchema,
|
|
29
27
|
erc20ComponentSchema,
|
|
30
28
|
erc20RawComponentSchema,
|
|
31
29
|
erc721ComponentSchema,
|
|
32
30
|
erc721RawComponentSchema,
|
|
31
|
+
erc1155ComponentSchema,
|
|
32
|
+
erc1155RawComponentSchema,
|
|
33
33
|
idComponentSchema,
|
|
34
34
|
internalComponentSchema,
|
|
35
35
|
internalRawComponentSchema,
|