viem 2.57.11 → 2.57.12

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 (315) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/_cjs/actions/public/waitForTransactionReceipt.js +83 -23
  3. package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
  4. package/_cjs/actions/public/watchEvent.js +1 -0
  5. package/_cjs/actions/public/watchEvent.js.map +1 -1
  6. package/_cjs/actions/token/approve.js +1 -1
  7. package/_cjs/actions/token/approve.js.map +1 -1
  8. package/_cjs/actions/token/getAllowance.js +1 -1
  9. package/_cjs/actions/token/getAllowance.js.map +1 -1
  10. package/_cjs/actions/token/getBalance.js +1 -1
  11. package/_cjs/actions/token/getBalance.js.map +1 -1
  12. package/_cjs/actions/token/getTotalSupply.js +1 -1
  13. package/_cjs/actions/token/getTotalSupply.js.map +1 -1
  14. package/_cjs/actions/token/transfer.js +1 -1
  15. package/_cjs/actions/token/transfer.js.map +1 -1
  16. package/_cjs/actions/wallet/sendCalls.js +1 -1
  17. package/_cjs/actions/wallet/sendCalls.js.map +1 -1
  18. package/_cjs/chains/definitions/valuechain.js +22 -0
  19. package/_cjs/chains/definitions/valuechain.js.map +1 -0
  20. package/_cjs/chains/definitions/valuechainTestnet.js +23 -0
  21. package/_cjs/chains/definitions/valuechainTestnet.js.map +1 -0
  22. package/_cjs/chains/index.js +6 -2
  23. package/_cjs/chains/index.js.map +1 -1
  24. package/_cjs/clients/decorators/public.js.map +1 -1
  25. package/_cjs/clients/transports/http.js +5 -1
  26. package/_cjs/clients/transports/http.js.map +1 -1
  27. package/_cjs/errors/node.js +1 -1
  28. package/_cjs/errors/node.js.map +1 -1
  29. package/_cjs/errors/request.js +20 -2
  30. package/_cjs/errors/request.js.map +1 -1
  31. package/_cjs/errors/typedData.js +3 -1
  32. package/_cjs/errors/typedData.js.map +1 -1
  33. package/_cjs/errors/version.js +1 -1
  34. package/_cjs/op-stack/abis.js +52 -0
  35. package/_cjs/op-stack/abis.js.map +1 -1
  36. package/_cjs/op-stack/actions/getTimeToFinalize.js +53 -4
  37. package/_cjs/op-stack/actions/getTimeToFinalize.js.map +1 -1
  38. package/_cjs/op-stack/actions/getTimeToProve.js +29 -2
  39. package/_cjs/op-stack/actions/getTimeToProve.js.map +1 -1
  40. package/_cjs/op-stack/actions/getWithdrawalStatus.js +20 -4
  41. package/_cjs/op-stack/actions/getWithdrawalStatus.js.map +1 -1
  42. package/_cjs/op-stack/actions/waitToProve.js +28 -2
  43. package/_cjs/op-stack/actions/waitToProve.js.map +1 -1
  44. package/_cjs/op-stack/errors/withdrawal.js +12 -1
  45. package/_cjs/op-stack/errors/withdrawal.js.map +1 -1
  46. package/_cjs/tempo/Account.js +2 -5
  47. package/_cjs/tempo/Account.js.map +1 -1
  48. package/_cjs/tempo/Addresses.js +1 -2
  49. package/_cjs/tempo/Addresses.js.map +1 -1
  50. package/_cjs/tempo/accounts/Config.js +1 -4
  51. package/_cjs/tempo/accounts/Config.js.map +1 -1
  52. package/_cjs/tempo/actions/accessKey.js +8 -8
  53. package/_cjs/tempo/actions/accessKey.js.map +1 -1
  54. package/_cjs/tempo/actions/accounts.js +5 -5
  55. package/_cjs/tempo/actions/accounts.js.map +1 -1
  56. package/_cjs/tempo/actions/amm.js +4 -4
  57. package/_cjs/tempo/actions/amm.js.map +1 -1
  58. package/_cjs/tempo/actions/channel.js +7 -7
  59. package/_cjs/tempo/actions/channel.js.map +1 -1
  60. package/_cjs/tempo/actions/dex.js +14 -14
  61. package/_cjs/tempo/actions/dex.js.map +1 -1
  62. package/_cjs/tempo/actions/earn/deployment.js +3 -3
  63. package/_cjs/tempo/actions/earn/deployment.js.map +1 -1
  64. package/_cjs/tempo/actions/earn.js +6 -6
  65. package/_cjs/tempo/actions/earn.js.map +1 -1
  66. package/_cjs/tempo/actions/fee.js +4 -4
  67. package/_cjs/tempo/actions/fee.js.map +1 -1
  68. package/_cjs/tempo/actions/nonce.js +1 -1
  69. package/_cjs/tempo/actions/nonce.js.map +1 -1
  70. package/_cjs/tempo/actions/policy.js +6 -6
  71. package/_cjs/tempo/actions/policy.js.map +1 -1
  72. package/_cjs/tempo/actions/propAmm.js +10 -10
  73. package/_cjs/tempo/actions/propAmm.js.map +1 -1
  74. package/_cjs/tempo/actions/receivePolicy.js +6 -6
  75. package/_cjs/tempo/actions/receivePolicy.js.map +1 -1
  76. package/_cjs/tempo/actions/reward.js +6 -6
  77. package/_cjs/tempo/actions/reward.js.map +1 -1
  78. package/_cjs/tempo/actions/token.js +21 -21
  79. package/_cjs/tempo/actions/token.js.map +1 -1
  80. package/_cjs/tempo/actions/validator.js +11 -11
  81. package/_cjs/tempo/actions/validator.js.map +1 -1
  82. package/_cjs/tempo/actions/virtualAddress.js +2 -2
  83. package/_cjs/tempo/actions/virtualAddress.js.map +1 -1
  84. package/_cjs/tempo/internal/relay/accounts.js +1 -3
  85. package/_cjs/tempo/internal/relay/accounts.js.map +1 -1
  86. package/_cjs/utils/abi/getAbiItem.js +33 -12
  87. package/_cjs/utils/abi/getAbiItem.js.map +1 -1
  88. package/_cjs/utils/abi/parseEventLogs.js +18 -10
  89. package/_cjs/utils/abi/parseEventLogs.js.map +1 -1
  90. package/_cjs/utils/authorization/serializeAuthorizationList.js +4 -1
  91. package/_cjs/utils/authorization/serializeAuthorizationList.js.map +1 -1
  92. package/_cjs/utils/buildRequest.js +25 -14
  93. package/_cjs/utils/buildRequest.js.map +1 -1
  94. package/_cjs/utils/data/isHex.js +3 -1
  95. package/_cjs/utils/data/isHex.js.map +1 -1
  96. package/_cjs/utils/hash/normalizeSignature.js +1 -1
  97. package/_cjs/utils/hash/normalizeSignature.js.map +1 -1
  98. package/_cjs/utils/rpc/http.js +24 -4
  99. package/_cjs/utils/rpc/http.js.map +1 -1
  100. package/_cjs/utils/signature/compactSignatureToSignature.js +3 -2
  101. package/_cjs/utils/signature/compactSignatureToSignature.js.map +1 -1
  102. package/_cjs/utils/signature/hashTypedData.js +1 -2
  103. package/_cjs/utils/signature/hashTypedData.js.map +1 -1
  104. package/_cjs/utils/signature/signatureToCompactSignature.js +15 -7
  105. package/_cjs/utils/signature/signatureToCompactSignature.js.map +1 -1
  106. package/_cjs/utils/siwe/createSiweMessage.js +1 -1
  107. package/_cjs/utils/siwe/createSiweMessage.js.map +1 -1
  108. package/_cjs/utils/typedData.js +6 -7
  109. package/_cjs/utils/typedData.js.map +1 -1
  110. package/_cjs/utils/wait.js +1 -1
  111. package/_cjs/utils/wait.js.map +1 -1
  112. package/_esm/actions/public/waitForTransactionReceipt.js +101 -23
  113. package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
  114. package/_esm/actions/public/watchEvent.js +1 -0
  115. package/_esm/actions/public/watchEvent.js.map +1 -1
  116. package/_esm/actions/token/approve.js +1 -1
  117. package/_esm/actions/token/approve.js.map +1 -1
  118. package/_esm/actions/token/getAllowance.js +1 -1
  119. package/_esm/actions/token/getAllowance.js.map +1 -1
  120. package/_esm/actions/token/getBalance.js +1 -1
  121. package/_esm/actions/token/getBalance.js.map +1 -1
  122. package/_esm/actions/token/getTotalSupply.js +1 -1
  123. package/_esm/actions/token/getTotalSupply.js.map +1 -1
  124. package/_esm/actions/token/transfer.js +1 -1
  125. package/_esm/actions/token/transfer.js.map +1 -1
  126. package/_esm/actions/wallet/sendCalls.js +1 -1
  127. package/_esm/actions/wallet/sendCalls.js.map +1 -1
  128. package/_esm/chains/definitions/valuechain.js +20 -0
  129. package/_esm/chains/definitions/valuechain.js.map +1 -0
  130. package/_esm/chains/definitions/valuechainTestnet.js +21 -0
  131. package/_esm/chains/definitions/valuechainTestnet.js.map +1 -0
  132. package/_esm/chains/index.js +4 -0
  133. package/_esm/chains/index.js.map +1 -1
  134. package/_esm/clients/decorators/public.js.map +1 -1
  135. package/_esm/clients/transports/http.js +6 -1
  136. package/_esm/clients/transports/http.js.map +1 -1
  137. package/_esm/errors/node.js +1 -1
  138. package/_esm/errors/node.js.map +1 -1
  139. package/_esm/errors/request.js +22 -2
  140. package/_esm/errors/request.js.map +1 -1
  141. package/_esm/errors/typedData.js +3 -1
  142. package/_esm/errors/typedData.js.map +1 -1
  143. package/_esm/errors/version.js +1 -1
  144. package/_esm/op-stack/abis.js +52 -0
  145. package/_esm/op-stack/abis.js.map +1 -1
  146. package/_esm/op-stack/actions/getTimeToFinalize.js +64 -6
  147. package/_esm/op-stack/actions/getTimeToFinalize.js.map +1 -1
  148. package/_esm/op-stack/actions/getTimeToProve.js +30 -2
  149. package/_esm/op-stack/actions/getTimeToProve.js.map +1 -1
  150. package/_esm/op-stack/actions/getWithdrawalStatus.js +24 -5
  151. package/_esm/op-stack/actions/getWithdrawalStatus.js.map +1 -1
  152. package/_esm/op-stack/actions/waitToProve.js +30 -3
  153. package/_esm/op-stack/actions/waitToProve.js.map +1 -1
  154. package/_esm/op-stack/errors/withdrawal.js +10 -0
  155. package/_esm/op-stack/errors/withdrawal.js.map +1 -1
  156. package/_esm/tempo/Account.js +2 -5
  157. package/_esm/tempo/Account.js.map +1 -1
  158. package/_esm/tempo/Addresses.js +0 -2
  159. package/_esm/tempo/Addresses.js.map +1 -1
  160. package/_esm/tempo/accounts/Config.js +1 -4
  161. package/_esm/tempo/accounts/Config.js.map +1 -1
  162. package/_esm/tempo/actions/accessKey.js +8 -8
  163. package/_esm/tempo/actions/accessKey.js.map +1 -1
  164. package/_esm/tempo/actions/accounts.js +7 -7
  165. package/_esm/tempo/actions/accounts.js.map +1 -1
  166. package/_esm/tempo/actions/amm.js +4 -4
  167. package/_esm/tempo/actions/amm.js.map +1 -1
  168. package/_esm/tempo/actions/channel.js +7 -7
  169. package/_esm/tempo/actions/channel.js.map +1 -1
  170. package/_esm/tempo/actions/dex.js +14 -14
  171. package/_esm/tempo/actions/dex.js.map +1 -1
  172. package/_esm/tempo/actions/earn/deployment.js +3 -3
  173. package/_esm/tempo/actions/earn/deployment.js.map +1 -1
  174. package/_esm/tempo/actions/earn.js +6 -6
  175. package/_esm/tempo/actions/earn.js.map +1 -1
  176. package/_esm/tempo/actions/fee.js +4 -4
  177. package/_esm/tempo/actions/fee.js.map +1 -1
  178. package/_esm/tempo/actions/nonce.js +1 -1
  179. package/_esm/tempo/actions/nonce.js.map +1 -1
  180. package/_esm/tempo/actions/policy.js +6 -6
  181. package/_esm/tempo/actions/policy.js.map +1 -1
  182. package/_esm/tempo/actions/propAmm.js +10 -10
  183. package/_esm/tempo/actions/propAmm.js.map +1 -1
  184. package/_esm/tempo/actions/receivePolicy.js +6 -6
  185. package/_esm/tempo/actions/receivePolicy.js.map +1 -1
  186. package/_esm/tempo/actions/reward.js +6 -6
  187. package/_esm/tempo/actions/reward.js.map +1 -1
  188. package/_esm/tempo/actions/token.js +21 -21
  189. package/_esm/tempo/actions/token.js.map +1 -1
  190. package/_esm/tempo/actions/validator.js +11 -11
  191. package/_esm/tempo/actions/validator.js.map +1 -1
  192. package/_esm/tempo/actions/virtualAddress.js +2 -2
  193. package/_esm/tempo/actions/virtualAddress.js.map +1 -1
  194. package/_esm/tempo/internal/relay/accounts.js +1 -3
  195. package/_esm/tempo/internal/relay/accounts.js.map +1 -1
  196. package/_esm/utils/abi/getAbiItem.js +36 -14
  197. package/_esm/utils/abi/getAbiItem.js.map +1 -1
  198. package/_esm/utils/abi/parseEventLogs.js +25 -11
  199. package/_esm/utils/abi/parseEventLogs.js.map +1 -1
  200. package/_esm/utils/authorization/serializeAuthorizationList.js +7 -1
  201. package/_esm/utils/authorization/serializeAuthorizationList.js.map +1 -1
  202. package/_esm/utils/buildRequest.js +29 -15
  203. package/_esm/utils/buildRequest.js.map +1 -1
  204. package/_esm/utils/data/isHex.js +3 -1
  205. package/_esm/utils/data/isHex.js.map +1 -1
  206. package/_esm/utils/hash/normalizeSignature.js +1 -1
  207. package/_esm/utils/hash/normalizeSignature.js.map +1 -1
  208. package/_esm/utils/hash/toSignature.js +1 -1
  209. package/_esm/utils/hash/toSignatureHash.js +1 -1
  210. package/_esm/utils/rpc/http.js +29 -7
  211. package/_esm/utils/rpc/http.js.map +1 -1
  212. package/_esm/utils/signature/compactSignatureToSignature.js +3 -2
  213. package/_esm/utils/signature/compactSignatureToSignature.js.map +1 -1
  214. package/_esm/utils/signature/hashTypedData.js +1 -2
  215. package/_esm/utils/signature/hashTypedData.js.map +1 -1
  216. package/_esm/utils/signature/signatureToCompactSignature.js +16 -7
  217. package/_esm/utils/signature/signatureToCompactSignature.js.map +1 -1
  218. package/_esm/utils/siwe/createSiweMessage.js +1 -1
  219. package/_esm/utils/siwe/createSiweMessage.js.map +1 -1
  220. package/_esm/utils/typedData.js +12 -8
  221. package/_esm/utils/typedData.js.map +1 -1
  222. package/_esm/utils/wait.js +2 -1
  223. package/_esm/utils/wait.js.map +1 -1
  224. package/_types/actions/public/waitForTransactionReceipt.d.ts +31 -1
  225. package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
  226. package/_types/actions/public/watchEvent.d.ts.map +1 -1
  227. package/_types/chains/definitions/valuechain.d.ts +53 -0
  228. package/_types/chains/definitions/valuechain.d.ts.map +1 -0
  229. package/_types/chains/definitions/valuechainTestnet.d.ts +53 -0
  230. package/_types/chains/definitions/valuechainTestnet.d.ts.map +1 -0
  231. package/_types/chains/index.d.ts +4 -0
  232. package/_types/chains/index.d.ts.map +1 -1
  233. package/_types/clients/decorators/public.d.ts +3 -0
  234. package/_types/clients/decorators/public.d.ts.map +1 -1
  235. package/_types/clients/transports/http.d.ts.map +1 -1
  236. package/_types/errors/node.d.ts.map +1 -1
  237. package/_types/errors/request.d.ts +7 -1
  238. package/_types/errors/request.d.ts.map +1 -1
  239. package/_types/errors/typedData.d.ts.map +1 -1
  240. package/_types/errors/version.d.ts +1 -1
  241. package/_types/op-stack/abis.d.ts +40 -0
  242. package/_types/op-stack/abis.d.ts.map +1 -1
  243. package/_types/op-stack/actions/getTimeToFinalize.d.ts +3 -2
  244. package/_types/op-stack/actions/getTimeToFinalize.d.ts.map +1 -1
  245. package/_types/op-stack/actions/getTimeToProve.d.ts +3 -1
  246. package/_types/op-stack/actions/getTimeToProve.d.ts.map +1 -1
  247. package/_types/op-stack/actions/getWithdrawalStatus.d.ts +2 -2
  248. package/_types/op-stack/actions/getWithdrawalStatus.d.ts.map +1 -1
  249. package/_types/op-stack/actions/waitToProve.d.ts +3 -1
  250. package/_types/op-stack/actions/waitToProve.d.ts.map +1 -1
  251. package/_types/op-stack/errors/withdrawal.d.ts +8 -0
  252. package/_types/op-stack/errors/withdrawal.d.ts.map +1 -1
  253. package/_types/tempo/Account.d.ts +0 -5
  254. package/_types/tempo/Account.d.ts.map +1 -1
  255. package/_types/tempo/Addresses.d.ts +0 -2
  256. package/_types/tempo/Addresses.d.ts.map +1 -1
  257. package/_types/tempo/accounts/Config.d.ts.map +1 -1
  258. package/_types/tempo/actions/accounts.d.ts +2 -2
  259. package/_types/tempo/internal/relay/accounts.d.ts.map +1 -1
  260. package/_types/utils/abi/getAbiItem.d.ts.map +1 -1
  261. package/_types/utils/abi/parseEventLogs.d.ts.map +1 -1
  262. package/_types/utils/authorization/serializeAuthorizationList.d.ts.map +1 -1
  263. package/_types/utils/buildRequest.d.ts.map +1 -1
  264. package/_types/utils/data/isHex.d.ts +12 -1
  265. package/_types/utils/data/isHex.d.ts.map +1 -1
  266. package/_types/utils/hash/toSignature.d.ts +1 -1
  267. package/_types/utils/hash/toSignatureHash.d.ts +1 -1
  268. package/_types/utils/rpc/http.d.ts +2 -2
  269. package/_types/utils/rpc/http.d.ts.map +1 -1
  270. package/_types/utils/signature/compactSignatureToSignature.d.ts +2 -1
  271. package/_types/utils/signature/compactSignatureToSignature.d.ts.map +1 -1
  272. package/_types/utils/signature/hashTypedData.d.ts.map +1 -1
  273. package/_types/utils/signature/signatureToCompactSignature.d.ts +2 -1
  274. package/_types/utils/signature/signatureToCompactSignature.d.ts.map +1 -1
  275. package/_types/utils/typedData.d.ts.map +1 -1
  276. package/_types/utils/wait.d.ts.map +1 -1
  277. package/actions/public/waitForTransactionReceipt.ts +164 -33
  278. package/actions/public/watchEvent.ts +1 -0
  279. package/actions/wallet/sendCalls.ts +1 -1
  280. package/chains/definitions/valuechain.ts +20 -0
  281. package/chains/definitions/valuechainTestnet.ts +21 -0
  282. package/chains/index.ts +4 -0
  283. package/clients/decorators/public.ts +3 -0
  284. package/clients/transports/http.ts +6 -1
  285. package/errors/node.ts +1 -1
  286. package/errors/request.ts +15 -1
  287. package/errors/typedData.ts +3 -1
  288. package/errors/version.ts +1 -1
  289. package/op-stack/abis.ts +52 -0
  290. package/op-stack/actions/getTimeToFinalize.ts +89 -10
  291. package/op-stack/actions/getTimeToProve.ts +43 -2
  292. package/op-stack/actions/getWithdrawalStatus.ts +30 -6
  293. package/op-stack/actions/waitToProve.ts +45 -3
  294. package/op-stack/errors/withdrawal.ts +17 -0
  295. package/package.json +2 -2
  296. package/tempo/Account.ts +2 -14
  297. package/tempo/Addresses.ts +0 -3
  298. package/tempo/accounts/Config.ts +1 -9
  299. package/tempo/actions/accounts.ts +2 -2
  300. package/tempo/internal/relay/accounts.ts +1 -3
  301. package/utils/abi/getAbiItem.ts +49 -17
  302. package/utils/abi/parseEventLogs.ts +32 -11
  303. package/utils/authorization/serializeAuthorizationList.ts +7 -1
  304. package/utils/buildRequest.ts +29 -14
  305. package/utils/data/isHex.ts +18 -1
  306. package/utils/hash/normalizeSignature.ts +1 -1
  307. package/utils/hash/toSignature.ts +1 -1
  308. package/utils/hash/toSignatureHash.ts +1 -1
  309. package/utils/rpc/http.ts +33 -8
  310. package/utils/signature/compactSignatureToSignature.ts +4 -2
  311. package/utils/signature/hashTypedData.ts +1 -2
  312. package/utils/signature/signatureToCompactSignature.ts +13 -8
  313. package/utils/siwe/createSiweMessage.ts +1 -1
  314. package/utils/typedData.ts +11 -8
  315. package/utils/wait.ts +8 -4
