viem 2.56.8 → 2.57.0

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 (359) hide show
  1. package/CHANGELOG.md +78 -0
  2. package/README.md +0 -1
  3. package/_cjs/actions/index.js +5 -3
  4. package/_cjs/actions/index.js.map +1 -1
  5. package/_cjs/actions/public/getStorageValues.js +17 -0
  6. package/_cjs/actions/public/getStorageValues.js.map +1 -0
  7. package/_cjs/actions/public/simulateBlocks.js +2 -0
  8. package/_cjs/actions/public/simulateBlocks.js.map +1 -1
  9. package/_cjs/actions/public/waitForTransactionReceipt.js +12 -1
  10. package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
  11. package/_cjs/chains/definitions/blockdag.js +23 -0
  12. package/_cjs/chains/definitions/blockdag.js.map +1 -0
  13. package/_cjs/chains/definitions/candyChain.js +29 -0
  14. package/_cjs/chains/definitions/candyChain.js.map +1 -0
  15. package/_cjs/chains/definitions/creditCoin3Devnet.js +6 -0
  16. package/_cjs/chains/definitions/creditCoin3Devnet.js.map +1 -1
  17. package/_cjs/chains/definitions/creditCoin3Mainnet.js +6 -0
  18. package/_cjs/chains/definitions/creditCoin3Mainnet.js.map +1 -1
  19. package/_cjs/chains/definitions/creditCoin3Testnet.js +6 -0
  20. package/_cjs/chains/definitions/creditCoin3Testnet.js.map +1 -1
  21. package/_cjs/chains/definitions/kortana.js +23 -0
  22. package/_cjs/chains/definitions/kortana.js.map +1 -0
  23. package/_cjs/chains/definitions/rabbitChainTestnet.js +24 -0
  24. package/_cjs/chains/definitions/rabbitChainTestnet.js.map +1 -0
  25. package/_cjs/chains/index.js +22 -14
  26. package/_cjs/chains/index.js.map +1 -1
  27. package/_cjs/clients/createClientResolver.js +45 -0
  28. package/_cjs/clients/createClientResolver.js.map +1 -0
  29. package/_cjs/clients/decorators/public.js +2 -0
  30. package/_cjs/clients/decorators/public.js.map +1 -1
  31. package/_cjs/errors/version.js +1 -1
  32. package/_cjs/index.js +13 -9
  33. package/_cjs/index.js.map +1 -1
  34. package/_cjs/op-stack/actions/getGame.js +1 -1
  35. package/_cjs/op-stack/actions/getGame.js.map +1 -1
  36. package/_cjs/op-stack/actions/getGames.js +1 -1
  37. package/_cjs/op-stack/actions/getGames.js.map +1 -1
  38. package/_cjs/op-stack/actions/getTimeToNextGame.js +1 -1
  39. package/_cjs/op-stack/actions/getTimeToNextGame.js.map +1 -1
  40. package/_cjs/op-stack/actions/getTimeToNextL2Output.js +1 -1
  41. package/_cjs/op-stack/actions/getTimeToNextL2Output.js.map +1 -1
  42. package/_cjs/tempo/Abis.js +1211 -32
  43. package/_cjs/tempo/Abis.js.map +1 -1
  44. package/_cjs/tempo/Addresses.js +2 -1
  45. package/_cjs/tempo/Addresses.js.map +1 -1
  46. package/_cjs/tempo/Client.js +2 -10
  47. package/_cjs/tempo/Client.js.map +1 -1
  48. package/_cjs/tempo/Decorator.js +12 -0
  49. package/_cjs/tempo/Decorator.js.map +1 -1
  50. package/_cjs/tempo/ExecutionError.js +290 -0
  51. package/_cjs/tempo/ExecutionError.js.map +1 -0
  52. package/_cjs/tempo/Relay.js +88 -0
  53. package/_cjs/tempo/Relay.js.map +1 -0
  54. package/_cjs/tempo/Selectors.js +7 -4
  55. package/_cjs/tempo/Selectors.js.map +1 -1
  56. package/_cjs/tempo/Transaction.js.map +1 -1
  57. package/_cjs/tempo/Transport.js +21 -12
  58. package/_cjs/tempo/Transport.js.map +1 -1
  59. package/_cjs/tempo/actions/index.js +2 -1
  60. package/_cjs/tempo/actions/index.js.map +1 -1
  61. package/_cjs/tempo/actions/propAmm.js +349 -0
  62. package/_cjs/tempo/actions/propAmm.js.map +1 -0
  63. package/_cjs/tempo/chainConfig.js +3 -0
  64. package/_cjs/tempo/chainConfig.js.map +1 -1
  65. package/_cjs/tempo/index.js +3 -3
  66. package/_cjs/tempo/index.js.map +1 -1
  67. package/_cjs/tempo/internal/relay/cache.js +74 -0
  68. package/_cjs/tempo/internal/relay/cache.js.map +1 -0
  69. package/_cjs/tempo/internal/relay/deadline.js +35 -0
  70. package/_cjs/tempo/internal/relay/deadline.js.map +1 -0
  71. package/_cjs/tempo/internal/relay/error.js +102 -0
  72. package/_cjs/tempo/internal/relay/error.js.map +1 -0
  73. package/_cjs/tempo/internal/relay/feePayer.js +426 -0
  74. package/_cjs/tempo/internal/relay/feePayer.js.map +1 -0
  75. package/_cjs/tempo/internal/relay/feeToken.js +143 -0
  76. package/_cjs/tempo/internal/relay/feeToken.js.map +1 -0
  77. package/_cjs/tempo/{Multisig.js → internal/relay/multisig.js} +132 -122
  78. package/_cjs/tempo/internal/relay/multisig.js.map +1 -0
  79. package/_cjs/tempo/internal/relay/plugin.js +13 -0
  80. package/_cjs/tempo/internal/relay/plugin.js.map +1 -0
  81. package/_cjs/tempo/internal/relay/preflight.js +58 -0
  82. package/_cjs/tempo/internal/relay/preflight.js.map +1 -0
  83. package/_cjs/tempo/internal/relay/request.js +319 -0
  84. package/_cjs/tempo/internal/relay/request.js.map +1 -0
  85. package/_cjs/tempo/internal/relay/simulate.js +267 -0
  86. package/_cjs/tempo/internal/relay/simulate.js.map +1 -0
  87. package/_cjs/tempo/internal/relay/utils.js +174 -0
  88. package/_cjs/tempo/internal/relay/utils.js.map +1 -0
  89. package/_cjs/tempo/internal/relay/virtualAddress.js +78 -0
  90. package/_cjs/tempo/internal/relay/virtualAddress.js.map +1 -0
  91. package/_cjs/tempo/internal/relay.js +139 -0
  92. package/_cjs/tempo/internal/relay.js.map +1 -0
  93. package/_cjs/tempo/multisig/Config.js +0 -2
  94. package/_cjs/tempo/multisig/Config.js.map +1 -1
  95. package/_cjs/tempo/multisig/Operation.js +1 -2
  96. package/_cjs/tempo/multisig/Operation.js.map +1 -1
  97. package/_cjs/tokens/definitions/eurc.js +1 -0
  98. package/_cjs/tokens/definitions/eurc.js.map +1 -1
  99. package/_cjs/tokens/definitions/usdc.js +1 -0
  100. package/_cjs/tokens/definitions/usdc.js.map +1 -1
  101. package/_cjs/utils/siwe/parseSiweMessage.js +3 -3
  102. package/_cjs/utils/siwe/parseSiweMessage.js.map +1 -1
  103. package/_esm/actions/index.js +1 -0
  104. package/_esm/actions/index.js.map +1 -1
  105. package/_esm/actions/public/getStorageValues.js +39 -0
  106. package/_esm/actions/public/getStorageValues.js.map +1 -0
  107. package/_esm/actions/public/simulateBlocks.js +4 -0
  108. package/_esm/actions/public/simulateBlocks.js.map +1 -1
  109. package/_esm/actions/public/waitForTransactionReceipt.js +15 -1
  110. package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
  111. package/_esm/chains/definitions/blockdag.js +20 -0
  112. package/_esm/chains/definitions/blockdag.js.map +1 -0
  113. package/_esm/chains/definitions/candyChain.js +26 -0
  114. package/_esm/chains/definitions/candyChain.js.map +1 -0
  115. package/_esm/chains/definitions/creditCoin3Devnet.js +6 -0
  116. package/_esm/chains/definitions/creditCoin3Devnet.js.map +1 -1
  117. package/_esm/chains/definitions/creditCoin3Mainnet.js +6 -0
  118. package/_esm/chains/definitions/creditCoin3Mainnet.js.map +1 -1
  119. package/_esm/chains/definitions/creditCoin3Testnet.js +6 -0
  120. package/_esm/chains/definitions/creditCoin3Testnet.js.map +1 -1
  121. package/_esm/chains/definitions/kortana.js +20 -0
  122. package/_esm/chains/definitions/kortana.js.map +1 -0
  123. package/_esm/chains/definitions/rabbitChainTestnet.js +21 -0
  124. package/_esm/chains/definitions/rabbitChainTestnet.js.map +1 -0
  125. package/_esm/chains/index.js +4 -0
  126. package/_esm/chains/index.js.map +1 -1
  127. package/_esm/clients/createClientResolver.js +64 -0
  128. package/_esm/clients/createClientResolver.js.map +1 -0
  129. package/_esm/clients/decorators/public.js +2 -0
  130. package/_esm/clients/decorators/public.js.map +1 -1
  131. package/_esm/errors/version.js +1 -1
  132. package/_esm/index.js +2 -0
  133. package/_esm/index.js.map +1 -1
  134. package/_esm/op-stack/actions/getGame.js +1 -1
  135. package/_esm/op-stack/actions/getGame.js.map +1 -1
  136. package/_esm/op-stack/actions/getGames.js +1 -1
  137. package/_esm/op-stack/actions/getGames.js.map +1 -1
  138. package/_esm/op-stack/actions/getTimeToNextGame.js +2 -2
  139. package/_esm/op-stack/actions/getTimeToNextGame.js.map +1 -1
  140. package/_esm/op-stack/actions/getTimeToNextL2Output.js +2 -2
  141. package/_esm/op-stack/actions/getTimeToNextL2Output.js.map +1 -1
  142. package/_esm/tempo/Abis.js +1214 -34
  143. package/_esm/tempo/Abis.js.map +1 -1
  144. package/_esm/tempo/Addresses.js +2 -0
  145. package/_esm/tempo/Addresses.js.map +1 -1
  146. package/_esm/tempo/Client.js +8 -14
  147. package/_esm/tempo/Client.js.map +1 -1
  148. package/_esm/tempo/Decorator.js +12 -0
  149. package/_esm/tempo/Decorator.js.map +1 -1
  150. package/_esm/tempo/ExecutionError.js +306 -0
  151. package/_esm/tempo/ExecutionError.js.map +1 -0
  152. package/_esm/tempo/Relay.js +170 -0
  153. package/_esm/tempo/Relay.js.map +1 -0
  154. package/_esm/tempo/Selectors.js +6 -3
  155. package/_esm/tempo/Selectors.js.map +1 -1
  156. package/_esm/tempo/Transaction.js.map +1 -1
  157. package/_esm/tempo/Transport.js +21 -46
  158. package/_esm/tempo/Transport.js.map +1 -1
  159. package/_esm/tempo/actions/index.js +1 -0
  160. package/_esm/tempo/actions/index.js.map +1 -1
  161. package/_esm/tempo/actions/propAmm.js +539 -0
  162. package/_esm/tempo/actions/propAmm.js.map +1 -0
  163. package/_esm/tempo/chainConfig.js +4 -0
  164. package/_esm/tempo/chainConfig.js.map +1 -1
  165. package/_esm/tempo/index.js +8 -3
  166. package/_esm/tempo/index.js.map +1 -1
  167. package/_esm/tempo/internal/relay/cache.js +72 -0
  168. package/_esm/tempo/internal/relay/cache.js.map +1 -0
  169. package/_esm/tempo/internal/relay/deadline.js +34 -0
  170. package/_esm/tempo/internal/relay/deadline.js.map +1 -0
  171. package/_esm/tempo/internal/relay/error.js +101 -0
  172. package/_esm/tempo/internal/relay/error.js.map +1 -0
  173. package/_esm/tempo/internal/relay/feePayer.js +442 -0
  174. package/_esm/tempo/internal/relay/feePayer.js.map +1 -0
  175. package/_esm/tempo/internal/relay/feeToken.js +143 -0
  176. package/_esm/tempo/internal/relay/feeToken.js.map +1 -0
  177. package/_esm/tempo/{Multisig.js → internal/relay/multisig.js} +133 -129
  178. package/_esm/tempo/internal/relay/multisig.js.map +1 -0
  179. package/_esm/tempo/internal/relay/plugin.js +10 -0
  180. package/_esm/tempo/internal/relay/plugin.js.map +1 -0
  181. package/_esm/tempo/internal/relay/preflight.js +57 -0
  182. package/_esm/tempo/internal/relay/preflight.js.map +1 -0
  183. package/_esm/tempo/internal/relay/request.js +321 -0
  184. package/_esm/tempo/internal/relay/request.js.map +1 -0
  185. package/_esm/tempo/internal/relay/simulate.js +277 -0
  186. package/_esm/tempo/internal/relay/simulate.js.map +1 -0
  187. package/_esm/tempo/internal/relay/utils.js +174 -0
  188. package/_esm/tempo/internal/relay/utils.js.map +1 -0
  189. package/_esm/tempo/internal/relay/virtualAddress.js +73 -0
  190. package/_esm/tempo/internal/relay/virtualAddress.js.map +1 -0
  191. package/_esm/tempo/internal/relay.js +138 -0
  192. package/_esm/tempo/internal/relay.js.map +1 -0
  193. package/_esm/tempo/multisig/Config.js +2 -1
  194. package/_esm/tempo/multisig/Config.js.map +1 -1
  195. package/_esm/tempo/multisig/Operation.js +1 -1
  196. package/_esm/tempo/multisig/Operation.js.map +1 -1
  197. package/_esm/tokens/definitions/eurc.js +1 -0
  198. package/_esm/tokens/definitions/eurc.js.map +1 -1
  199. package/_esm/tokens/definitions/usdc.js +1 -0
  200. package/_esm/tokens/definitions/usdc.js.map +1 -1
  201. package/_esm/utils/siwe/parseSiweMessage.js +3 -3
  202. package/_esm/utils/siwe/parseSiweMessage.js.map +1 -1
  203. package/_types/actions/index.d.ts +1 -0
  204. package/_types/actions/index.d.ts.map +1 -1
  205. package/_types/actions/public/getStorageValues.d.ts +59 -0
  206. package/_types/actions/public/getStorageValues.d.ts.map +1 -0
  207. package/_types/actions/public/simulateBlocks.d.ts +8 -0
  208. package/_types/actions/public/simulateBlocks.d.ts.map +1 -1
  209. package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
  210. package/_types/chains/definitions/blockdag.d.ts +51 -0
  211. package/_types/chains/definitions/blockdag.d.ts.map +1 -0
  212. package/_types/chains/definitions/candyChain.d.ts +48 -0
  213. package/_types/chains/definitions/candyChain.d.ts.map +1 -0
  214. package/_types/chains/definitions/creditCoin3Devnet.d.ts +6 -9
  215. package/_types/chains/definitions/creditCoin3Devnet.d.ts.map +1 -1
  216. package/_types/chains/definitions/creditCoin3Mainnet.d.ts +6 -9
  217. package/_types/chains/definitions/creditCoin3Mainnet.d.ts.map +1 -1
  218. package/_types/chains/definitions/creditCoin3Testnet.d.ts +6 -9
  219. package/_types/chains/definitions/creditCoin3Testnet.d.ts.map +1 -1
  220. package/_types/chains/definitions/kortana.d.ts +51 -0
  221. package/_types/chains/definitions/kortana.d.ts.map +1 -0
  222. package/_types/chains/definitions/rabbitChainTestnet.d.ts +51 -0
  223. package/_types/chains/definitions/rabbitChainTestnet.d.ts.map +1 -0
  224. package/_types/chains/index.d.ts +4 -0
  225. package/_types/chains/index.d.ts.map +1 -1
  226. package/_types/clients/createClientResolver.d.ts +76 -0
  227. package/_types/clients/createClientResolver.d.ts.map +1 -0
  228. package/_types/clients/decorators/public.d.ts +11 -0
  229. package/_types/clients/decorators/public.d.ts.map +1 -1
  230. package/_types/errors/version.d.ts +1 -1
  231. package/_types/index.d.ts +3 -0
  232. package/_types/index.d.ts.map +1 -1
  233. package/_types/op-stack/actions/getGame.d.ts.map +1 -1
  234. package/_types/tempo/Abis.d.ts +14686 -9568
  235. package/_types/tempo/Abis.d.ts.map +1 -1
  236. package/_types/tempo/Addresses.d.ts +2 -0
  237. package/_types/tempo/Addresses.d.ts.map +1 -1
  238. package/_types/tempo/Capabilities.d.ts +7 -28
  239. package/_types/tempo/Capabilities.d.ts.map +1 -1
  240. package/_types/tempo/Client.d.ts +6 -15
  241. package/_types/tempo/Client.d.ts.map +1 -1
  242. package/_types/tempo/Decorator.d.ts +205 -1
  243. package/_types/tempo/Decorator.d.ts.map +1 -1
  244. package/_types/tempo/ExecutionError.d.ts +79 -0
  245. package/_types/tempo/ExecutionError.d.ts.map +1 -0
  246. package/_types/tempo/Relay.d.ts +302 -0
  247. package/_types/tempo/Relay.d.ts.map +1 -0
  248. package/_types/tempo/Selectors.d.ts +6 -3
  249. package/_types/tempo/Selectors.d.ts.map +1 -1
  250. package/_types/tempo/Transaction.d.ts +2 -1
  251. package/_types/tempo/Transaction.d.ts.map +1 -1
  252. package/_types/tempo/Transport.d.ts +15 -29
  253. package/_types/tempo/Transport.d.ts.map +1 -1
  254. package/_types/tempo/actions/earn.d.ts +621 -1
  255. package/_types/tempo/actions/earn.d.ts.map +1 -1
  256. package/_types/tempo/actions/index.d.ts +1 -0
  257. package/_types/tempo/actions/index.d.ts.map +1 -1
  258. package/_types/tempo/actions/propAmm.d.ts +2228 -0
  259. package/_types/tempo/actions/propAmm.d.ts.map +1 -0
  260. package/_types/tempo/chainConfig.d.ts.map +1 -1
  261. package/_types/tempo/index.d.ts +8 -3
  262. package/_types/tempo/index.d.ts.map +1 -1
  263. package/_types/tempo/internal/relay/cache.d.ts +9 -0
  264. package/_types/tempo/internal/relay/cache.d.ts.map +1 -0
  265. package/_types/tempo/internal/relay/deadline.d.ts +4 -0
  266. package/_types/tempo/internal/relay/deadline.d.ts.map +1 -0
  267. package/_types/tempo/internal/relay/error.d.ts +47 -0
  268. package/_types/tempo/internal/relay/error.d.ts.map +1 -0
  269. package/_types/tempo/internal/relay/feePayer.d.ts +70 -0
  270. package/_types/tempo/internal/relay/feePayer.d.ts.map +1 -0
  271. package/_types/tempo/internal/relay/feeToken.d.ts +38 -0
  272. package/_types/tempo/internal/relay/feeToken.d.ts.map +1 -0
  273. package/_types/tempo/internal/relay/multisig.d.ts +4 -0
  274. package/_types/tempo/internal/relay/multisig.d.ts.map +1 -0
  275. package/_types/tempo/internal/relay/plugin.d.ts +5 -0
  276. package/_types/tempo/internal/relay/plugin.d.ts.map +1 -0
  277. package/_types/tempo/internal/relay/preflight.d.ts +17 -0
  278. package/_types/tempo/internal/relay/preflight.d.ts.map +1 -0
  279. package/_types/tempo/internal/relay/request.d.ts +16 -0
  280. package/_types/tempo/internal/relay/request.d.ts.map +1 -0
  281. package/_types/tempo/internal/relay/simulate.d.ts +59 -0
  282. package/_types/tempo/internal/relay/simulate.d.ts.map +1 -0
  283. package/_types/tempo/internal/relay/utils.d.ts +294 -0
  284. package/_types/tempo/internal/relay/utils.d.ts.map +1 -0
  285. package/_types/tempo/internal/relay/virtualAddress.d.ts +9 -0
  286. package/_types/tempo/internal/relay/virtualAddress.d.ts.map +1 -0
  287. package/_types/tempo/internal/relay.d.ts +4 -0
  288. package/_types/tempo/internal/relay.d.ts.map +1 -0
  289. package/_types/tempo/multisig/Config.d.ts +0 -13
  290. package/_types/tempo/multisig/Config.d.ts.map +1 -1
  291. package/_types/tempo/multisig/Operation.d.ts +0 -5
  292. package/_types/tempo/multisig/Operation.d.ts.map +1 -1
  293. package/_types/tokens/definitions/eurc.d.ts +1 -0
  294. package/_types/tokens/definitions/eurc.d.ts.map +1 -1
  295. package/_types/tokens/definitions/usdc.d.ts +1 -0
  296. package/_types/tokens/definitions/usdc.d.ts.map +1 -1
  297. package/_types/tokens/sets.d.ts +3 -0
  298. package/_types/tokens/sets.d.ts.map +1 -1
  299. package/_types/types/eip1193.d.ts +20 -0
  300. package/_types/types/eip1193.d.ts.map +1 -1
  301. package/_types/utils/siwe/parseSiweMessage.d.ts.map +1 -1
  302. package/actions/index.ts +6 -0
  303. package/actions/public/getStorageValues.ts +93 -0
  304. package/actions/public/simulateBlocks.ts +13 -0
  305. package/actions/public/waitForTransactionReceipt.ts +16 -2
  306. package/chains/definitions/blockdag.ts +20 -0
  307. package/chains/definitions/candyChain.ts +26 -0
  308. package/chains/definitions/creditCoin3Devnet.ts +6 -0
  309. package/chains/definitions/creditCoin3Mainnet.ts +6 -0
  310. package/chains/definitions/creditCoin3Testnet.ts +6 -0
  311. package/chains/definitions/kortana.ts +20 -0
  312. package/chains/definitions/rabbitChainTestnet.ts +21 -0
  313. package/chains/index.ts +4 -0
  314. package/clients/createClientResolver.ts +191 -0
  315. package/clients/decorators/public.ts +18 -0
  316. package/errors/version.ts +1 -1
  317. package/index.ts +11 -0
  318. package/op-stack/actions/getGame.ts +3 -1
  319. package/op-stack/actions/getGames.ts +1 -1
  320. package/op-stack/actions/getTimeToNextGame.ts +2 -2
  321. package/op-stack/actions/getTimeToNextL2Output.ts +2 -2
  322. package/package.json +1 -1
  323. package/tempo/Abis.ts +1218 -34
  324. package/tempo/Addresses.ts +2 -0
  325. package/tempo/Capabilities.ts +7 -29
  326. package/tempo/Client.ts +8 -38
  327. package/tempo/Decorator.ts +239 -3
  328. package/tempo/ExecutionError.ts +418 -0
  329. package/tempo/Relay.ts +428 -0
  330. package/tempo/Selectors.ts +10 -4
  331. package/tempo/Transaction.ts +2 -1
  332. package/tempo/Transport.ts +69 -60
  333. package/tempo/actions/index.ts +1 -0
  334. package/tempo/actions/propAmm.ts +998 -0
  335. package/tempo/chainConfig.ts +4 -0
  336. package/tempo/index.ts +7 -3
  337. package/tempo/internal/relay/cache.ts +82 -0
  338. package/tempo/internal/relay/deadline.ts +45 -0
  339. package/tempo/internal/relay/error.ts +128 -0
  340. package/tempo/internal/relay/feePayer.ts +692 -0
  341. package/tempo/internal/relay/feeToken.ts +190 -0
  342. package/tempo/{Multisig.ts → internal/relay/multisig.ts} +162 -193
  343. package/tempo/internal/relay/plugin.ts +13 -0
  344. package/tempo/internal/relay/preflight.ts +81 -0
  345. package/tempo/internal/relay/request.ts +391 -0
  346. package/tempo/internal/relay/simulate.ts +367 -0
  347. package/tempo/internal/relay/utils.ts +202 -0
  348. package/tempo/internal/relay/virtualAddress.ts +95 -0
  349. package/tempo/internal/relay.ts +158 -0
  350. package/tempo/multisig/Config.ts +3 -2
  351. package/tempo/multisig/Operation.ts +1 -1
  352. package/tokens/definitions/eurc.ts +1 -0
  353. package/tokens/definitions/usdc.ts +1 -0
  354. package/types/eip1193.ts +20 -0
  355. package/utils/siwe/parseSiweMessage.ts +21 -13
  356. package/_cjs/tempo/Multisig.js.map +0 -1
  357. package/_esm/tempo/Multisig.js.map +0 -1
  358. package/_types/tempo/Multisig.d.ts +0 -37
  359. package/_types/tempo/Multisig.d.ts.map +0 -1
