@0xtorch/evm 0.0.11 → 0.0.12
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/.DS_Store +0 -0
- package/_cjs/analyzer/analyze.js.map +1 -1
- package/_cjs/analyzer/axieMarketplace/analyze.js +37 -130
- package/_cjs/analyzer/axieMarketplace/analyze.js.map +1 -1
- package/_cjs/analyzer/gasFee/analyze.js +22 -21
- package/_cjs/analyzer/gasFee/analyze.js.map +1 -1
- package/_cjs/analyzer/index.js +2 -1
- package/_cjs/analyzer/index.js.map +1 -1
- package/_cjs/analyzer/json/analyze.js +21 -29
- package/_cjs/analyzer/json/analyze.js.map +1 -1
- package/_cjs/analyzer/json/components/comment.js +47 -0
- package/_cjs/analyzer/json/components/comment.js.map +1 -0
- package/_cjs/analyzer/json/components/erc1155.js +93 -0
- package/_cjs/analyzer/json/components/erc1155.js.map +1 -0
- package/_cjs/analyzer/json/components/erc1155Raw.js +31 -0
- package/_cjs/analyzer/json/components/erc1155Raw.js.map +1 -0
- package/_cjs/analyzer/json/components/erc20.js +90 -0
- package/_cjs/analyzer/json/components/erc20.js.map +1 -0
- package/_cjs/analyzer/json/components/erc20Raw.js +28 -0
- package/_cjs/analyzer/json/components/erc20Raw.js.map +1 -0
- package/_cjs/analyzer/json/components/erc721.js +78 -0
- package/_cjs/analyzer/json/components/erc721.js.map +1 -0
- package/_cjs/analyzer/json/components/erc721Raw.js +29 -0
- package/_cjs/analyzer/json/components/erc721Raw.js.map +1 -0
- package/_cjs/analyzer/json/components/id.js +47 -0
- package/_cjs/analyzer/json/components/id.js.map +1 -0
- package/_cjs/analyzer/json/components/internal.js +78 -0
- package/_cjs/analyzer/json/components/internal.js.map +1 -0
- package/_cjs/analyzer/json/components/internalRaw.js +26 -0
- package/_cjs/analyzer/json/components/internalRaw.js.map +1 -0
- package/_cjs/analyzer/json/components/logArgument.js +67 -0
- package/_cjs/analyzer/json/components/logArgument.js.map +1 -0
- package/_cjs/analyzer/json/components/logArgumentRaw.js +41 -0
- package/_cjs/analyzer/json/components/logArgumentRaw.js.map +1 -0
- package/_cjs/analyzer/json/components/transfer.js +435 -0
- package/_cjs/analyzer/json/components/transfer.js.map +1 -0
- package/_cjs/analyzer/json/condition/address.js +106 -0
- package/_cjs/analyzer/json/condition/address.js.map +1 -0
- package/_cjs/analyzer/json/condition/argumentValue.js +31 -0
- package/_cjs/analyzer/json/condition/argumentValue.js.map +1 -0
- package/_cjs/analyzer/json/condition/index.js +10 -0
- package/_cjs/analyzer/json/condition/index.js.map +1 -0
- package/_cjs/analyzer/json/condition/value.js +65 -0
- package/_cjs/analyzer/json/condition/value.js.map +1 -0
- package/_cjs/analyzer/json/generator.js +774 -0
- package/_cjs/analyzer/json/generator.js.map +1 -0
- package/_cjs/analyzer/json/index.js +3 -1
- package/_cjs/analyzer/json/index.js.map +1 -1
- package/_cjs/analyzer/json/schemas/generator.js +279 -0
- package/_cjs/analyzer/json/schemas/generator.js.map +1 -0
- package/_cjs/analyzer/json/schemas/index.js +303 -0
- package/_cjs/analyzer/json/schemas/index.js.map +1 -0
- package/_cjs/analyzer/json/schemas/utils.js +14 -0
- package/_cjs/analyzer/json/schemas/utils.js.map +1 -0
- package/_cjs/analyzer/parsers/transfer.js +149 -0
- package/_cjs/analyzer/parsers/transfer.js.map +1 -0
- package/_cjs/analyzer/seaport/analyze.js +165 -157
- package/_cjs/analyzer/seaport/analyze.js.map +1 -1
- package/_cjs/analyzer/spam/analyze.js +61 -90
- package/_cjs/analyzer/spam/analyze.js.map +1 -1
- package/_cjs/analyzer/swap/analyze.js +50 -75
- package/_cjs/analyzer/swap/analyze.js.map +1 -1
- package/_cjs/analyzer/transfer/analyze.js +37 -84
- package/_cjs/analyzer/transfer/analyze.js.map +1 -1
- package/_cjs/index.js +3 -2
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/create.js +28 -0
- package/_cjs/utils/create.js.map +1 -0
- package/_cjs/utils/index.js +3 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_esm/analyzer/analyze.js.map +1 -1
- package/_esm/analyzer/axieMarketplace/analyze.js +37 -130
- package/_esm/analyzer/axieMarketplace/analyze.js.map +1 -1
- package/_esm/analyzer/gasFee/analyze.js +23 -21
- package/_esm/analyzer/gasFee/analyze.js.map +1 -1
- package/_esm/analyzer/index.js +1 -1
- package/_esm/analyzer/index.js.map +1 -1
- package/_esm/analyzer/json/analyze.js +22 -29
- package/_esm/analyzer/json/analyze.js.map +1 -1
- package/_esm/analyzer/json/components/comment.js +43 -0
- package/_esm/analyzer/json/components/comment.js.map +1 -0
- package/_esm/analyzer/json/components/erc1155.js +88 -0
- package/_esm/analyzer/json/components/erc1155.js.map +1 -0
- package/_esm/analyzer/json/components/erc1155Raw.js +27 -0
- package/_esm/analyzer/json/components/erc1155Raw.js.map +1 -0
- package/_esm/analyzer/json/components/erc20.js +85 -0
- package/_esm/analyzer/json/components/erc20.js.map +1 -0
- package/_esm/analyzer/json/components/erc20Raw.js +24 -0
- package/_esm/analyzer/json/components/erc20Raw.js.map +1 -0
- package/_esm/analyzer/json/components/erc721.js +73 -0
- package/_esm/analyzer/json/components/erc721.js.map +1 -0
- package/_esm/analyzer/json/components/erc721Raw.js +25 -0
- package/_esm/analyzer/json/components/erc721Raw.js.map +1 -0
- package/_esm/analyzer/json/components/id.js +43 -0
- package/_esm/analyzer/json/components/id.js.map +1 -0
- package/_esm/analyzer/json/components/internal.js +73 -0
- package/_esm/analyzer/json/components/internal.js.map +1 -0
- package/_esm/analyzer/json/components/internalRaw.js +22 -0
- package/_esm/analyzer/json/components/internalRaw.js.map +1 -0
- package/_esm/analyzer/json/components/logArgument.js +62 -0
- package/_esm/analyzer/json/components/logArgument.js.map +1 -0
- package/_esm/analyzer/json/components/logArgumentRaw.js +37 -0
- package/_esm/analyzer/json/components/logArgumentRaw.js.map +1 -0
- package/_esm/analyzer/json/components/transfer.js +431 -0
- package/_esm/analyzer/json/components/transfer.js.map +1 -0
- package/_esm/analyzer/json/condition/address.js +102 -0
- package/_esm/analyzer/json/condition/address.js.map +1 -0
- package/_esm/analyzer/json/condition/argumentValue.js +27 -0
- package/_esm/analyzer/json/condition/argumentValue.js.map +1 -0
- package/_esm/analyzer/json/condition/index.js +4 -0
- package/_esm/analyzer/json/condition/index.js.map +1 -0
- package/_esm/analyzer/json/condition/value.js +61 -0
- package/_esm/analyzer/json/condition/value.js.map +1 -0
- package/_esm/analyzer/json/generator.js +825 -0
- package/_esm/analyzer/json/generator.js.map +1 -0
- package/_esm/analyzer/json/index.js +1 -0
- package/_esm/analyzer/json/index.js.map +1 -1
- package/_esm/analyzer/json/schemas/generator.js +340 -0
- package/_esm/analyzer/json/schemas/generator.js.map +1 -0
- package/_esm/analyzer/json/schemas/index.js +299 -0
- package/_esm/analyzer/json/schemas/index.js.map +1 -0
- package/_esm/analyzer/json/schemas/utils.js +11 -0
- package/_esm/analyzer/json/schemas/utils.js.map +1 -0
- package/_esm/analyzer/parsers/transfer.js +129 -0
- package/_esm/analyzer/parsers/transfer.js.map +1 -0
- package/_esm/analyzer/seaport/analyze.js +166 -157
- package/_esm/analyzer/seaport/analyze.js.map +1 -1
- package/_esm/analyzer/spam/analyze.js +62 -92
- package/_esm/analyzer/spam/analyze.js.map +1 -1
- package/_esm/analyzer/swap/analyze.js +51 -75
- package/_esm/analyzer/swap/analyze.js.map +1 -1
- package/_esm/analyzer/transfer/analyze.js +38 -86
- package/_esm/analyzer/transfer/analyze.js.map +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/utils/create.js +21 -0
- package/_esm/utils/create.js.map +1 -0
- package/_esm/utils/index.js +1 -0
- package/_esm/utils/index.js.map +1 -1
- package/_types/analyzer/analyze.d.ts +11 -16
- package/_types/analyzer/analyze.d.ts.map +1 -1
- package/_types/analyzer/analyzer.d.ts +9 -1
- package/_types/analyzer/analyzer.d.ts.map +1 -1
- package/_types/analyzer/axieMarketplace/analyze.d.ts +9 -2
- package/_types/analyzer/axieMarketplace/analyze.d.ts.map +1 -1
- package/_types/analyzer/gasFee/analyze.d.ts +9 -2
- package/_types/analyzer/gasFee/analyze.d.ts.map +1 -1
- package/_types/analyzer/index.d.ts +1 -1
- package/_types/analyzer/index.d.ts.map +1 -1
- package/_types/analyzer/json/analyze.d.ts +9 -2
- package/_types/analyzer/json/analyze.d.ts.map +1 -1
- package/_types/analyzer/json/components/comment.d.ts +20 -0
- package/_types/analyzer/json/components/comment.d.ts.map +1 -0
- package/_types/analyzer/json/components/erc1155.d.ts +32 -0
- package/_types/analyzer/json/components/erc1155.d.ts.map +1 -0
- package/_types/analyzer/json/components/erc1155Raw.d.ts +18 -0
- package/_types/analyzer/json/components/erc1155Raw.d.ts.map +1 -0
- package/_types/analyzer/json/components/erc20.d.ts +32 -0
- package/_types/analyzer/json/components/erc20.d.ts.map +1 -0
- package/_types/analyzer/json/components/erc20Raw.d.ts +18 -0
- package/_types/analyzer/json/components/erc20Raw.d.ts.map +1 -0
- package/_types/analyzer/json/components/erc721.d.ts +32 -0
- package/_types/analyzer/json/components/erc721.d.ts.map +1 -0
- package/_types/analyzer/json/components/erc721Raw.d.ts +18 -0
- package/_types/analyzer/json/components/erc721Raw.d.ts.map +1 -0
- package/_types/analyzer/json/components/id.d.ts +20 -0
- package/_types/analyzer/json/components/id.d.ts.map +1 -0
- package/_types/analyzer/json/components/internal.d.ts +32 -0
- package/_types/analyzer/json/components/internal.d.ts.map +1 -0
- package/_types/analyzer/json/components/internalRaw.d.ts +18 -0
- package/_types/analyzer/json/components/internalRaw.d.ts.map +1 -0
- package/_types/analyzer/json/components/logArgument.d.ts +32 -0
- package/_types/analyzer/json/components/logArgument.d.ts.map +1 -0
- package/_types/analyzer/json/components/logArgumentRaw.d.ts +18 -0
- package/_types/analyzer/json/components/logArgumentRaw.d.ts.map +1 -0
- package/_types/analyzer/json/components/transfer.d.ts +20 -0
- package/_types/analyzer/json/components/transfer.d.ts.map +1 -0
- package/_types/analyzer/json/condition/address.d.ts +18 -0
- package/_types/analyzer/json/condition/address.d.ts.map +1 -0
- package/_types/analyzer/json/condition/argumentValue.d.ts +18 -0
- package/_types/analyzer/json/condition/argumentValue.d.ts.map +1 -0
- package/_types/analyzer/json/condition/index.d.ts +4 -0
- package/_types/analyzer/json/condition/index.d.ts.map +1 -0
- package/_types/analyzer/json/condition/value.d.ts +18 -0
- package/_types/analyzer/json/condition/value.d.ts.map +1 -0
- package/_types/analyzer/json/generator.d.ts +20 -0
- package/_types/analyzer/json/generator.d.ts.map +1 -0
- package/_types/analyzer/json/index.d.ts +1 -0
- package/_types/analyzer/json/index.d.ts.map +1 -1
- package/_types/analyzer/json/schemas/generator.d.ts +56942 -0
- package/_types/analyzer/json/schemas/generator.d.ts.map +1 -0
- package/_types/analyzer/json/schemas/index.d.ts +1348 -0
- package/_types/analyzer/json/schemas/index.d.ts.map +1 -0
- package/_types/analyzer/json/schemas/utils.d.ts +4 -0
- package/_types/analyzer/json/schemas/utils.d.ts.map +1 -0
- package/_types/analyzer/json/types.d.ts +42 -172
- package/_types/analyzer/json/types.d.ts.map +1 -1
- package/_types/analyzer/parsers/transfer.d.ts +46 -0
- package/_types/analyzer/parsers/transfer.d.ts.map +1 -0
- package/_types/analyzer/seaport/analyze.d.ts +9 -2
- package/_types/analyzer/seaport/analyze.d.ts.map +1 -1
- package/_types/analyzer/seaport/orderFulfilled.d.ts +8 -8
- package/_types/analyzer/spam/analyze.d.ts +9 -2
- package/_types/analyzer/spam/analyze.d.ts.map +1 -1
- package/_types/analyzer/swap/analyze.d.ts +9 -2
- package/_types/analyzer/swap/analyze.d.ts.map +1 -1
- package/_types/analyzer/transfer/analyze.d.ts +9 -2
- package/_types/analyzer/transfer/analyze.d.ts.map +1 -1
- package/_types/analyzer/types.d.ts +6 -6
- package/_types/analyzer/types.d.ts.map +1 -1
- package/_types/decoder/tests.d.ts +2 -2
- package/_types/explorers/definitions/blockscout.d.ts +60 -4
- package/_types/explorers/definitions/blockscout.d.ts.map +1 -1
- package/_types/explorers/definitions/etherscan.d.ts +60 -4
- package/_types/explorers/definitions/etherscan.d.ts.map +1 -1
- package/_types/explorers/definitions/roninExplorer.d.ts +60 -4
- package/_types/explorers/definitions/roninExplorer.d.ts.map +1 -1
- package/_types/explorers/externals/blockscout/getInternalTransactionsByAddress.d.ts +2 -2
- package/_types/getAccountsTransactionFulls/getAccountsTransactionFulls.d.ts +9 -1
- package/_types/getAccountsTransactionFulls/getAccountsTransactionFulls.d.ts.map +1 -1
- package/_types/getTransactionFull/getTransactionFull.d.ts +9 -1
- package/_types/getTransactionFull/getTransactionFull.d.ts.map +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/types/log.d.ts +6 -6
- package/_types/types/transaction.d.ts +3 -4
- package/_types/types/transaction.d.ts.map +1 -1
- package/_types/utils/create.d.ts +23 -0
- package/_types/utils/create.d.ts.map +1 -0
- package/_types/utils/index.d.ts +1 -0
- package/_types/utils/index.d.ts.map +1 -1
- package/analyzer/analyze.ts +6 -30
- package/analyzer/axieMarketplace/analyze.ts +67 -150
- package/analyzer/gasFee/analyze.ts +29 -36
- package/analyzer/index.ts +1 -1
- package/analyzer/json/analyze.ts +32 -53
- package/analyzer/json/components/comment.ts +62 -0
- package/analyzer/json/components/erc1155.ts +132 -0
- package/analyzer/json/components/erc1155Raw.ts +46 -0
- package/analyzer/json/components/erc20.ts +129 -0
- package/analyzer/json/components/erc20Raw.ts +43 -0
- package/analyzer/json/components/erc721.ts +117 -0
- package/analyzer/json/components/erc721Raw.ts +46 -0
- package/analyzer/json/components/id.ts +62 -0
- package/analyzer/json/components/internal.ts +117 -0
- package/analyzer/json/components/internalRaw.ts +39 -0
- package/analyzer/json/components/logArgument.ts +99 -0
- package/analyzer/json/components/logArgumentRaw.ts +57 -0
- package/analyzer/json/components/transfer.ts +531 -0
- package/analyzer/json/condition/address.ts +124 -0
- package/analyzer/json/condition/argumentValue.ts +43 -0
- package/analyzer/json/condition/index.ts +3 -0
- package/analyzer/json/condition/value.ts +76 -0
- package/analyzer/json/generator.ts +1166 -0
- package/analyzer/json/index.ts +1 -0
- package/analyzer/json/schemas/generator.ts +387 -0
- package/analyzer/json/schemas/index.ts +363 -0
- package/analyzer/json/schemas/utils.ts +12 -0
- package/analyzer/json/types.ts +111 -207
- package/analyzer/parsers/transfer.ts +301 -0
- package/analyzer/seaport/analyze.ts +228 -195
- package/analyzer/spam/analyze.ts +79 -112
- package/analyzer/swap/analyze.ts +67 -101
- package/analyzer/transfer/analyze.ts +54 -100
- package/analyzer/types.ts +5 -21
- package/index.ts +1 -0
- package/package.json +2 -2
- package/types/transaction.ts +2 -14
- package/utils/create.ts +57 -0
- package/utils/index.ts +1 -0
- package/_cjs/analyzer/createAccountActionByAction/addLiquidity.js +0 -28
- package/_cjs/analyzer/createAccountActionByAction/addLiquidity.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/atomicArbitrage.js +0 -79
- package/_cjs/analyzer/createAccountActionByAction/atomicArbitrage.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/bridgeFrom.js +0 -38
- package/_cjs/analyzer/createAccountActionByAction/bridgeFrom.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/bridgeTo.js +0 -38
- package/_cjs/analyzer/createAccountActionByAction/bridgeTo.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/buyNft.js +0 -59
- package/_cjs/analyzer/createAccountActionByAction/buyNft.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/createAccountActionByAction.js +0 -69
- package/_cjs/analyzer/createAccountActionByAction/createAccountActionByAction.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/deposit.js +0 -41
- package/_cjs/analyzer/createAccountActionByAction/deposit.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/depositWithBond.js +0 -28
- package/_cjs/analyzer/createAccountActionByAction/depositWithBond.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/freeMintNft.js +0 -32
- package/_cjs/analyzer/createAccountActionByAction/freeMintNft.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/index.js +0 -6
- package/_cjs/analyzer/createAccountActionByAction/index.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/removeLiquidity.js +0 -28
- package/_cjs/analyzer/createAccountActionByAction/removeLiquidity.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/spam.js +0 -58
- package/_cjs/analyzer/createAccountActionByAction/spam.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/trade.js +0 -59
- package/_cjs/analyzer/createAccountActionByAction/trade.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/transactionFee.js +0 -29
- package/_cjs/analyzer/createAccountActionByAction/transactionFee.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/transfer.js +0 -74
- package/_cjs/analyzer/createAccountActionByAction/transfer.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/withdraw.js +0 -38
- package/_cjs/analyzer/createAccountActionByAction/withdraw.js.map +0 -1
- package/_cjs/analyzer/createAccountActionByAction/withdrawWithBond.js +0 -28
- package/_cjs/analyzer/createAccountActionByAction/withdrawWithBond.js.map +0 -1
- package/_cjs/analyzer/json/generatorAnyLog.js +0 -163
- package/_cjs/analyzer/json/generatorAnyLog.js.map +0 -1
- package/_cjs/analyzer/json/generatorAnyTokenTransfer.js +0 -102
- package/_cjs/analyzer/json/generatorAnyTokenTransfer.js.map +0 -1
- package/_cjs/analyzer/json/generatorSpecificTokenTransfer.js +0 -343
- package/_cjs/analyzer/json/generatorSpecificTokenTransfer.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/addLiquidity.js +0 -24
- package/_esm/analyzer/createAccountActionByAction/addLiquidity.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/atomicArbitrage.js +0 -79
- package/_esm/analyzer/createAccountActionByAction/atomicArbitrage.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/bridgeFrom.js +0 -34
- package/_esm/analyzer/createAccountActionByAction/bridgeFrom.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/bridgeTo.js +0 -34
- package/_esm/analyzer/createAccountActionByAction/bridgeTo.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/buyNft.js +0 -59
- package/_esm/analyzer/createAccountActionByAction/buyNft.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/createAccountActionByAction.js +0 -80
- package/_esm/analyzer/createAccountActionByAction/createAccountActionByAction.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/deposit.js +0 -38
- package/_esm/analyzer/createAccountActionByAction/deposit.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/depositWithBond.js +0 -24
- package/_esm/analyzer/createAccountActionByAction/depositWithBond.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/freeMintNft.js +0 -28
- package/_esm/analyzer/createAccountActionByAction/freeMintNft.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/index.js +0 -2
- package/_esm/analyzer/createAccountActionByAction/index.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/removeLiquidity.js +0 -24
- package/_esm/analyzer/createAccountActionByAction/removeLiquidity.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/spam.js +0 -54
- package/_esm/analyzer/createAccountActionByAction/spam.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/trade.js +0 -59
- package/_esm/analyzer/createAccountActionByAction/trade.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/transactionFee.js +0 -25
- package/_esm/analyzer/createAccountActionByAction/transactionFee.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/transfer.js +0 -70
- package/_esm/analyzer/createAccountActionByAction/transfer.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/withdraw.js +0 -34
- package/_esm/analyzer/createAccountActionByAction/withdraw.js.map +0 -1
- package/_esm/analyzer/createAccountActionByAction/withdrawWithBond.js +0 -24
- package/_esm/analyzer/createAccountActionByAction/withdrawWithBond.js.map +0 -1
- package/_esm/analyzer/json/generatorAnyLog.js +0 -159
- package/_esm/analyzer/json/generatorAnyLog.js.map +0 -1
- package/_esm/analyzer/json/generatorAnyTokenTransfer.js +0 -98
- package/_esm/analyzer/json/generatorAnyTokenTransfer.js.map +0 -1
- package/_esm/analyzer/json/generatorSpecificTokenTransfer.js +0 -339
- package/_esm/analyzer/json/generatorSpecificTokenTransfer.js.map +0 -1
- package/_types/analyzer/createAccountActionByAction/addLiquidity.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/addLiquidity.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/atomicArbitrage.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/atomicArbitrage.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/bridgeFrom.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/bridgeFrom.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/bridgeTo.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/bridgeTo.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/buyNft.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/buyNft.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/createAccountActionByAction.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/createAccountActionByAction.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/deposit.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/deposit.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/depositWithBond.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/depositWithBond.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/freeMintNft.d.ts +0 -53
- package/_types/analyzer/createAccountActionByAction/freeMintNft.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/index.d.ts +0 -2
- package/_types/analyzer/createAccountActionByAction/index.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/removeLiquidity.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/removeLiquidity.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/spam.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/spam.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/trade.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/trade.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/transactionFee.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/transactionFee.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/transfer.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/transfer.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/withdraw.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/withdraw.d.ts.map +0 -1
- package/_types/analyzer/createAccountActionByAction/withdrawWithBond.d.ts +0 -59
- package/_types/analyzer/createAccountActionByAction/withdrawWithBond.d.ts.map +0 -1
- package/_types/analyzer/json/generatorAnyLog.d.ts +0 -55
- package/_types/analyzer/json/generatorAnyLog.d.ts.map +0 -1
- package/_types/analyzer/json/generatorAnyTokenTransfer.d.ts +0 -54
- package/_types/analyzer/json/generatorAnyTokenTransfer.d.ts.map +0 -1
- package/_types/analyzer/json/generatorSpecificTokenTransfer.d.ts +0 -55
- package/_types/analyzer/json/generatorSpecificTokenTransfer.d.ts.map +0 -1
- package/analyzer/createAccountActionByAction/addLiquidity.ts +0 -60
- package/analyzer/createAccountActionByAction/atomicArbitrage.ts +0 -115
- package/analyzer/createAccountActionByAction/bridgeFrom.ts +0 -61
- package/analyzer/createAccountActionByAction/bridgeTo.ts +0 -61
- package/analyzer/createAccountActionByAction/buyNft.ts +0 -106
- package/analyzer/createAccountActionByAction/createAccountActionByAction.ts +0 -181
- package/analyzer/createAccountActionByAction/deposit.ts +0 -64
- package/analyzer/createAccountActionByAction/depositWithBond.ts +0 -60
- package/analyzer/createAccountActionByAction/freeMintNft.ts +0 -54
- package/analyzer/createAccountActionByAction/index.ts +0 -1
- package/analyzer/createAccountActionByAction/removeLiquidity.ts +0 -60
- package/analyzer/createAccountActionByAction/spam.ts +0 -79
- package/analyzer/createAccountActionByAction/trade.ts +0 -105
- package/analyzer/createAccountActionByAction/transactionFee.ts +0 -51
- package/analyzer/createAccountActionByAction/transfer.ts +0 -95
- package/analyzer/createAccountActionByAction/withdraw.ts +0 -61
- package/analyzer/createAccountActionByAction/withdrawWithBond.ts +0 -60
- package/analyzer/json/generatorAnyLog.ts +0 -207
- package/analyzer/json/generatorAnyTokenTransfer.ts +0 -118
- package/analyzer/json/generatorSpecificTokenTransfer.ts +0 -425
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { createBigDecimal } from '@0xtorch/big-decimal'
|
|
2
1
|
import type {
|
|
3
2
|
AccountActionBuyNft,
|
|
4
3
|
AccountActionSellNft,
|
|
5
4
|
CryptoCurrencyPrice,
|
|
6
5
|
NormalActionTrade,
|
|
7
6
|
} from '@0xtorch/core'
|
|
8
|
-
import { createEvmAccount } from '../../creates/createEvmAccount'
|
|
9
|
-
import type { EvmAccount, TransactionSource } from '../../types'
|
|
10
7
|
import { toLowerHex } from '../../types'
|
|
8
|
+
import {
|
|
9
|
+
parseErc1155TransferToActionTransferIn,
|
|
10
|
+
parseErc1155TransferToActionTransferOut,
|
|
11
|
+
parseErc20TransferToActionTransferIn,
|
|
12
|
+
parseErc20TransferToActionTransferOut,
|
|
13
|
+
parseErc721TransferToActionTransferIn,
|
|
14
|
+
parseErc721TransferToActionTransferOut,
|
|
15
|
+
parseInternalTransactionToActionTransferIn,
|
|
16
|
+
parseInternalTransactionToActionTransferOut,
|
|
17
|
+
} from '../parsers/transfer'
|
|
11
18
|
import type { AnalyzeParameters, AnalyzeReturnType } from '../types'
|
|
12
19
|
|
|
13
20
|
export const analyzeAxieMarketplace = <
|
|
@@ -16,7 +23,7 @@ export const analyzeAxieMarketplace = <
|
|
|
16
23
|
chain,
|
|
17
24
|
transaction,
|
|
18
25
|
accountAddresses,
|
|
19
|
-
}: AnalyzeParameters<Price>): Promise<AnalyzeReturnType
|
|
26
|
+
}: AnalyzeParameters<Price>): Promise<AnalyzeReturnType | undefined> => {
|
|
20
27
|
const {
|
|
21
28
|
transactionHash,
|
|
22
29
|
from,
|
|
@@ -119,85 +126,43 @@ export const analyzeAxieMarketplace = <
|
|
|
119
126
|
accountAddressSet.has(transfer.to),
|
|
120
127
|
)
|
|
121
128
|
) {
|
|
122
|
-
const
|
|
129
|
+
const transfers = [
|
|
130
|
+
...relatedErc721Transfers.map((transfer) =>
|
|
131
|
+
parseErc721TransferToActionTransferIn({
|
|
132
|
+
chainId: chain.id,
|
|
133
|
+
transfer,
|
|
134
|
+
}),
|
|
135
|
+
),
|
|
136
|
+
...relatedErc1155Transfers.map((transfer) =>
|
|
137
|
+
parseErc1155TransferToActionTransferIn({
|
|
138
|
+
chainId: chain.id,
|
|
139
|
+
transfer,
|
|
140
|
+
}),
|
|
141
|
+
),
|
|
142
|
+
...relatedInternalTransactions.map((internalTransaction) =>
|
|
143
|
+
parseInternalTransactionToActionTransferOut({
|
|
144
|
+
chain,
|
|
145
|
+
internalTransaction,
|
|
146
|
+
}),
|
|
147
|
+
),
|
|
148
|
+
...relatedErc20Transfers.map((transfer) =>
|
|
149
|
+
parseErc20TransferToActionTransferOut({
|
|
150
|
+
chainId: chain.id,
|
|
151
|
+
transfer,
|
|
152
|
+
}),
|
|
153
|
+
),
|
|
154
|
+
]
|
|
155
|
+
const normalAction: NormalActionTrade = {
|
|
123
156
|
type: 'NormalAction',
|
|
124
157
|
action: 'trade',
|
|
125
158
|
evidence: 'contract',
|
|
126
159
|
timestamp,
|
|
127
160
|
comment: undefined,
|
|
128
161
|
app,
|
|
129
|
-
transfers
|
|
130
|
-
...relatedErc721Transfers.map((transfer) => ({
|
|
131
|
-
target: transfer.to,
|
|
132
|
-
direction: 'in' as const,
|
|
133
|
-
from: createEvmAccount({
|
|
134
|
-
address: transfer.from,
|
|
135
|
-
chainId: chain.id,
|
|
136
|
-
}),
|
|
137
|
-
to: createEvmAccount({
|
|
138
|
-
address: transfer.to,
|
|
139
|
-
chainId: chain.id,
|
|
140
|
-
}),
|
|
141
|
-
asset: transfer.nft,
|
|
142
|
-
amount: createBigDecimal(1n),
|
|
143
|
-
price: undefined as Price,
|
|
144
|
-
})),
|
|
145
|
-
...relatedErc1155Transfers.map((transfer) => ({
|
|
146
|
-
target: transfer.to,
|
|
147
|
-
direction: 'in' as const,
|
|
148
|
-
from: createEvmAccount({
|
|
149
|
-
address: transfer.from,
|
|
150
|
-
chainId: chain.id,
|
|
151
|
-
}),
|
|
152
|
-
to: createEvmAccount({
|
|
153
|
-
address: transfer.to,
|
|
154
|
-
chainId: chain.id,
|
|
155
|
-
}),
|
|
156
|
-
asset: transfer.nft,
|
|
157
|
-
amount: createBigDecimal(transfer.value),
|
|
158
|
-
price: undefined as Price,
|
|
159
|
-
})),
|
|
160
|
-
...relatedInternalTransactions.map((internalTransaction) => ({
|
|
161
|
-
target: internalTransaction.from,
|
|
162
|
-
direction: 'out' as const,
|
|
163
|
-
from: createEvmAccount({
|
|
164
|
-
address: internalTransaction.from,
|
|
165
|
-
chainId: chain.id,
|
|
166
|
-
}),
|
|
167
|
-
to: createEvmAccount({
|
|
168
|
-
address: internalTransaction.to ?? '0x',
|
|
169
|
-
chainId: chain.id,
|
|
170
|
-
}),
|
|
171
|
-
asset: chain.nativeToken.currency,
|
|
172
|
-
amount: createBigDecimal(
|
|
173
|
-
internalTransaction.value,
|
|
174
|
-
chain.nativeToken.decimals,
|
|
175
|
-
),
|
|
176
|
-
price: nativeTokenPrice,
|
|
177
|
-
})),
|
|
178
|
-
...relatedErc20Transfers.map((transfer) => ({
|
|
179
|
-
target: transfer.from,
|
|
180
|
-
direction: 'out' as const,
|
|
181
|
-
from: createEvmAccount({
|
|
182
|
-
address: transfer.from,
|
|
183
|
-
chainId: chain.id,
|
|
184
|
-
}),
|
|
185
|
-
to: createEvmAccount({
|
|
186
|
-
address: transfer.to,
|
|
187
|
-
chainId: chain.id,
|
|
188
|
-
}),
|
|
189
|
-
asset: transfer.token.currency,
|
|
190
|
-
amount: createBigDecimal(transfer.value, transfer.token.decimals),
|
|
191
|
-
price: transfer.price,
|
|
192
|
-
})),
|
|
193
|
-
],
|
|
162
|
+
transfers,
|
|
194
163
|
}
|
|
195
|
-
const accountAction: AccountActionBuyNft
|
|
196
|
-
|
|
197
|
-
TransactionSource,
|
|
198
|
-
Price
|
|
199
|
-
> = {
|
|
200
|
-
type: 'AccountAction',
|
|
164
|
+
const accountAction: AccountActionBuyNft = {
|
|
165
|
+
type: 'NormalAccountAction',
|
|
201
166
|
action: 'buy-nft',
|
|
202
167
|
source: `evm_${chain.id}_${toLowerHex(transactionHash)}`,
|
|
203
168
|
evidence: 'contract',
|
|
@@ -205,7 +170,7 @@ export const analyzeAxieMarketplace = <
|
|
|
205
170
|
order: 0,
|
|
206
171
|
comment: normalAction.comment,
|
|
207
172
|
app,
|
|
208
|
-
transfers
|
|
173
|
+
transfers,
|
|
209
174
|
}
|
|
210
175
|
return Promise.resolve({
|
|
211
176
|
actions: [normalAction],
|
|
@@ -228,85 +193,37 @@ export const analyzeAxieMarketplace = <
|
|
|
228
193
|
accountAddressSet.has(transfer.from),
|
|
229
194
|
)
|
|
230
195
|
) {
|
|
231
|
-
const
|
|
196
|
+
const transfers = [
|
|
197
|
+
...relatedInternalTransactions.map((internalTransaction) =>
|
|
198
|
+
parseInternalTransactionToActionTransferIn({
|
|
199
|
+
chain,
|
|
200
|
+
internalTransaction,
|
|
201
|
+
}),
|
|
202
|
+
),
|
|
203
|
+
...relatedErc20Transfers.map((transfer) =>
|
|
204
|
+
parseErc20TransferToActionTransferIn({ chainId: chain.id, transfer }),
|
|
205
|
+
),
|
|
206
|
+
...relatedErc721Transfers.map((transfer) =>
|
|
207
|
+
parseErc721TransferToActionTransferOut({ chainId: chain.id, transfer }),
|
|
208
|
+
),
|
|
209
|
+
...relatedErc1155Transfers.map((transfer) =>
|
|
210
|
+
parseErc1155TransferToActionTransferOut({
|
|
211
|
+
chainId: chain.id,
|
|
212
|
+
transfer,
|
|
213
|
+
}),
|
|
214
|
+
),
|
|
215
|
+
]
|
|
216
|
+
const normalAction: NormalActionTrade = {
|
|
232
217
|
type: 'NormalAction',
|
|
233
218
|
action: 'trade',
|
|
234
219
|
evidence: 'contract',
|
|
235
220
|
timestamp,
|
|
236
221
|
comment: undefined,
|
|
237
222
|
app,
|
|
238
|
-
transfers
|
|
239
|
-
...relatedInternalTransactions.map((internalTransaction) => ({
|
|
240
|
-
target: internalTransaction.to ?? '0x',
|
|
241
|
-
direction: 'in' as const,
|
|
242
|
-
from: createEvmAccount({
|
|
243
|
-
address: internalTransaction.from,
|
|
244
|
-
chainId: chain.id,
|
|
245
|
-
}),
|
|
246
|
-
to: createEvmAccount({
|
|
247
|
-
address: internalTransaction.to ?? '0x',
|
|
248
|
-
chainId: chain.id,
|
|
249
|
-
}),
|
|
250
|
-
asset: chain.nativeToken.currency,
|
|
251
|
-
amount: createBigDecimal(
|
|
252
|
-
internalTransaction.value,
|
|
253
|
-
chain.nativeToken.decimals,
|
|
254
|
-
),
|
|
255
|
-
price: nativeTokenPrice,
|
|
256
|
-
})),
|
|
257
|
-
...relatedErc20Transfers.map((transfer) => ({
|
|
258
|
-
target: transfer.to ?? '0x',
|
|
259
|
-
direction: 'in' as const,
|
|
260
|
-
from: createEvmAccount({
|
|
261
|
-
address: transfer.from,
|
|
262
|
-
chainId: chain.id,
|
|
263
|
-
}),
|
|
264
|
-
to: createEvmAccount({
|
|
265
|
-
address: transfer.to,
|
|
266
|
-
chainId: chain.id,
|
|
267
|
-
}),
|
|
268
|
-
asset: transfer.token.currency,
|
|
269
|
-
amount: createBigDecimal(transfer.value, transfer.token.decimals),
|
|
270
|
-
price: transfer.price,
|
|
271
|
-
})),
|
|
272
|
-
...relatedErc721Transfers.map((transfer) => ({
|
|
273
|
-
target: transfer.from,
|
|
274
|
-
direction: 'out' as const,
|
|
275
|
-
from: createEvmAccount({
|
|
276
|
-
address: transfer.from,
|
|
277
|
-
chainId: chain.id,
|
|
278
|
-
}),
|
|
279
|
-
to: createEvmAccount({
|
|
280
|
-
address: transfer.to,
|
|
281
|
-
chainId: chain.id,
|
|
282
|
-
}),
|
|
283
|
-
asset: transfer.nft,
|
|
284
|
-
amount: createBigDecimal(1n),
|
|
285
|
-
price: undefined as Price,
|
|
286
|
-
})),
|
|
287
|
-
...relatedErc1155Transfers.map((transfer) => ({
|
|
288
|
-
target: transfer.from,
|
|
289
|
-
direction: 'out' as const,
|
|
290
|
-
from: createEvmAccount({
|
|
291
|
-
address: transfer.from,
|
|
292
|
-
chainId: chain.id,
|
|
293
|
-
}),
|
|
294
|
-
to: createEvmAccount({
|
|
295
|
-
address: transfer.to,
|
|
296
|
-
chainId: chain.id,
|
|
297
|
-
}),
|
|
298
|
-
asset: transfer.nft,
|
|
299
|
-
amount: createBigDecimal(transfer.value),
|
|
300
|
-
price: undefined as Price,
|
|
301
|
-
})),
|
|
302
|
-
],
|
|
223
|
+
transfers,
|
|
303
224
|
}
|
|
304
|
-
const accountAction: AccountActionSellNft
|
|
305
|
-
|
|
306
|
-
TransactionSource,
|
|
307
|
-
Price
|
|
308
|
-
> = {
|
|
309
|
-
type: 'AccountAction',
|
|
225
|
+
const accountAction: AccountActionSellNft = {
|
|
226
|
+
type: 'NormalAccountAction',
|
|
310
227
|
action: 'sell-nft',
|
|
311
228
|
source: `evm_${chain.id}_${toLowerHex(transactionHash)}`,
|
|
312
229
|
evidence: 'contract',
|
|
@@ -314,7 +231,7 @@ export const analyzeAxieMarketplace = <
|
|
|
314
231
|
order: 0,
|
|
315
232
|
comment: normalAction.comment,
|
|
316
233
|
app,
|
|
317
|
-
transfers
|
|
234
|
+
transfers,
|
|
318
235
|
}
|
|
319
236
|
return Promise.resolve({
|
|
320
237
|
actions: [normalAction],
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { createBigDecimal } from '@0xtorch/big-decimal'
|
|
2
1
|
import type {
|
|
3
2
|
CryptoCurrencyPrice,
|
|
4
3
|
NormalActionTransactionFee,
|
|
5
4
|
} from '@0xtorch/core'
|
|
5
|
+
import { parseNormalActionToAccountActions } from '@0xtorch/core'
|
|
6
6
|
import type { Chain } from '../../chains'
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import type { TransactionDecoded } from '../../types'
|
|
8
|
+
import { createEvmAddressId } from '../../utils'
|
|
9
|
+
import { createEvmActionSource } from '../../utils/create'
|
|
10
|
+
import { parseTransactionGasToActionTransferOut } from '../parsers/transfer'
|
|
11
11
|
import type { AnalyzeParameters, AnalyzeReturnType } from '../types'
|
|
12
12
|
|
|
13
13
|
// [MAYBE] zkSyncEra は gasRefund の仕組みがあるので、最初の gas から refund された分を引いた値を使う
|
|
@@ -15,38 +15,39 @@ export const analyzeGasFee = <Price extends CryptoCurrencyPrice | undefined>({
|
|
|
15
15
|
chain,
|
|
16
16
|
transaction,
|
|
17
17
|
accountAddresses,
|
|
18
|
-
}: AnalyzeParameters<Price>): Promise<AnalyzeReturnType
|
|
18
|
+
}: AnalyzeParameters<Price>): Promise<AnalyzeReturnType | undefined> => {
|
|
19
19
|
// transaction gas fee を計算して、 normalAction 作成
|
|
20
20
|
const normalAction = generateNormalAction(transaction, chain)
|
|
21
21
|
|
|
22
22
|
// transaction.from が accountAddresses に含まれている場合は、 accountAction 作成
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
const accountIds = new Set(
|
|
24
|
+
accountAddresses.map((address) =>
|
|
25
|
+
createEvmAddressId({ chainId: chain.id, address }),
|
|
26
|
+
),
|
|
27
27
|
)
|
|
28
|
+
const source = createEvmActionSource({
|
|
29
|
+
chainId: chain.id,
|
|
30
|
+
transactionHash: transaction.transactionHash,
|
|
31
|
+
})
|
|
32
|
+
const accountActions = parseNormalActionToAccountActions({
|
|
33
|
+
action: normalAction,
|
|
34
|
+
accountIds,
|
|
35
|
+
source,
|
|
36
|
+
// TODO 値を入れる
|
|
37
|
+
cexAccountIds: undefined,
|
|
38
|
+
})
|
|
28
39
|
|
|
29
40
|
return Promise.resolve({
|
|
30
41
|
actions: [normalAction],
|
|
31
|
-
accountActions
|
|
42
|
+
accountActions,
|
|
32
43
|
})
|
|
33
44
|
}
|
|
34
45
|
|
|
35
46
|
const generateNormalAction = <Price extends CryptoCurrencyPrice | undefined>(
|
|
36
|
-
|
|
37
|
-
gasUsed,
|
|
38
|
-
effectiveGasPrice,
|
|
39
|
-
block,
|
|
40
|
-
from,
|
|
41
|
-
nativeTokenPrice,
|
|
42
|
-
}: TransactionDecoded<Price>,
|
|
47
|
+
transaction: TransactionDecoded<Price>,
|
|
43
48
|
chain: Chain,
|
|
44
|
-
): NormalActionTransactionFee
|
|
45
|
-
const
|
|
46
|
-
gasUsed * effectiveGasPrice,
|
|
47
|
-
chain.nativeToken.decimals,
|
|
48
|
-
)
|
|
49
|
-
const lowerFrom = toLowerHex(from)
|
|
49
|
+
): NormalActionTransactionFee => {
|
|
50
|
+
const { block } = transaction
|
|
50
51
|
return {
|
|
51
52
|
type: 'NormalAction',
|
|
52
53
|
action: 'transaction-fee',
|
|
@@ -55,18 +56,10 @@ const generateNormalAction = <Price extends CryptoCurrencyPrice | undefined>(
|
|
|
55
56
|
comment: undefined,
|
|
56
57
|
app: undefined,
|
|
57
58
|
transfers: [
|
|
58
|
-
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
address: lowerFrom,
|
|
63
|
-
chainId: chain.id,
|
|
64
|
-
}),
|
|
65
|
-
to: undefined,
|
|
66
|
-
asset: chain.nativeToken.currency,
|
|
67
|
-
amount: gasFee,
|
|
68
|
-
price: nativeTokenPrice,
|
|
69
|
-
},
|
|
59
|
+
parseTransactionGasToActionTransferOut({
|
|
60
|
+
chain,
|
|
61
|
+
transaction,
|
|
62
|
+
}),
|
|
70
63
|
],
|
|
71
64
|
}
|
|
72
65
|
}
|
package/analyzer/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { analyze } from './analyze'
|
|
|
2
2
|
export { analyzer } from './analyzer'
|
|
3
3
|
export { analyzeAxieMarketplace } from './axieMarketplace'
|
|
4
4
|
export { analyzeGasFee } from './gasFee'
|
|
5
|
-
export { createAnalyzeByJsonRule } from './json'
|
|
5
|
+
export { createAnalyzeByJsonRule, evmAnalyzersSchema } from './json'
|
|
6
6
|
export { analyzeSeaport } from './seaport'
|
|
7
7
|
export { analyzeSwap } from './swap'
|
|
8
8
|
export { analyzeTransfer } from './transfer'
|
package/analyzer/json/analyze.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
NormalAction,
|
|
5
|
-
} from '@0xtorch/core'
|
|
6
|
-
import type { EvmAccount, TransactionDecoded } from '../../types'
|
|
1
|
+
import type { CryptoCurrencyPrice } from '@0xtorch/core'
|
|
2
|
+
import { parseNormalActionToAccountActions } from '@0xtorch/core'
|
|
3
|
+
import type { TransactionDecoded } from '../../types'
|
|
7
4
|
import { toLowerHex } from '../../types'
|
|
8
|
-
import {
|
|
5
|
+
import { createEvmAddressId } from '../../utils'
|
|
6
|
+
import { createEvmActionSource } from '../../utils/create'
|
|
9
7
|
import type { AnalyzeParameters, AnalyzeReturnType } from '../types'
|
|
10
|
-
import {
|
|
11
|
-
import { generateActionsByAnyTokenTransferGenerator } from './generatorAnyTokenTransfer'
|
|
12
|
-
import { generateActionBySpecificTokenTransferGenerator } from './generatorSpecificTokenTransfer'
|
|
8
|
+
import { generateActionsByGenerator } from './generator'
|
|
13
9
|
import type { AnalyzeRule, ParameterBase, ParameterIndex } from './types'
|
|
14
10
|
|
|
15
11
|
export const createAnalyzeByJsonRule =
|
|
@@ -18,9 +14,7 @@ export const createAnalyzeByJsonRule =
|
|
|
18
14
|
chain,
|
|
19
15
|
transaction,
|
|
20
16
|
accountAddresses,
|
|
21
|
-
}: AnalyzeParameters<Price>): Promise<
|
|
22
|
-
AnalyzeReturnType<Price> | undefined
|
|
23
|
-
> => {
|
|
17
|
+
}: AnalyzeParameters<Price>): Promise<AnalyzeReturnType | undefined> => {
|
|
24
18
|
const {
|
|
25
19
|
chainId,
|
|
26
20
|
from,
|
|
@@ -264,51 +258,36 @@ export const createAnalyzeByJsonRule =
|
|
|
264
258
|
}
|
|
265
259
|
|
|
266
260
|
// rule に基づいて action を生成する
|
|
267
|
-
const
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
)
|
|
275
|
-
mut_actions.push(...actions)
|
|
276
|
-
break
|
|
277
|
-
}
|
|
278
|
-
case 'any-log': {
|
|
279
|
-
const actions = generateActionsByAnyLogGenerator(
|
|
280
|
-
generator,
|
|
281
|
-
chain,
|
|
282
|
-
transaction,
|
|
283
|
-
)
|
|
284
|
-
mut_actions.push(...actions)
|
|
285
|
-
break
|
|
286
|
-
}
|
|
287
|
-
case 'specific-token-transfer': {
|
|
288
|
-
const action = generateActionBySpecificTokenTransferGenerator(
|
|
289
|
-
generator,
|
|
290
|
-
chain,
|
|
291
|
-
transaction,
|
|
292
|
-
)
|
|
293
|
-
mut_actions.push(action)
|
|
294
|
-
break
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
261
|
+
const actions = generators.flatMap((generator) =>
|
|
262
|
+
generateActionsByGenerator({
|
|
263
|
+
generator,
|
|
264
|
+
transaction,
|
|
265
|
+
chain,
|
|
266
|
+
}),
|
|
267
|
+
)
|
|
298
268
|
|
|
299
269
|
// actions から account actions の作成
|
|
300
|
-
const
|
|
301
|
-
|
|
270
|
+
const accountIds = new Set(
|
|
271
|
+
accountAddresses.map((address) =>
|
|
272
|
+
createEvmAddressId({ chainId: chain.id, address }),
|
|
273
|
+
),
|
|
274
|
+
)
|
|
275
|
+
const source = createEvmActionSource({
|
|
276
|
+
chainId: chain.id,
|
|
277
|
+
transactionHash: transaction.transactionHash,
|
|
278
|
+
})
|
|
279
|
+
const accountActions = actions.flatMap((action) =>
|
|
280
|
+
parseNormalActionToAccountActions({
|
|
281
|
+
action,
|
|
282
|
+
accountIds,
|
|
283
|
+
source,
|
|
284
|
+
// TODO 値を入れる
|
|
285
|
+
cexAccountIds: undefined,
|
|
286
|
+
}),
|
|
302
287
|
)
|
|
303
|
-
const accountActions = optionalAccountActions
|
|
304
|
-
.filter(
|
|
305
|
-
(action): action is Exclude<typeof action, undefined> =>
|
|
306
|
-
action !== undefined,
|
|
307
|
-
)
|
|
308
|
-
.map((action, index) => ({ ...action, order: index }))
|
|
309
288
|
|
|
310
289
|
return Promise.resolve({
|
|
311
|
-
actions
|
|
290
|
+
actions,
|
|
312
291
|
accountActions,
|
|
313
292
|
})
|
|
314
293
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { createBigDecimal, toStringBigDecimal } from '@0xtorch/big-decimal'
|
|
2
|
+
import type { CryptoCurrencyPrice } from '@0xtorch/core'
|
|
3
|
+
import type { Chain } from '../../../chains'
|
|
4
|
+
import type { TransactionDecoded } from '../../../types'
|
|
5
|
+
import { toLowerHex } from '../../../types'
|
|
6
|
+
import type { CommentComponent, Target } from '../types'
|
|
7
|
+
import { getLogArgumentComponent } from './logArgument'
|
|
8
|
+
|
|
9
|
+
type CreateCommentByCommentComponentParameters<
|
|
10
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
11
|
+
> = {
|
|
12
|
+
readonly component: CommentComponent
|
|
13
|
+
readonly transaction: TransactionDecoded<Price>
|
|
14
|
+
readonly chain: Chain
|
|
15
|
+
} & Target<Price>
|
|
16
|
+
|
|
17
|
+
export const createCommentByCommentComponent = <
|
|
18
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
19
|
+
>({
|
|
20
|
+
component,
|
|
21
|
+
transaction,
|
|
22
|
+
chain,
|
|
23
|
+
targetsLog = [],
|
|
24
|
+
}: CreateCommentByCommentComponentParameters<Price>): string => {
|
|
25
|
+
if (typeof component === 'string') {
|
|
26
|
+
return component
|
|
27
|
+
} else if (typeof component === 'number') {
|
|
28
|
+
return component.toString()
|
|
29
|
+
} else if (typeof component === 'bigint') {
|
|
30
|
+
return component.toString()
|
|
31
|
+
}
|
|
32
|
+
switch (component.type) {
|
|
33
|
+
case 'from': {
|
|
34
|
+
const address = toLowerHex(transaction.from)
|
|
35
|
+
return component.minify === true
|
|
36
|
+
? `${address.slice(0, 6)}...${address.slice(-4)}`
|
|
37
|
+
: address
|
|
38
|
+
}
|
|
39
|
+
case 'to': {
|
|
40
|
+
if (transaction.to === null) {
|
|
41
|
+
return 'null'
|
|
42
|
+
}
|
|
43
|
+
const address = toLowerHex(transaction.to)
|
|
44
|
+
return component.minify === true
|
|
45
|
+
? `${address.slice(0, 6)}...${address.slice(-4)}`
|
|
46
|
+
: address
|
|
47
|
+
}
|
|
48
|
+
case 'value': {
|
|
49
|
+
return toStringBigDecimal(
|
|
50
|
+
createBigDecimal(transaction.value, chain.nativeToken.decimals),
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
case 'log': {
|
|
54
|
+
const arguments_ = getLogArgumentComponent({
|
|
55
|
+
component,
|
|
56
|
+
transaction,
|
|
57
|
+
targetsLog,
|
|
58
|
+
})
|
|
59
|
+
return arguments_.map(String).join('')
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { CryptoCurrencyPrice } from '@0xtorch/core'
|
|
2
|
+
import type { Erc1155Transfer, TransactionDecoded } from '../../../types'
|
|
3
|
+
import {
|
|
4
|
+
getAddressByAddressCondition,
|
|
5
|
+
getValueByValueCondition,
|
|
6
|
+
} from '../condition'
|
|
7
|
+
import type { Erc1155Component, Target } from '../types'
|
|
8
|
+
|
|
9
|
+
type GetErc1155ComponentParameters<
|
|
10
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
11
|
+
> = {
|
|
12
|
+
readonly component: Erc1155Component
|
|
13
|
+
readonly transaction: TransactionDecoded<Price>
|
|
14
|
+
} & Target<Price>
|
|
15
|
+
|
|
16
|
+
export const getErc1155Component = <
|
|
17
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
18
|
+
>({
|
|
19
|
+
component,
|
|
20
|
+
transaction,
|
|
21
|
+
targetsErc20 = [],
|
|
22
|
+
targetsErc721 = [],
|
|
23
|
+
targetsErc1155 = [],
|
|
24
|
+
targetsInternal = [],
|
|
25
|
+
targetsLog = [],
|
|
26
|
+
}: GetErc1155ComponentParameters<Price>): readonly Erc1155Transfer[] => {
|
|
27
|
+
const transfers =
|
|
28
|
+
component.target === true ? targetsErc1155 : transaction.erc1155Transfers
|
|
29
|
+
const filteredTransfers = transfers.filter((transfer) =>
|
|
30
|
+
isMatchErc1155Component({
|
|
31
|
+
component,
|
|
32
|
+
transfer,
|
|
33
|
+
transaction,
|
|
34
|
+
targetsErc20,
|
|
35
|
+
targetsErc721,
|
|
36
|
+
targetsErc1155,
|
|
37
|
+
targetsInternal,
|
|
38
|
+
targetsLog,
|
|
39
|
+
}),
|
|
40
|
+
)
|
|
41
|
+
if (component.index === 'any') {
|
|
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
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
type IsMatchErc1155ComponentParameters<
|
|
52
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
53
|
+
> = {
|
|
54
|
+
readonly component: Erc1155Component
|
|
55
|
+
readonly transfer: Erc1155Transfer
|
|
56
|
+
readonly transaction: TransactionDecoded<Price>
|
|
57
|
+
} & Target<Price>
|
|
58
|
+
|
|
59
|
+
export const isMatchErc1155Component = <
|
|
60
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
61
|
+
>({
|
|
62
|
+
component,
|
|
63
|
+
transfer,
|
|
64
|
+
transaction,
|
|
65
|
+
targetsErc20 = [],
|
|
66
|
+
targetsErc721 = [],
|
|
67
|
+
targetsErc1155 = [],
|
|
68
|
+
targetsInternal = [],
|
|
69
|
+
targetsLog = [],
|
|
70
|
+
}: IsMatchErc1155ComponentParameters<Price>): boolean => {
|
|
71
|
+
if (component.from !== undefined) {
|
|
72
|
+
const value = getAddressByAddressCondition({
|
|
73
|
+
condition: component.from,
|
|
74
|
+
transaction,
|
|
75
|
+
targetsErc20,
|
|
76
|
+
targetsErc721,
|
|
77
|
+
targetsErc1155,
|
|
78
|
+
targetsInternal,
|
|
79
|
+
targetsLog,
|
|
80
|
+
})
|
|
81
|
+
if (value !== transfer.from) {
|
|
82
|
+
return false
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (component.to !== undefined) {
|
|
86
|
+
const value = getAddressByAddressCondition({
|
|
87
|
+
condition: component.to,
|
|
88
|
+
transaction,
|
|
89
|
+
targetsErc20,
|
|
90
|
+
targetsErc721,
|
|
91
|
+
targetsErc1155,
|
|
92
|
+
targetsInternal,
|
|
93
|
+
targetsLog,
|
|
94
|
+
})
|
|
95
|
+
if (value !== transfer.to) {
|
|
96
|
+
return false
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (component.token !== undefined) {
|
|
100
|
+
const value = getAddressByAddressCondition({
|
|
101
|
+
condition: component.token,
|
|
102
|
+
transaction,
|
|
103
|
+
targetsErc20,
|
|
104
|
+
targetsErc721,
|
|
105
|
+
targetsErc1155,
|
|
106
|
+
targetsInternal,
|
|
107
|
+
targetsLog,
|
|
108
|
+
})
|
|
109
|
+
if (value !== transfer.token.contractAddress) {
|
|
110
|
+
return false
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (component.tokenId !== undefined && component.tokenId !== transfer.id) {
|
|
114
|
+
return false
|
|
115
|
+
}
|
|
116
|
+
if (component.value !== undefined) {
|
|
117
|
+
const value = getValueByValueCondition({
|
|
118
|
+
condition: component.value,
|
|
119
|
+
transaction,
|
|
120
|
+
targetsErc20,
|
|
121
|
+
targetsErc1155,
|
|
122
|
+
targetsInternal,
|
|
123
|
+
targetsLog,
|
|
124
|
+
})
|
|
125
|
+
if (value === 'plus' && transfer.value <= 0) {
|
|
126
|
+
return false
|
|
127
|
+
} else if (value !== 'plus' && value !== transfer.value) {
|
|
128
|
+
return false
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return true
|
|
132
|
+
}
|