@@ -0,0 +1,21 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ /** ValueChain testnet. */
4
+ export const valuechainTestnet = /*#__PURE__*/ defineChain({
5
+ id: 138_565,
6
+ name: 'ValueChain Testnet',
7
+ blockTime: 2_000,
8
+ nativeCurrency: { name: 'SOSO', symbol: 'SOSO', decimals: 18 },
9
+ rpcUrls: {
10
+ default: {
11
+ http: ['https://testnet.valuechain.xyz'],
12
+ },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'ValueChain Testnet Explorer',
17
+ url: 'https://test-scan.valuechain.xyz',
18
+ },
19
+ },
20
+ testnet: true,
21
+ })
package/chains/index.ts CHANGED
@@ -699,6 +699,10 @@ export { unique } from './definitions/unique.js'
699
699
  export { uniqueOpal } from './definitions/uniqueOpal.js'
700
700
  export { uniqueQuartz } from './definitions/uniqueQuartz.js'
701
701
  export { unreal } from './definitions/unreal.js'
702
+ /** ValueChain mainnet. */
703
+ export { valuechain } from './definitions/valuechain.js'
704
+ /** ValueChain testnet. */
705
+ export { valuechainTestnet } from './definitions/valuechainTestnet.js'
702
706
  export { valygoNft } from './definitions/valygoNft.js'
