@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,326 @@
|
|
|
1
|
+
import { createBigDecimal } from '@0xtorch/big-decimal'
|
|
2
|
+
import type {
|
|
3
|
+
AccountActionBuyNft,
|
|
4
|
+
AccountActionSellNft,
|
|
5
|
+
CryptoCurrencyPrice,
|
|
6
|
+
NormalActionTrade,
|
|
7
|
+
} from '@0xtorch/core'
|
|
8
|
+
import { createEvmAccount } from '../../creates/createEvmAccount'
|
|
9
|
+
import type { EvmAccount, TransactionSource } from '../../types'
|
|
10
|
+
import { toLowerHex } from '../../types'
|
|
11
|
+
import type { AnalyzeParameters, AnalyzeReturnType } from '../types'
|
|
12
|
+
|
|
13
|
+
export const analyzeAxieMarketplace = <
|
|
14
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
15
|
+
>({
|
|
16
|
+
chain,
|
|
17
|
+
transaction,
|
|
18
|
+
accountAddresses,
|
|
19
|
+
}: AnalyzeParameters<Price>): Promise<AnalyzeReturnType<Price> | undefined> => {
|
|
20
|
+
const {
|
|
21
|
+
transactionHash,
|
|
22
|
+
from,
|
|
23
|
+
to,
|
|
24
|
+
value,
|
|
25
|
+
input,
|
|
26
|
+
app,
|
|
27
|
+
erc20Transfers,
|
|
28
|
+
erc721Transfers,
|
|
29
|
+
erc1155Transfers,
|
|
30
|
+
internalTransactions,
|
|
31
|
+
block,
|
|
32
|
+
logs,
|
|
33
|
+
nativeTokenPrice,
|
|
34
|
+
} = transaction
|
|
35
|
+
const timestamp = Number(block.timestamp) * 1000
|
|
36
|
+
const accountAddressSet = new Set(accountAddresses)
|
|
37
|
+
|
|
38
|
+
if (input.slice(0, 10) !== '0x95a4ec00') {
|
|
39
|
+
return Promise.resolve(undefined)
|
|
40
|
+
}
|
|
41
|
+
const orderMatchedEventSignature =
|
|
42
|
+
'0x968d1942d9971cb9c45c722957d854c38f327206399d12ae49ca2f9c5dd06fda'
|
|
43
|
+
const orderMatchedLogs = logs.filter(
|
|
44
|
+
(log) => log.log.topics[0] === orderMatchedEventSignature,
|
|
45
|
+
)
|
|
46
|
+
if (orderMatchedLogs.length !== 1) {
|
|
47
|
+
return Promise.resolve(undefined)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const relatedErc20Transfers = erc20Transfers.filter(
|
|
51
|
+
(transfer) =>
|
|
52
|
+
(accountAddressSet.has(transfer.from) ||
|
|
53
|
+
accountAddressSet.has(transfer.to)) &&
|
|
54
|
+
transfer.value > 0,
|
|
55
|
+
)
|
|
56
|
+
const relatedErc721Transfers = erc721Transfers.filter(
|
|
57
|
+
(transfer) =>
|
|
58
|
+
accountAddressSet.has(transfer.from) ||
|
|
59
|
+
accountAddressSet.has(transfer.to),
|
|
60
|
+
)
|
|
61
|
+
const relatedErc1155Transfers = erc1155Transfers.filter(
|
|
62
|
+
(transfer) =>
|
|
63
|
+
accountAddressSet.has(transfer.from) ||
|
|
64
|
+
accountAddressSet.has(transfer.to),
|
|
65
|
+
)
|
|
66
|
+
const relatedInternalTransactions = [
|
|
67
|
+
...(value === 0n || to === null
|
|
68
|
+
? []
|
|
69
|
+
: [
|
|
70
|
+
{
|
|
71
|
+
type: 'InternalTransaction' as const,
|
|
72
|
+
transactionHash,
|
|
73
|
+
from: toLowerHex(from),
|
|
74
|
+
to: toLowerHex(to),
|
|
75
|
+
contractAddress: undefined,
|
|
76
|
+
txType: '',
|
|
77
|
+
value,
|
|
78
|
+
gas: 0n,
|
|
79
|
+
gasUsed: 0n,
|
|
80
|
+
isError: false,
|
|
81
|
+
input: undefined,
|
|
82
|
+
currency: chain.nativeToken.currency,
|
|
83
|
+
price: nativeTokenPrice,
|
|
84
|
+
},
|
|
85
|
+
]),
|
|
86
|
+
...internalTransactions,
|
|
87
|
+
].filter(
|
|
88
|
+
(internalTransaction) =>
|
|
89
|
+
(accountAddressSet.has(internalTransaction.from) ||
|
|
90
|
+
accountAddressSet.has(internalTransaction.to ?? '0x')) &&
|
|
91
|
+
internalTransaction.value > 0,
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
if (
|
|
95
|
+
relatedErc20Transfers.length === 0 &&
|
|
96
|
+
relatedInternalTransactions.length === 0
|
|
97
|
+
) {
|
|
98
|
+
return Promise.resolve(undefined)
|
|
99
|
+
}
|
|
100
|
+
if (
|
|
101
|
+
relatedErc721Transfers.length === 0 &&
|
|
102
|
+
relatedErc1155Transfers.length === 0
|
|
103
|
+
) {
|
|
104
|
+
return Promise.resolve(undefined)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// NFT Buy
|
|
108
|
+
if (
|
|
109
|
+
relatedErc20Transfers.every((transfer) =>
|
|
110
|
+
accountAddressSet.has(transfer.from),
|
|
111
|
+
) &&
|
|
112
|
+
relatedInternalTransactions.every((internalTransaction) =>
|
|
113
|
+
accountAddressSet.has(internalTransaction.from),
|
|
114
|
+
) &&
|
|
115
|
+
relatedErc721Transfers.every((transfer) =>
|
|
116
|
+
accountAddressSet.has(transfer.to),
|
|
117
|
+
) &&
|
|
118
|
+
relatedErc1155Transfers.every((transfer) =>
|
|
119
|
+
accountAddressSet.has(transfer.to),
|
|
120
|
+
)
|
|
121
|
+
) {
|
|
122
|
+
const normalAction: NormalActionTrade<EvmAccount, Price> = {
|
|
123
|
+
type: 'NormalAction',
|
|
124
|
+
action: 'trade',
|
|
125
|
+
evidence: 'contract',
|
|
126
|
+
timestamp,
|
|
127
|
+
comment: undefined,
|
|
128
|
+
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
|
+
],
|
|
194
|
+
}
|
|
195
|
+
const accountAction: AccountActionBuyNft<
|
|
196
|
+
EvmAccount,
|
|
197
|
+
TransactionSource,
|
|
198
|
+
Price
|
|
199
|
+
> = {
|
|
200
|
+
type: 'AccountAction',
|
|
201
|
+
action: 'buy-nft',
|
|
202
|
+
source: `evm_${chain.id}_${toLowerHex(transactionHash)}`,
|
|
203
|
+
evidence: 'contract',
|
|
204
|
+
timestamp,
|
|
205
|
+
order: 0,
|
|
206
|
+
comment: normalAction.comment,
|
|
207
|
+
app,
|
|
208
|
+
transfers: normalAction.transfers,
|
|
209
|
+
}
|
|
210
|
+
return Promise.resolve({
|
|
211
|
+
actions: [normalAction],
|
|
212
|
+
accountActions: [accountAction],
|
|
213
|
+
})
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// NFT Sell
|
|
217
|
+
if (
|
|
218
|
+
relatedErc20Transfers.every((transfer) =>
|
|
219
|
+
accountAddressSet.has(transfer.to),
|
|
220
|
+
) &&
|
|
221
|
+
relatedInternalTransactions.every((internalTransaction) =>
|
|
222
|
+
accountAddressSet.has(internalTransaction.to ?? '0x'),
|
|
223
|
+
) &&
|
|
224
|
+
relatedErc721Transfers.every((transfer) =>
|
|
225
|
+
accountAddressSet.has(transfer.from),
|
|
226
|
+
) &&
|
|
227
|
+
relatedErc1155Transfers.every((transfer) =>
|
|
228
|
+
accountAddressSet.has(transfer.from),
|
|
229
|
+
)
|
|
230
|
+
) {
|
|
231
|
+
const normalAction: NormalActionTrade<EvmAccount, Price> = {
|
|
232
|
+
type: 'NormalAction',
|
|
233
|
+
action: 'trade',
|
|
234
|
+
evidence: 'contract',
|
|
235
|
+
timestamp,
|
|
236
|
+
comment: undefined,
|
|
237
|
+
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
|
+
],
|
|
303
|
+
}
|
|
304
|
+
const accountAction: AccountActionSellNft<
|
|
305
|
+
EvmAccount,
|
|
306
|
+
TransactionSource,
|
|
307
|
+
Price
|
|
308
|
+
> = {
|
|
309
|
+
type: 'AccountAction',
|
|
310
|
+
action: 'sell-nft',
|
|
311
|
+
source: `evm_${chain.id}_${toLowerHex(transactionHash)}`,
|
|
312
|
+
evidence: 'contract',
|
|
313
|
+
timestamp,
|
|
314
|
+
order: 0,
|
|
315
|
+
comment: normalAction.comment,
|
|
316
|
+
app,
|
|
317
|
+
transfers: normalAction.transfers,
|
|
318
|
+
}
|
|
319
|
+
return Promise.resolve({
|
|
320
|
+
actions: [normalAction],
|
|
321
|
+
accountActions: [accountAction],
|
|
322
|
+
})
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return Promise.resolve(undefined)
|
|
326
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { analyzeAxieMarketplace } from './analyze'
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AccountAction,
|
|
3
|
+
AccountActionType,
|
|
4
|
+
CryptoCurrencyPrice,
|
|
5
|
+
NormalActionAddLiquidity,
|
|
6
|
+
} from '@0xtorch/core'
|
|
7
|
+
import type {
|
|
8
|
+
EvmAccount,
|
|
9
|
+
LowerHex,
|
|
10
|
+
TransactionDecoded,
|
|
11
|
+
TransactionSource,
|
|
12
|
+
} from '../../types'
|
|
13
|
+
import { toLowerHex } from '../../types'
|
|
14
|
+
|
|
15
|
+
export const createAccountActionByActionAddLiquidity = <
|
|
16
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
17
|
+
>(
|
|
18
|
+
action: NormalActionAddLiquidity<EvmAccount, Price>,
|
|
19
|
+
transaction: TransactionDecoded<Price>,
|
|
20
|
+
accountAddresses: readonly LowerHex[],
|
|
21
|
+
):
|
|
22
|
+
| AccountAction<
|
|
23
|
+
AccountActionType,
|
|
24
|
+
TransactionSource,
|
|
25
|
+
EvmAccount | undefined,
|
|
26
|
+
Price
|
|
27
|
+
>
|
|
28
|
+
| undefined => {
|
|
29
|
+
const transfersIn = action.transfers.filter(
|
|
30
|
+
(transfer) => transfer.direction === 'in',
|
|
31
|
+
)
|
|
32
|
+
const transfersOut = action.transfers.filter(
|
|
33
|
+
(transfer) => transfer.direction === 'out',
|
|
34
|
+
)
|
|
35
|
+
if (transfersOut.length === 0) {
|
|
36
|
+
throw new Error('invalid action')
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const source =
|
|
40
|
+
`evm_${transaction.chainId}_${toLowerHex(transaction.transactionHash)}` as const
|
|
41
|
+
|
|
42
|
+
return transfersIn.every((transfer) =>
|
|
43
|
+
accountAddresses.includes(transfer.to.address),
|
|
44
|
+
) &&
|
|
45
|
+
transfersOut.every((transfer) =>
|
|
46
|
+
accountAddresses.includes(transfer.from.address),
|
|
47
|
+
)
|
|
48
|
+
? {
|
|
49
|
+
type: 'AccountAction',
|
|
50
|
+
action: 'add-liquidity',
|
|
51
|
+
source,
|
|
52
|
+
evidence: action.evidence,
|
|
53
|
+
timestamp: action.timestamp,
|
|
54
|
+
order: 0,
|
|
55
|
+
comment: action.comment,
|
|
56
|
+
app: action.app,
|
|
57
|
+
transfers: action.transfers,
|
|
58
|
+
}
|
|
59
|
+
: undefined
|
|
60
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createBigDecimal, greaterThan } from '@0xtorch/big-decimal'
|
|
2
|
+
import type {
|
|
3
|
+
AccountAction,
|
|
4
|
+
AccountActionType,
|
|
5
|
+
CryptoCurrencyPrice,
|
|
6
|
+
NormalActionAtomicArbitrage,
|
|
7
|
+
} from '@0xtorch/core'
|
|
8
|
+
import type {
|
|
9
|
+
EvmAccount,
|
|
10
|
+
LowerHex,
|
|
11
|
+
TransactionDecoded,
|
|
12
|
+
TransactionSource,
|
|
13
|
+
} from '../../types'
|
|
14
|
+
import { toLowerHex } from '../../types'
|
|
15
|
+
|
|
16
|
+
export const createAccountActionByActionAtomicArbitrage = <
|
|
17
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
18
|
+
>(
|
|
19
|
+
action: NormalActionAtomicArbitrage<EvmAccount, Price>,
|
|
20
|
+
transaction: TransactionDecoded<Price>,
|
|
21
|
+
accountAddresses: readonly LowerHex[],
|
|
22
|
+
):
|
|
23
|
+
| AccountAction<
|
|
24
|
+
AccountActionType,
|
|
25
|
+
TransactionSource,
|
|
26
|
+
EvmAccount | undefined,
|
|
27
|
+
Price
|
|
28
|
+
>
|
|
29
|
+
| undefined => {
|
|
30
|
+
if (action.transfers.length !== 2) {
|
|
31
|
+
throw new Error('invalid action')
|
|
32
|
+
}
|
|
33
|
+
const transferIn = action.transfers.find(
|
|
34
|
+
(transfer) => transfer.direction === 'in',
|
|
35
|
+
)
|
|
36
|
+
const transferOut = action.transfers.find(
|
|
37
|
+
(transfer) => transfer.direction === 'out',
|
|
38
|
+
)
|
|
39
|
+
if (transferIn === undefined || transferOut === undefined) {
|
|
40
|
+
throw new Error('invalid action')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const source =
|
|
44
|
+
`evm_${transaction.chainId}_${toLowerHex(transaction.transactionHash)}` as const
|
|
45
|
+
if (
|
|
46
|
+
accountAddresses.includes(transferIn.to.address) &&
|
|
47
|
+
accountAddresses.includes(transferOut.from.address)
|
|
48
|
+
) {
|
|
49
|
+
// transfers の両側が自分の address の場合は atomic-arbitrage として扱う
|
|
50
|
+
return {
|
|
51
|
+
type: 'AccountAction',
|
|
52
|
+
action: 'atomic-arbitrage',
|
|
53
|
+
source,
|
|
54
|
+
evidence: action.evidence,
|
|
55
|
+
timestamp: action.timestamp,
|
|
56
|
+
order: 0,
|
|
57
|
+
comment: action.comment,
|
|
58
|
+
app: action.app,
|
|
59
|
+
transfers: [
|
|
60
|
+
{
|
|
61
|
+
target: transferIn.to.address,
|
|
62
|
+
direction: greaterThan(transferIn.amount, transferOut.amount)
|
|
63
|
+
? 'in'
|
|
64
|
+
: 'out',
|
|
65
|
+
from: greaterThan(transferIn.amount, transferOut.amount)
|
|
66
|
+
? undefined
|
|
67
|
+
: transferIn.to,
|
|
68
|
+
to: greaterThan(transferIn.amount, transferOut.amount)
|
|
69
|
+
? transferIn.to
|
|
70
|
+
: undefined,
|
|
71
|
+
asset: transferIn.asset,
|
|
72
|
+
amount: greaterThan(transferIn.amount, transferOut.amount)
|
|
73
|
+
? createBigDecimal(
|
|
74
|
+
transferIn.amount.value - transferOut.amount.value,
|
|
75
|
+
transferIn.amount.decimals,
|
|
76
|
+
)
|
|
77
|
+
: createBigDecimal(
|
|
78
|
+
transferOut.amount.value - transferIn.amount.value,
|
|
79
|
+
transferIn.amount.decimals,
|
|
80
|
+
),
|
|
81
|
+
price: transferIn.price,
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
}
|
|
85
|
+
} else if (accountAddresses.includes(transferIn.to.address)) {
|
|
86
|
+
// transfers の in 側が自分の address の場合は swap-income として扱う
|
|
87
|
+
return {
|
|
88
|
+
type: 'AccountAction',
|
|
89
|
+
action: 'swap-income',
|
|
90
|
+
source,
|
|
91
|
+
evidence: action.evidence,
|
|
92
|
+
timestamp: action.timestamp,
|
|
93
|
+
order: 0,
|
|
94
|
+
comment: action.comment,
|
|
95
|
+
app: action.app,
|
|
96
|
+
transfers: [transferIn],
|
|
97
|
+
}
|
|
98
|
+
} else if (accountAddresses.includes(transferOut.from.address)) {
|
|
99
|
+
// transfers の out 側が自分の address の場合は swap-transfer として扱う
|
|
100
|
+
return {
|
|
101
|
+
type: 'AccountAction',
|
|
102
|
+
action: 'swap-transfer',
|
|
103
|
+
source,
|
|
104
|
+
evidence: action.evidence,
|
|
105
|
+
timestamp: action.timestamp,
|
|
106
|
+
order: 0,
|
|
107
|
+
comment: action.comment,
|
|
108
|
+
app: action.app,
|
|
109
|
+
transfers: [transferOut],
|
|
110
|
+
}
|
|
111
|
+
} else {
|
|
112
|
+
// transfers の両側が自分の address でない場合は undefined を返す
|
|
113
|
+
return undefined
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AccountAction,
|
|
3
|
+
AccountActionType,
|
|
4
|
+
CryptoCurrencyPrice,
|
|
5
|
+
NormalActionBridgeFrom,
|
|
6
|
+
} from '@0xtorch/core'
|
|
7
|
+
import type {
|
|
8
|
+
EvmAccount,
|
|
9
|
+
LowerHex,
|
|
10
|
+
TransactionDecoded,
|
|
11
|
+
TransactionSource,
|
|
12
|
+
} from '../../types'
|
|
13
|
+
import { toLowerHex } from '../../types'
|
|
14
|
+
|
|
15
|
+
export const createAccountActionByActionBridgeFrom = <
|
|
16
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
17
|
+
>(
|
|
18
|
+
action: NormalActionBridgeFrom<EvmAccount, Price>,
|
|
19
|
+
transaction: TransactionDecoded<Price>,
|
|
20
|
+
accountAddresses: readonly LowerHex[],
|
|
21
|
+
):
|
|
22
|
+
| AccountAction<
|
|
23
|
+
AccountActionType,
|
|
24
|
+
TransactionSource,
|
|
25
|
+
EvmAccount | undefined,
|
|
26
|
+
Price
|
|
27
|
+
>
|
|
28
|
+
| undefined => {
|
|
29
|
+
if (action.transfers.length !== 1) {
|
|
30
|
+
throw new Error('invalid action')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const transfer = action.transfers[0]
|
|
34
|
+
if (
|
|
35
|
+
accountAddresses.includes(transfer.from.address) &&
|
|
36
|
+
accountAddresses.includes(transfer.to.address)
|
|
37
|
+
) {
|
|
38
|
+
return undefined
|
|
39
|
+
} else if (accountAddresses.includes(transfer.from.address)) {
|
|
40
|
+
return {
|
|
41
|
+
type: 'AccountAction',
|
|
42
|
+
action: 'bridge-from',
|
|
43
|
+
source:
|
|
44
|
+
`evm_${transaction.chainId}_${toLowerHex(transaction.transactionHash)}` as const,
|
|
45
|
+
evidence: action.evidence,
|
|
46
|
+
timestamp: action.timestamp,
|
|
47
|
+
order: 0,
|
|
48
|
+
comment: action.comment,
|
|
49
|
+
app: action.app,
|
|
50
|
+
transfers: [
|
|
51
|
+
{
|
|
52
|
+
...transfer,
|
|
53
|
+
target: transfer.from.address,
|
|
54
|
+
direction: 'out',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
return undefined
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AccountAction,
|
|
3
|
+
AccountActionType,
|
|
4
|
+
CryptoCurrencyPrice,
|
|
5
|
+
NormalActionBridgeTo,
|
|
6
|
+
} from '@0xtorch/core'
|
|
7
|
+
import type {
|
|
8
|
+
EvmAccount,
|
|
9
|
+
LowerHex,
|
|
10
|
+
TransactionDecoded,
|
|
11
|
+
TransactionSource,
|
|
12
|
+
} from '../../types'
|
|
13
|
+
import { toLowerHex } from '../../types'
|
|
14
|
+
|
|
15
|
+
export const createAccountActionByActionBridgeTo = <
|
|
16
|
+
Price extends CryptoCurrencyPrice | undefined,
|
|
17
|
+
>(
|
|
18
|
+
action: NormalActionBridgeTo<EvmAccount, Price>,
|
|
19
|
+
transaction: TransactionDecoded<Price>,
|
|
20
|
+
accountAddresses: readonly LowerHex[],
|
|
21
|
+
):
|
|
22
|
+
| AccountAction<
|
|
23
|
+
AccountActionType,
|
|
24
|
+
TransactionSource,
|
|
25
|
+
EvmAccount | undefined,
|
|
26
|
+
Price
|
|
27
|
+
>
|
|
28
|
+
| undefined => {
|
|
29
|
+
if (action.transfers.length !== 1) {
|
|
30
|
+
throw new Error('invalid action')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const transfer = action.transfers[0]
|
|
34
|
+
if (
|
|
35
|
+
accountAddresses.includes(transfer.from.address) &&
|
|
36
|
+
accountAddresses.includes(transfer.to.address)
|
|
37
|
+
) {
|
|
38
|
+
return undefined
|
|
39
|
+
} else if (accountAddresses.includes(transfer.to.address)) {
|
|
40
|
+
return {
|
|
41
|
+
type: 'AccountAction',
|
|
42
|
+
action: 'bridge-to',
|
|
43
|
+
source:
|
|
44
|
+
`evm_${transaction.chainId}_${toLowerHex(transaction.transactionHash)}` as const,
|
|
45
|
+
evidence: action.evidence,
|
|
46
|
+
timestamp: action.timestamp,
|
|
47
|
+
order: 0,
|
|
48
|
+
comment: action.comment,
|
|
49
|
+
app: action.app,
|
|
50
|
+
transfers: [
|
|
51
|
+
{
|
|
52
|
+
...transfer,
|
|
53
|
+
target: transfer.to.address,
|
|
54
|
+
direction: 'in',
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
return undefined
|
|
60
|
+
}
|
|
61
|
+
}
|