dequanto 0.2.38 → 0.2.40
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/lib/cjs/abi/$abiCoder.js +1 -1
- package/lib/cjs/abi/$abiCoder.js.map +1 -1
- package/lib/cjs/abi/Logger.js +1 -1
- package/lib/cjs/abi/abi-coder-packed.js +3 -3
- package/lib/cjs/abi/abi-coder.js +16 -16
- package/lib/cjs/abi/coders/abstract-coder.js +31 -31
- package/lib/cjs/abi/coders/abstract-coder.js.map +1 -1
- package/lib/cjs/abi/fragments.js +90 -90
- package/lib/cjs/abi/fragments.js.map +1 -1
- package/lib/cjs/blocks/BlockDateResolver.js +9 -9
- package/lib/cjs/blocks/BlockDateResolver.js.map +1 -1
- package/lib/cjs/class/PackedRanges.js +46 -46
- package/lib/cjs/class/PackedRanges.js.map +1 -1
- package/lib/cjs/clients/ClientEventsStream.js +1 -1
- package/lib/cjs/clients/ClientEventsStream.js.map +1 -1
- package/lib/cjs/clients/ClientPool.js +23 -23
- package/lib/cjs/clients/ClientPool.js.map +1 -1
- package/lib/cjs/clients/WalletClient.js +3 -3
- package/lib/cjs/clients/WalletClient.js.map +1 -1
- package/lib/cjs/clients/Web3Client.js +14 -14
- package/lib/cjs/clients/Web3Client.js.map +1 -1
- package/lib/cjs/clients/Web3ClientFactory.js +1 -1
- package/lib/cjs/clients/Web3ClientFactory.js.map +1 -1
- package/lib/cjs/clients/compatibility/Web3.js +2 -2
- package/lib/cjs/clients/compatibility/Web3.js.map +1 -1
- package/lib/cjs/clients/handlers/RateLimitGuard.js +16 -16
- package/lib/cjs/clients/handlers/RateLimitGuard.js.map +1 -1
- package/lib/cjs/clients/model/PromiEventWrap.js +1 -1
- package/lib/cjs/clients/model/PromiEventWrap.js.map +1 -1
- package/lib/cjs/clients/utils/$web3Abi.js +2 -2
- package/lib/cjs/clients/utils/$web3Abi.js.map +1 -1
- package/lib/cjs/clients/utils/ClientErrorUtil.js +4 -0
- package/lib/cjs/clients/utils/ClientErrorUtil.js.map +1 -1
- package/lib/cjs/config/Config.js.map +1 -1
- package/lib/cjs/contracts/Contract.js +1 -1
- package/lib/cjs/contracts/Contract.js.map +1 -1
- package/lib/cjs/contracts/ContractAbiProvider.js +6 -6
- package/lib/cjs/contracts/ContractAbiProvider.js.map +1 -1
- package/lib/cjs/contracts/ContractBase.js +10 -10
- package/lib/cjs/contracts/ContractBase.js.map +1 -1
- package/lib/cjs/contracts/ContractProvider.js +1 -1
- package/lib/cjs/contracts/ContractProvider.js.map +1 -1
- package/lib/cjs/contracts/ContractReader.js +5 -5
- package/lib/cjs/contracts/ContractReader.js.map +1 -1
- package/lib/cjs/contracts/ContractWriter.js +4 -4
- package/lib/cjs/contracts/ContractWriter.js.map +1 -1
- package/lib/cjs/contracts/deploy/ContractDeployer.js +4 -4
- package/lib/cjs/contracts/deploy/ContractDeployer.js.map +1 -1
- package/lib/cjs/contracts/deploy/Deployments.js +36 -21
- package/lib/cjs/contracts/deploy/Deployments.js.map +1 -1
- package/lib/cjs/contracts/deploy/proxy/$proxyDeploy.js +13 -13
- package/lib/cjs/contracts/deploy/proxy/$proxyDeploy.js.map +1 -1
- package/lib/cjs/contracts/deploy/proxy/ProxyDeployment.js +22 -22
- package/lib/cjs/contracts/deploy/proxy/ProxyDeployment.js.map +1 -1
- package/lib/cjs/contracts/deploy/storage/DeploymentsStorage.js +15 -14
- package/lib/cjs/contracts/deploy/storage/DeploymentsStorage.js.map +1 -1
- package/lib/cjs/contracts/utils/AbiDeserializer.js +4 -4
- package/lib/cjs/contracts/utils/AbiDeserializer.js.map +1 -1
- package/lib/cjs/contracts/utils/ContractBaseUtils.js +3 -3
- package/lib/cjs/contracts/utils/ContractBaseUtils.js.map +1 -1
- package/lib/cjs/evm/OpcodesWalker.js +1 -1
- package/lib/cjs/evm/OpcodesWalker.js.map +1 -1
- package/lib/cjs/explorer/BlockchainExplorer.js +1 -1
- package/lib/cjs/explorer/BlockchainExplorer.js.map +1 -1
- package/lib/cjs/explorer/BlockchainExplorerFactory.js +1 -1
- package/lib/cjs/explorer/BlockchainExplorerStorage.js +12 -12
- package/lib/cjs/explorer/BlockchainExplorerStorage.js.map +1 -1
- package/lib/cjs/explorer/Evmscan.js +1 -1
- package/lib/cjs/explorer/verifiers/FsHtmlVerifier.js +7 -7
- package/lib/cjs/explorer/verifiers/FsHtmlVerifier.js.map +1 -1
- package/lib/cjs/flashbots/FlashbotWeb3Client.js +1 -1
- package/lib/cjs/flashbots/FlashbotWeb3Client.js.map +1 -1
- package/lib/cjs/hardhat/HardhatProvider.js +7 -7
- package/lib/cjs/hardhat/HardhatProvider.js.map +1 -1
- package/lib/cjs/indexer/BlocksTxIndexer.js +2 -2
- package/lib/cjs/indexer/BlocksTxIndexer.js.map +1 -1
- package/lib/cjs/indexer/EventsIndexer.js +11 -11
- package/lib/cjs/indexer/EventsIndexer.js.map +1 -1
- package/lib/cjs/indexer/PendingTxIndexer.js +2 -2
- package/lib/cjs/indexer/PendingTxIndexer.js.map +1 -1
- package/lib/cjs/indexer/handlers/BlocksWalker.js +9 -9
- package/lib/cjs/indexer/handlers/BlocksWalker.js.map +1 -1
- package/lib/cjs/indexer/handlers/TxQueueLoader.js +1 -1
- package/lib/cjs/indexer/storage/FsEventsIndexerStore.js +3 -3
- package/lib/cjs/indexer/storage/FsEventsIndexerStore.js.map +1 -1
- package/lib/cjs/indexer/storage/FsEventsStoreUtils.js +1 -1
- package/lib/cjs/indexer/storage/FsEventsStoreUtils.js.map +1 -1
- package/lib/cjs/json/JsonArrayMultiStore.js +1 -1
- package/lib/cjs/json/JsonArrayMultiStore.js.map +1 -1
- package/lib/cjs/json/JsonStoreFs.js +1 -1
- package/lib/cjs/json/JsonStoreFs.js.map +1 -1
- package/lib/cjs/rpc/$rpc.js +2 -2
- package/lib/cjs/rpc/$rpc.js.map +1 -1
- package/lib/cjs/rpc/Rpc.js +2 -2
- package/lib/cjs/rpc/RpcBase.js +2 -2
- package/lib/cjs/rpc/RpcBase.js.map +1 -1
- package/lib/cjs/rpc/RpcContract.js +4 -3
- package/lib/cjs/rpc/RpcContract.js.map +1 -1
- package/lib/cjs/rpc/RpcSubscription.js +1 -1
- package/lib/cjs/rpc/RpcSubscription.js.map +1 -1
- package/lib/cjs/rpc/transports/compatibility/EIP1193Transport.js +4 -4
- package/lib/cjs/rpc/transports/compatibility/EIP1193Transport.js.map +1 -1
- package/lib/cjs/rpc/transports/compatibility/Web3Transport.js +1 -1
- package/lib/cjs/rpc/transports/compatibility/Web3Transport.js.map +1 -1
- package/lib/cjs/services/TimelockService/TimelockService.js +2 -2
- package/lib/cjs/services/TimelockService/TimelockServiceFallbackSafe.js +2 -2
- package/lib/cjs/solidity/SlotsDump.js +1 -1
- package/lib/cjs/solidity/SlotsDump.js.map +1 -1
- package/lib/cjs/solidity/SlotsParser/MappingSettersResolver.js +3 -3
- package/lib/cjs/solidity/SlotsParser/MappingSettersResolver.js.map +1 -1
- package/lib/cjs/solidity/SlotsParser/SourceFile.js +3 -3
- package/lib/cjs/solidity/SlotsParser/SourceFile.js.map +1 -1
- package/lib/cjs/solidity/SolidityParser.js +1 -1
- package/lib/cjs/solidity/SolidityParser.js.map +1 -1
- package/lib/cjs/solidity/SourceCodeProvider.js +1 -1
- package/lib/cjs/solidity/SourceCodeProvider.js.map +1 -1
- package/lib/cjs/solidity/storage/Accessor.js +1 -1
- package/lib/cjs/solidity/storage/Accessor.js.map +1 -1
- package/lib/cjs/solidity/storage/SlotFixedArray.js +1 -1
- package/lib/cjs/solidity/storage/SlotFixedArray.js.map +1 -1
- package/lib/cjs/solidity/storage/SlotsStorageTransport.js +3 -3
- package/lib/cjs/solidity/storage/SlotsStorageTransport.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotBytesHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotBytesHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotDynamicArrayHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotDynamicArrayHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotFixedArrayHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotFixedArrayHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueConstantHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueConstantHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueHandler.js +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueHandler.js.map +1 -1
- package/lib/cjs/solidity/storage/handlers/SlotValueImmutableHandler.js +4 -4
- package/lib/cjs/solidity/storage/handlers/SlotValueImmutableHandler.js.map +1 -1
- package/lib/cjs/tokens/TokenDataProvider.js +2 -2
- package/lib/cjs/tokens/TokenDataProvider.js.map +1 -1
- package/lib/cjs/tokens/TokenExchangeService.js +1 -1
- package/lib/cjs/tokens/TokenExchangeService.js.map +1 -1
- package/lib/cjs/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js +2 -2
- package/lib/cjs/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js.map +1 -1
- package/lib/cjs/tokens/TokenExchanges/AmmV2PriceQuote.js +2 -2
- package/lib/cjs/tokens/TokenExchanges/AmmV2PriceQuote.js.map +1 -1
- package/lib/cjs/tokens/TokenOracles/amm/AmmV1Oracle.js +2 -2
- package/lib/cjs/tokens/TokenOracles/amm/AmmV1Oracle.js.map +1 -1
- package/lib/cjs/tokens/TokenTransferService.js +2 -2
- package/lib/cjs/tokens/TokenTransferService.js.map +1 -1
- package/lib/cjs/tokens/TokensService.js +1 -1
- package/lib/cjs/tokens/TokensService.js.map +1 -1
- package/lib/cjs/txs/TxNonceManager.js +1 -1
- package/lib/cjs/txs/TxWriter.js +9 -0
- package/lib/cjs/txs/TxWriter.js.map +1 -1
- package/lib/cjs/txs/conditional/GasWatcherTx.js +1 -1
- package/lib/cjs/txs/conditional/GasWatcherTx.js.map +1 -1
- package/lib/cjs/txs/receipt/TxLogParser.js +1 -1
- package/lib/cjs/utils/$crypto.js +1 -1
- package/lib/cjs/utils/$crypto.js.map +1 -1
- package/lib/cjs/utils/$date.js +1 -1
- package/lib/cjs/utils/$date.js.map +1 -1
- package/lib/cjs/utils/$hex.js +1 -1
- package/lib/cjs/utils/$logger.js +1 -1
- package/lib/cjs/utils/$logger.js.map +1 -1
- package/lib/cjs/utils/$machine.js +2 -2
- package/lib/cjs/utils/$machine.js.map +1 -1
- package/lib/cjs/utils/$traces.js +1 -1
- package/lib/cjs/utils/$traces.js.map +1 -1
- package/lib/esm/abi/$abiCoder.js.map +1 -1
- package/lib/esm/abi/$abiCoder.mjs +1 -1
- package/lib/esm/abi/Logger.mjs +1 -1
- package/lib/esm/abi/abi-coder-packed.mjs +3 -3
- package/lib/esm/abi/abi-coder.mjs +16 -16
- package/lib/esm/abi/coders/abstract-coder.js.map +1 -1
- package/lib/esm/abi/coders/abstract-coder.mjs +31 -31
- package/lib/esm/abi/fragments.js.map +1 -1
- package/lib/esm/abi/fragments.mjs +90 -90
- package/lib/esm/blocks/BlockDateResolver.js.map +1 -1
- package/lib/esm/blocks/BlockDateResolver.mjs +9 -9
- package/lib/esm/class/PackedRanges.js.map +1 -1
- package/lib/esm/class/PackedRanges.mjs +46 -46
- package/lib/esm/clients/ClientEventsStream.js.map +1 -1
- package/lib/esm/clients/ClientEventsStream.mjs +1 -1
- package/lib/esm/clients/ClientPool.js.map +1 -1
- package/lib/esm/clients/ClientPool.mjs +23 -23
- package/lib/esm/clients/WalletClient.js.map +1 -1
- package/lib/esm/clients/WalletClient.mjs +3 -3
- package/lib/esm/clients/Web3Client.js.map +1 -1
- package/lib/esm/clients/Web3Client.mjs +14 -14
- package/lib/esm/clients/Web3ClientFactory.js.map +1 -1
- package/lib/esm/clients/Web3ClientFactory.mjs +1 -1
- package/lib/esm/clients/compatibility/Web3.js.map +1 -1
- package/lib/esm/clients/compatibility/Web3.mjs +2 -2
- package/lib/esm/clients/handlers/RateLimitGuard.js.map +1 -1
- package/lib/esm/clients/handlers/RateLimitGuard.mjs +16 -16
- package/lib/esm/clients/model/PromiEventWrap.js.map +1 -1
- package/lib/esm/clients/model/PromiEventWrap.mjs +1 -1
- package/lib/esm/clients/utils/$web3Abi.js.map +1 -1
- package/lib/esm/clients/utils/$web3Abi.mjs +2 -2
- package/lib/esm/clients/utils/ClientErrorUtil.js.map +1 -1
- package/lib/esm/clients/utils/ClientErrorUtil.mjs +4 -0
- package/lib/esm/config/Config.js.map +1 -1
- package/lib/esm/contracts/Contract.js.map +1 -1
- package/lib/esm/contracts/Contract.mjs +1 -1
- package/lib/esm/contracts/ContractAbiProvider.js.map +1 -1
- package/lib/esm/contracts/ContractAbiProvider.mjs +6 -6
- package/lib/esm/contracts/ContractBase.js.map +1 -1
- package/lib/esm/contracts/ContractBase.mjs +10 -10
- package/lib/esm/contracts/ContractProvider.js.map +1 -1
- package/lib/esm/contracts/ContractProvider.mjs +1 -1
- package/lib/esm/contracts/ContractReader.js.map +1 -1
- package/lib/esm/contracts/ContractReader.mjs +5 -5
- package/lib/esm/contracts/ContractWriter.js.map +1 -1
- package/lib/esm/contracts/ContractWriter.mjs +4 -4
- package/lib/esm/contracts/deploy/ContractDeployer.js.map +1 -1
- package/lib/esm/contracts/deploy/ContractDeployer.mjs +4 -4
- package/lib/esm/contracts/deploy/Deployments.js.map +1 -1
- package/lib/esm/contracts/deploy/Deployments.mjs +36 -21
- package/lib/esm/contracts/deploy/proxy/$proxyDeploy.js.map +1 -1
- package/lib/esm/contracts/deploy/proxy/$proxyDeploy.mjs +13 -13
- package/lib/esm/contracts/deploy/proxy/ProxyDeployment.js.map +1 -1
- package/lib/esm/contracts/deploy/proxy/ProxyDeployment.mjs +22 -22
- package/lib/esm/contracts/deploy/storage/DeploymentsStorage.js.map +1 -1
- package/lib/esm/contracts/deploy/storage/DeploymentsStorage.mjs +15 -14
- package/lib/esm/contracts/utils/AbiDeserializer.js.map +1 -1
- package/lib/esm/contracts/utils/AbiDeserializer.mjs +4 -4
- package/lib/esm/contracts/utils/ContractBaseUtils.js.map +1 -1
- package/lib/esm/contracts/utils/ContractBaseUtils.mjs +3 -3
- package/lib/esm/evm/OpcodesWalker.js.map +1 -1
- package/lib/esm/evm/OpcodesWalker.mjs +1 -1
- package/lib/esm/explorer/BlockchainExplorer.js.map +1 -1
- package/lib/esm/explorer/BlockchainExplorer.mjs +1 -1
- package/lib/esm/explorer/BlockchainExplorerFactory.mjs +1 -1
- package/lib/esm/explorer/BlockchainExplorerStorage.js.map +1 -1
- package/lib/esm/explorer/BlockchainExplorerStorage.mjs +12 -12
- package/lib/esm/explorer/Evmscan.mjs +1 -1
- package/lib/esm/explorer/verifiers/FsHtmlVerifier.js.map +1 -1
- package/lib/esm/explorer/verifiers/FsHtmlVerifier.mjs +7 -7
- package/lib/esm/flashbots/FlashbotWeb3Client.js.map +1 -1
- package/lib/esm/flashbots/FlashbotWeb3Client.mjs +1 -1
- package/lib/esm/hardhat/HardhatProvider.js.map +1 -1
- package/lib/esm/hardhat/HardhatProvider.mjs +7 -7
- package/lib/esm/indexer/BlocksTxIndexer.js.map +1 -1
- package/lib/esm/indexer/BlocksTxIndexer.mjs +2 -2
- package/lib/esm/indexer/EventsIndexer.js.map +1 -1
- package/lib/esm/indexer/EventsIndexer.mjs +11 -11
- package/lib/esm/indexer/PendingTxIndexer.js.map +1 -1
- package/lib/esm/indexer/PendingTxIndexer.mjs +2 -2
- package/lib/esm/indexer/handlers/BlocksWalker.js.map +1 -1
- package/lib/esm/indexer/handlers/BlocksWalker.mjs +9 -9
- package/lib/esm/indexer/handlers/TxQueueLoader.mjs +1 -1
- package/lib/esm/indexer/storage/FsEventsIndexerStore.js.map +1 -1
- package/lib/esm/indexer/storage/FsEventsIndexerStore.mjs +3 -3
- package/lib/esm/indexer/storage/FsEventsStoreUtils.js.map +1 -1
- package/lib/esm/indexer/storage/FsEventsStoreUtils.mjs +1 -1
- package/lib/esm/json/JsonArrayMultiStore.js.map +1 -1
- package/lib/esm/json/JsonArrayMultiStore.mjs +1 -1
- package/lib/esm/json/JsonStoreFs.js.map +1 -1
- package/lib/esm/json/JsonStoreFs.mjs +1 -1
- package/lib/esm/rpc/$rpc.js.map +1 -1
- package/lib/esm/rpc/$rpc.mjs +2 -2
- package/lib/esm/rpc/Rpc.mjs +2 -2
- package/lib/esm/rpc/RpcBase.js.map +1 -1
- package/lib/esm/rpc/RpcBase.mjs +2 -2
- package/lib/esm/rpc/RpcContract.js.map +1 -1
- package/lib/esm/rpc/RpcContract.mjs +4 -3
- package/lib/esm/rpc/RpcSubscription.js.map +1 -1
- package/lib/esm/rpc/RpcSubscription.mjs +1 -1
- package/lib/esm/rpc/transports/compatibility/EIP1193Transport.js.map +1 -1
- package/lib/esm/rpc/transports/compatibility/EIP1193Transport.mjs +4 -4
- package/lib/esm/rpc/transports/compatibility/Web3Transport.js.map +1 -1
- package/lib/esm/rpc/transports/compatibility/Web3Transport.mjs +1 -1
- package/lib/esm/services/TimelockService/TimelockService.mjs +2 -2
- package/lib/esm/services/TimelockService/TimelockServiceFallbackSafe.mjs +2 -2
- package/lib/esm/solidity/SlotsDump.js.map +1 -1
- package/lib/esm/solidity/SlotsDump.mjs +1 -1
- package/lib/esm/solidity/SlotsParser/MappingSettersResolver.js.map +1 -1
- package/lib/esm/solidity/SlotsParser/MappingSettersResolver.mjs +3 -3
- package/lib/esm/solidity/SlotsParser/SourceFile.js.map +1 -1
- package/lib/esm/solidity/SlotsParser/SourceFile.mjs +3 -3
- package/lib/esm/solidity/SolidityParser.js.map +1 -1
- package/lib/esm/solidity/SolidityParser.mjs +1 -1
- package/lib/esm/solidity/SourceCodeProvider.js.map +1 -1
- package/lib/esm/solidity/SourceCodeProvider.mjs +1 -1
- package/lib/esm/solidity/storage/Accessor.js.map +1 -1
- package/lib/esm/solidity/storage/Accessor.mjs +1 -1
- package/lib/esm/solidity/storage/SlotFixedArray.js.map +1 -1
- package/lib/esm/solidity/storage/SlotFixedArray.mjs +1 -1
- package/lib/esm/solidity/storage/SlotsStorageTransport.js.map +1 -1
- package/lib/esm/solidity/storage/SlotsStorageTransport.mjs +3 -3
- package/lib/esm/solidity/storage/handlers/SlotBytesHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotBytesHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotDynamicArrayHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotDynamicArrayHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotFixedArrayHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotFixedArrayHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueConstantHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueConstantHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueHandler.mjs +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueImmutableHandler.js.map +1 -1
- package/lib/esm/solidity/storage/handlers/SlotValueImmutableHandler.mjs +4 -4
- package/lib/esm/tokens/TokenDataProvider.js.map +1 -1
- package/lib/esm/tokens/TokenDataProvider.mjs +2 -2
- package/lib/esm/tokens/TokenExchangeService.js.map +1 -1
- package/lib/esm/tokens/TokenExchangeService.mjs +1 -1
- package/lib/esm/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js.map +1 -1
- package/lib/esm/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.mjs +2 -2
- package/lib/esm/tokens/TokenExchanges/AmmV2PriceQuote.js.map +1 -1
- package/lib/esm/tokens/TokenExchanges/AmmV2PriceQuote.mjs +2 -2
- package/lib/esm/tokens/TokenOracles/amm/AmmV1Oracle.js.map +1 -1
- package/lib/esm/tokens/TokenOracles/amm/AmmV1Oracle.mjs +2 -2
- package/lib/esm/tokens/TokenTransferService.js.map +1 -1
- package/lib/esm/tokens/TokenTransferService.mjs +2 -2
- package/lib/esm/tokens/TokensService.js.map +1 -1
- package/lib/esm/tokens/TokensService.mjs +1 -1
- package/lib/esm/txs/TxNonceManager.mjs +1 -1
- package/lib/esm/txs/TxWriter.js.map +1 -1
- package/lib/esm/txs/TxWriter.mjs +9 -0
- package/lib/esm/txs/conditional/GasWatcherTx.js.map +1 -1
- package/lib/esm/txs/conditional/GasWatcherTx.mjs +1 -1
- package/lib/esm/txs/receipt/TxLogParser.mjs +1 -1
- package/lib/esm/utils/$crypto.js.map +1 -1
- package/lib/esm/utils/$crypto.mjs +1 -1
- package/lib/esm/utils/$date.js.map +1 -1
- package/lib/esm/utils/$date.mjs +1 -1
- package/lib/esm/utils/$hex.mjs +1 -1
- package/lib/esm/utils/$logger.js.map +1 -1
- package/lib/esm/utils/$logger.mjs +1 -1
- package/lib/esm/utils/$machine.js.map +1 -1
- package/lib/esm/utils/$machine.mjs +2 -2
- package/lib/esm/utils/$traces.js.map +1 -1
- package/lib/esm/utils/$traces.mjs +1 -1
- package/lib/types/abi/abi-coder-packed.d.ts +1 -1
- package/lib/types/abi/abi-coder.d.ts +13 -13
- package/lib/types/abi/coders/abstract-coder.d.ts +14 -14
- package/lib/types/abi/fragments.d.ts +95 -95
- package/lib/types/blocks/BlockDateResolver.d.ts +7 -7
- package/lib/types/class/PackedRanges.d.ts +44 -44
- package/lib/types/clients/ClientPool.d.ts +10 -10
- package/lib/types/clients/WalletClient.d.ts +2 -2
- package/lib/types/clients/Web3Client.d.ts +6 -6
- package/lib/types/clients/Web3ClientFactory.d.ts +1 -1
- package/lib/types/clients/handlers/RateLimitGuard.d.ts +5 -5
- package/lib/types/clients/model/PromiEventWrap.d.ts +1 -1
- package/lib/types/clients/utils/$web3Abi.d.ts +1 -1
- package/lib/types/clients/utils/ClientErrorUtil.d.ts +1 -0
- package/lib/types/config/Config.d.ts +3 -2
- package/lib/types/contracts/ContractBase.d.ts +4 -4
- package/lib/types/contracts/ContractReader.d.ts +2 -2
- package/lib/types/contracts/ContractWriter.d.ts +3 -3
- package/lib/types/contracts/deploy/Deployments.d.ts +13 -14
- package/lib/types/contracts/deploy/storage/DeploymentsStorage.d.ts +2 -0
- package/lib/types/explorer/BlockchainExplorerFactory.d.ts +1 -1
- package/lib/types/explorer/Evmscan.d.ts +1 -1
- package/lib/types/indexer/BlocksTxIndexer.d.ts +4 -4
- package/lib/types/indexer/EventsIndexer.d.ts +4 -4
- package/lib/types/indexer/PendingTxIndexer.d.ts +1 -1
- package/lib/types/indexer/handlers/BlocksWalker.d.ts +2 -2
- package/lib/types/indexer/storage/FsEventsIndexerStore.d.ts +4 -4
- package/lib/types/ns/providers/INsProvider.d.ts +1 -1
- package/lib/types/rpc/Rpc.d.ts +2 -2
- package/lib/types/services/TimelockService/ITimelockService.d.ts +2 -2
- package/lib/types/services/TimelockService/TimelockService.d.ts +2 -2
- package/lib/types/services/TimelockService/TimelockServiceFallbackSafe.d.ts +2 -2
- package/lib/types/solidity/SlotsParser/SourceFile.d.ts +1 -1
- package/lib/types/solidity/storage/SlotFixedArray.d.ts +1 -1
- package/lib/types/tokens/TokenDataProvider.d.ts +2 -2
- package/lib/types/tokens/TokensService.d.ts +1 -1
- package/lib/types/txs/ITxBuilderOptions.d.ts +1 -1
- package/lib/types/txs/TxNonceManager.d.ts +1 -1
- package/lib/types/txs/TxWriter.d.ts +4 -4
- package/lib/types/txs/receipt/TxLogParser.d.ts +1 -1
- package/lib/types/utils/$date.d.ts +1 -1
- package/lib/types/utils/$hex.d.ts +1 -1
- package/package.json +1 -1
- package/readme.md +105 -83
- package/src/abi/$abiCoder.ts +1 -1
- package/src/abi/Logger.ts +1 -1
- package/src/abi/abi-coder-packed.ts +3 -3
- package/src/abi/abi-coder.ts +16 -16
- package/src/abi/coders/abstract-coder.ts +36 -36
- package/src/abi/fragments.ts +137 -137
- package/src/blocks/BlockDateResolver.ts +9 -9
- package/src/bridges/hop/HopBridge.ts +1 -1
- package/src/class/PackedRanges.ts +46 -46
- package/src/clients/ClientEventsStream.ts +1 -1
- package/src/clients/ClientPool.ts +38 -38
- package/src/clients/WalletClient.ts +3 -3
- package/src/clients/Web3BatchRequests.ts +3 -3
- package/src/clients/Web3Client.ts +21 -21
- package/src/clients/Web3ClientFactory.ts +1 -1
- package/src/clients/compatibility/Web3.ts +2 -2
- package/src/clients/handlers/RateLimitGuard.ts +16 -16
- package/src/clients/interfaces/IWeb3Client.ts +2 -2
- package/src/clients/model/PromiEventWrap.ts +1 -1
- package/src/clients/utils/$web3Abi.ts +2 -2
- package/src/clients/utils/ClientErrorUtil.ts +4 -0
- package/src/config/Config.ts +4 -3
- package/src/contracts/Contract.ts +1 -1
- package/src/contracts/ContractAbiProvider.ts +6 -6
- package/src/contracts/ContractBase.ts +14 -14
- package/src/contracts/ContractProvider.ts +1 -1
- package/src/contracts/ContractReader.ts +7 -7
- package/src/contracts/ContractWriter.ts +4 -4
- package/src/contracts/deploy/ContractDeployer.ts +4 -4
- package/src/contracts/deploy/ContractDeployment.ts +1 -1
- package/src/contracts/deploy/Deployments.ts +69 -56
- package/src/contracts/deploy/proxy/$proxyDeploy.ts +14 -14
- package/src/contracts/deploy/proxy/ProxyDeployment.ts +22 -22
- package/src/contracts/deploy/storage/DeploymentsStorage.ts +21 -18
- package/src/contracts/utils/AbiDeserializer.ts +4 -4
- package/src/contracts/utils/ContractBaseUtils.ts +3 -3
- package/src/erc4337/models/UserOperation.ts +2 -2
- package/src/evm/OpcodesWalker.ts +1 -1
- package/src/explorer/BlockchainExplorer.ts +1 -1
- package/src/explorer/BlockchainExplorerFactory.ts +1 -1
- package/src/explorer/BlockchainExplorerStorage.ts +12 -12
- package/src/explorer/Evmscan.ts +1 -1
- package/src/explorer/verifiers/FsHtmlVerifier.ts +7 -7
- package/src/flashbots/FlashbotWeb3Client.ts +1 -1
- package/src/hardhat/HardhatProvider.ts +7 -7
- package/src/indexer/BlocksTxIndexer.ts +6 -6
- package/src/indexer/EventsIndexer.ts +20 -20
- package/src/indexer/PendingTxIndexer.ts +3 -3
- package/src/indexer/handlers/BlocksWalker.ts +9 -9
- package/src/indexer/handlers/TxQueueLoader.ts +1 -1
- package/src/indexer/storage/FsEventsIndexerStore.ts +9 -9
- package/src/indexer/storage/FsEventsMetaStore.ts +1 -1
- package/src/indexer/storage/FsEventsStoreUtils.ts +1 -1
- package/src/json/JsonArrayMultiStore.ts +1 -1
- package/src/json/JsonStoreFs.ts +1 -1
- package/src/ns/providers/INsProvider.ts +1 -1
- package/src/rpc/$rpc.ts +2 -2
- package/src/rpc/Rpc.ts +2 -2
- package/src/rpc/RpcBase.ts +2 -2
- package/src/rpc/RpcContract.ts +6 -6
- package/src/rpc/RpcSubscription.ts +1 -1
- package/src/rpc/transports/compatibility/EIP1193Transport.ts +4 -4
- package/src/rpc/transports/compatibility/Web3Transport.ts +1 -1
- package/src/services/TimelockService/ITimelockService.ts +2 -2
- package/src/services/TimelockService/TimelockService.ts +2 -2
- package/src/services/TimelockService/TimelockServiceFallbackSafe.ts +2 -2
- package/src/solidity/SlotsDump.ts +1 -1
- package/src/solidity/SlotsParser/MappingSettersResolver.ts +3 -3
- package/src/solidity/SlotsParser/SourceFile.ts +3 -3
- package/src/solidity/SolidityParser.ts +1 -1
- package/src/solidity/SourceCodeProvider.ts +1 -1
- package/src/solidity/storage/Accessor.spec.ts +1 -1
- package/src/solidity/storage/Accessor.ts +1 -1
- package/src/solidity/storage/SlotDynamicArray.ts +1 -1
- package/src/solidity/storage/SlotFixedArray.ts +1 -1
- package/src/solidity/storage/SlotsStorageTransport.ts +3 -3
- package/src/solidity/storage/handlers/SlotBytesHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotDynamicArrayHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotFixedArrayHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotValueConstantHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotValueHandler.ts +1 -1
- package/src/solidity/storage/handlers/SlotValueImmutableHandler.ts +4 -4
- package/src/tokens/TokenDataProvider.ts +2 -2
- package/src/tokens/TokenExchangeService.ts +1 -1
- package/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.ts +2 -2
- package/src/tokens/TokenExchanges/AmmV2PriceQuote.ts +2 -2
- package/src/tokens/TokenOracles/amm/AmmV1Oracle.ts +2 -2
- package/src/tokens/TokenTransferService.ts +2 -2
- package/src/tokens/TokensService.ts +1 -1
- package/src/txs/ITxBuilderOptions.ts +1 -1
- package/src/txs/TxNonceManager.ts +1 -1
- package/src/txs/TxWriter.ts +15 -4
- package/src/txs/agents/BatchAgent.ts +1 -1
- package/src/txs/conditional/GasWatcherTx.ts +1 -1
- package/src/txs/receipt/TxLogParser.ts +1 -1
- package/src/utils/$crypto.ts +1 -1
- package/src/utils/$date.ts +1 -1
- package/src/utils/$hex.ts +1 -1
- package/src/utils/$logger.ts +1 -1
- package/src/utils/$machine.ts +2 -2
- package/src/utils/$traces.ts +1 -1
- package/src/wallets/EIP6963ProviderFactory.ts +4 -4
|
@@ -7,7 +7,7 @@ import { EIP6963ProviderDetail, EIP6963ProviderFactory } from '@dequanto/wallets
|
|
|
7
7
|
import { WClient } from './ClientPool';
|
|
8
8
|
import { $hex } from '@dequanto/utils/$hex';
|
|
9
9
|
|
|
10
|
-
/** Wallet actions only.
|
|
10
|
+
/** Wallet actions only. Use Web3Client for all node/chain-related actions */
|
|
11
11
|
|
|
12
12
|
export class WalletClient {
|
|
13
13
|
public factory: EIP6963ProviderFactory;
|
|
@@ -18,7 +18,7 @@ export class WalletClient {
|
|
|
18
18
|
|
|
19
19
|
// Client abstract methods
|
|
20
20
|
|
|
21
|
-
//Set the provider by UUID as the default one for eth_** methods
|
|
21
|
+
// Set the provider by UUID as the default one for eth_** methods
|
|
22
22
|
async useProvider (uuid: string) {
|
|
23
23
|
this.factory.useProvider(uuid);
|
|
24
24
|
}
|
|
@@ -37,7 +37,7 @@ export class WalletClient {
|
|
|
37
37
|
return rpc.eth_accounts();
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
/**
|
|
40
|
+
/** Finds the provider by UUID, or uses the first one to connect and request accounts */
|
|
41
41
|
async connect (uuid?: string): Promise<TEth.Address[]> {
|
|
42
42
|
return this.factory.connect(uuid);
|
|
43
43
|
}
|
|
@@ -58,12 +58,12 @@ export namespace Web3BatchRequests {
|
|
|
58
58
|
// if (RateLimitGuard.isBatchLimit(error)) {
|
|
59
59
|
// let num = RateLimitGuard.extractBatchLimitFromError(error);
|
|
60
60
|
// if (num && num < this.requests.length) {
|
|
61
|
-
// //
|
|
61
|
+
// // If the batch limit is lower than the current batch, throw so wClient rereads the batch limit and the pool retries
|
|
62
62
|
// this.promise.reject(error);
|
|
63
63
|
// return;
|
|
64
64
|
// }
|
|
65
65
|
// }
|
|
66
|
-
// l`Web3BatchRequest failed for ${this.results.length}
|
|
66
|
+
// l`Web3BatchRequest failed for a batch of ${this.results.length} with error "${ this.results[0]?.error?.message }". Falling back to single calls.`;
|
|
67
67
|
// this.results = new Array(this.requests.length);
|
|
68
68
|
// this.awaitables = this.requests.length;
|
|
69
69
|
// this.callByOne();
|
|
@@ -98,7 +98,7 @@ export namespace Web3BatchRequests {
|
|
|
98
98
|
|
|
99
99
|
// } catch (error) {
|
|
100
100
|
// if (index > -1) {
|
|
101
|
-
// l`BatchRequester
|
|
101
|
+
// l`BatchRequester failed while processing requests one by one after ${index + 1} requests`;
|
|
102
102
|
// }
|
|
103
103
|
// this.promise.reject(error);
|
|
104
104
|
// }
|
|
@@ -43,7 +43,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
43
43
|
abstract defaultGasLimit: number;
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
// Hardhat network
|
|
46
|
+
// The Hardhat network can be launched in forking mode
|
|
47
47
|
forked?: {
|
|
48
48
|
platform: TPlatform;
|
|
49
49
|
block?: number;
|
|
@@ -53,7 +53,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
53
53
|
defaultGasPriceRatio = 1.4;
|
|
54
54
|
minGasPriorityFee = 0.0012345;
|
|
55
55
|
|
|
56
|
-
//
|
|
56
|
+
// Block time in ms
|
|
57
57
|
blockTimeAvg = 12_000;
|
|
58
58
|
|
|
59
59
|
get network (): TPlatform {
|
|
@@ -76,7 +76,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
76
76
|
|
|
77
77
|
if (this.options.endpoints == null && this.options.web3 == null) {
|
|
78
78
|
console.dir(this.options, { depth: null });
|
|
79
|
-
throw new Error(`Neither
|
|
79
|
+
throw new Error(`Neither node endpoints nor a web3 instance were provided`);
|
|
80
80
|
}
|
|
81
81
|
this.pool = new ClientPool(this.options);
|
|
82
82
|
this.debug = new ClientDebugMethods(this, this.options.debug);
|
|
@@ -109,7 +109,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
109
109
|
let eventAbi = abi.find(x => x.type === 'event' && x.name === event);
|
|
110
110
|
if (eventAbi == null) {
|
|
111
111
|
let events = abi.filter(x => x.type === 'event').map(x => x.name).join(', ');
|
|
112
|
-
throw new Error(`Event "${event}" not present in ABI. Events: ${events}`);
|
|
112
|
+
throw new Error(`Event "${event}" is not present in the ABI. Events: ${events}`);
|
|
113
113
|
}
|
|
114
114
|
let stream = new ClientEventsStream(address, eventAbi);
|
|
115
115
|
this
|
|
@@ -133,7 +133,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
async getWeb3(options?: IPoolWeb3Request) {
|
|
136
|
-
throw new Error(`To get
|
|
136
|
+
throw new Error(`To get web3, initialize the Web3 compatibility class ('compatibility/Web3.ts') instead`)
|
|
137
137
|
}
|
|
138
138
|
async getRpc(options?: IPoolWeb3Request): Promise<Rpc> {
|
|
139
139
|
return await this.pool.getRpc(options);
|
|
@@ -466,7 +466,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
468
|
if (tx.input != null) {
|
|
469
|
-
/** eth_call expects 'data' property, not
|
|
469
|
+
/** eth_call expects the 'data' property, not 'input' as in Transaction */
|
|
470
470
|
tx.data = tx.input;
|
|
471
471
|
delete tx.input;
|
|
472
472
|
}
|
|
@@ -484,18 +484,18 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
484
484
|
|
|
485
485
|
async getPastLogs(filter: RpcTypes.Filter, options?: {
|
|
486
486
|
/**
|
|
487
|
-
* For large block ranges and huge amounts of logs, streaming should be used
|
|
488
|
-
* and do not aggregate to a final logs array to prevent memory issues
|
|
487
|
+
* For large block ranges and huge amounts of logs, streaming should be used. Loaded logs are passed directly to onProgress in batches
|
|
488
|
+
* and do not aggregate to a final logs array to prevent memory issues
|
|
489
489
|
*/
|
|
490
490
|
streamed?: boolean
|
|
491
491
|
/**
|
|
492
|
-
*
|
|
493
|
-
* the RPC exception will be parsed
|
|
492
|
+
* Overrides the default block range limits for all underlying RPC clients. Otherwise, the config will be used or
|
|
493
|
+
* the RPC exception will be parsed
|
|
494
494
|
*/
|
|
495
495
|
blockRangeLimits?: WClient['blockRangeLimits']
|
|
496
496
|
|
|
497
497
|
/**
|
|
498
|
-
* When loading in batches the
|
|
498
|
+
* When loading in batches, the callback will be called with fetched and parsed logs on each iteration
|
|
499
499
|
*/
|
|
500
500
|
onProgress? (info: TLogsRangeProgress<TEth.Log>): void
|
|
501
501
|
}): Promise<TEth.Log[]> {
|
|
@@ -504,7 +504,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
504
504
|
this.pool.MINIMUM_BLOCK_RANGE = Math.min(this.pool.MINIMUM_BLOCK_RANGE, options.blockRangeLimits.blocks);
|
|
505
505
|
}
|
|
506
506
|
|
|
507
|
-
//
|
|
507
|
+
// Ensure numbers, bigints, and bools are in HEX
|
|
508
508
|
filter.topics = filter.topics?.map(mix => {
|
|
509
509
|
if (mix != null && Array.isArray(mix) === false) {
|
|
510
510
|
return $hex.ensure(mix as any)
|
|
@@ -512,7 +512,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
512
512
|
return mix;
|
|
513
513
|
});
|
|
514
514
|
|
|
515
|
-
//
|
|
515
|
+
// Ensure all topics are 32 bytes
|
|
516
516
|
filter.topics = filter.topics?.map(topic => {
|
|
517
517
|
if (typeof topic === 'string' && topic.startsWith('0x')) {
|
|
518
518
|
return $hex.padBytes(topic, 32);
|
|
@@ -540,7 +540,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
540
540
|
|
|
541
541
|
let removedLogs = logs?.filter(x => x.removed === true);
|
|
542
542
|
if (removedLogs?.length > 0) {
|
|
543
|
-
console.error(`Caution:
|
|
543
|
+
console.error(`Caution: there are ${removedLogs.length} removed logs. @dequanto does not handle them because they are not expected to be present in past logs.`);
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
return logs;
|
|
@@ -580,7 +580,7 @@ export abstract class Web3Client implements IWeb3Client {
|
|
|
580
580
|
export type TLogsRangeProgress<TLogParsed> = {
|
|
581
581
|
logs: TLogParsed[]
|
|
582
582
|
|
|
583
|
-
/** @deprecated Use logs for current logs buffer */
|
|
583
|
+
/** @deprecated Use logs for the current logs buffer */
|
|
584
584
|
paged: TLogParsed[]
|
|
585
585
|
latestBlock: number
|
|
586
586
|
blocks: {
|
|
@@ -612,8 +612,8 @@ namespace RangeWorker {
|
|
|
612
612
|
) {
|
|
613
613
|
let { fromBlock, toBlock } = ranges;
|
|
614
614
|
|
|
615
|
-
$require.Number(fromBlock, `
|
|
616
|
-
$require.Number(toBlock, `
|
|
615
|
+
$require.Number(fromBlock, `fromBlock must be a number`);
|
|
616
|
+
$require.Number(toBlock, `toBlock must be a number`);
|
|
617
617
|
if (options?.streamed) {
|
|
618
618
|
$require.Function(options.onProgress, `onProgress must be a function when streaming past logs`);
|
|
619
619
|
}
|
|
@@ -738,7 +738,7 @@ namespace RangeWorker {
|
|
|
738
738
|
}
|
|
739
739
|
|
|
740
740
|
/**
|
|
741
|
-
* query returned more than
|
|
741
|
+
* The query returned more than 10,000 results
|
|
742
742
|
*/
|
|
743
743
|
$logger.log(`Range worker request: ${range.fromBlock}-${range.toBlock}. ${error.message.trim()}. Current range: ${ blockRange }`);
|
|
744
744
|
|
|
@@ -755,7 +755,7 @@ namespace RangeWorker {
|
|
|
755
755
|
|
|
756
756
|
let maxRangeMatch = /\b(?<maxRange>\d{2,})\b/.exec(error.message)?.groups?.maxRange;
|
|
757
757
|
if (maxRangeMatch && knownLimits.maxBlockRange == null) {
|
|
758
|
-
//
|
|
758
|
+
// Handle an unknown range; otherwise, throw
|
|
759
759
|
let rangeLimit = Number(maxRangeMatch);
|
|
760
760
|
let currentRangeLimit = currentWClient.blockRangeLimits.blocks;
|
|
761
761
|
if (currentRangeLimit <= rangeLimit) {
|
|
@@ -766,7 +766,7 @@ namespace RangeWorker {
|
|
|
766
766
|
return fetchPaged(client, filter, range, knownLimits);
|
|
767
767
|
}
|
|
768
768
|
if (/\b(range|limit)\b/.test(error.message)) {
|
|
769
|
-
// Generic "block range is too wide"
|
|
769
|
+
// Generic "block range is too wide" or "limit exceeded" error
|
|
770
770
|
let newRange = Math.floor(blockRange * 0.8);
|
|
771
771
|
currentWClient.updateBlockRangeInfo({
|
|
772
772
|
blocks: newRange
|
|
@@ -798,7 +798,7 @@ namespace LogsFetcher {
|
|
|
798
798
|
|
|
799
799
|
let { result } = await fetch (client, lastBlock, toBlockExcluded, blockRange, filter);
|
|
800
800
|
|
|
801
|
-
// The sub-range query includes the last block, as some results
|
|
801
|
+
// The sub-range query includes the last block, as some results in the same block might otherwise be skipped
|
|
802
802
|
arr = arr.filter(x => x.blockNumber !== lastBlock);
|
|
803
803
|
arr = arr.concat(result.paged);
|
|
804
804
|
}
|
|
@@ -26,7 +26,7 @@ export namespace Web3ClientFactory {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/** Same as sync
|
|
29
|
+
/** Same as the sync variant, but ensures the config is fetched */
|
|
30
30
|
export async function getAsync (platform: TPlatform | string | number, opts?: IWeb3EndpointOptions) {
|
|
31
31
|
let cfg = await Config.get();
|
|
32
32
|
return get(platform, opts);
|
|
@@ -100,7 +100,7 @@ namespace $Web3Contract {
|
|
|
100
100
|
get(target: Web3Contract, method, receiver) {
|
|
101
101
|
let abiItem = target.abi.find(item => item.name === method);
|
|
102
102
|
if (abiItem == null) {
|
|
103
|
-
throw new Error(`Method ${method.toString()} not found. Available methods: ${target.abi.map(item => item.name).join(', ')}`);
|
|
103
|
+
throw new Error(`Method ${method.toString()} was not found. Available methods: ${target.abi.map(item => item.name).join(', ')}`);
|
|
104
104
|
}
|
|
105
105
|
return (...args) => {
|
|
106
106
|
return new Web3ContractMethod(target.eth, abiItem, target.abi, target.address, args);
|
|
@@ -140,7 +140,7 @@ namespace $Web3Contract {
|
|
|
140
140
|
}
|
|
141
141
|
send (opts: { from, gas }) {
|
|
142
142
|
let account = this.eth.accounts.wallet.get(opts.from);
|
|
143
|
-
$require.notNull(account, `Account ${opts.from} not found`);
|
|
143
|
+
$require.notNull(account, `Account ${opts.from} was not found`);
|
|
144
144
|
|
|
145
145
|
let builder = new TxDataBuilder(this.eth.client, account, {
|
|
146
146
|
to: this.address,
|
|
@@ -6,7 +6,7 @@ import memd from 'memd';
|
|
|
6
6
|
|
|
7
7
|
let rateLimitRgx = {
|
|
8
8
|
checks: [
|
|
9
|
-
//
|
|
9
|
+
// Extracted from known and common rate-limit messages
|
|
10
10
|
/rate.+limit/i,
|
|
11
11
|
/too.+many.+request/i,
|
|
12
12
|
/exceed.+request/i,
|
|
@@ -99,9 +99,9 @@ export class RateLimitGuard {
|
|
|
99
99
|
|
|
100
100
|
val = Number(val);
|
|
101
101
|
if (val < 50_000) {
|
|
102
|
-
//
|
|
102
|
+
// Relative time
|
|
103
103
|
if (val < 1000) {
|
|
104
|
-
//
|
|
104
|
+
// In seconds
|
|
105
105
|
val = val * 1000;
|
|
106
106
|
}
|
|
107
107
|
val = Date.now() + val;
|
|
@@ -190,7 +190,7 @@ export class RateLimitGuard {
|
|
|
190
190
|
this.backoff = info.backoff;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
if (info.spanLimit && info.spanMs) {
|
|
193
|
+
if (info.spanLimit != null && info.spanMs != null) {
|
|
194
194
|
l`Updating the yellow<rate limits> for ${this.id} using: bold<${info.spanLimit}> per bold<${info.spanMs}ms>`;
|
|
195
195
|
let rate = this.rates.find(x => x.spanMs === info.spanMs);
|
|
196
196
|
if (rate) {
|
|
@@ -243,9 +243,9 @@ export class RateLimitGuard {
|
|
|
243
243
|
private onThrottle(ms: number) {
|
|
244
244
|
let awaited = this.awaited;
|
|
245
245
|
if (awaited.count > 0 && awaited.count % 20 === 0) {
|
|
246
|
-
l`The
|
|
246
|
+
l`The node ${this.id} with (${this.rates[0].counter} req) was throttled ${awaited.count}x for ${ $date.formatTimespan(awaited.total) } in total. Current wait time: ${ $date.formatTimespan(ms) }`
|
|
247
247
|
} else if (ms > 30_000) {
|
|
248
|
-
l`The
|
|
248
|
+
l`The node ${this.id} with (${this.rates[0].counter} req) is now waiting ${ $date.formatTimespan(ms) } to continue.`
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
//-this.rates[1].printStatus()
|
|
@@ -255,9 +255,9 @@ export class RateLimitGuard {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
/**
|
|
258
|
-
* In short
|
|
258
|
+
* In the short-epoch rate limiter (1s, 1m, 1h), we track each request
|
|
259
259
|
*
|
|
260
|
-
* sliding(rolling) window | fixed window
|
|
260
|
+
* sliding (rolling) window | fixed window
|
|
261
261
|
*/
|
|
262
262
|
class ShortEpochRateLimitData {
|
|
263
263
|
public started: number;
|
|
@@ -273,7 +273,7 @@ class ShortEpochRateLimitData {
|
|
|
273
273
|
let rgx = /^(?<limit>\d+)[\\/](?<time>\w+)$/;
|
|
274
274
|
let match = rgx.exec(rate);
|
|
275
275
|
if (match == null) {
|
|
276
|
-
throw new Error(`Invalid value for rate limit: ${rate}.
|
|
276
|
+
throw new Error(`Invalid value for rate limit: ${rate}. Expected to match the regex: ${rgx.toString()}`);
|
|
277
277
|
}
|
|
278
278
|
let spanMs = Number(match.groups.limit);
|
|
279
279
|
let spanLimit = $date.parseTimespan(match.groups.time);
|
|
@@ -312,9 +312,9 @@ class ShortEpochRateLimitData {
|
|
|
312
312
|
}
|
|
313
313
|
|
|
314
314
|
/**
|
|
315
|
-
* The server has own request time
|
|
316
|
-
* Here we should update the times AFTER the response received,
|
|
317
|
-
* otherwise the
|
|
315
|
+
* The server has its own request time. With `addTicks`, we save the time BEFORE sending to the server
|
|
316
|
+
* Here we should update the times AFTER the response is received,
|
|
317
|
+
* otherwise the request could be removed locally from TimeWindow earlier than it is cleared on the backend
|
|
318
318
|
*/
|
|
319
319
|
public updateRequests (tick: number, newTick: number) {
|
|
320
320
|
for (let i = 0; i < this.ticks.length; i++) {
|
|
@@ -329,20 +329,20 @@ class ShortEpochRateLimitData {
|
|
|
329
329
|
let spanStart = now - this.spanMs;
|
|
330
330
|
for (let i = 0; i < ticks.length; i++) {
|
|
331
331
|
if (ticks[i] < spanStart) {
|
|
332
|
-
//
|
|
332
|
+
// Older ticks; continue and slice later
|
|
333
333
|
continue;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
if (i > 0) {
|
|
337
|
-
//
|
|
337
|
+
// Remove older requests
|
|
338
338
|
ticks.splice(0, i);
|
|
339
339
|
}
|
|
340
|
-
//
|
|
340
|
+
// In-range tick found
|
|
341
341
|
break;
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
if ((ticks.length + ticksCount) <= this.spanLimit) {
|
|
345
|
-
// We can add requests to current span
|
|
345
|
+
// We can add requests to the current span
|
|
346
346
|
return 0;
|
|
347
347
|
}
|
|
348
348
|
|
|
@@ -15,7 +15,7 @@ export interface IWeb3ClientOptions {
|
|
|
15
15
|
chainId?: number
|
|
16
16
|
// Token symbol: e.g. ETH
|
|
17
17
|
chainToken?: string
|
|
18
|
-
//
|
|
18
|
+
// Alias to `provider`
|
|
19
19
|
web3?: TTransport.Transport | Promise<TTransport.Transport>
|
|
20
20
|
provider?: TTransport.Transport
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ export interface IWeb3ClientOptions {
|
|
|
23
23
|
defaultGasPriceRatio?: number;
|
|
24
24
|
minGasPriorityFee?: number; // in GWEI
|
|
25
25
|
|
|
26
|
-
//
|
|
26
|
+
// Block time in ms
|
|
27
27
|
blockTimeAvg?: number;
|
|
28
28
|
|
|
29
29
|
debug?: {
|
|
@@ -28,7 +28,7 @@ export class PromiseEventWrap extends class_Dfr {
|
|
|
28
28
|
this._events.emit(event, ...args);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
/**
|
|
31
|
+
/** Attaches this wrapper to the promiseEvent */
|
|
32
32
|
bind (promiseEvent: PromiseEvent<any>) {
|
|
33
33
|
|
|
34
34
|
this.$source = promiseEvent;
|
|
@@ -3,7 +3,7 @@ import type { TAbiItem } from '@dequanto/types/TAbi';
|
|
|
3
3
|
|
|
4
4
|
export namespace $web3Abi {
|
|
5
5
|
|
|
6
|
-
/**
|
|
6
|
+
/** Normalizes user input into an array of TAbiItems */
|
|
7
7
|
export function ensureAbis(abi: string | TAbiItem | TAbiItem[]): (TAbiItem & { signature? })[] {
|
|
8
8
|
let arr: TAbiItem[];
|
|
9
9
|
if (typeof abi === 'string') {
|
|
@@ -16,7 +16,7 @@ export namespace $web3Abi {
|
|
|
16
16
|
|
|
17
17
|
let first = abi[0];
|
|
18
18
|
if (first.outputs == null || first.outputs.length === 0) {
|
|
19
|
-
// Normalize outputs
|
|
19
|
+
// Normalize outputs to read at least bytes if nothing is set
|
|
20
20
|
first.outputs = [
|
|
21
21
|
{
|
|
22
22
|
type: 'bytes32',
|
package/src/config/Config.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import memd from 'memd';
|
|
2
|
+
import type { Config as Appcfg } from 'appcfg/Config';
|
|
2
3
|
import { class_Dfr, obj_extend } from 'atma-utils';
|
|
3
4
|
import { TConfigParamsBrowser, TConfigParamsNode } from './AConfigBase';
|
|
4
5
|
import { IConfigData } from './interface/IConfigData';
|
|
@@ -8,7 +9,7 @@ import { $logger } from '../utils/$logger';
|
|
|
8
9
|
export class Config {
|
|
9
10
|
|
|
10
11
|
@memd.deco.memoize()
|
|
11
|
-
static async fetch (parameters?: TConfigParamsNode | TConfigParamsBrowser) {
|
|
12
|
+
static async fetch (parameters?: TConfigParamsNode | TConfigParamsBrowser): Promise<Appcfg<IConfigData> & IConfigData> {
|
|
12
13
|
singleton ??= new class_Dfr();
|
|
13
14
|
|
|
14
15
|
let cfg = await provider.fetch(parameters);
|
|
@@ -27,7 +28,7 @@ export class Config {
|
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
/** Will return a config that was previously loaded by fetch with any parameters or will trigger fetch with default parameters */
|
|
30
|
-
static async get (): Promise<IConfigData> {
|
|
31
|
+
static async get (): Promise<Appcfg<IConfigData> & IConfigData> {
|
|
31
32
|
if (singleton != null) {
|
|
32
33
|
return singleton;
|
|
33
34
|
}
|
|
@@ -47,4 +48,4 @@ export class Config {
|
|
|
47
48
|
export const config = { } as IConfigData;
|
|
48
49
|
|
|
49
50
|
let provider = new ConfigProvider();
|
|
50
|
-
let singleton: class_Dfr<IConfigData> = null;
|
|
51
|
+
let singleton: class_Dfr<Appcfg<IConfigData> & IConfigData> = null;
|
|
@@ -107,7 +107,7 @@ export abstract class Contract {
|
|
|
107
107
|
if (info == null) {
|
|
108
108
|
let byName = $is.Address(mix) === false;
|
|
109
109
|
if (byName) {
|
|
110
|
-
throw new Error(`Contract by name not found ${mix}`);
|
|
110
|
+
throw new Error(`Contract by name was not found: ${mix}`);
|
|
111
111
|
}
|
|
112
112
|
info = <any> { address: mix };
|
|
113
113
|
}
|
|
@@ -20,7 +20,7 @@ export class ContractAbiProvider {
|
|
|
20
20
|
|
|
21
21
|
async getAbi(abi: TAddress | string, opts: { implementation?: string, location?: string, optional?: boolean } = null) {
|
|
22
22
|
|
|
23
|
-
$require.notNull(abi, `
|
|
23
|
+
$require.notNull(abi, `ABI source is required`);
|
|
24
24
|
|
|
25
25
|
let abiJson: TAbiItem[]
|
|
26
26
|
let implementation: TAddress;
|
|
@@ -32,7 +32,7 @@ export class ContractAbiProvider {
|
|
|
32
32
|
let path = abi;
|
|
33
33
|
let location = opts?.location;
|
|
34
34
|
if (location && $path.isAbsolute(path) === false) {
|
|
35
|
-
//
|
|
35
|
+
// If the path is not absolute, check the file relative to the class file location.
|
|
36
36
|
let relPath = class_Uri.combine(location, path);
|
|
37
37
|
if (await File.existsAsync(relPath)) {
|
|
38
38
|
path = relPath;
|
|
@@ -42,18 +42,18 @@ export class ContractAbiProvider {
|
|
|
42
42
|
abiJson = Array.isArray(json) ? json : json.abi;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
opts?.optional !== true && $require.notNull(abiJson, `
|
|
45
|
+
opts?.optional !== true && $require.notNull(abiJson, `ABI was not resolved from ${abi}`);
|
|
46
46
|
return { abiJson, implementation };
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
private async getAbiByAddress (abi: TAddress, opts: { implementation?: string }) {
|
|
51
|
-
let address = $address.expectValid(abi, '
|
|
51
|
+
let address = $address.expectValid(abi, 'Contract address is not valid');
|
|
52
52
|
let platform = this.client.platform;
|
|
53
53
|
let explorer = $require.notNull(this.explorer, `Explorer not resolved for network: ${platform}`);
|
|
54
54
|
|
|
55
55
|
try {
|
|
56
|
-
$logger.log(`Loading
|
|
56
|
+
$logger.log(`Loading contract ABI for ${address}. `)
|
|
57
57
|
let { abi, implementation } = await explorer.getContractAbi(address, opts);
|
|
58
58
|
|
|
59
59
|
let hasProxy = $address.eq(address, implementation) === false;
|
|
@@ -63,7 +63,7 @@ export class ContractAbiProvider {
|
|
|
63
63
|
return { abi: abiJson, implementation };
|
|
64
64
|
} catch (error) {
|
|
65
65
|
$logger.error(error);
|
|
66
|
-
throw new Error(`ABI
|
|
66
|
+
throw new Error(`ABI was not resolved from ${platform}/${address}: ${error.message ?? error}`);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -39,7 +39,7 @@ export abstract class ContractBase {
|
|
|
39
39
|
private blockDate?: Date;
|
|
40
40
|
//private from?: TAddress;
|
|
41
41
|
|
|
42
|
-
/** 1.4 for medium*/
|
|
42
|
+
/** 1.4 for medium */
|
|
43
43
|
private gasPriorityFee?: number;
|
|
44
44
|
protected builderConfig?: ITxBuilderOptions;
|
|
45
45
|
protected writerConfig?: ITxWriterOptions;
|
|
@@ -177,7 +177,7 @@ export abstract class ContractBase {
|
|
|
177
177
|
}
|
|
178
178
|
let data = writer.builder.data as any as TEth.Tx;
|
|
179
179
|
if (!params?.estimateGas) {
|
|
180
|
-
//
|
|
180
|
+
// Remove default values.
|
|
181
181
|
delete data.gasPrice;
|
|
182
182
|
delete data.maxPriorityFeePerGas;
|
|
183
183
|
delete data.maxFeePerGas;
|
|
@@ -404,7 +404,7 @@ export abstract class ContractBase {
|
|
|
404
404
|
.filter(x => (x.inputs?.length ?? 0) === args.length);
|
|
405
405
|
|
|
406
406
|
if ($abis.length === 0) {
|
|
407
|
-
throw new Error(`ABI not found in overloads \n${abis.join('\n')}\n by
|
|
407
|
+
throw new Error(`ABI was not found in overloads \n${abis.join('\n')}\n by argument count. Got ${args.length} arguments`);
|
|
408
408
|
}
|
|
409
409
|
if ($abis.length === 1) {
|
|
410
410
|
return $abis[0];
|
|
@@ -422,7 +422,7 @@ export abstract class ContractBase {
|
|
|
422
422
|
return $abis[0];
|
|
423
423
|
}
|
|
424
424
|
|
|
425
|
-
throw new Error(`ABI not found. Got multiple overloads for the argument count ${args.length}.
|
|
425
|
+
throw new Error(`ABI was not found. Got multiple overloads for the argument count ${args.length}. The ABI should be selected by parameter types.`)
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
protected $extractLogs(tx: TEth.TxReceipt, abiItem: TAbiItem) {
|
|
@@ -458,9 +458,9 @@ export abstract class ContractBase {
|
|
|
458
458
|
}
|
|
459
459
|
onProgress?(info: TLogsRangeProgress<ITxLogItem>)
|
|
460
460
|
|
|
461
|
-
/**
|
|
462
|
-
*
|
|
463
|
-
* This
|
|
461
|
+
/** If TRUE, data will only be forwarded via the onProgress callback.
|
|
462
|
+
* The final array will be undefined.
|
|
463
|
+
* This handles large queries without holding huge arrays in memory.
|
|
464
464
|
* */
|
|
465
465
|
streamed?: boolean
|
|
466
466
|
|
|
@@ -545,7 +545,7 @@ export abstract class ContractBase {
|
|
|
545
545
|
@memd.deco.memoize({ perInstance: true })
|
|
546
546
|
protected getContractWriter() {
|
|
547
547
|
if (this.abi != null) {
|
|
548
|
-
//
|
|
548
|
+
// Update the singleton instance.
|
|
549
549
|
let logParser = di.resolve(TxTopicInMemoryProvider);
|
|
550
550
|
logParser.register(this.abi);
|
|
551
551
|
}
|
|
@@ -624,10 +624,10 @@ export type TEventLogOptions<TParams> = {
|
|
|
624
624
|
type TEventParams<TEvents extends TEventsBase, TEventName extends keyof TEvents> = Partial<TEvents[TEventName]['outputParams']>;
|
|
625
625
|
|
|
626
626
|
|
|
627
|
-
// Tuple check type detects how an argument satisfies the "tuple"
|
|
628
|
-
// shallow: checks only that the argument is an object type
|
|
629
|
-
// single: checks that all tuple components (keys) are present in the argument
|
|
630
|
-
// both: checks that all tuple components are present in the argument AND all argument keys exist in the tuple components
|
|
627
|
+
// Tuple check type detects how an argument satisfies the "tuple" type.
|
|
628
|
+
// shallow: checks only that the argument is an object type.
|
|
629
|
+
// single: checks that all tuple components (keys) are present in the argument.
|
|
630
|
+
// both: checks that all tuple components are present in the argument AND all argument keys exist in the tuple components.
|
|
631
631
|
function filterABIbyArguments(abis: TAbiItem[], args: any[], tupleCheck: 'shallow' | 'single' | 'both') {
|
|
632
632
|
return abis.filter(abi => {
|
|
633
633
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -667,8 +667,8 @@ function filterABIbyArguments(abis: TAbiItem[], args: any[], tupleCheck: 'shallo
|
|
|
667
667
|
// E.g. Solidity structs:
|
|
668
668
|
// 1. struct FooV1 { uint256 a; uint256 b; }
|
|
669
669
|
// 2. struct FooV2 { uint256 a; uint256 b; uint256 c; }
|
|
670
|
-
// If we call the
|
|
671
|
-
//
|
|
670
|
+
// If we call the second overloaded function, the single check will match both structs.
|
|
671
|
+
// Therefore, we need to call later with tupleCheck === 'both' to detect the correct overload.
|
|
672
672
|
const components = item.components ?? [];
|
|
673
673
|
const satisfies = components.every(x => x.name in arg) ?? false;
|
|
674
674
|
if (!satisfies) {
|
|
@@ -35,7 +35,7 @@ export class ContractProvider implements IContractProvider {
|
|
|
35
35
|
async getByAddress (address: string): Promise<IContract> {
|
|
36
36
|
let info = await this.getInfo(address);
|
|
37
37
|
if (info == null) {
|
|
38
|
-
throw new Error(`Contract info not found for ${address}`)
|
|
38
|
+
throw new Error(`Contract info was not found for ${address}`)
|
|
39
39
|
}
|
|
40
40
|
let abi = await this.getAbi(info.address);
|
|
41
41
|
|
|
@@ -149,7 +149,7 @@ export class ContractReader implements IContractReader {
|
|
|
149
149
|
{ -readonly [P in keyof T]: ContractReaderUtils.TIContractReadParamsInferred<T[P]>; }
|
|
150
150
|
> {
|
|
151
151
|
|
|
152
|
-
//
|
|
152
|
+
// All inputs should be deferred requests.
|
|
153
153
|
let requests = await alot(requestArr as any[])
|
|
154
154
|
.mapAsync(async x => await x)
|
|
155
155
|
.toArrayAsync() as ContractReaderUtils.IContractReadParams[];
|
|
@@ -157,7 +157,7 @@ export class ContractReader implements IContractReader {
|
|
|
157
157
|
let invalid = requests.find(x => $is.Address(x.address) === false);
|
|
158
158
|
if (invalid != null) {
|
|
159
159
|
$logger.error('Invalid object', invalid);
|
|
160
|
-
throw new Error(`Invalid
|
|
160
|
+
throw new Error(`Invalid deferred request at position ${ requests.indexOf(invalid) }`);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
let inputs = await alot(requests).mapAsync(async req => {
|
|
@@ -190,10 +190,10 @@ export class ContractReader implements IContractReader {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
async getLogsFilter(abi: TAbiItem | string | '*' | TAbiItem[], options: {
|
|
193
|
-
/** Can be UNDEFINED
|
|
193
|
+
/** Can be UNDEFINED; then the logs will be searched globally. */
|
|
194
194
|
address?: TAddress | TAddress[]
|
|
195
195
|
/**
|
|
196
|
-
* "deployment": get the
|
|
196
|
+
* "deployment": get the contract deployment date to skip many blocks when paginating logs.
|
|
197
197
|
*/
|
|
198
198
|
fromBlock?: number | Date | 'deployment'
|
|
199
199
|
toBlock?: number | Date
|
|
@@ -214,14 +214,14 @@ export class ContractReader implements IContractReader {
|
|
|
214
214
|
if ($is.Array(options.address)) {
|
|
215
215
|
throw new Error('Cannot use "deployment" with multiple addresses');
|
|
216
216
|
}
|
|
217
|
-
$require.Address(options.address, `No contract address provided, but
|
|
217
|
+
$require.Address(options.address, `No contract address was provided, but "fromBlock" is "deployment"`)
|
|
218
218
|
try {
|
|
219
219
|
let explorer = BlockchainExplorerFactory.get(this.client.platform);
|
|
220
220
|
let dateResolver = new ContractCreationResolver(this.client, explorer);
|
|
221
221
|
let info = await dateResolver.getInfo(options.address);
|
|
222
222
|
filters.fromBlock = info.block - 1;
|
|
223
223
|
} catch (error) {
|
|
224
|
-
// Skip any explorer errors and
|
|
224
|
+
// Skip any explorer errors and search from block 0.
|
|
225
225
|
}
|
|
226
226
|
} else {
|
|
227
227
|
filters.fromBlock = await $block.ensureNumber(options.fromBlock, this.client);
|
|
@@ -259,7 +259,7 @@ export class ContractReader implements IContractReader {
|
|
|
259
259
|
}
|
|
260
260
|
filters.topics = topics;
|
|
261
261
|
} else {
|
|
262
|
-
//
|
|
262
|
+
// Array: query multiple events.
|
|
263
263
|
let topics = [
|
|
264
264
|
abi.map($abiUtils.getTopicSignature)
|
|
265
265
|
];
|