viem 2.57.4 → 2.57.6

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 (372) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/_cjs/actions/public/waitForTransactionReceipt.js +5 -2
  3. package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
  4. package/_cjs/actions/wallet/waitForCallsStatus.js +25 -2
  5. package/_cjs/actions/wallet/waitForCallsStatus.js.map +1 -1
  6. package/_cjs/chains/definitions/arcTestnet.js +11 -8
  7. package/_cjs/chains/definitions/arcTestnet.js.map +1 -1
  8. package/_cjs/chains/definitions/qmsTestnet.js +30 -0
  9. package/_cjs/chains/definitions/qmsTestnet.js.map +1 -0
  10. package/_cjs/chains/definitions/tempo.js +1 -1
  11. package/_cjs/chains/definitions/tempoModerato.js +2 -2
  12. package/_cjs/chains/index.js +7 -5
  13. package/_cjs/chains/index.js.map +1 -1
  14. package/_cjs/clients/transports/ipc.js +19 -10
  15. package/_cjs/clients/transports/ipc.js.map +1 -1
  16. package/_cjs/clients/transports/webSocket.js +19 -10
  17. package/_cjs/clients/transports/webSocket.js.map +1 -1
  18. package/_cjs/errors/version.js +1 -1
  19. package/_cjs/tempo/Abis.js +297 -1
  20. package/_cjs/tempo/Abis.js.map +1 -1
  21. package/_cjs/tempo/Account.js +40 -40
  22. package/_cjs/tempo/Account.js.map +1 -1
  23. package/_cjs/tempo/Addresses.js +2 -1
  24. package/_cjs/tempo/Addresses.js.map +1 -1
  25. package/_cjs/tempo/Decorator.js +9 -8
  26. package/_cjs/tempo/Decorator.js.map +1 -1
  27. package/_cjs/tempo/ExecutionError.js +95 -4
  28. package/_cjs/tempo/ExecutionError.js.map +1 -1
  29. package/_cjs/tempo/Formatters.js +8 -7
  30. package/_cjs/tempo/Formatters.js.map +1 -1
  31. package/_cjs/tempo/KeyAuthorizationManager.js +25 -16
  32. package/_cjs/tempo/KeyAuthorizationManager.js.map +1 -1
  33. package/_cjs/tempo/Relay.js +9 -4
  34. package/_cjs/tempo/Relay.js.map +1 -1
  35. package/_cjs/tempo/Transaction.js +9 -9
  36. package/_cjs/tempo/Transaction.js.map +1 -1
  37. package/_cjs/tempo/Transport.js +21 -11
  38. package/_cjs/tempo/Transport.js.map +1 -1
  39. package/_cjs/tempo/{multisig → accounts}/Config.js +8 -8
  40. package/_cjs/tempo/{multisig → accounts}/Config.js.map +1 -1
  41. package/_cjs/tempo/{multisig → accounts}/Operation.js +10 -10
  42. package/_cjs/tempo/{multisig → accounts}/Operation.js.map +1 -1
  43. package/_cjs/tempo/{multisig → accounts}/Signature.js +2 -2
  44. package/_cjs/tempo/accounts/Signature.js.map +1 -0
  45. package/_cjs/tempo/actions/accessKey.js +442 -47
  46. package/_cjs/tempo/actions/accessKey.js.map +1 -1
  47. package/_cjs/tempo/actions/{multisig.js → accounts.js} +16 -20
  48. package/_cjs/tempo/actions/accounts.js.map +1 -0
  49. package/_cjs/tempo/actions/amm.js +90 -4
  50. package/_cjs/tempo/actions/amm.js.map +1 -1
  51. package/_cjs/tempo/actions/channel.js +183 -7
  52. package/_cjs/tempo/actions/channel.js.map +1 -1
  53. package/_cjs/tempo/actions/dex.js +507 -14
  54. package/_cjs/tempo/actions/dex.js.map +1 -1
  55. package/_cjs/tempo/actions/earn/deployment.js +4 -3
  56. package/_cjs/tempo/actions/earn/deployment.js.map +1 -1
  57. package/_cjs/tempo/actions/earn.js +22 -21
  58. package/_cjs/tempo/actions/earn.js.map +1 -1
  59. package/_cjs/tempo/actions/fee.js +85 -5
  60. package/_cjs/tempo/actions/fee.js.map +1 -1
  61. package/_cjs/tempo/actions/index.js +2 -2
  62. package/_cjs/tempo/actions/index.js.map +1 -1
  63. package/_cjs/tempo/actions/nonce.js +54 -1
  64. package/_cjs/tempo/actions/nonce.js.map +1 -1
  65. package/_cjs/tempo/actions/policy.js +35 -6
  66. package/_cjs/tempo/actions/policy.js.map +1 -1
  67. package/_cjs/tempo/actions/propAmm.js +18 -8
  68. package/_cjs/tempo/actions/propAmm.js.map +1 -1
  69. package/_cjs/tempo/actions/receivePolicy.js +7 -6
  70. package/_cjs/tempo/actions/receivePolicy.js.map +1 -1
  71. package/_cjs/tempo/actions/reward.js +7 -6
  72. package/_cjs/tempo/actions/reward.js.map +1 -1
  73. package/_cjs/tempo/actions/token.js +433 -22
  74. package/_cjs/tempo/actions/token.js.map +1 -1
  75. package/_cjs/tempo/actions/validator.js +12 -11
  76. package/_cjs/tempo/actions/validator.js.map +1 -1
  77. package/_cjs/tempo/actions/virtualAddress.js +3 -2
  78. package/_cjs/tempo/actions/virtualAddress.js.map +1 -1
  79. package/_cjs/tempo/actions/zone.js +12 -11
  80. package/_cjs/tempo/actions/zone.js.map +1 -1
  81. package/_cjs/tempo/chainConfig.js +37 -37
  82. package/_cjs/tempo/chainConfig.js.map +1 -1
  83. package/_cjs/tempo/errors.js +57 -1
  84. package/_cjs/tempo/errors.js.map +1 -1
  85. package/_cjs/tempo/index.js +3 -3
  86. package/_cjs/tempo/index.js.map +1 -1
  87. package/_cjs/tempo/internal/errors.js +46 -0
  88. package/_cjs/tempo/internal/errors.js.map +1 -0
  89. package/_cjs/tempo/internal/relay/{multisig.js → accounts.js} +90 -93
  90. package/_cjs/tempo/internal/relay/accounts.js.map +1 -0
  91. package/_cjs/tempo/internal/relay/keyAuthorization.js +296 -0
  92. package/_cjs/tempo/internal/relay/keyAuthorization.js.map +1 -0
  93. package/_cjs/tempo/internal/relay/plugin.js +17 -7
  94. package/_cjs/tempo/internal/relay/plugin.js.map +1 -1
  95. package/_cjs/tempo/internal/resolveError.js +128 -0
  96. package/_cjs/tempo/internal/resolveError.js.map +1 -0
  97. package/_cjs/tempo/internal/utils.js +1 -0
  98. package/_cjs/tempo/internal/utils.js.map +1 -1
  99. package/_cjs/utils/hash/normalizeSignature.js +1 -1
  100. package/_cjs/utils/hash/normalizeSignature.js.map +1 -1
  101. package/_cjs/utils/rpc/http.js +66 -31
  102. package/_cjs/utils/rpc/http.js.map +1 -1
  103. package/_cjs/utils/rpc/socket.js +1 -1
  104. package/_cjs/utils/rpc/socket.js.map +1 -1
  105. package/_esm/actions/public/waitForTransactionReceipt.js +5 -2
  106. package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
  107. package/_esm/actions/wallet/waitForCallsStatus.js +39 -2
  108. package/_esm/actions/wallet/waitForCallsStatus.js.map +1 -1
  109. package/_esm/chains/definitions/arcTestnet.js +11 -8
  110. package/_esm/chains/definitions/arcTestnet.js.map +1 -1
  111. package/_esm/chains/definitions/qmsTestnet.js +27 -0
  112. package/_esm/chains/definitions/qmsTestnet.js.map +1 -0
  113. package/_esm/chains/definitions/tempo.js +1 -1
  114. package/_esm/chains/definitions/tempoModerato.js +2 -2
  115. package/_esm/chains/index.js +1 -0
  116. package/_esm/chains/index.js.map +1 -1
  117. package/_esm/clients/transports/ipc.js +21 -10
  118. package/_esm/clients/transports/ipc.js.map +1 -1
  119. package/_esm/clients/transports/webSocket.js +21 -10
  120. package/_esm/clients/transports/webSocket.js.map +1 -1
  121. package/_esm/errors/version.js +1 -1
  122. package/_esm/tempo/Abis.js +297 -0
  123. package/_esm/tempo/Abis.js.map +1 -1
  124. package/_esm/tempo/Account.js +42 -42
  125. package/_esm/tempo/Account.js.map +1 -1
  126. package/_esm/tempo/Addresses.js +1 -0
  127. package/_esm/tempo/Addresses.js.map +1 -1
  128. package/_esm/tempo/Client.js +3 -3
  129. package/_esm/tempo/Decorator.js +9 -8
  130. package/_esm/tempo/Decorator.js.map +1 -1
  131. package/_esm/tempo/ExecutionError.js +96 -3
  132. package/_esm/tempo/ExecutionError.js.map +1 -1
  133. package/_esm/tempo/Formatters.js +11 -10
  134. package/_esm/tempo/Formatters.js.map +1 -1
  135. package/_esm/tempo/KeyAuthorizationManager.js +58 -16
  136. package/_esm/tempo/KeyAuthorizationManager.js.map +1 -1
  137. package/_esm/tempo/Relay.js +49 -8
  138. package/_esm/tempo/Relay.js.map +1 -1
  139. package/_esm/tempo/Transaction.js +11 -11
  140. package/_esm/tempo/Transaction.js.map +1 -1
  141. package/_esm/tempo/Transport.js +22 -12
  142. package/_esm/tempo/Transport.js.map +1 -1
  143. package/_esm/tempo/{multisig → accounts}/Config.js +14 -14
  144. package/_esm/tempo/{multisig → accounts}/Config.js.map +1 -1
  145. package/_esm/tempo/{multisig → accounts}/Operation.js +17 -17
  146. package/_esm/tempo/{multisig → accounts}/Operation.js.map +1 -1
  147. package/_esm/tempo/accounts/Signature.js +9 -0
  148. package/_esm/tempo/accounts/Signature.js.map +1 -0
  149. package/_esm/tempo/actions/accessKey.js +499 -48
  150. package/_esm/tempo/actions/accessKey.js.map +1 -1
  151. package/_esm/tempo/actions/{multisig.js → accounts.js} +34 -38
  152. package/_esm/tempo/actions/accounts.js.map +1 -0
  153. package/_esm/tempo/actions/amm.js +95 -4
  154. package/_esm/tempo/actions/amm.js.map +1 -1
  155. package/_esm/tempo/actions/channel.js +191 -7
  156. package/_esm/tempo/actions/channel.js.map +1 -1
  157. package/_esm/tempo/actions/dex.js +537 -14
  158. package/_esm/tempo/actions/dex.js.map +1 -1
  159. package/_esm/tempo/actions/earn/deployment.js +4 -3
  160. package/_esm/tempo/actions/earn/deployment.js.map +1 -1
  161. package/_esm/tempo/actions/earn.js +22 -21
  162. package/_esm/tempo/actions/earn.js.map +1 -1
  163. package/_esm/tempo/actions/fee.js +90 -6
  164. package/_esm/tempo/actions/fee.js.map +1 -1
  165. package/_esm/tempo/actions/index.js +1 -1
  166. package/_esm/tempo/actions/index.js.map +1 -1
  167. package/_esm/tempo/actions/nonce.js +57 -1
  168. package/_esm/tempo/actions/nonce.js.map +1 -1
  169. package/_esm/tempo/actions/policy.js +36 -6
  170. package/_esm/tempo/actions/policy.js.map +1 -1
  171. package/_esm/tempo/actions/propAmm.js +18 -8
  172. package/_esm/tempo/actions/propAmm.js.map +1 -1
  173. package/_esm/tempo/actions/receivePolicy.js +7 -6
  174. package/_esm/tempo/actions/receivePolicy.js.map +1 -1
  175. package/_esm/tempo/actions/reward.js +7 -6
  176. package/_esm/tempo/actions/reward.js.map +1 -1
  177. package/_esm/tempo/actions/token.js +461 -22
  178. package/_esm/tempo/actions/token.js.map +1 -1
  179. package/_esm/tempo/actions/validator.js +12 -11
  180. package/_esm/tempo/actions/validator.js.map +1 -1
  181. package/_esm/tempo/actions/virtualAddress.js +3 -2
  182. package/_esm/tempo/actions/virtualAddress.js.map +1 -1
  183. package/_esm/tempo/actions/zone.js +12 -11
  184. package/_esm/tempo/actions/zone.js.map +1 -1
  185. package/_esm/tempo/chainConfig.js +38 -38
  186. package/_esm/tempo/chainConfig.js.map +1 -1
  187. package/_esm/tempo/errors.js +63 -0
  188. package/_esm/tempo/errors.js.map +1 -1
  189. package/_esm/tempo/index.js +2 -1
  190. package/_esm/tempo/index.js.map +1 -1
  191. package/_esm/tempo/internal/errors.js +51 -0
  192. package/_esm/tempo/internal/errors.js.map +1 -0
  193. package/_esm/tempo/internal/relay/{multisig.js → accounts.js} +93 -98
  194. package/_esm/tempo/internal/relay/accounts.js.map +1 -0
  195. package/_esm/tempo/internal/relay/feePayer.js +1 -1
  196. package/_esm/tempo/internal/relay/feePayer.js.map +1 -1
  197. package/_esm/tempo/internal/relay/keyAuthorization.js +334 -0
  198. package/_esm/tempo/internal/relay/keyAuthorization.js.map +1 -0
  199. package/_esm/tempo/internal/relay/plugin.js +15 -6
  200. package/_esm/tempo/internal/relay/plugin.js.map +1 -1
  201. package/_esm/tempo/internal/resolveError.js +130 -0
  202. package/_esm/tempo/internal/resolveError.js.map +1 -0
  203. package/_esm/tempo/internal/utils.js +2 -0
  204. package/_esm/tempo/internal/utils.js.map +1 -1
  205. package/_esm/utils/hash/normalizeSignature.js +3 -2
  206. package/_esm/utils/hash/normalizeSignature.js.map +1 -1
  207. package/_esm/utils/rpc/http.js +74 -31
  208. package/_esm/utils/rpc/http.js.map +1 -1
  209. package/_esm/utils/rpc/socket.js +3 -1
  210. package/_esm/utils/rpc/socket.js.map +1 -1
  211. package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
  212. package/_types/actions/wallet/waitForCallsStatus.d.ts.map +1 -1
  213. package/_types/chains/definitions/arcTestnet.d.ts +5 -5
  214. package/_types/chains/definitions/arcTestnet.d.ts.map +1 -1
  215. package/_types/chains/definitions/qmsTestnet.d.ts +50 -0
  216. package/_types/chains/definitions/qmsTestnet.d.ts.map +1 -0
  217. package/_types/chains/definitions/tempo.d.ts +2 -2
  218. package/_types/chains/definitions/tempoModerato.d.ts +4 -4
  219. package/_types/chains/index.d.ts +1 -0
  220. package/_types/chains/index.d.ts.map +1 -1
  221. package/_types/clients/transports/ipc.d.ts.map +1 -1
  222. package/_types/clients/transports/webSocket.d.ts.map +1 -1
  223. package/_types/errors/version.d.ts +1 -1
  224. package/_types/tempo/Abis.d.ts +807 -0
  225. package/_types/tempo/Abis.d.ts.map +1 -1
  226. package/_types/tempo/Account.d.ts +28 -28
  227. package/_types/tempo/Account.d.ts.map +1 -1
  228. package/_types/tempo/Addresses.d.ts +1 -0
  229. package/_types/tempo/Addresses.d.ts.map +1 -1
  230. package/_types/tempo/Client.d.ts +3 -3
  231. package/_types/tempo/Decorator.d.ts +64 -38
  232. package/_types/tempo/Decorator.d.ts.map +1 -1
  233. package/_types/tempo/ExecutionError.d.ts +3 -1
  234. package/_types/tempo/ExecutionError.d.ts.map +1 -1
  235. package/_types/tempo/Formatters.d.ts.map +1 -1
  236. package/_types/tempo/KeyAuthorizationManager.d.ts +45 -2
  237. package/_types/tempo/KeyAuthorizationManager.d.ts.map +1 -1
  238. package/_types/tempo/Relay.d.ts +62 -12
  239. package/_types/tempo/Relay.d.ts.map +1 -1
  240. package/_types/tempo/Transaction.d.ts +14 -11
  241. package/_types/tempo/Transaction.d.ts.map +1 -1
  242. package/_types/tempo/Transport.d.ts +20 -7
  243. package/_types/tempo/Transport.d.ts.map +1 -1
  244. package/_types/tempo/{multisig → accounts}/Config.d.ts +7 -7
  245. package/_types/tempo/accounts/Config.d.ts.map +1 -0
  246. package/_types/tempo/{multisig → accounts}/Operation.d.ts +7 -7
  247. package/_types/tempo/accounts/Operation.d.ts.map +1 -0
  248. package/_types/tempo/{multisig → accounts}/Signature.d.ts +1 -1
  249. package/_types/tempo/accounts/Signature.d.ts.map +1 -0
  250. package/_types/tempo/actions/accessKey.d.ts +214 -25
  251. package/_types/tempo/actions/accessKey.d.ts.map +1 -1
  252. package/_types/tempo/actions/{multisig.d.ts → accounts.d.ts} +31 -29
  253. package/_types/tempo/actions/accounts.d.ts.map +1 -0
  254. package/_types/tempo/actions/amm.d.ts +39 -0
  255. package/_types/tempo/actions/amm.d.ts.map +1 -1
  256. package/_types/tempo/actions/channel.d.ts +77 -7
  257. package/_types/tempo/actions/channel.d.ts.map +1 -1
  258. package/_types/tempo/actions/dex.d.ts +222 -16
  259. package/_types/tempo/actions/dex.d.ts.map +1 -1
  260. package/_types/tempo/actions/earn/deployment.d.ts +7 -6
  261. package/_types/tempo/actions/earn/deployment.d.ts.map +1 -1
  262. package/_types/tempo/actions/earn.d.ts +15 -14
  263. package/_types/tempo/actions/earn.d.ts.map +1 -1
  264. package/_types/tempo/actions/fee.d.ts +32 -6
  265. package/_types/tempo/actions/fee.d.ts.map +1 -1
  266. package/_types/tempo/actions/index.d.ts +1 -1
  267. package/_types/tempo/actions/index.d.ts.map +1 -1
  268. package/_types/tempo/actions/nonce.d.ts +35 -0
  269. package/_types/tempo/actions/nonce.d.ts.map +1 -1
  270. package/_types/tempo/actions/policy.d.ts +29 -8
  271. package/_types/tempo/actions/policy.d.ts.map +1 -1
  272. package/_types/tempo/actions/propAmm.d.ts +9 -1
  273. package/_types/tempo/actions/propAmm.d.ts.map +1 -1
  274. package/_types/tempo/actions/receivePolicy.d.ts +10 -6
  275. package/_types/tempo/actions/receivePolicy.d.ts.map +1 -1
  276. package/_types/tempo/actions/reward.d.ts +7 -3
  277. package/_types/tempo/actions/reward.d.ts.map +1 -1
  278. package/_types/tempo/actions/token.d.ts +200 -32
  279. package/_types/tempo/actions/token.d.ts.map +1 -1
  280. package/_types/tempo/actions/validator.d.ts +17 -5
  281. package/_types/tempo/actions/validator.d.ts.map +1 -1
  282. package/_types/tempo/actions/virtualAddress.d.ts +4 -3
  283. package/_types/tempo/actions/virtualAddress.d.ts.map +1 -1
  284. package/_types/tempo/actions/zone.d.ts +10 -9
  285. package/_types/tempo/actions/zone.d.ts.map +1 -1
  286. package/_types/tempo/errors.d.ts +63 -1
  287. package/_types/tempo/errors.d.ts.map +1 -1
  288. package/_types/tempo/index.d.ts +3 -2
  289. package/_types/tempo/index.d.ts.map +1 -1
  290. package/_types/tempo/internal/errors.d.ts +59 -0
  291. package/_types/tempo/internal/errors.d.ts.map +1 -0
  292. package/_types/tempo/internal/relay/accounts.d.ts +15 -0
  293. package/_types/tempo/internal/relay/accounts.d.ts.map +1 -0
  294. package/_types/tempo/internal/relay/keyAuthorization.d.ts +25 -0
  295. package/_types/tempo/internal/relay/keyAuthorization.d.ts.map +1 -0
  296. package/_types/tempo/internal/relay/plugin.d.ts +6 -3
  297. package/_types/tempo/internal/relay/plugin.d.ts.map +1 -1
  298. package/_types/tempo/internal/resolveError.d.ts +8 -0
  299. package/_types/tempo/internal/resolveError.d.ts.map +1 -0
  300. package/_types/tempo/internal/utils.d.ts.map +1 -1
  301. package/_types/utils/hash/normalizeSignature.d.ts.map +1 -1
  302. package/_types/utils/rpc/http.d.ts.map +1 -1
  303. package/_types/utils/rpc/socket.d.ts.map +1 -1
  304. package/actions/public/waitForTransactionReceipt.ts +8 -2
  305. package/actions/wallet/waitForCallsStatus.ts +41 -2
  306. package/chains/definitions/arcTestnet.ts +11 -8
  307. package/chains/definitions/qmsTestnet.ts +27 -0
  308. package/chains/definitions/tempo.ts +1 -1
  309. package/chains/definitions/tempoModerato.ts +2 -2
  310. package/chains/index.ts +1 -0
  311. package/clients/transports/ipc.ts +38 -29
  312. package/clients/transports/webSocket.ts +42 -33
  313. package/errors/version.ts +1 -1
  314. package/package.json +2 -2
  315. package/tempo/Abis.ts +298 -0
  316. package/tempo/Account.ts +95 -84
  317. package/tempo/Addresses.ts +1 -0
  318. package/tempo/Client.ts +3 -3
  319. package/tempo/Decorator.ts +91 -60
  320. package/tempo/ExecutionError.ts +102 -4
  321. package/tempo/Formatters.ts +14 -13
  322. package/tempo/KeyAuthorizationManager.ts +71 -19
  323. package/tempo/Relay.ts +70 -14
  324. package/tempo/Transaction.ts +31 -23
  325. package/tempo/Transport.ts +49 -21
  326. package/tempo/{multisig → accounts}/Config.ts +21 -21
  327. package/tempo/{multisig → accounts}/Operation.ts +26 -26
  328. package/tempo/{multisig → accounts}/Signature.ts +5 -3
  329. package/tempo/actions/accessKey.ts +675 -104
  330. package/tempo/actions/{multisig.ts → accounts.ts} +54 -59
  331. package/tempo/actions/amm.ts +126 -4
  332. package/tempo/actions/channel.ts +248 -14
  333. package/tempo/actions/dex.ts +599 -33
  334. package/tempo/actions/earn/deployment.ts +11 -9
  335. package/tempo/actions/earn.ts +40 -35
  336. package/tempo/actions/fee.ts +111 -9
  337. package/tempo/actions/index.ts +1 -1
  338. package/tempo/actions/nonce.ts +86 -1
  339. package/tempo/actions/policy.ts +66 -14
  340. package/tempo/actions/propAmm.ts +36 -9
  341. package/tempo/actions/receivePolicy.ts +26 -15
  342. package/tempo/actions/reward.ts +17 -9
  343. package/tempo/actions/token.ts +519 -54
  344. package/tempo/actions/validator.ts +40 -16
  345. package/tempo/actions/virtualAddress.ts +7 -5
  346. package/tempo/actions/zone.ts +25 -20
  347. package/tempo/chainConfig.ts +52 -52
  348. package/tempo/errors.ts +114 -1
  349. package/tempo/index.ts +5 -4
  350. package/tempo/internal/errors.ts +110 -0
  351. package/tempo/internal/relay/{multisig.ts → accounts.ts} +118 -118
  352. package/tempo/internal/relay/feePayer.ts +1 -1
  353. package/tempo/internal/relay/keyAuthorization.ts +415 -0
  354. package/tempo/internal/relay/plugin.ts +20 -7
  355. package/tempo/internal/resolveError.ts +169 -0
  356. package/tempo/internal/utils.ts +2 -0
  357. package/utils/hash/normalizeSignature.ts +3 -2
  358. package/utils/rpc/http.ts +76 -30
  359. package/utils/rpc/socket.ts +3 -1
  360. package/_cjs/tempo/actions/multisig.js.map +0 -1
  361. package/_cjs/tempo/internal/relay/multisig.js.map +0 -1
  362. package/_cjs/tempo/multisig/Signature.js.map +0 -1
  363. package/_esm/tempo/actions/multisig.js.map +0 -1
  364. package/_esm/tempo/internal/relay/multisig.js.map +0 -1
  365. package/_esm/tempo/multisig/Signature.js +0 -9
  366. package/_esm/tempo/multisig/Signature.js.map +0 -1
  367. package/_types/tempo/actions/multisig.d.ts.map +0 -1
  368. package/_types/tempo/internal/relay/multisig.d.ts +0 -4
  369. package/_types/tempo/internal/relay/multisig.d.ts.map +0 -1
  370. package/_types/tempo/multisig/Config.d.ts.map +0 -1
  371. package/_types/tempo/multisig/Operation.d.ts.map +0 -1
  372. package/_types/tempo/multisig/Signature.d.ts.map +0 -1