@@ -0,0 +1,93 @@
1
+ import type { Address } from 'abitype'
2
+
3
+ import type { Client } from '../../clients/createClient.js'
4
+ import type { Transport } from '../../clients/transports/createTransport.js'
5
+ import type { ErrorType } from '../../errors/utils.js'
6
+ import type { BlockTag } from '../../types/block.js'
7
+ import type { Chain } from '../../types/chain.js'
8
+ import type { Hash, Hex } from '../../types/misc.js'
9
+ import {
10
+ type FormatBlockParameterErrorType,
11
+ formatBlockParameter,
12
+ } from '../../utils/block/formatBlockParameter.js'
13
+ import type { RequestErrorType } from '../../utils/buildRequest.js'
14
+
15
+ export type GetStorageValuesParameters = {
16
+ /** Mapping of contract addresses to storage slot keys. */
17
+ requests: Record<Address, readonly Hex[]>
18
+ } & (
19
+ | {
20
+ blockNumber?: undefined
21
+ blockTag?: BlockTag | undefined
22
+ blockHash?: undefined
23
+ requireCanonical?: undefined
24
+ }
25
+ | {
26
+ blockNumber?: bigint | undefined
27
+ blockTag?: undefined
28
+ blockHash?: undefined
29
+ requireCanonical?: undefined
30
+ }
31
+ | {
32
+ blockNumber?: undefined
33
+ blockTag?: undefined
34
+ /** The storage values at a block specified by block hash. */
35
+ blockHash: Hash
36
+ /** Whether or not to throw an error if the block is not in the canonical chain. Only allowed in conjunction with `blockHash`. */
37
+ requireCanonical?: boolean | undefined
38
+ }
39
+ )
40
+
41
+ export type GetStorageValuesReturnType = Record<Address, Hex[]>
42
+
43
+ export type GetStorageValuesErrorType =
44
+ | FormatBlockParameterErrorType
45
+ | RequestErrorType
46
+ | ErrorType
47
+
48
+ /**
49
+ * Returns values from multiple storage slots for multiple adddresses at a given block.
50
+ *
51
+ * - Docs: https://viem.sh/docs/actions/public/getStorageValues
52
+ * - JSON-RPC Methods: [`eth_getStorageValues`](https://github.com/ethereum/execution-apis/issues/752)
53
+ *
54
+ * @param client - Client to use
55
+ * @param parameters - {@link GetStorageValuesParameters}
56
+ * @returns The values of the requested storage slots. {@link GetStorageValuesReturnType}
57
+ *
58
+ * @example
59
+ * import { createPublicClient, http, toHex } from 'viem'
60
+ * import { mainnet } from 'viem/chains'
61
+ * import { getStorageValues } from 'viem/actions'
62
+ *
63
+ * const client = createPublicClient({ chain: mainnet, transport: http() })
64
+ * const values = await getStorageValues(client, {
65
+ * requests: {
66
+ * '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2': [
67
+ * toHex(0, { size: 32 }),
68
+ * toHex(1, { size: 32 }),
69
+ * ],
70
+ * },
71
+ * })
72
+ */
73
+ export async function getStorageValues<chain extends Chain | undefined>(
74
+ client: Client<Transport, chain>,
75
+ {
76
+ blockHash,
77
+ blockNumber,
78
+ blockTag = 'latest',
79
+ requireCanonical,
80
+ requests,
81
+ }: GetStorageValuesParameters,
82
+ ): Promise<GetStorageValuesReturnType> {
83
+ const block = formatBlockParameter({
84
+ blockHash,
85
+ blockNumber,
86
+ blockTag,
87
+ requireCanonical,
88
+ })
89
+ return client.request({
90
+ method: 'eth_getStorageValues',
91
+ params: [requests, block],
92
+ })
93
+ }
@@ -115,6 +115,14 @@ export type SimulateBlocksReturnType<
115
115
  data: Hex
