viem 2.57.3 → 2.57.5

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 (246) 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 +216 -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 +1 -1
  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/Selectors.js +13 -1
  36. package/_cjs/tempo/Selectors.js.map +1 -1
  37. package/_cjs/tempo/Transaction.js +9 -9
  38. package/_cjs/tempo/Transaction.js.map +1 -1
  39. package/_cjs/tempo/Transport.js +21 -11
  40. package/_cjs/tempo/Transport.js.map +1 -1
  41. package/_cjs/tempo/{multisig → accounts}/Config.js +8 -8
  42. package/_cjs/tempo/{multisig → accounts}/Config.js.map +1 -1
  43. package/_cjs/tempo/{multisig → accounts}/Operation.js +10 -10
  44. package/_cjs/tempo/{multisig → accounts}/Operation.js.map +1 -1
  45. package/_cjs/tempo/{multisig → accounts}/Signature.js +2 -2
  46. package/_cjs/tempo/accounts/Signature.js.map +1 -0
  47. package/_cjs/tempo/actions/accessKey.js +60 -37
  48. package/_cjs/tempo/actions/accessKey.js.map +1 -1
  49. package/_cjs/tempo/actions/{multisig.js → accounts.js} +13 -18
  50. package/_cjs/tempo/actions/accounts.js.map +1 -0
  51. package/_cjs/tempo/actions/index.js +2 -2
  52. package/_cjs/tempo/actions/index.js.map +1 -1
  53. package/_cjs/tempo/chainConfig.js +37 -37
  54. package/_cjs/tempo/chainConfig.js.map +1 -1
  55. package/_cjs/tempo/index.js +3 -3
  56. package/_cjs/tempo/index.js.map +1 -1
  57. package/_cjs/tempo/internal/relay/{multisig.js → accounts.js} +90 -93
  58. package/_cjs/tempo/internal/relay/accounts.js.map +1 -0
  59. package/_cjs/tempo/internal/relay/keyAuthorization.js +296 -0
  60. package/_cjs/tempo/internal/relay/keyAuthorization.js.map +1 -0
  61. package/_cjs/tempo/internal/relay/plugin.js +17 -7
  62. package/_cjs/tempo/internal/relay/plugin.js.map +1 -1
  63. package/_cjs/utils/hash/normalizeSignature.js +1 -1
  64. package/_cjs/utils/hash/normalizeSignature.js.map +1 -1
  65. package/_cjs/utils/rpc/http.js +66 -31
  66. package/_cjs/utils/rpc/http.js.map +1 -1
  67. package/_cjs/utils/rpc/socket.js +1 -1
  68. package/_cjs/utils/rpc/socket.js.map +1 -1
  69. package/_esm/actions/public/waitForTransactionReceipt.js +5 -2
  70. package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
  71. package/_esm/actions/wallet/waitForCallsStatus.js +39 -2
  72. package/_esm/actions/wallet/waitForCallsStatus.js.map +1 -1
  73. package/_esm/chains/definitions/arcTestnet.js +11 -8
  74. package/_esm/chains/definitions/arcTestnet.js.map +1 -1
  75. package/_esm/chains/definitions/qmsTestnet.js +27 -0
  76. package/_esm/chains/definitions/qmsTestnet.js.map +1 -0
  77. package/_esm/chains/definitions/tempo.js +1 -1
  78. package/_esm/chains/definitions/tempoModerato.js +2 -2
  79. package/_esm/chains/index.js +1 -0
  80. package/_esm/chains/index.js.map +1 -1
  81. package/_esm/clients/transports/ipc.js +21 -10
  82. package/_esm/clients/transports/ipc.js.map +1 -1
  83. package/_esm/clients/transports/webSocket.js +21 -10
  84. package/_esm/clients/transports/webSocket.js.map +1 -1
  85. package/_esm/errors/version.js +1 -1
  86. package/_esm/tempo/Abis.js +216 -0
  87. package/_esm/tempo/Abis.js.map +1 -1
  88. package/_esm/tempo/Account.js +42 -42
  89. package/_esm/tempo/Account.js.map +1 -1
  90. package/_esm/tempo/Addresses.js +1 -0
  91. package/_esm/tempo/Addresses.js.map +1 -1
  92. package/_esm/tempo/Client.js +3 -3
  93. package/_esm/tempo/Decorator.js +9 -8
  94. package/_esm/tempo/Decorator.js.map +1 -1
  95. package/_esm/tempo/ExecutionError.js +1 -1
  96. package/_esm/tempo/ExecutionError.js.map +1 -1
  97. package/_esm/tempo/Formatters.js +11 -10
  98. package/_esm/tempo/Formatters.js.map +1 -1
  99. package/_esm/tempo/KeyAuthorizationManager.js +58 -16
  100. package/_esm/tempo/KeyAuthorizationManager.js.map +1 -1
  101. package/_esm/tempo/Relay.js +49 -8
  102. package/_esm/tempo/Relay.js.map +1 -1
  103. package/_esm/tempo/Selectors.js +12 -0
  104. package/_esm/tempo/Selectors.js.map +1 -1
  105. package/_esm/tempo/Transaction.js +11 -11
  106. package/_esm/tempo/Transaction.js.map +1 -1
  107. package/_esm/tempo/Transport.js +22 -12
  108. package/_esm/tempo/Transport.js.map +1 -1
  109. package/_esm/tempo/{multisig → accounts}/Config.js +14 -14
  110. package/_esm/tempo/{multisig → accounts}/Config.js.map +1 -1
  111. package/_esm/tempo/{multisig → accounts}/Operation.js +17 -17
  112. package/_esm/tempo/{multisig → accounts}/Operation.js.map +1 -1
  113. package/_esm/tempo/accounts/Signature.js +9 -0
  114. package/_esm/tempo/accounts/Signature.js.map +1 -0
  115. package/_esm/tempo/actions/accessKey.js +93 -38
  116. package/_esm/tempo/actions/accessKey.js.map +1 -1
  117. package/_esm/tempo/actions/{multisig.js → accounts.js} +31 -36
  118. package/_esm/tempo/actions/accounts.js.map +1 -0
  119. package/_esm/tempo/actions/index.js +1 -1
  120. package/_esm/tempo/actions/index.js.map +1 -1
  121. package/_esm/tempo/chainConfig.js +38 -38
  122. package/_esm/tempo/chainConfig.js.map +1 -1
  123. package/_esm/tempo/index.js +2 -1
  124. package/_esm/tempo/index.js.map +1 -1
  125. package/_esm/tempo/internal/relay/{multisig.js → accounts.js} +93 -98
  126. package/_esm/tempo/internal/relay/accounts.js.map +1 -0
  127. package/_esm/tempo/internal/relay/feePayer.js +1 -1
  128. package/_esm/tempo/internal/relay/feePayer.js.map +1 -1
  129. package/_esm/tempo/internal/relay/keyAuthorization.js +334 -0
  130. package/_esm/tempo/internal/relay/keyAuthorization.js.map +1 -0
  131. package/_esm/tempo/internal/relay/plugin.js +15 -6
  132. package/_esm/tempo/internal/relay/plugin.js.map +1 -1
  133. package/_esm/utils/hash/normalizeSignature.js +3 -2
  134. package/_esm/utils/hash/normalizeSignature.js.map +1 -1
  135. package/_esm/utils/rpc/http.js +74 -31
  136. package/_esm/utils/rpc/http.js.map +1 -1
  137. package/_esm/utils/rpc/socket.js +3 -1
  138. package/_esm/utils/rpc/socket.js.map +1 -1
  139. package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
  140. package/_types/actions/wallet/waitForCallsStatus.d.ts.map +1 -1
  141. package/_types/chains/definitions/arcTestnet.d.ts +5 -5
  142. package/_types/chains/definitions/arcTestnet.d.ts.map +1 -1
  143. package/_types/chains/definitions/qmsTestnet.d.ts +50 -0
  144. package/_types/chains/definitions/qmsTestnet.d.ts.map +1 -0
  145. package/_types/chains/definitions/tempo.d.ts +2 -2
  146. package/_types/chains/definitions/tempoModerato.d.ts +4 -4
  147. package/_types/chains/index.d.ts +1 -0
  148. package/_types/chains/index.d.ts.map +1 -1
  149. package/_types/clients/transports/ipc.d.ts.map +1 -1
  150. package/_types/clients/transports/webSocket.d.ts.map +1 -1
  151. package/_types/errors/version.d.ts +1 -1
  152. package/_types/tempo/Abis.d.ts +1935 -899
  153. package/_types/tempo/Abis.d.ts.map +1 -1
  154. package/_types/tempo/Account.d.ts +28 -28
  155. package/_types/tempo/Account.d.ts.map +1 -1
  156. package/_types/tempo/Addresses.d.ts +1 -0
  157. package/_types/tempo/Addresses.d.ts.map +1 -1
  158. package/_types/tempo/Client.d.ts +3 -3
  159. package/_types/tempo/Decorator.d.ts +63 -37
  160. package/_types/tempo/Decorator.d.ts.map +1 -1
  161. package/_types/tempo/Formatters.d.ts.map +1 -1
  162. package/_types/tempo/KeyAuthorizationManager.d.ts +45 -2
  163. package/_types/tempo/KeyAuthorizationManager.d.ts.map +1 -1
  164. package/_types/tempo/Relay.d.ts +62 -12
  165. package/_types/tempo/Relay.d.ts.map +1 -1
  166. package/_types/tempo/Selectors.d.ts +12 -0
  167. package/_types/tempo/Selectors.d.ts.map +1 -1
  168. package/_types/tempo/Transaction.d.ts +14 -11
  169. package/_types/tempo/Transaction.d.ts.map +1 -1
  170. package/_types/tempo/Transport.d.ts +20 -7
  171. package/_types/tempo/Transport.d.ts.map +1 -1
  172. package/_types/tempo/{multisig → accounts}/Config.d.ts +7 -7
  173. package/_types/tempo/accounts/Config.d.ts.map +1 -0
  174. package/_types/tempo/{multisig → accounts}/Operation.d.ts +7 -7
  175. package/_types/tempo/accounts/Operation.d.ts.map +1 -0
  176. package/_types/tempo/{multisig → accounts}/Signature.d.ts +1 -1
  177. package/_types/tempo/accounts/Signature.d.ts.map +1 -0
  178. package/_types/tempo/actions/accessKey.d.ts +59 -17
  179. package/_types/tempo/actions/accessKey.d.ts.map +1 -1
  180. package/_types/tempo/actions/{multisig.d.ts → accounts.d.ts} +28 -28
  181. package/_types/tempo/actions/{multisig.d.ts.map → accounts.d.ts.map} +1 -1
  182. package/_types/tempo/actions/index.d.ts +1 -1
  183. package/_types/tempo/actions/index.d.ts.map +1 -1
  184. package/_types/tempo/index.d.ts +3 -2
  185. package/_types/tempo/index.d.ts.map +1 -1
  186. package/_types/tempo/internal/relay/accounts.d.ts +15 -0
  187. package/_types/tempo/internal/relay/accounts.d.ts.map +1 -0
  188. package/_types/tempo/internal/relay/keyAuthorization.d.ts +25 -0
  189. package/_types/tempo/internal/relay/keyAuthorization.d.ts.map +1 -0
  190. package/_types/tempo/internal/relay/plugin.d.ts +6 -3
  191. package/_types/tempo/internal/relay/plugin.d.ts.map +1 -1
  192. package/_types/tempo/internal/relay/utils.d.ts +59 -0
  193. package/_types/tempo/internal/relay/utils.d.ts.map +1 -1
  194. package/_types/utils/hash/normalizeSignature.d.ts.map +1 -1
  195. package/_types/utils/rpc/http.d.ts.map +1 -1
  196. package/_types/utils/rpc/socket.d.ts.map +1 -1
  197. package/actions/public/waitForTransactionReceipt.ts +8 -2
  198. package/actions/wallet/waitForCallsStatus.ts +41 -2
  199. package/chains/definitions/arcTestnet.ts +11 -8
  200. package/chains/definitions/qmsTestnet.ts +27 -0
  201. package/chains/definitions/tempo.ts +1 -1
  202. package/chains/definitions/tempoModerato.ts +2 -2
  203. package/chains/index.ts +1 -0
  204. package/clients/transports/ipc.ts +38 -29
  205. package/clients/transports/webSocket.ts +42 -33
  206. package/errors/version.ts +1 -1
  207. package/package.json +2 -2
  208. package/tempo/Abis.ts +217 -0
  209. package/tempo/Account.ts +95 -84
  210. package/tempo/Addresses.ts +1 -0
  211. package/tempo/Client.ts +3 -3
  212. package/tempo/Decorator.ts +86 -57
  213. package/tempo/ExecutionError.ts +1 -1
  214. package/tempo/Formatters.ts +14 -13
  215. package/tempo/KeyAuthorizationManager.ts +71 -19
  216. package/tempo/Relay.ts +70 -14
  217. package/tempo/Selectors.ts +13 -0
  218. package/tempo/Transaction.ts +31 -23
  219. package/tempo/Transport.ts +49 -21
  220. package/tempo/{multisig → accounts}/Config.ts +21 -21
  221. package/tempo/{multisig → accounts}/Operation.ts +26 -26
  222. package/tempo/{multisig → accounts}/Signature.ts +5 -3
  223. package/tempo/actions/accessKey.ts +179 -79
  224. package/tempo/actions/{multisig.ts → accounts.ts} +47 -56
  225. package/tempo/actions/index.ts +1 -1
  226. package/tempo/chainConfig.ts +52 -52
  227. package/tempo/index.ts +5 -4
  228. package/tempo/internal/relay/{multisig.ts → accounts.ts} +118 -118
  229. package/tempo/internal/relay/feePayer.ts +1 -1
  230. package/tempo/internal/relay/keyAuthorization.ts +415 -0
  231. package/tempo/internal/relay/plugin.ts +20 -7
  232. package/utils/hash/normalizeSignature.ts +3 -2
  233. package/utils/rpc/http.ts +76 -30
  234. package/utils/rpc/socket.ts +3 -1
  235. package/_cjs/tempo/actions/multisig.js.map +0 -1
  236. package/_cjs/tempo/internal/relay/multisig.js.map +0 -1
  237. package/_cjs/tempo/multisig/Signature.js.map +0 -1
  238. package/_esm/tempo/actions/multisig.js.map +0 -1
  239. package/_esm/tempo/internal/relay/multisig.js.map +0 -1
  240. package/_esm/tempo/multisig/Signature.js +0 -9
  241. package/_esm/tempo/multisig/Signature.js.map +0 -1
  242. package/_types/tempo/internal/relay/multisig.d.ts +0 -4
  243. package/_types/tempo/internal/relay/multisig.d.ts.map +0 -1
  244. package/_types/tempo/multisig/Config.d.ts.map +0 -1
  245. package/_types/tempo/multisig/Operation.d.ts.map +0 -1
  246. package/_types/tempo/multisig/Signature.d.ts.map +0 -1
