ox 0.14.55 → 0.14.57
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.
- package/CHANGELOG.md +48 -0
- package/_cjs/tempo/{MultisigConfig.js → AccountConfig.js} +32 -9
- package/_cjs/tempo/AccountConfig.js.map +1 -0
- package/_cjs/tempo/{MultisigOperation.js → AccountOperation.js} +29 -29
- package/_cjs/tempo/AccountOperation.js.map +1 -0
- package/_cjs/tempo/{MultisigSimulation.js → AccountSimulation.js} +22 -13
- package/_cjs/tempo/AccountSimulation.js.map +1 -0
- package/_cjs/tempo/KeyAuthorization.js +10 -18
- package/_cjs/tempo/KeyAuthorization.js.map +1 -1
- package/_cjs/tempo/SignatureEnvelope.js +64 -64
- package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
- package/_cjs/tempo/TransactionRequest.js +15 -10
- package/_cjs/tempo/TransactionRequest.js.map +1 -1
- package/_cjs/tempo/index.js +4 -4
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/tempo/{MultisigConfig.js → AccountConfig.js} +161 -64
- package/_esm/tempo/AccountConfig.js.map +1 -0
- package/_esm/tempo/{MultisigOperation.js → AccountOperation.js} +64 -64
- package/_esm/tempo/AccountOperation.js.map +1 -0
- package/_esm/tempo/{MultisigSimulation.js → AccountSimulation.js} +35 -25
- package/_esm/tempo/AccountSimulation.js.map +1 -0
- package/_esm/tempo/KeyAuthorization.js +16 -19
- package/_esm/tempo/KeyAuthorization.js.map +1 -1
- package/_esm/tempo/SignatureEnvelope.js +71 -71
- package/_esm/tempo/SignatureEnvelope.js.map +1 -1
- package/_esm/tempo/TransactionRequest.js +15 -10
- package/_esm/tempo/TransactionRequest.js.map +1 -1
- package/_esm/tempo/index.js +50 -48
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/tempo/{MultisigConfig.d.ts → AccountConfig.d.ts} +156 -66
- package/_types/tempo/AccountConfig.d.ts.map +1 -0
- package/_types/tempo/{MultisigOperation.d.ts → AccountOperation.d.ts} +62 -62
- package/_types/tempo/AccountOperation.d.ts.map +1 -0
- package/_types/tempo/{MultisigSimulation.d.ts → AccountSimulation.d.ts} +25 -21
- package/_types/tempo/AccountSimulation.d.ts.map +1 -0
- package/_types/tempo/KeyAuthorization.d.ts +28 -23
- package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
- package/_types/tempo/RpcSchemaTempo.d.ts +13 -13
- package/_types/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/_types/tempo/SignatureEnvelope.d.ts +36 -33
- package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/_types/tempo/TransactionRequest.d.ts +11 -9
- package/_types/tempo/TransactionRequest.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +50 -48
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/package.json +31 -31
- package/tempo/AccountConfig/package.json +6 -0
- package/tempo/AccountConfig.test-d/package.json +6 -0
- package/tempo/AccountConfig.test-d.ts +72 -0
- package/tempo/AccountConfig.test.ts +642 -0
- package/tempo/{MultisigConfig.ts → AccountConfig.ts} +212 -75
- package/tempo/AccountOperation/package.json +6 -0
- package/tempo/AccountOperation.test-d/package.json +6 -0
- package/tempo/AccountOperation.test-d.ts +71 -0
- package/tempo/{MultisigOperation.test.ts → AccountOperation.test.ts} +129 -129
- package/tempo/{MultisigOperation.ts → AccountOperation.ts} +95 -97
- package/tempo/AccountSimulation/package.json +6 -0
- package/tempo/AccountSimulation.test-d/package.json +6 -0
- package/tempo/{MultisigSimulation.test-d.ts → AccountSimulation.test-d.ts} +7 -9
- package/tempo/{MultisigSimulation.test.ts → AccountSimulation.test.ts} +73 -29
- package/tempo/{MultisigSimulation.ts → AccountSimulation.ts} +47 -35
- package/tempo/KeyAuthorization.test-d.ts +19 -29
- package/tempo/KeyAuthorization.test.ts +151 -74
- package/tempo/KeyAuthorization.ts +40 -61
- package/tempo/RpcSchemaTempo.test-d.ts +20 -20
- package/tempo/RpcSchemaTempo.ts +13 -13
- package/tempo/SignatureEnvelope.test-d.ts +7 -7
- package/tempo/SignatureEnvelope.test.ts +34 -34
- package/tempo/SignatureEnvelope.ts +107 -103
- package/tempo/Transaction.test.ts +4 -4
- package/tempo/TransactionRequest.test-d.ts +17 -8
- package/tempo/TransactionRequest.test.ts +31 -21
- package/tempo/TransactionRequest.ts +29 -20
- package/tempo/{multisig.e2e.test.ts → configurableAccounts.e2e.test.ts} +16 -16
- package/tempo/index.ts +50 -48
- package/version.ts +1 -1
- package/_cjs/tempo/MultisigConfig.js.map +0 -1
- package/_cjs/tempo/MultisigOperation.js.map +0 -1
- package/_cjs/tempo/MultisigSimulation.js.map +0 -1
- package/_esm/tempo/MultisigConfig.js.map +0 -1
- package/_esm/tempo/MultisigOperation.js.map +0 -1
- package/_esm/tempo/MultisigSimulation.js.map +0 -1
- package/_types/tempo/MultisigConfig.d.ts.map +0 -1
- package/_types/tempo/MultisigOperation.d.ts.map +0 -1
- package/_types/tempo/MultisigSimulation.d.ts.map +0 -1
- package/tempo/MultisigConfig/package.json +0 -6
- package/tempo/MultisigConfig.test-d/package.json +0 -6
- package/tempo/MultisigConfig.test-d.ts +0 -52
- package/tempo/MultisigConfig.test.ts +0 -391
- package/tempo/MultisigOperation/package.json +0 -6
- package/tempo/MultisigOperation.test-d/package.json +0 -6
- package/tempo/MultisigOperation.test-d.ts +0 -71
- package/tempo/MultisigSimulation/package.json +0 -6
- package/tempo/MultisigSimulation.test-d/package.json +0 -6
|
@@ -5,28 +5,40 @@ import * as Hash from '../core/Hash.js';
|
|
|
5
5
|
import * as Hex from '../core/Hex.js';
|
|
6
6
|
/** Maximum encoded byte length for one primitive owner approval. */
|
|
7
7
|
export const maxOwnerSignatureBytes = 2049;
|
|
8
|
-
/** Maximum number of owners allowed in
|
|
8
|
+
/** Maximum number of owners allowed in an account config. */
|
|
9
9
|
export const maxOwners = 48;
|
|
10
|
-
/** Maximum number of owner approvals in a
|
|
10
|
+
/** Maximum number of owner approvals in a configurable account signature. */
|
|
11
11
|
export const maxSignatures = 8;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Maximum threshold accepted by an account config.
|
|
14
|
+
*
|
|
15
|
+
* The threshold must also be reachable by at most {@link ox#AccountConfig.maxSignatures}
|
|
16
|
+
* owner approvals.
|
|
17
|
+
*/
|
|
18
|
+
export const maxThreshold = 0xff;
|
|
19
|
+
/** Maximum version accepted by an account config. */
|
|
15
20
|
export const maxVersion = 2n ** 64n - 1n;
|
|
16
|
-
/** Tempo signature type byte for
|
|
21
|
+
/** Tempo signature type byte for configurable account signatures. */
|
|
17
22
|
export const signatureTypeByte = '0x05';
|
|
18
23
|
/** Zero 32-byte salt (the default when no salt is provided). */
|
|
19
24
|
export const zeroSalt = `0x${'00'.repeat(32)}`;
|
|
20
|
-
/** Domain prefix for the
|
|
21
|
-
const accountDomain = 'tempo:
|
|
22
|
-
/** Domain prefix for
|
|
23
|
-
const configDomain = 'tempo:
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
/** Domain prefix for the configurable account address derivation. */
|
|
26
|
+
const accountDomain = 'tempo:configurable-account:account';
|
|
27
|
+
/** Domain prefix for account configuration commitments. */
|
|
28
|
+
const configDomain = 'tempo:configurable-account:config';
|
|
29
|
+
/**
|
|
30
|
+
* Keccak-256 of the account proxy creation code.
|
|
31
|
+
*
|
|
32
|
+
* Placeholder until [TIP-1110](https://tips.sh/1110) fixes the canonical
|
|
33
|
+
* account proxy, which will change every derived address.
|
|
34
|
+
*/
|
|
35
|
+
const accountProxyInitCodeHash = '0x583cc63a2e37f645b43eac911b1a6d6de08b83abdc308c61364edda8cfc3bd37';
|
|
36
|
+
/** Domain prefix for configurable account owner approvals. */
|
|
37
|
+
const signatureDomain = 'tempo:configurable-account:signature';
|
|
38
|
+
/** Domain prefix for the salt of an account migrated in place. */
|
|
39
|
+
const upgradeDomain = 'tempo:configurable-account:upgrade';
|
|
28
40
|
/**
|
|
29
|
-
* Asserts that
|
|
41
|
+
* Asserts that an {@link ox#AccountConfig.Config} is valid.
|
|
30
42
|
*
|
|
31
43
|
* Mirrors the Tempo configuration rules: owners non-empty and
|
|
32
44
|
* `<= maxOwners`, strictly ascending unique nonzero owner addresses, nonzero
|
|
@@ -36,9 +48,9 @@ const signatureDomain = 'tempo:multisig:signature';
|
|
|
36
48
|
*
|
|
37
49
|
* @example
|
|
38
50
|
* ```ts twoslash
|
|
39
|
-
* import {
|
|
51
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
40
52
|
*
|
|
41
|
-
*
|
|
53
|
+
* AccountConfig.assert({
|
|
42
54
|
* threshold: 1,
|
|
43
55
|
* owners: [
|
|
44
56
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
@@ -46,7 +58,7 @@ const signatureDomain = 'tempo:multisig:signature';
|
|
|
46
58
|
* })
|
|
47
59
|
* ```
|
|
48
60
|
*
|
|
49
|
-
* @param config - The
|
|
61
|
+
* @param config - The account config.
|
|
50
62
|
*/
|
|
51
63
|
export function assert(config) {
|
|
52
64
|
const { owners, salt, threshold, version = 0n } = config;
|
|
@@ -117,13 +129,13 @@ export function from(config) {
|
|
|
117
129
|
return normalized;
|
|
118
130
|
}
|
|
119
131
|
/**
|
|
120
|
-
* Converts a JSON-RPC
|
|
132
|
+
* Converts a JSON-RPC account configuration to its domain representation.
|
|
121
133
|
*
|
|
122
134
|
* @example
|
|
123
135
|
* ```ts twoslash
|
|
124
|
-
* import {
|
|
136
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
125
137
|
*
|
|
126
|
-
* const config =
|
|
138
|
+
* const config = AccountConfig.fromRpc({
|
|
127
139
|
* owners: [
|
|
128
140
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
129
141
|
* ],
|
|
@@ -133,8 +145,8 @@ export function from(config) {
|
|
|
133
145
|
* })
|
|
134
146
|
* ```
|
|
135
147
|
*
|
|
136
|
-
* @param config - The JSON-RPC
|
|
137
|
-
* @returns The normalized
|
|
148
|
+
* @param config - The JSON-RPC account configuration.
|
|
149
|
+
* @returns The normalized account configuration.
|
|
138
150
|
*/
|
|
139
151
|
export function fromRpc(config) {
|
|
140
152
|
return from({
|
|
@@ -143,14 +155,14 @@ export function fromRpc(config) {
|
|
|
143
155
|
});
|
|
144
156
|
}
|
|
145
157
|
/**
|
|
146
|
-
* Converts an RLP {@link ox#
|
|
147
|
-
* {@link ox#
|
|
158
|
+
* Converts an RLP {@link ox#AccountConfig.Tuple} back to a
|
|
159
|
+
* {@link ox#AccountConfig.Config}.
|
|
148
160
|
*
|
|
149
161
|
* @example
|
|
150
162
|
* ```ts twoslash
|
|
151
|
-
* import {
|
|
163
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
152
164
|
*
|
|
153
|
-
* const config =
|
|
165
|
+
* const config = AccountConfig.fromTuple([
|
|
154
166
|
* `0x${'00'.repeat(32)}`,
|
|
155
167
|
* '0x',
|
|
156
168
|
* '0x01',
|
|
@@ -159,7 +171,7 @@ export function fromRpc(config) {
|
|
|
159
171
|
* ```
|
|
160
172
|
*
|
|
161
173
|
* @param tuple - The RLP tuple.
|
|
162
|
-
* @returns The
|
|
174
|
+
* @returns The account config.
|
|
163
175
|
*/
|
|
164
176
|
export function fromTuple(tuple) {
|
|
165
177
|
const [salt, version, threshold, owners] = tuple;
|
|
@@ -197,34 +209,76 @@ export function fromTuple(tuple) {
|
|
|
197
209
|
return config;
|
|
198
210
|
}
|
|
199
211
|
/**
|
|
200
|
-
* Derives the
|
|
212
|
+
* Derives the configuration an existing account installs when it migrates in
|
|
213
|
+
* place with the `upgradeAccount` precompile call
|
|
214
|
+
* ([TIP-1113](https://tips.sh/1113)).
|
|
215
|
+
*
|
|
216
|
+
* The account keeps its address. Its salt is
|
|
217
|
+
* `keccak256("tempo:configurable-account:upgrade" || account)` and its version
|
|
218
|
+
* is `1n`. Owners are sorted into canonical order and the config is validated.
|
|
219
|
+
* The account itself may be listed as an owner.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```ts twoslash
|
|
223
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
224
|
+
*
|
|
225
|
+
* const config = AccountConfig.fromUpgrade(
|
|
226
|
+
* '0x3333333333333333333333333333333333333333',
|
|
227
|
+
* {
|
|
228
|
+
* owners: [
|
|
229
|
+
* {
|
|
230
|
+
* owner: '0x1111111111111111111111111111111111111111',
|
|
231
|
+
* weight: 1
|
|
232
|
+
* }
|
|
233
|
+
* ],
|
|
234
|
+
* threshold: 1
|
|
235
|
+
* }
|
|
236
|
+
* )
|
|
237
|
+
* // config.version === 1n
|
|
238
|
+
* ```
|
|
239
|
+
*
|
|
240
|
+
* @param account - The account migrating in place.
|
|
241
|
+
* @param options - The owners and threshold to install.
|
|
242
|
+
* @returns The installed account config.
|
|
243
|
+
*/
|
|
244
|
+
export function fromUpgrade(account, options) {
|
|
245
|
+
Address.assert(account);
|
|
246
|
+
return from({
|
|
247
|
+
owners: options.owners,
|
|
248
|
+
salt: Hash.keccak256(Hex.concat(Hex.fromString(upgradeDomain), account)),
|
|
249
|
+
threshold: options.threshold,
|
|
250
|
+
version: 1n,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Derives the stable configurable account address.
|
|
201
255
|
*
|
|
202
256
|
* The initial config is hashed into a CREATE2 salt using fixed-width
|
|
203
257
|
* big-endian fields, not RLP. The account uses the chain-configured recovery
|
|
204
|
-
* factory and
|
|
258
|
+
* factory and account proxy init-code hash.
|
|
205
259
|
*
|
|
206
260
|
* The address is derived once from the initial version-0 config. Config
|
|
207
261
|
* updates do not change it.
|
|
208
262
|
*
|
|
209
263
|
* @example
|
|
210
264
|
* ```ts twoslash
|
|
211
|
-
* import {
|
|
265
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
212
266
|
*
|
|
213
|
-
* const initialConfig =
|
|
267
|
+
* const initialConfig = AccountConfig.from({
|
|
214
268
|
* owners: [
|
|
215
269
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
216
270
|
* ],
|
|
217
271
|
* threshold: 1,
|
|
218
272
|
* })
|
|
219
273
|
*
|
|
220
|
-
* const address =
|
|
274
|
+
* const address = AccountConfig.getAddress(initialConfig, {
|
|
221
275
|
* factory: '0x7171717171717171717171717171717171717171'
|
|
222
276
|
* })
|
|
223
277
|
* ```
|
|
224
278
|
*
|
|
225
|
-
* @param config - The initial
|
|
279
|
+
* @param config - The initial account config.
|
|
226
280
|
* @param options - The recovery factory configured by the chain.
|
|
227
|
-
* @returns The
|
|
281
|
+
* @returns The configurable account address.
|
|
228
282
|
*/
|
|
229
283
|
export function getAddress(config, options) {
|
|
230
284
|
Address.assert(options.factory);
|
|
@@ -238,7 +292,7 @@ export function getAddress(config, options) {
|
|
|
238
292
|
Hex.fromNumber(owner.weight, { size: 1 }),
|
|
239
293
|
])));
|
|
240
294
|
const account = ContractAddress.fromCreate2({
|
|
241
|
-
bytecodeHash:
|
|
295
|
+
bytecodeHash: accountProxyInitCodeHash,
|
|
242
296
|
from: options.factory,
|
|
243
297
|
salt: accountSalt,
|
|
244
298
|
});
|
|
@@ -251,16 +305,16 @@ export function getAddress(config, options) {
|
|
|
251
305
|
return account;
|
|
252
306
|
}
|
|
253
307
|
/**
|
|
254
|
-
* Computes the commitment for
|
|
308
|
+
* Computes the commitment for an account configuration.
|
|
255
309
|
*
|
|
256
310
|
* The commitment uses raw fixed-width fields, not RLP or ABI encoding:
|
|
257
|
-
* `keccak256("tempo:
|
|
311
|
+
* `keccak256("tempo:configurable-account:config" || salt || uint64be(version) || uint8(threshold) || uint8(owners.length) || owners)`.
|
|
258
312
|
*
|
|
259
313
|
* @example
|
|
260
314
|
* ```ts twoslash
|
|
261
|
-
* import {
|
|
315
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
262
316
|
*
|
|
263
|
-
* const commitment =
|
|
317
|
+
* const commitment = AccountConfig.getCommitment({
|
|
264
318
|
* owners: [
|
|
265
319
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
266
320
|
* ],
|
|
@@ -269,7 +323,7 @@ export function getAddress(config, options) {
|
|
|
269
323
|
* })
|
|
270
324
|
* ```
|
|
271
325
|
*
|
|
272
|
-
* @param config - The complete
|
|
326
|
+
* @param config - The complete account configuration.
|
|
273
327
|
* @returns The configuration commitment.
|
|
274
328
|
*/
|
|
275
329
|
export function getCommitment(config) {
|
|
@@ -280,9 +334,9 @@ export function getCommitment(config) {
|
|
|
280
334
|
])));
|
|
281
335
|
}
|
|
282
336
|
/**
|
|
283
|
-
* Computes the digest a
|
|
337
|
+
* Computes the digest a configurable account owner approves (signs).
|
|
284
338
|
*
|
|
285
|
-
* `keccak256("tempo:
|
|
339
|
+
* `keccak256("tempo:configurable-account:signature" || inner_digest || account || uint64be(version))`,
|
|
286
340
|
* where `inner_digest` is the transaction sign payload
|
|
287
341
|
* ({@link ox#TxEnvelopeTempo.(getSignPayload:function)}).
|
|
288
342
|
*
|
|
@@ -292,9 +346,9 @@ export function getCommitment(config) {
|
|
|
292
346
|
*
|
|
293
347
|
* @example
|
|
294
348
|
* ```ts twoslash
|
|
295
|
-
* import {
|
|
349
|
+
* import { AccountConfig, TxEnvelopeTempo } from 'ox/tempo'
|
|
296
350
|
*
|
|
297
|
-
* const config =
|
|
351
|
+
* const config = AccountConfig.from({
|
|
298
352
|
* owners: [
|
|
299
353
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
300
354
|
* ],
|
|
@@ -306,8 +360,8 @@ export function getCommitment(config) {
|
|
|
306
360
|
* calls: [],
|
|
307
361
|
* })
|
|
308
362
|
*
|
|
309
|
-
* const digest =
|
|
310
|
-
* account:
|
|
363
|
+
* const digest = AccountConfig.getSignPayload({
|
|
364
|
+
* account: AccountConfig.getAddress(config, {
|
|
311
365
|
* factory: '0x7171717171717171717171717171717171717171'
|
|
312
366
|
* }),
|
|
313
367
|
* config,
|
|
@@ -327,13 +381,13 @@ export function getSignPayload(value) {
|
|
|
327
381
|
return Hash.keccak256(Hex.concat(Hex.fromString(signatureDomain), Hex.from(payload), account, Hex.fromNumber(config.version ?? 0n, { size: 8 })));
|
|
328
382
|
}
|
|
329
383
|
/**
|
|
330
|
-
* Converts
|
|
384
|
+
* Converts an account configuration to its JSON-RPC representation.
|
|
331
385
|
*
|
|
332
386
|
* @example
|
|
333
387
|
* ```ts twoslash
|
|
334
|
-
* import {
|
|
388
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
335
389
|
*
|
|
336
|
-
* const config =
|
|
390
|
+
* const config = AccountConfig.toRpc({
|
|
337
391
|
* owners: [
|
|
338
392
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
339
393
|
* ],
|
|
@@ -341,8 +395,8 @@ export function getSignPayload(value) {
|
|
|
341
395
|
* })
|
|
342
396
|
* ```
|
|
343
397
|
*
|
|
344
|
-
* @param config - The
|
|
345
|
-
* @returns The JSON-RPC
|
|
398
|
+
* @param config - The account configuration.
|
|
399
|
+
* @returns The JSON-RPC account configuration.
|
|
346
400
|
*/
|
|
347
401
|
export function toRpc(config) {
|
|
348
402
|
const value = from(config);
|
|
@@ -357,7 +411,7 @@ export function toRpc(config) {
|
|
|
357
411
|
};
|
|
358
412
|
}
|
|
359
413
|
/**
|
|
360
|
-
* Converts a {@link ox#
|
|
414
|
+
* Converts a {@link ox#AccountConfig.Config} to its RLP tuple form.
|
|
361
415
|
*
|
|
362
416
|
* Tuple shape: `[salt, version, threshold, [[owner, weight], ...]]`. The
|
|
363
417
|
* 32-byte `salt` encodes as a full fixed-width string; other integers use
|
|
@@ -365,9 +419,9 @@ export function toRpc(config) {
|
|
|
365
419
|
*
|
|
366
420
|
* @example
|
|
367
421
|
* ```ts twoslash
|
|
368
|
-
* import {
|
|
422
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
369
423
|
*
|
|
370
|
-
* const tuple =
|
|
424
|
+
* const tuple = AccountConfig.toTuple({
|
|
371
425
|
* owners: [
|
|
372
426
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
373
427
|
* ],
|
|
@@ -375,7 +429,7 @@ export function toRpc(config) {
|
|
|
375
429
|
* })
|
|
376
430
|
* ```
|
|
377
431
|
*
|
|
378
|
-
* @param config - The
|
|
432
|
+
* @param config - The account config.
|
|
379
433
|
* @returns The RLP tuple.
|
|
380
434
|
*/
|
|
381
435
|
export function toTuple(config) {
|
|
@@ -393,14 +447,57 @@ export function toTuple(config) {
|
|
|
393
447
|
];
|
|
394
448
|
}
|
|
395
449
|
/**
|
|
396
|
-
*
|
|
450
|
+
* Derives the configuration that replaces the current one in an owner update.
|
|
451
|
+
*
|
|
452
|
+
* Mirrors the `updateConfig` precompile ([TIP-1109](https://tips.sh/1109)):
|
|
453
|
+
* keeps the current salt, increments the version by one, and replaces the
|
|
454
|
+
* owners and threshold. Owners are sorted into canonical order and the next
|
|
455
|
+
* configuration is validated. The account address does not change.
|
|
456
|
+
*
|
|
457
|
+
* @example
|
|
458
|
+
* ```ts twoslash
|
|
459
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
460
|
+
*
|
|
461
|
+
* const initialConfig = AccountConfig.from({
|
|
462
|
+
* owners: [
|
|
463
|
+
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
464
|
+
* ],
|
|
465
|
+
* threshold: 1,
|
|
466
|
+
* })
|
|
467
|
+
*
|
|
468
|
+
* const config = AccountConfig.update(initialConfig, {
|
|
469
|
+
* owners: [
|
|
470
|
+
* { owner: '0x2222222222222222222222222222222222222222', weight: 1 },
|
|
471
|
+
* ],
|
|
472
|
+
* threshold: 1,
|
|
473
|
+
* })
|
|
474
|
+
* // config.version === 1n, with the initial salt
|
|
475
|
+
* ```
|
|
476
|
+
*
|
|
477
|
+
* @param config - The current account config.
|
|
478
|
+
* @param options - The replacement owners and threshold.
|
|
479
|
+
* @returns The next account config.
|
|
480
|
+
*/
|
|
481
|
+
export function update(config, options) {
|
|
482
|
+
const current = from(config);
|
|
483
|
+
if (current.version === maxVersion)
|
|
484
|
+
throw new InvalidConfigError({ reason: 'version overflow' });
|
|
485
|
+
return from({
|
|
486
|
+
owners: options.owners,
|
|
487
|
+
salt: current.salt,
|
|
488
|
+
threshold: options.threshold,
|
|
489
|
+
version: current.version + 1n,
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Validates an {@link ox#AccountConfig.Config}. Returns `true`
|
|
397
494
|
* if valid, `false` otherwise.
|
|
398
495
|
*
|
|
399
496
|
* @example
|
|
400
497
|
* ```ts twoslash
|
|
401
|
-
* import {
|
|
498
|
+
* import { AccountConfig } from 'ox/tempo'
|
|
402
499
|
*
|
|
403
|
-
* const valid =
|
|
500
|
+
* const valid = AccountConfig.validate({
|
|
404
501
|
* owners: [
|
|
405
502
|
* { owner: '0x1111111111111111111111111111111111111111', weight: 1 },
|
|
406
503
|
* ],
|
|
@@ -409,7 +506,7 @@ export function toTuple(config) {
|
|
|
409
506
|
* // @log: true
|
|
410
507
|
* ```
|
|
411
508
|
*
|
|
412
|
-
* @param config - The
|
|
509
|
+
* @param config - The account config.
|
|
413
510
|
* @returns Whether the config is valid.
|
|
414
511
|
*/
|
|
415
512
|
export function validate(config) {
|
|
@@ -421,15 +518,15 @@ export function validate(config) {
|
|
|
421
518
|
return false;
|
|
422
519
|
}
|
|
423
520
|
}
|
|
424
|
-
/** Thrown when
|
|
521
|
+
/** Thrown when an account config is invalid. */
|
|
425
522
|
export class InvalidConfigError extends Errors.BaseError {
|
|
426
523
|
constructor({ reason }) {
|
|
427
|
-
super(`Invalid
|
|
524
|
+
super(`Invalid account config: ${reason}.`);
|
|
428
525
|
Object.defineProperty(this, "name", {
|
|
429
526
|
enumerable: true,
|
|
430
527
|
configurable: true,
|
|
431
528
|
writable: true,
|
|
432
|
-
value: '
|
|
529
|
+
value: 'AccountConfig.InvalidConfigError'
|
|
433
530
|
});
|
|
434
531
|
}
|
|
435
532
|
}
|
|
@@ -443,4 +540,4 @@ function assertVersion(version) {
|
|
|
443
540
|
reason: 'version must be an unsigned 64-bit integer',
|
|
444
541
|
});
|
|
445
542
|
}
|
|
446
|
-
//# sourceMappingURL=
|
|
543
|
+
//# sourceMappingURL=AccountConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountConfig.js","sourceRoot":"","sources":["../../tempo/AccountConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAE7C,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AAGrC,oEAAoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAE1C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAA;AAE3B,6EAA6E;AAC7E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAE9B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAEhC,qDAAqD;AACrD,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,IAAI,GAAG,GAAG,EAAE,CAAA;AAExC,qEAAqE;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAe,CAAA;AAEhD,gEAAgE;AAChE,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAW,CAAA;AAEvD,qEAAqE;AACrE,MAAM,aAAa,GAAG,oCAAoC,CAAA;AAE1D,2DAA2D;AAC3D,MAAM,YAAY,GAAG,mCAAmC,CAAA;AAExD;;;;;GAKG;AACH,MAAM,wBAAwB,GAC5B,oEAAoE,CAA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