ox 0.14.57 → 0.14.59
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 +26 -0
- package/_cjs/core/AbiEvent.js +16 -4
- package/_cjs/core/AbiEvent.js.map +1 -1
- package/_cjs/core/Authorization.js +37 -6
- package/_cjs/core/Authorization.js.map +1 -1
- package/_cjs/core/Hex.js +5 -3
- package/_cjs/core/Hex.js.map +1 -1
- package/_cjs/core/RpcTransport.js +32 -19
- package/_cjs/core/RpcTransport.js.map +1 -1
- package/_cjs/core/Siwe.js +1 -1
- package/_cjs/core/Siwe.js.map +1 -1
- package/_cjs/core/TypedData.js +1 -1
- package/_cjs/core/TypedData.js.map +1 -1
- package/_cjs/core/internal/abiItem.js +46 -14
- package/_cjs/core/internal/abiItem.js.map +1 -1
- package/_cjs/tempo/AccountConfig.js +3 -10
- package/_cjs/tempo/AccountConfig.js.map +1 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/core/AbiEvent.js +19 -4
- package/_esm/core/AbiEvent.js.map +1 -1
- package/_esm/core/Authorization.js +47 -6
- package/_esm/core/Authorization.js.map +1 -1
- package/_esm/core/Hex.js +5 -3
- package/_esm/core/Hex.js.map +1 -1
- package/_esm/core/RpcTransport.js +38 -19
- package/_esm/core/RpcTransport.js.map +1 -1
- package/_esm/core/Siwe.js +1 -1
- package/_esm/core/Siwe.js.map +1 -1
- package/_esm/core/TypedData.js +1 -1
- package/_esm/core/TypedData.js.map +1 -1
- package/_esm/core/internal/abiItem.js +51 -17
- package/_esm/core/internal/abiItem.js.map +1 -1
- package/_esm/tempo/AccountConfig.js +8 -26
- package/_esm/tempo/AccountConfig.js.map +1 -1
- package/_esm/tempo/AccountOperation.js +1 -1
- package/_esm/tempo/index.js +1 -3
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/core/AbiEvent.d.ts.map +1 -1
- package/_types/core/Authorization.d.ts.map +1 -1
- package/_types/core/Hex.d.ts +13 -1
- package/_types/core/Hex.d.ts.map +1 -1
- package/_types/core/RpcTransport.d.ts.map +1 -1
- package/_types/core/Siwe.d.ts.map +1 -1
- package/_types/core/internal/abiItem.d.ts.map +1 -1
- package/_types/tempo/AccountConfig.d.ts +7 -17
- package/_types/tempo/AccountConfig.d.ts.map +1 -1
- package/_types/tempo/AccountOperation.d.ts +1 -1
- package/_types/tempo/index.d.ts +1 -3
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/core/AbiEvent.ts +24 -3
- package/core/Authorization.ts +46 -6
- package/core/Hex.ts +17 -3
- package/core/RpcTransport.ts +40 -22
- package/core/Siwe.ts +1 -1
- package/core/TypedData.ts +1 -1
- package/core/internal/abiItem.ts +70 -21
- package/package.json +1 -1
- package/tempo/AccountConfig.test.ts +34 -47
- package/tempo/AccountConfig.ts +9 -37
- package/tempo/AccountOperation.test.ts +36 -37
- package/tempo/AccountOperation.ts +1 -1
- package/tempo/SignatureEnvelope.test.ts +1 -3
- package/tempo/configurableAccounts.e2e.test.ts +1 -2
- package/tempo/index.ts +1 -3
- package/version.ts +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Hash, Hex, Rlp } from 'ox'
|
|
2
2
|
import { AccountConfig } from 'ox/tempo'
|
|
3
3
|
import { describe, expect, test } from 'vitest'
|
|
4
|
-
import { factory } from '../../test/tempo/configurableAccounts.js'
|
|
5
4
|
|
|
6
5
|
const owner_1 = '0x1111111111111111111111111111111111111111'
|
|
7
6
|
const owner_2 = '0x2222222222222222222222222222222222222222'
|
|
@@ -10,13 +9,12 @@ const config = AccountConfig.from({
|
|
|
10
9
|
owners: [{ owner: owner_1, weight: 1 }],
|
|
11
10
|
threshold: 1,
|
|
12
11
|
})
|
|
13
|
-
const account = AccountConfig.getAddress(config
|
|
12
|
+
const account = AccountConfig.getAddress(config)
|
|
14
13
|
|
|
15
14
|
// Vectors from Tempo `crates/primitives/tests/configurable_account.rs`
|
|
16
15
|
// (`configurable_account_hashes_follow_vectors_and_documented_layout`).
|
|
17
16
|
const tempo = {
|
|
18
17
|
account: '0x91847576f406d0842ad7c1a0c97c22a122e64278',
|
|
19
|
-
factory: '0x9999999999999999999999999999999999999999',
|
|
20
18
|
} as const
|
|
21
19
|
|
|
22
20
|
describe('from', () => {
|
|
@@ -181,78 +179,67 @@ describe('fromUpgrade', () => {
|
|
|
181
179
|
describe('getAddress', () => {
|
|
182
180
|
test('example: matches the Tempo vectors', () => {
|
|
183
181
|
expect({
|
|
184
|
-
maxOwners: AccountConfig.getAddress(
|
|
185
|
-
{
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
{ factory: tempo.factory },
|
|
193
|
-
),
|
|
194
|
-
single: AccountConfig.getAddress(config, { factory: tempo.factory }),
|
|
182
|
+
maxOwners: AccountConfig.getAddress({
|
|
183
|
+
owners: Array.from({ length: AccountConfig.maxOwners }, (_, i) => ({
|
|
184
|
+
owner: Hex.padLeft(Hex.fromNumber(i + 1), 20),
|
|
185
|
+
weight: 1,
|
|
186
|
+
})),
|
|
187
|
+
threshold: 8,
|
|
188
|
+
}),
|
|
189
|
+
single: AccountConfig.getAddress(config),
|
|
195
190
|
}).toMatchInlineSnapshot(`
|
|
196
191
|
{
|
|
197
|
-
"maxOwners": "
|
|
198
|
-
"single": "
|
|
192
|
+
"maxOwners": "0x9859f0316567499ebcd81d3417c0622999d7179f",
|
|
193
|
+
"single": "0xcbb727e2489c904a905420e794e8275b6150bfe1",
|
|
199
194
|
}
|
|
200
195
|
`)
|
|
201
196
|
})
|
|
202
197
|
|
|
203
|
-
test('example: matches the frozen
|
|
198
|
+
test('example: matches the frozen keccak vector', () => {
|
|
204
199
|
expect(account).toMatchInlineSnapshot(
|
|
205
|
-
`"
|
|
200
|
+
`"0xcbb727e2489c904a905420e794e8275b6150bfe1"`,
|
|
206
201
|
)
|
|
207
202
|
expect(account).not.toBe('0x8820d1497eeaf4f68e00b2cfc00a2f3b1dbb00da')
|
|
208
203
|
})
|
|
209
204
|
|
|
210
205
|
test('behavior: includes salt, threshold, and owners', () => {
|
|
211
206
|
expect(
|
|
212
|
-
AccountConfig.getAddress(
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
{ factory },
|
|
222
|
-
),
|
|
223
|
-
).toMatchInlineSnapshot(`"0x1baa996a4f142d99999aa22f1cb1eb97eed2a24a"`)
|
|
207
|
+
AccountConfig.getAddress({
|
|
208
|
+
owners: [
|
|
209
|
+
{ owner: owner_1, weight: 1 },
|
|
210
|
+
{ owner: owner_2, weight: 2 },
|
|
211
|
+
],
|
|
212
|
+
salt: `0x${'42'.repeat(32)}`,
|
|
213
|
+
threshold: 2,
|
|
214
|
+
}),
|
|
215
|
+
).toMatchInlineSnapshot(`"0x870b14ffcb3d1bd52be7cc6e8358a35712fec535"`)
|
|
224
216
|
})
|
|
225
217
|
|
|
226
218
|
test('behavior: is stable and binds the salt', () => {
|
|
227
219
|
expect({
|
|
228
|
-
repeated: AccountConfig.getAddress(config
|
|
229
|
-
salted: AccountConfig.getAddress(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
{ factory },
|
|
235
|
-
),
|
|
220
|
+
repeated: AccountConfig.getAddress(config),
|
|
221
|
+
salted: AccountConfig.getAddress({
|
|
222
|
+
...config,
|
|
223
|
+
salt: `0x${'42'.repeat(32)}`,
|
|
224
|
+
}),
|
|
236
225
|
}).toMatchInlineSnapshot(`
|
|
237
226
|
{
|
|
238
|
-
"repeated": "
|
|
239
|
-
"salted": "
|
|
227
|
+
"repeated": "0xcbb727e2489c904a905420e794e8275b6150bfe1",
|
|
228
|
+
"salted": "0xfc6a724c4715d331ec47dc8c1636798956fd3e4d",
|
|
240
229
|
}
|
|
241
230
|
`)
|
|
242
231
|
})
|
|
243
232
|
|
|
244
233
|
test('error: rejects a current configuration', () => {
|
|
245
234
|
expect(() =>
|
|
246
|
-
AccountConfig.getAddress({ ...config, version: 1n }
|
|
235
|
+
AccountConfig.getAddress({ ...config, version: 1n }),
|
|
247
236
|
).toThrowErrorMatchingInlineSnapshot(
|
|
248
237
|
`[AccountConfig.InvalidConfigError: Invalid account config: account address requires version zero.]`,
|
|
249
238
|
)
|
|
250
239
|
})
|
|
251
240
|
|
|
252
241
|
test('behavior: accepts numeric zero for an initial configuration', () => {
|
|
253
|
-
expect(
|
|
254
|
-
AccountConfig.getAddress({ ...config, version: 0 }, { factory }),
|
|
255
|
-
).toBe(account)
|
|
242
|
+
expect(AccountConfig.getAddress({ ...config, version: 0 })).toBe(account)
|
|
256
243
|
})
|
|
257
244
|
})
|
|
258
245
|
|
|
@@ -309,7 +296,7 @@ describe('getSignPayload', () => {
|
|
|
309
296
|
expect(
|
|
310
297
|
AccountConfig.getSignPayload({ account, config, payload }),
|
|
311
298
|
).toMatchInlineSnapshot(
|
|
312
|
-
`"
|
|
299
|
+
`"0x53a60618dd8fd4d01c2c94a4d9dc482dbb7b97115eb448a4590d153b933e549a"`,
|
|
313
300
|
)
|
|
314
301
|
})
|
|
315
302
|
|
|
@@ -450,14 +437,14 @@ describe('assert/validate', () => {
|
|
|
450
437
|
})
|
|
451
438
|
const rlp = Rlp.fromHex(AccountConfig.toTuple(boundary))
|
|
452
439
|
expect({
|
|
453
|
-
account: AccountConfig.getAddress(boundary
|
|
440
|
+
account: AccountConfig.getAddress(boundary),
|
|
454
441
|
commitment: AccountConfig.getCommitment(boundary),
|
|
455
442
|
rlpHash: Hash.keccak256(rlp),
|
|
456
443
|
rlpLength: Hex.size(rlp),
|
|
457
444
|
valid: AccountConfig.validate(boundary),
|
|
458
445
|
}).toMatchInlineSnapshot(`
|
|
459
446
|
{
|
|
460
|
-
"account": "
|
|
447
|
+
"account": "0x9859f0316567499ebcd81d3417c0622999d7179f",
|
|
461
448
|
"commitment": "0xa9282ca5b73ac63b7e27f49cafa6ab13bd2aa79fc45267cf27342db73150cd46",
|
|
462
449
|
"rlpHash": "0xbaf0d030add91caaa10815d2e99c942f1e39b0d199216973781adb4fc1af6955",
|
|
463
450
|
"rlpLength": 1145,
|
package/tempo/AccountConfig.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as Address from '../core/Address.js'
|
|
2
2
|
import type * as Bytes from '../core/Bytes.js'
|
|
3
|
-
import * as ContractAddress from '../core/ContractAddress.js'
|
|
4
3
|
import * as Errors from '../core/Errors.js'
|
|
5
4
|
import * as Hash from '../core/Hash.js'
|
|
6
5
|
import * as Hex from '../core/Hex.js'
|
|
@@ -38,15 +37,6 @@ const accountDomain = 'tempo:configurable-account:account'
|
|
|
38
37
|
/** Domain prefix for account configuration commitments. */
|
|
39
38
|
const configDomain = 'tempo:configurable-account:config'
|
|
40
39
|
|
|
41
|
-
/**
|
|
42
|
-
* Keccak-256 of the account proxy creation code.
|
|
43
|
-
*
|
|
44
|
-
* Placeholder until [TIP-1110](https://tips.sh/1110) fixes the canonical
|
|
45
|
-
* account proxy, which will change every derived address.
|
|
46
|
-
*/
|
|
47
|
-
const accountProxyInitCodeHash =
|
|
48
|
-
'0x583cc63a2e37f645b43eac911b1a6d6de08b83abdc308c61364edda8cfc3bd37'
|
|
49
|
-
|
|
50
40
|
/** Domain prefix for configurable account owner approvals. */
|
|
51
41
|
const signatureDomain = 'tempo:configurable-account:signature'
|
|
52
42
|
|
|
@@ -409,9 +399,9 @@ export declare namespace fromUpgrade {
|
|
|
409
399
|
/**
|
|
410
400
|
* Derives the stable configurable account address.
|
|
411
401
|
*
|
|
412
|
-
* The
|
|
413
|
-
* big-endian fields, not RLP
|
|
414
|
-
*
|
|
402
|
+
* The address is the last 20 bytes of the keccak256 hash of the initial
|
|
403
|
+
* config, encoded with fixed-width big-endian fields, not RLP:
|
|
404
|
+
* `keccak256("tempo:configurable-account:account" || salt || uint8(threshold) || uint8(owners.length) || owners)`.
|
|
415
405
|
*
|
|
416
406
|
* The address is derived once from the initial version-0 config. Config
|
|
417
407
|
* updates do not change it.
|
|
@@ -427,26 +417,19 @@ export declare namespace fromUpgrade {
|
|
|
427
417
|
* threshold: 1,
|
|
428
418
|
* })
|
|
429
419
|
*
|
|
430
|
-
* const address = AccountConfig.getAddress(initialConfig
|
|
431
|
-
* factory: '0x7171717171717171717171717171717171717171'
|
|
432
|
-
* })
|
|
420
|
+
* const address = AccountConfig.getAddress(initialConfig)
|
|
433
421
|
* ```
|
|
434
422
|
*
|
|
435
423
|
* @param config - The initial account config.
|
|
436
|
-
* @param options - The recovery factory configured by the chain.
|
|
437
424
|
* @returns The configurable account address.
|
|
438
425
|
*/
|
|
439
|
-
export function getAddress(
|
|
440
|
-
config: Input,
|
|
441
|
-
options: getAddress.Options,
|
|
442
|
-
): Address.Address {
|
|
443
|
-
Address.assert(options.factory)
|
|
426
|
+
export function getAddress(config: Input): Address.Address {
|
|
444
427
|
assert(config)
|
|
445
428
|
if (BigInt(config.version ?? 0) !== 0n)
|
|
446
429
|
throw new InvalidConfigError({
|
|
447
430
|
reason: 'account address requires version zero',
|
|
448
431
|
})
|
|
449
|
-
const
|
|
432
|
+
const hash = Hash.keccak256(
|
|
450
433
|
Hex.concat(
|
|
451
434
|
Hex.fromString(accountDomain),
|
|
452
435
|
Hex.padLeft(config.salt ?? zeroSalt, 32),
|
|
@@ -458,11 +441,7 @@ export function getAddress(
|
|
|
458
441
|
]),
|
|
459
442
|
),
|
|
460
443
|
)
|
|
461
|
-
const account =
|
|
462
|
-
bytecodeHash: accountProxyInitCodeHash,
|
|
463
|
-
from: options.factory,
|
|
464
|
-
salt: accountSalt,
|
|
465
|
-
})
|
|
444
|
+
const account = Hex.slice(hash, 12)
|
|
466
445
|
if (Hex.toBigInt(account) === 0n)
|
|
467
446
|
throw new InvalidConfigError({ reason: 'derived account cannot be zero' })
|
|
468
447
|
if (config.owners.some((owner) => Address.isEqual(owner.owner, account)))
|
|
@@ -473,18 +452,13 @@ export function getAddress(
|
|
|
473
452
|
}
|
|
474
453
|
|
|
475
454
|
export declare namespace getAddress {
|
|
476
|
-
type Options = {
|
|
477
|
-
/** Recovery factory configured by the chain. */
|
|
478
|
-
factory: Address.Address
|
|
479
|
-
}
|
|
480
|
-
|
|
481
455
|
type ErrorType =
|
|
482
456
|
| assert.ErrorType
|
|
483
|
-
| ContractAddress.fromCreate2.ErrorType
|
|
484
457
|
| Hash.keccak256.ErrorType
|
|
485
458
|
| Hex.concat.ErrorType
|
|
486
459
|
| Hex.fromNumber.ErrorType
|
|
487
460
|
| Hex.fromString.ErrorType
|
|
461
|
+
| Hex.slice.ErrorType
|
|
488
462
|
| Errors.GlobalErrorType
|
|
489
463
|
}
|
|
490
464
|
|
|
@@ -565,9 +539,7 @@ export declare namespace getCommitment {
|
|
|
565
539
|
* })
|
|
566
540
|
*
|
|
567
541
|
* const digest = AccountConfig.getSignPayload({
|
|
568
|
-
* account: AccountConfig.getAddress(config,
|
|
569
|
-
* factory: '0x7171717171717171717171717171717171717171'
|
|
570
|
-
* }),
|
|
542
|
+
* account: AccountConfig.getAddress(config),
|
|
571
543
|
* config,
|
|
572
544
|
* payload: TxEnvelopeTempo.getSignPayload(envelope),
|
|
573
545
|
* })
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
TxEnvelopeTempo,
|
|
8
8
|
} from 'ox/tempo'
|
|
9
9
|
import { describe, expect, test } from 'vitest'
|
|
10
|
-
import { factory } from '../../test/tempo/configurableAccounts.js'
|
|
11
10
|
|
|
12
11
|
const owners = [1n, 2n, 3n]
|
|
13
12
|
.map((value, index) => {
|
|
@@ -38,7 +37,7 @@ const config = AccountConfig.from({
|
|
|
38
37
|
threshold: 2,
|
|
39
38
|
})
|
|
40
39
|
const currentConfig = AccountConfig.from({ ...config, version: 1n })
|
|
41
|
-
const account = AccountConfig.getAddress(config
|
|
40
|
+
const account = AccountConfig.getAddress(config)
|
|
42
41
|
const ownerSignature_1 = owners[0]!.signature
|
|
43
42
|
const approval_1 = SignatureEnvelope.serialize(ownerSignature_1)
|
|
44
43
|
const approval_2 = SignatureEnvelope.serialize(owners[1]!.signature)
|
|
@@ -150,8 +149,8 @@ describe('getHash', () => {
|
|
|
150
149
|
}),
|
|
151
150
|
}).toMatchInlineSnapshot(`
|
|
152
151
|
{
|
|
153
|
-
"keyAuthorization": "
|
|
154
|
-
"transaction": "
|
|
152
|
+
"keyAuthorization": "0x5e8fa6d31c6e604cdac971bdd0a10b825cbb039c76ee399a6d6f619957032de4",
|
|
153
|
+
"transaction": "0x4f312a4616f3f96375e6bd4c20f992694408a8c804429140068aee31bd0b0eaf",
|
|
155
154
|
}
|
|
156
155
|
`)
|
|
157
156
|
})
|
|
@@ -167,7 +166,7 @@ describe('selectApprovals', () => {
|
|
|
167
166
|
],
|
|
168
167
|
threshold: 3,
|
|
169
168
|
})
|
|
170
|
-
const account = AccountConfig.getAddress(config
|
|
169
|
+
const account = AccountConfig.getAddress(config)
|
|
171
170
|
const hash = AccountOperation.getHash({
|
|
172
171
|
account,
|
|
173
172
|
config: { ...config, version: 1n },
|
|
@@ -223,7 +222,7 @@ describe('selectApprovals', () => {
|
|
|
223
222
|
}
|
|
224
223
|
`)
|
|
225
224
|
})
|
|
226
|
-
test('accepts an explicit account
|
|
225
|
+
test('accepts an explicit derived account', async () => {
|
|
227
226
|
const selected = await AccountOperation.selectApprovals({
|
|
228
227
|
account,
|
|
229
228
|
approvals: [],
|
|
@@ -342,14 +341,14 @@ describe('serializeKeyAuthorization', () => {
|
|
|
342
341
|
expect(results).toMatchInlineSnapshot(`
|
|
343
342
|
[
|
|
344
343
|
{
|
|
345
|
-
"account": "
|
|
346
|
-
"hash": "
|
|
344
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
345
|
+
"hash": "0xa12b482453a90d0be6ec0c85e9871d47c322278e2e623191196a974aef52cafd",
|
|
347
346
|
"signatureCount": 2,
|
|
348
347
|
"version": 1n,
|
|
349
348
|
},
|
|
350
349
|
{
|
|
351
|
-
"account": "
|
|
352
|
-
"hash": "
|
|
350
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
351
|
+
"hash": "0x65666f84fa858423447d9eb84e4ad8e36ea483b358cfb935103f14912db0de93",
|
|
353
352
|
"signatureCount": 2,
|
|
354
353
|
"version": 0n,
|
|
355
354
|
},
|
|
@@ -443,15 +442,15 @@ describe('serializeTransaction', () => {
|
|
|
443
442
|
expect(results).toMatchInlineSnapshot(`
|
|
444
443
|
[
|
|
445
444
|
{
|
|
446
|
-
"account": "
|
|
447
|
-
"hash": "
|
|
445
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
446
|
+
"hash": "0x58d5d2655982d69e28c791189c23056344a2b7a166a893988a4b9be228b73469",
|
|
448
447
|
"signatureCount": 2,
|
|
449
448
|
"type": "0x76",
|
|
450
449
|
"version": 1n,
|
|
451
450
|
},
|
|
452
451
|
{
|
|
453
|
-
"account": "
|
|
454
|
-
"hash": "
|
|
452
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
453
|
+
"hash": "0xb3e7bcc63f69d80a954c2e4a5ba186903012686ea31bd049465f6c1e2308c046",
|
|
455
454
|
"signatureCount": 2,
|
|
456
455
|
"type": "0x76",
|
|
457
456
|
"version": 0n,
|
|
@@ -528,7 +527,7 @@ describe('serializeTransaction', () => {
|
|
|
528
527
|
[
|
|
529
528
|
{
|
|
530
529
|
"feePayerSignature": null,
|
|
531
|
-
"from": "
|
|
530
|
+
"from": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
532
531
|
"signatureCount": 2,
|
|
533
532
|
"type": "0x78",
|
|
534
533
|
},
|
|
@@ -538,7 +537,7 @@ describe('serializeTransaction', () => {
|
|
|
538
537
|
"s": 6n,
|
|
539
538
|
"yParity": 0,
|
|
540
539
|
},
|
|
541
|
-
"from": "
|
|
540
|
+
"from": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
542
541
|
"signatureCount": 2,
|
|
543
542
|
"type": "0x78",
|
|
544
543
|
},
|
|
@@ -610,7 +609,7 @@ describe('from', () => {
|
|
|
610
609
|
expect({ pending, submitting, success }).toMatchInlineSnapshot(`
|
|
611
610
|
{
|
|
612
611
|
"pending": {
|
|
613
|
-
"account": "
|
|
612
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
614
613
|
"approvals": [
|
|
615
614
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
616
615
|
],
|
|
@@ -630,7 +629,7 @@ describe('from', () => {
|
|
|
630
629
|
"version": 1n,
|
|
631
630
|
},
|
|
632
631
|
"createdAt": 1,
|
|
633
|
-
"hash": "
|
|
632
|
+
"hash": "0x4f312a4616f3f96375e6bd4c20f992694408a8c804429140068aee31bd0b0eaf",
|
|
634
633
|
"signatureCount": 1,
|
|
635
634
|
"status": "pending",
|
|
636
635
|
"threshold": 2,
|
|
@@ -640,7 +639,7 @@ describe('from', () => {
|
|
|
640
639
|
"weight": 1,
|
|
641
640
|
},
|
|
642
641
|
"submitting": {
|
|
643
|
-
"account": "
|
|
642
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
644
643
|
"approvals": [
|
|
645
644
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
646
645
|
"0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
@@ -662,7 +661,7 @@ describe('from', () => {
|
|
|
662
661
|
},
|
|
663
662
|
"createdAt": 1,
|
|
664
663
|
"expiresAt": 10,
|
|
665
|
-
"hash": "
|
|
664
|
+
"hash": "0x4f312a4616f3f96375e6bd4c20f992694408a8c804429140068aee31bd0b0eaf",
|
|
666
665
|
"signatureCount": 2,
|
|
667
666
|
"status": "submitting",
|
|
668
667
|
"submissionId": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
@@ -673,7 +672,7 @@ describe('from', () => {
|
|
|
673
672
|
"weight": 2,
|
|
674
673
|
},
|
|
675
674
|
"success": {
|
|
676
|
-
"account": "
|
|
675
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
677
676
|
"approvals": [
|
|
678
677
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
679
678
|
"0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
@@ -694,7 +693,7 @@ describe('from', () => {
|
|
|
694
693
|
"version": 1n,
|
|
695
694
|
},
|
|
696
695
|
"createdAt": 1,
|
|
697
|
-
"hash": "
|
|
696
|
+
"hash": "0x4f312a4616f3f96375e6bd4c20f992694408a8c804429140068aee31bd0b0eaf",
|
|
698
697
|
"signatureCount": 2,
|
|
699
698
|
"status": "success",
|
|
700
699
|
"threshold": 2,
|
|
@@ -735,7 +734,7 @@ describe('from', () => {
|
|
|
735
734
|
},
|
|
736
735
|
`
|
|
737
736
|
{
|
|
738
|
-
"account": "
|
|
737
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
739
738
|
"approvals": [
|
|
740
739
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
741
740
|
],
|
|
@@ -812,7 +811,7 @@ describe('from', () => {
|
|
|
812
811
|
},
|
|
813
812
|
`
|
|
814
813
|
{
|
|
815
|
-
"account": "
|
|
814
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
816
815
|
"approvals": [
|
|
817
816
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
818
817
|
],
|
|
@@ -869,7 +868,7 @@ describe('from', () => {
|
|
|
869
868
|
expect({ pending, success }).toMatchInlineSnapshot(`
|
|
870
869
|
{
|
|
871
870
|
"pending": {
|
|
872
|
-
"account": "
|
|
871
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
873
872
|
"approvals": [
|
|
874
873
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
875
874
|
],
|
|
@@ -889,8 +888,8 @@ describe('from', () => {
|
|
|
889
888
|
"version": 1n,
|
|
890
889
|
},
|
|
891
890
|
"createdAt": 1,
|
|
892
|
-
"hash": "
|
|
893
|
-
"keyAuthorization": "
|
|
891
|
+
"hash": "0x5e8fa6d31c6e604cdac971bdd0a10b825cbb039c76ee399a6d6f619957032de4",
|
|
892
|
+
"keyAuthorization": "0xf838f782107980943333333333333333333333333333333333333333846b49d2008080808094b3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
894
893
|
"signatureCount": 1,
|
|
895
894
|
"status": "pending",
|
|
896
895
|
"threshold": 2,
|
|
@@ -899,7 +898,7 @@ describe('from', () => {
|
|
|
899
898
|
"weight": 1,
|
|
900
899
|
},
|
|
901
900
|
"success": {
|
|
902
|
-
"account": "
|
|
901
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
903
902
|
"approvals": [
|
|
904
903
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
905
904
|
"0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
@@ -920,8 +919,8 @@ describe('from', () => {
|
|
|
920
919
|
"version": 1n,
|
|
921
920
|
},
|
|
922
921
|
"createdAt": 1,
|
|
923
|
-
"hash": "
|
|
924
|
-
"keyAuthorization": "
|
|
922
|
+
"hash": "0x5e8fa6d31c6e604cdac971bdd0a10b825cbb039c76ee399a6d6f619957032de4",
|
|
923
|
+
"keyAuthorization": "0xf901b3f782107980943333333333333333333333333333333333333333846b49d2008080808094b3cc0b31026c7a54a9c45e468c674722c3c5b3b5b9017805f9017494b3cc0b31026c7a54a9c45e468c674722c3c5b3b5f852a000000000000000000000000000000000000000000000000000000000000000000102eed69407e1ed8ea0e9601e5546b0a03aed683df360140701d694288f0cd85005f34168f731a468aef268c2f9456f01f90108b88201000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200b88201000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
925
924
|
"signatureCount": 2,
|
|
926
925
|
"status": "success",
|
|
927
926
|
"threshold": 2,
|
|
@@ -967,7 +966,7 @@ describe('from', () => {
|
|
|
967
966
|
},
|
|
968
967
|
`
|
|
969
968
|
{
|
|
970
|
-
"account": "
|
|
969
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
971
970
|
"approvals": [
|
|
972
971
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
973
972
|
"0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
|
|
@@ -1013,7 +1012,7 @@ describe('RPC conversion', () => {
|
|
|
1013
1012
|
expect({ keyAuthorizationRpc, transactionRpc }).toMatchInlineSnapshot(`
|
|
1014
1013
|
{
|
|
1015
1014
|
"keyAuthorizationRpc": {
|
|
1016
|
-
"account": "
|
|
1015
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
1017
1016
|
"approvals": [
|
|
1018
1017
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1019
1018
|
],
|
|
@@ -1033,8 +1032,8 @@ describe('RPC conversion', () => {
|
|
|
1033
1032
|
"version": "0x1",
|
|
1034
1033
|
},
|
|
1035
1034
|
"createdAt": 1,
|
|
1036
|
-
"hash": "
|
|
1037
|
-
"keyAuthorization": "
|
|
1035
|
+
"hash": "0x5e8fa6d31c6e604cdac971bdd0a10b825cbb039c76ee399a6d6f619957032de4",
|
|
1036
|
+
"keyAuthorization": "0xf838f782107980943333333333333333333333333333333333333333846b49d2008080808094b3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
1038
1037
|
"signatureCount": 1,
|
|
1039
1038
|
"status": "pending",
|
|
1040
1039
|
"threshold": 2,
|
|
@@ -1043,7 +1042,7 @@ describe('RPC conversion', () => {
|
|
|
1043
1042
|
"weight": 1,
|
|
1044
1043
|
},
|
|
1045
1044
|
"transactionRpc": {
|
|
1046
|
-
"account": "
|
|
1045
|
+
"account": "0xb3cc0b31026c7a54a9c45e468c674722c3c5b3b5",
|
|
1047
1046
|
"approvals": [
|
|
1048
1047
|
"0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
|
|
1049
1048
|
],
|
|
@@ -1063,7 +1062,7 @@ describe('RPC conversion', () => {
|
|
|
1063
1062
|
"version": "0x1",
|
|
1064
1063
|
},
|
|
1065
1064
|
"createdAt": 1,
|
|
1066
|
-
"hash": "
|
|
1065
|
+
"hash": "0x4f312a4616f3f96375e6bd4c20f992694408a8c804429140068aee31bd0b0eaf",
|
|
1067
1066
|
"signatureCount": 1,
|
|
1068
1067
|
"status": "pending",
|
|
1069
1068
|
"threshold": 2,
|
|
@@ -1406,7 +1405,7 @@ describe('validation', () => {
|
|
|
1406
1405
|
salt: `0x${'AB'.repeat(32)}`,
|
|
1407
1406
|
threshold: 2,
|
|
1408
1407
|
})
|
|
1409
|
-
const account = AccountConfig.getAddress(config
|
|
1408
|
+
const account = AccountConfig.getAddress(config)
|
|
1410
1409
|
const authorization = KeyAuthorization.from({
|
|
1411
1410
|
account,
|
|
1412
1411
|
address: '0x3333333333333333333333333333333333333333',
|
|
@@ -145,7 +145,7 @@ export declare namespace getHash {
|
|
|
145
145
|
* The function retains one canonical approval per owner. It selects the
|
|
146
146
|
* smallest deterministic quorum by owner weight, then orders the selected
|
|
147
147
|
* approvals by owner address for serialization. The caller supplies the
|
|
148
|
-
* account and config; the chain validates their
|
|
148
|
+
* account and config; the chain validates their derived identity.
|
|
149
149
|
*
|
|
150
150
|
* @example
|
|
151
151
|
* ```ts twoslash
|
|
@@ -1745,9 +1745,7 @@ describe('sortApprovals', () => {
|
|
|
1745
1745
|
owners: ascendingOwners.map((o) => ({ owner: o.address, weight: 1 })),
|
|
1746
1746
|
})
|
|
1747
1747
|
const payload = `0x${'42'.repeat(32)}` as const
|
|
1748
|
-
const account = AccountConfig.getAddress(genesisConfig
|
|
1749
|
-
factory: '0x7171717171717171717171717171717171717171',
|
|
1750
|
-
})
|
|
1748
|
+
const account = AccountConfig.getAddress(genesisConfig)
|
|
1751
1749
|
const version = 3n
|
|
1752
1750
|
const digest = AccountConfig.getSignPayload({
|
|
1753
1751
|
payload,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AbiFunction, Address, Hex, Secp256k1, Value } from 'ox'
|
|
2
2
|
import { describe, expect, test } from 'vitest'
|
|
3
3
|
import { chain, client, fundAddress } from '../../test/tempo/config.js'
|
|
4
|
-
import { factory } from '../../test/tempo/configurableAccounts.js'
|
|
5
4
|
import {
|
|
6
5
|
AccountConfig,
|
|
7
6
|
AccountOperation,
|
|
@@ -31,7 +30,7 @@ async function setup() {
|
|
|
31
30
|
threshold: 2,
|
|
32
31
|
owners: keys.map((key) => ({ owner: key.address, weight: 1 })),
|
|
33
32
|
})
|
|
34
|
-
const account = AccountConfig.getAddress(config
|
|
33
|
+
const account = AccountConfig.getAddress(config)
|
|
35
34
|
await fundAddress(client, { address: account })
|
|
36
35
|
return { account, config, keys }
|
|
37
36
|
}
|
package/tempo/index.ts
CHANGED
|
@@ -24,9 +24,7 @@ export type {}
|
|
|
24
24
|
* ],
|
|
25
25
|
* })
|
|
26
26
|
*
|
|
27
|
-
* const account = AccountConfig.getAddress(initialConfig
|
|
28
|
-
* factory: '0x7171717171717171717171717171717171717171'
|
|
29
|
-
* })
|
|
27
|
+
* const account = AccountConfig.getAddress(initialConfig)
|
|
30
28
|
* ```
|
|
31
29
|
*
|
|
32
30
|
* @category Reference
|
package/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** @internal */
|
|
2
|
-
export const version = '0.14.
|
|
2
|
+
export const version = '0.14.59'
|