@@ -1,11 +1,7 @@
1
1
  import type { Address } from 'abitype'
2
2
  import type * as Hex from 'ox/Hex'
3
3
  import type * as RpcSchema from 'ox/RpcSchema'
4
- import {
5
- MultisigConfig,
6
- MultisigOperation,
7
- type RpcSchemaTempo,
8
- } from 'ox/tempo'
4
+ import { AccountConfig, AccountOperation, type RpcSchemaTempo } from 'ox/tempo'
9
5
  import type { Account } from '../../accounts/types.js'
10
6
  import type { ReadContractReturnType } from '../../actions/public/readContract.js'
11
7
  import { readContract } from '../../actions/public/readContract.js'
@@ -20,14 +16,14 @@ import type { Log } from '../../types/log.js'
20
16
  import type { Compute } from '../../types/utils.js'
21
17
  import { parseEventLogs } from '../../utils/abi/parseEventLogs.js'
22
18
  import * as Abis from '../Abis.js'
23
- import { fromMultisig, type MultisigAccount } from '../Account.js'
19
+ import { type ConfigurableAccount, fromConfig } from '../Account.js'
24
20
  import * as Addresses from '../Addresses.js'
25
21
  import type { ReadParameters, WriteParameters } from '../internal/types.js'
26
22
  import { defineCall } from '../internal/utils.js'
