ox 1.7.0 → 1.7.2
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 +21 -0
- package/dist/core/Hash.js +1 -1
- package/dist/core/Hash.js.map +1 -1
- package/dist/core/Siwe.d.ts.map +1 -1
- package/dist/core/Siwe.js +45 -6
- package/dist/core/Siwe.js.map +1 -1
- package/dist/tempo/KeyAuthorization.d.ts +1 -1
- package/dist/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/tempo/MultisigConfig.d.ts +151 -83
- package/dist/tempo/MultisigConfig.d.ts.map +1 -1
- package/dist/tempo/MultisigConfig.js +164 -86
- package/dist/tempo/MultisigConfig.js.map +1 -1
- package/dist/tempo/MultisigOperation.d.ts +324 -0
- package/dist/tempo/MultisigOperation.d.ts.map +1 -0
- package/dist/tempo/MultisigOperation.js +809 -0
- package/dist/tempo/MultisigOperation.js.map +1 -0
- package/dist/tempo/MultisigWitness.d.ts +106 -0
- package/dist/tempo/MultisigWitness.d.ts.map +1 -0
- package/dist/tempo/MultisigWitness.js +118 -0
- package/dist/tempo/MultisigWitness.js.map +1 -0
- package/dist/tempo/RpcSchemaTempo.d.ts +35 -0
- package/dist/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/dist/tempo/SignatureEnvelope.d.ts +60 -80
- package/dist/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/dist/tempo/SignatureEnvelope.js +87 -146
- package/dist/tempo/SignatureEnvelope.js.map +1 -1
- package/dist/tempo/TransactionRequest.d.ts +9 -17
- package/dist/tempo/TransactionRequest.d.ts.map +1 -1
- package/dist/tempo/TransactionRequest.js +7 -7
- package/dist/tempo/TransactionRequest.js.map +1 -1
- package/dist/tempo/TxEnvelopeTempo.d.ts +3 -2
- package/dist/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/dist/tempo/TxEnvelopeTempo.js +3 -2
- package/dist/tempo/TxEnvelopeTempo.js.map +1 -1
- package/dist/tempo/index.d.ts +22 -2
- package/dist/tempo/index.d.ts.map +1 -1
- package/dist/tempo/index.js +22 -2
- package/dist/tempo/index.js.map +1 -1
- package/dist/zod/tempo/AuthorizationTempo.d.ts +110 -110
- package/dist/zod/tempo/AuthorizationTempo.d.ts.map +1 -1
- package/dist/zod/tempo/KeyAuthorization.d.ts +90 -83
- package/dist/zod/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/zod/tempo/MultisigConfig.d.ts +31 -2
- package/dist/zod/tempo/MultisigConfig.d.ts.map +1 -1
- package/dist/zod/tempo/MultisigConfig.js +26 -3
- package/dist/zod/tempo/MultisigConfig.js.map +1 -1
- package/dist/zod/tempo/MultisigOperation.d.ts +168 -0
- package/dist/zod/tempo/MultisigOperation.d.ts.map +1 -0
- package/dist/zod/tempo/MultisigOperation.js +65 -0
- package/dist/zod/tempo/MultisigOperation.js.map +1 -0
- package/dist/zod/tempo/MultisigWitness.d.ts +152 -0
- package/dist/zod/tempo/MultisigWitness.d.ts.map +1 -0
- package/dist/zod/tempo/MultisigWitness.js +76 -0
- package/dist/zod/tempo/MultisigWitness.js.map +1 -0
- package/dist/zod/tempo/RpcSchemaTempo.d.ts +607 -102
- package/dist/zod/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/dist/zod/tempo/RpcSchemaTempo.js +38 -0
- package/dist/zod/tempo/RpcSchemaTempo.js.map +1 -1
- package/dist/zod/tempo/SignatureEnvelope.d.ts +33 -33
- package/dist/zod/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/dist/zod/tempo/SignatureEnvelope.js +9 -16
- package/dist/zod/tempo/SignatureEnvelope.js.map +1 -1
- package/dist/zod/tempo/Transaction.d.ts +228 -222
- package/dist/zod/tempo/Transaction.d.ts.map +1 -1
- package/dist/zod/tempo/TransactionRequest.d.ts +379 -176
- package/dist/zod/tempo/TransactionRequest.d.ts.map +1 -1
- package/dist/zod/tempo/TransactionRequest.js +11 -22
- package/dist/zod/tempo/TransactionRequest.js.map +1 -1
- package/dist/zod/tempo/TxEnvelopeTempo.d.ts +60 -48
- package/dist/zod/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/dist/zod/tempo/ZoneRpcAuthentication.d.ts +15 -12
- package/dist/zod/tempo/ZoneRpcAuthentication.d.ts.map +1 -1
- package/dist/zod/tempo/z.d.ts +2 -0
- package/dist/zod/tempo/z.d.ts.map +1 -1
- package/dist/zod/tempo/z.js +2 -0
- package/dist/zod/tempo/z.js.map +1 -1
- package/package.json +21 -1
- package/src/core/Hash.ts +1 -1
- package/src/core/Siwe.ts +45 -5
- package/src/core/_test/Hash.test.ts +15 -0
- package/src/core/_test/Siwe.test.ts +98 -0
- package/src/tempo/KeyAuthorization.test-d.ts +13 -1
- package/src/tempo/KeyAuthorization.test.ts +65 -0
- package/src/tempo/KeyAuthorization.ts +1 -1
- package/src/tempo/MultisigConfig.test-d.ts +52 -0
- package/src/tempo/MultisigConfig.test.ts +288 -227
- package/src/tempo/MultisigConfig.ts +275 -104
- package/src/tempo/MultisigOperation.test-d.ts +77 -0
- package/src/tempo/MultisigOperation.test.ts +1883 -0
- package/src/tempo/MultisigOperation.ts +1254 -0
- package/src/tempo/MultisigWitness.test-d.ts +42 -0
- package/src/tempo/MultisigWitness.test.ts +288 -0
- package/src/tempo/MultisigWitness.ts +210 -0
- package/src/tempo/RpcSchemaTempo.test-d.ts +56 -0
- package/src/tempo/RpcSchemaTempo.ts +37 -0
- package/src/tempo/SignatureEnvelope.test-d.ts +63 -46
- package/src/tempo/SignatureEnvelope.test.ts +523 -500
- package/src/tempo/SignatureEnvelope.ts +172 -242
- package/src/tempo/TransactionRequest.test-d.ts +11 -0
- package/src/tempo/TransactionRequest.test.ts +285 -33
- package/src/tempo/TransactionRequest.ts +15 -20
- package/src/tempo/TxEnvelopeTempo.test-d.ts +7 -0
- package/src/tempo/TxEnvelopeTempo.test.ts +25 -0
- package/src/tempo/TxEnvelopeTempo.ts +5 -3
- package/src/tempo/index.ts +22 -2
- package/src/tempo/multisig.e2e.test.ts +113 -86
- package/src/version.ts +1 -1
- package/src/zod/tempo/MultisigConfig.ts +29 -3
- package/src/zod/tempo/MultisigOperation.ts +69 -0
- package/src/zod/tempo/MultisigWitness.ts +101 -0
- package/src/zod/tempo/RpcSchemaTempo.ts +43 -0
- package/src/zod/tempo/SignatureEnvelope.ts +20 -38
- package/src/zod/tempo/TransactionRequest.ts +17 -26
- package/src/zod/tempo/_test/KeyAuthorization.test.ts +11 -0
- package/src/zod/tempo/_test/MultisigConfig.test-d.ts +13 -0
- package/src/zod/tempo/_test/MultisigConfig.test.ts +13 -2
- package/src/zod/tempo/_test/MultisigOperation.test-d.ts +27 -0
- package/src/zod/tempo/_test/MultisigOperation.test.ts +68 -0
- package/src/zod/tempo/_test/MultisigWitness.test-d.ts +13 -0
- package/src/zod/tempo/_test/MultisigWitness.test.ts +149 -0
- package/src/zod/tempo/_test/RpcSchemaTempo.test-d.ts +31 -0
- package/src/zod/tempo/_test/RpcSchemaTempo.test.ts +41 -0
- package/src/zod/tempo/_test/SignatureEnvelope.test-d.ts +1 -1
- package/src/zod/tempo/_test/SignatureEnvelope.test.ts +25 -34
- package/src/zod/tempo/_test/TransactionRequest.test.ts +176 -8
- package/src/zod/tempo/z.ts +2 -0
|
@@ -2,12 +2,6 @@ import * as Address from '../core/Address.js';
|
|
|
2
2
|
import * as Errors from '../core/Errors.js';
|
|
3
3
|
import * as Hash from '../core/Hash.js';
|
|
4
4
|
import * as Hex from '../core/Hex.js';
|
|
5
|
-
/** Maximum number of owners allowed in a native multisig config. */
|
|
6
|
-
export const maxOwners = 50;
|
|
7
|
-
/** Maximum threshold accepted by a native multisig config. */
|
|
8
|
-
export const maxThreshold = 8;
|
|
9
|
-
/** Maximum number of owner approvals in a native multisig signature. */
|
|
10
|
-
export const maxSignatures = maxThreshold;
|
|
11
5
|
/**
|
|
12
6
|
* Maximum number of native multisig signatures in one nested authorization
|
|
13
7
|
* path, including the top-level transaction signature.
|
|
@@ -15,21 +9,32 @@ export const maxSignatures = maxThreshold;
|
|
|
15
9
|
export const maxNestingDepth = 2;
|
|
16
10
|
/** Maximum encoded byte length for one primitive owner approval. */
|
|
17
11
|
export const maxOwnerSignatureBytes = 2049;
|
|
12
|
+
/** Maximum number of owners allowed in a native multisig config. */
|
|
13
|
+
export const maxOwners = 48;
|
|
14
|
+
/** Maximum number of owner approvals in a native multisig signature. */
|
|
15
|
+
export const maxSignatures = 8;
|
|
16
|
+
/** Maximum threshold accepted by a native multisig config. */
|
|
17
|
+
export const maxThreshold = 0xff;
|
|
18
|
+
/** Maximum version accepted by a native multisig config. */
|
|
19
|
+
export const maxVersion = 2n ** 64n - 1n;
|
|
18
20
|
/** Tempo signature type byte for native multisig signatures. */
|
|
19
21
|
export const signatureTypeByte = '0x05';
|
|
20
22
|
/** Zero 32-byte salt (the default when no salt is provided). */
|
|
21
23
|
export const zeroSalt = `0x${'00'.repeat(32)}`;
|
|
22
24
|
/** Domain prefix for the native multisig account address derivation. */
|
|
23
25
|
const accountDomain = 'tempo:multisig:account';
|
|
26
|
+
/** Domain prefix for native multisig configuration commitments. */
|
|
27
|
+
const configDomain = 'tempo:multisig:config';
|
|
24
28
|
/** Domain prefix for native multisig owner approvals. */
|
|
25
29
|
const signatureDomain = 'tempo:multisig:signature';
|
|
26
30
|
/**
|
|
27
31
|
* Asserts that a native multisig {@link ox#MultisigConfig.Config} is valid.
|
|
28
32
|
*
|
|
29
|
-
* Mirrors the Tempo
|
|
33
|
+
* Mirrors the Tempo configuration rules: owners non-empty and
|
|
30
34
|
* `<= maxOwners`, strictly ascending unique nonzero owner addresses, nonzero
|
|
31
35
|
* integer owner weights, integer `threshold` between `1` and `maxThreshold`,
|
|
32
|
-
* total weight `<= 255` (u8 max), and
|
|
36
|
+
* total weight `<= 255` (u8 max), and a threshold reachable by at most
|
|
37
|
+
* `maxSignatures` owners.
|
|
33
38
|
*
|
|
34
39
|
* @example
|
|
35
40
|
* ```ts twoslash
|
|
@@ -49,9 +54,10 @@ const signatureDomain = 'tempo:multisig:signature';
|
|
|
49
54
|
* @param config - The multisig config.
|
|
50
55
|
*/
|
|
51
56
|
export function assert(config) {
|
|
52
|
-
const { salt, threshold,
|
|
57
|
+
const { owners, salt, threshold, version = 0n } = config;
|
|
53
58
|
if (typeof salt !== 'undefined' && Hex.size(salt) !== 32)
|
|
54
59
|
throw new InvalidConfigError({ reason: 'salt must be 32 bytes' });
|
|
60
|
+
assertVersion(version);
|
|
55
61
|
if (owners.length === 0)
|
|
56
62
|
throw new InvalidConfigError({ reason: 'owners cannot be empty' });
|
|
57
63
|
if (owners.length > maxOwners)
|
|
@@ -63,6 +69,7 @@ export function assert(config) {
|
|
|
63
69
|
if (Number(threshold) > maxThreshold)
|
|
64
70
|
throw new InvalidConfigError({ reason: 'threshold exceeds max threshold' });
|
|
65
71
|
let totalWeight = 0;
|
|
72
|
+
const weights = [];
|
|
66
73
|
let previous;
|
|
67
74
|
for (const owner of owners) {
|
|
68
75
|
if (!Address.validate(owner.owner) || Hex.toBigInt(owner.owner) === 0n)
|
|
@@ -79,7 +86,9 @@ export function assert(config) {
|
|
|
79
86
|
reason: 'owners must be strictly ascending',
|
|
80
87
|
});
|
|
81
88
|
previous = current;
|
|
82
|
-
|
|
89
|
+
const weight = Number(owner.weight);
|
|
90
|
+
totalWeight += weight;
|
|
91
|
+
weights.push(weight);
|
|
83
92
|
}
|
|
84
93
|
if (totalWeight > 0xff)
|
|
85
94
|
throw new InvalidConfigError({
|
|
@@ -89,45 +98,57 @@ export function assert(config) {
|
|
|
89
98
|
throw new InvalidConfigError({
|
|
90
99
|
reason: 'threshold exceeds total owner weight',
|
|
91
100
|
});
|
|
101
|
+
const reachableWeight = weights
|
|
102
|
+
.sort((a, b) => b - a)
|
|
103
|
+
.slice(0, maxSignatures)
|
|
104
|
+
.reduce((sum, weight) => sum + weight, 0);
|
|
105
|
+
if (Number(threshold) > reachableWeight)
|
|
106
|
+
throw new InvalidConfigError({
|
|
107
|
+
reason: `threshold exceeds weight reachable by ${maxSignatures} owner signatures`,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// eslint-disable-next-line jsdoc-js/require-jsdoc
|
|
111
|
+
export function from(config) {
|
|
112
|
+
const version = config.version ?? 0n;
|
|
113
|
+
assertVersion(version);
|
|
114
|
+
const owners = [...config.owners].sort((a, b) => Hex.toBigInt(a.owner) < Hex.toBigInt(b.owner) ? -1 : 1);
|
|
115
|
+
const normalized = {
|
|
116
|
+
owners,
|
|
117
|
+
salt: config.salt ? Hex.padLeft(config.salt, 32) : zeroSalt,
|
|
118
|
+
threshold: config.threshold,
|
|
119
|
+
version: BigInt(version),
|
|
120
|
+
};
|
|
121
|
+
assert(normalized);
|
|
122
|
+
return normalized;
|
|
92
123
|
}
|
|
93
124
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* Sorts owners into strictly ascending `owner` address order (the canonical
|
|
97
|
-
* form required for account derivation) and asserts the config is valid.
|
|
125
|
+
* Converts a JSON-RPC multisig configuration to its domain representation.
|
|
98
126
|
*
|
|
99
127
|
* @example
|
|
100
128
|
* ```ts twoslash
|
|
101
129
|
* import { MultisigConfig } from 'ox/tempo'
|
|
102
130
|
*
|
|
103
|
-
* const config = MultisigConfig.
|
|
104
|
-
* threshold: 2,
|
|
131
|
+
* const config = MultisigConfig.fromRpc({
|
|
105
132
|
* owners: [
|
|
106
133
|
* {
|
|
107
|
-
* owner: '0x2222222222222222222222222222222222222222',
|
|
108
|
-
* weight: 1
|
|
109
|
-
* },
|
|
110
|
-
* {
|
|
111
134
|
* owner: '0x1111111111111111111111111111111111111111',
|
|
112
135
|
* weight: 1
|
|
113
136
|
* }
|
|
114
|
-
* ]
|
|
137
|
+
* ],
|
|
138
|
+
* salt: `0x${'00'.repeat(32)}`,
|
|
139
|
+
* threshold: 1,
|
|
140
|
+
* version: '0x0'
|
|
115
141
|
* })
|
|
116
|
-
* // owners are now sorted ascending by address
|
|
117
142
|
* ```
|
|
118
143
|
*
|
|
119
|
-
* @param config - The multisig
|
|
120
|
-
* @returns The normalized multisig
|
|
144
|
+
* @param config - The JSON-RPC multisig configuration.
|
|
145
|
+
* @returns The normalized multisig configuration.
|
|
121
146
|
*/
|
|
122
|
-
export function
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
owners,
|
|
128
|
-
};
|
|
129
|
-
assert(normalized);
|
|
130
|
-
return normalized;
|
|
147
|
+
export function fromRpc(config) {
|
|
148
|
+
return from({
|
|
149
|
+
...config,
|
|
150
|
+
version: Hex.toBigInt(config.version),
|
|
151
|
+
});
|
|
131
152
|
}
|
|
132
153
|
/**
|
|
133
154
|
* Converts an RLP {@link ox#MultisigConfig.Tuple} back to a
|
|
@@ -139,6 +160,7 @@ export function from(config) {
|
|
|
139
160
|
*
|
|
140
161
|
* const config = MultisigConfig.fromTuple([
|
|
141
162
|
* `0x${'00'.repeat(32)}`,
|
|
163
|
+
* '0x',
|
|
142
164
|
* '0x01',
|
|
143
165
|
* [['0x1111111111111111111111111111111111111111', '0x01']]
|
|
144
166
|
* ])
|
|
@@ -148,10 +170,8 @@ export function from(config) {
|
|
|
148
170
|
* @returns The multisig config.
|
|
149
171
|
*/
|
|
150
172
|
export function fromTuple(tuple) {
|
|
151
|
-
const [salt, threshold, owners] = tuple;
|
|
173
|
+
const [salt, version, threshold, owners] = tuple;
|
|
152
174
|
return {
|
|
153
|
-
salt: salt && salt !== '0x' ? Hex.padLeft(salt, 32) : zeroSalt,
|
|
154
|
-
threshold: threshold === '0x' ? 0 : Hex.toNumber(threshold),
|
|
155
175
|
owners: owners.map((owner) => {
|
|
156
176
|
const [ownerAddress, weight] = owner;
|
|
157
177
|
return {
|
|
@@ -159,6 +179,9 @@ export function fromTuple(tuple) {
|
|
|
159
179
|
weight: !weight || weight === '0x' ? 0 : Hex.toNumber(weight),
|
|
160
180
|
};
|
|
161
181
|
}),
|
|
182
|
+
salt: salt && salt !== '0x' ? Hex.padLeft(salt, 32) : zeroSalt,
|
|
183
|
+
threshold: threshold === '0x' ? 0 : Hex.toNumber(threshold),
|
|
184
|
+
version: version === '0x' ? 0n : Hex.toBigInt(version),
|
|
162
185
|
};
|
|
163
186
|
}
|
|
164
187
|
/**
|
|
@@ -167,31 +190,35 @@ export function fromTuple(tuple) {
|
|
|
167
190
|
* Preimage (fixed-width big-endian, **not** RLP):
|
|
168
191
|
* `keccak256("tempo:multisig:account" || salt || u8(threshold) || u8(owners.length) || (owner || u8(weight)) for each owner)[12:32]`.
|
|
169
192
|
*
|
|
170
|
-
* The address is derived once from the initial
|
|
171
|
-
*
|
|
193
|
+
* The address is derived once from the initial version-0 config. Config
|
|
194
|
+
* updates do not change it.
|
|
172
195
|
*
|
|
173
196
|
* @example
|
|
174
197
|
* ```ts twoslash
|
|
175
198
|
* import { MultisigConfig } from 'ox/tempo'
|
|
176
199
|
*
|
|
177
200
|
* const initialConfig = MultisigConfig.from({
|
|
178
|
-
* threshold: 1,
|
|
179
201
|
* owners: [
|
|
180
202
|
* {
|
|
181
203
|
* owner: '0x1111111111111111111111111111111111111111',
|
|
182
204
|
* weight: 1
|
|
183
205
|
* }
|
|
184
|
-
* ]
|
|
206
|
+
* ],
|
|
207
|
+
* threshold: 1
|
|
185
208
|
* })
|
|
186
209
|
*
|
|
187
210
|
* const address = MultisigConfig.getAddress(initialConfig)
|
|
188
211
|
* ```
|
|
189
212
|
*
|
|
190
|
-
* @param config - The initial
|
|
213
|
+
* @param config - The initial multisig config.
|
|
191
214
|
* @returns The multisig account address.
|
|
192
215
|
*/
|
|
193
216
|
export function getAddress(config) {
|
|
194
217
|
assert(config);
|
|
218
|
+
if (BigInt(config.version ?? 0) !== 0n)
|
|
219
|
+
throw new InvalidConfigError({
|
|
220
|
+
reason: 'account address requires version zero',
|
|
221
|
+
});
|
|
195
222
|
const hash = Hash.keccak256(Hex.concat(Hex.fromString(accountDomain), Hex.padLeft(config.salt ?? zeroSalt, 32), Hex.fromNumber(config.threshold, { size: 1 }), Hex.fromNumber(config.owners.length, { size: 1 }), ...config.owners.flatMap((owner) => [
|
|
196
223
|
owner.owner,
|
|
197
224
|
Hex.fromNumber(owner.weight, { size: 1 }),
|
|
@@ -199,8 +226,44 @@ export function getAddress(config) {
|
|
|
199
226
|
const account = Address.from(Hex.slice(hash, 12, 32));
|
|
200
227
|
if (Hex.toBigInt(account) === 0n)
|
|
201
228
|
throw new InvalidConfigError({ reason: 'derived account cannot be zero' });
|
|
229
|
+
if (config.owners.some((owner) => Address.isEqual(owner.owner, account)))
|
|
230
|
+
throw new InvalidConfigError({
|
|
231
|
+
reason: 'derived account cannot be an owner',
|
|
232
|
+
});
|
|
202
233
|
return account;
|
|
203
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Computes the commitment for a native multisig configuration.
|
|
237
|
+
*
|
|
238
|
+
* The commitment uses raw fixed-width fields, not RLP or ABI encoding:
|
|
239
|
+
* `keccak256("tempo:multisig:config" || salt || uint64be(version) || uint8(threshold) || uint8(owners.length) || owners)`.
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```ts twoslash
|
|
243
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
244
|
+
*
|
|
245
|
+
* const commitment = MultisigConfig.getCommitment({
|
|
246
|
+
* owners: [
|
|
247
|
+
* {
|
|
248
|
+
* owner: '0x1111111111111111111111111111111111111111',
|
|
249
|
+
* weight: 1
|
|
250
|
+
* }
|
|
251
|
+
* ],
|
|
252
|
+
* threshold: 1,
|
|
253
|
+
* version: 1n
|
|
254
|
+
* })
|
|
255
|
+
* ```
|
|
256
|
+
*
|
|
257
|
+
* @param config - The complete multisig configuration.
|
|
258
|
+
* @returns The configuration commitment.
|
|
259
|
+
*/
|
|
260
|
+
export function getCommitment(config) {
|
|
261
|
+
assert(config);
|
|
262
|
+
return Hash.keccak256(Hex.concat(Hex.fromString(configDomain), Hex.padLeft(config.salt ?? zeroSalt, 32), Hex.fromNumber(config.version ?? 0n, { size: 8 }), Hex.fromNumber(config.threshold, { size: 1 }), Hex.fromNumber(config.owners.length, { size: 1 }), ...config.owners.flatMap((owner) => [
|
|
263
|
+
owner.owner,
|
|
264
|
+
Hex.fromNumber(owner.weight, { size: 1 }),
|
|
265
|
+
])));
|
|
266
|
+
}
|
|
204
267
|
/**
|
|
205
268
|
* Computes the digest a native multisig owner approves (signs).
|
|
206
269
|
*
|
|
@@ -208,9 +271,9 @@ export function getAddress(config) {
|
|
|
208
271
|
* where `inner_digest` is the transaction sign payload
|
|
209
272
|
* ({@link ox#TxEnvelopeTempo.(getSignPayload:function)}).
|
|
210
273
|
*
|
|
211
|
-
* The digest is keyed on the permanent `account`
|
|
212
|
-
*
|
|
213
|
-
*
|
|
274
|
+
* The digest is keyed on the permanent `account` and the supplied config
|
|
275
|
+
* version. Initial approvals use version `0n`; each config update increments
|
|
276
|
+
* it.
|
|
214
277
|
*
|
|
215
278
|
* For a nested multisig owner approval, the parent digest becomes the nested
|
|
216
279
|
* approval's `payload`, with the nested multisig `account`.
|
|
@@ -219,14 +282,14 @@ export function getAddress(config) {
|
|
|
219
282
|
* ```ts twoslash
|
|
220
283
|
* import { MultisigConfig, TxEnvelopeTempo } from 'ox/tempo'
|
|
221
284
|
*
|
|
222
|
-
* const
|
|
223
|
-
* threshold: 1,
|
|
285
|
+
* const config = MultisigConfig.from({
|
|
224
286
|
* owners: [
|
|
225
287
|
* {
|
|
226
288
|
* owner: '0x1111111111111111111111111111111111111111',
|
|
227
289
|
* weight: 1
|
|
228
290
|
* }
|
|
229
|
-
* ]
|
|
291
|
+
* ],
|
|
292
|
+
* threshold: 1
|
|
230
293
|
* })
|
|
231
294
|
*
|
|
232
295
|
* const envelope = TxEnvelopeTempo.from({
|
|
@@ -235,58 +298,57 @@ export function getAddress(config) {
|
|
|
235
298
|
* })
|
|
236
299
|
*
|
|
237
300
|
* const digest = MultisigConfig.getSignPayload({
|
|
238
|
-
*
|
|
239
|
-
*
|
|
301
|
+
* account: MultisigConfig.getAddress(config),
|
|
302
|
+
* config,
|
|
303
|
+
* payload: TxEnvelopeTempo.getSignPayload(envelope)
|
|
240
304
|
* })
|
|
241
305
|
* ```
|
|
242
306
|
*
|
|
243
|
-
* @
|
|
244
|
-
*
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
307
|
+
* @param value - The digest derivation parameters.
|
|
308
|
+
* @returns The owner approval digest.
|
|
309
|
+
*/
|
|
310
|
+
export function getSignPayload(value) {
|
|
311
|
+
const { account, config, payload } = value;
|
|
312
|
+
assertVersion(config.version);
|
|
313
|
+
return Hash.keccak256(Hex.concat(Hex.fromString(signatureDomain), Hex.from(payload), account, Hex.fromNumber(config.version ?? 0n, { size: 8 })));
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Converts a multisig configuration to its JSON-RPC representation.
|
|
248
317
|
*
|
|
318
|
+
* @example
|
|
249
319
|
* ```ts twoslash
|
|
250
|
-
* import { MultisigConfig
|
|
320
|
+
* import { MultisigConfig } from 'ox/tempo'
|
|
251
321
|
*
|
|
252
|
-
* const
|
|
253
|
-
* threshold: 1,
|
|
322
|
+
* const config = MultisigConfig.toRpc({
|
|
254
323
|
* owners: [
|
|
255
324
|
* {
|
|
256
325
|
* owner: '0x1111111111111111111111111111111111111111',
|
|
257
326
|
* weight: 1
|
|
258
327
|
* }
|
|
259
|
-
* ]
|
|
260
|
-
*
|
|
261
|
-
* const account = MultisigConfig.getAddress(initialConfig)
|
|
262
|
-
*
|
|
263
|
-
* const envelope = TxEnvelopeTempo.from({
|
|
264
|
-
* chainId: 1,
|
|
265
|
-
* calls: []
|
|
266
|
-
* })
|
|
267
|
-
*
|
|
268
|
-
* const digest = MultisigConfig.getSignPayload({
|
|
269
|
-
* payload: TxEnvelopeTempo.getSignPayload(envelope),
|
|
270
|
-
* account,
|
|
271
|
-
* version: 1n
|
|
328
|
+
* ],
|
|
329
|
+
* threshold: 1
|
|
272
330
|
* })
|
|
273
331
|
* ```
|
|
274
332
|
*
|
|
275
|
-
* @param
|
|
276
|
-
* @returns The
|
|
333
|
+
* @param config - The multisig configuration.
|
|
334
|
+
* @returns The JSON-RPC multisig configuration.
|
|
277
335
|
*/
|
|
278
|
-
export function
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
336
|
+
export function toRpc(config) {
|
|
337
|
+
const value = from(config);
|
|
338
|
+
return {
|
|
339
|
+
owners: value.owners.map((owner) => ({
|
|
340
|
+
owner: owner.owner,
|
|
341
|
+
weight: Number(owner.weight),
|
|
342
|
+
})),
|
|
343
|
+
salt: value.salt,
|
|
344
|
+
threshold: Number(value.threshold),
|
|
345
|
+
version: Hex.fromNumber(value.version),
|
|
346
|
+
};
|
|
284
347
|
}
|
|
285
348
|
/**
|
|
286
|
-
* Converts a {@link ox#MultisigConfig.Config} to its RLP tuple form
|
|
287
|
-
* by the multisig signature `init`).
|
|
349
|
+
* Converts a {@link ox#MultisigConfig.Config} to its RLP tuple form.
|
|
288
350
|
*
|
|
289
|
-
* Tuple shape: `[salt, threshold, [[owner, weight], ...]]`. The
|
|
351
|
+
* Tuple shape: `[salt, version, threshold, [[owner, weight], ...]]`. The
|
|
290
352
|
* 32-byte `salt` encodes as a full fixed-width string; other integers use
|
|
291
353
|
* canonical RLP encoding (zero values encode as `0x`).
|
|
292
354
|
*
|
|
@@ -295,13 +357,13 @@ export function getSignPayload(value) {
|
|
|
295
357
|
* import { MultisigConfig } from 'ox/tempo'
|
|
296
358
|
*
|
|
297
359
|
* const tuple = MultisigConfig.toTuple({
|
|
298
|
-
* threshold: 1,
|
|
299
360
|
* owners: [
|
|
300
361
|
* {
|
|
301
362
|
* owner: '0x1111111111111111111111111111111111111111',
|
|
302
363
|
* weight: 1
|
|
303
364
|
* }
|
|
304
|
-
* ]
|
|
365
|
+
* ],
|
|
366
|
+
* threshold: 1
|
|
305
367
|
* })
|
|
306
368
|
* ```
|
|
307
369
|
*
|
|
@@ -314,7 +376,13 @@ export function toTuple(config) {
|
|
|
314
376
|
// `salt` is a fixed 32-byte value: it RLP-encodes as a full 32-byte string
|
|
315
377
|
// (including the zero salt), never trimmed like an integer.
|
|
316
378
|
const salt = config.salt ? Hex.padLeft(config.salt, 32) : zeroSalt;
|
|
317
|
-
|
|
379
|
+
const version = BigInt(config.version ?? 0);
|
|
380
|
+
return [
|
|
381
|
+
salt,
|
|
382
|
+
version === 0n ? '0x' : Hex.fromNumber(version),
|
|
383
|
+
Hex.fromNumber(config.threshold),
|
|
384
|
+
owners,
|
|
385
|
+
];
|
|
318
386
|
}
|
|
319
387
|
/**
|
|
320
388
|
* Validates a native multisig {@link ox#MultisigConfig.Config}. Returns `true`
|
|
@@ -325,13 +393,13 @@ export function toTuple(config) {
|
|
|
325
393
|
* import { MultisigConfig } from 'ox/tempo'
|
|
326
394
|
*
|
|
327
395
|
* const valid = MultisigConfig.validate({
|
|
328
|
-
* threshold: 1,
|
|
329
396
|
* owners: [
|
|
330
397
|
* {
|
|
331
398
|
* owner: '0x1111111111111111111111111111111111111111',
|
|
332
399
|
* weight: 1
|
|
333
400
|
* }
|
|
334
|
-
* ]
|
|
401
|
+
* ],
|
|
402
|
+
* threshold: 1
|
|
335
403
|
* })
|
|
336
404
|
* // @log: true
|
|
337
405
|
* ```
|
|
@@ -355,4 +423,14 @@ export class InvalidConfigError extends Errors.BaseError {
|
|
|
355
423
|
super(`Invalid native multisig config: ${reason}.`);
|
|
356
424
|
}
|
|
357
425
|
}
|
|
426
|
+
/** @internal */
|
|
427
|
+
function assertVersion(version) {
|
|
428
|
+
if ((typeof version !== 'bigint' && typeof version !== 'number') ||
|
|
429
|
+
(typeof version === 'number' && !Number.isSafeInteger(version)) ||
|
|
430
|
+
BigInt(version) < 0n ||
|
|
431
|
+
BigInt(version) > maxVersion)
|
|
432
|
+
throw new InvalidConfigError({
|
|
433
|
+
reason: 'version must be an unsigned 64-bit integer',
|
|
434
|
+
});
|
|
435
|
+
}
|
|
358
436
|
//# sourceMappingURL=MultisigConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultisigConfig.js","sourceRoot":"","sources":["../../src/tempo/MultisigConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAE7C,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,
|
|
1
|
+
{"version":3,"file":"MultisigConfig.js","sourceRoot":"","sources":["../../src/tempo/MultisigConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAE7C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAC3C,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AAGrC;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAA;AAEhC,oEAAoE;AACpE,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;AAE1C,oEAAoE;AACpE,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,CAAA;AAE3B,wEAAwE;AACxE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAE9B,8DAA8D;AAC9D,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAA;AAEhC,4DAA4D;AAC5D,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,IAAI,GAAG,GAAG,EAAE,CAAA;AAExC,gEAAgE;AAChE,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,wEAAwE;AACxE,MAAM,aAAa,GAAG,wBAAwB,CAAA;AAE9C,m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