package/tempo/Relay.ts CHANGED
@@ -4,9 +4,10 @@ import type { LocalAccount } from '../accounts/types.js'
4
4
  import type { Client as Client_ } from '../clients/createClient.js'
5
5
  import { ChainNotConfiguredError } from '../clients/createClientResolver.js'
6
6
  import type { EIP1193RequestOptions } from '../types/eip1193.js'
7
+ import * as Accounts from './internal/relay/accounts.js'
7
8
  import * as Sponsorship from './internal/relay/feePayer.js'
8
9
  import * as FeeToken from './internal/relay/feeToken.js'
9
- import * as Multisig from './internal/relay/multisig.js'
10
+ import * as KeyAuthorization from './internal/relay/keyAuthorization.js'
10
11
  import * as Request_ from './internal/relay/request.js'
11
12
  import * as Simulate from './internal/relay/simulate.js'
12
13
  import * as internal from './internal/relay.js'
@@ -307,13 +308,19 @@ export declare namespace Plugin {
307
308
  }
308
309
  }
309
310
 
310
- declare const multisigBrand: unique symbol
311
+ declare const accountsBrand: unique symbol
311
312
 
312
313
  /**
313
- * Coordinates native multisig approvals using shared atomic storage.
314
+ * Serves configurable accounts using shared atomic storage.
315
+ *
316
+ * The chain stores only a commitment to each account's config, so the plugin
317
+ * records every config it relays (including configs left by `updateConfig`
318
+ * calls) and serves them through `account_getConfig`. It also collects owner
319
+ * approvals until the account's threshold is met, then submits.
314
320
  *
315
321
  * Memory storage is process-local. Independent clients and multiple server
316
- * instances must use the same persistent store to share pending approvals.
322
+ * instances must use the same persistent store to share configs and pending
323
+ * approvals.
317
324
  *
318
325
  * @example
319
326
  * ```ts
@@ -321,31 +328,31 @@ declare const multisigBrand: unique symbol
321
328
  * import { Relay, Store, withRelay } from 'viem/tempo'
322
329
  *
323
330
  * const transport = withRelay(http(), {
324
- * plugins: [Relay.multisig({ store: Store.memory() })],
331
+ * plugins: [Relay.accounts({ store: Store.memory() })],
325
332
  * })
326
333
  * ```
327
334
  *
328
335
  * @param options - Shared atomic storage.
329
- * @returns A plugin that coordinates multisig requests and forwards other calls.
336
+ * @returns A plugin that handles configurable account requests and forwards other calls.
330
337
  */