27
23
  import type * as Transaction from '../Transaction.js'
28
24
 
29
25
  /**
30
- * Gets the current cached config for a multisig account.
26
+ * Gets the current cached config for a configurable account.
31
27
  *
32
28
  * The coordinator reads the account's current onchain commitment and returns
33
29
  * the matching config from its store. It returns `null` when the config is not
@@ -35,7 +31,7 @@ import type * as Transaction from '../Transaction.js'
35
31
  *
36
32
  * @example
37
33
  * ```ts
38
- * const config = await client.multisig.getConfig({
34
+ * const config = await client.accounts.getConfig({
39
35
  * address: '0x...',
40
36
  * })
41
37
  * ```
@@ -49,32 +45,32 @@ export async function getConfig(
49
45
  parameters: getConfig.Parameters,
50
46
  ): Promise<getConfig.ReturnValue> {
51
47
  const config = await client.request<{
52
- Method: 'multisig_getConfig'
48
+ Method: 'account_getConfig'
53
49
  Parameters: [{ address: Address }]
54
- ReturnType: MultisigConfig.Rpc | null
50
+ ReturnType: AccountConfig.Rpc | null
55
51
  }>({
56
- method: 'multisig_getConfig',
52
+ method: 'account_getConfig',
57
53
  params: [{ address: parameters.address }],
58
54
  })
59
- return config ? MultisigConfig.fromRpc(config) : null
55
+ return config ? AccountConfig.fromRpc(config) : null
60
56
  }
61
57
 
62
58
  export declare namespace getConfig {
63
59
  /** Parameters for {@link getConfig}. */