116
116
  gasUsed: bigint
117
117
  logs?: Log[] | undefined
118
+ /**
119
+ * Gas used by the call as measured by the node before gas refunds are
120
+ * applied. `undefined` when the node does not report it.
121
+ *
122
+ * Note: this is a measurement of gas usage, not a guaranteed minimum
123
+ * sufficient gas limit for the call.
124
+ */
125
+ maxUsedGas?: bigint | undefined
118
126
  }
119
127
  error: Error
120
128
  mutability: AbiStateMutability
@@ -247,6 +255,8 @@ export async function simulateBlocks<
247
255
 
248
256
  const data = call.error?.data ?? call.returnData
249
257
  const gasUsed = BigInt(call.gasUsed)
258
+ const maxUsedGas =
259
+ call.maxUsedGas === undefined ? undefined : BigInt(call.maxUsedGas)
250
260
  const logs = call.logs?.map((log) => formatLog(log))
251
261
  const status = call.status === '0x1' ? 'success' : 'failure'
252
262
 
@@ -279,6 +289,9 @@ export async function simulateBlocks<
279
289
  data,
280
290
  gasUsed,
281
291
  logs,
292
+ // only present when reported by the node, so existing consumers
293
+ // (and snapshots) are unaffected on nodes that omit it.
294
+ ...(maxUsedGas === undefined ? {} : { maxUsedGas }),
282
295
  status,