331
- export function multisig(options: multisig.Options): multisig.ReturnType {
332
- return Multisig.create(options)
338
+ export function accounts(options: accounts.Options): accounts.ReturnType {
339
+ return Accounts.create(options)
333
340
  }
334
341
 
335
- export declare namespace multisig {
336
- /** Multisig coordination options. */
342
+ export declare namespace accounts {
343
+ /** Configurable account options. */
337
344
  export type Options = {
338
- /** Store shared by multisig coordinators, with atomic compare-and-set support. */
345
+ /** Store shared by relays, with atomic compare-and-set support. */
339
346
  store: Store.Atomic
340
347
  }
341
- /** Middleware advertising native multisig coordination. */
342
- export type ReturnType = Plugin & { readonly [multisigBrand]: true }
348
+ /** Middleware advertising configurable account support. */
349
+ export type ReturnType = Plugin & { readonly [accountsBrand]: true }
343
350
  }
344
351
 
345
352
  /**
346
353
  * Sponsors transactions with a local account or an external fee-payer relay.
347
354
  *
348
- * Place multisig before this plugin and fee-token selection after it.
355
+ * Place accounts before this plugin and fee-token selection after it.
349
356
  *
350
357
  * @example
351
358
  * ```ts
@@ -400,6 +407,55 @@ export function feeToken(): Plugin {
400
407
  return FeeToken.create()
401
408
  }
402
409
 
410
+ declare const keyAuthorizationBrand: unique symbol
411
+
412
+ /**
413
+ * Stores pending key authorizations and attaches them to the next fill that needs them.
414
+ *
415
+ * Signing a key authorization with `Actions.accessKey.signAuthorization` through a
416
+ * relay with this plugin saves it with `relay_saveKeyAuthorization`. Configurable
417
+ * account key authorizations are saved once they reach quorum. The next `eth_fillTransaction`
418
+ * from the access key includes the authorization until the key is active onchain.
419
+ * Remote `withRelay` transports opt in with `keyAuthorization: true`.
420
+ *
421
+ * Place this plugin before `Relay.accounts` so it can observe completed configurable
422
+ * account key authorizations, and before plugins that read the filled transaction.
423
+ *
424
+ * A saved authorization only replaces a pending authorization that expires earlier,
425
+ * so a replayed older authorization cannot replace a newer one.
426
+ *
427
+ * Memory storage is process-local. Multiple server instances must use the same
428
+ * persistent atomic store to share pending authorizations.
429
+ *
430
+ * @example
431
+ * ```ts
432
+ * import { http } from 'viem'
433
+ * import { Relay, Store, withRelay } from 'viem/tempo'
434
+ *
435
+ * const transport = withRelay(http(), {
436
+ * plugins: [Relay.keyAuthorization({ store: Store.memory() })],
437
+ * })
438
+ * ```
439
+ *
440
+ * @param options - Pending key authorization storage.
441
+ * @returns A plugin that stores and attaches pending key authorizations.
442
+ */
443
+ export function keyAuthorization(
444
+ options: keyAuthorization.Options = {},
445
+ ): keyAuthorization.ReturnType {
446
+ return KeyAuthorization.create(options)
447
+ }
448
+
449
+ export declare namespace keyAuthorization {
450
+ /** Key authorization storage options. */
451
+ export type Options = {
452
+ /** Store for pending key authorizations, with atomic compare-and-set support. Defaults to a process-local memory store. */
453
+ store?: Store.Atomic | undefined
454
+ }
455
+ /** Middleware advertising pending key authorization storage. */
456
+ export type ReturnType = Plugin & { readonly [keyAuthorizationBrand]: true }
457
+ }
458
+
403
459
  /**
404
460
  * Adds balance changes, estimated fees, and execution errors to fill capabilities.
405
461
  *
@@ -4,11 +4,11 @@ import type { Address } from 'abitype'
4
4
  import * as Hex from 'ox/Hex'
5
5
  import * as Signature from 'ox/Signature'
6
6
  import {
7
+ AccountConfig,
8
+ type AccountOperation,
9
+ type AccountSimulation,
7
10
  type AuthorizationTempo,
8
11
  type KeyAuthorization,
9
- MultisigConfig,
10
- type MultisigOperation,
11
- type MultisigSimulation,
12
12
  type TransactionReceipt as ox_TransactionReceipt,
13
13
  SignatureEnvelope,
14
14
  type TempoAddress,
@@ -43,7 +43,7 @@ import {
43
43
  } from '../utils/transaction/parseTransaction.js'
44
44
  import { serializeTransaction as viem_serializeTransaction } from '../utils/transaction/serializeTransaction.js'
45
45
  import type { RootAccount } from './Account.js'
46
- import { parseApproval } from './multisig/Signature.js'
46
+ import { parseApproval } from './accounts/Signature.js'
47
47
 
48
48
  export type Transaction<
49
49
  bigintType = bigint,
@@ -61,7 +61,7 @@ export type TransactionRpc<pending extends boolean = false> = OneOf<
61
61
  > & {
62
62
  authorizationList?: AuthorizationTempo.ListRpc | undefined
63
63
  keyAuthorization?: KeyAuthorization.Rpc | null | undefined
64
- multisig?: MultisigOperation.TransactionRpc | undefined
64
+ operation?: AccountOperation.TransactionRpc | undefined
65
65
  signature: SignatureEnvelope.SignatureEnvelopeRpc
66
66
  })
67
67
  >
@@ -82,7 +82,7 @@ export type TransactionTempo<
82
82
  feeToken?: Address | undefined
83
83
  feePayerSignature?: viem_Signature | undefined
84
84
  keyAuthorization?: KeyAuthorization.Signed<quantity, index> | null | undefined
85
- multisig?: MultisigOperation.TransactionOperation | undefined
85
+ operation?: AccountOperation.TransactionOperation | undefined
86
86
  nonceKey?: quantity | undefined
87
87
  signature: SignatureEnvelope.SignatureEnvelope
88
88
  type: type
@@ -98,7 +98,14 @@ export type TransactionRequest<
98
98
  | TransactionRequestTempo<bigintType, numberType>
99
99
  >
100
100
  export type TransactionRequestRpc = OneOf<
101
- viem_RpcTransactionRequest | TransactionRequestTempo<Hex.Hex, Hex.Hex, '0x76'>
101
+ | viem_RpcTransactionRequest
102
+ | (Omit<
103
+ TransactionRequestTempo<Hex.Hex, Hex.Hex, '0x76'>,
104
+ 'accountSimulation'
105
+ > & {
106
+ /** Account simulation spec, named `multisigSimulation` by the node. */
107
+ multisigSimulation?: AccountSimulation.Rpc | undefined
108
+ })
102
109
  >