64
60
  export type Parameters = {
65
- /** Multisig account address. */
61
+ /** Configurable account address. */
66
62
  address: Address
67
63
  }
68
64
 
69
65
  /** Return value for {@link getConfig}. */
70
- export type ReturnValue = MultisigConfig.Config | null
66
+ export type ReturnValue = AccountConfig.Config | null
71
67
 
72
68
  /** Error type for {@link getConfig}. */
73
69
  export type ErrorType = BaseErrorType
74
70
  }
75
71
 
76
72
  /**
77
- * Gets the current configuration commitment for a native multisig account.
73
+ * Gets the current configuration commitment for a configurable account.
78
74
  *
79
75
  * @example
80
76
  * ```ts
@@ -87,7 +83,7 @@ export declare namespace getConfig {
87
83
  * transport: http(),
88
84
  * })
89
85
  *
90
- * const commitment = await Actions.multisig.getConfigCommitment(client, {
86
+ * const commitment = await Actions.accounts.getConfigCommitment(client, {
91
87
  * account: '0x...',
92
88
  * })
93
89
  * ```
@@ -115,7 +111,7 @@ export namespace getConfigCommitment {
115
111
  export type Parameters = ReadParameters & Args
116
112
 
117
113
  export type Args = {
118
- /** Initialized multisig account address. */
114
+ /** Initialized configurable account address. */
119
115
  account: Address
120
116
  }
121
117
 
@@ -144,7 +140,7 @@ export namespace getConfigCommitment {
144
140
  }
145
141
 
146
142
  /**
147
- * Gets a coordinated multisig operation by its hash.
143
+ * Gets a coordinated account operation by its hash.
148
144
  *
149
145
  * @param client - Client.
150
146
  * @param parameters - Parameters.
@@ -154,33 +150,33 @@ export async function getOperation(
154
150
  client: Client,
155
151
  parameters: getOperation.Parameters,
156
152
  ): Promise<getOperation.ReturnValue> {
157
- type multisig_getOperation = Extract<
158
- RpcSchema.ToViem<RpcSchemaTempo.Multisig>[number],
159
- { Method: 'multisig_getOperation' }
153
+ type account_getOperation = Extract<
154
+ RpcSchema.ToViem<RpcSchemaTempo.Account>[number],
155
+ { Method: 'account_getOperation' }
160
156
  >
161
- const operation = await client.request<multisig_getOperation>({
162
- method: 'multisig_getOperation',
157
+ const operation = await client.request<account_getOperation>({
158
+ method: 'account_getOperation',
163
159
  params: [parameters.hash],
164
160
  })
165
- return operation ? MultisigOperation.fromRpc(operation) : null
161
+ return operation ? AccountOperation.fromRpc(operation) : null
166
162
  }
167
163
 
168
164
  export declare namespace getOperation {
169
165
  /** Parameters for {@link getOperation}. */
170
166
  export type Parameters = {
171
- /** Multisig operation hash. */
167
+ /** Account operation hash. */
172
168
  hash: Hex.Hex
173
169
  }
174
170
 
175
171
  /** Return value for {@link getOperation}. */
176
- export type ReturnValue = MultisigOperation.Operation | null
172
+ export type ReturnValue = AccountOperation.Operation | null
177
173
 
178
174
  /** Error type for {@link getOperation}. */
179
175
  export type ErrorType = BaseErrorType
180
176
  }
181
177
 