283
296
  ...(status === 'success'
284
297
  ? {
@@ -153,8 +153,6 @@ export async function waitForTransactionReceipt<
153
153
  timeout = 180_000,
154
154
  } = parameters
155
155
 
156
- const observerId = stringify(['waitForTransactionReceipt', client.uid, hash])
157
-
158
156
  const pollingInterval = (() => {
159
157
  if (parameters.pollingInterval) return parameters.pollingInterval
160
158
  if (client.chain?.experimental_preconfirmationTime)
@@ -162,6 +160,22 @@ export async function waitForTransactionReceipt<
162
160
  return client.pollingInterval
163
161
  })()
164
162
 
163
+ const observerId = stringify([
164
+ 'waitForTransactionReceipt',
165
+ client.uid,
166
+ hash,
167
+ // Concurrent calls with different behavior-defining options must not
168
+ // share an observer: the first call's polling closure decides timeout,
169
+ // confirmations, polling interval and replacement checks for everyone.
170
+ {
171
+ checkReplacement,
172
+ confirmations,
173
+ pollingInterval,
174
+ retryCount,
175
+ timeout,
176
+ },
177
+ ])
178
+
165
179
  let transaction: GetTransactionReturnType<chain> | undefined
166
180
  let replacedTransaction: GetTransactionReturnType<chain> | undefined
167
181
  let receipt: GetTransactionReceiptReturnType<chain> | undefined
@@ -0,0 +1,20 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const blockdag = /*#__PURE__*/ defineChain({
4
+ id: 1404,
5
+ name: 'BlockDAG',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'BlockDAG',
9
+ symbol: 'BDAG',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://rpc.bdagexplorer.com/'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'BDAG Explorer',
17
+ url: 'https://explorer.bdagexplorer.com',
18
+ },
19
+ },
20
+ })
@@ -0,0 +1,26 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const candyChain = /*#__PURE__*/ defineChain({
4
+ id: 2828,
5
+ name: 'CandyChain',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'CANDY',
9
+ symbol: 'CANDY',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://publicrpc.candychain.io'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'CandyChain Explorer',
17
+ url: 'https://streams.candychain.io',
18
+ },
19
+ },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0xca11bde05977b3631167028862be2a173976ca11',
23
+ blockCreated: 2039339,
24
+ },
25
+ },
26
+ })
@@ -17,5 +17,11 @@ export const creditCoin3Devnet = /*#__PURE__*/ defineChain({
17
17
  apiUrl: 'https://creditcoin3-dev.subscan.io',
18
18
  },
19
19
  },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0x47b51dC7b7Bbb3d9eB12080e3DA6E26125e8D75e',