103
110
 
104
111
  export type TransactionReceipt<
@@ -106,11 +113,11 @@ export type TransactionReceipt<
106
113
  index = number,
107
114
  status = 'success' | 'reverted' | 'pending',
108
115
  type = TransactionType,
109
- multisig = MultisigOperation.TransactionOperation,
116
+ operation = AccountOperation.TransactionOperation,
110
117
  > = viem_TransactionReceipt<quantity, index, status, type> & {
111
118
  feePayer?: Address | undefined
112
119
  feeToken?: Address | undefined
113
- multisig?: multisig | undefined
120
+ operation?: operation | undefined
114
121
  }
115
122
 
116
123
  export type TransactionReceiptRpc = TransactionReceipt<
@@ -118,7 +125,7 @@ export type TransactionReceiptRpc = TransactionReceipt<
118
125
  Hex.Hex,
119
126
  ox_TransactionReceipt.RpcStatus | 'pending',
120
127
  ox_TransactionReceipt.RpcType,
121
- MultisigOperation.TransactionRpc
128
+ AccountOperation.TransactionRpc
122
129
  >
123
130
 
124
131
  export type TransactionRequestTempo<
@@ -128,6 +135,7 @@ export type TransactionRequestTempo<
128
135
  > = TransactionRequestBase<quantity, index, type> &
