dequanto 0.2.38 → 0.2.41

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.
Files changed (480) hide show
  1. package/lib/cjs/abi/$abiCoder.js +1 -1
  2. package/lib/cjs/abi/$abiCoder.js.map +1 -1
  3. package/lib/cjs/abi/Logger.js +1 -1
  4. package/lib/cjs/abi/abi-coder-packed.js +3 -3
  5. package/lib/cjs/abi/abi-coder.js +16 -16
  6. package/lib/cjs/abi/coders/abstract-coder.js +31 -31
  7. package/lib/cjs/abi/coders/abstract-coder.js.map +1 -1
  8. package/lib/cjs/abi/fragments.js +90 -90
  9. package/lib/cjs/abi/fragments.js.map +1 -1
  10. package/lib/cjs/blocks/BlockDateResolver.js +9 -9
  11. package/lib/cjs/blocks/BlockDateResolver.js.map +1 -1
  12. package/lib/cjs/class/PackedRanges.js +46 -46
  13. package/lib/cjs/class/PackedRanges.js.map +1 -1
  14. package/lib/cjs/clients/ClientEventsStream.js +1 -1
  15. package/lib/cjs/clients/ClientEventsStream.js.map +1 -1
  16. package/lib/cjs/clients/ClientPool.js +23 -23
  17. package/lib/cjs/clients/ClientPool.js.map +1 -1
  18. package/lib/cjs/clients/WalletClient.js +3 -3
  19. package/lib/cjs/clients/WalletClient.js.map +1 -1
  20. package/lib/cjs/clients/Web3Client.js +14 -14
  21. package/lib/cjs/clients/Web3Client.js.map +1 -1
  22. package/lib/cjs/clients/Web3ClientFactory.js +1 -1
  23. package/lib/cjs/clients/Web3ClientFactory.js.map +1 -1
  24. package/lib/cjs/clients/compatibility/Web3.js +2 -2
  25. package/lib/cjs/clients/compatibility/Web3.js.map +1 -1
  26. package/lib/cjs/clients/handlers/RateLimitGuard.js +16 -16
  27. package/lib/cjs/clients/handlers/RateLimitGuard.js.map +1 -1
  28. package/lib/cjs/clients/model/PromiEventWrap.js +1 -1
  29. package/lib/cjs/clients/model/PromiEventWrap.js.map +1 -1
  30. package/lib/cjs/clients/utils/$web3Abi.js +2 -2
  31. package/lib/cjs/clients/utils/$web3Abi.js.map +1 -1
  32. package/lib/cjs/clients/utils/ClientErrorUtil.js +4 -0
  33. package/lib/cjs/clients/utils/ClientErrorUtil.js.map +1 -1
  34. package/lib/cjs/config/Config.js.map +1 -1
  35. package/lib/cjs/contracts/Contract.js +1 -1
  36. package/lib/cjs/contracts/Contract.js.map +1 -1
  37. package/lib/cjs/contracts/ContractAbiProvider.js +6 -6
  38. package/lib/cjs/contracts/ContractAbiProvider.js.map +1 -1
  39. package/lib/cjs/contracts/ContractBase.js +10 -10
  40. package/lib/cjs/contracts/ContractBase.js.map +1 -1
  41. package/lib/cjs/contracts/ContractProvider.js +1 -1
  42. package/lib/cjs/contracts/ContractProvider.js.map +1 -1
  43. package/lib/cjs/contracts/ContractReader.js +5 -5
  44. package/lib/cjs/contracts/ContractReader.js.map +1 -1
  45. package/lib/cjs/contracts/ContractWriter.js +4 -4
  46. package/lib/cjs/contracts/ContractWriter.js.map +1 -1
  47. package/lib/cjs/contracts/deploy/ContractDeployer.js +4 -4
  48. package/lib/cjs/contracts/deploy/ContractDeployer.js.map +1 -1
  49. package/lib/cjs/contracts/deploy/Deployments.js +36 -21
  50. package/lib/cjs/contracts/deploy/Deployments.js.map +1 -1
  51. package/lib/cjs/contracts/deploy/proxy/$proxyDeploy.js +13 -13
  52. package/lib/cjs/contracts/deploy/proxy/$proxyDeploy.js.map +1 -1
  53. package/lib/cjs/contracts/deploy/proxy/ProxyDeployment.js +22 -22
  54. package/lib/cjs/contracts/deploy/proxy/ProxyDeployment.js.map +1 -1
  55. package/lib/cjs/contracts/deploy/storage/DeploymentsStorage.js +15 -14
  56. package/lib/cjs/contracts/deploy/storage/DeploymentsStorage.js.map +1 -1
  57. package/lib/cjs/contracts/utils/AbiDeserializer.js +4 -4
  58. package/lib/cjs/contracts/utils/AbiDeserializer.js.map +1 -1
  59. package/lib/cjs/contracts/utils/ContractBaseUtils.js +3 -3
  60. package/lib/cjs/contracts/utils/ContractBaseUtils.js.map +1 -1
  61. package/lib/cjs/evm/OpcodesWalker.js +1 -1
  62. package/lib/cjs/evm/OpcodesWalker.js.map +1 -1
  63. package/lib/cjs/explorer/BlockchainExplorer.js +1 -1
  64. package/lib/cjs/explorer/BlockchainExplorer.js.map +1 -1
  65. package/lib/cjs/explorer/BlockchainExplorerFactory.js +1 -1
  66. package/lib/cjs/explorer/BlockchainExplorerStorage.js +12 -12
  67. package/lib/cjs/explorer/BlockchainExplorerStorage.js.map +1 -1
  68. package/lib/cjs/explorer/Evmscan.js +1 -1
  69. package/lib/cjs/explorer/verifiers/FsHtmlVerifier.js +7 -7
  70. package/lib/cjs/explorer/verifiers/FsHtmlVerifier.js.map +1 -1
  71. package/lib/cjs/flashbots/FlashbotWeb3Client.js +1 -1
  72. package/lib/cjs/flashbots/FlashbotWeb3Client.js.map +1 -1
  73. package/lib/cjs/hardhat/HardhatProvider.js +7 -7
  74. package/lib/cjs/hardhat/HardhatProvider.js.map +1 -1
  75. package/lib/cjs/indexer/BlocksTxIndexer.js +2 -2
  76. package/lib/cjs/indexer/BlocksTxIndexer.js.map +1 -1
  77. package/lib/cjs/indexer/EventsIndexer.js +11 -11
  78. package/lib/cjs/indexer/EventsIndexer.js.map +1 -1
  79. package/lib/cjs/indexer/PendingTxIndexer.js +2 -2
  80. package/lib/cjs/indexer/PendingTxIndexer.js.map +1 -1
  81. package/lib/cjs/indexer/handlers/BlocksWalker.js +9 -9
  82. package/lib/cjs/indexer/handlers/BlocksWalker.js.map +1 -1
  83. package/lib/cjs/indexer/handlers/TxQueueLoader.js +1 -1
  84. package/lib/cjs/indexer/storage/FsEventsIndexerStore.js +3 -3
  85. package/lib/cjs/indexer/storage/FsEventsIndexerStore.js.map +1 -1
  86. package/lib/cjs/indexer/storage/FsEventsStoreUtils.js +1 -1
  87. package/lib/cjs/indexer/storage/FsEventsStoreUtils.js.map +1 -1
  88. package/lib/cjs/json/JsonArrayMultiStore.js +1 -1
  89. package/lib/cjs/json/JsonArrayMultiStore.js.map +1 -1
  90. package/lib/cjs/json/JsonStoreFs.js +1 -1
  91. package/lib/cjs/json/JsonStoreFs.js.map +1 -1
  92. package/lib/cjs/rpc/$rpc.js +2 -2
  93. package/lib/cjs/rpc/$rpc.js.map +1 -1
  94. package/lib/cjs/rpc/Rpc.js +2 -2
  95. package/lib/cjs/rpc/RpcBase.js +2 -2
  96. package/lib/cjs/rpc/RpcBase.js.map +1 -1
  97. package/lib/cjs/rpc/RpcContract.js +4 -3
  98. package/lib/cjs/rpc/RpcContract.js.map +1 -1
  99. package/lib/cjs/rpc/RpcSubscription.js +1 -1
  100. package/lib/cjs/rpc/RpcSubscription.js.map +1 -1
  101. package/lib/cjs/rpc/transports/compatibility/EIP1193Transport.js +4 -4
  102. package/lib/cjs/rpc/transports/compatibility/EIP1193Transport.js.map +1 -1
  103. package/lib/cjs/rpc/transports/compatibility/Web3Transport.js +1 -1
  104. package/lib/cjs/rpc/transports/compatibility/Web3Transport.js.map +1 -1
  105. package/lib/cjs/services/TimelockService/TimelockService.js +2 -2
  106. package/lib/cjs/services/TimelockService/TimelockServiceFallbackSafe.js +2 -2
  107. package/lib/cjs/solidity/SlotsDump.js +1 -1
  108. package/lib/cjs/solidity/SlotsDump.js.map +1 -1
  109. package/lib/cjs/solidity/SlotsParser/MappingSettersResolver.js +3 -3
  110. package/lib/cjs/solidity/SlotsParser/MappingSettersResolver.js.map +1 -1
  111. package/lib/cjs/solidity/SlotsParser/SourceFile.js +3 -3
  112. package/lib/cjs/solidity/SlotsParser/SourceFile.js.map +1 -1
  113. package/lib/cjs/solidity/SolidityParser.js +1 -1
  114. package/lib/cjs/solidity/SolidityParser.js.map +1 -1
  115. package/lib/cjs/solidity/SourceCodeProvider.js +1 -1
  116. package/lib/cjs/solidity/SourceCodeProvider.js.map +1 -1
  117. package/lib/cjs/solidity/storage/Accessor.js +1 -1
  118. package/lib/cjs/solidity/storage/Accessor.js.map +1 -1
  119. package/lib/cjs/solidity/storage/SlotFixedArray.js +1 -1
  120. package/lib/cjs/solidity/storage/SlotFixedArray.js.map +1 -1
  121. package/lib/cjs/solidity/storage/SlotsStorageTransport.js +3 -3
  122. package/lib/cjs/solidity/storage/SlotsStorageTransport.js.map +1 -1
  123. package/lib/cjs/solidity/storage/handlers/SlotBytesHandler.js +1 -1
  124. package/lib/cjs/solidity/storage/handlers/SlotBytesHandler.js.map +1 -1
  125. package/lib/cjs/solidity/storage/handlers/SlotDynamicArrayHandler.js +1 -1
  126. package/lib/cjs/solidity/storage/handlers/SlotDynamicArrayHandler.js.map +1 -1
  127. package/lib/cjs/solidity/storage/handlers/SlotFixedArrayHandler.js +1 -1
  128. package/lib/cjs/solidity/storage/handlers/SlotFixedArrayHandler.js.map +1 -1
  129. package/lib/cjs/solidity/storage/handlers/SlotValueConstantHandler.js +1 -1
  130. package/lib/cjs/solidity/storage/handlers/SlotValueConstantHandler.js.map +1 -1
  131. package/lib/cjs/solidity/storage/handlers/SlotValueHandler.js +1 -1
  132. package/lib/cjs/solidity/storage/handlers/SlotValueHandler.js.map +1 -1
  133. package/lib/cjs/solidity/storage/handlers/SlotValueImmutableHandler.js +4 -4
  134. package/lib/cjs/solidity/storage/handlers/SlotValueImmutableHandler.js.map +1 -1
  135. package/lib/cjs/tokens/TokenDataProvider.js +2 -2
  136. package/lib/cjs/tokens/TokenDataProvider.js.map +1 -1
  137. package/lib/cjs/tokens/TokenExchangeService.js +1 -1
  138. package/lib/cjs/tokens/TokenExchangeService.js.map +1 -1
  139. package/lib/cjs/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js +2 -2
  140. package/lib/cjs/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js.map +1 -1
  141. package/lib/cjs/tokens/TokenExchanges/AmmV2PriceQuote.js +2 -2
  142. package/lib/cjs/tokens/TokenExchanges/AmmV2PriceQuote.js.map +1 -1
  143. package/lib/cjs/tokens/TokenOracles/amm/AmmV1Oracle.js +2 -2
  144. package/lib/cjs/tokens/TokenOracles/amm/AmmV1Oracle.js.map +1 -1
  145. package/lib/cjs/tokens/TokenTransferService.js +2 -2
  146. package/lib/cjs/tokens/TokenTransferService.js.map +1 -1
  147. package/lib/cjs/tokens/TokensService.js +1 -1
  148. package/lib/cjs/tokens/TokensService.js.map +1 -1
  149. package/lib/cjs/txs/TxNonceManager.js +1 -1
  150. package/lib/cjs/txs/TxWriter.js +9 -0
  151. package/lib/cjs/txs/TxWriter.js.map +1 -1
  152. package/lib/cjs/txs/conditional/GasWatcherTx.js +1 -1
  153. package/lib/cjs/txs/conditional/GasWatcherTx.js.map +1 -1
  154. package/lib/cjs/txs/receipt/TxLogParser.js +1 -1
  155. package/lib/cjs/utils/$crypto.js +1 -1
  156. package/lib/cjs/utils/$crypto.js.map +1 -1
  157. package/lib/cjs/utils/$date.js +1 -1
  158. package/lib/cjs/utils/$date.js.map +1 -1
  159. package/lib/cjs/utils/$hex.js +1 -1
  160. package/lib/cjs/utils/$logger.js +1 -1
  161. package/lib/cjs/utils/$logger.js.map +1 -1
  162. package/lib/cjs/utils/$machine.js +2 -2
  163. package/lib/cjs/utils/$machine.js.map +1 -1
  164. package/lib/cjs/utils/$require.js.map +1 -1
  165. package/lib/cjs/utils/$traces.js +1 -1
  166. package/lib/cjs/utils/$traces.js.map +1 -1
  167. package/lib/esm/abi/$abiCoder.js.map +1 -1
  168. package/lib/esm/abi/$abiCoder.mjs +1 -1
  169. package/lib/esm/abi/Logger.mjs +1 -1
  170. package/lib/esm/abi/abi-coder-packed.mjs +3 -3
  171. package/lib/esm/abi/abi-coder.mjs +16 -16
  172. package/lib/esm/abi/coders/abstract-coder.js.map +1 -1
  173. package/lib/esm/abi/coders/abstract-coder.mjs +31 -31
  174. package/lib/esm/abi/fragments.js.map +1 -1
  175. package/lib/esm/abi/fragments.mjs +90 -90
  176. package/lib/esm/blocks/BlockDateResolver.js.map +1 -1
  177. package/lib/esm/blocks/BlockDateResolver.mjs +9 -9
  178. package/lib/esm/class/PackedRanges.js.map +1 -1
  179. package/lib/esm/class/PackedRanges.mjs +46 -46
  180. package/lib/esm/clients/ClientEventsStream.js.map +1 -1
  181. package/lib/esm/clients/ClientEventsStream.mjs +1 -1
  182. package/lib/esm/clients/ClientPool.js.map +1 -1
  183. package/lib/esm/clients/ClientPool.mjs +23 -23
  184. package/lib/esm/clients/WalletClient.js.map +1 -1
  185. package/lib/esm/clients/WalletClient.mjs +3 -3
  186. package/lib/esm/clients/Web3Client.js.map +1 -1
  187. package/lib/esm/clients/Web3Client.mjs +14 -14
  188. package/lib/esm/clients/Web3ClientFactory.js.map +1 -1
  189. package/lib/esm/clients/Web3ClientFactory.mjs +1 -1
  190. package/lib/esm/clients/compatibility/Web3.js.map +1 -1
  191. package/lib/esm/clients/compatibility/Web3.mjs +2 -2
  192. package/lib/esm/clients/handlers/RateLimitGuard.js.map +1 -1
  193. package/lib/esm/clients/handlers/RateLimitGuard.mjs +16 -16
  194. package/lib/esm/clients/model/PromiEventWrap.js.map +1 -1
  195. package/lib/esm/clients/model/PromiEventWrap.mjs +1 -1
  196. package/lib/esm/clients/utils/$web3Abi.js.map +1 -1
  197. package/lib/esm/clients/utils/$web3Abi.mjs +2 -2
  198. package/lib/esm/clients/utils/ClientErrorUtil.js.map +1 -1
  199. package/lib/esm/clients/utils/ClientErrorUtil.mjs +4 -0
  200. package/lib/esm/config/Config.js.map +1 -1
  201. package/lib/esm/contracts/Contract.js.map +1 -1
  202. package/lib/esm/contracts/Contract.mjs +1 -1
  203. package/lib/esm/contracts/ContractAbiProvider.js.map +1 -1
  204. package/lib/esm/contracts/ContractAbiProvider.mjs +6 -6
  205. package/lib/esm/contracts/ContractBase.js.map +1 -1
  206. package/lib/esm/contracts/ContractBase.mjs +10 -10
  207. package/lib/esm/contracts/ContractProvider.js.map +1 -1
  208. package/lib/esm/contracts/ContractProvider.mjs +1 -1
  209. package/lib/esm/contracts/ContractReader.js.map +1 -1
  210. package/lib/esm/contracts/ContractReader.mjs +5 -5
  211. package/lib/esm/contracts/ContractWriter.js.map +1 -1
  212. package/lib/esm/contracts/ContractWriter.mjs +4 -4
  213. package/lib/esm/contracts/deploy/ContractDeployer.js.map +1 -1
  214. package/lib/esm/contracts/deploy/ContractDeployer.mjs +4 -4
  215. package/lib/esm/contracts/deploy/Deployments.js.map +1 -1
  216. package/lib/esm/contracts/deploy/Deployments.mjs +36 -21
  217. package/lib/esm/contracts/deploy/proxy/$proxyDeploy.js.map +1 -1
  218. package/lib/esm/contracts/deploy/proxy/$proxyDeploy.mjs +13 -13
  219. package/lib/esm/contracts/deploy/proxy/ProxyDeployment.js.map +1 -1
  220. package/lib/esm/contracts/deploy/proxy/ProxyDeployment.mjs +22 -22
  221. package/lib/esm/contracts/deploy/storage/DeploymentsStorage.js.map +1 -1
  222. package/lib/esm/contracts/deploy/storage/DeploymentsStorage.mjs +15 -14
  223. package/lib/esm/contracts/utils/AbiDeserializer.js.map +1 -1
  224. package/lib/esm/contracts/utils/AbiDeserializer.mjs +4 -4
  225. package/lib/esm/contracts/utils/ContractBaseUtils.js.map +1 -1
  226. package/lib/esm/contracts/utils/ContractBaseUtils.mjs +3 -3
  227. package/lib/esm/evm/OpcodesWalker.js.map +1 -1
  228. package/lib/esm/evm/OpcodesWalker.mjs +1 -1
  229. package/lib/esm/explorer/BlockchainExplorer.js.map +1 -1
  230. package/lib/esm/explorer/BlockchainExplorer.mjs +1 -1
  231. package/lib/esm/explorer/BlockchainExplorerFactory.mjs +1 -1
  232. package/lib/esm/explorer/BlockchainExplorerStorage.js.map +1 -1
  233. package/lib/esm/explorer/BlockchainExplorerStorage.mjs +12 -12
  234. package/lib/esm/explorer/Evmscan.mjs +1 -1
  235. package/lib/esm/explorer/verifiers/FsHtmlVerifier.js.map +1 -1
  236. package/lib/esm/explorer/verifiers/FsHtmlVerifier.mjs +7 -7
  237. package/lib/esm/flashbots/FlashbotWeb3Client.js.map +1 -1
  238. package/lib/esm/flashbots/FlashbotWeb3Client.mjs +1 -1
  239. package/lib/esm/hardhat/HardhatProvider.js.map +1 -1
  240. package/lib/esm/hardhat/HardhatProvider.mjs +7 -7
  241. package/lib/esm/indexer/BlocksTxIndexer.js.map +1 -1
  242. package/lib/esm/indexer/BlocksTxIndexer.mjs +2 -2
  243. package/lib/esm/indexer/EventsIndexer.js.map +1 -1
  244. package/lib/esm/indexer/EventsIndexer.mjs +11 -11
  245. package/lib/esm/indexer/PendingTxIndexer.js.map +1 -1
  246. package/lib/esm/indexer/PendingTxIndexer.mjs +2 -2
  247. package/lib/esm/indexer/handlers/BlocksWalker.js.map +1 -1
  248. package/lib/esm/indexer/handlers/BlocksWalker.mjs +9 -9
  249. package/lib/esm/indexer/handlers/TxQueueLoader.mjs +1 -1
  250. package/lib/esm/indexer/storage/FsEventsIndexerStore.js.map +1 -1
  251. package/lib/esm/indexer/storage/FsEventsIndexerStore.mjs +3 -3
  252. package/lib/esm/indexer/storage/FsEventsStoreUtils.js.map +1 -1
  253. package/lib/esm/indexer/storage/FsEventsStoreUtils.mjs +1 -1
  254. package/lib/esm/json/JsonArrayMultiStore.js.map +1 -1
  255. package/lib/esm/json/JsonArrayMultiStore.mjs +1 -1
  256. package/lib/esm/json/JsonStoreFs.js.map +1 -1
  257. package/lib/esm/json/JsonStoreFs.mjs +1 -1
  258. package/lib/esm/rpc/$rpc.js.map +1 -1
  259. package/lib/esm/rpc/$rpc.mjs +2 -2
  260. package/lib/esm/rpc/Rpc.mjs +2 -2
  261. package/lib/esm/rpc/RpcBase.js.map +1 -1
  262. package/lib/esm/rpc/RpcBase.mjs +2 -2
  263. package/lib/esm/rpc/RpcContract.js.map +1 -1
  264. package/lib/esm/rpc/RpcContract.mjs +4 -3
  265. package/lib/esm/rpc/RpcSubscription.js.map +1 -1
  266. package/lib/esm/rpc/RpcSubscription.mjs +1 -1
  267. package/lib/esm/rpc/transports/compatibility/EIP1193Transport.js.map +1 -1
  268. package/lib/esm/rpc/transports/compatibility/EIP1193Transport.mjs +4 -4
  269. package/lib/esm/rpc/transports/compatibility/Web3Transport.js.map +1 -1
  270. package/lib/esm/rpc/transports/compatibility/Web3Transport.mjs +1 -1
  271. package/lib/esm/services/TimelockService/TimelockService.mjs +2 -2
  272. package/lib/esm/services/TimelockService/TimelockServiceFallbackSafe.mjs +2 -2
  273. package/lib/esm/solidity/SlotsDump.js.map +1 -1
  274. package/lib/esm/solidity/SlotsDump.mjs +1 -1
  275. package/lib/esm/solidity/SlotsParser/MappingSettersResolver.js.map +1 -1
  276. package/lib/esm/solidity/SlotsParser/MappingSettersResolver.mjs +3 -3
  277. package/lib/esm/solidity/SlotsParser/SourceFile.js.map +1 -1
  278. package/lib/esm/solidity/SlotsParser/SourceFile.mjs +3 -3
  279. package/lib/esm/solidity/SolidityParser.js.map +1 -1
  280. package/lib/esm/solidity/SolidityParser.mjs +1 -1
  281. package/lib/esm/solidity/SourceCodeProvider.js.map +1 -1
  282. package/lib/esm/solidity/SourceCodeProvider.mjs +1 -1
  283. package/lib/esm/solidity/storage/Accessor.js.map +1 -1
  284. package/lib/esm/solidity/storage/Accessor.mjs +1 -1
  285. package/lib/esm/solidity/storage/SlotFixedArray.js.map +1 -1
  286. package/lib/esm/solidity/storage/SlotFixedArray.mjs +1 -1
  287. package/lib/esm/solidity/storage/SlotsStorageTransport.js.map +1 -1
  288. package/lib/esm/solidity/storage/SlotsStorageTransport.mjs +3 -3
  289. package/lib/esm/solidity/storage/handlers/SlotBytesHandler.js.map +1 -1
  290. package/lib/esm/solidity/storage/handlers/SlotBytesHandler.mjs +1 -1
  291. package/lib/esm/solidity/storage/handlers/SlotDynamicArrayHandler.js.map +1 -1
  292. package/lib/esm/solidity/storage/handlers/SlotDynamicArrayHandler.mjs +1 -1
  293. package/lib/esm/solidity/storage/handlers/SlotFixedArrayHandler.js.map +1 -1
  294. package/lib/esm/solidity/storage/handlers/SlotFixedArrayHandler.mjs +1 -1
  295. package/lib/esm/solidity/storage/handlers/SlotValueConstantHandler.js.map +1 -1
  296. package/lib/esm/solidity/storage/handlers/SlotValueConstantHandler.mjs +1 -1
  297. package/lib/esm/solidity/storage/handlers/SlotValueHandler.js.map +1 -1
  298. package/lib/esm/solidity/storage/handlers/SlotValueHandler.mjs +1 -1
  299. package/lib/esm/solidity/storage/handlers/SlotValueImmutableHandler.js.map +1 -1
  300. package/lib/esm/solidity/storage/handlers/SlotValueImmutableHandler.mjs +4 -4
  301. package/lib/esm/tokens/TokenDataProvider.js.map +1 -1
  302. package/lib/esm/tokens/TokenDataProvider.mjs +2 -2
  303. package/lib/esm/tokens/TokenExchangeService.js.map +1 -1
  304. package/lib/esm/tokens/TokenExchangeService.mjs +1 -1
  305. package/lib/esm/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.js.map +1 -1
  306. package/lib/esm/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.mjs +2 -2
  307. package/lib/esm/tokens/TokenExchanges/AmmV2PriceQuote.js.map +1 -1
  308. package/lib/esm/tokens/TokenExchanges/AmmV2PriceQuote.mjs +2 -2
  309. package/lib/esm/tokens/TokenOracles/amm/AmmV1Oracle.js.map +1 -1
  310. package/lib/esm/tokens/TokenOracles/amm/AmmV1Oracle.mjs +2 -2
  311. package/lib/esm/tokens/TokenTransferService.js.map +1 -1
  312. package/lib/esm/tokens/TokenTransferService.mjs +2 -2
  313. package/lib/esm/tokens/TokensService.js.map +1 -1
  314. package/lib/esm/tokens/TokensService.mjs +1 -1
  315. package/lib/esm/txs/TxNonceManager.mjs +1 -1
  316. package/lib/esm/txs/TxWriter.js.map +1 -1
  317. package/lib/esm/txs/TxWriter.mjs +9 -0
  318. package/lib/esm/txs/conditional/GasWatcherTx.js.map +1 -1
  319. package/lib/esm/txs/conditional/GasWatcherTx.mjs +1 -1
  320. package/lib/esm/txs/receipt/TxLogParser.mjs +1 -1
  321. package/lib/esm/utils/$crypto.js.map +1 -1
  322. package/lib/esm/utils/$crypto.mjs +1 -1
  323. package/lib/esm/utils/$date.js.map +1 -1
  324. package/lib/esm/utils/$date.mjs +1 -1
  325. package/lib/esm/utils/$hex.mjs +1 -1
  326. package/lib/esm/utils/$logger.js.map +1 -1
  327. package/lib/esm/utils/$logger.mjs +1 -1
  328. package/lib/esm/utils/$machine.js.map +1 -1
  329. package/lib/esm/utils/$machine.mjs +2 -2
  330. package/lib/esm/utils/$require.js.map +1 -1
  331. package/lib/esm/utils/$traces.js.map +1 -1
  332. package/lib/esm/utils/$traces.mjs +1 -1
  333. package/lib/types/abi/abi-coder-packed.d.ts +1 -1
  334. package/lib/types/abi/abi-coder.d.ts +13 -13
  335. package/lib/types/abi/coders/abstract-coder.d.ts +14 -14
  336. package/lib/types/abi/fragments.d.ts +95 -95
  337. package/lib/types/blocks/BlockDateResolver.d.ts +7 -7
  338. package/lib/types/class/PackedRanges.d.ts +44 -44
  339. package/lib/types/clients/ClientPool.d.ts +10 -10
  340. package/lib/types/clients/WalletClient.d.ts +2 -2
  341. package/lib/types/clients/Web3Client.d.ts +6 -6
  342. package/lib/types/clients/Web3ClientFactory.d.ts +1 -1
  343. package/lib/types/clients/handlers/RateLimitGuard.d.ts +5 -5
  344. package/lib/types/clients/model/PromiEventWrap.d.ts +1 -1
  345. package/lib/types/clients/utils/$web3Abi.d.ts +1 -1
  346. package/lib/types/clients/utils/ClientErrorUtil.d.ts +1 -0
  347. package/lib/types/config/Config.d.ts +3 -2
  348. package/lib/types/contracts/ContractBase.d.ts +4 -4
  349. package/lib/types/contracts/ContractReader.d.ts +2 -2
  350. package/lib/types/contracts/ContractWriter.d.ts +3 -3
  351. package/lib/types/contracts/deploy/Deployments.d.ts +13 -14
  352. package/lib/types/contracts/deploy/storage/DeploymentsStorage.d.ts +2 -0
  353. package/lib/types/explorer/BlockchainExplorerFactory.d.ts +1 -1
  354. package/lib/types/explorer/Evmscan.d.ts +1 -1
  355. package/lib/types/indexer/BlocksTxIndexer.d.ts +4 -4
  356. package/lib/types/indexer/EventsIndexer.d.ts +4 -4
  357. package/lib/types/indexer/PendingTxIndexer.d.ts +1 -1
  358. package/lib/types/indexer/handlers/BlocksWalker.d.ts +2 -2
  359. package/lib/types/indexer/storage/FsEventsIndexerStore.d.ts +4 -4
  360. package/lib/types/ns/providers/INsProvider.d.ts +1 -1
  361. package/lib/types/rpc/Rpc.d.ts +2 -2
  362. package/lib/types/services/TimelockService/ITimelockService.d.ts +2 -2
  363. package/lib/types/services/TimelockService/TimelockService.d.ts +2 -2
  364. package/lib/types/services/TimelockService/TimelockServiceFallbackSafe.d.ts +2 -2
  365. package/lib/types/solidity/SlotsParser/SourceFile.d.ts +1 -1
  366. package/lib/types/solidity/storage/SlotFixedArray.d.ts +1 -1
  367. package/lib/types/tokens/TokenDataProvider.d.ts +2 -2
  368. package/lib/types/tokens/TokensService.d.ts +1 -1
  369. package/lib/types/txs/ITxBuilderOptions.d.ts +1 -1
  370. package/lib/types/txs/TxNonceManager.d.ts +1 -1
  371. package/lib/types/txs/TxWriter.d.ts +4 -4
  372. package/lib/types/txs/receipt/TxLogParser.d.ts +1 -1
  373. package/lib/types/utils/$date.d.ts +1 -1
  374. package/lib/types/utils/$hex.d.ts +1 -1
  375. package/lib/types/utils/$require.d.ts +8 -8
  376. package/package.json +1 -1
  377. package/readme.md +105 -83
  378. package/src/abi/$abiCoder.ts +1 -1
  379. package/src/abi/Logger.ts +1 -1
  380. package/src/abi/abi-coder-packed.ts +3 -3
  381. package/src/abi/abi-coder.ts +16 -16
  382. package/src/abi/coders/abstract-coder.ts +36 -36
  383. package/src/abi/fragments.ts +137 -137
  384. package/src/blocks/BlockDateResolver.ts +9 -9
  385. package/src/bridges/hop/HopBridge.ts +1 -1
  386. package/src/class/PackedRanges.ts +46 -46
  387. package/src/clients/ClientEventsStream.ts +1 -1
  388. package/src/clients/ClientPool.ts +38 -38
  389. package/src/clients/WalletClient.ts +3 -3
  390. package/src/clients/Web3BatchRequests.ts +3 -3
  391. package/src/clients/Web3Client.ts +21 -21
  392. package/src/clients/Web3ClientFactory.ts +1 -1
  393. package/src/clients/compatibility/Web3.ts +2 -2
  394. package/src/clients/handlers/RateLimitGuard.ts +16 -16
  395. package/src/clients/interfaces/IWeb3Client.ts +2 -2
  396. package/src/clients/model/PromiEventWrap.ts +1 -1
  397. package/src/clients/utils/$web3Abi.ts +2 -2
  398. package/src/clients/utils/ClientErrorUtil.ts +4 -0
  399. package/src/config/Config.ts +4 -3
  400. package/src/contracts/Contract.ts +1 -1
  401. package/src/contracts/ContractAbiProvider.ts +6 -6
  402. package/src/contracts/ContractBase.ts +14 -14
  403. package/src/contracts/ContractProvider.ts +1 -1
  404. package/src/contracts/ContractReader.ts +7 -7
  405. package/src/contracts/ContractWriter.ts +4 -4
  406. package/src/contracts/deploy/ContractDeployer.ts +4 -4
  407. package/src/contracts/deploy/ContractDeployment.ts +1 -1
  408. package/src/contracts/deploy/Deployments.ts +69 -56
  409. package/src/contracts/deploy/proxy/$proxyDeploy.ts +14 -14
  410. package/src/contracts/deploy/proxy/ProxyDeployment.ts +22 -22
  411. package/src/contracts/deploy/storage/DeploymentsStorage.ts +21 -18
  412. package/src/contracts/utils/AbiDeserializer.ts +4 -4
  413. package/src/contracts/utils/ContractBaseUtils.ts +3 -3
  414. package/src/erc4337/models/UserOperation.ts +2 -2
  415. package/src/evm/OpcodesWalker.ts +1 -1
  416. package/src/explorer/BlockchainExplorer.ts +1 -1
  417. package/src/explorer/BlockchainExplorerFactory.ts +1 -1
  418. package/src/explorer/BlockchainExplorerStorage.ts +12 -12
  419. package/src/explorer/Evmscan.ts +1 -1
  420. package/src/explorer/verifiers/FsHtmlVerifier.ts +7 -7
  421. package/src/flashbots/FlashbotWeb3Client.ts +1 -1
  422. package/src/hardhat/HardhatProvider.ts +7 -7
  423. package/src/indexer/BlocksTxIndexer.ts +6 -6
  424. package/src/indexer/EventsIndexer.ts +20 -20
  425. package/src/indexer/PendingTxIndexer.ts +3 -3
  426. package/src/indexer/handlers/BlocksWalker.ts +9 -9
  427. package/src/indexer/handlers/TxQueueLoader.ts +1 -1
  428. package/src/indexer/storage/FsEventsIndexerStore.ts +9 -9
  429. package/src/indexer/storage/FsEventsMetaStore.ts +1 -1
  430. package/src/indexer/storage/FsEventsStoreUtils.ts +1 -1
  431. package/src/json/JsonArrayMultiStore.ts +1 -1
  432. package/src/json/JsonStoreFs.ts +1 -1
  433. package/src/ns/providers/INsProvider.ts +1 -1
  434. package/src/rpc/$rpc.ts +2 -2
  435. package/src/rpc/Rpc.ts +2 -2
  436. package/src/rpc/RpcBase.ts +2 -2
  437. package/src/rpc/RpcContract.ts +6 -6
  438. package/src/rpc/RpcSubscription.ts +1 -1
  439. package/src/rpc/transports/compatibility/EIP1193Transport.ts +4 -4
  440. package/src/rpc/transports/compatibility/Web3Transport.ts +1 -1
  441. package/src/services/TimelockService/ITimelockService.ts +2 -2
  442. package/src/services/TimelockService/TimelockService.ts +2 -2
  443. package/src/services/TimelockService/TimelockServiceFallbackSafe.ts +2 -2
  444. package/src/solidity/SlotsDump.ts +1 -1
  445. package/src/solidity/SlotsParser/MappingSettersResolver.ts +3 -3
  446. package/src/solidity/SlotsParser/SourceFile.ts +3 -3
  447. package/src/solidity/SolidityParser.ts +1 -1
  448. package/src/solidity/SourceCodeProvider.ts +1 -1
  449. package/src/solidity/storage/Accessor.spec.ts +1 -1
  450. package/src/solidity/storage/Accessor.ts +1 -1
  451. package/src/solidity/storage/SlotDynamicArray.ts +1 -1
  452. package/src/solidity/storage/SlotFixedArray.ts +1 -1
  453. package/src/solidity/storage/SlotsStorageTransport.ts +3 -3
  454. package/src/solidity/storage/handlers/SlotBytesHandler.ts +1 -1
  455. package/src/solidity/storage/handlers/SlotDynamicArrayHandler.ts +1 -1
  456. package/src/solidity/storage/handlers/SlotFixedArrayHandler.ts +1 -1
  457. package/src/solidity/storage/handlers/SlotValueConstantHandler.ts +1 -1
  458. package/src/solidity/storage/handlers/SlotValueHandler.ts +1 -1
  459. package/src/solidity/storage/handlers/SlotValueImmutableHandler.ts +4 -4
  460. package/src/tokens/TokenDataProvider.ts +2 -2
  461. package/src/tokens/TokenExchangeService.ts +1 -1
  462. package/src/tokens/TokenExchanges/AmmBase/V2/AmmPairV2Service.ts +2 -2
  463. package/src/tokens/TokenExchanges/AmmV2PriceQuote.ts +2 -2
  464. package/src/tokens/TokenOracles/amm/AmmV1Oracle.ts +2 -2
  465. package/src/tokens/TokenTransferService.ts +2 -2
  466. package/src/tokens/TokensService.ts +1 -1
  467. package/src/txs/ITxBuilderOptions.ts +1 -1
  468. package/src/txs/TxNonceManager.ts +1 -1
  469. package/src/txs/TxWriter.ts +15 -4
  470. package/src/txs/agents/BatchAgent.ts +1 -1
  471. package/src/txs/conditional/GasWatcherTx.ts +1 -1
  472. package/src/txs/receipt/TxLogParser.ts +1 -1
  473. package/src/utils/$crypto.ts +1 -1
  474. package/src/utils/$date.ts +1 -1
  475. package/src/utils/$hex.ts +1 -1
  476. package/src/utils/$logger.ts +1 -1
  477. package/src/utils/$machine.ts +2 -2
  478. package/src/utils/$require.ts +10 -10
  479. package/src/utils/$traces.ts +1 -1
  480. 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. For all Node (Chain) related actions - Web3Client should be used */
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
- /** Find the provider by UUID or use the first one to connect to and to requestAccounts */
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
- // // if got the batch limit lower than current batch, throw to make the wClient to reread the batch limit, and the pool to retry
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} Batch with error "${ this.results[0]?.error?.message }". Fallback to single calls.`;
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 when processing by one request errored after ${index + 1} requests`;
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 could be launched in forking mode
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
- // block time in ms
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 Node endpoints nor web3 instance provided`);
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 the web3 initialize the Web3 compatibility class ('compatibility/Web3.ts') instead`)
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 the 'input' as in Transaction */
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, we pass the loaded logs in batches direct to onProgress
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
- * Override the default block range limits for all underlying RPC clients, otherwise the config will be used or
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 cb will be called with fetched and parsed logs on each iteration
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
- // ensure numbers, bigints, bools are in HEX
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
- // ensure all topics are in 32-byte
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: There are ${removedLogs.length} removed Logs. But @dequanto didn't handle this as they are not expected to be present in past logs.`);
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, `FromBlock must be a number`);
616
- $require.Number(toBlock, `ToBlock must be a number`);
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 10000 results
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
- // handle unknown range, otherwise throw
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", "limit exceeded",
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 might be skipped that are in the same block.
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 variation, but ensures the config is being fetched */
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
- // extracted from known and common rate-limit messages
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
- // relative time
102
+ // Relative time
103
103
  if (val < 1000) {
104
- // in seconds
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 Node ${this.id} with (${this.rates[0].counter}req) was ${awaited.count}x throttled, in total for ${ $date.formatTimespan(awaited.total) }. Current wait-time: ${ $date.formatTimespan(ms) }`
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 Node ${this.id} with (${this.rates[0].counter}req) waits now for ${ $date.formatTimespan(ms) } to continue.`
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 epoch rate limiter (1s, 1m, 1h) we track each request
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}. Expects to match the regex: ${rgx.toString()}`);
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, with `addTicks` we save the time BEFORE sending to the server
316
- * Here we should update the times AFTER the response received,
317
- * otherwise the Request could be removed locally from TimeWindow earlier, as it has been cleared on the backend.
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
- // older ticks, continue to slice later
332
+ // Older ticks; continue and slice later
333
333
  continue;
334
334
  }
335
335
 
336
336
  if (i > 0) {
337
- // remove older requests
337
+ // Remove older requests
338
338
  ticks.splice(0, i);
339
339
  }
340
- // in range tick found
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
- // alias to `provider`
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
- // block time in ms
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
- /** Attach this wrapper to the promiseEvent */
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
- /** Normalize user input by normalizing to the array of TAbiItems */
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, to read at least bytes if nothing set
19
+ // Normalize outputs to read at least bytes if nothing is set
20
20
  first.outputs = [
21
21
  {
22
22
  type: 'bytes32',
@@ -30,4 +30,8 @@ export namespace ClientErrorUtil {
30
30
  export function IsNonceTooHigh(error: Error) {
31
31
  return /nonce too high/i.test(error.message);
32
32
  }
33
+
34
+ export function IsUnderpriced(error: Error) {
35
+ return /underpriced/i.test(error.message);
36
+ }
33
37
  }
@@ -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, `Abi not provided to get the Abi Json from`);
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
- // if path not relative, check the file at ClassFile location
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, `Abi not resolved from ${abi}`);
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, 'contract address is not valid');
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 contracts ABI for ${address}. `)
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 is not resolved from ${platform}/${address}: ${error.message ?? error}`);
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
- // remove default values
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 arguments count. Got ${args.length} arguments`);
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}. We should pick the ABI by parameters type.`)
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
- /** if TRUE the data will be only forwarded via onProgress callback.
462
- * And the final array will be undefined.
463
- * This will handle big queries to hold huge arrays in memory
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
- // Updates the singleton instance
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 2. overloaded function the single check will match both structs
671
- // therefore we need later to call with tupleCheck === 'both' to detect correct overload
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
- // all inputs should be deferred requests
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 Deferred Request at position ${ requests.indexOf(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, then the logs will be searched globally */
193
+ /** Can be UNDEFINED; then the logs will be searched globally. */
194
194
  address?: TAddress | TAddress[]
195
195
  /**
196
- * "deployment": get the contracts deployment date to skip lots of blocks (in case we use pagination to fetch logs)
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 the "fromBlock" is "deployment"`)
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 look from block 0
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
- // is Array: query multiple events
262
+ // Array: query multiple events.
263
263
  let topics = [
264
264
  abi.map($abiUtils.getTopicSignature)
265
265
  ];