23
+ blockCreated: 16_352_786,
24
+ },
25
+ },
20
26
  testnet: true,
21
27
  })
@@ -17,5 +17,11 @@ export const creditCoin3Mainnet = /*#__PURE__*/ defineChain({
17
17
  apiUrl: 'https://creditcoin.blockscout.com/api',
18
18
  },
19
19
  },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0x47b51dC7b7Bbb3d9eB12080e3DA6E26125e8D75e',
23
+ blockCreated: 4_373_631,
24
+ },
25
+ },
20
26
  testnet: false,
21
27
  })
@@ -17,5 +17,11 @@ export const creditCoin3Testnet = /*#__PURE__*/ defineChain({
17
17
  apiUrl: 'https://creditcoin-testnet.blockscout.com/api',
18
18
  },
19
19
  },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0x47b51dC7b7Bbb3d9eB12080e3DA6E26125e8D75e',
23
+ blockCreated: 5_566_188,
24
+ },
25
+ },
20
26
  testnet: true,
21
27
  })
@@ -0,0 +1,20 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const kortana = /*#__PURE__*/ defineChain({
4
+ id: 9002,
5
+ name: 'Kortana',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'Dinar',
9
+ symbol: 'DNR',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://zeus-rpc.mainnet.kortana.xyz'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'Kortana Explorer',
17
+ url: 'https://explorer.mainnet.kortana.xyz',
18
+ },
19
+ },
20
+ })
@@ -0,0 +1,21 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const rabbitChainTestnet = /*#__PURE__*/ defineChain({
4
+ id: 9280,
5
+ name: 'Rabbit Chain Testnet',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'Test Rabbit',
9
+ symbol: 'tRAB',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://rpc-testnet.rabbitchain.org'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'Rabbit Chain Testnet Explorer',
17
+ url: 'https://explorer-testnet.rabbitchain.org',
18
+ },
19
+ },
20
+ testnet: true,
21
+ })
package/chains/index.ts CHANGED
@@ -86,6 +86,7 @@ export { bitTorrent } from './definitions/bitTorrent.js'
86
86
  export { bitTorrentTestnet } from './definitions/bitTorrentTestnet.js'
