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.
Files changed (97) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/_cjs/tempo/{MultisigConfig.js → AccountConfig.js} +32 -9
  3. package/_cjs/tempo/AccountConfig.js.map +1 -0
  4. package/_cjs/tempo/{MultisigOperation.js → AccountOperation.js} +29 -29
  5. package/_cjs/tempo/AccountOperation.js.map +1 -0
  6. package/_cjs/tempo/{MultisigSimulation.js → AccountSimulation.js} +22 -13
  7. package/_cjs/tempo/AccountSimulation.js.map +1 -0
  8. package/_cjs/tempo/KeyAuthorization.js +10 -18
  9. package/_cjs/tempo/KeyAuthorization.js.map +1 -1
  10. package/_cjs/tempo/SignatureEnvelope.js +64 -64
  11. package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
  12. package/_cjs/tempo/TransactionRequest.js +15 -10
  13. package/_cjs/tempo/TransactionRequest.js.map +1 -1
  14. package/_cjs/tempo/index.js +4 -4
  15. package/_cjs/tempo/index.js.map +1 -1
  16. package/_cjs/version.js +1 -1
  17. package/_esm/tempo/{MultisigConfig.js → AccountConfig.js} +161 -64
  18. package/_esm/tempo/AccountConfig.js.map +1 -0
  19. package/_esm/tempo/{MultisigOperation.js → AccountOperation.js} +64 -64
  20. package/_esm/tempo/AccountOperation.js.map +1 -0
  21. package/_esm/tempo/{MultisigSimulation.js → AccountSimulation.js} +35 -25
  22. package/_esm/tempo/AccountSimulation.js.map +1 -0
  23. package/_esm/tempo/KeyAuthorization.js +16 -19
  24. package/_esm/tempo/KeyAuthorization.js.map +1 -1
  25. package/_esm/tempo/SignatureEnvelope.js +71 -71
  26. package/_esm/tempo/SignatureEnvelope.js.map +1 -1
  27. package/_esm/tempo/TransactionRequest.js +15 -10
  28. package/_esm/tempo/TransactionRequest.js.map +1 -1
  29. package/_esm/tempo/index.js +50 -48
  30. package/_esm/tempo/index.js.map +1 -1
  31. package/_esm/version.js +1 -1
  32. package/_types/tempo/{MultisigConfig.d.ts → AccountConfig.d.ts} +156 -66
  33. package/_types/tempo/AccountConfig.d.ts.map +1 -0
  34. package/_types/tempo/{MultisigOperation.d.ts → AccountOperation.d.ts} +62 -62
  35. package/_types/tempo/AccountOperation.d.ts.map +1 -0
  36. package/_types/tempo/{MultisigSimulation.d.ts → AccountSimulation.d.ts} +25 -21
  37. package/_types/tempo/AccountSimulation.d.ts.map +1 -0
  38. package/_types/tempo/KeyAuthorization.d.ts +28 -23
  39. package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
  40. package/_types/tempo/RpcSchemaTempo.d.ts +13 -13
  41. package/_types/tempo/RpcSchemaTempo.d.ts.map +1 -1
  42. package/_types/tempo/SignatureEnvelope.d.ts +36 -33
  43. package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
  44. package/_types/tempo/TransactionRequest.d.ts +11 -9
  45. package/_types/tempo/TransactionRequest.d.ts.map +1 -1
  46. package/_types/tempo/index.d.ts +50 -48
  47. package/_types/tempo/index.d.ts.map +1 -1
  48. package/_types/version.d.ts +1 -1
  49. package/package.json +31 -31
  50. package/tempo/AccountConfig/package.json +6 -0
  51. package/tempo/AccountConfig.test-d/package.json +6 -0
  52. package/tempo/AccountConfig.test-d.ts +72 -0
  53. package/tempo/AccountConfig.test.ts +642 -0
  54. package/tempo/{MultisigConfig.ts → AccountConfig.ts} +212 -75
  55. package/tempo/AccountOperation/package.json +6 -0
  56. package/tempo/AccountOperation.test-d/package.json +6 -0
  57. package/tempo/AccountOperation.test-d.ts +71 -0
  58. package/tempo/{MultisigOperation.test.ts → AccountOperation.test.ts} +129 -129
  59. package/tempo/{MultisigOperation.ts → AccountOperation.ts} +95 -97
  60. package/tempo/AccountSimulation/package.json +6 -0
  61. package/tempo/AccountSimulation.test-d/package.json +6 -0
  62. package/tempo/{MultisigSimulation.test-d.ts → AccountSimulation.test-d.ts} +7 -9
  63. package/tempo/{MultisigSimulation.test.ts → AccountSimulation.test.ts} +73 -29
  64. package/tempo/{MultisigSimulation.ts → AccountSimulation.ts} +47 -35
  65. package/tempo/KeyAuthorization.test-d.ts +19 -29
  66. package/tempo/KeyAuthorization.test.ts +151 -74
  67. package/tempo/KeyAuthorization.ts +40 -61
  68. package/tempo/RpcSchemaTempo.test-d.ts +20 -20
  69. package/tempo/RpcSchemaTempo.ts +13 -13
  70. package/tempo/SignatureEnvelope.test-d.ts +7 -7
  71. package/tempo/SignatureEnvelope.test.ts +34 -34
  72. package/tempo/SignatureEnvelope.ts +107 -103
  73. package/tempo/Transaction.test.ts +4 -4
  74. package/tempo/TransactionRequest.test-d.ts +17 -8
  75. package/tempo/TransactionRequest.test.ts +31 -21
  76. package/tempo/TransactionRequest.ts +29 -20
  77. package/tempo/{multisig.e2e.test.ts → configurableAccounts.e2e.test.ts} +16 -16
  78. package/tempo/index.ts +50 -48
  79. package/version.ts +1 -1
  80. package/_cjs/tempo/MultisigConfig.js.map +0 -1
  81. package/_cjs/tempo/MultisigOperation.js.map +0 -1
  82. package/_cjs/tempo/MultisigSimulation.js.map +0 -1
  83. package/_esm/tempo/MultisigConfig.js.map +0 -1
  84. package/_esm/tempo/MultisigOperation.js.map +0 -1
  85. package/_esm/tempo/MultisigSimulation.js.map +0 -1
  86. package/_types/tempo/MultisigConfig.d.ts.map +0 -1
  87. package/_types/tempo/MultisigOperation.d.ts.map +0 -1
  88. package/_types/tempo/MultisigSimulation.d.ts.map +0 -1
  89. package/tempo/MultisigConfig/package.json +0 -6
  90. package/tempo/MultisigConfig.test-d/package.json +0 -6
  91. package/tempo/MultisigConfig.test-d.ts +0 -52
  92. package/tempo/MultisigConfig.test.ts +0 -391
  93. package/tempo/MultisigOperation/package.json +0 -6
  94. package/tempo/MultisigOperation.test-d/package.json +0 -6
  95. package/tempo/MultisigOperation.test-d.ts +0 -71
  96. package/tempo/MultisigSimulation/package.json +0 -6
  97. 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.55",
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,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/tempo/AccountConfig.d.ts",
4
+ "main": "../../_cjs/tempo/AccountConfig.js",
5
+ "module": "../../_esm/tempo/AccountConfig.js"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/tempo/AccountConfig.test-d.d.ts",
4
+ "main": "../../_cjs/tempo/AccountConfig.test-d.js",
5
+ "module": "../../_esm/tempo/AccountConfig.test-d.js"
6
+ }
@@ -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
+ })