703
707
  export { valygoSmartchain } from './definitions/valygoSmartchain.js'
704
708
  export { vana } from './definitions/vana.js'
@@ -1954,6 +1954,9 @@ export type PublicActions<
1954
1954
  * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions
1955
1955
  * - Checks if one of the Transactions is a replacement
1956
1956
  * - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt).
1957
+ * - If the Transaction is not found and `replacement` is provided:
1958
+ * - Calls `eth_getTransactionBySenderAndNonce` to find the Transaction in its nonce slot
1959
+ * - If it is a replacement, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt).
1957
1960
  *
1958
1961
  * @remarks
1959
1962
  * The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions).
@@ -170,7 +170,12 @@ export function http<
170
170
  }),
171
171
  ]
172
172
 
173
- const [{ error, result }] = await fn(body)
173
+ const [{ error, result }] = await fn(body).catch((err) => {
174
+ // Raw transports also return JSON-RPC errors from non-2xx responses.
175
+ if (raw && err instanceof RpcRequestError)
176
+ return [{ error: err.cause, result: undefined }]
177
+ throw err
178
+ })
174
179
 
175
180
  if (raw) return { error, result }
176
181
  if (error)
package/errors/node.ts CHANGED
@@ -151,7 +151,7 @@ export type InsufficientFundsErrorType = InsufficientFundsError & {
151
151
  }