129
136
  ExactPartial<FeeValuesEIP1559<quantity>> & {
130
137
  accessList?: AccessList | undefined
138
+ accountSimulation?: AccountSimulation.Spec | undefined
131
139
  calls?: readonly TxTempo.Call<quantity, TempoAddress.Address>[] | undefined
132
140
  capabilities?: ExtractCapabilities<'fillTransaction', 'Request'> | undefined
133
141
  /** Fee-payer account, external relay URL, or sponsorship preference. */
@@ -135,7 +143,6 @@ export type TransactionRequestTempo<
135
143
  feeToken?: TempoAddress.Address | bigint | undefined
136
144
  hash?: Hex.Hex | undefined
137
145
  keyAuthorization?: KeyAuthorization.Signed<quantity, index> | undefined
138
- multisigSimulation?: MultisigSimulation.Spec | undefined
139
146
  /** Nonce lane, or `'expiring'` for time-bounded transactions. `nonce` can distinguish otherwise identical expiring transactions. */
140
147
  nonceKey?: 'expiring' | quantity | undefined
141
148
  owner?: RootAccount | undefined
@@ -168,17 +175,17 @@ export type TransactionSerializableTempo<
168
175
  } & (
169
176
  | {
170
177
  from: Address
171
- multisigSimulation?: MultisigSimulation.Spec | undefined
178
+ accountSimulation?: AccountSimulation.Spec | undefined
172
179
  signatures?: readonly SignatureEnvelope.Serialized[] | undefined
173
180
  }
174
181
  | {
175
182
  from?: Address | undefined
176
- multisigSimulation?: undefined
183
+ accountSimulation?: undefined
177
184
  signatures?: readonly SignatureEnvelope.Serialized[] | undefined
178
185
  }
179
186
  | {
180
187
  from?: Address | undefined
181
- multisigSimulation?: MultisigSimulation.Spec | undefined
188
+ accountSimulation?: AccountSimulation.Spec | undefined
182
189
  signatures?: undefined
183
190
  }
184
191
  )