182
178
  /**
183
- * Replaces the current configuration for a native multisig account.
179
+ * Replaces the current configuration for a configurable account.
184
180
  *
185
181
  * The transaction must be authorized directly by the account's current owner
186
182
  * quorum. Local owner-signing flows can include {@link updateConfig.call} in a
@@ -196,7 +192,7 @@ export declare namespace getOperation {
196
192
  * const owner = Account.fromSecp256k1(
197
193
  * '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80',
198
194
  * )
199
- * const account = Account.fromMultisig({
195
+ * const account = Account.fromConfig({
200
196
  * address: 'infer',
201
197
  * owners: [owner],
202
198
  * })
@@ -210,7 +206,7 @@ export declare namespace getOperation {
210
206
  * to: account.address,
211
207
  * })
212
208
  *
213
- * const hash = await Actions.multisig.updateConfig(client, {
209
+ * const hash = await Actions.accounts.updateConfig(client, {
214
210
  * account,
215
211
  * nextConfig: {
216
212
  * owners: [{ owner: owner.address, weight: 1 }],
@@ -239,16 +235,16 @@ export namespace updateConfig {
239
235
  account extends Account | undefined = Account | undefined,
240
236
  > = WriteParameters<chain, account> & {
241
237
  /** Complete current config. Inferred from the account or coordinator when omitted. */
242
- currentConfig?: MultisigConfig.Config | undefined
238
+ currentConfig?: AccountConfig.Config | undefined
243
239
  /** Replacement owners and threshold. */
244
- nextConfig: Pick<MultisigConfig.Config, 'owners' | 'threshold'>
240
+ nextConfig: Pick<AccountConfig.Config, 'owners' | 'threshold'>
245
241
  }
246
242
 
247
243
  export type Args = {
248
244
  /** Complete current config. */
249
- currentConfig: MultisigConfig.Config
245
+ currentConfig: AccountConfig.Config
250
246
  /** Replacement owners and threshold. */
251
- nextConfig: Pick<MultisigConfig.Config, 'owners' | 'threshold'>
247
+ nextConfig: Pick<AccountConfig.Config, 'owners' | 'threshold'>
252
248
  }
253
249
 
254
250
  export type ReturnValue = WriteContractReturnType