87
87
  export { blast } from './definitions/blast.js'
88
88
  export { blastSepolia } from './definitions/blastSepolia.js'
89
+ export { blockdag } from './definitions/blockdag.js'
89
90
  export { bob } from './definitions/bob.js'
90
91
  export { boba } from './definitions/boba.js'
91
92
  export { bobaSepolia } from './definitions/bobaSepolia.js'
@@ -106,6 +107,7 @@ export { btr } from './definitions/btr.js'
106
107
  export { btrTestnet } from './definitions/btrTestnet.js'
107
108
  export { bxn } from './definitions/bxn.js'
108
109
  export { bxnTestnet } from './definitions/bxnTestnet.js'
110
+ export { candyChain } from './definitions/candyChain.js'
109
111
  export { cannon } from './definitions/cannon.js'
110
112
  export { canto } from './definitions/canto.js'
111
113
  export { celo } from './definitions/celo.js'
@@ -353,6 +355,7 @@ export { klaytn } from './definitions/klaytn.js'
353
355
  /** @deprecated Use `kairos` instead. */
354
356
  export { klaytnBaobab } from './definitions/klaytnBaobab.js'
355
357
  export { koi } from './definitions/koi.js'
358
+ export { kortana } from './definitions/kortana.js'
356
359
  export { kroma } from './definitions/kroma.js'
357
360
  export { kromaSepolia } from './definitions/kromaSepolia.js'
358
361
  export { krown } from './definitions/krown.js'
@@ -517,6 +520,7 @@ export { qMainnet } from './definitions/qMainnet.js'
517
520
  export { qTestnet } from './definitions/qTestnet.js'
518
521
  export { quai } from './definitions/quai.js'
519
522
  export { quaiTestnet } from './definitions/quaiTestnet.js'
523
+ export { rabbitChainTestnet } from './definitions/rabbitChainTestnet.js'
520
524
  export { radius } from './definitions/radius.js'
521
525
  export { radiusTestnet } from './definitions/radiusTestnet.js'
522
526
  export { reactiveTestnet } from './definitions/reactiveTestnet.js'