152
152
  export class InsufficientFundsError extends BaseError {
153
153
  static nodeMessage =
154
- /insufficient funds|exceeds transaction sender account balance/
154
+ /insufficient funds|exceeds transaction sender account balance|outoffunds/
155
155
  constructor({ cause }: { cause?: BaseError | undefined } = {}) {
156
156
  super(
157
157
  [
package/errors/request.ts CHANGED
@@ -96,24 +96,38 @@ export type RpcRequestErrorType = RpcRequestError & {
96
96
  export class RpcRequestError extends BaseError {
97
97
  code: number
98
98
  data?: unknown
99
+ /** Response headers, when the error came from a non-2xx HTTP response. */
100
+ headers?: Headers | undefined
101
+ /** Response status, when the error came from a non-2xx HTTP response. */
102
+ status?: number | undefined
99
103
  url: string
100
104
  constructor({
101
105
  body,
102
106
  error,
107
+ headers,
108
+ status,
103
109
  url,
104
110
  }: {
105
111
  body: { [x: string]: unknown } | { [y: string]: unknown }[]
106
112
  error: { code: number; data?: unknown; message: string }
113
+ headers?: Headers | undefined
114
+ status?: number | undefined
107
115
  url: string
108
116
  }) {
109
117
  super('RPC Request failed.', {
110
118
  cause: error as any,
111
119
  details: error.message,
112
- metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify(body)}`],
120
+ metaMessages: [
121
+ status && `Status: ${status}`,
122
+ `URL: ${getUrl(url)}`,
123
+ `Request body: ${stringify(body)}`,
124
+ ].filter(Boolean) as string[],
113
125
  name: 'RpcRequestError',
114
126
  })
115
127
  this.code = error.code
116
128
  this.data = error.data
129
+ this.headers = headers
130
+ this.status = status
117
131
  this.url = url
118
132
  }
119
133
  }
@@ -38,7 +38,9 @@ export type InvalidStructTypeErrorType = InvalidStructTypeError & {
38
38
  export class InvalidStructTypeError extends BaseError {
39
39
  constructor({ type }: { type: string }) {
40
40
  super(`Struct type "${type}" is invalid.`, {
41
- metaMessages: ['Struct type must not be a Solidity type.'],
41
+ metaMessages: [
42
+ 'Struct type must contain only letters, digits, "_" and "$", and must not be a Solidity type.',
43
+ ],
42
44
  name: 'InvalidStructTypeError',
43
45
  })
44
46
  }
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.57.11'
1
+ export const version = '2.57.12'
package/op-stack/abis.ts CHANGED
@@ -479,6 +479,58 @@ export const l2ToL1MessagePasserAbi = [
479
479
  ] as const
480
480
 
481
481
  export const disputeGameAbi = [
482
+ {
483
+ type: 'function',
484
+ name: 'createdAt',
485
+ inputs: [],
486
+ outputs: [
487
+ {
488
+ name: '',
489
+ type: 'uint64',
490
+ internalType: 'uint64',
491
+ },
492
+ ],
493
+ stateMutability: 'view',
494
+ },
495
+ {
496
+ type: 'function',
497
+ name: 'expectedResolution',
498
+ inputs: [],
499
+ outputs: [
500
+ {
501
+ name: '',
502
+ type: 'uint64',
503
+ internalType: 'uint64',
504
+ },
505
+ ],
506
+ stateMutability: 'view',
507
+ },
508
+ {
509
+ type: 'function',
510
+ name: 'maxClockDuration',
511
+ inputs: [],
512
+ outputs: [
513
+ {
514
+ name: 'maxClockDuration_',
515
+ type: 'uint64',
516
+ internalType: 'uint64',
517
+ },
518
+ ],
519
+ stateMutability: 'view',
520
+ },
521
+ {
522
+ type: 'function',
523
+ name: 'resolvedAt',
524
+ inputs: [],
525
+ outputs: [
526
+ {
527
+ name: '',
528
+ type: 'uint64',
529
+ internalType: 'uint64',
530
+ },
531
+ ],
532
+ stateMutability: 'view',
533
+ },
482
534
  {
483
535
  type: 'function',
484
536
  name: 'l2SequenceNumber',
@@ -2,10 +2,14 @@ import {
2
2
  type MulticallErrorType,
3
3
  multicall,
4
4
  } from '../../actions/public/multicall.js'
5
- import { readContract } from '../../actions/public/readContract.js'
5
+ import {
6
+ type ReadContractErrorType,
7
+ readContract,
8
+ } from '../../actions/public/readContract.js'
6
9
  import type { Client } from '../../clients/createClient.js'
7
10
  import type { Transport } from '../../clients/transports/createTransport.js'
8
11
  import { BaseError } from '../../errors/base.js'
12
+ import { ContractFunctionRevertedError } from '../../errors/contract.js'
9
13
  import type { ErrorType } from '../../errors/utils.js'
10
14
  import type { Account } from '../../types/account.js'
11
15
  import type {
@@ -14,7 +18,12 @@ import type {
14
18
  GetChainParameter,
15
19
  } from '../../types/chain.js'
16
20
  import type { Hash } from '../../types/misc.js'
17
- import { l2OutputOracleAbi, portal2Abi, portalAbi } from '../abis.js'
21
+ import {
22
+ disputeGameAbi,
23
+ l2OutputOracleAbi,
24
+ portal2Abi,
25
+ portalAbi,
26
+ } from '../abis.js'
18
27
  import type { GetContractAddressParameter } from '../types/contract.js'
19
28
  import { getPortalVersion } from './getPortalVersion.js'
20
29
 
@@ -27,14 +36,17 @@ export type GetTimeToFinalizeParameters<
27
36
  withdrawalHash: Hash
28
37
  }
29
38
  export type GetTimeToFinalizeReturnType = {
30
- /** The finalization period (in seconds). */
39
+ /** The proof maturity delay (in seconds). */
31
40
  period: number
32
41
  /** Seconds until the withdrawal can be finalized. */
33
42
  seconds: number
34
43
  /** Timestamp of when the withdrawal can be finalized. */
35
44
  timestamp: number
36
45
  }
37
- export type GetTimeToFinalizeErrorType = MulticallErrorType | ErrorType
46
+ export type GetTimeToFinalizeErrorType =
47
+ | MulticallErrorType
48
+ | ReadContractErrorType
49
+ | ErrorType
38
50
 
39
51
  const buffer = 10
40
52
 
@@ -142,7 +154,7 @@ export async function getTimeToFinalize<
142
154
  args: [withdrawalHash, numProofSubmitters - 1n],
143
155
  }).catch(() => undefined)
144
156
 
145
- const [[_disputeGameProxy, proveTimestamp], proofMaturityDelaySeconds] =
157
+ const [[disputeGameProxy, proveTimestamp], proofMaturityDelaySeconds] =
146
158
  await Promise.all([
147
159
  proofSubmitter
148
160
  ? readContract(client, {
@@ -151,7 +163,7 @@ export async function getTimeToFinalize<
151
163
  functionName: 'provenWithdrawals',
152
164
  args: [withdrawalHash, proofSubmitter],
153
165
  })
154
- : Promise.resolve(['0x', 0n]),
166
+ : Promise.resolve(['0x', 0n] as const),
155
167
  readContract(client, {
156
168
  abi: portal2Abi,
157
169
  address: portalAddress,
@@ -162,14 +174,81 @@ export async function getTimeToFinalize<
162
174
  if (proveTimestamp === 0n)
163
175
  throw new BaseError('Withdrawal has not been proven on L1.')
164
176
 
165
- const secondsSinceProven = Date.now() / 1000 - Number(proveTimestamp)
166
- const secondsToFinalize =
167
- Number(proofMaturityDelaySeconds) - secondsSinceProven
177
+ // The withdrawal can only be finalized once the proof's dispute game is
178
+ // resolved and its finality delay has passed, so also read the game.
179
+ const [
180
+ resolvedAt,
181
+ createdAt,
182
+ expectedResolution,
183
+ maxClockDuration,
184
+ disputeGameFinalityDelaySeconds,
185
+ ] = await Promise.all([
186
+ readContract(client, {
187
+ abi: disputeGameAbi,
188
+ address: disputeGameProxy,
189
+ functionName: 'resolvedAt',
190
+ }),
191
+ readContract(client, {
192
+ abi: disputeGameAbi,
193
+ address: disputeGameProxy,
194
+ functionName: 'createdAt',
195
+ }),
196
+ // Only some game types implement `expectedResolution` (e.g. `AggregateVerifier`).
197
+ readContract(client, {
198
+ abi: disputeGameAbi,
199
+ address: disputeGameProxy,
200
+ functionName: 'expectedResolution',
201
+ }).catch(unsupported),
202
+ // Only some game types implement `maxClockDuration` (e.g. `FaultDisputeGame`).
203
+ readContract(client, {
204
+ abi: disputeGameAbi,
205
+ address: disputeGameProxy,
206
+ functionName: 'maxClockDuration',
207
+ }).catch(unsupported),
208
+ readContract(client, {
209
+ abi: portal2Abi,
210
+ address: portalAddress,
211
+ functionName: 'disputeGameFinalityDelaySeconds',
212
+ }),
213
+ ])
214
+
215
+ const now = Date.now() / 1000
216
+
217
+ // When the game is not resolved yet, estimate when it will be: the expected
218
+ // resolution reported by the game, or the end of an unchallenged root claim's clock.
219
+ // An unresolved game cannot have resolved in the past, so the estimate is at least `now`.
220
+ const gameResolvedAt = (() => {
221
+ if (resolvedAt > 0n) return Number(resolvedAt)
222
+ const estimate = (() => {
223
+ if (typeof expectedResolution === 'bigint') return expectedResolution
224
+ if (typeof maxClockDuration === 'bigint')
225
+ return createdAt + maxClockDuration
226
+ return undefined
227
+ })()
228
+ // Without an estimate, only the proof maturity delay applies.
229
+ if (estimate === undefined) return 0
230
+ return Math.max(Number(estimate), now)
231
+ })()
232
+
233
+ const secondsToProofMaturity =
234
+ Number(proofMaturityDelaySeconds) - (now - Number(proveTimestamp))
235
+ const secondsToGameFinality =
236
+ gameResolvedAt + Number(disputeGameFinalityDelaySeconds) - now
237
+ const secondsToFinalize = Math.max(
238
+ secondsToProofMaturity,
239
+ secondsToGameFinality,
240
+ )
168
241
 
169
242
  const seconds = Math.floor(
170
- secondsToFinalize < 0n ? 0 : secondsToFinalize + buffer,
243
+ secondsToFinalize < 0 ? 0 : secondsToFinalize + buffer,
171
244
  )
172
245
  const timestamp = Date.now() + seconds * 1000
173
246
 
174
247
  return { period: Number(proofMaturityDelaySeconds), seconds, timestamp }
175
248
  }
249
+
250
+ /** Returns `undefined` when the game does not implement the getter, and rethrows other errors. */
251
+ function unsupported(error: ReadContractErrorType) {
252
+ if (error.cause instanceof ContractFunctionRevertedError) return undefined
253
+ throw error
254
+ }
@@ -1,3 +1,7 @@
1
+ import {
2
+ type ReadContractErrorType,
3
+ readContract,
4
+ } from '../../actions/public/readContract.js'
1
5
  import type { Client } from '../../clients/createClient.js'
2
6
  import type { Transport } from '../../clients/transports/createTransport.js'
3
7
  import type { ErrorType } from '../../errors/utils.js'
@@ -9,6 +13,13 @@ import type {
9
13
  } from '../../types/chain.js'
10
14
  import type { TransactionReceipt } from '../../types/transaction.js'
11
15
  import type { OneOf } from '../../types/utils.js'
16
+ import { portal2Abi } from '../abis.js'
17
+ import {
18
+ L2TimestampRequiredError,
19
+ type L2TimestampRequiredErrorType,
20
+ } from '../errors/withdrawal.js'
21
+ import { isSuperGameType } from '../gameTypes.js'
22
+ import type { TargetChain } from '../types/chain.js'
12
23
  import type { GetContractAddressParameter } from '../types/contract.js'
13
24
  import {
14
25
  type GetPortalVersionErrorType,
@@ -62,6 +73,8 @@ export type GetTimeToProveErrorType =
62
73
  | GetPortalVersionErrorType
63
74
  | GetTimeToNextGameErrorType
64
75
  | GetTimeToNextL2OutputErrorType
76
+ | L2TimestampRequiredErrorType
77
+ | ReadContractErrorType
65
78
  | ErrorType
66
79
 
67
80
  /**
@@ -102,7 +115,14 @@ export async function getTimeToProve<
102
115
  client: Client<Transport, chain, account>,
103
116
  parameters: GetTimeToProveParameters<chain, chainOverride>,
104
117
  ): Promise<GetTimeToProveReturnType> {
105
- const { l2Timestamp, receipt } = parameters
118
+ const {
119
+ chain = client.chain,
120
+ l2Timestamp,
121
+ receipt,
122
+ targetChain: targetChain_,
123
+ } = parameters
124
+
125
+ const targetChain = targetChain_ as unknown as TargetChain
106
126
 
107
127
  const portalVersion = await getPortalVersion(
108
128
  client,
@@ -116,8 +136,29 @@ export async function getTimeToProve<
116
136
  l2BlockNumber: l2Timestamp ?? receipt.blockNumber,
117
137
  } as GetTimeToNextL2OutputParameters)
118
138
 
139
+ const portalAddress = (() => {
140
+ if (parameters.portalAddress) return parameters.portalAddress
141
+ if (chain) return targetChain.contracts.portal[chain.id].address
142
+ return Object.values(targetChain.contracts.portal)[0].address
143
+ })()
144
+
145
+ // Super-root games anchor on L2 timestamps instead of L2 block numbers.
146
+ const l2BlockNumber = await (async () => {
147
+ if (typeof l2Timestamp === 'bigint') return l2Timestamp
148
+ const gameType = await readContract(client, {
149
+ abi: portal2Abi,
150
+ address: portalAddress,
151
+ functionName: 'respectedGameType',
152
+ })
153
+ if (!isSuperGameType(gameType)) return receipt.blockNumber
154
+ const timestamp = receipt.logs[0]?.blockTimestamp
155
+ if (typeof timestamp !== 'bigint')
156
+ throw new L2TimestampRequiredError({ gameType })
157
+ return timestamp
158
+ })()
159
+
119
160
  return getTimeToNextGame(client, {
120
161
  ...parameters,
121
- l2BlockNumber: l2Timestamp ?? receipt.blockNumber,
162
+ l2BlockNumber,
122
163
  } as GetTimeToNextGameParameters)
123
164
  }
@@ -18,9 +18,12 @@ import type { TransactionReceipt } from '../../types/transaction.js'
18
18
  import type { OneOf } from '../../types/utils.js'
19
19
  import { anchorStateRegistryAbi, portal2Abi, portalAbi } from '../abis.js'
20
20
  import {
21
+ L2TimestampRequiredError,
22
+ type L2TimestampRequiredErrorType,
21
23
  ReceiptContainsNoWithdrawalsError,
22
24
  type ReceiptContainsNoWithdrawalsErrorType,
23
25
  } from '../errors/withdrawal.js'
26
+ import { isSuperGameType } from '../gameTypes.js'
24
27
  import type { TargetChain } from '../types/chain.js'
25
28
  import type { GetContractAddressParameter } from '../types/contract.js'
26
29
  import {
@@ -106,6 +109,7 @@ export type GetWithdrawalStatusErrorType =
106
109
  | GetL2OutputErrorType
107
110
  | GetTimeToFinalizeErrorType
108
111
  | GetWithdrawalsErrorType
112
+ | L2TimestampRequiredErrorType
109
113
  | ReadContractErrorType
110
114
  | ReceiptContainsNoWithdrawalsErrorType
111
115
  | ErrorType
@@ -152,6 +156,7 @@ export async function getWithdrawalStatus<
152
156
  chain = client.chain,
153
157
  gameLimit = 100,
154
158
  receipt,
159
+ l2Timestamp,
155
160
  targetChain: targetChain_,
156
161
  logIndex = 0,
157
162
  } = parameters
@@ -165,7 +170,7 @@ export async function getWithdrawalStatus<
165
170
  })()
166
171
 
167
172
  const l2BlockNumber =
168
- parameters.l2Timestamp ?? receipt?.blockNumber ?? parameters.l2BlockNumber
173
+ l2Timestamp ?? receipt?.blockNumber ?? parameters.l2BlockNumber
169
174
 
170
175
  const withdrawal = (() => {
171
176
  if (receipt) {
@@ -254,17 +259,36 @@ export async function getWithdrawalStatus<
254
259
  args: [withdrawal.withdrawalHash, numProofSubmitters - 1n],
255
260
  }).catch(() => withdrawal.sender)
256
261
 
262
+ // Super-root games anchor on L2 timestamps instead of L2 block numbers.
263
+ // Not awaited, so a missing L2 timestamp only fails the game lookup and a
264
+ // finalized withdrawal still resolves.
265
+ const gameL2BlockNumber = (async () => {
266
+ if (typeof l2Timestamp === 'bigint') return l2Timestamp
267
+ const gameType = await readContract(client, {
268
+ abi: portal2Abi,
269
+ address: portalAddress,
270
+ functionName: 'respectedGameType',
271
+ })
272
+ if (!isSuperGameType(gameType)) return l2BlockNumber
273
+ const timestamp = receipt?.logs[0]?.blockTimestamp
274
+ if (typeof timestamp !== 'bigint')
275
+ throw new L2TimestampRequiredError({ gameType })
276
+ return timestamp
277
+ })()
278
+
257
279
  const [
258
280
  disputeGameResult,
259
281
  provenWithdrawalsResult,
260
282
  checkWithdrawalResult,
261
283
  finalizedResult,
262
284
  ] = await Promise.allSettled([
263
- getGame(client, {
264
- ...parameters,
265
- l2BlockNumber,
266
- limit: gameLimit,
267
- } as GetGameParameters),
285
+ gameL2BlockNumber.then((l2BlockNumber) =>
286
+ getGame(client, {
287
+ ...parameters,
288
+ l2BlockNumber,
289
+ limit: gameLimit,
290
+ } as GetGameParameters),
291
+ ),
268
292
  readContract(client, {
269
293
  abi: portal2Abi,
270
294
  address: portalAddress,
@@ -1,3 +1,7 @@
1
+ import {
2
+ type ReadContractErrorType,
3
+ readContract,
4
+ } from '../../actions/public/readContract.js'
1
5
  import type { Client } from '../../clients/createClient.js'
2
6
  import type { Transport } from '../../clients/transports/createTransport.js'
3
7
  import type { ErrorType } from '../../errors/utils.js'
@@ -9,7 +13,14 @@ import type {
9
13
  } from '../../types/chain.js'
10
14
  import type { TransactionReceipt } from '../../types/transaction.js'
11
15
  import type { OneOf } from '../../types/utils.js'
12
- import { ReceiptContainsNoWithdrawalsError } from '../errors/withdrawal.js'
16
+ import { portal2Abi } from '../abis.js'
17
+ import {
18
+ L2TimestampRequiredError,
19
+ type L2TimestampRequiredErrorType,
20
+ ReceiptContainsNoWithdrawalsError,
21
+ } from '../errors/withdrawal.js'
22
+ import { isSuperGameType } from '../gameTypes.js'
23
+ import type { TargetChain } from '../types/chain.js'
13
24
  import type { GetContractAddressParameter } from '../types/contract.js'
14
25
  import type { Withdrawal } from '../types/withdrawal.js'
15
26
  import {
@@ -68,6 +79,8 @@ export type WaitToProveReturnType = {
68
79
 
69
80
  export type WaitToProveErrorType =
70
81
  | GetWithdrawalsErrorType
82
+ | L2TimestampRequiredErrorType
83
+ | ReadContractErrorType
71
84
  | WaitForNextL2OutputErrorType
72
85
  | ErrorType
73
86
 
@@ -109,7 +122,15 @@ export async function waitToProve<
109
122
  client: Client<Transport, chain, account>,
110
123
  parameters: WaitToProveParameters<chain, chainOverride>,
111
124
  ): Promise<WaitToProveReturnType> {
112
- const { gameLimit, l2Timestamp, receipt } = parameters
125
+ const {
126
+ chain = client.chain,
127
+ gameLimit,
128
+ l2Timestamp,
129
+ receipt,
130
+ targetChain: targetChain_,
131
+ } = parameters
132
+
133
+ const targetChain = targetChain_ as unknown as TargetChain
113
134
 
114
135
  const [withdrawal] = getWithdrawals(receipt)
115
136
 
@@ -144,10 +165,31 @@ export async function waitToProve<
144
165
  }
145
166
  }
146
167
 
168
+ const portalAddress = (() => {
169
+ if (parameters.portalAddress) return parameters.portalAddress
170
+ if (chain) return targetChain.contracts.portal[chain.id].address
171
+ return Object.values(targetChain.contracts.portal)[0].address
172
+ })()
173
+
174
+ // Super-root games anchor on L2 timestamps instead of L2 block numbers.
175
+ const l2BlockNumber = await (async () => {
176
+ if (typeof l2Timestamp === 'bigint') return l2Timestamp
177
+ const gameType = await readContract(client, {
178
+ abi: portal2Abi,
179
+ address: portalAddress,
180
+ functionName: 'respectedGameType',
181
+ })
182
+ if (!isSuperGameType(gameType)) return receipt.blockNumber
183
+ const timestamp = receipt.logs[0]?.blockTimestamp
184
+ if (typeof timestamp !== 'bigint')
185
+ throw new L2TimestampRequiredError({ gameType })
186
+ return timestamp
187
+ })()
188
+
147
189
  const game = await waitForNextGame(client, {
148
190
  ...parameters,
149
191
  limit: gameLimit,
150
- l2BlockNumber: l2Timestamp ?? receipt.blockNumber,
192
+ l2BlockNumber,
151
193
  } as WaitForNextGameParameters)
152
194
  return {
153
195
  game,
@@ -22,3 +22,20 @@ export class ReceiptContainsNoWithdrawalsError extends BaseError {
22
22
  )
23
23
  }
24
24
  }
25
+
26
+ export type L2TimestampRequiredErrorType = L2TimestampRequiredError & {
27
+ name: 'L2TimestampRequiredError'
28
+ }
29
+ export class L2TimestampRequiredError extends BaseError {
30
+ constructor({ gameType }: { gameType: number }) {
31
+ super(
32
+ `Dispute game type ${gameType} anchors on L2 timestamps, so the L2 timestamp of the withdrawal is required.`,
33
+ {
34
+ metaMessages: [
35
+ 'Pass `l2Timestamp`, or a receipt whose logs include `blockTimestamp`.',
36
+ ],
37
+ name: 'L2TimestampRequiredError',
38
+ },
39
+ )
40
+ }
41
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.57.11",
4
+ "version": "2.57.12",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -229,7 +229,7 @@
229
229
  "@scure/bip39": "1.6.0",
230
230
  "abitype": "1.2.3",
231
231
  "isows": "1.0.7",
232
- "ox": "0.14.57",
232
+ "ox": "0.14.59",
233
233
  "ws": "8.21.0"
234
234
  },
235
235
  "license": "MIT",
package/tempo/Account.ts CHANGED
@@ -24,7 +24,6 @@ import { keccak256 } from '../utils/hash/keccak256.js'
24
24
  import { hashMessage } from '../utils/signature/hashMessage.js'
25
25
  import { hashTypedData } from '../utils/signature/hashTypedData.js'
26
26
  import type { SerializeTransactionFn } from '../utils/transaction/serializeTransaction.js'
27
- import { configurableAccountRecoveryFactory } from './Addresses.js'
28
27
  import { parseApproval } from './accounts/Signature.js'
29
28
  import type { KeyAuthorizationManager } from './KeyAuthorizationManager.js'
30
29
  import * as Transaction from './Transaction.js'
@@ -331,11 +330,7 @@ export function fromConfig(value: fromConfig.Parameters): ConfigurableAccount {
331
330
  const configInput = (() => {
332
331
  if (typeof value === 'string') return undefined
333
332
  if ('upgrade' in value) return value.upgrade
334
- const {
335
- address: _,
336
- factory: __,
337
- ...config
338
- } = value as fromConfig.InitialConfig
333
+ const { address: _, ...config } = value as fromConfig.InitialConfig
339
334
  return config
340
335
  })()
341
336
  const config = (() => {
@@ -371,9 +366,7 @@ export function fromConfig(value: fromConfig.Parameters): ConfigurableAccount {
371
366
  (() => {
372
367
  if (typeof value === 'string') return value
373
368
  if (value.address === undefined || value.address === 'infer')
374
- return AccountConfig.getAddress(config!, {
375
- factory: value.factory ?? configurableAccountRecoveryFactory,
376
- })
369
+ return AccountConfig.getAddress(config!)
377
370
  return value.address
378
371
  })(),
379
372
  )
@@ -494,11 +487,6 @@ export declare namespace fromConfig {
494
487
  export type InitialConfig = {
495
488
  /** Derives the stable account address from this initial config. */
496
489
  address?: 'infer' | undefined
497
- /**
498
- * Recovery factory used to derive the address.
499
- * @default `Addresses.configurableAccountRecoveryFactory`
500
- */
501
- factory?: Address.Address | undefined
502
490
  /** Weighted owners. */
503
491
  owners: readonly Owner[]
504
492
  /** Caller-chosen 32-byte salt. */
@@ -13,9 +13,6 @@ export const accountKeychain = '0xaAAAaaAA00000000000000000000000000000000'
13
13
  export const accountRegistrar = '0x7702ac0000000000000000000000000000000000'
14
14
  export const addressRegistry = '0xfdc0000000000000000000000000000000000000'
15
15
  export const configurableAccount = '0xAACC000000000000000000000000000000000000'
16
- /** Default configurable account recovery factory. Temporary until the production address is finalized. */
17
- export const configurableAccountRecoveryFactory =
18
- '0x7171717171717171717171717171717171717171'
19
16
  /** Current consensus committee precompile address, used with `Abis.currentCommittee` to read committee members. */
20
17
  export const currentCommittee = '0xC077e00000000000000000000000000000000000'
21
18
  export const feeManager = '0xfeec000000000000000000000000000000000000'