viem 2.8.10 → 2.8.11

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 (690) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/_cjs/accounts/generateMnemonic.js.map +1 -1
  3. package/_cjs/actions/getContract.js.map +1 -1
  4. package/_cjs/actions/public/call.js +5 -1
  5. package/_cjs/actions/public/call.js.map +1 -1
  6. package/_cjs/actions/public/createContractEventFilter.js.map +1 -1
  7. package/_cjs/actions/public/estimateFeesPerGas.js.map +1 -1
  8. package/_cjs/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -1
  9. package/_cjs/actions/public/watchBlockNumber.js +1 -1
  10. package/_cjs/actions/public/watchBlockNumber.js.map +1 -1
  11. package/_cjs/actions/public/watchBlocks.js +1 -1
  12. package/_cjs/actions/public/watchBlocks.js.map +1 -1
  13. package/_cjs/actions/public/watchContractEvent.js +73 -58
  14. package/_cjs/actions/public/watchContractEvent.js.map +1 -1
  15. package/_cjs/actions/public/watchEvent.js +1 -1
  16. package/_cjs/actions/public/watchEvent.js.map +1 -1
  17. package/_cjs/actions/public/watchPendingTransactions.js +1 -1
  18. package/_cjs/actions/public/watchPendingTransactions.js.map +1 -1
  19. package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
  20. package/_cjs/chains/celo/parsers.js.map +1 -1
  21. package/_cjs/chains/celo/serializers.js.map +1 -1
  22. package/_cjs/chains/definitions/lukso.js +6 -0
  23. package/_cjs/chains/definitions/lukso.js.map +1 -1
  24. package/_cjs/chains/definitions/luksoTestnet.js +34 -0
  25. package/_cjs/chains/definitions/luksoTestnet.js.map +1 -0
  26. package/_cjs/chains/definitions/zkSyncInMemoryNode.js +17 -0
  27. package/_cjs/chains/definitions/zkSyncInMemoryNode.js.map +1 -0
  28. package/_cjs/chains/definitions/zkSyncLocalNode.js +17 -0
  29. package/_cjs/chains/definitions/zkSyncLocalNode.js.map +1 -0
  30. package/_cjs/chains/index.js +19 -13
  31. package/_cjs/chains/index.js.map +1 -1
  32. package/_cjs/chains/opStack/actions/getL1BaseFee.js.map +1 -1
  33. package/_cjs/chains/opStack/actions/getTimeToProve.js.map +1 -1
  34. package/_cjs/chains/opStack/actions/waitForNextL2Output.js.map +1 -1
  35. package/_cjs/chains/zksync/formatters.js.map +1 -1
  36. package/_cjs/chains/zksync/serializers.js.map +1 -1
  37. package/_cjs/chains/zksync/utils/assertEip712Request.js.map +1 -1
  38. package/_cjs/chains/zksync/utils/assertEip712Transaction.js.map +1 -1
  39. package/_cjs/chains/zksync/utils/isEip712Transaction.js.map +1 -1
  40. package/_cjs/clients/createClient.js.map +1 -1
  41. package/_cjs/clients/decorators/public.js.map +1 -1
  42. package/_cjs/clients/transports/createTransport.js.map +1 -1
  43. package/_cjs/clients/transports/fallback.js.map +1 -1
  44. package/_cjs/clients/transports/http.js.map +1 -1
  45. package/_cjs/errors/abi.js.map +1 -1
  46. package/_cjs/errors/account.js.map +1 -1
  47. package/_cjs/errors/base.js.map +1 -1
  48. package/_cjs/errors/chain.js.map +1 -1
  49. package/_cjs/errors/contract.js.map +1 -1
  50. package/_cjs/errors/node.js +5 -5
  51. package/_cjs/errors/node.js.map +1 -1
  52. package/_cjs/errors/request.js.map +1 -1
  53. package/_cjs/errors/rpc.js.map +1 -1
  54. package/_cjs/errors/version.js +1 -1
  55. package/_cjs/index.js.map +1 -1
  56. package/_cjs/utils/abi/formatAbiItem.js.map +1 -1
  57. package/_cjs/utils/address/getAddress.js.map +1 -1
  58. package/_cjs/utils/data/isHex.js.map +1 -1
  59. package/_cjs/utils/data/slice.js.map +1 -1
  60. package/_cjs/utils/encoding/toBytes.js.map +1 -1
  61. package/_cjs/utils/errors/getNodeError.js.map +1 -1
  62. package/_cjs/utils/formatters/block.js.map +1 -1
  63. package/_cjs/utils/formatters/extract.js.map +1 -1
  64. package/_cjs/utils/formatters/log.js +1 -1
  65. package/_cjs/utils/formatters/log.js.map +1 -1
  66. package/_cjs/utils/formatters/proof.js.map +1 -1
  67. package/_cjs/utils/formatters/transaction.js.map +1 -1
  68. package/_cjs/utils/formatters/transactionReceipt.js.map +1 -1
  69. package/_cjs/utils/formatters/transactionRequest.js.map +1 -1
  70. package/_cjs/utils/hash/keccak256.js.map +1 -1
  71. package/_cjs/utils/hash/ripemd160.js.map +1 -1
  72. package/_cjs/utils/hash/sha256.js.map +1 -1
  73. package/_cjs/utils/promise/withRetry.js.map +1 -1
  74. package/_cjs/utils/promise/withTimeout.js +1 -1
  75. package/_cjs/utils/promise/withTimeout.js.map +1 -1
  76. package/_cjs/utils/rpc/http.js +1 -1
  77. package/_cjs/utils/rpc/http.js.map +1 -1
  78. package/_cjs/utils/signature/hashMessage.js.map +1 -1
  79. package/_cjs/utils/transaction/assertRequest.js.map +1 -1
  80. package/_cjs/utils/transaction/getTransactionType.js.map +1 -1
  81. package/_cjs/utils/transaction/serializeAccessList.js.map +1 -1
  82. package/_cjs/utils/transaction/serializeTransaction.js.map +1 -1
  83. package/_cjs/utils/typedData.js.map +1 -1
  84. package/_esm/accounts/generateMnemonic.js.map +1 -1
  85. package/_esm/actions/getContract.js.map +1 -1
  86. package/_esm/actions/public/call.js +5 -1
  87. package/_esm/actions/public/call.js.map +1 -1
  88. package/_esm/actions/public/createContractEventFilter.js.map +1 -1
  89. package/_esm/actions/public/estimateFeesPerGas.js.map +1 -1
  90. package/_esm/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -1
  91. package/_esm/actions/public/watchBlockNumber.js +1 -1
  92. package/_esm/actions/public/watchBlockNumber.js.map +1 -1
  93. package/_esm/actions/public/watchBlocks.js +1 -1
  94. package/_esm/actions/public/watchBlocks.js.map +1 -1
  95. package/_esm/actions/public/watchContractEvent.js +75 -60
  96. package/_esm/actions/public/watchContractEvent.js.map +1 -1
  97. package/_esm/actions/public/watchEvent.js +1 -1
  98. package/_esm/actions/public/watchEvent.js.map +1 -1
  99. package/_esm/actions/public/watchPendingTransactions.js +1 -1
  100. package/_esm/actions/public/watchPendingTransactions.js.map +1 -1
  101. package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
  102. package/_esm/chains/celo/parsers.js.map +1 -1
  103. package/_esm/chains/celo/serializers.js.map +1 -1
  104. package/_esm/chains/definitions/lukso.js +6 -0
  105. package/_esm/chains/definitions/lukso.js.map +1 -1
  106. package/_esm/chains/definitions/luksoTestnet.js +31 -0
  107. package/_esm/chains/definitions/luksoTestnet.js.map +1 -0
  108. package/_esm/chains/definitions/zkSyncInMemoryNode.js +14 -0
  109. package/_esm/chains/definitions/zkSyncInMemoryNode.js.map +1 -0
  110. package/_esm/chains/definitions/zkSyncLocalNode.js +14 -0
  111. package/_esm/chains/definitions/zkSyncLocalNode.js.map +1 -0
  112. package/_esm/chains/index.js +8 -5
  113. package/_esm/chains/index.js.map +1 -1
  114. package/_esm/chains/opStack/actions/getL1BaseFee.js.map +1 -1
  115. package/_esm/chains/opStack/actions/getTimeToProve.js.map +1 -1
  116. package/_esm/chains/opStack/actions/waitForNextL2Output.js.map +1 -1
  117. package/_esm/chains/opStack/decorators/publicL2.js +2 -2
  118. package/_esm/chains/zksync/formatters.js.map +1 -1
  119. package/_esm/chains/zksync/serializers.js.map +1 -1
  120. package/_esm/chains/zksync/utils/assertEip712Request.js.map +1 -1
  121. package/_esm/chains/zksync/utils/assertEip712Transaction.js.map +1 -1
  122. package/_esm/chains/zksync/utils/isEip712Transaction.js.map +1 -1
  123. package/_esm/clients/createClient.js.map +1 -1
  124. package/_esm/clients/decorators/public.js.map +1 -1
  125. package/_esm/clients/transports/createTransport.js.map +1 -1
  126. package/_esm/clients/transports/fallback.js.map +1 -1
  127. package/_esm/clients/transports/http.js.map +1 -1
  128. package/_esm/errors/abi.js.map +1 -1
  129. package/_esm/errors/account.js.map +1 -1
  130. package/_esm/errors/base.js.map +1 -1
  131. package/_esm/errors/chain.js.map +1 -1
  132. package/_esm/errors/contract.js.map +1 -1
  133. package/_esm/errors/node.js +5 -5
  134. package/_esm/errors/node.js.map +1 -1
  135. package/_esm/errors/request.js.map +1 -1
  136. package/_esm/errors/rpc.js.map +1 -1
  137. package/_esm/errors/version.js +1 -1
  138. package/_esm/index.js.map +1 -1
  139. package/_esm/utils/abi/formatAbiItem.js.map +1 -1
  140. package/_esm/utils/address/getAddress.js.map +1 -1
  141. package/_esm/utils/data/isHex.js.map +1 -1
  142. package/_esm/utils/data/slice.js.map +1 -1
  143. package/_esm/utils/encoding/toBytes.js.map +1 -1
  144. package/_esm/utils/errors/getNodeError.js.map +1 -1
  145. package/_esm/utils/formatters/block.js.map +1 -1
  146. package/_esm/utils/formatters/extract.js.map +1 -1
  147. package/_esm/utils/formatters/log.js +1 -1
  148. package/_esm/utils/formatters/log.js.map +1 -1
  149. package/_esm/utils/formatters/proof.js.map +1 -1
  150. package/_esm/utils/formatters/transaction.js.map +1 -1
  151. package/_esm/utils/formatters/transactionReceipt.js.map +1 -1
  152. package/_esm/utils/formatters/transactionRequest.js.map +1 -1
  153. package/_esm/utils/hash/keccak256.js.map +1 -1
  154. package/_esm/utils/hash/ripemd160.js.map +1 -1
  155. package/_esm/utils/hash/sha256.js.map +1 -1
  156. package/_esm/utils/promise/withRetry.js.map +1 -1
  157. package/_esm/utils/promise/withTimeout.js +1 -1
  158. package/_esm/utils/promise/withTimeout.js.map +1 -1
  159. package/_esm/utils/rpc/http.js +1 -1
  160. package/_esm/utils/rpc/http.js.map +1 -1
  161. package/_esm/utils/signature/hashMessage.js.map +1 -1
  162. package/_esm/utils/transaction/assertRequest.js.map +1 -1
  163. package/_esm/utils/transaction/getTransactionType.js.map +1 -1
  164. package/_esm/utils/transaction/serializeAccessList.js.map +1 -1
  165. package/_esm/utils/transaction/serializeTransaction.js.map +1 -1
  166. package/_esm/utils/typedData.js.map +1 -1
  167. package/_types/accounts/generateMnemonic.d.ts +1 -1
  168. package/_types/accounts/generateMnemonic.d.ts.map +1 -1
  169. package/_types/accounts/types.d.ts +9 -9
  170. package/_types/accounts/types.d.ts.map +1 -1
  171. package/_types/accounts/utils/signTransaction.d.ts +1 -1
  172. package/_types/accounts/utils/signTransaction.d.ts.map +1 -1
  173. package/_types/actions/ens/getEnsAddress.d.ts +4 -4
  174. package/_types/actions/ens/getEnsAddress.d.ts.map +1 -1
  175. package/_types/actions/ens/getEnsAvatar.d.ts +1 -1
  176. package/_types/actions/ens/getEnsAvatar.d.ts.map +1 -1
  177. package/_types/actions/ens/getEnsName.d.ts +3 -3
  178. package/_types/actions/ens/getEnsName.d.ts.map +1 -1
  179. package/_types/actions/ens/getEnsResolver.d.ts +1 -1
  180. package/_types/actions/ens/getEnsResolver.d.ts.map +1 -1
  181. package/_types/actions/ens/getEnsText.d.ts +3 -3
  182. package/_types/actions/ens/getEnsText.d.ts.map +1 -1
  183. package/_types/actions/getContract.d.ts +3 -3
  184. package/_types/actions/getContract.d.ts.map +1 -1
  185. package/_types/actions/public/call.d.ts +8 -8
  186. package/_types/actions/public/call.d.ts.map +1 -1
  187. package/_types/actions/public/createContractEventFilter.d.ts +6 -6
  188. package/_types/actions/public/createContractEventFilter.d.ts.map +1 -1
  189. package/_types/actions/public/createEventFilter.d.ts +21 -21
  190. package/_types/actions/public/createEventFilter.d.ts.map +1 -1
  191. package/_types/actions/public/estimateFeesPerGas.d.ts +4 -4
  192. package/_types/actions/public/estimateFeesPerGas.d.ts.map +1 -1
  193. package/_types/actions/public/estimateGas.d.ts +5 -5
  194. package/_types/actions/public/estimateGas.d.ts.map +1 -1
  195. package/_types/actions/public/estimateMaxPriorityFeePerGas.d.ts +3 -3
  196. package/_types/actions/public/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
  197. package/_types/actions/public/getBalance.d.ts +4 -4
  198. package/_types/actions/public/getBalance.d.ts.map +1 -1
  199. package/_types/actions/public/getBlock.d.ts +10 -10
  200. package/_types/actions/public/getBlock.d.ts.map +1 -1
  201. package/_types/actions/public/getBlockNumber.d.ts +1 -1
  202. package/_types/actions/public/getBlockNumber.d.ts.map +1 -1
  203. package/_types/actions/public/getBlockTransactionCount.d.ts +9 -9
  204. package/_types/actions/public/getBlockTransactionCount.d.ts.map +1 -1
  205. package/_types/actions/public/getBytecode.d.ts +4 -4
  206. package/_types/actions/public/getBytecode.d.ts.map +1 -1
  207. package/_types/actions/public/getContractEvents.d.ts +4 -4
  208. package/_types/actions/public/getContractEvents.d.ts.map +1 -1
  209. package/_types/actions/public/getFeeHistory.d.ts +4 -4
  210. package/_types/actions/public/getFeeHistory.d.ts.map +1 -1
  211. package/_types/actions/public/getLogs.d.ts +17 -17
  212. package/_types/actions/public/getLogs.d.ts.map +1 -1
  213. package/_types/actions/public/getProof.d.ts +4 -4
  214. package/_types/actions/public/getProof.d.ts.map +1 -1
  215. package/_types/actions/public/getStorageAt.d.ts +4 -4
  216. package/_types/actions/public/getStorageAt.d.ts.map +1 -1
  217. package/_types/actions/public/getTransaction.d.ts +13 -13
  218. package/_types/actions/public/getTransaction.d.ts.map +1 -1
  219. package/_types/actions/public/getTransactionConfirmations.d.ts +2 -2
  220. package/_types/actions/public/getTransactionConfirmations.d.ts.map +1 -1
  221. package/_types/actions/public/getTransactionCount.d.ts +4 -4
  222. package/_types/actions/public/getTransactionCount.d.ts.map +1 -1
  223. package/_types/actions/public/simulateContract.d.ts +3 -3
  224. package/_types/actions/public/simulateContract.d.ts.map +1 -1
  225. package/_types/actions/public/waitForTransactionReceipt.d.ts +6 -6
  226. package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
  227. package/_types/actions/public/watchBlockNumber.d.ts +1 -1
  228. package/_types/actions/public/watchBlockNumber.d.ts.map +1 -1
  229. package/_types/actions/public/watchContractEvent.d.ts.map +1 -1
  230. package/_types/actions/public/watchEvent.d.ts +13 -13
  231. package/_types/actions/public/watchEvent.d.ts.map +1 -1
  232. package/_types/actions/public/watchPendingTransactions.d.ts +1 -1
  233. package/_types/actions/public/watchPendingTransactions.d.ts.map +1 -1
  234. package/_types/actions/test/mine.d.ts +1 -1
  235. package/_types/actions/test/mine.d.ts.map +1 -1
  236. package/_types/actions/test/reset.d.ts +2 -2
  237. package/_types/actions/test/reset.d.ts.map +1 -1
  238. package/_types/actions/wallet/prepareTransactionRequest.d.ts +5 -5
  239. package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
  240. package/_types/actions/wallet/writeContract.d.ts +1 -1
  241. package/_types/actions/wallet/writeContract.d.ts.map +1 -1
  242. package/_types/chains/celo/chainConfig.d.ts +312 -312
  243. package/_types/chains/celo/formatters.d.ts +312 -312
  244. package/_types/chains/celo/parsers.d.ts.map +1 -1
  245. package/_types/chains/celo/serializers.d.ts +1 -1
  246. package/_types/chains/celo/serializers.d.ts.map +1 -1
  247. package/_types/chains/celo/types.d.ts +39 -39
  248. package/_types/chains/celo/types.d.ts.map +1 -1
  249. package/_types/chains/definitions/ancient8.d.ts +217 -217
  250. package/_types/chains/definitions/ancient8Sepolia.d.ts +217 -217
  251. package/_types/chains/definitions/base.d.ts +217 -217
  252. package/_types/chains/definitions/baseGoerli.d.ts +217 -217
  253. package/_types/chains/definitions/baseSepolia.d.ts +217 -217
  254. package/_types/chains/definitions/celo.d.ts +312 -312
  255. package/_types/chains/definitions/celoAlfajores.d.ts +312 -312
  256. package/_types/chains/definitions/fraxtal.d.ts +217 -217
  257. package/_types/chains/definitions/fraxtalTestnet.d.ts +217 -217
  258. package/_types/chains/definitions/liskSepolia.d.ts +217 -217
  259. package/_types/chains/definitions/lukso.d.ts +6 -8
  260. package/_types/chains/definitions/lukso.d.ts.map +1 -1
  261. package/_types/chains/definitions/luksoTestnet.d.ts +35 -0
  262. package/_types/chains/definitions/luksoTestnet.d.ts.map +1 -0
  263. package/_types/chains/definitions/optimism.d.ts +217 -217
  264. package/_types/chains/definitions/optimismGoerli.d.ts +217 -217
  265. package/_types/chains/definitions/optimismSepolia.d.ts +217 -217
  266. package/_types/chains/definitions/pgn.d.ts +217 -217
  267. package/_types/chains/definitions/pgnTestnet.d.ts +217 -217
  268. package/_types/chains/definitions/rss3.d.ts +217 -217
  269. package/_types/chains/definitions/rss3Sepolia.d.ts +217 -217
  270. package/_types/chains/definitions/zkSync.d.ts +33 -33
  271. package/_types/chains/definitions/zkSyncInMemoryNode.d.ts +42 -0
  272. package/_types/chains/definitions/zkSyncInMemoryNode.d.ts.map +1 -0
  273. package/_types/chains/definitions/zkSyncLocalNode.d.ts +42 -0
  274. package/_types/chains/definitions/zkSyncLocalNode.d.ts.map +1 -0
  275. package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts +33 -33
  276. package/_types/chains/definitions/zkSyncTestnet.d.ts +33 -33
  277. package/_types/chains/definitions/zora.d.ts +217 -217
  278. package/_types/chains/definitions/zoraSepolia.d.ts +217 -217
  279. package/_types/chains/definitions/zoraTestnet.d.ts +217 -217
  280. package/_types/chains/index.d.ts +8 -5
  281. package/_types/chains/index.d.ts.map +1 -1
  282. package/_types/chains/opStack/actions/buildDepositTransaction.d.ts +7 -7
  283. package/_types/chains/opStack/actions/buildDepositTransaction.d.ts.map +1 -1
  284. package/_types/chains/opStack/actions/buildInitiateWithdrawal.d.ts +3 -3
  285. package/_types/chains/opStack/actions/buildInitiateWithdrawal.d.ts.map +1 -1
  286. package/_types/chains/opStack/actions/depositTransaction.d.ts +1 -1
  287. package/_types/chains/opStack/actions/depositTransaction.d.ts.map +1 -1
  288. package/_types/chains/opStack/actions/estimateDepositTransactionGas.d.ts +1 -1
  289. package/_types/chains/opStack/actions/estimateDepositTransactionGas.d.ts.map +1 -1
  290. package/_types/chains/opStack/actions/estimateFinalizeWithdrawalGas.d.ts +1 -1
  291. package/_types/chains/opStack/actions/estimateFinalizeWithdrawalGas.d.ts.map +1 -1
  292. package/_types/chains/opStack/actions/estimateInitiateWithdrawalGas.d.ts +1 -1
  293. package/_types/chains/opStack/actions/estimateInitiateWithdrawalGas.d.ts.map +1 -1
  294. package/_types/chains/opStack/actions/estimateL1Fee.d.ts +1 -1
  295. package/_types/chains/opStack/actions/estimateL1Fee.d.ts.map +1 -1
  296. package/_types/chains/opStack/actions/estimateL1Gas.d.ts +1 -1
  297. package/_types/chains/opStack/actions/estimateL1Gas.d.ts.map +1 -1
  298. package/_types/chains/opStack/actions/estimateProveWithdrawalGas.d.ts +1 -1
  299. package/_types/chains/opStack/actions/estimateProveWithdrawalGas.d.ts.map +1 -1
  300. package/_types/chains/opStack/actions/finalizeWithdrawal.d.ts +1 -1
  301. package/_types/chains/opStack/actions/finalizeWithdrawal.d.ts.map +1 -1
  302. package/_types/chains/opStack/actions/getL1BaseFee.d.ts +2 -2
  303. package/_types/chains/opStack/actions/getL1BaseFee.d.ts.map +1 -1
  304. package/_types/chains/opStack/actions/getTimeToNextL2Output.d.ts +2 -2
  305. package/_types/chains/opStack/actions/getTimeToNextL2Output.d.ts.map +1 -1
  306. package/_types/chains/opStack/actions/getTimeToProve.d.ts +1 -1
  307. package/_types/chains/opStack/actions/getTimeToProve.d.ts.map +1 -1
  308. package/_types/chains/opStack/actions/proveWithdrawal.d.ts +1 -1
  309. package/_types/chains/opStack/actions/proveWithdrawal.d.ts.map +1 -1
  310. package/_types/chains/opStack/actions/waitForNextL2Output.d.ts +2 -2
  311. package/_types/chains/opStack/actions/waitForNextL2Output.d.ts.map +1 -1
  312. package/_types/chains/opStack/actions/waitToProve.d.ts +1 -1
  313. package/_types/chains/opStack/actions/waitToProve.d.ts.map +1 -1
  314. package/_types/chains/opStack/chainConfig.d.ts +217 -217
  315. package/_types/chains/opStack/decorators/publicL2.d.ts +3 -3
  316. package/_types/chains/opStack/decorators/publicL2.d.ts.map +1 -1
  317. package/_types/chains/opStack/formatters.d.ts +217 -217
  318. package/_types/chains/opStack/types/deposit.d.ts +6 -6
  319. package/_types/chains/opStack/types/deposit.d.ts.map +1 -1
  320. package/_types/chains/opStack/types/transaction.d.ts +4 -4
  321. package/_types/chains/opStack/types/transaction.d.ts.map +1 -1
  322. package/_types/chains/opStack/types/withdrawal.d.ts +2 -2
  323. package/_types/chains/opStack/types/withdrawal.d.ts.map +1 -1
  324. package/_types/chains/zksync/chainConfig.d.ts +33 -33
  325. package/_types/chains/zksync/formatters.d.ts +33 -33
  326. package/_types/chains/zksync/serializers.d.ts +1 -1
  327. package/_types/chains/zksync/serializers.d.ts.map +1 -1
  328. package/_types/chains/zksync/types/eip712.d.ts +4 -4
  329. package/_types/chains/zksync/types/eip712.d.ts.map +1 -1
  330. package/_types/chains/zksync/types/transaction.d.ts +21 -21
  331. package/_types/chains/zksync/types/transaction.d.ts.map +1 -1
  332. package/_types/chains/zksync/utils/assertEip712Request.d.ts +2 -1
  333. package/_types/chains/zksync/utils/assertEip712Request.d.ts.map +1 -1
  334. package/_types/chains/zksync/utils/assertEip712Transaction.d.ts +2 -1
  335. package/_types/chains/zksync/utils/assertEip712Transaction.d.ts.map +1 -1
  336. package/_types/chains/zksync/utils/isEip712Transaction.d.ts +2 -1
  337. package/_types/chains/zksync/utils/isEip712Transaction.d.ts.map +1 -1
  338. package/_types/clients/createClient.d.ts +2 -2
  339. package/_types/clients/createClient.d.ts.map +1 -1
  340. package/_types/clients/decorators/public.d.ts +7 -7
  341. package/_types/clients/decorators/public.d.ts.map +1 -1
  342. package/_types/clients/decorators/test.d.ts +1 -1
  343. package/_types/clients/decorators/test.d.ts.map +1 -1
  344. package/_types/clients/transports/createTransport.d.ts +9 -9
  345. package/_types/clients/transports/createTransport.d.ts.map +1 -1
  346. package/_types/clients/transports/custom.d.ts +4 -4
  347. package/_types/clients/transports/custom.d.ts.map +1 -1
  348. package/_types/clients/transports/fallback.d.ts +17 -17
  349. package/_types/clients/transports/fallback.d.ts.map +1 -1
  350. package/_types/clients/transports/http.d.ts +13 -13
  351. package/_types/clients/transports/http.d.ts.map +1 -1
  352. package/_types/clients/transports/ipc.d.ts +6 -6
  353. package/_types/clients/transports/ipc.d.ts.map +1 -1
  354. package/_types/clients/transports/webSocket.d.ts +6 -6
  355. package/_types/clients/transports/webSocket.d.ts.map +1 -1
  356. package/_types/errors/abi.d.ts +6 -6
  357. package/_types/errors/abi.d.ts.map +1 -1
  358. package/_types/errors/account.d.ts +1 -1
  359. package/_types/errors/account.d.ts.map +1 -1
  360. package/_types/errors/base.d.ts +9 -9
  361. package/_types/errors/base.d.ts.map +1 -1
  362. package/_types/errors/block.d.ts +2 -2
  363. package/_types/errors/block.d.ts.map +1 -1
  364. package/_types/errors/chain.d.ts +3 -3
  365. package/_types/errors/chain.d.ts.map +1 -1
  366. package/_types/errors/contract.d.ts +20 -20
  367. package/_types/errors/contract.d.ts.map +1 -1
  368. package/_types/errors/encoding.d.ts +3 -3
  369. package/_types/errors/encoding.d.ts.map +1 -1
  370. package/_types/errors/estimateGas.d.ts +3 -3
  371. package/_types/errors/estimateGas.d.ts.map +1 -1
  372. package/_types/errors/node.d.ts +27 -27
  373. package/_types/errors/node.d.ts.map +1 -1
  374. package/_types/errors/request.d.ts +7 -7
  375. package/_types/errors/request.d.ts.map +1 -1
  376. package/_types/errors/rpc.d.ts +5 -5
  377. package/_types/errors/rpc.d.ts.map +1 -1
  378. package/_types/errors/transaction.d.ts +7 -7
  379. package/_types/errors/transaction.d.ts.map +1 -1
  380. package/_types/errors/version.d.ts +1 -1
  381. package/_types/index.d.ts +1 -1
  382. package/_types/index.d.ts.map +1 -1
  383. package/_types/types/block.d.ts +3 -3
  384. package/_types/types/block.d.ts.map +1 -1
  385. package/_types/types/chain.d.ts +1 -1
  386. package/_types/types/chain.d.ts.map +1 -1
  387. package/_types/types/contract.d.ts +5 -5
  388. package/_types/types/contract.d.ts.map +1 -1
  389. package/_types/types/eip1193.d.ts +29 -29
  390. package/_types/types/eip1193.d.ts.map +1 -1
  391. package/_types/types/ens.d.ts +1 -1
  392. package/_types/types/ens.d.ts.map +1 -1
  393. package/_types/types/fee.d.ts +6 -6
  394. package/_types/types/fee.d.ts.map +1 -1
  395. package/_types/types/filter.d.ts +9 -9
  396. package/_types/types/filter.d.ts.map +1 -1
  397. package/_types/types/kzg.d.ts +1 -1
  398. package/_types/types/kzg.d.ts.map +1 -1
  399. package/_types/types/misc.d.ts +2 -2
  400. package/_types/types/misc.d.ts.map +1 -1
  401. package/_types/types/rpc.d.ts +16 -16
  402. package/_types/types/rpc.d.ts.map +1 -1
  403. package/_types/types/stateOverride.d.ts +5 -5
  404. package/_types/types/stateOverride.d.ts.map +1 -1
  405. package/_types/types/transaction.d.ts +56 -56
  406. package/_types/types/transaction.d.ts.map +1 -1
  407. package/_types/types/typedData.d.ts +1 -1
  408. package/_types/types/typedData.d.ts.map +1 -1
  409. package/_types/types/utils.d.ts +6 -3
  410. package/_types/types/utils.d.ts.map +1 -1
  411. package/_types/types/window.d.ts +1 -1
  412. package/_types/types/window.d.ts.map +1 -1
  413. package/_types/utils/abi/decodeEventLog.d.ts +1 -1
  414. package/_types/utils/abi/decodeEventLog.d.ts.map +1 -1
  415. package/_types/utils/abi/decodeFunctionResult.d.ts +2 -2
  416. package/_types/utils/abi/decodeFunctionResult.d.ts.map +1 -1
  417. package/_types/utils/abi/encodeErrorResult.d.ts +2 -2
  418. package/_types/utils/abi/encodeErrorResult.d.ts.map +1 -1
  419. package/_types/utils/abi/encodeEventTopics.d.ts +2 -2
  420. package/_types/utils/abi/encodeEventTopics.d.ts.map +1 -1
  421. package/_types/utils/abi/encodeFunctionData.d.ts +2 -2
  422. package/_types/utils/abi/encodeFunctionData.d.ts.map +1 -1
  423. package/_types/utils/abi/encodeFunctionResult.d.ts +2 -2
  424. package/_types/utils/abi/encodeFunctionResult.d.ts.map +1 -1
  425. package/_types/utils/abi/formatAbiItem.d.ts +2 -2
  426. package/_types/utils/abi/formatAbiItem.d.ts.map +1 -1
  427. package/_types/utils/abi/formatAbiItemWithArgs.d.ts +2 -2
  428. package/_types/utils/abi/formatAbiItemWithArgs.d.ts.map +1 -1
  429. package/_types/utils/address/getAddress.d.ts +1 -1
  430. package/_types/utils/address/getAddress.d.ts.map +1 -1
  431. package/_types/utils/address/getContractAddress.d.ts +1 -1
  432. package/_types/utils/address/getContractAddress.d.ts.map +1 -1
  433. package/_types/utils/address/isAddress.d.ts +1 -1
  434. package/_types/utils/address/isAddress.d.ts.map +1 -1
  435. package/_types/utils/blob/commitmentToVersionedHash.d.ts +1 -1
  436. package/_types/utils/blob/commitmentToVersionedHash.d.ts.map +1 -1
  437. package/_types/utils/blob/commitmentsToVersionedHashes.d.ts +1 -1
  438. package/_types/utils/blob/commitmentsToVersionedHashes.d.ts.map +1 -1
  439. package/_types/utils/blob/sidecarsToVersionedHashes.d.ts +1 -1
  440. package/_types/utils/blob/sidecarsToVersionedHashes.d.ts.map +1 -1
  441. package/_types/utils/chain/assertCurrentChain.d.ts +1 -1
  442. package/_types/utils/chain/assertCurrentChain.d.ts.map +1 -1
  443. package/_types/utils/chain/getChainContractAddress.d.ts +1 -1
  444. package/_types/utils/chain/getChainContractAddress.d.ts.map +1 -1
  445. package/_types/utils/cursor.d.ts +1 -1
  446. package/_types/utils/cursor.d.ts.map +1 -1
  447. package/_types/utils/data/isHex.d.ts +1 -1
  448. package/_types/utils/data/isHex.d.ts.map +1 -1
  449. package/_types/utils/data/pad.d.ts +2 -2
  450. package/_types/utils/data/pad.d.ts.map +1 -1
  451. package/_types/utils/data/slice.d.ts +6 -6
  452. package/_types/utils/data/slice.d.ts.map +1 -1
  453. package/_types/utils/data/trim.d.ts +1 -1
  454. package/_types/utils/data/trim.d.ts.map +1 -1
  455. package/_types/utils/encoding/fromBytes.d.ts +5 -5
  456. package/_types/utils/encoding/fromBytes.d.ts.map +1 -1
  457. package/_types/utils/encoding/fromHex.d.ts +5 -5
  458. package/_types/utils/encoding/fromHex.d.ts.map +1 -1
  459. package/_types/utils/encoding/toBytes.d.ts +5 -5
  460. package/_types/utils/encoding/toBytes.d.ts.map +1 -1
  461. package/_types/utils/encoding/toHex.d.ts +7 -7
  462. package/_types/utils/encoding/toHex.d.ts.map +1 -1
  463. package/_types/utils/ens/avatar/parseAvatarRecord.d.ts +1 -1
  464. package/_types/utils/ens/avatar/parseAvatarRecord.d.ts.map +1 -1
  465. package/_types/utils/errors/getCallError.d.ts +2 -2
  466. package/_types/utils/errors/getCallError.d.ts.map +1 -1
  467. package/_types/utils/errors/getContractError.d.ts +3 -3
  468. package/_types/utils/errors/getContractError.d.ts.map +1 -1
  469. package/_types/utils/errors/getEstimateGasError.d.ts +3 -3
  470. package/_types/utils/errors/getEstimateGasError.d.ts.map +1 -1
  471. package/_types/utils/errors/getNodeError.d.ts +2 -1
  472. package/_types/utils/errors/getNodeError.d.ts.map +1 -1
  473. package/_types/utils/errors/getTransactionError.d.ts +2 -2
  474. package/_types/utils/errors/getTransactionError.d.ts.map +1 -1
  475. package/_types/utils/formatters/block.d.ts +3 -3
  476. package/_types/utils/formatters/block.d.ts.map +1 -1
  477. package/_types/utils/formatters/extract.d.ts +1 -1
  478. package/_types/utils/formatters/extract.d.ts.map +1 -1
  479. package/_types/utils/formatters/formatter.d.ts.map +1 -1
  480. package/_types/utils/formatters/log.d.ts +4 -3
  481. package/_types/utils/formatters/log.d.ts.map +1 -1
  482. package/_types/utils/formatters/proof.d.ts +2 -1
  483. package/_types/utils/formatters/proof.d.ts.map +1 -1
  484. package/_types/utils/formatters/transaction.d.ts +3 -3
  485. package/_types/utils/formatters/transaction.d.ts.map +1 -1
  486. package/_types/utils/formatters/transactionReceipt.d.ts +3 -2
  487. package/_types/utils/formatters/transactionReceipt.d.ts.map +1 -1
  488. package/_types/utils/formatters/transactionRequest.d.ts +3 -2
  489. package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
  490. package/_types/utils/hash/keccak256.d.ts +1 -1
  491. package/_types/utils/hash/keccak256.d.ts.map +1 -1
  492. package/_types/utils/hash/ripemd160.d.ts +1 -1
  493. package/_types/utils/hash/ripemd160.d.ts.map +1 -1
  494. package/_types/utils/hash/sha256.d.ts +1 -1
  495. package/_types/utils/hash/sha256.d.ts.map +1 -1
  496. package/_types/utils/poll.d.ts +2 -2
  497. package/_types/utils/poll.d.ts.map +1 -1
  498. package/_types/utils/promise/createBatchScheduler.d.ts +4 -4
  499. package/_types/utils/promise/createBatchScheduler.d.ts.map +1 -1
  500. package/_types/utils/promise/withCache.d.ts +1 -1
  501. package/_types/utils/promise/withCache.d.ts.map +1 -1
  502. package/_types/utils/promise/withRetry.d.ts +4 -4
  503. package/_types/utils/promise/withRetry.d.ts.map +1 -1
  504. package/_types/utils/promise/withTimeout.d.ts +4 -4
  505. package/_types/utils/promise/withTimeout.d.ts.map +1 -1
  506. package/_types/utils/rpc/http.d.ts +6 -6
  507. package/_types/utils/rpc/http.d.ts.map +1 -1
  508. package/_types/utils/rpc/socket.d.ts +2 -2
  509. package/_types/utils/rpc/socket.d.ts.map +1 -1
  510. package/_types/utils/signature/hashMessage.d.ts +1 -1
  511. package/_types/utils/signature/hashMessage.d.ts.map +1 -1
  512. package/_types/utils/transaction/assertRequest.d.ts +2 -1
  513. package/_types/utils/transaction/assertRequest.d.ts.map +1 -1
  514. package/_types/utils/transaction/getTransactionType.d.ts +4 -4
  515. package/_types/utils/transaction/getTransactionType.d.ts.map +1 -1
  516. package/_types/utils/transaction/serializeAccessList.d.ts +1 -1
  517. package/_types/utils/transaction/serializeAccessList.d.ts.map +1 -1
  518. package/_types/utils/transaction/serializeTransaction.d.ts +2 -2
  519. package/_types/utils/transaction/serializeTransaction.d.ts.map +1 -1
  520. package/_types/utils/typedData.d.ts +1 -1
  521. package/_types/utils/typedData.d.ts.map +1 -1
  522. package/accounts/generateMnemonic.ts +1 -1
  523. package/accounts/types.ts +12 -10
  524. package/accounts/utils/signTransaction.ts +1 -1
  525. package/actions/ens/getEnsAddress.ts +4 -4
  526. package/actions/ens/getEnsAvatar.ts +1 -1
  527. package/actions/ens/getEnsName.ts +3 -3
  528. package/actions/ens/getEnsResolver.ts +1 -1
  529. package/actions/ens/getEnsText.ts +3 -3
  530. package/actions/getContract.ts +3 -3
  531. package/actions/public/call.ts +16 -12
  532. package/actions/public/createContractEventFilter.ts +9 -6
  533. package/actions/public/createEventFilter.ts +21 -21
  534. package/actions/public/estimateFeesPerGas.ts +4 -4
  535. package/actions/public/estimateGas.ts +5 -5
  536. package/actions/public/estimateMaxPriorityFeePerGas.ts +11 -7
  537. package/actions/public/getBalance.ts +4 -4
  538. package/actions/public/getBlock.ts +10 -10
  539. package/actions/public/getBlockNumber.ts +1 -1
  540. package/actions/public/getBlockTransactionCount.ts +9 -9
  541. package/actions/public/getBytecode.ts +4 -4
  542. package/actions/public/getContractEvents.ts +4 -4
  543. package/actions/public/getFeeHistory.ts +4 -4
  544. package/actions/public/getLogs.ts +17 -17
  545. package/actions/public/getProof.ts +4 -4
  546. package/actions/public/getStorageAt.ts +4 -4
  547. package/actions/public/getTransaction.ts +13 -13
  548. package/actions/public/getTransactionConfirmations.ts +2 -2
  549. package/actions/public/getTransactionCount.ts +4 -4
  550. package/actions/public/simulateContract.ts +3 -3
  551. package/actions/public/waitForTransactionReceipt.ts +6 -6
  552. package/actions/public/watchBlockNumber.ts +2 -2
  553. package/actions/public/watchBlocks.ts +1 -1
  554. package/actions/public/watchContractEvent.ts +75 -59
  555. package/actions/public/watchEvent.ts +14 -14
  556. package/actions/public/watchPendingTransactions.ts +2 -2
  557. package/actions/test/mine.ts +1 -1
  558. package/actions/test/reset.ts +2 -2
  559. package/actions/wallet/prepareTransactionRequest.ts +5 -4
  560. package/actions/wallet/writeContract.ts +1 -1
  561. package/chains/celo/parsers.ts +3 -2
  562. package/chains/celo/serializers.ts +3 -3
  563. package/chains/celo/types.ts +37 -37
  564. package/chains/definitions/lukso.ts +6 -0
  565. package/chains/definitions/luksoTestnet.ts +31 -0
  566. package/chains/definitions/zkSyncInMemoryNode.ts +14 -0
  567. package/chains/definitions/zkSyncLocalNode.ts +14 -0
  568. package/chains/index.ts +8 -5
  569. package/chains/opStack/actions/buildDepositTransaction.ts +7 -7
  570. package/chains/opStack/actions/buildInitiateWithdrawal.ts +3 -3
  571. package/chains/opStack/actions/depositTransaction.ts +1 -1
  572. package/chains/opStack/actions/estimateDepositTransactionGas.ts +1 -1
  573. package/chains/opStack/actions/estimateFinalizeWithdrawalGas.ts +1 -1
  574. package/chains/opStack/actions/estimateInitiateWithdrawalGas.ts +1 -1
  575. package/chains/opStack/actions/estimateL1Fee.ts +1 -1
  576. package/chains/opStack/actions/estimateL1Gas.ts +1 -1
  577. package/chains/opStack/actions/estimateProveWithdrawalGas.ts +1 -1
  578. package/chains/opStack/actions/finalizeWithdrawal.ts +1 -1
  579. package/chains/opStack/actions/getL1BaseFee.ts +2 -2
  580. package/chains/opStack/actions/getTimeToNextL2Output.ts +2 -2
  581. package/chains/opStack/actions/getTimeToProve.ts +3 -1
  582. package/chains/opStack/actions/proveWithdrawal.ts +1 -1
  583. package/chains/opStack/actions/waitForNextL2Output.ts +4 -2
  584. package/chains/opStack/actions/waitToProve.ts +1 -1
  585. package/chains/opStack/decorators/publicL2.ts +3 -3
  586. package/chains/opStack/types/deposit.ts +6 -6
  587. package/chains/opStack/types/transaction.ts +4 -4
  588. package/chains/opStack/types/withdrawal.ts +2 -2
  589. package/chains/zksync/formatters.ts +1 -1
  590. package/chains/zksync/serializers.ts +1 -1
  591. package/chains/zksync/types/eip712.ts +4 -4
  592. package/chains/zksync/types/transaction.ts +21 -21
  593. package/chains/zksync/utils/assertEip712Request.ts +2 -1
  594. package/chains/zksync/utils/assertEip712Transaction.ts +2 -1
  595. package/chains/zksync/utils/isEip712Transaction.ts +2 -1
  596. package/clients/createClient.ts +3 -3
  597. package/clients/decorators/public.ts +23 -21
  598. package/clients/decorators/test.ts +1 -1
  599. package/clients/transports/createTransport.ts +9 -9
  600. package/clients/transports/custom.ts +4 -4
  601. package/clients/transports/fallback.ts +28 -26
  602. package/clients/transports/http.ts +13 -13
  603. package/clients/transports/ipc.ts +6 -6
  604. package/clients/transports/webSocket.ts +6 -6
  605. package/errors/abi.ts +12 -3
  606. package/errors/account.ts +1 -1
  607. package/errors/base.ts +13 -10
  608. package/errors/block.ts +2 -2
  609. package/errors/chain.ts +3 -3
  610. package/errors/contract.ts +26 -15
  611. package/errors/encoding.ts +3 -3
  612. package/errors/estimateGas.ts +3 -3
  613. package/errors/node.ts +35 -14
  614. package/errors/request.ts +7 -7
  615. package/errors/rpc.ts +5 -5
  616. package/errors/transaction.ts +7 -7
  617. package/errors/version.ts +1 -1
  618. package/index.ts +2 -0
  619. package/package.json +1 -1
  620. package/types/block.ts +3 -3
  621. package/types/chain.ts +1 -1
  622. package/types/contract.ts +7 -5
  623. package/types/eip1193.ts +42 -38
  624. package/types/ens.ts +1 -1
  625. package/types/fee.ts +6 -6
  626. package/types/filter.ts +9 -9
  627. package/types/kzg.ts +1 -1
  628. package/types/misc.ts +2 -2
  629. package/types/rpc.ts +16 -16
  630. package/types/stateOverride.ts +5 -5
  631. package/types/transaction.ts +63 -56
  632. package/types/typedData.ts +1 -1
  633. package/types/utils.ts +9 -3
  634. package/types/window.ts +1 -1
  635. package/utils/abi/decodeEventLog.ts +1 -1
  636. package/utils/abi/decodeFunctionResult.ts +2 -2
  637. package/utils/abi/encodeErrorResult.ts +2 -2
  638. package/utils/abi/encodeEventTopics.ts +2 -2
  639. package/utils/abi/encodeFunctionData.ts +2 -2
  640. package/utils/abi/encodeFunctionResult.ts +2 -2
  641. package/utils/abi/formatAbiItem.ts +2 -2
  642. package/utils/abi/formatAbiItemWithArgs.ts +2 -2
  643. package/utils/address/getAddress.ts +4 -1
  644. package/utils/address/getContractAddress.ts +1 -1
  645. package/utils/address/isAddress.ts +1 -1
  646. package/utils/blob/commitmentToVersionedHash.ts +1 -1
  647. package/utils/blob/commitmentsToVersionedHashes.ts +1 -1
  648. package/utils/blob/sidecarsToVersionedHashes.ts +1 -1
  649. package/utils/chain/assertCurrentChain.ts +1 -1
  650. package/utils/chain/getChainContractAddress.ts +1 -1
  651. package/utils/cursor.ts +1 -1
  652. package/utils/data/isHex.ts +1 -1
  653. package/utils/data/pad.ts +2 -2
  654. package/utils/data/slice.ts +15 -11
  655. package/utils/data/trim.ts +1 -1
  656. package/utils/encoding/fromBytes.ts +5 -5
  657. package/utils/encoding/fromHex.ts +5 -5
  658. package/utils/encoding/toBytes.ts +8 -5
  659. package/utils/encoding/toHex.ts +7 -7
  660. package/utils/ens/avatar/parseAvatarRecord.ts +2 -2
  661. package/utils/errors/getCallError.ts +2 -2
  662. package/utils/errors/getContractError.ts +3 -3
  663. package/utils/errors/getEstimateGasError.ts +3 -3
  664. package/utils/errors/getNodeError.ts +4 -1
  665. package/utils/errors/getTransactionError.ts +2 -2
  666. package/utils/formatters/block.ts +2 -2
  667. package/utils/formatters/extract.ts +1 -1
  668. package/utils/formatters/formatter.ts +1 -1
  669. package/utils/formatters/log.ts +6 -2
  670. package/utils/formatters/proof.ts +2 -1
  671. package/utils/formatters/transaction.ts +2 -2
  672. package/utils/formatters/transactionReceipt.ts +2 -1
  673. package/utils/formatters/transactionRequest.ts +4 -1
  674. package/utils/hash/keccak256.ts +1 -1
  675. package/utils/hash/ripemd160.ts +1 -1
  676. package/utils/hash/sha256.ts +1 -1
  677. package/utils/poll.ts +2 -2
  678. package/utils/promise/createBatchScheduler.ts +6 -6
  679. package/utils/promise/withCache.ts +1 -1
  680. package/utils/promise/withRetry.ts +14 -9
  681. package/utils/promise/withTimeout.ts +6 -4
  682. package/utils/rpc/http.ts +7 -7
  683. package/utils/rpc/socket.ts +2 -2
  684. package/utils/signature/hashMessage.ts +1 -1
  685. package/utils/transaction/assertRequest.ts +4 -1
  686. package/utils/transaction/getTransactionType.ts +10 -4
  687. package/utils/transaction/parseTransaction.ts +1 -1
  688. package/utils/transaction/serializeAccessList.ts +1 -1
  689. package/utils/transaction/serializeTransaction.ts +6 -6
  690. package/utils/typedData.ts +1 -1
