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
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ox",
|
|
3
3
|
"description": "Ethereum Standard Library",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.57",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
7
7
|
"types": "./_types/index.d.ts",
|
|
@@ -523,6 +523,36 @@
|
|
|
523
523
|
"default": "./_cjs/index.js"
|
|
524
524
|
},
|
|
525
525
|
"./package.json": "./package.json",
|
|
526
|
+
"./tempo/AccountConfig.test-d": {
|
|
527
|
+
"types": "./_types/tempo/AccountConfig.test-d.d.ts",
|
|
528
|
+
"import": "./_esm/tempo/AccountConfig.test-d.js",
|
|
529
|
+
"default": "./_cjs/tempo/AccountConfig.test-d.js"
|
|
530
|
+
},
|
|
531
|
+
"./tempo/AccountConfig": {
|
|
532
|
+
"types": "./_types/tempo/AccountConfig.d.ts",
|
|
533
|
+
"import": "./_esm/tempo/AccountConfig.js",
|
|
534
|
+
"default": "./_cjs/tempo/AccountConfig.js"
|
|
535
|
+
},
|
|
536
|
+
"./tempo/AccountOperation.test-d": {
|
|
537
|
+
"types": "./_types/tempo/AccountOperation.test-d.d.ts",
|
|
538
|
+
"import": "./_esm/tempo/AccountOperation.test-d.js",
|
|
539
|
+
"default": "./_cjs/tempo/AccountOperation.test-d.js"
|
|
540
|
+
},
|
|
541
|
+
"./tempo/AccountOperation": {
|
|
542
|
+
"types": "./_types/tempo/AccountOperation.d.ts",
|
|
543
|
+
"import": "./_esm/tempo/AccountOperation.js",
|
|
544
|
+
"default": "./_cjs/tempo/AccountOperation.js"
|
|
545
|
+
},
|
|
546
|
+
"./tempo/AccountSimulation.test-d": {
|
|
547
|
+
"types": "./_types/tempo/AccountSimulation.test-d.d.ts",
|
|
548
|
+
"import": "./_esm/tempo/AccountSimulation.test-d.js",
|
|
549
|
+
"default": "./_cjs/tempo/AccountSimulation.test-d.js"
|
|
550
|
+
},
|
|
551
|
+
"./tempo/AccountSimulation": {
|
|
552
|
+
"types": "./_types/tempo/AccountSimulation.d.ts",
|
|
553
|
+
"import": "./_esm/tempo/AccountSimulation.js",
|
|
554
|
+
"default": "./_cjs/tempo/AccountSimulation.js"
|
|
555
|
+
},
|
|
526
556
|
"./tempo/AuthorizationTempo": {
|
|
527
557
|
"types": "./_types/tempo/AuthorizationTempo.d.ts",
|
|
528
558
|
"import": "./_esm/tempo/AuthorizationTempo.js",
|
|
@@ -548,36 +578,6 @@
|
|
|
548
578
|
"import": "./_esm/tempo/KeyAuthorization.js",
|
|
549
579
|
"default": "./_cjs/tempo/KeyAuthorization.js"
|
|
550
580
|
},
|
|
551
|
-
"./tempo/MultisigConfig.test-d": {
|
|
552
|
-
"types": "./_types/tempo/MultisigConfig.test-d.d.ts",
|
|
553
|
-
"import": "./_esm/tempo/MultisigConfig.test-d.js",
|
|
554
|
-
"default": "./_cjs/tempo/MultisigConfig.test-d.js"
|
|
555
|
-
},
|
|
556
|
-
"./tempo/MultisigConfig": {
|
|
557
|
-
"types": "./_types/tempo/MultisigConfig.d.ts",
|
|
558
|
-
"import": "./_esm/tempo/MultisigConfig.js",
|
|
559
|
-
"default": "./_cjs/tempo/MultisigConfig.js"
|
|
560
|
-
},
|
|
561
|
-
"./tempo/MultisigOperation.test-d": {
|
|
562
|
-
"types": "./_types/tempo/MultisigOperation.test-d.d.ts",
|
|
563
|
-
"import": "./_esm/tempo/MultisigOperation.test-d.js",
|
|
564
|
-
"default": "./_cjs/tempo/MultisigOperation.test-d.js"
|
|
565
|
-
},
|
|
566
|
-
"./tempo/MultisigOperation": {
|
|
567
|
-
"types": "./_types/tempo/MultisigOperation.d.ts",
|
|
568
|
-
"import": "./_esm/tempo/MultisigOperation.js",
|
|
569
|
-
"default": "./_cjs/tempo/MultisigOperation.js"
|
|
570
|
-
},
|
|
571
|
-
"./tempo/MultisigSimulation.test-d": {
|
|
572
|
-
"types": "./_types/tempo/MultisigSimulation.test-d.d.ts",
|
|
573
|
-
"import": "./_esm/tempo/MultisigSimulation.test-d.js",
|
|
574
|
-
"default": "./_cjs/tempo/MultisigSimulation.test-d.js"
|
|
575
|
-
},
|
|
576
|
-
"./tempo/MultisigSimulation": {
|
|
577
|
-
"types": "./_types/tempo/MultisigSimulation.d.ts",
|
|
578
|
-
"import": "./_esm/tempo/MultisigSimulation.js",
|
|
579
|
-
"default": "./_cjs/tempo/MultisigSimulation.js"
|
|
580
|
-
},
|
|
581
581
|
"./tempo/Period": {
|
|
582
582
|
"types": "./_types/tempo/Period.d.ts",
|
|
583
583
|
"import": "./_esm/tempo/Period.js",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { expectTypeOf, test } from 'vitest'
|
|
2
|
+
import * as AccountConfig from './AccountConfig.js'
|
|
3
|
+
|
|
4
|
+
const input = {
|
|
5
|
+
owners: [
|
|
6
|
+
{
|
|
7
|
+
owner: '0x1111111111111111111111111111111111111111',
|
|
8
|
+
weight: 1,
|
|
9
|
+
},
|
|
10
|
+
],
|
|
11
|
+
threshold: 1,
|
|
12
|
+
} as const satisfies AccountConfig.Input
|
|
13
|
+
|
|
14
|
+
test('from returns a complete configuration', () => {
|
|
15
|
+
const config = AccountConfig.from(input)
|
|
16
|
+
const numeric = AccountConfig.from({ ...input, version: 1 })
|
|
17
|
+
const zero = AccountConfig.from({ ...input, version: 0 })
|
|
18
|
+
|
|
19
|
+
expectTypeOf(config).toMatchTypeOf<AccountConfig.Config>()
|
|
20
|
+
expectTypeOf(config.version).toEqualTypeOf<0n>()
|
|
21
|
+
expectTypeOf(numeric.version).toEqualTypeOf<bigint>()
|
|
22
|
+
expectTypeOf(zero.version).toEqualTypeOf<0n>()
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
test('fromUpgrade returns a version-one configuration', () => {
|
|
26
|
+
const config = AccountConfig.fromUpgrade(
|
|
27
|
+
'0x3333333333333333333333333333333333333333',
|
|
28
|
+
input,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
expectTypeOf(config).toMatchTypeOf<AccountConfig.Config>()
|
|
32
|
+
expectTypeOf(config.version).toEqualTypeOf<1n>()
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
test('update returns the next complete configuration', () => {
|
|
36
|
+
const config = AccountConfig.update(AccountConfig.from(input), {
|
|
37
|
+
owners: input.owners,
|
|
38
|
+
threshold: 1,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
expectTypeOf(config).toEqualTypeOf<AccountConfig.Config>()
|
|
42
|
+
expectTypeOf(config.version).toEqualTypeOf<bigint>()
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
test('RPC configurations use hexadecimal versions', () => {
|
|
46
|
+
const rpc = AccountConfig.toRpc(AccountConfig.from(input))
|
|
47
|
+
|
|
48
|
+
expectTypeOf(rpc).toEqualTypeOf<AccountConfig.Rpc>()
|
|
49
|
+
expectTypeOf(rpc.version).toEqualTypeOf<`0x${string}`>()
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
test('complete configurations require a version', () => {
|
|
53
|
+
// @ts-expect-error Complete configurations include their version.
|
|
54
|
+
const config: AccountConfig.Config = input
|
|
55
|
+
|
|
56
|
+
expectTypeOf(config).toEqualTypeOf<AccountConfig.Config>()
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
test('sign payloads take the version from config', () => {
|
|
60
|
+
AccountConfig.getSignPayload({
|
|
61
|
+
account: '0x2222222222222222222222222222222222222222',
|
|
62
|
+
config: { version: 1 },
|
|
63
|
+
payload: '0x1234',
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
AccountConfig.getSignPayload({
|
|
67
|
+
account: '0x2222222222222222222222222222222222222222',
|
|
68
|
+
// @ts-expect-error A configuration version is required.
|
|
69
|
+
config: {},
|
|
70
|
+
payload: '0x1234',
|
|
71
|
+
})
|
|
72
|
+
})
|