@@ -0,0 +1,191 @@
1
+ import type { Address } from 'abitype'
2
+
3
+ import type { JsonRpcAccount } from '../accounts/types.js'
4
+ import { BaseError } from '../errors/base.js'
5
+ import type { Tokens } from '../tokens/defineToken.js'
6
+ import type { Account } from '../types/account.js'
7
+ import type { Chain } from '../types/chain.js'
8
+ import type { RpcSchema } from '../types/eip1193.js'
9
+ import type { Prettify } from '../types/utils.js'
10
+ import {
11
+ type Client,
12
+ type ClientConfig,
13
+ type CreateClientErrorType,
14
+ createClient,
15
+ } from './createClient.js'
16
+ import type { Transport } from './transports/createTransport.js'
17
+
18
+ /**
19
+ * Creates a resolver that lazily constructs and caches a Client for each configured chain.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * import { createClientResolver, http } from 'viem'
24
+ * import { mainnet, optimism } from 'viem/chains'
25
+ *
26
+ * const resolver = createClientResolver({
27
+ * chains: [mainnet, optimism],
28
+ * transport: {
29
+ * [mainnet.id]: http(),
30
+ * [optimism.id]: http(),
31
+ * },
32
+ * })
33
+ *
34
+ * const client = resolver.getClient({ chainId: optimism.id })
35
+ * ```
36
+ *
37
+ * @param options - Resolver options, including shared Client configuration.
38
+ * @returns A resolver for the configured chains.
39
+ */
40
+ export function createClientResolver<
41
+ const chains extends Chains,
42
+ accountOrAddress extends Account | Address | undefined = undefined,
43
+ const transport extends TransportConfig<NoInfer<chains>> = TransportConfig<
44
+ NoInfer<chains>
45
+ >,
46
+ const tokens extends Tokens | undefined = undefined,
47
+ rpcSchema extends RpcSchema | undefined = undefined,
48
+ >(
49
+ options: createClientResolver.Options<
50
+ chains,
51
+ accountOrAddress,
52
+ transport,
53
+ tokens,
54
+ rpcSchema
55
+ >,
56
+ ): createClientResolver.ReturnType<
57
+ chains,
58
+ accountOrAddress,
59
+ transport,
60
+ tokens,
61
+ rpcSchema
62
+ > {
63
+ const { chains, transport, ...rest } = options
64
+ const clients = new Map<number, unknown>()
65
+
66
+ // The chain and transport are selected from the same chain ID.
67
+ return {
68
+ getClient({ chainId }) {
69
+ const cached = clients.get(chainId)
70
+ if (cached) return cached
71
+
72
+ const chain = chains.find((chain) => chain.id === chainId)
73
+ if (!chain) throw new ChainNotConfiguredError({ chainId })
74
+ const transport_ =
75
+ typeof transport === 'function'
76
+ ? transport({ chainId })
77
+ : (transport as TransportMap<chains>)[chainId]
78
+ if (!transport_) throw new TransportNotConfiguredError({ chainId })
79
+ const client = createClient({ ...rest, chain, transport: transport_ })
80
+ clients.set(chainId, client)
81
+ return client
82
+ },
83
+ } as createClientResolver.ReturnType<
84
+ chains,
85
+ accountOrAddress,
86
+ transport,
87
+ tokens,
88
+ rpcSchema
89
+ >
90
+ }
91
+
92
+ export declare namespace createClientResolver {
93
+ /** Errors thrown while resolving a Client. */
94
+ type ErrorType =
95
+ | ChainNotConfiguredError
96
+ | CreateClientErrorType
97
+ | TransportNotConfiguredError
98
+
99
+ /** Options for {@link createClientResolver}. */
100
+ type Options<
101
+ chains extends Chains = Chains,
102
+ accountOrAddress extends Account | Address | undefined =
103
+ | Account
104
+ | Address
105
+ | undefined,
106
+ transport extends TransportConfig<chains> = TransportConfig<chains>,
107
+ tokens extends Tokens | undefined = Tokens | undefined,
108
+ rpcSchema extends RpcSchema | undefined = undefined,
109
+ > = Prettify<
110
+ Omit<
111
+ ClientConfig<Transport, undefined, accountOrAddress, rpcSchema, tokens>,
112
+ 'chain' | 'transport'
113
+ > & {
114
+ /** Chains available to the resolver. Must contain at least one chain. */
115
+ chains: chains
116
+ /** Transports indexed or resolved by chain ID. */
117
+ transport: transport
118
+ }
119
+ >
120
+
121
+ /** Return type of {@link createClientResolver}. */
122
+ type ReturnType<
123
+ chains extends Chains = Chains,
124
+ accountOrAddress extends Account | Address | undefined =
125
+ | Account
126
+ | Address
127
+ | undefined,
128
+ transport extends TransportConfig<chains> = TransportConfig<chains>,
129
+ tokens extends Tokens | undefined = Tokens | undefined,
130
+ rpcSchema extends RpcSchema | undefined = undefined,
131
+ > = {
132
+ /** Returns the cached Client configured for `chainId`, creating it on first use. */
133
+ getClient<const chainId extends chains[number]['id']>(options: {
134
+ /** ID of a configured chain. */
135
+ chainId: chainId
136
+ }): Client<
137
+ ResolvedTransport<chains, transport, chainId>,
138
+ number extends chains[number]['id']
139
+ ? chains[number]
140
+ : Extract<chains[number], { id: chainId }>,
141
+ accountOrAddress extends Address
142
+ ? Prettify<JsonRpcAccount<accountOrAddress>>
143
+ : accountOrAddress,
144
+ rpcSchema,
145
+ undefined,
146
+ tokens
147
+ >
148
+ }
149
+ }
150
+
151
+ type Chains = readonly [Chain, ...Chain[]]
152
+
153
+ type TransportConfig<chains extends Chains> =
154
+ | TransportMap<chains>
155
+ | ((options: { chainId: chains[number]['id'] }) => Transport)
156
+
157
+ type TransportMap<chains extends Chains> = {
158
+ readonly [chainId in chains[number]['id']]: Transport
159
+ }
160
+
161
+ type ResolvedTransport<
162
+ chains extends Chains,
163
+ transport extends TransportConfig<chains>,
164
+ chainId extends chains[number]['id'],
165
+ > = transport extends (...args: never[]) => infer resolved
166
+ ? resolved extends Transport
167
+ ? resolved
168
+ : never
169
+ : transport extends Record<chainId, infer resolved>
170
+ ? resolved extends Transport
171
+ ? resolved
172
+ : never
173
+ : never
174
+
175
+ /** Thrown when a Client is requested for an unconfigured chain. */
176
+ export class ChainNotConfiguredError extends BaseError {
177
+ constructor({ chainId }: { chainId: number }) {
178
+ super(`Chain with id ${chainId} is not configured.`, {
179
+ name: 'createClientResolver.ChainNotConfiguredError',
180
+ })
181
+ }
182
+ }
183
+
184
+ /** Thrown when a configured chain has no transport. */
185
+ export class TransportNotConfiguredError extends BaseError {
186
+ constructor({ chainId }: { chainId: number }) {
187
+ super(`Transport for chain with id ${chainId} is not configured.`, {
188
+ name: 'createClientResolver.TransportNotConfiguredError',
189
+ })
190
+ }
191
+ }
@@ -170,6 +170,11 @@ import {
170
170
  type GetStorageAtReturnType,
171
171
  getStorageAt,
172
172
  } from '../../actions/public/getStorageAt.js'