@@ -201,13 +208,13 @@ export function getType(
201
208
  if (
202
209
  (account?.keyType && account.keyType !== 'secp256k1') ||
203
210
  account?.source === 'accessKey' ||
204
- account?.source === 'multisig' ||
211
+ account?.source === 'configurable' ||
205
212
  typeof transaction.calls !== 'undefined' ||
206
213
  typeof transaction.feePayer !== 'undefined' ||
207
214
  typeof transaction.feePayerSignature !== 'undefined' ||
208
215
  typeof transaction.feeToken !== 'undefined' ||
209
216
  typeof transaction.keyAuthorization !== 'undefined' ||
210
- typeof transaction.multisigSimulation !== 'undefined' ||
217
+ typeof transaction.accountSimulation !== 'undefined' ||
211
218
  typeof transaction.nonceKey !== 'undefined' ||
212
219
  typeof transaction.owner !== 'undefined' ||
213
220
  typeof transaction.signature !== 'undefined' ||
@@ -314,7 +321,7 @@ async function serializeTempo(
314
321
  },
315
322
  sig?: OneOf<SignatureEnvelope.SignatureEnvelope | viem_Signature> | undefined,
316
323
  ) {
317
- // Track caller signatures separately from synthesized multisig approvals.
324
+ // Track caller signatures separately from synthesized owner approvals.
318
325
  const signature_provided = (() => {
319
326
  if (transaction.signature) return transaction.signature
320
327
  if (sig && 'type' in sig) return sig as SignatureEnvelope.SignatureEnvelope
@@ -330,7 +337,7 @@ async function serializeTempo(
330
337
  const {
331
338
  chainId,
332
339
  feePayer,
333
- multisigSimulation,
340
+ accountSimulation,
334
341
  nonce,
335
342
  owner: _owner,
336
343
  ...rest
@@ -352,7 +359,7 @@ async function serializeTempo(
352
359
  transaction.feePayerSignature !== null
353
360
  const hasSenderSignature =
354
361
  typeof signature_provided !== 'undefined' ||
355
- Boolean(multisigSimulation && transaction.signatures)
362
+ Boolean(accountSimulation && transaction.signatures)
356
363
  // Sponsorship sender signatures omit `feeToken`.
357
364
  const shouldStripFeeTokenForSponsorship =
358
365
  // Relay fills a partial sender envelope first.
@@ -393,16 +400,17 @@ async function serializeTempo(
393
400
  // Combine owner approvals before fee-payer handling.
394
401
  const signature = (() => {
395
402
  if (signature_provided) return signature_provided
396
- if (!multisigSimulation || !transaction.signatures) return undefined
403
+ if (!accountSimulation || !transaction.signatures) return undefined
397
404
 
398
405
  const payload = TxTempo.getSignPayload(TxTempo.from(transaction_sender_ox))
399
406
  const signatures = transaction.signatures.map((approval) =>
400
407
  parseApproval(approval),
401
408
  )
402
- const config = MultisigConfig.from(multisigSimulation.config)
409
+ const config = AccountConfig.from(accountSimulation.config)
403
410
  const account = transaction.from
404
- if (!account) throw new Error('A multisig sender is required for signing.')
405
- const sorted = SignatureEnvelope.sortMultisigApprovals({
411
+ if (!account)
412
+ throw new Error('A configurable account sender is required for signing.')
413
+ const sorted = SignatureEnvelope.sortApprovals({
406
414
  account,
407
415
  config,
408
416
  payload,
@@ -86,7 +86,7 @@ type RelayProxyParameters = {
86
86
  }
87
87
 
88
88
  export type FeePayer = Transport<typeof withFeePayer.type>
89
- export type Relay = Transport<typeof withRelay.type, { multisig: true }>
89
+ export type Relay = Transport<typeof withRelay.type, { accounts: true }>
90
90
 
91
91
  /**
92
92
  * Creates a relay transport that routes requests between
@@ -94,8 +94,10 @@ export type Relay = Transport<typeof withRelay.type, { multisig: true }>
94
94
  *
95
95
  * All `eth_fillTransaction` requests are sent to the relay with the request's
96
96
  * `feePayer` value preserved so the relay can decide whether to sponsor the transaction.
97
- * Multisig approvals, configs, operations, and operation-aware transaction
97
+ * Owner approvals, configs, operations, and operation-aware transaction
98
98
  * lookups are also sent to the relay so it can coordinate approvals in its store.
99
+ * Signed key authorizations are saved to relays with key authorization storage
100
+ * so they can attach them to the access key's next transaction.
99
101
  *
100
102
  * The policy parameter controls how the relay handles sponsored transactions:
101
103
  * - `'sign-only'`: Relay co-signs the transaction and returns it to the client transport, which then broadcasts it via the default transport
@@ -116,11 +118,11 @@ export function withRelay<
116
118
  defaultTransport: transport,
117
119
  options: withRelay.LocalOptions<plugins>,
118
120
  ): withRelay.LocalReturnValue<transport, plugins>
119
- export function withRelay(
121
+ export function withRelay<const parameters extends withRelay.Parameters = {}>(
120
122
  defaultTransport: Transport,
121
123
  relayTransport: Transport,
122
- parameters?: withRelay.Parameters,
123
- ): withRelay.ReturnValue
124
+ parameters?: parameters | withRelay.Parameters,
125
+ ): withRelay.ReturnValue<parameters>
124
126
  export function withRelay(
125
127
  defaultTransport: Transport,
126
128
  relayTransport: Transport | withRelay.LocalOptions,
@@ -145,14 +147,17 @@ export function withRelay(
145
147
  })) as typeof transport.request,
146
148
  value: {
147
149
  ...transport.value,
148
- ...(relayTransport.plugins?.some(Plugin_.isMultisig)
149
- ? { multisig: true }
150
+ ...(relayTransport.plugins?.some(Plugin_.isAccounts)
151
+ ? { accounts: true }
152
+ : {}),
153
+ ...(relayTransport.plugins?.some(Plugin_.isKeyAuthorization)
154
+ ? { keyAuthorization: true }
150
155
  : {}),
151
156
  },
152
157
  }
153
158
  }
154
159
 
155
- const { policy = 'sign-only' } = parameters ?? {}
160
+ const { keyAuthorization, policy = 'sign-only' } = parameters ?? {}
156
161
 
157
162
  return (config) => {
158
163
  const transport_default = defaultTransport(config)
@@ -179,7 +184,7 @@ export function withRelay(
179
184
  const operation = await (async () => {
180
185
  try {
181
186
  return await transport_relay.request(
182
- { method: 'multisig_getOperation', params },
187
+ { method: 'account_getOperation', params },
183
188
  options,
184
189
  )
185
190
  } catch (error) {
@@ -187,7 +192,7 @@ export function withRelay(
187
192
  error instanceof MethodNotFoundRpcError ||
188
193
  error instanceof MethodNotSupportedRpcError
189
194
  ) {
190
- // Relays created before multisig coordination do not expose this method.
195
+ // Relays without the accounts plugin do not expose this method.
191
196
  return null
192
197
  }
193
198
  throw error
@@ -204,11 +209,12 @@ export function withRelay(
204
209
  }
205
210
 
206
211
  if (
207
- method === 'multisig_approveKeyAuthorization' ||
208
- method === 'multisig_approveRawTransaction' ||
209
- method === 'multisig_approveRawTransactionSync' ||
210
- method === 'multisig_getConfig' ||
211
- method === 'multisig_getOperation'
212
+ method === 'account_approveKeyAuthorization' ||
213
+ method === 'account_approveRawTransaction' ||
214
+ method === 'account_approveRawTransactionSync' ||
215
+ method === 'account_getConfig' ||
216
+ method === 'account_getOperation' ||
217
+ method === 'relay_saveKeyAuthorization'
212
218
  )
213
219
  return transport_relay.request({ method, params }, options) as never
214
220
 
@@ -219,7 +225,7 @@ export function withRelay(
219
225
  const serialized = (params as any)[0] as `0x76${string}`
220
226
  const transaction = Transaction.deserialize(serialized)
221
227
 
222
- if (transaction.signature?.type === 'multisig')
228
+ if (transaction.signature?.type === 'configurable')
223
229
  return transport_relay.request({ method, params }, options) as never
224
230
 
225
231
  // Serialized Tempo envelopes encode `feePayer: true` as a missing fee payer
@@ -259,14 +265,23 @@ export function withRelay(
259
265
  },
260
266
  type: withRelay.type,
261
267
  })
262
- return { ...transport, value: { multisig: true } }
268
+ return {
269
+ ...transport,
270
+ value: {
271
+ accounts: true,
272
+ ...(keyAuthorization ? { keyAuthorization } : {}),
273
+ },
274
+ }
263
275
  }
264
276
  }
265
277
 
266
278
  export declare namespace withRelay {
267
279
  export const type = 'relay'
268
280
 
269
- export type Parameters = RelayProxyParameters
281
+ export type Parameters = RelayProxyParameters & {
282
+ /** Whether the relay stores key authorizations with `Relay.keyAuthorization`. Defaults to `false`. */
283
+ keyAuthorization?: boolean | undefined
284
+ }
270
285
 
271
286
  /** Plugins applied directly to the default transport. */
272
287
  export type LocalOptions<
@@ -284,14 +299,27 @@ export declare namespace withRelay {
284
299
  ? Transport<
285
300
  type,
286
301
  attributes &
287
- (Extract<plugins[number], Relay_.multisig.ReturnType> extends never
302
+ (Extract<plugins[number], Relay_.accounts.ReturnType> extends never
303
+ ? {}
304
+ : { accounts: true }) &
305
+ (Extract<
306
+ plugins[number],
307
+ Relay_.keyAuthorization.ReturnType
308
+ > extends never
288
309
  ? {}
289
- : { multisig: true }),
310
+ : { keyAuthorization: true }),
290
311
  request
291
312
  >
292
313
  : never
293
314
 
294
- export type ReturnValue = Relay
315
+ /** Remote relay transport, advertising key authorization storage when enabled. */
316
+ export type ReturnValue<parameters extends Parameters = {}> =
317
+ parameters extends { keyAuthorization: true }
318
+ ? Transport<
319
+ typeof withRelay.type,
320
+ { accounts: true; keyAuthorization: true }
321
+ >
322
+ : Relay
295
323
  }
296
324
 
297
325
  /** @deprecated Use `withRelay` instead. */
@@ -2,7 +2,7 @@ import * as Address from 'ox/Address'
2
2
  import * as Hash from 'ox/Hash'
3
3
  import type * as Hex from 'ox/Hex'
4
4
  import * as Json from 'ox/Json'
5
- import { MultisigConfig } from 'ox/tempo'
5
+ import { AccountConfig } from 'ox/tempo'
6
6
  import { BaseError } from '../../errors/base.js'
7
7
  import { nativeMultisigFactory } from '../Addresses.js'
8
8
  import type * as Store from '../Store.js'
@@ -13,11 +13,11 @@ const maxStoredValueLength = 65_536
13
13
  /** Zero commitment used before an account is initialized. */
14
14
  const zeroCommitment = `0x${'00'.repeat(32)}` as const
15
15
 
16
- /** Reads a cached multisig config. */
16
+ /** Reads a cached account config. */
17
17
  export async function read(
18
18
  store: Store.Store,
19
19
  options: read.Options,
20
- ): Promise<MultisigConfig.Config | null> {
20
+ ): Promise<AccountConfig.Config | null> {
21
21
  const { address, commitment } = options
22
22
  const value = await store.getItem(key({ address, commitment }))
23
23
  if (value === null || value === undefined) return null
@@ -29,27 +29,27 @@ export async function read(
29
29
  export declare namespace read {
30
30
  /** Parameters for {@link read}. */
31
31
  export type Options = {
32
- /** Multisig account address. */
32
+ /** Configurable account address. */
33
33
  address: Address.Address
34
34
  /** Config commitment observed onchain. */
35
35
  commitment: Hex.Hex
36
36
  }
37
37
  }
38
38
 
39
- /** Writes a validated multisig config. */
39
+ /** Writes a validated account config. */
40
40
  export async function write(
41
41
  store: Store.Store,
42
42
  options: write.Options,
43
43
  ): Promise<void> {
44
44
  const { address, commitment } = options
45
- const config = MultisigConfig.from(options.config)
45
+ const config = AccountConfig.from(options.config)
46
46
  assertKey({ address, commitment, config })
47
47
  const value = serialize(config)
48
48
  await store.setItem(key({ address, commitment }), value)
49
49
  // Initialization commits the version-zero config without changing its version.
50
50
  if (commitment.toLowerCase() === zeroCommitment)
51
51
  await store.setItem(
52
- key({ address, commitment: MultisigConfig.getCommitment(config) }),
52
+ key({ address, commitment: AccountConfig.getCommitment(config) }),
53
53
  value,
54
54
  )
55
55
  }
@@ -57,12 +57,12 @@ export async function write(
57
57
  export declare namespace write {
58
58
  /** Parameters for {@link write}. */
59
59
  export type Options = {
60
- /** Multisig account address. */
60
+ /** Configurable account address. */
61
61
  address: Address.Address
62
62
  /** Config commitment used for lookup. */
63
63
  commitment: Hex.Hex
64
64
  /** Complete config. */
65
- config: MultisigConfig.Config
65
+ config: AccountConfig.Config
66
66
  }
67
67
  }
68
68
 
@@ -70,7 +70,7 @@ export declare namespace write {
70
70
  function assertKey(options: {
71
71
  address: Address.Address
72
72
  commitment: Hex.Hex
73
- config: MultisigConfig.Config
73
+ config: AccountConfig.Config
74
74
  }) {
75
75
  const { address, commitment, config } = options
76
76
  if (!Address.validate(address) || !Hash.validate(commitment))
@@ -78,7 +78,7 @@ function assertKey(options: {
78
78
  if (config.version === 0n) {
79
79
  if (
80
80
  !Address.isEqual(
81
- MultisigConfig.getAddress(config, { factory: nativeMultisigFactory }),
81
+ AccountConfig.getAddress(config, { factory: nativeMultisigFactory }),
82
82
  address,
83
83
  )
84
84
  )
@@ -86,17 +86,17 @@ function assertKey(options: {
86
86
  if (commitment.toLowerCase() === zeroCommitment) return
87
87
  }
88
88
  if (
89
- MultisigConfig.getCommitment(config).toLowerCase() !==
89
+ AccountConfig.getCommitment(config).toLowerCase() !==
90
90
  commitment.toLowerCase()
91
91
  )
92
92
  throw new InvalidStoreValueError()
93
93
  }
94
94
 
95
- /** Deserializes a multisig config from storage. */
96
- function deserialize(value: string): MultisigConfig.Config {
95
+ /** Deserializes an account config from storage. */
96
+ function deserialize(value: string): AccountConfig.Config {
97
97
  try {
98
98
  if (value.length > maxStoredValueLength) throw new InvalidStoreValueError()
99
- return MultisigConfig.fromRpc(Json.parse(value) as never)
99
+ return AccountConfig.fromRpc(Json.parse(value) as never)
100
100
  } catch (cause) {
101
101
  if (cause instanceof InvalidStoreValueError) throw cause
102
102
  throw new InvalidStoreValueError({ cause })
@@ -109,10 +109,10 @@ function key(options: { address: Address.Address; commitment: Hex.Hex }) {
109
109
  return `multisig:config:${address.toLowerCase()}:${commitment.toLowerCase()}`
110
110
  }
111
111
 
112
- /** Serializes a multisig config for storage. */
113
- function serialize(config: MultisigConfig.Config): string {
112
+ /** Serializes an account config for storage. */
113
+ function serialize(config: AccountConfig.Config): string {
114
114
  try {
115
- const value = Json.stringify(MultisigConfig.toRpc(config))
115
+ const value = Json.stringify(AccountConfig.toRpc(config))
116
116
  if (value.length > maxStoredValueLength) throw new InvalidStoreValueError()
117
117
  return value
118
118
  } catch (cause) {
@@ -121,14 +121,14 @@ function serialize(config: MultisigConfig.Config): string {
121
121
  }
122
122
  }
123
123
 
124
- /** Thrown when a stored multisig config is malformed or mismatched. */
124
+ /** Thrown when a stored account config is malformed or mismatched. */
125
125
  // biome-ignore lint/correctness/noUnusedVariables: declaration merge
126
126
  class InvalidStoreValueError extends BaseError {
127
127
  /** Creates an invalid store value error. */
128
128
  constructor(options: InvalidStoreValueError.Options = {}) {
129
- super('Stored multisig config is malformed or mismatched.', {
129
+ super('Stored account config is malformed or mismatched.', {
130
130
  cause: options.cause as Error | undefined,
131
- name: 'Multisig.Config.InvalidStoreValueError',
131
+ name: 'Accounts.Config.InvalidStoreValueError',
132
132
  })
133
133
  }
134
134
  }