@0xtorch/evm 0.0.108 → 0.0.110
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/chain/definitions/arbitrumOne.js +1 -2
- package/_cjs/chain/definitions/arbitrumOne.js.map +1 -1
- package/_cjs/chain/definitions/astar.js +1 -2
- package/_cjs/chain/definitions/astar.js.map +1 -1
- package/_cjs/chain/definitions/astarZkEvm.js +1 -2
- package/_cjs/chain/definitions/astarZkEvm.js.map +1 -1
- package/_cjs/chain/definitions/avalancheC.js +1 -2
- package/_cjs/chain/definitions/avalancheC.js.map +1 -1
- package/_cjs/chain/definitions/base.js +1 -2
- package/_cjs/chain/definitions/base.js.map +1 -1
- package/_cjs/chain/definitions/blast.js +1 -2
- package/_cjs/chain/definitions/blast.js.map +1 -1
- package/_cjs/chain/definitions/bsc.js +1 -2
- package/_cjs/chain/definitions/bsc.js.map +1 -1
- package/_cjs/chain/definitions/doge.js +1 -2
- package/_cjs/chain/definitions/doge.js.map +1 -1
- package/_cjs/chain/definitions/ethereum.js +1 -17
- package/_cjs/chain/definitions/ethereum.js.map +1 -1
- package/_cjs/chain/definitions/fantom.js +1 -2
- package/_cjs/chain/definitions/fantom.js.map +1 -1
- package/_cjs/chain/definitions/linea.js +1 -2
- package/_cjs/chain/definitions/linea.js.map +1 -1
- package/_cjs/chain/definitions/mantaPacific.js +1 -2
- package/_cjs/chain/definitions/mantaPacific.js.map +1 -1
- package/_cjs/chain/definitions/mantle.js +1 -2
- package/_cjs/chain/definitions/mantle.js.map +1 -1
- package/_cjs/chain/definitions/metis.js +1 -2
- package/_cjs/chain/definitions/metis.js.map +1 -1
- package/_cjs/chain/definitions/moonbeam.js +1 -2
- package/_cjs/chain/definitions/moonbeam.js.map +1 -1
- package/_cjs/chain/definitions/moonriver.js +1 -2
- package/_cjs/chain/definitions/moonriver.js.map +1 -1
- package/_cjs/chain/definitions/oasys.js +1 -2
- package/_cjs/chain/definitions/oasys.js.map +1 -1
- package/_cjs/chain/definitions/opBnb.js +1 -2
- package/_cjs/chain/definitions/opBnb.js.map +1 -1
- package/_cjs/chain/definitions/optimism.js +1 -2
- package/_cjs/chain/definitions/optimism.js.map +1 -1
- package/_cjs/chain/definitions/polygonPos.js +1 -2
- package/_cjs/chain/definitions/polygonPos.js.map +1 -1
- package/_cjs/chain/definitions/ronin.js +1 -2
- package/_cjs/chain/definitions/ronin.js.map +1 -1
- package/_cjs/chain/definitions/scroll.js +1 -2
- package/_cjs/chain/definitions/scroll.js.map +1 -1
- package/_cjs/chain/definitions/zkFair.js +1 -2
- package/_cjs/chain/definitions/zkFair.js.map +1 -1
- package/_cjs/chain/definitions/zkSyncEra.js +1 -2
- package/_cjs/chain/definitions/zkSyncEra.js.map +1 -1
- package/_cjs/chain/definitions/zora.js +1 -2
- package/_cjs/chain/definitions/zora.js.map +1 -1
- package/_cjs/explorer/blockscout/client.js +2 -2
- package/_cjs/explorer/blockscout/client.js.map +1 -1
- package/_cjs/explorer/blockscout/create.js +18 -10
- package/_cjs/explorer/blockscout/create.js.map +1 -1
- package/_cjs/explorer/blockscout/getBlockNumberByTimestamp.js +2 -1
- package/_cjs/explorer/blockscout/getBlockNumberByTimestamp.js.map +1 -1
- package/_cjs/explorer/blockscout/getContractCreatorAddressHashAndCreationTransactionHash.js +2 -1
- package/_cjs/explorer/blockscout/getContractCreatorAddressHashAndCreationTransactionHash.js.map +1 -1
- package/_cjs/explorer/blockscout/getContractSourceCodeForAVerifiedContract.js +2 -1
- package/_cjs/explorer/blockscout/getContractSourceCodeForAVerifiedContract.js.map +1 -1
- package/_cjs/explorer/blockscout/getEventLogsByAddressAndTopic.js +2 -1
- package/_cjs/explorer/blockscout/getEventLogsByAddressAndTopic.js.map +1 -1
- package/_cjs/explorer/blockscout/getInternalTransactionsByAddressHash.js +2 -1
- package/_cjs/explorer/blockscout/getInternalTransactionsByAddressHash.js.map +1 -1
- package/_cjs/explorer/blockscout/getInternalTransactionsByTransactionHash.js +2 -1
- package/_cjs/explorer/blockscout/getInternalTransactionsByTransactionHash.js.map +1 -1
- package/_cjs/explorer/blockscout/getTokenTransferEventsByAddress.js +2 -1
- package/_cjs/explorer/blockscout/getTokenTransferEventsByAddress.js.map +1 -1
- package/_cjs/explorer/blockscout/getTransactionsByAddress.js +2 -1
- package/_cjs/explorer/blockscout/getTransactionsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/client.js +2 -2
- package/_cjs/explorer/etherscan/client.js.map +1 -1
- package/_cjs/explorer/etherscan/create.js +19 -10
- package/_cjs/explorer/etherscan/create.js.map +1 -1
- package/_cjs/explorer/etherscan/getBlockNumberByTimestamp.js +2 -1
- package/_cjs/explorer/etherscan/getBlockNumberByTimestamp.js.map +1 -1
- package/_cjs/explorer/etherscan/getContractCreatorAndCreationTxHash.js +2 -1
- package/_cjs/explorer/etherscan/getContractCreatorAndCreationTxHash.js.map +1 -1
- package/_cjs/explorer/etherscan/getContractSourceCodeForVerifiedContract.js +2 -1
- package/_cjs/explorer/etherscan/getContractSourceCodeForVerifiedContract.js.map +1 -1
- package/_cjs/explorer/etherscan/getEventLogsByAddressFilteredByTopics.js +2 -1
- package/_cjs/explorer/etherscan/getEventLogsByAddressFilteredByTopics.js.map +1 -1
- package/_cjs/explorer/etherscan/getInternalTransactionsByTransactionHash.js +2 -1
- package/_cjs/explorer/etherscan/getInternalTransactionsByTransactionHash.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfErc1155TokenTransferEventsByAddress.js +2 -1
- package/_cjs/explorer/etherscan/getListOfErc1155TokenTransferEventsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js +2 -1
- package/_cjs/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfErc721TokenTransferEventsByAddress.js +2 -1
- package/_cjs/explorer/etherscan/getListOfErc721TokenTransferEventsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfInternalTransactionsByAddress.js +2 -1
- package/_cjs/explorer/etherscan/getListOfInternalTransactionsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfNormalTransactionsByAddress.js +2 -1
- package/_cjs/explorer/etherscan/getListOfNormalTransactionsByAddress.js.map +1 -1
- package/_cjs/explorer/moralis/client.js +2 -2
- package/_cjs/explorer/moralis/client.js.map +1 -1
- package/_cjs/explorer/moralis/create.js +7 -5
- package/_cjs/explorer/moralis/create.js.map +1 -1
- package/_cjs/explorer/moralis/getWalletTransactionHistory.js +2 -1
- package/_cjs/explorer/moralis/getWalletTransactionHistory.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/allValue.js +9 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/allValue.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/erc1155Pattern.js +12 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/erc1155Pattern.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/erc20Pattern.js +12 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/erc20Pattern.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/internalTransferGenerator.js +12 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/internalTransferGenerator.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/join.js +9 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/join.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/transferGenerator.js +12 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/transferGenerator.js.map +1 -1
- package/_cjs/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.js +36 -3
- package/_cjs/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.js.map +1 -1
- package/_esm/chain/definitions/arbitrumOne.js +1 -2
- package/_esm/chain/definitions/arbitrumOne.js.map +1 -1
- package/_esm/chain/definitions/astar.js +1 -2
- package/_esm/chain/definitions/astar.js.map +1 -1
- package/_esm/chain/definitions/astarZkEvm.js +1 -2
- package/_esm/chain/definitions/astarZkEvm.js.map +1 -1
- package/_esm/chain/definitions/avalancheC.js +1 -2
- package/_esm/chain/definitions/avalancheC.js.map +1 -1
- package/_esm/chain/definitions/base.js +1 -2
- package/_esm/chain/definitions/base.js.map +1 -1
- package/_esm/chain/definitions/blast.js +1 -2
- package/_esm/chain/definitions/blast.js.map +1 -1
- package/_esm/chain/definitions/bsc.js +1 -2
- package/_esm/chain/definitions/bsc.js.map +1 -1
- package/_esm/chain/definitions/doge.js +1 -2
- package/_esm/chain/definitions/doge.js.map +1 -1
- package/_esm/chain/definitions/ethereum.js +19 -17
- package/_esm/chain/definitions/ethereum.js.map +1 -1
- package/_esm/chain/definitions/fantom.js +1 -2
- package/_esm/chain/definitions/fantom.js.map +1 -1
- package/_esm/chain/definitions/linea.js +1 -2
- package/_esm/chain/definitions/linea.js.map +1 -1
- package/_esm/chain/definitions/mantaPacific.js +1 -2
- package/_esm/chain/definitions/mantaPacific.js.map +1 -1
- package/_esm/chain/definitions/mantle.js +1 -2
- package/_esm/chain/definitions/mantle.js.map +1 -1
- package/_esm/chain/definitions/metis.js +1 -2
- package/_esm/chain/definitions/metis.js.map +1 -1
- package/_esm/chain/definitions/moonbeam.js +1 -2
- package/_esm/chain/definitions/moonbeam.js.map +1 -1
- package/_esm/chain/definitions/moonriver.js +1 -2
- package/_esm/chain/definitions/moonriver.js.map +1 -1
- package/_esm/chain/definitions/oasys.js +1 -2
- package/_esm/chain/definitions/oasys.js.map +1 -1
- package/_esm/chain/definitions/opBnb.js +1 -2
- package/_esm/chain/definitions/opBnb.js.map +1 -1
- package/_esm/chain/definitions/optimism.js +1 -2
- package/_esm/chain/definitions/optimism.js.map +1 -1
- package/_esm/chain/definitions/polygonPos.js +1 -2
- package/_esm/chain/definitions/polygonPos.js.map +1 -1
- package/_esm/chain/definitions/ronin.js +1 -2
- package/_esm/chain/definitions/ronin.js.map +1 -1
- package/_esm/chain/definitions/scroll.js +1 -2
- package/_esm/chain/definitions/scroll.js.map +1 -1
- package/_esm/chain/definitions/zkFair.js +1 -2
- package/_esm/chain/definitions/zkFair.js.map +1 -1
- package/_esm/chain/definitions/zkSyncEra.js +1 -2
- package/_esm/chain/definitions/zkSyncEra.js.map +1 -1
- package/_esm/chain/definitions/zora.js +1 -2
- package/_esm/chain/definitions/zora.js.map +1 -1
- package/_esm/explorer/blockscout/client.js +2 -2
- package/_esm/explorer/blockscout/client.js.map +1 -1
- package/_esm/explorer/blockscout/create.js +18 -10
- package/_esm/explorer/blockscout/create.js.map +1 -1
- package/_esm/explorer/blockscout/getBlockNumberByTimestamp.js +2 -1
- package/_esm/explorer/blockscout/getBlockNumberByTimestamp.js.map +1 -1
- package/_esm/explorer/blockscout/getContractCreatorAddressHashAndCreationTransactionHash.js +2 -1
- package/_esm/explorer/blockscout/getContractCreatorAddressHashAndCreationTransactionHash.js.map +1 -1
- package/_esm/explorer/blockscout/getContractSourceCodeForAVerifiedContract.js +2 -1
- package/_esm/explorer/blockscout/getContractSourceCodeForAVerifiedContract.js.map +1 -1
- package/_esm/explorer/blockscout/getEventLogsByAddressAndTopic.js +2 -1
- package/_esm/explorer/blockscout/getEventLogsByAddressAndTopic.js.map +1 -1
- package/_esm/explorer/blockscout/getInternalTransactionsByAddressHash.js +2 -1
- package/_esm/explorer/blockscout/getInternalTransactionsByAddressHash.js.map +1 -1
- package/_esm/explorer/blockscout/getInternalTransactionsByTransactionHash.js +2 -1
- package/_esm/explorer/blockscout/getInternalTransactionsByTransactionHash.js.map +1 -1
- package/_esm/explorer/blockscout/getTokenTransferEventsByAddress.js +2 -1
- package/_esm/explorer/blockscout/getTokenTransferEventsByAddress.js.map +1 -1
- package/_esm/explorer/blockscout/getTransactionsByAddress.js +2 -1
- package/_esm/explorer/blockscout/getTransactionsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/client.js +2 -2
- package/_esm/explorer/etherscan/client.js.map +1 -1
- package/_esm/explorer/etherscan/create.js +19 -10
- package/_esm/explorer/etherscan/create.js.map +1 -1
- package/_esm/explorer/etherscan/getBlockNumberByTimestamp.js +2 -1
- package/_esm/explorer/etherscan/getBlockNumberByTimestamp.js.map +1 -1
- package/_esm/explorer/etherscan/getContractCreatorAndCreationTxHash.js +2 -1
- package/_esm/explorer/etherscan/getContractCreatorAndCreationTxHash.js.map +1 -1
- package/_esm/explorer/etherscan/getContractSourceCodeForVerifiedContract.js +2 -1
- package/_esm/explorer/etherscan/getContractSourceCodeForVerifiedContract.js.map +1 -1
- package/_esm/explorer/etherscan/getEventLogsByAddressFilteredByTopics.js +2 -1
- package/_esm/explorer/etherscan/getEventLogsByAddressFilteredByTopics.js.map +1 -1
- package/_esm/explorer/etherscan/getInternalTransactionsByTransactionHash.js +2 -1
- package/_esm/explorer/etherscan/getInternalTransactionsByTransactionHash.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfErc1155TokenTransferEventsByAddress.js +2 -1
- package/_esm/explorer/etherscan/getListOfErc1155TokenTransferEventsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js +2 -1
- package/_esm/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfErc721TokenTransferEventsByAddress.js +2 -1
- package/_esm/explorer/etherscan/getListOfErc721TokenTransferEventsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfInternalTransactionsByAddress.js +2 -1
- package/_esm/explorer/etherscan/getListOfInternalTransactionsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfNormalTransactionsByAddress.js +2 -1
- package/_esm/explorer/etherscan/getListOfNormalTransactionsByAddress.js.map +1 -1
- package/_esm/explorer/moralis/client.js +2 -2
- package/_esm/explorer/moralis/client.js.map +1 -1
- package/_esm/explorer/moralis/create.js +7 -5
- package/_esm/explorer/moralis/create.js.map +1 -1
- package/_esm/explorer/moralis/getWalletTransactionHistory.js +2 -1
- package/_esm/explorer/moralis/getWalletTransactionHistory.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/allValue.js +9 -1
- package/_esm/logic/analyzeTransaction/createActions/json/allValue.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/erc1155Pattern.js +12 -1
- package/_esm/logic/analyzeTransaction/createActions/json/erc1155Pattern.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/erc20Pattern.js +12 -1
- package/_esm/logic/analyzeTransaction/createActions/json/erc20Pattern.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/internalTransferGenerator.js +12 -1
- package/_esm/logic/analyzeTransaction/createActions/json/internalTransferGenerator.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/join.js +9 -1
- package/_esm/logic/analyzeTransaction/createActions/json/join.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/transferGenerator.js +12 -1
- package/_esm/logic/analyzeTransaction/createActions/json/transferGenerator.js.map +1 -1
- package/_esm/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.js +36 -3
- package/_esm/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.js.map +1 -1
- package/_types/chain/definitions/arbitrumOne.d.ts +1 -2
- package/_types/chain/definitions/arbitrumOne.d.ts.map +1 -1
- package/_types/chain/definitions/astar.d.ts +1 -2
- package/_types/chain/definitions/astar.d.ts.map +1 -1
- package/_types/chain/definitions/astarZkEvm.d.ts +1 -2
- package/_types/chain/definitions/astarZkEvm.d.ts.map +1 -1
- package/_types/chain/definitions/avalancheC.d.ts +1 -2
- package/_types/chain/definitions/avalancheC.d.ts.map +1 -1
- package/_types/chain/definitions/base.d.ts +1 -2
- package/_types/chain/definitions/base.d.ts.map +1 -1
- package/_types/chain/definitions/blast.d.ts +1 -2
- package/_types/chain/definitions/blast.d.ts.map +1 -1
- package/_types/chain/definitions/bsc.d.ts +1 -2
- package/_types/chain/definitions/bsc.d.ts.map +1 -1
- package/_types/chain/definitions/doge.d.ts +1 -2
- package/_types/chain/definitions/doge.d.ts.map +1 -1
- package/_types/chain/definitions/ethereum.d.ts +1 -2
- package/_types/chain/definitions/ethereum.d.ts.map +1 -1
- package/_types/chain/definitions/fantom.d.ts +1 -2
- package/_types/chain/definitions/fantom.d.ts.map +1 -1
- package/_types/chain/definitions/linea.d.ts +1 -2
- package/_types/chain/definitions/linea.d.ts.map +1 -1
- package/_types/chain/definitions/mantaPacific.d.ts +1 -2
- package/_types/chain/definitions/mantaPacific.d.ts.map +1 -1
- package/_types/chain/definitions/mantle.d.ts +1 -2
- package/_types/chain/definitions/mantle.d.ts.map +1 -1
- package/_types/chain/definitions/metis.d.ts +1 -2
- package/_types/chain/definitions/metis.d.ts.map +1 -1
- package/_types/chain/definitions/moonbeam.d.ts +1 -2
- package/_types/chain/definitions/moonbeam.d.ts.map +1 -1
- package/_types/chain/definitions/moonriver.d.ts +1 -2
- package/_types/chain/definitions/moonriver.d.ts.map +1 -1
- package/_types/chain/definitions/oasys.d.ts +1 -2
- package/_types/chain/definitions/oasys.d.ts.map +1 -1
- package/_types/chain/definitions/opBnb.d.ts +1 -2
- package/_types/chain/definitions/opBnb.d.ts.map +1 -1
- package/_types/chain/definitions/optimism.d.ts +1 -2
- package/_types/chain/definitions/optimism.d.ts.map +1 -1
- package/_types/chain/definitions/polygonPos.d.ts +1 -2
- package/_types/chain/definitions/polygonPos.d.ts.map +1 -1
- package/_types/chain/definitions/ronin.d.ts +1 -2
- package/_types/chain/definitions/ronin.d.ts.map +1 -1
- package/_types/chain/definitions/scroll.d.ts +1 -2
- package/_types/chain/definitions/scroll.d.ts.map +1 -1
- package/_types/chain/definitions/zkFair.d.ts +1 -1
- package/_types/chain/definitions/zkFair.d.ts.map +1 -1
- package/_types/chain/definitions/zkSyncEra.d.ts +1 -2
- package/_types/chain/definitions/zkSyncEra.d.ts.map +1 -1
- package/_types/chain/definitions/zora.d.ts +1 -2
- package/_types/chain/definitions/zora.d.ts.map +1 -1
- package/_types/explorer/blockscout/client.d.ts +2 -2
- package/_types/explorer/blockscout/client.d.ts.map +1 -1
- package/_types/explorer/blockscout/create.d.ts +1 -2
- package/_types/explorer/blockscout/create.d.ts.map +1 -1
- package/_types/explorer/blockscout/getBlockNumberByTimestamp.d.ts +2 -1
- package/_types/explorer/blockscout/getBlockNumberByTimestamp.d.ts.map +1 -1
- package/_types/explorer/blockscout/getContractCreatorAddressHashAndCreationTransactionHash.d.ts +2 -1
- package/_types/explorer/blockscout/getContractCreatorAddressHashAndCreationTransactionHash.d.ts.map +1 -1
- package/_types/explorer/blockscout/getContractSourceCodeForAVerifiedContract.d.ts +2 -1
- package/_types/explorer/blockscout/getContractSourceCodeForAVerifiedContract.d.ts.map +1 -1
- package/_types/explorer/blockscout/getEventLogsByAddressAndTopic.d.ts +2 -1
- package/_types/explorer/blockscout/getEventLogsByAddressAndTopic.d.ts.map +1 -1
- package/_types/explorer/blockscout/getInternalTransactionsByAddressHash.d.ts +2 -1
- package/_types/explorer/blockscout/getInternalTransactionsByAddressHash.d.ts.map +1 -1
- package/_types/explorer/blockscout/getInternalTransactionsByTransactionHash.d.ts +2 -1
- package/_types/explorer/blockscout/getInternalTransactionsByTransactionHash.d.ts.map +1 -1
- package/_types/explorer/blockscout/getTokenTransferEventsByAddress.d.ts +2 -1
- package/_types/explorer/blockscout/getTokenTransferEventsByAddress.d.ts.map +1 -1
- package/_types/explorer/blockscout/getTransactionsByAddress.d.ts +2 -1
- package/_types/explorer/blockscout/getTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/client.d.ts +2 -2
- package/_types/explorer/etherscan/client.d.ts.map +1 -1
- package/_types/explorer/etherscan/create.d.ts +1 -2
- package/_types/explorer/etherscan/create.d.ts.map +1 -1
- package/_types/explorer/etherscan/getBlockNumberByTimestamp.d.ts +2 -1
- package/_types/explorer/etherscan/getBlockNumberByTimestamp.d.ts.map +1 -1
- package/_types/explorer/etherscan/getContractCreatorAndCreationTxHash.d.ts +2 -1
- package/_types/explorer/etherscan/getContractCreatorAndCreationTxHash.d.ts.map +1 -1
- package/_types/explorer/etherscan/getContractSourceCodeForVerifiedContract.d.ts +2 -1
- package/_types/explorer/etherscan/getContractSourceCodeForVerifiedContract.d.ts.map +1 -1
- package/_types/explorer/etherscan/getEventLogsByAddressFilteredByTopics.d.ts +2 -1
- package/_types/explorer/etherscan/getEventLogsByAddressFilteredByTopics.d.ts.map +1 -1
- package/_types/explorer/etherscan/getInternalTransactionsByTransactionHash.d.ts +2 -1
- package/_types/explorer/etherscan/getInternalTransactionsByTransactionHash.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfErc1155TokenTransferEventsByAddress.d.ts +2 -1
- package/_types/explorer/etherscan/getListOfErc1155TokenTransferEventsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.d.ts +2 -1
- package/_types/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfErc721TokenTransferEventsByAddress.d.ts +2 -1
- package/_types/explorer/etherscan/getListOfErc721TokenTransferEventsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfInternalTransactionsByAddress.d.ts +2 -1
- package/_types/explorer/etherscan/getListOfInternalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfNormalTransactionsByAddress.d.ts +2 -1
- package/_types/explorer/etherscan/getListOfNormalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorer/moralis/client.d.ts +2 -2
- package/_types/explorer/moralis/client.d.ts.map +1 -1
- package/_types/explorer/moralis/create.d.ts +1 -2
- package/_types/explorer/moralis/create.d.ts.map +1 -1
- package/_types/explorer/moralis/getWalletTransactionHistory.d.ts +2 -1
- package/_types/explorer/moralis/getWalletTransactionHistory.d.ts.map +1 -1
- package/_types/explorer/types.d.ts +8 -0
- package/_types/explorer/types.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/allValue.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/erc1155Pattern.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/erc20Pattern.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/join.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/transferGenerator.d.ts.map +1 -1
- package/_types/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.d.ts.map +1 -1
- package/analyzer/.DS_Store +0 -0
- package/chain/.DS_Store +0 -0
- package/chain/definitions/arbitrumOne.ts +0 -3
- package/chain/definitions/astar.ts +0 -3
- package/chain/definitions/astarZkEvm.ts +0 -3
- package/chain/definitions/avalancheC.ts +0 -3
- package/chain/definitions/base.ts +0 -3
- package/chain/definitions/blast.ts +0 -3
- package/chain/definitions/bsc.ts +0 -3
- package/chain/definitions/doge.ts +0 -3
- package/chain/definitions/ethereum.ts +18 -18
- package/chain/definitions/fantom.ts +0 -3
- package/chain/definitions/linea.ts +0 -3
- package/chain/definitions/mantaPacific.ts +0 -3
- package/chain/definitions/mantle.ts +0 -3
- package/chain/definitions/metis.ts +0 -3
- package/chain/definitions/moonbeam.ts +0 -3
- package/chain/definitions/moonriver.ts +0 -3
- package/chain/definitions/oasys.ts +0 -3
- package/chain/definitions/opBnb.ts +0 -3
- package/chain/definitions/optimism.ts +0 -3
- package/chain/definitions/polygonPos.ts +0 -3
- package/chain/definitions/ronin.ts +0 -3
- package/chain/definitions/scroll.ts +0 -3
- package/chain/definitions/zkFair.ts +0 -2
- package/chain/definitions/zkSyncEra.ts +0 -3
- package/chain/definitions/zora.ts +0 -3
- package/client/.DS_Store +0 -0
- package/explorer/.DS_Store +0 -0
- package/explorer/blockscout/client.ts +3 -2
- package/explorer/blockscout/create.ts +32 -10
- package/explorer/blockscout/getBlockNumberByTimestamp.ts +3 -0
- package/explorer/blockscout/getContractCreatorAddressHashAndCreationTransactionHash.ts +3 -0
- package/explorer/blockscout/getContractSourceCodeForAVerifiedContract.ts +3 -0
- package/explorer/blockscout/getEventLogsByAddressAndTopic.ts +3 -0
- package/explorer/blockscout/getInternalTransactionsByAddressHash.ts +3 -0
- package/explorer/blockscout/getInternalTransactionsByTransactionHash.ts +3 -0
- package/explorer/blockscout/getTokenTransferEventsByAddress.ts +3 -0
- package/explorer/blockscout/getTransactionsByAddress.ts +3 -0
- package/explorer/etherscan/client.ts +3 -2
- package/explorer/etherscan/create.ts +33 -10
- package/explorer/etherscan/getBlockNumberByTimestamp.ts +3 -0
- package/explorer/etherscan/getContractCreatorAndCreationTxHash.ts +3 -0
- package/explorer/etherscan/getContractSourceCodeForVerifiedContract.ts +3 -0
- package/explorer/etherscan/getEventLogsByAddressFilteredByTopics.ts +3 -0
- package/explorer/etherscan/getInternalTransactionsByTransactionHash.ts +3 -0
- package/explorer/etherscan/getListOfErc1155TokenTransferEventsByAddress.ts +3 -0
- package/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.ts +3 -0
- package/explorer/etherscan/getListOfErc721TokenTransferEventsByAddress.ts +3 -0
- package/explorer/etherscan/getListOfInternalTransactionsByAddress.ts +3 -0
- package/explorer/etherscan/getListOfNormalTransactionsByAddress.ts +3 -0
- package/explorer/moralis/client.ts +3 -2
- package/explorer/moralis/create.ts +6 -3
- package/explorer/moralis/getWalletTransactionHistory.ts +3 -0
- package/explorer/types.ts +8 -0
- package/logic/analyzeTransaction/createActions/json/allValue.ts +9 -1
- package/logic/analyzeTransaction/createActions/json/erc1155Pattern.ts +12 -1
- package/logic/analyzeTransaction/createActions/json/erc20Pattern.ts +12 -1
- package/logic/analyzeTransaction/createActions/json/internalTransferGenerator.ts +12 -1
- package/logic/analyzeTransaction/createActions/json/join.ts +9 -1
- package/logic/analyzeTransaction/createActions/json/transferGenerator.ts +12 -1
- package/logic/analyzeTransaction/createActions/json/verifyTxSatisfiesCondition.ts +36 -3
- package/package.json +2 -2
|
@@ -10,19 +10,18 @@ export type BlockscoutClient = {
|
|
|
10
10
|
path: string
|
|
11
11
|
query: Record<string, string>
|
|
12
12
|
resultSchema: ZodType<Output, Def, Input>
|
|
13
|
+
headers?: Record<string, string>
|
|
13
14
|
}) => Promise<Output>
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
type CreateBlockscoutClientParameters = {
|
|
17
18
|
apiBaseUrl: string
|
|
18
19
|
proxyUrl?: string
|
|
19
|
-
headers?: Record<string, string>
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const createBlockscoutClient = ({
|
|
23
23
|
apiBaseUrl,
|
|
24
24
|
proxyUrl,
|
|
25
|
-
headers,
|
|
26
25
|
}: CreateBlockscoutClientParameters): BlockscoutClient => {
|
|
27
26
|
const rateLimitPerSecond = 5
|
|
28
27
|
const requestTimestamps: number[] = []
|
|
@@ -36,10 +35,12 @@ export const createBlockscoutClient = ({
|
|
|
36
35
|
path,
|
|
37
36
|
query,
|
|
38
37
|
resultSchema,
|
|
38
|
+
headers,
|
|
39
39
|
}: {
|
|
40
40
|
path: string
|
|
41
41
|
query: Record<string, string>
|
|
42
42
|
resultSchema: ZodType<Output, Def, Input>
|
|
43
|
+
headers?: Record<string, string>
|
|
43
44
|
},
|
|
44
45
|
repeat = 0,
|
|
45
46
|
): Promise<Output> => {
|
|
@@ -18,7 +18,6 @@ type CreateBlockscoutParameters = {
|
|
|
18
18
|
baseUrl: string
|
|
19
19
|
apiBaseUrl: string
|
|
20
20
|
proxyUrl?: string
|
|
21
|
-
headers?: Record<string, string>
|
|
22
21
|
}
|
|
23
22
|
|
|
24
23
|
export const createBlockscout = ({
|
|
@@ -26,14 +25,18 @@ export const createBlockscout = ({
|
|
|
26
25
|
baseUrl,
|
|
27
26
|
apiBaseUrl,
|
|
28
27
|
proxyUrl,
|
|
29
|
-
headers,
|
|
30
28
|
}: CreateBlockscoutParameters): Explorer => {
|
|
31
|
-
const client = createBlockscoutClient({ apiBaseUrl, proxyUrl
|
|
29
|
+
const client = createBlockscoutClient({ apiBaseUrl, proxyUrl })
|
|
32
30
|
|
|
33
31
|
return {
|
|
34
32
|
name,
|
|
35
33
|
baseUrl,
|
|
36
|
-
getAddressInternalTransactions: async ({
|
|
34
|
+
getAddressInternalTransactions: async ({
|
|
35
|
+
address,
|
|
36
|
+
fromBlock,
|
|
37
|
+
toBlock,
|
|
38
|
+
headers,
|
|
39
|
+
}) => {
|
|
37
40
|
const internalTransactions = new Map<
|
|
38
41
|
string,
|
|
39
42
|
InternalTransactionWithIndex
|
|
@@ -47,6 +50,7 @@ export const createBlockscout = ({
|
|
|
47
50
|
address,
|
|
48
51
|
startblock,
|
|
49
52
|
endblock,
|
|
53
|
+
headers,
|
|
50
54
|
})
|
|
51
55
|
for (const transaction of result) {
|
|
52
56
|
const id = createInternalTransactionId(transaction)
|
|
@@ -62,7 +66,12 @@ export const createBlockscout = ({
|
|
|
62
66
|
}
|
|
63
67
|
return [...internalTransactions.values()]
|
|
64
68
|
},
|
|
65
|
-
getAddressTransactionIndexes: async ({
|
|
69
|
+
getAddressTransactionIndexes: async ({
|
|
70
|
+
address,
|
|
71
|
+
fromBlock,
|
|
72
|
+
toBlock,
|
|
73
|
+
headers,
|
|
74
|
+
}) => {
|
|
66
75
|
const indexes = new Map<LowerHex, TransactionIndex>()
|
|
67
76
|
let startblock = fromBlock
|
|
68
77
|
const endblock = toBlock
|
|
@@ -73,6 +82,7 @@ export const createBlockscout = ({
|
|
|
73
82
|
address,
|
|
74
83
|
startblock,
|
|
75
84
|
endblock,
|
|
85
|
+
headers,
|
|
76
86
|
})
|
|
77
87
|
for (const index of result) {
|
|
78
88
|
if (!indexes.has(index.hash)) {
|
|
@@ -87,7 +97,12 @@ export const createBlockscout = ({
|
|
|
87
97
|
}
|
|
88
98
|
return [...indexes.values()]
|
|
89
99
|
},
|
|
90
|
-
getAddressTokenTransferIndexes: async ({
|
|
100
|
+
getAddressTokenTransferIndexes: async ({
|
|
101
|
+
address,
|
|
102
|
+
fromBlock,
|
|
103
|
+
toBlock,
|
|
104
|
+
headers,
|
|
105
|
+
}) => {
|
|
91
106
|
const indexes = new Map<LowerHex, TransactionIndex>()
|
|
92
107
|
let startblock = fromBlock
|
|
93
108
|
const endblock = toBlock
|
|
@@ -98,6 +113,7 @@ export const createBlockscout = ({
|
|
|
98
113
|
address,
|
|
99
114
|
startblock,
|
|
100
115
|
endblock,
|
|
116
|
+
headers,
|
|
101
117
|
})
|
|
102
118
|
for (const index of result) {
|
|
103
119
|
if (!indexes.has(index.hash)) {
|
|
@@ -112,26 +128,30 @@ export const createBlockscout = ({
|
|
|
112
128
|
}
|
|
113
129
|
return [...indexes.values()]
|
|
114
130
|
},
|
|
115
|
-
getBlockNumberOfTimestamp: ({ timestamp }) =>
|
|
131
|
+
getBlockNumberOfTimestamp: ({ timestamp, headers }) =>
|
|
116
132
|
getBlockNumberByTimestamp({
|
|
117
133
|
client,
|
|
118
134
|
timestamp: Math.floor(timestamp / 1000),
|
|
135
|
+
headers,
|
|
119
136
|
}),
|
|
120
|
-
getContract: ({ address }) =>
|
|
137
|
+
getContract: ({ address, headers }) =>
|
|
121
138
|
getContractSourceCodeForAVerifiedContract({
|
|
122
139
|
client,
|
|
123
140
|
address,
|
|
141
|
+
headers,
|
|
124
142
|
}),
|
|
125
|
-
getContractCreations: ({ addresses }) =>
|
|
143
|
+
getContractCreations: ({ addresses, headers }) =>
|
|
126
144
|
getContractCreatorAddressHashAndCreationTransactionHash({
|
|
127
145
|
client,
|
|
128
146
|
contractaddresses: addresses,
|
|
147
|
+
headers,
|
|
129
148
|
}),
|
|
130
149
|
getEventLogs: async ({
|
|
131
150
|
address,
|
|
132
151
|
topic0,
|
|
133
152
|
fromBlock: fromBlockParam,
|
|
134
153
|
toBlock: toBlockParam,
|
|
154
|
+
headers,
|
|
135
155
|
}) => {
|
|
136
156
|
const logs: LogWithBlockNumber[] = []
|
|
137
157
|
let fromBlock = fromBlockParam ?? 0
|
|
@@ -144,6 +164,7 @@ export const createBlockscout = ({
|
|
|
144
164
|
topic0,
|
|
145
165
|
fromBlock,
|
|
146
166
|
toBlock,
|
|
167
|
+
headers,
|
|
147
168
|
})
|
|
148
169
|
logs.push(...result)
|
|
149
170
|
if (result.length < maxPageSize) {
|
|
@@ -154,10 +175,11 @@ export const createBlockscout = ({
|
|
|
154
175
|
}
|
|
155
176
|
return logs
|
|
156
177
|
},
|
|
157
|
-
getInternalTransactionOfTransaction: ({ hash }) =>
|
|
178
|
+
getInternalTransactionOfTransaction: ({ hash, headers }) =>
|
|
158
179
|
getInternalTransactionsByTransactionHash({
|
|
159
180
|
client,
|
|
160
181
|
txhash: hash,
|
|
182
|
+
headers,
|
|
161
183
|
}),
|
|
162
184
|
}
|
|
163
185
|
}
|
|
@@ -6,6 +6,7 @@ type GetBlockNumberByTimestampParameters = {
|
|
|
6
6
|
/** Unix timestamp in seconds */
|
|
7
7
|
timestamp: number
|
|
8
8
|
closest?: 'before' | 'after'
|
|
9
|
+
headers?: Record<string, string>
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const resultSchema = z.object({
|
|
@@ -17,6 +18,7 @@ export const getBlockNumberByTimestamp = async ({
|
|
|
17
18
|
client,
|
|
18
19
|
timestamp,
|
|
19
20
|
closest = 'before',
|
|
21
|
+
headers,
|
|
20
22
|
}: GetBlockNumberByTimestampParameters) => {
|
|
21
23
|
const result = await client.get({
|
|
22
24
|
path: '',
|
|
@@ -27,6 +29,7 @@ export const getBlockNumberByTimestamp = async ({
|
|
|
27
29
|
closest,
|
|
28
30
|
},
|
|
29
31
|
resultSchema,
|
|
32
|
+
headers,
|
|
30
33
|
})
|
|
31
34
|
return result.blockNumber
|
|
32
35
|
}
|
|
@@ -7,6 +7,7 @@ import type { BlockscoutClient } from './client'
|
|
|
7
7
|
type GetContractCreatorAddressHashAndCreationTransactionHashParameters = {
|
|
8
8
|
client: BlockscoutClient
|
|
9
9
|
contractaddresses: Hex[]
|
|
10
|
+
headers?: Record<string, string>
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const contractCreationSchema = z.object({
|
|
@@ -20,6 +21,7 @@ const resultSchema = z.array(contractCreationSchema)
|
|
|
20
21
|
export const getContractCreatorAddressHashAndCreationTransactionHash = async ({
|
|
21
22
|
client,
|
|
22
23
|
contractaddresses,
|
|
24
|
+
headers,
|
|
23
25
|
}: GetContractCreatorAddressHashAndCreationTransactionHashParameters): Promise<
|
|
24
26
|
ContractCreation[]
|
|
25
27
|
> => {
|
|
@@ -31,6 +33,7 @@ export const getContractCreatorAddressHashAndCreationTransactionHash = async ({
|
|
|
31
33
|
contractaddresses: contractaddresses.join(','),
|
|
32
34
|
},
|
|
33
35
|
resultSchema,
|
|
36
|
+
headers,
|
|
34
37
|
})
|
|
35
38
|
return result
|
|
36
39
|
}
|
|
@@ -6,6 +6,7 @@ import type { BlockscoutClient } from './client'
|
|
|
6
6
|
type GetContractSourceCodeForAVerifiedContractParameters = {
|
|
7
7
|
client: BlockscoutClient
|
|
8
8
|
address: Hex
|
|
9
|
+
headers?: Record<string, string>
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const resultSchema = z.array(
|
|
@@ -19,6 +20,7 @@ const resultSchema = z.array(
|
|
|
19
20
|
export const getContractSourceCodeForAVerifiedContract = async ({
|
|
20
21
|
client,
|
|
21
22
|
address,
|
|
23
|
+
headers,
|
|
22
24
|
}: GetContractSourceCodeForAVerifiedContractParameters): Promise<
|
|
23
25
|
Contract | undefined
|
|
24
26
|
> => {
|
|
@@ -30,6 +32,7 @@ export const getContractSourceCodeForAVerifiedContract = async ({
|
|
|
30
32
|
address,
|
|
31
33
|
},
|
|
32
34
|
resultSchema,
|
|
35
|
+
headers,
|
|
33
36
|
})
|
|
34
37
|
if (result.length === 0) {
|
|
35
38
|
return undefined
|
|
@@ -10,6 +10,7 @@ type GetEventLogsByAddressAndTopicParameters = {
|
|
|
10
10
|
topic0: LowerHex
|
|
11
11
|
fromBlock: number | 'latest'
|
|
12
12
|
toBlock: number | 'latest'
|
|
13
|
+
headers?: Record<string, string>
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const logSchema = z.object({
|
|
@@ -37,6 +38,7 @@ export const getEventLogsByAddressAndTopic = async ({
|
|
|
37
38
|
topic0,
|
|
38
39
|
fromBlock,
|
|
39
40
|
toBlock,
|
|
41
|
+
headers,
|
|
40
42
|
}: GetEventLogsByAddressAndTopicParameters): Promise<LogWithBlockNumber[]> => {
|
|
41
43
|
try {
|
|
42
44
|
const result = await client.get({
|
|
@@ -50,6 +52,7 @@ export const getEventLogsByAddressAndTopic = async ({
|
|
|
50
52
|
toBlock: toBlock.toString(),
|
|
51
53
|
},
|
|
52
54
|
resultSchema,
|
|
55
|
+
headers,
|
|
53
56
|
})
|
|
54
57
|
return result
|
|
55
58
|
} catch (error) {
|
|
@@ -16,6 +16,7 @@ type GetInternalTransactionsByAddressHashParameters = {
|
|
|
16
16
|
page?: number
|
|
17
17
|
offset?: number
|
|
18
18
|
sort?: 'asc' | 'desc'
|
|
19
|
+
headers?: Record<string, string>
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const internalTransactionSchema = z.object({
|
|
@@ -56,6 +57,7 @@ export const getInternalTransactionsByAddressHash = async ({
|
|
|
56
57
|
page = 1,
|
|
57
58
|
offset = 10_000,
|
|
58
59
|
sort = 'asc',
|
|
60
|
+
headers,
|
|
59
61
|
}: GetInternalTransactionsByAddressHashParameters): Promise<
|
|
60
62
|
InternalTransactionWithIndex[]
|
|
61
63
|
> => {
|
|
@@ -77,6 +79,7 @@ export const getInternalTransactionsByAddressHash = async ({
|
|
|
77
79
|
sort,
|
|
78
80
|
},
|
|
79
81
|
resultSchema,
|
|
82
|
+
headers,
|
|
80
83
|
})
|
|
81
84
|
return result.map((v) => ({
|
|
82
85
|
blockNumber: v.blockNumber,
|
|
@@ -11,6 +11,7 @@ import type { BlockscoutClient } from './client'
|
|
|
11
11
|
type GetInternalTransactionsByTransactionHashParameters = {
|
|
12
12
|
client: BlockscoutClient
|
|
13
13
|
txhash: LowerHex
|
|
14
|
+
headers?: Record<string, string>
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const internalTransactionSchema = z.object({
|
|
@@ -46,6 +47,7 @@ const resultSchema = z.array(internalTransactionSchema)
|
|
|
46
47
|
export const getInternalTransactionsByTransactionHash = async ({
|
|
47
48
|
client,
|
|
48
49
|
txhash,
|
|
50
|
+
headers,
|
|
49
51
|
}: GetInternalTransactionsByTransactionHashParameters): Promise<
|
|
50
52
|
InternalTransactionWithIndex[]
|
|
51
53
|
> => {
|
|
@@ -58,6 +60,7 @@ export const getInternalTransactionsByTransactionHash = async ({
|
|
|
58
60
|
txhash,
|
|
59
61
|
},
|
|
60
62
|
resultSchema,
|
|
63
|
+
headers,
|
|
61
64
|
})
|
|
62
65
|
return result.map((v) => ({
|
|
63
66
|
blockNumber: v.blockNumber,
|
|
@@ -11,6 +11,7 @@ type GetTokenTransferEventsByAddressParameters = {
|
|
|
11
11
|
page?: number
|
|
12
12
|
offset?: number
|
|
13
13
|
sort?: 'asc' | 'desc'
|
|
14
|
+
headers?: Record<string, string>
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const transferSchema = z.object({
|
|
@@ -29,6 +30,7 @@ export const getTokenTransferEventsByAddress = async ({
|
|
|
29
30
|
page = 1,
|
|
30
31
|
offset = 10_000,
|
|
31
32
|
sort = 'asc',
|
|
33
|
+
headers,
|
|
32
34
|
}: GetTokenTransferEventsByAddressParameters): Promise<
|
|
33
35
|
readonly TransactionIndex[]
|
|
34
36
|
> => {
|
|
@@ -50,6 +52,7 @@ export const getTokenTransferEventsByAddress = async ({
|
|
|
50
52
|
sort,
|
|
51
53
|
},
|
|
52
54
|
resultSchema,
|
|
55
|
+
headers,
|
|
53
56
|
})
|
|
54
57
|
return result.map((v) => ({
|
|
55
58
|
blockNumber: v.blockNumber,
|
|
@@ -12,6 +12,7 @@ type GetTransactionsByAddressParameters = {
|
|
|
12
12
|
page?: number
|
|
13
13
|
offset?: number
|
|
14
14
|
sort?: 'asc' | 'desc'
|
|
15
|
+
headers?: Record<string, string>
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const transactionSchema = z.object({
|
|
@@ -30,6 +31,7 @@ export const getTransactionsByAddress = async ({
|
|
|
30
31
|
page = 1,
|
|
31
32
|
offset = 10_000,
|
|
32
33
|
sort = 'asc',
|
|
34
|
+
headers,
|
|
33
35
|
}: GetTransactionsByAddressParameters): Promise<TransactionIndex[]> => {
|
|
34
36
|
try {
|
|
35
37
|
const result = await client.get({
|
|
@@ -49,6 +51,7 @@ export const getTransactionsByAddress = async ({
|
|
|
49
51
|
sort,
|
|
50
52
|
},
|
|
51
53
|
resultSchema,
|
|
54
|
+
headers,
|
|
52
55
|
})
|
|
53
56
|
return result.map((v) => ({
|
|
54
57
|
blockNumber: v.blockNumber,
|
|
@@ -10,6 +10,7 @@ export type EtherscanClient = {
|
|
|
10
10
|
path: string
|
|
11
11
|
query: Record<string, string>
|
|
12
12
|
resultSchema: ZodType<Output, Def, Input>
|
|
13
|
+
headers?: Record<string, string>
|
|
13
14
|
}) => Promise<Output>
|
|
14
15
|
}
|
|
15
16
|
|
|
@@ -17,14 +18,12 @@ type CreateEtherscanClientParameters = {
|
|
|
17
18
|
apiBaseUrl: string
|
|
18
19
|
apiKey?: string
|
|
19
20
|
proxyUrl?: string
|
|
20
|
-
headers?: Record<string, string>
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export const createEtherscanClient = ({
|
|
24
24
|
apiBaseUrl,
|
|
25
25
|
apiKey,
|
|
26
26
|
proxyUrl,
|
|
27
|
-
headers,
|
|
28
27
|
}: CreateEtherscanClientParameters): EtherscanClient => {
|
|
29
28
|
// apiKey = undefined かつ proxyUrl = undefined の場合はエラー
|
|
30
29
|
if (apiKey === undefined && proxyUrl === undefined) {
|
|
@@ -43,10 +42,12 @@ export const createEtherscanClient = ({
|
|
|
43
42
|
path,
|
|
44
43
|
query,
|
|
45
44
|
resultSchema,
|
|
45
|
+
headers,
|
|
46
46
|
}: {
|
|
47
47
|
path: string
|
|
48
48
|
query: Record<string, string>
|
|
49
49
|
resultSchema: ZodType<Output, Def, Input>
|
|
50
|
+
headers?: Record<string, string>
|
|
50
51
|
},
|
|
51
52
|
repeat = 0,
|
|
52
53
|
): Promise<Output> => {
|
|
@@ -21,7 +21,6 @@ type CreateEtherscanParameters = {
|
|
|
21
21
|
apiBaseUrl: string
|
|
22
22
|
apiKey?: string
|
|
23
23
|
proxyUrl?: string
|
|
24
|
-
headers?: Record<string, string>
|
|
25
24
|
pageSize?: number
|
|
26
25
|
}
|
|
27
26
|
|
|
@@ -31,20 +30,23 @@ export const createEtherscan = ({
|
|
|
31
30
|
apiBaseUrl,
|
|
32
31
|
apiKey,
|
|
33
32
|
proxyUrl,
|
|
34
|
-
headers,
|
|
35
33
|
pageSize = 10_000,
|
|
36
34
|
}: CreateEtherscanParameters): Explorer => {
|
|
37
35
|
const client = createEtherscanClient({
|
|
38
36
|
apiBaseUrl,
|
|
39
37
|
apiKey,
|
|
40
38
|
proxyUrl,
|
|
41
|
-
headers,
|
|
42
39
|
})
|
|
43
40
|
|
|
44
41
|
return {
|
|
45
42
|
name,
|
|
46
43
|
baseUrl,
|
|
47
|
-
getAddressInternalTransactions: async ({
|
|
44
|
+
getAddressInternalTransactions: async ({
|
|
45
|
+
address,
|
|
46
|
+
fromBlock,
|
|
47
|
+
toBlock,
|
|
48
|
+
headers,
|
|
49
|
+
}) => {
|
|
48
50
|
const internalTransactions = new Map<
|
|
49
51
|
string,
|
|
50
52
|
InternalTransactionWithIndex
|
|
@@ -58,6 +60,7 @@ export const createEtherscan = ({
|
|
|
58
60
|
startblock,
|
|
59
61
|
endblock,
|
|
60
62
|
offset: pageSize,
|
|
63
|
+
headers,
|
|
61
64
|
})
|
|
62
65
|
for (const transaction of result) {
|
|
63
66
|
const id = createInternalTransactionId(transaction)
|
|
@@ -73,7 +76,12 @@ export const createEtherscan = ({
|
|
|
73
76
|
}
|
|
74
77
|
return [...internalTransactions.values()]
|
|
75
78
|
},
|
|
76
|
-
getAddressTransactionIndexes: async ({
|
|
79
|
+
getAddressTransactionIndexes: async ({
|
|
80
|
+
address,
|
|
81
|
+
fromBlock,
|
|
82
|
+
toBlock,
|
|
83
|
+
headers,
|
|
84
|
+
}) => {
|
|
77
85
|
const indexes = new Map<LowerHex, TransactionIndex>()
|
|
78
86
|
let startblock = fromBlock
|
|
79
87
|
const endblock = toBlock
|
|
@@ -84,6 +92,7 @@ export const createEtherscan = ({
|
|
|
84
92
|
startblock,
|
|
85
93
|
endblock,
|
|
86
94
|
offset: pageSize,
|
|
95
|
+
headers,
|
|
87
96
|
})
|
|
88
97
|
for (const index of result) {
|
|
89
98
|
if (!indexes.has(index.hash)) {
|
|
@@ -98,7 +107,12 @@ export const createEtherscan = ({
|
|
|
98
107
|
}
|
|
99
108
|
return [...indexes.values()]
|
|
100
109
|
},
|
|
101
|
-
getAddressTokenTransferIndexes: async ({
|
|
110
|
+
getAddressTokenTransferIndexes: async ({
|
|
111
|
+
address,
|
|
112
|
+
fromBlock,
|
|
113
|
+
toBlock,
|
|
114
|
+
headers,
|
|
115
|
+
}) => {
|
|
102
116
|
const indexes = new Map<LowerHex, TransactionIndex>()
|
|
103
117
|
const endblock = toBlock
|
|
104
118
|
|
|
@@ -111,6 +125,7 @@ export const createEtherscan = ({
|
|
|
111
125
|
startblock,
|
|
112
126
|
endblock,
|
|
113
127
|
offset: pageSize,
|
|
128
|
+
headers,
|
|
114
129
|
})
|
|
115
130
|
for (const index of result) {
|
|
116
131
|
if (!indexes.has(index.hash)) {
|
|
@@ -133,6 +148,7 @@ export const createEtherscan = ({
|
|
|
133
148
|
startblock,
|
|
134
149
|
endblock,
|
|
135
150
|
offset: pageSize,
|
|
151
|
+
headers,
|
|
136
152
|
})
|
|
137
153
|
for (const index of result) {
|
|
138
154
|
if (!indexes.has(index.hash)) {
|
|
@@ -155,6 +171,7 @@ export const createEtherscan = ({
|
|
|
155
171
|
startblock,
|
|
156
172
|
endblock,
|
|
157
173
|
offset: pageSize,
|
|
174
|
+
headers,
|
|
158
175
|
})
|
|
159
176
|
for (const index of result) {
|
|
160
177
|
if (!indexes.has(index.hash)) {
|
|
@@ -170,26 +187,30 @@ export const createEtherscan = ({
|
|
|
170
187
|
|
|
171
188
|
return [...indexes.values()]
|
|
172
189
|
},
|
|
173
|
-
getBlockNumberOfTimestamp: ({ timestamp }): Promise<number> =>
|
|
190
|
+
getBlockNumberOfTimestamp: ({ timestamp, headers }): Promise<number> =>
|
|
174
191
|
getBlockNumberByTimestamp({
|
|
175
192
|
client,
|
|
176
193
|
timestamp: Math.floor(timestamp / 1000),
|
|
194
|
+
headers,
|
|
177
195
|
}),
|
|
178
|
-
getContract: ({ address }) =>
|
|
196
|
+
getContract: ({ address, headers }) =>
|
|
179
197
|
getContractSourceCodeForVerifiedContract({
|
|
180
198
|
client,
|
|
181
199
|
address,
|
|
200
|
+
headers,
|
|
182
201
|
}),
|
|
183
|
-
getContractCreations: ({ addresses }) =>
|
|
202
|
+
getContractCreations: ({ addresses, headers }) =>
|
|
184
203
|
getContractCreatorAndCreationTxHash({
|
|
185
204
|
client,
|
|
186
205
|
contractaddresses: addresses,
|
|
206
|
+
headers,
|
|
187
207
|
}),
|
|
188
208
|
getEventLogs: async ({
|
|
189
209
|
address,
|
|
190
210
|
topic0,
|
|
191
211
|
fromBlock: fromBlockParam,
|
|
192
212
|
toBlock,
|
|
213
|
+
headers,
|
|
193
214
|
}) => {
|
|
194
215
|
const logs: LogWithBlockNumber[] = []
|
|
195
216
|
let fromBlock = fromBlockParam ?? 0
|
|
@@ -201,6 +222,7 @@ export const createEtherscan = ({
|
|
|
201
222
|
topic0,
|
|
202
223
|
fromBlock,
|
|
203
224
|
toBlock,
|
|
225
|
+
headers,
|
|
204
226
|
})
|
|
205
227
|
logs.push(...result)
|
|
206
228
|
if (result.length < maxPageSize) {
|
|
@@ -211,10 +233,11 @@ export const createEtherscan = ({
|
|
|
211
233
|
}
|
|
212
234
|
return logs
|
|
213
235
|
},
|
|
214
|
-
getInternalTransactionOfTransaction: ({ hash }) =>
|
|
236
|
+
getInternalTransactionOfTransaction: ({ hash, headers }) =>
|
|
215
237
|
getInternalTransactionsByTransactionHash({
|
|
216
238
|
client,
|
|
217
239
|
txhash: hash,
|
|
240
|
+
headers,
|
|
218
241
|
}),
|
|
219
242
|
}
|
|
220
243
|
}
|
|
@@ -6,6 +6,7 @@ type GetBlockNumberByTimestampParameters = {
|
|
|
6
6
|
/** Unix timestamp in seconds */
|
|
7
7
|
timestamp: number
|
|
8
8
|
closest?: 'before' | 'after'
|
|
9
|
+
headers?: Record<string, string>
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const resultSchema = z.string().regex(/^\d+$/).transform(Number)
|
|
@@ -15,6 +16,7 @@ export const getBlockNumberByTimestamp = async ({
|
|
|
15
16
|
client,
|
|
16
17
|
timestamp,
|
|
17
18
|
closest = 'before',
|
|
19
|
+
headers,
|
|
18
20
|
}: GetBlockNumberByTimestampParameters) => {
|
|
19
21
|
const result = await client.get({
|
|
20
22
|
path: '',
|
|
@@ -25,6 +27,7 @@ export const getBlockNumberByTimestamp = async ({
|
|
|
25
27
|
closest,
|
|
26
28
|
},
|
|
27
29
|
resultSchema,
|
|
30
|
+
headers,
|
|
28
31
|
})
|
|
29
32
|
return result
|
|
30
33
|
}
|
|
@@ -7,6 +7,7 @@ import type { EtherscanClient } from './client'
|
|
|
7
7
|
type GetContractCreatorAndCreationTxHashParameters = {
|
|
8
8
|
client: EtherscanClient
|
|
9
9
|
contractaddresses: Hex[]
|
|
10
|
+
headers?: Record<string, string>
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const contractCreationSchema = z.object({
|
|
@@ -20,6 +21,7 @@ const resultSchema = z.array(contractCreationSchema)
|
|
|
20
21
|
export const getContractCreatorAndCreationTxHash = async ({
|
|
21
22
|
client,
|
|
22
23
|
contractaddresses,
|
|
24
|
+
headers,
|
|
23
25
|
}: GetContractCreatorAndCreationTxHashParameters): Promise<
|
|
24
26
|
ContractCreation[]
|
|
25
27
|
> => {
|
|
@@ -32,6 +34,7 @@ export const getContractCreatorAndCreationTxHash = async ({
|
|
|
32
34
|
contractaddresses: contractaddresses.join(','),
|
|
33
35
|
},
|
|
34
36
|
resultSchema,
|
|
37
|
+
headers,
|
|
35
38
|
})
|
|
36
39
|
return result
|
|
37
40
|
} catch (error) {
|
|
@@ -6,6 +6,7 @@ import type { EtherscanClient } from './client'
|
|
|
6
6
|
type GetContractSourceCodeForVerifiedContractParameters = {
|
|
7
7
|
client: EtherscanClient
|
|
8
8
|
address: Hex
|
|
9
|
+
headers?: Record<string, string>
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const resultSchema = z.array(
|
|
@@ -19,6 +20,7 @@ const resultSchema = z.array(
|
|
|
19
20
|
export const getContractSourceCodeForVerifiedContract = async ({
|
|
20
21
|
client,
|
|
21
22
|
address,
|
|
23
|
+
headers,
|
|
22
24
|
}: GetContractSourceCodeForVerifiedContractParameters): Promise<
|
|
23
25
|
Contract | undefined
|
|
24
26
|
> => {
|
|
@@ -30,6 +32,7 @@ export const getContractSourceCodeForVerifiedContract = async ({
|
|
|
30
32
|
address,
|
|
31
33
|
},
|
|
32
34
|
resultSchema,
|
|
35
|
+
headers,
|
|
33
36
|
})
|
|
34
37
|
if (result.length === 0) {
|
|
35
38
|
return undefined
|
|
@@ -11,6 +11,7 @@ type GetEventLogsByAddressFilteredByTopicsParameters = {
|
|
|
11
11
|
topic0: LowerHex
|
|
12
12
|
fromBlock?: number
|
|
13
13
|
toBlock?: number
|
|
14
|
+
headers?: Record<string, string>
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const logSchema = z.object({
|
|
@@ -38,6 +39,7 @@ export const getEventLogsByAddressFilteredByTopics = async ({
|
|
|
38
39
|
topic0,
|
|
39
40
|
fromBlock,
|
|
40
41
|
toBlock,
|
|
42
|
+
headers,
|
|
41
43
|
}: GetEventLogsByAddressFilteredByTopicsParameters): Promise<
|
|
42
44
|
LogWithBlockNumber[]
|
|
43
45
|
> => {
|
|
@@ -53,6 +55,7 @@ export const getEventLogsByAddressFilteredByTopics = async ({
|
|
|
53
55
|
...(toBlock === undefined ? {} : { toBlock: toBlock.toString() }),
|
|
54
56
|
},
|
|
55
57
|
resultSchema,
|
|
58
|
+
headers,
|
|
56
59
|
})
|
|
57
60
|
return result
|
|
58
61
|
} catch (error) {
|
|
@@ -7,6 +7,7 @@ import type { EtherscanClient } from './client'
|
|
|
7
7
|
type GetInternalTransactionsByTransactionHashParameters = {
|
|
8
8
|
client: EtherscanClient
|
|
9
9
|
txhash: LowerHex
|
|
10
|
+
headers?: Record<string, string>
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const internalTransactionSchema = z.object({
|
|
@@ -40,6 +41,7 @@ const resultSchema = z.array(internalTransactionSchema)
|
|
|
40
41
|
export const getInternalTransactionsByTransactionHash = async ({
|
|
41
42
|
client,
|
|
42
43
|
txhash,
|
|
44
|
+
headers,
|
|
43
45
|
}: GetInternalTransactionsByTransactionHashParameters): Promise<
|
|
44
46
|
InternalTransactionWithIndex[]
|
|
45
47
|
> => {
|
|
@@ -52,6 +54,7 @@ export const getInternalTransactionsByTransactionHash = async ({
|
|
|
52
54
|
txhash,
|
|
53
55
|
},
|
|
54
56
|
resultSchema,
|
|
57
|
+
headers,
|
|
55
58
|
})
|
|
56
59
|
return result.map((v) => ({
|
|
57
60
|
blockNumber: v.blockNumber,
|
|
@@ -11,6 +11,7 @@ type GetListOfErc1155TokenTransferEventsByAddressParameters = {
|
|
|
11
11
|
page?: number
|
|
12
12
|
offset?: number
|
|
13
13
|
sort?: 'asc' | 'desc'
|
|
14
|
+
headers?: Record<string, string>
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
const transferSchema = z.object({
|
|
@@ -29,6 +30,7 @@ export const getListOfErc1155TokenTransferEventsByAddress = async ({
|
|
|
29
30
|
page = 1,
|
|
30
31
|
offset = 10_000,
|
|
31
32
|
sort = 'asc',
|
|
33
|
+
headers,
|
|
32
34
|
}: GetListOfErc1155TokenTransferEventsByAddressParameters): Promise<
|
|
33
35
|
TransactionIndex[]
|
|
34
36
|
> => {
|
|
@@ -50,6 +52,7 @@ export const getListOfErc1155TokenTransferEventsByAddress = async ({
|
|
|
50
52
|
sort,
|
|
51
53
|
},
|
|
52
54
|
resultSchema,
|
|
55
|
+
headers,
|
|
53
56
|
})
|
|
54
57
|
return result.map((v) => ({
|
|
55
58
|
blockNumber: v.blockNumber,
|