173
+ import {
174
+ type GetStorageValuesParameters,
175
+ type GetStorageValuesReturnType,
176
+ getStorageValues,
177
+ } from '../../actions/public/getStorageValues.js'
173
178
  import {
174
179
  type GetTransactionParameters,
175
180
  type GetTransactionReturnType,
@@ -1413,6 +1418,18 @@ export type PublicActions<
1413
1418
  getStorageAt: (
1414
1419
  args: GetStorageAtParameters,
1415
1420
  ) => Promise<GetStorageAtReturnType>
1421
+ /**
1422
+ * Returns values from multiple storage slots at a given address and block.
1423
+ *
1424
+ * - Docs: https://viem.sh/docs/actions/public/getStorageValues
1425
+ * - JSON-RPC Methods: [`eth_getStorageValues`](https://github.com/ethereum/execution-apis/issues/752)
1426
+ *
1427
+ * @param args - {@link GetStorageValuesParameters}
1428
+ * @returns The values of the requested storage slots. {@link GetStorageValuesReturnType}
1429
+ */
1430
+ getStorageValues: (
1431
+ args: GetStorageValuesParameters,
1432
+ ) => Promise<GetStorageValuesReturnType>
1416
1433
  /**
1417
1434
  * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
1418
1435
  *
@@ -2347,6 +2364,7 @@ export function publicActions<
2347
2364
  fillTransaction: (args) => fillTransaction(client, args),
2348
2365
  getRawTransaction: (args) => getRawTransaction(client, args),
2349
2366
  getStorageAt: (args) => getStorageAt(client, args),
2367
+ getStorageValues: (args) => getStorageValues(client, args),
2350
2368
  getTransaction: (args) => getTransaction(client, args),
2351
2369
  getTransactionConfirmations: (args) =>
2352
2370
  getTransactionConfirmations(client, args),
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.56.8'
1
+ export const version = '2.57.0'
package/index.ts CHANGED
@@ -247,6 +247,11 @@ export type {
247
247
  GetStorageAtParameters,
248
248
  GetStorageAtReturnType,
249
249
  } from './actions/public/getStorageAt.js'
250
+ export type {
251
+ GetStorageValuesErrorType,
252
+ GetStorageValuesParameters,
253
+ GetStorageValuesReturnType,
254
+ } from './actions/public/getStorageValues.js'
250
255
  export type {
251
256
  GetTransactionErrorType,
252
257
  GetTransactionParameters,
@@ -604,6 +609,12 @@ export {
604
609
  type MulticallBatchOptions,
605
610
  rpcSchema,
606
611
  } from './clients/createClient.js'
612
+ /** Lazily resolves and caches typed Clients across configured chains. */
613
+ export {
614
+ ChainNotConfiguredError,
615
+ createClientResolver,
616
+ TransportNotConfiguredError,
617
+ } from './clients/createClientResolver.js'
607
618
  export {
608
619
  type CreatePublicClientErrorType,
609
620
  createPublicClient,
@@ -93,7 +93,9 @@ export async function getGame<
93
93
 
94
94
  const latestGames = await getGames(client, parameters)
95
95
 
96
- const games = latestGames.filter((game) => game.l2BlockNumber > l2BlockNumber)
96
+ const games = latestGames.filter(
97
+ (game) => game.l2BlockNumber >= l2BlockNumber,
98
+ )
97
99
 
98
100
  const game = (() => {
99
101
  if (strategy === 'random')
@@ -145,7 +145,7 @@ export async function getGames<
145
145
  const games = rawGames
146
146
  .map((game, i) => {
147
147
  const blockNumber = l2SequenceNumbers[i] as bigint
148
- return !l2BlockNumber || blockNumber > l2BlockNumber
148
+ return !l2BlockNumber || blockNumber >= l2BlockNumber
149
149
  ? { ...game, l2BlockNumber: blockNumber, usesSuperRoots }
150
150
  : null
151
151
  })
@@ -133,9 +133,9 @@ export async function getTimeToNextGame<
133
133
  // then we assume that the dispute game has already been submitted.
134
134
  if (now < latestGameTimestamp) return 0
135
135
 
136
- // If the latest dispute game block is newer than the provided dispute game block number,
136
+ // If the latest dispute game covers the provided block number,
137
137
  // then we assume that the dispute game has already been submitted.
138
- if (latestGame.l2BlockNumber > l2BlockNumber) return 0
138
+ if (latestGame.l2BlockNumber >= l2BlockNumber) return 0
139
139
 
140
140
  // If there is only a single game, no interval data
141
141
  if (intervalWithBuffer === 0) return 0
@@ -141,9 +141,9 @@ export async function getTimeToNextL2Output<
141
141
  // then we assume that the L2 output has already been submitted.
142
142
  if (now < latestOutputTimestamp) return 0
143
143
 
144
- // If the latest L2 output block is newer than the provided L2 block number,
144
+ // If the latest L2 output covers the provided L2 block number,
145
145
  // then we assume that the L2 output has already been submitted.
146
- if (latestOutput.l2BlockNumber > l2BlockNumber) return 0
146
+ if (latestOutput.l2BlockNumber >= l2BlockNumber) return 0
147
147
 
148
148
  const elapsedBlocks = Number(l2BlockNumber - latestOutput.l2BlockNumber)
149
149
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.56.8",
4
+ "version": "2.57.0",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",