@@ -276,9 +272,9 @@ export namespace updateConfig {
276
272
  const account = (() => {
277
273
  if (
278
274
  typeof accountValue === 'object' &&
279
- accountValue.source === 'multisig'
275
+ accountValue.source === 'configurable'
280
276
  )
281
- return accountValue as MultisigAccount
277
+ return accountValue as ConfigurableAccount
282
278
  return undefined
283
279
  })()
284
280
  const config = (() => {
@@ -293,22 +289,22 @@ export namespace updateConfig {
293
289
  return undefined
294
290
  })()
295
291
  const currentConfig = await (async () => {
296
- if (config) return MultisigConfig.from(config)
292
+ if (config) return AccountConfig.from(config)
297
293
  if (!address)
298
294
  throw new Error(
299
- 'A multisig account address or current config is required.',
295
+ 'A configurable account address or current config is required.',
300
296
  )
301
297
  const cachedConfig = await getConfig(client, { address })
302
298
  if (!cachedConfig)
303
299
  throw new Error(
304
- `No current multisig config is cached for account ${address}. Provide the current config.`,
300
+ `No current account config is cached for account ${address}. Provide the current config.`,
305
301
  )
306
302
  return cachedConfig
307
303
  })()
308
304
  const resolvedAccount = (() => {
309
305
  if (account) return { ...account, config: currentConfig }
310
306
  if (typeof accountValue === 'object') return accountValue
311
- if (address) return fromMultisig({ address, ...currentConfig })
307
+ if (address) return fromConfig({ address, ...currentConfig })
312
308
  return undefined
313
309
  })()
314
310
  return (await action(client, {
@@ -328,11 +324,11 @@ export namespace updateConfig {
328
324
  *
329
325
  * @example
330
326
  * ```ts
331
- * import { Actions, type MultisigConfig } from 'viem/tempo'
327
+ * import { Actions, type AccountConfig } from 'viem/tempo'
332
328
  *
333
- * declare const currentConfig: MultisigConfig.Config
329
+ * declare const currentConfig: AccountConfig.Config
334
330
  *
335
- * const call = Actions.multisig.updateConfig.call({
331
+ * const call = Actions.accounts.updateConfig.call({
336
332
  * currentConfig,
337
333
  * nextConfig: {
338
334
  * owners: [{ owner: '0x...', weight: 1 }],
@@ -341,17 +337,12 @@ export namespace updateConfig {
341
337
  * })
342
338
  * ```
343
339
  *
344
- * @param args - Current and replacement multisig configurations.
340
+ * @param args - Current and replacement account configurations.
345
341
  * @returns The call.
346
342
  */
347
343
  export function call(args: Args) {
348
- const currentConfig = MultisigConfig.from(args.currentConfig)
349
- const nextConfig = MultisigConfig.from({
350
- owners: args.nextConfig.owners,
351
- salt: currentConfig.salt,
352
- threshold: args.nextConfig.threshold,
353
- version: currentConfig.version + 1n,
354
- })
344
+ const currentConfig = AccountConfig.from(args.currentConfig)
345
+ const nextConfig = AccountConfig.update(currentConfig, args.nextConfig)
355
346
  return defineCall({
356
347
  address: Addresses.nativeMultisig,
357
348
  abi: Abis.nativeMultisig,
@@ -379,16 +370,16 @@ export namespace updateConfig {
379
370
  }
380
371
 
381
372
  /**
382
- * Replaces a native multisig configuration and waits for confirmation.
373
+ * Replaces a configurable account configuration and waits for confirmation.
383
374
  *
384
375
  * @example
385
376
  * ```ts
386
377
  * import { createWalletClient, custom, type EIP1193Provider } from 'viem'
387
378
  * import { tempo } from 'viem/chains'
388
- * import { Actions, type MultisigConfig } from 'viem/tempo'
379
+ * import { Actions, type AccountConfig } from 'viem/tempo'
389
380
  *
390
381
  * declare const provider: EIP1193Provider
391
- * declare const currentConfig: MultisigConfig.Config
382
+ * declare const currentConfig: AccountConfig.Config
392
383
  *
393
384
  * const client = createWalletClient({
394
385
  * account: '0x...',
@@ -396,7 +387,7 @@ export namespace updateConfig {
396
387
  * transport: custom(provider),
397
388
  * })
398
389
  *
399
- * const { receipt } = await Actions.multisig.updateConfigSync(client, {
390
+ * const { receipt } = await Actions.accounts.updateConfigSync(client, {
400
391
  * currentConfig,
401
392
  * nextConfig: {
402
393
  * owners: [{ owner: '0x...', weight: 1 }],
@@ -426,7 +417,7 @@ export async function updateConfigSync<
426
417
  const { args } = updateConfig.extractEvent(receipt.logs)
427
418
  return {
428
419
  account: args.account,
429
- config: MultisigConfig.from({
420
+ config: AccountConfig.from({
430
421
  owners: args.owners,
431
422
  salt: args.salt,
432
423
  threshold: args.threshold,
@@ -446,7 +437,7 @@ export namespace updateConfigSync {
446
437
 
447
438
  export type ReturnValue = Compute<{
448
439
  account: Address
449
- config: MultisigConfig.Config
440
+ config: AccountConfig.Config
450
441
  receipt: Transaction.TransactionReceipt
451
442
  }>
452
443
 
@@ -1,12 +1,12 @@
1
1
  // biome-ignore lint/performance/noBarrelFile: _
2
2
  export * as accessKey from './accessKey.js'
3
+ export * as accounts from './accounts.js'
3
4
  export * as amm from './amm.js'
4
5
  export * as channel from './channel.js'
5
6
  export * as dex from './dex.js'
6
7
  export * as earn from './earn.js'
7
8
  export * as faucet from './faucet.js'
8
9
  export * as fee from './fee.js'
9
- export * as multisig from './multisig.js'
10
10
  export * as nonce from './nonce.js'
11
11
  export * as policy from './policy.js'
12
12
  export * as propAmm from './propAmm.js'
@@ -1,9 +1,9 @@
1
1
  import type { Address } from 'abitype'
2
2
  import * as Hex from 'ox/Hex'
3
3
  import {
4
- MultisigConfig,
5
- MultisigOperation,
6
- type MultisigSimulation,
4
+ AccountConfig,
5
+ AccountOperation,
6
+ type AccountSimulation,
7
7
  SignatureEnvelope,
8
8
  type TokenId,
9
9
  } from 'ox/tempo'
@@ -20,9 +20,9 @@ import { defineTransactionRequest } from '../utils/formatters/transactionRequest
20
20
  import { getAction } from '../utils/getAction.js'
21
21
  import { keccak256 } from '../utils/hash/keccak256.js'
22
22
  import type { SerializeTransactionFn } from '../utils/transaction/serializeTransaction.js'
23
- import type { Account, MultisigAccount } from './Account.js'
23
+ import type { Account, ConfigurableAccount } from './Account.js'
24
24
  import { getMetadata } from './actions/accessKey.js'
25
- import { getConfig } from './actions/multisig.js'
25
+ import { getConfig } from './actions/accounts.js'
26
26
  import * as Formatters from './Formatters.js'
27
27
  import type { Hardfork } from './Hardfork.js'
28
28
  import * as Concurrent from './internal/concurrent.js'
@@ -55,7 +55,7 @@ export const chainConfig = {
55
55
  prepareTransactionRequest: [
56
56
  async (r, { client, phase }) => {
57
57
  const request = r as Transaction.TransactionRequest & {
58
- account?: Account | MultisigAccount | undefined
58
+ account?: Account | ConfigurableAccount | undefined
59
59
  chainId?: number | undefined
60
60
  chain?:
61
61
  | (Chain & {
@@ -67,8 +67,8 @@ export const chainConfig = {
67
67
  hash?: Hex.Hex | undefined
68
68
  keyData?: Hex.Hex | undefined
69
69
  keyType?: 'p256' | 'secp256k1' | 'webAuthn' | undefined
70
- multisigSimulation?: MultisigSimulation.Spec | undefined
71
- owner?: Account | MultisigAccount | Address | undefined
70
+ accountSimulation?: AccountSimulation.Spec | undefined
71
+ owner?: Account | ConfigurableAccount | Address | undefined
72
72
  signatures?: readonly unknown[] | undefined
73
73
  }
74
74
 
@@ -76,18 +76,18 @@ export const chainConfig = {
76
76
  if (
77
77
  !request.account ||
78
78
  typeof request.account === 'string' ||
79
- request.account.source !== 'multisig'
79
+ request.account.source !== 'configurable'
80
80
  )
81
81
  throw new Error(
82
- 'A local multisig account is required to approve a stored multisig transaction.',
82
+ 'A local configurable account is required to approve a stored configurable account transaction.',
83
83
  )
84
84
  if (!request.owner || typeof request.owner === 'string')
85
85
  throw new Error(
86
- 'A local owner account is required to approve a stored multisig transaction.',
86
+ 'A local owner account is required to approve a stored configurable account transaction.',
87
87
  )
88
88
  if (request.owner.source !== 'root')
89
89
  throw new Error(
90
- 'A Tempo owner account is required to approve a stored multisig transaction.',
90
+ 'A Tempo owner account is required to approve a stored configurable account transaction.',
91
91
  )
92
92
  const transaction = await getAction(
93
93
  client,
@@ -95,28 +95,28 @@ export const chainConfig = {
95
95
  'getTransaction',
96
96
  )({ hash: request.hash })
97
97
  const operation =
98
- 'multisig' in transaction
99
- ? (transaction.multisig as
100
- | MultisigOperation.TransactionOperation
98
+ 'operation' in transaction
99
+ ? (transaction.operation as
100
+ | AccountOperation.TransactionOperation
101
101
  | undefined)
102
102
  : undefined
103
103
  if (!operation)
104
- throw new Error('Expected a multisig operation transaction.')
104
+ throw new Error('Expected an account operation transaction.')
105
105
  if (!isAddressEqual(operation.account, request.account.address))
106
106
  throw new Error(
107
- 'Multisig operation account does not match the requested account.',
107
+ 'Account operation account does not match the requested account.',
108
108
  )
109
109
  const storedTransaction = Transaction.deserialize(
110
110
  operation.transaction as Transaction.TransactionSerializedTempo,
111
111
  )
112
- const hash = MultisigOperation.getHash({
112
+ const hash = AccountOperation.getHash({
113
113
  account: operation.account,
114
114
  config: operation.config,
115
115
  transaction: operation.transaction,
116
116
  type: 'transaction',
117
117
  })
118
118
  if (hash.toLowerCase() !== request.hash.toLowerCase())
119
- throw new Error('Multisig operation hash does not match transaction.')
119
+ throw new Error('Account operation hash does not match transaction.')
120
120
  return {
121
121
  ...storedTransaction,
122
122
  // Serialized zero values must not trigger a new fill of an approved transaction.
@@ -125,7 +125,7 @@ export const chainConfig = {
125
125
  maxPriorityFeePerGas: storedTransaction.maxPriorityFeePerGas ?? 0n,
126
126
  account: request.account,
127
127
  from: operation.account,
128
- multisigSimulation: getMultisigSimulation({
128
+ accountSimulation: getAccountSimulation({
129
129
  config: operation.config,
130
130
  local: request.account,
131
131
  }),
@@ -151,40 +151,40 @@ export const chainConfig = {
151
151
  return request as unknown as typeof r
152
152
  }
153
153
 
154
- const multisigIdentity = (() => {
155
- if (request.account?.source === 'multisig')
154
+ const configurableIdentity = (() => {
155
+ if (request.account?.source === 'configurable')
156
156
  return {
157
157
  account: request.account.address,
158
- config: (request.account as MultisigAccount).config,
159
- local: request.account as MultisigAccount,
158
+ config: (request.account as ConfigurableAccount).config,
159
+ local: request.account as ConfigurableAccount,
160
160
  }
161
161
  return undefined
162
162
  })()
163
- if (request.owner && !multisigIdentity)
163
+ if (request.owner && !configurableIdentity)
164
164
  throw new Error(
165
- 'A multisig account is required when an owner is provided.',
165
+ 'A configurable account is required when an owner is provided.',
166
166
  )
167
167
  if (request.owner && typeof request.owner === 'string')
168
168
  throw new Error(
169
- 'A local owner account is required to approve a multisig transaction.',
169
+ 'A local owner account is required to approve a configurable account transaction.',
170
170
  )
171
171
  if (request.owner && request.owner.source !== 'root')
172
172
  throw new Error(
173
- 'A Tempo owner account is required to approve a multisig transaction.',
173
+ 'A Tempo owner account is required to approve a configurable account transaction.',
174
174
  )
175
- const coordinatedMultisig =
176
- !!multisigIdentity &&
175
+ const coordinated =
176
+ !!configurableIdentity &&
177
177
  !!request.owner &&
178
- (client.transport as { multisig?: boolean }).multisig === true
179
- if (multisigIdentity) {
180
- const { account, local } = multisigIdentity
178
+ (client.transport as { accounts?: boolean }).accounts === true
179
+ if (configurableIdentity) {
180
+ const { account, local } = configurableIdentity
181
181
  if (!account)
182
182
  throw new Error(
183
- 'A multisig account address is required with a current config.',
183
+ 'A configurable account address is required with a current config.',
184
184
  )
185
185
  const config = await (async () => {
186
- if (multisigIdentity.config) return multisigIdentity.config
187
- if (!coordinatedMultisig) return undefined
186
+ if (configurableIdentity.config) return configurableIdentity.config
187
+ if (!coordinated) return undefined
188
188
  const cachedConfig = await getAction(
189
189
  client,
190
190
  getConfig,
@@ -192,16 +192,16 @@ export const chainConfig = {
192
192
  )({ address: account })
193
193
  if (!cachedConfig)
194
194
  throw new Error(
195
- `No current multisig config is cached for account ${account}. Provide the current config.`,
195
+ `No current account config is cached for account ${account}. Provide the current config.`,
196
196
  )
197
197
  return cachedConfig
198
198
  })()
199
199
  if (!config)
200
200
  throw new Error(
201
- 'A multisig config is required to prepare a transaction.',
201
+ 'An account config is required to prepare a transaction.',
202
202
  )
203
203
  request.from = account
204
- request.multisigSimulation = getMultisigSimulation({
204
+ request.accountSimulation = getAccountSimulation({
205
205
  config,
206
206
  local,
207
207
  })
@@ -213,12 +213,12 @@ export const chainConfig = {
213
213
  if (request.nonceKey === 'expiring' || request.nonceKey === maxUint256)
214
214
  return true
215
215
  if (typeof request.nonceKey !== 'undefined') return false
216
- if (multisigIdentity) return false
216
+ if (configurableIdentity) return false
217
217
  if (request.feePayer && typeof request.nonceKey === 'undefined')
218
218
  return true
219
219
  const account = request.account as
220
220
  | Account
221
- | MultisigAccount
221
+ | ConfigurableAccount
222
222
  | Address
223
223
  | undefined
224
224
  const address = typeof account === 'string' ? account : account?.address
@@ -227,7 +227,7 @@ export const chainConfig = {
227
227
  return false
228
228
  })()
229
229
 
230
- if (coordinatedMultisig && typeof request.nonceKey === 'undefined') {
230
+ if (coordinated && typeof request.nonceKey === 'undefined') {
231
231
  // A random nonce lane lets a stored approval ceremony remain valid
232
232
  // indefinitely without blocking other pending operations.
233
233
  request.nonceKey = Hex.toBigInt(Hex.random(31)) + 1n
@@ -294,17 +294,17 @@ export const chainConfig = {
294
294
  transaction: serializeTransaction,
295
295
  async transactionEnvelope({ serializedTransaction, transaction }) {
296
296
  const request = transaction as Transaction.TransactionSerializableTempo
297
- if (!request.multisigSimulation) return serializedTransaction
297
+ if (!request.accountSimulation) return serializedTransaction
298
298
  try {
299
299
  SignatureEnvelope.deserialize(serializedTransaction)
300
300
  } catch {
301
301
  const transaction = Transaction.deserialize(
302
302
  serializedTransaction as Transaction.TransactionSerializedTempo,
303
303
  )
304
- if (transaction.signature?.type === 'multisig')
304
+ if (transaction.signature?.type === 'configurable')
305
305
  return serializedTransaction
306
306
  throw new Error(
307
- 'A Tempo owner account is required to approve a multisig transaction.',
307
+ 'A Tempo owner account is required to approve a configurable account transaction.',
308
308
  )
309
309
  }
310
310
  return await serializeTransaction({
@@ -402,11 +402,11 @@ export const chainConfig = {
402
402
 
403
403
  export type ChainConfig = typeof chainConfig
404
404
 
405
- /** Builds a bounded multisig spec for gas simulation. */
406
- function getMultisigSimulation(options: {
407
- config: MultisigConfig.Config
408
- local?: MultisigAccount | undefined
409
- }): MultisigSimulation.Spec {
405
+ /** Builds a bounded account spec for gas simulation. */
406
+ function getAccountSimulation(options: {
407
+ config: AccountConfig.Config
408
+ local?: ConfigurableAccount | undefined
409
+ }): AccountSimulation.Spec {
410
410
  const { config, local } = options
411
411
  return {
412
412
  approvals: selectOwners(config).map((owner) => {
@@ -453,7 +453,7 @@ function randomValidAfter(): number {
453
453
  }
454
454
 
455
455
  /** Selects a deterministic minimum-cardinality owner quorum. */
456
- function selectOwners(config: MultisigConfig.Config) {
456
+ function selectOwners(config: AccountConfig.Config) {
457
457
  const owners = [...config.owners].sort(
458
458
  (a, b) =>
459
459
  Number(b.weight) - Number(a.weight) ||
@@ -461,7 +461,7 @@ function selectOwners(config: MultisigConfig.Config) {
461
461
  )
462
462
  const selected: typeof owners = []
463
463
  let weight = 0
464
- for (const owner of owners.slice(0, MultisigConfig.maxSignatures)) {
464
+ for (const owner of owners.slice(0, AccountConfig.maxSignatures)) {
465
465
  if (weight >= Number(config.threshold)) break
466
466
  selected.push(owner)
467
467
  weight += Number(owner.weight)
package/tempo/index.ts CHANGED
@@ -12,10 +12,10 @@ export type {
12
12
  TxEnvelopeTempo as z_TxEnvelopeTempo,
13
13
  } from 'ox/tempo'
14
14
  export {
15
+ AccountConfig,
16
+ AccountOperation,
15
17
  Channel,
16
18
  EarnShares,
17
- MultisigConfig,
18
- MultisigOperation,
19
19
  Period,
20
20
  ReceivePolicyReceipt,
21
21
  TempoAddress,
@@ -26,8 +26,8 @@ export {
26
26
  } from 'ox/tempo'
27
27
  export type {
28
28
  /** @deprecated */
29
- Owner as z_MultisigConfigOwner,
30
- } from 'ox/tempo/MultisigConfig'
29
+ Owner as z_AccountConfigOwner,
30
+ } from 'ox/tempo/AccountConfig'
31
31
  export {
32
32
  type CustomTransport,
33
33
  type CustomTransportConfig,
@@ -73,6 +73,7 @@ export * as Expiry from './Expiry.js'
73
73
  export * from './errors.js'
74
74
  export * as Formatters from './Formatters.js'
75
75
  export * as Hardfork from './Hardfork.js'
76
+ /** Client-side storage for pending key authorizations, backed by a `Store`. */
76
77
  export * as KeyAuthorizationManager from './KeyAuthorizationManager.js'
77
78
  export * as P256 from './P256.js'
78
79
  /**