@@ -27,9 +27,9 @@ export type SliceErrorType =
27
27
  */
28
28
  export function slice<TValue extends ByteArray | Hex>(
29
29
  value: TValue,
30
- start?: number,
31
- end?: number,
32
- { strict }: { strict?: boolean } = {},
30
+ start?: number | undefined,
31
+ end?: number | undefined,
32
+ { strict }: { strict?: boolean | undefined } = {},
33
33
  ): SliceReturnType<TValue> {
34
34
  if (isHex(value, { strict: false }))
35
35
  return sliceHex(value as Hex, start, end, {
@@ -45,7 +45,7 @@ export type AssertStartOffsetErrorType =
45
45
  | SizeErrorType
46
46
  | ErrorType
47
47
 
48
- function assertStartOffset(value: Hex | ByteArray, start?: number) {
48
+ function assertStartOffset(value: Hex | ByteArray, start?: number | undefined) {
49
49
  if (typeof start === 'number' && start > 0 && start > size(value) - 1)
50
50
  throw new SliceOffsetOutOfBoundsError({
51
51
  offset: start,
@@ -59,7 +59,11 @@ export type AssertEndOffsetErrorType =
59
59
  | SizeErrorType
60
60
  | ErrorType
61
61
 
62
- function assertEndOffset(value: Hex | ByteArray, start?: number, end?: number) {
62
+ function assertEndOffset(
63
+ value: Hex | ByteArray,
64
+ start?: number | undefined,
65
+ end?: number | undefined,
66
+ ) {
63
67
  if (
64
68
  typeof start === 'number' &&
65
69
  typeof end === 'number' &&
@@ -87,9 +91,9 @@ export type SliceBytesErrorType =
87
91
  */
88
92
  export function sliceBytes(
89
93
  value_: ByteArray,
90
- start?: number,
91
- end?: number,
92
- { strict }: { strict?: boolean } = {},
94
+ start?: number | undefined,
95
+ end?: number | undefined,
96
+ { strict }: { strict?: boolean | undefined } = {},
93
97
  ): ByteArray {
94
98
  assertStartOffset(value_, start)
95
99
  const value = value_.slice(start, end)
@@ -111,9 +115,9 @@ export type SliceHexErrorType =
111
115
  */
112
116
  export function sliceHex(
113
117
  value_: Hex,
114
- start?: number,
115
- end?: number,
116
- { strict }: { strict?: boolean } = {},
118
+ start?: number | undefined,
119
+ end?: number | undefined,
120
+ { strict }: { strict?: boolean | undefined } = {},
117
121
  ): Hex {
118
122
  assertStartOffset(value_, start)
119
123
  const value = `0x${value_
@@ -2,7 +2,7 @@ import type { ErrorType } from '../../errors/utils.js'
2
2
  import type { ByteArray, Hex } from '../../types/misc.js'
3
3
 
4
4
  type TrimOptions = {
5
- dir?: 'left' | 'right'
5
+ dir?: 'left' | 'right' | undefined
6
6
  }
7
7
  export type TrimReturnType<TValue extends ByteArray | Hex> = TValue extends Hex
8
8
  ? Hex
@@ -19,7 +19,7 @@ export type FromBytesParameters<
19
19
  | TTo
20
20
  | {
21
21
  /** Size of the bytes. */
22
- size?: number
22
+ size?: number | undefined
23
23
  /** Type to convert to. */
24
24
  to: TTo
25
25
  }
@@ -89,9 +89,9 @@ export function fromBytes<
89
89
 
90
90
  export type BytesToBigIntOpts = {
91
91
  /** Whether or not the number of a signed representation. */
92
- signed?: boolean
92
+ signed?: boolean | undefined
93
93
  /** Size of the bytes. */
94
- size?: number
94
+ size?: number | undefined
95
95
  }
96
96
 
97
97
  export type BytesToBigIntErrorType =
@@ -124,7 +124,7 @@ export function bytesToBigInt(
124
124
 
125
125
  export type BytesToBoolOpts = {
126
126
  /** Size of the bytes. */
127
- size?: number
127
+ size?: number | undefined
128
128
  }
129
129
 
130
130
  export type BytesToBoolErrorType =
@@ -192,7 +192,7 @@ export function bytesToNumber(
192
192
 
193
193
  export type BytesToStringOpts = {
194
194
  /** Size of the bytes. */
195
- size?: number
195
+ size?: number | undefined
196
196
  }
197
197
 
198
198
  export type BytesToStringErrorType =
@@ -33,7 +33,7 @@ export type FromHexParameters<
33
33
  | TTo
34
34
  | {
35
35
  /** Size (in bytes) of the hex value. */
36
- size?: number
36
+ size?: number | undefined
37
37
  /** Type to convert to. */
38
38
  to: TTo
39
39
  }
@@ -101,9 +101,9 @@ export function fromHex<
101
101
 
102
102
  export type HexToBigIntOpts = {
103
103
  /** Whether or not the number of a signed representation. */
104
- signed?: boolean
104
+ signed?: boolean | undefined
105
105
  /** Size (in bytes) of the hex value. */
106
- size?: number
106
+ size?: number | undefined
107
107
  }
108
108
 
109
109
  export type HexToBigIntErrorType = AssertSizeErrorType | ErrorType
@@ -144,7 +144,7 @@ export function hexToBigInt(hex: Hex, opts: HexToBigIntOpts = {}): bigint {
144
144
 
145
145
  export type HexToBoolOpts = {
146
146
  /** Size (in bytes) of the hex value. */
147
- size?: number
147
+ size?: number | undefined
148
148
  }
149
149
 
150
150
  export type HexToBoolErrorType =
@@ -212,7 +212,7 @@ export function hexToNumber(hex: Hex, opts: HexToNumberOpts = {}): number {
212
212
 
213
213
  export type HexToStringOpts = {
214
214
  /** Size (in bytes) of the hex value. */
215
- size?: number
215
+ size?: number | undefined
216
216
  }
217
217
 
218
218
  export type HexToStringErrorType =
@@ -15,7 +15,7 @@ const encoder = /*#__PURE__*/ new TextEncoder()
15
15
 
16
16
  export type ToBytesParameters = {
17
17
  /** Size of the output bytes. */
18
- size?: number
18
+ size?: number | undefined
19
19
  }
20
20
 
21
21
  export type ToBytesErrorType =
@@ -64,7 +64,7 @@ export function toBytes(
64
64
 
65
65
  export type BoolToBytesOpts = {
66
66
  /** Size of the output bytes. */
67
- size?: number
67
+ size?: number | undefined
68
68
  }
69
69
 
70
70
  export type BoolToBytesErrorType =
@@ -123,7 +123,7 @@ function charCodeToBase16(char: number) {
123
123
 
124
124
  export type HexToBytesOpts = {
125
125
  /** Size of the output bytes. */
126
- size?: number
126
+ size?: number | undefined
127
127
  }
128
128
 
129
129
  export type HexToBytesErrorType = AssertSizeErrorType | PadErrorType | ErrorType
@@ -198,14 +198,17 @@ export type NumberToBytesErrorType =
198
198
  * const data = numberToBytes(420, { size: 4 })
199
199
  * // Uint8Array([0, 0, 1, 164])
200
200
  */
201
- export function numberToBytes(value: bigint | number, opts?: NumberToHexOpts) {
201
+ export function numberToBytes(
202
+ value: bigint | number,
203
+ opts?: NumberToHexOpts | undefined,
204
+ ) {
202
205
  const hex = numberToHex(value, opts)
203
206
  return hexToBytes(hex)
204
207
  }
205
208
 
206
209
  export type StringToBytesOpts = {
207
210
  /** Size of the output bytes. */
208
- size?: number
211
+ size?: number | undefined
209
212
  }
210
213
 
211
214
  export type StringToBytesErrorType =
@@ -14,7 +14,7 @@ const hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) =>
14
14
 
15
15
  export type ToHexParameters = {
16
16
  /** The size (in bytes) of the output hex value. */
17
- size?: number
17
+ size?: number | undefined
18
18
  }
19
19
 
20
20
  export type ToHexErrorType =
@@ -64,7 +64,7 @@ export function toHex(
64
64
 
65
65
  export type BoolToHexOpts = {
66
66
  /** The size (in bytes) of the output hex value. */
67
- size?: number
67
+ size?: number | undefined
68
68
  }
69
69
 
70
70
  export type BoolToHexErrorType = AssertSizeErrorType | PadErrorType | ErrorType
@@ -104,7 +104,7 @@ export function boolToHex(value: boolean, opts: BoolToHexOpts = {}): Hex {
104
104
 
105
105
  export type BytesToHexOpts = {
106
106
  /** The size (in bytes) of the output hex value. */
107
- size?: number
107
+ size?: number | undefined
108
108
  }
109
109
 
110
110
  export type BytesToHexErrorType = AssertSizeErrorType | PadErrorType | ErrorType
@@ -145,14 +145,14 @@ export function bytesToHex(value: ByteArray, opts: BytesToHexOpts = {}): Hex {
145
145
  export type NumberToHexOpts =
146
146
  | {
147
147
  /** Whether or not the number of a signed representation. */
148
- signed?: boolean
148
+ signed?: boolean | undefined
149
149
  /** The size (in bytes) of the output hex value. */
150
150
  size: number
151
151
  }
152
152
  | {
153
- signed?: never
153
+ signed?: never | undefined
154
154
  /** The size (in bytes) of the output hex value. */
155
- size?: number
155
+ size?: number | undefined
156
156
  }
157
157
 
158
158
  export type NumberToHexErrorType =
@@ -218,7 +218,7 @@ export function numberToHex(
218
218
 
219
219
  export type StringToHexOpts = {
220
220
  /** The size (in bytes) of the output hex value. */
221
- size?: number
221
+ size?: number | undefined
222
222
  }
223
223
 
224
224
  export type StringToHexErrorType = BytesToHexErrorType | ErrorType
@@ -30,7 +30,7 @@ export async function parseAvatarRecord<TChain extends Chain | undefined>(
30
30
  gatewayUrls,
31
31
  record,
32
32
  }: {
33
- gatewayUrls?: AssetGatewayUrls
33
+ gatewayUrls?: AssetGatewayUrls | undefined
34
34
  record: string
35
35
  },
36
36
  ): Promise<string> {
@@ -54,7 +54,7 @@ async function parseNftAvatarUri<TChain extends Chain | undefined>(
54
54
  gatewayUrls,
55
55
  record,
56
56
  }: {
57
- gatewayUrls?: AssetGatewayUrls
57
+ gatewayUrls?: AssetGatewayUrls | undefined
58
58
  record: string
59
59
  },
60
60
  ): Promise<string> {
@@ -27,8 +27,8 @@ export function getCallError<err extends ErrorType<string>>(
27
27
  docsPath,
28
28
  ...args
29
29
  }: CallParameters & {
30
- chain?: Chain
31
- docsPath?: string
30
+ chain?: Chain | undefined
31
+ docsPath?: string | undefined
32
32
  },
33
33
  ): GetCallErrorReturnType<err> {
34
34
  const cause = (() => {
@@ -38,10 +38,10 @@ export function getContractError<err extends ErrorType<string>>(
38
38
  }: {
39
39
  abi: Abi
40
40
  args: any
41
- address?: Address
42
- docsPath?: string
41
+ address?: Address | undefined
42
+ docsPath?: string | undefined
43
43
  functionName: string
44
- sender?: Address
44
+ sender?: Address | undefined
45
45
  },
46
46
  ): GetContractErrorReturnType {
47
47
  const { code, data, message, shortMessage } = (
@@ -26,9 +26,9 @@ export function getEstimateGasError<err extends ErrorType<string>>(
26
26
  docsPath,
27
27
  ...args
28
28
  }: Omit<EstimateGasParameters, 'account'> & {
29
- account?: Account
30
- chain?: Chain
31
- docsPath?: string
29
+ account?: Account | undefined
30
+ chain?: Chain | undefined
31
+ docsPath?: string | undefined
32
32
  },
33
33
  ): GetEstimateGasErrorReturnType<err> {
34
34
  const cause = (() => {
@@ -31,6 +31,7 @@ import {
31
31
  InvalidInputRpcError,
32
32
  TransactionRejectedRpcError,
33
33
  } from '../../errors/rpc.js'
34
+ import type { ExactPartial } from '../../types/utils.js'
34
35
 
35
36
  export function containsNodeError(err: BaseError) {
36
37
  return (
@@ -40,7 +41,9 @@ export function containsNodeError(err: BaseError) {
40
41
  )
41
42
  }
42
43
 
43
- export type GetNodeErrorParameters = Partial<SendTransactionParameters<any>>
44
+ export type GetNodeErrorParameters = ExactPartial<
45
+ SendTransactionParameters<any>
46
+ >
44
47
 
45
48
  export type GetNodeErrorReturnType =
46
49
  | ExecutionRevertedErrorType
@@ -20,8 +20,8 @@ export type GetTransactionErrorParameters = Omit<
20
20
  'account' | 'chain'
21
21
  > & {
22
22
  account: Account
23
- chain?: Chain
24
- docsPath?: string
23
+ chain?: Chain | undefined
24
+ docsPath?: string | undefined
25
25
  }
26
26
 
27
27
  export type GetTransactionErrorReturnType<cause = ErrorType> = Omit<
@@ -7,7 +7,7 @@ import type {
7
7
  } from '../../types/chain.js'
8
8
  import type { Hash } from '../../types/misc.js'
9
9
  import type { RpcBlock } from '../../types/rpc.js'
10
- import type { Prettify } from '../../types/utils.js'
10
+ import type { ExactPartial, Prettify } from '../../types/utils.js'
11
11
 
12
12
  import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
13
13
  import { type FormattedTransaction, formatTransaction } from './transaction.js'
@@ -40,7 +40,7 @@ export type FormattedBlock<
40
40
 
41
41
  export type FormatBlockErrorType = ErrorType
42
42
 
43
- export function formatBlock(block: Partial<RpcBlock>) {
43
+ export function formatBlock(block: ExactPartial<RpcBlock>) {
44
44
  const transactions = block.transactions?.map((transaction) => {
45
45
  if (typeof transaction === 'string') return transaction
46
46
  return formatTransaction(transaction)
@@ -8,7 +8,7 @@ export type ExtractErrorType = ErrorType
8
8
  */
9
9
  export function extract(
10
10
  value_: Record<string, unknown>,
11
- { format }: { format?: ChainFormatter['format'] },
11
+ { format }: { format?: ChainFormatter['format'] | undefined },
12
12
  ) {
13
13
  if (!format) return {}
14
14
 
@@ -15,7 +15,7 @@ export function defineFormatter<TType extends string, TParameters, TReturnType>(
15
15
  exclude,
16
16
  format: overrides,
17
17
  }: {
18
- exclude?: TExclude
18
+ exclude?: TExclude | undefined
19
19
  format: (_: TOverrideParameters) => TOverrideReturnType
20
20
  }) => {
21
21
  return {
@@ -1,12 +1,16 @@
1
1
  import type { ErrorType } from '../../errors/utils.js'
2
2
  import type { Log } from '../../types/log.js'
3
3
  import type { RpcLog } from '../../types/rpc.js'
4
+ import type { ExactPartial } from '../../types/utils.js'
4
5
 
5
6
  export type FormatLogErrorType = ErrorType
6
7
 
7
8
  export function formatLog(
8
- log: Partial<RpcLog>,
9
- { args, eventName }: { args?: unknown; eventName?: string } = {},
9
+ log: ExactPartial<RpcLog>,
10
+ {
11
+ args,
12
+ eventName,
13
+ }: { args?: unknown | undefined; eventName?: string | undefined } = {},
10
14
  ) {
11
15
  return {
12
16
  ...log,
@@ -1,6 +1,7 @@
1
1
  import type { ErrorType } from '../../errors/utils.js'
2
2
  import type { Proof } from '../../types/proof.js'
3
3
  import type { RpcProof } from '../../types/rpc.js'
4
+ import type { ExactPartial } from '../../types/utils.js'
4
5
  import { hexToNumber } from '../index.js'
5
6
 
6
7
  export type FormatProofErrorType = ErrorType
@@ -12,7 +13,7 @@ function formatStorageProof(storageProof: RpcProof['storageProof']) {
12
13
  }))
13
14
  }
14
15
 
15
- export function formatProof(proof: Partial<RpcProof>) {
16
+ export function formatProof(proof: ExactPartial<RpcProof>) {
16
17
  return {
17
18
  ...proof,
18
19
  balance: proof.balance ? BigInt(proof.balance) : undefined,
@@ -8,7 +8,7 @@ import type {
8
8
  import type { Hex } from '../../types/misc.js'
9
9
  import type { RpcTransaction } from '../../types/rpc.js'
10
10
  import type { Transaction, TransactionType } from '../../types/transaction.js'
11
- import type { UnionLooseOmit } from '../../types/utils.js'
11
+ import type { ExactPartial, UnionLooseOmit } from '../../types/utils.js'
12
12
  import { hexToNumber } from '../encoding/fromHex.js'
13
13
  import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
14
14
 
@@ -43,7 +43,7 @@ export const transactionType = {
43
43
 
44
44
  export type FormatTransactionErrorType = ErrorType
45
45
 
46
- export function formatTransaction(transaction: Partial<RpcTransaction>) {
46
+ export function formatTransaction(transaction: ExactPartial<RpcTransaction>) {
47
47
  const transaction_ = {
48
48
  ...transaction,
49
49
  blockHash: transaction.blockHash ? transaction.blockHash : null,
@@ -5,6 +5,7 @@ import type {
5
5
  } from '../../types/chain.js'
6
6
  import type { RpcTransactionReceipt } from '../../types/rpc.js'
7
7
  import type { TransactionReceipt } from '../../types/transaction.js'
8
+ import type { ExactPartial } from '../../types/utils.js'
8
9
  import { hexToNumber } from '../encoding/fromHex.js'
9
10
 
10
11
  import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
@@ -27,7 +28,7 @@ const statuses = {
27
28
  export type FormatTransactionReceiptErrorType = ErrorType
28
29
 
29
30
  export function formatTransactionReceipt(
30
- transactionReceipt: Partial<RpcTransactionReceipt>,
31
+ transactionReceipt: ExactPartial<RpcTransactionReceipt>,
31
32
  ) {
32
33
  const receipt = {
33
34
  ...transactionReceipt,
@@ -6,6 +6,7 @@ import type {
6
6
  import type { ByteArray } from '../../types/misc.js'
7
7
  import type { RpcTransactionRequest } from '../../types/rpc.js'
8
8
  import type { TransactionRequest } from '../../types/transaction.js'
9
+ import type { ExactPartial } from '../../types/utils.js'
9
10
  import { bytesToHex, numberToHex } from '../encoding/toHex.js'
10
11
  import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
11
12
 
@@ -26,7 +27,9 @@ export const rpcTransactionType = {
26
27
 
27
28
  export type FormatTransactionRequestErrorType = ErrorType
28
29
 
29
- export function formatTransactionRequest(request: Partial<TransactionRequest>) {
30
+ export function formatTransactionRequest(
31
+ request: ExactPartial<TransactionRequest>,
32
+ ) {
30
33
  const rpcRequest = { ...request } as RpcTransactionRequest
31
34
 
32
35
  if (
@@ -20,7 +20,7 @@ export type Keccak256ErrorType =
20
20
 
21
21
  export function keccak256<TTo extends To = 'hex'>(
22
22
  value: Hex | ByteArray,
23
- to_?: TTo,
23
+ to_?: TTo | undefined,
24
24
  ): Keccak256Hash<TTo> {
25
25
  const to = to_ || 'hex'
26
26
  const bytes = keccak_256(
@@ -20,7 +20,7 @@ export type Ripemd160ErrorType =
20
20
 
21
21
  export function ripemd160<TTo extends To = 'hex'>(
22
22
  value: Hex | ByteArray,
23
- to_?: TTo,
23
+ to_?: TTo | undefined,
24
24
  ): Ripemd160Hash<TTo> {
25
25
  const to = to_ || 'hex'
26
26
  const bytes = noble_ripemd160(
@@ -20,7 +20,7 @@ export type Sha256ErrorType =
20
20
 
21
21
  export function sha256<TTo extends To = 'hex'>(
22
22
  value: Hex | ByteArray,
23
- to_?: TTo,
23
+ to_?: TTo | undefined,
24
24
  ): Sha256Hash<TTo> {
25
25
  const to = to_ || 'hex'
26
26
  const bytes = noble_sha256(
package/utils/poll.ts CHANGED
@@ -3,9 +3,9 @@ import { wait } from './wait.js'
3
3
 
4
4
  type PollOptions<TData> = {
5
5
  // Whether or not to emit when the polling starts.
6
- emitOnBegin?: boolean
6
+ emitOnBegin?: boolean | undefined
7
7
  // The initial wait time (in ms) before polling.
8
- initialWaitTime?: (data: TData | void) => Promise<number>
8
+ initialWaitTime?: ((data: TData | void) => Promise<number>) | undefined
9
9
  // The interval (in ms).
10
10
  interval: number
11
11
  }
@@ -6,8 +6,8 @@ type Resolved<TReturnType extends readonly unknown[] = any> = [
6
6
  ]
7
7
 
8
8
  type PendingPromise<TReturnType extends readonly unknown[] = any> = {
9
- resolve?: (data: Resolved<TReturnType>) => void
10
- reject?: (reason?: unknown) => void
9
+ resolve?: ((data: Resolved<TReturnType>) => void) | undefined
10
+ reject?: ((reason?: unknown) => void) | undefined
11
11
  }
12
12
 
13
13
  type SchedulerItem = { args: unknown; pendingPromise: PendingPromise }
@@ -23,9 +23,9 @@ export type CreateBatchSchedulerArguments<
23
23
  > = {
24
24
  fn: (args: TParameters[]) => Promise<TReturnType>
25
25
  id: number | string
26
- shouldSplitBatch?: (args: TParameters[]) => boolean
27
- wait?: number
28
- sort?: BatchResultsCompareFn<TReturnType[number]>
26
+ shouldSplitBatch?: ((args: TParameters[]) => boolean) | undefined
27
+ wait?: number | undefined
28
+ sort?: BatchResultsCompareFn<TReturnType[number]> | undefined
29
29
  }
30
30
 
31
31
  export type CreateBatchSchedulerReturnType<
@@ -34,7 +34,7 @@ export type CreateBatchSchedulerReturnType<
34
34
  > = {
35
35
  flush: () => void
36
36
  schedule: TParameters extends undefined
37
- ? (args?: TParameters) => Promise<Resolved<TReturnType>>
37
+ ? (args?: TParameters | undefined) => Promise<Resolved<TReturnType>>
38
38
  : (args: TParameters) => Promise<Resolved<TReturnType>>
39
39
  }
40
40
 
@@ -32,7 +32,7 @@ export type WithCacheParameters = {
32
32
  /** The key to cache the data against. */
33
33
  cacheKey: string
34
34
  /** The time that cached data will remain in memory. Default: Infinity (no expiry) */
35
- cacheTime?: number
35
+ cacheTime?: number | undefined
36
36
  }
37
37
 
38
38
  /**
@@ -3,17 +3,22 @@ import { wait } from '../wait.js'
3
3
 
4
4
  export type WithRetryParameters = {
5
5
  // The delay (in ms) between retries.
6
- delay?: ((config: { count: number; error: Error }) => number) | number
6
+ delay?:
7
+ | ((config: { count: number; error: Error }) => number)
8
+ | number
9
+ | undefined
7
10
  // The max number of times to retry.
8
- retryCount?: number
11
+ retryCount?: number | undefined
9
12
  // Whether or not to retry when an error is thrown.
10
- shouldRetry?: ({
11
- count,
12
- error,
13
- }: {
14
- count: number
15
- error: Error
16
- }) => Promise<boolean> | boolean
13
+ shouldRetry?:
14
+ | (({
15
+ count,
16
+ error,
17
+ }: {
18
+ count: number
19
+ error: Error
20
+ }) => Promise<boolean> | boolean)
21
+ | undefined
17
22
  }
18
23
 
19
24
  export type WithRetryErrorType = ErrorType
@@ -3,18 +3,20 @@ import type { ErrorType } from '../../errors/utils.js'
3
3
  export type WithTimeoutErrorType = ErrorType
4
4
 
5
5
  export function withTimeout<TData>(
6
- fn: ({ signal }: { signal?: AbortController['signal'] }) => Promise<TData>,
6
+ fn: ({
7
+ signal,
8
+ }: { signal: AbortController['signal'] | null }) => Promise<TData>,
7
9
  {
8
10
  errorInstance = new Error('timed out'),
9
11
  timeout,
10
12
  signal,
11
13
  }: {
12
14
  // The error instance to throw when the timeout is reached.
13
- errorInstance?: Error
15
+ errorInstance?: Error | undefined
14
16
  // The timeout (in ms).
15
17
  timeout: number
16
18
  // Whether or not the timeout should use an abort signal.
17
- signal?: boolean
19
+ signal?: boolean | undefined
18
20
  },
19
21
  ): Promise<TData> {
20
22
  return new Promise((resolve, reject) => {
@@ -31,7 +33,7 @@ export function withTimeout<TData>(
31
33
  }
32
34
  }, timeout)
33
35
  }
34
- resolve(await fn({ signal: controller?.signal }))
36
+ resolve(await fn({ signal: controller?.signal || null }))
35
37
  } catch (err) {
36
38
  if ((err as Error).name === 'AbortError') reject(errorInstance)
37
39
  reject(err)
package/utils/rpc/http.ts CHANGED
@@ -15,11 +15,11 @@ import { idCache } from './id.js'
15
15
 
16
16
  export type HttpRpcClientOptions = {
17
17
  // Request configuration to pass to `fetch`.
18
- fetchOptions?: Omit<RequestInit, 'body'>
18
+ fetchOptions?: Omit<RequestInit, 'body'> | undefined
19
19
  // A callback to handle the response.
20
- onResponse?: (response: Response) => Promise<void> | void
20
+ onResponse?: ((response: Response) => Promise<void> | void) | undefined
21
21
  // The timeout (in ms) for the request.
22
- timeout?: number
22
+ timeout?: number | undefined
23
23
  }
24
24
 
25
25
  export type HttpRequestParameters<
@@ -28,11 +28,11 @@ export type HttpRequestParameters<
28
28
  // The RPC request body.
29
29
  body: TBody
30
30
  // Request configuration to pass to `fetch`.
31
- fetchOptions?: HttpRpcClientOptions['fetchOptions']
31
+ fetchOptions?: HttpRpcClientOptions['fetchOptions'] | undefined
32
32
  // A callback to handle the response.
33
- onResponse?: (response: Response) => Promise<void> | void
33
+ onResponse?: ((response: Response) => Promise<void> | void) | undefined
34
34
  // The timeout (in ms) for the request.
35
- timeout?: HttpRpcClientOptions['timeout']
35
+ timeout?: HttpRpcClientOptions['timeout'] | undefined
36
36
  }
37
37
 
38
38
  export type HttpRequestReturnType<
@@ -92,7 +92,7 @@ export function getHttpRpcClient(
92
92
  'Content-Type': 'application/json',
93
93
  },
94
94
  method: method || 'POST',
95
- signal: signal_ || (timeout > 0 ? signal : undefined),
95
+ signal: signal_ || (timeout > 0 ? signal : null),
96
96
  })
97
97
  return response
98
98
  },