ox 0.14.54 → 0.14.56

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 (101) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/_cjs/tempo/{MultisigConfig.js → AccountConfig.js} +16 -4
  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} +9 -9
  7. package/_cjs/tempo/AccountSimulation.js.map +1 -0
  8. package/_cjs/tempo/KeyAuthorization.js +12 -11
  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/Transaction.js +2 -0
  13. package/_cjs/tempo/Transaction.js.map +1 -1
  14. package/_cjs/tempo/TransactionRequest.js +12 -9
  15. package/_cjs/tempo/TransactionRequest.js.map +1 -1
  16. package/_cjs/tempo/index.js +4 -4
  17. package/_cjs/tempo/index.js.map +1 -1
  18. package/_cjs/version.js +1 -1
  19. package/_esm/tempo/{MultisigConfig.js → AccountConfig.js} +103 -55
  20. package/_esm/tempo/AccountConfig.js.map +1 -0
  21. package/_esm/tempo/{MultisigOperation.js → AccountOperation.js} +64 -64
  22. package/_esm/tempo/AccountOperation.js.map +1 -0
  23. package/_esm/tempo/{MultisigSimulation.js → AccountSimulation.js} +20 -20
  24. package/_esm/tempo/AccountSimulation.js.map +1 -0
  25. package/_esm/tempo/KeyAuthorization.js +13 -12
  26. package/_esm/tempo/KeyAuthorization.js.map +1 -1
  27. package/_esm/tempo/SignatureEnvelope.js +71 -71
  28. package/_esm/tempo/SignatureEnvelope.js.map +1 -1
  29. package/_esm/tempo/Transaction.js +2 -0
  30. package/_esm/tempo/Transaction.js.map +1 -1
  31. package/_esm/tempo/TransactionRequest.js +12 -9
  32. package/_esm/tempo/TransactionRequest.js.map +1 -1
  33. package/_esm/tempo/index.js +50 -48
  34. package/_esm/tempo/index.js.map +1 -1
  35. package/_esm/version.js +1 -1
  36. package/_types/tempo/{MultisigConfig.d.ts → AccountConfig.d.ts} +110 -63
  37. package/_types/tempo/AccountConfig.d.ts.map +1 -0
  38. package/_types/tempo/{MultisigOperation.d.ts → AccountOperation.d.ts} +62 -62
  39. package/_types/tempo/AccountOperation.d.ts.map +1 -0
  40. package/_types/tempo/{MultisigSimulation.d.ts → AccountSimulation.d.ts} +21 -21
  41. package/_types/tempo/AccountSimulation.d.ts.map +1 -0
  42. package/_types/tempo/KeyAuthorization.d.ts +14 -14
  43. package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
  44. package/_types/tempo/RpcSchemaTempo.d.ts +13 -13
  45. package/_types/tempo/RpcSchemaTempo.d.ts.map +1 -1
  46. package/_types/tempo/SignatureEnvelope.d.ts +36 -33
  47. package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
  48. package/_types/tempo/Transaction.d.ts.map +1 -1
  49. package/_types/tempo/TransactionRequest.d.ts +11 -9
  50. package/_types/tempo/TransactionRequest.d.ts.map +1 -1
  51. package/_types/tempo/index.d.ts +50 -48
  52. package/_types/tempo/index.d.ts.map +1 -1
  53. package/_types/version.d.ts +1 -1
  54. package/package.json +31 -31
  55. package/tempo/AccountConfig/package.json +6 -0
  56. package/tempo/AccountConfig.test-d/package.json +6 -0
  57. package/tempo/{MultisigConfig.test-d.ts → AccountConfig.test-d.ts} +22 -12
  58. package/tempo/{MultisigConfig.test.ts → AccountConfig.test.ts} +155 -37
  59. package/tempo/{MultisigConfig.ts → AccountConfig.ts} +132 -66
  60. package/tempo/AccountOperation/package.json +6 -0
  61. package/tempo/AccountOperation.test-d/package.json +6 -0
  62. package/tempo/AccountOperation.test-d.ts +71 -0
  63. package/tempo/{MultisigOperation.test.ts → AccountOperation.test.ts} +97 -97
  64. package/tempo/{MultisigOperation.ts → AccountOperation.ts} +95 -97
  65. package/tempo/AccountSimulation/package.json +6 -0
  66. package/tempo/AccountSimulation.test-d/package.json +6 -0
  67. package/tempo/{MultisigSimulation.test-d.ts → AccountSimulation.test-d.ts} +7 -9
  68. package/tempo/{MultisigSimulation.test.ts → AccountSimulation.test.ts} +29 -29
  69. package/tempo/{MultisigSimulation.ts → AccountSimulation.ts} +28 -30
  70. package/tempo/KeyAuthorization.test-d.ts +14 -14
  71. package/tempo/KeyAuthorization.test.ts +70 -49
  72. package/tempo/KeyAuthorization.ts +29 -27
  73. package/tempo/RpcSchemaTempo.test-d.ts +19 -19
  74. package/tempo/RpcSchemaTempo.ts +13 -13
  75. package/tempo/SignatureEnvelope.test-d.ts +7 -7
  76. package/tempo/SignatureEnvelope.test.ts +34 -34
  77. package/tempo/SignatureEnvelope.ts +107 -103
  78. package/tempo/Transaction.test.ts +40 -4
  79. package/tempo/Transaction.ts +2 -0
  80. package/tempo/TransactionRequest.test-d.ts +16 -7
  81. package/tempo/TransactionRequest.test.ts +25 -17
  82. package/tempo/TransactionRequest.ts +25 -18
  83. package/tempo/{multisig.e2e.test.ts → configurableAccounts.e2e.test.ts} +16 -16
  84. package/tempo/index.ts +50 -48
  85. package/version.ts +1 -1
  86. package/_cjs/tempo/MultisigConfig.js.map +0 -1
  87. package/_cjs/tempo/MultisigOperation.js.map +0 -1
  88. package/_cjs/tempo/MultisigSimulation.js.map +0 -1
  89. package/_esm/tempo/MultisigConfig.js.map +0 -1
  90. package/_esm/tempo/MultisigOperation.js.map +0 -1
  91. package/_esm/tempo/MultisigSimulation.js.map +0 -1
  92. package/_types/tempo/MultisigConfig.d.ts.map +0 -1
  93. package/_types/tempo/MultisigOperation.d.ts.map +0 -1
  94. package/_types/tempo/MultisigSimulation.d.ts.map +0 -1
  95. package/tempo/MultisigConfig/package.json +0 -6
  96. package/tempo/MultisigConfig.test-d/package.json +0 -6
  97. package/tempo/MultisigOperation/package.json +0 -6
  98. package/tempo/MultisigOperation.test-d/package.json +0 -6
  99. package/tempo/MultisigOperation.test-d.ts +0 -71
  100. package/tempo/MultisigSimulation/package.json +0 -6
  101. package/tempo/MultisigSimulation.test-d/package.json +0 -6
@@ -1,4 +1,4 @@
1
- import { MultisigConfig, MultisigSimulation } from 'ox/tempo'
1
+ import { AccountConfig, AccountSimulation } from 'ox/tempo'
2
2
  import { describe, expect, test } from 'vitest'
3
3
 
4
4
  const config =
@@ -12,11 +12,11 @@ const rpc = {
12
12
  },
13
13
  ],
14
14
  config,
15
- } as const satisfies MultisigSimulation.Rpc
15
+ } as const satisfies AccountSimulation.Rpc
16
16
 
17
17
  describe('fromRpc', () => {
18
18
  test('behavior: decodes the configuration', () => {
19
- expect(MultisigSimulation.fromRpc(rpc)).toMatchInlineSnapshot(`
19
+ expect(AccountSimulation.fromRpc(rpc)).toMatchInlineSnapshot(`
20
20
  {
21
21
  "approvals": [
22
22
  {
@@ -49,43 +49,43 @@ describe('fromRpc', () => {
49
49
  '0xf843a0000000000000000000000000000000000000000000000000000000000000000088ffffffffffffffff01d7d694111111111111111111111111111111111111111101' as const
50
50
 
51
51
  expect(
52
- MultisigSimulation.fromRpc({ ...rpc, approvals: [], config }).config
52
+ AccountSimulation.fromRpc({ ...rpc, approvals: [], config }).config
53
53
  .version,
54
54
  ).toMatchInlineSnapshot(`18446744073709551615n`)
55
55
  })
56
56
 
57
57
  test('error: rejects excess root approvals', () => {
58
58
  expect(() =>
59
- MultisigSimulation.fromRpc({
59
+ AccountSimulation.fromRpc({
60
60
  ...rpc,
61
61
  approvals: Array.from({ length: 9 }, () => rpc.approvals[0]),
62
62
  }),
63
63
  ).toThrowErrorMatchingInlineSnapshot(
64
- `[MultisigSimulation.InvalidSimulationError: Invalid multisig simulation: approval count exceeds 8.]`,
64
+ `[AccountSimulation.InvalidSimulationError: Invalid account simulation: approval count exceeds 8.]`,
65
65
  )
66
66
  })
67
67
  test('error: rejects nested approvals', () => {
68
68
  expect(() =>
69
- MultisigSimulation.fromRpc({
69
+ AccountSimulation.fromRpc({
70
70
  ...rpc,
71
- approvals: [{ type: 'multisig', spec: rpc }],
71
+ approvals: [{ type: 'configurable', spec: rpc }],
72
72
  } as never),
73
73
  ).toThrowErrorMatchingInlineSnapshot(
74
- `[MultisigSimulation.InvalidSimulationError: Invalid multisig simulation: only untagged primitive owner approvals are allowed.]`,
74
+ `[AccountSimulation.InvalidSimulationError: Invalid account simulation: only untagged primitive owner approvals are allowed.]`,
75
75
  )
76
76
  })
77
77
 
78
78
  test('error: rejects trailing configuration bytes', () => {
79
79
  expect(() =>
80
- MultisigSimulation.fromRpc({ ...rpc, config: `${config}00` }),
80
+ AccountSimulation.fromRpc({ ...rpc, config: `${config}00` }),
81
81
  ).toThrowErrorMatchingInlineSnapshot(
82
- `[MultisigSimulation.InvalidSimulationError: Invalid multisig simulation: noncanonical config encoding.]`,
82
+ `[AccountSimulation.InvalidSimulationError: Invalid account simulation: noncanonical config encoding.]`,
83
83
  )
84
84
  })
85
85
 
86
86
  test('error: rejects malformed configuration RLP', () => {
87
87
  expect(() =>
88
- MultisigSimulation.fromRpc({ ...rpc, config: '0xf8' }),
88
+ AccountSimulation.fromRpc({ ...rpc, config: '0xf8' }),
89
89
  ).toThrowErrorMatchingInlineSnapshot(
90
90
  `[Cursor.PositionOutOfBoundsError: Position \`1\` is out of bounds (\`0 < position < 1\`).]`,
91
91
  )
@@ -93,9 +93,9 @@ describe('fromRpc', () => {
93
93
 
94
94
  test('error: rejects a non-list configuration', () => {
95
95
  expect(() =>
96
- MultisigSimulation.fromRpc({ ...rpc, config: '0x01' }),
96
+ AccountSimulation.fromRpc({ ...rpc, config: '0x01' }),
97
97
  ).toThrowErrorMatchingInlineSnapshot(
98
- `[MultisigSimulation.InvalidSimulationError: Invalid multisig simulation: invalid config encoding.]`,
98
+ `[AccountSimulation.InvalidSimulationError: Invalid account simulation: invalid config encoding.]`,
99
99
  )
100
100
  })
101
101
 
@@ -105,9 +105,9 @@ describe('fromRpc', () => {
105
105
  .replace('118002', '11810002') as `0x${string}`
106
106
 
107
107
  expect(() =>
108
- MultisigSimulation.fromRpc({ ...rpc, config: noncanonical }),
108
+ AccountSimulation.fromRpc({ ...rpc, config: noncanonical }),
109
109
  ).toThrowErrorMatchingInlineSnapshot(
110
- `[MultisigSimulation.InvalidSimulationError: Invalid multisig simulation: invalid config encoding.]`,
110
+ `[AccountSimulation.InvalidSimulationError: Invalid account simulation: invalid config encoding.]`,
111
111
  )
112
112
  })
113
113
  })
@@ -115,7 +115,7 @@ describe('fromRpc', () => {
115
115
  describe('toRpc', () => {
116
116
  test('behavior: encodes configurations and shims long key data', () => {
117
117
  expect(
118
- MultisigSimulation.toRpc(MultisigSimulation.fromRpc(rpc)),
118
+ AccountSimulation.toRpc(AccountSimulation.fromRpc(rpc)),
119
119
  ).toMatchInlineSnapshot(`
120
120
  {
121
121
  "approvals": [
@@ -131,12 +131,12 @@ describe('toRpc', () => {
131
131
  })
132
132
 
133
133
  test('behavior: preserves short key data', () => {
134
- const spec = MultisigSimulation.fromRpc({
134
+ const spec = AccountSimulation.fromRpc({
135
135
  ...rpc,
136
136
  approvals: [{ ...rpc.approvals[0], keyData: '0x0102' }],
137
137
  })
138
138
 
139
- expect(MultisigSimulation.toRpc(spec).approvals).toMatchInlineSnapshot(`
139
+ expect(AccountSimulation.toRpc(spec).approvals).toMatchInlineSnapshot(`
140
140
  [
141
141
  {
142
142
  "keyData": "0x0102",
@@ -148,13 +148,13 @@ describe('toRpc', () => {
148
148
  })
149
149
 
150
150
  test('behavior: encodes the maximum uint64 configuration version', () => {
151
- const spec = MultisigSimulation.fromRpc(rpc)
151
+ const spec = AccountSimulation.fromRpc(rpc)
152
152
 
153
153
  expect(
154
- MultisigSimulation.toRpc({
154
+ AccountSimulation.toRpc({
155
155
  ...spec,
156
156
  approvals: [],
157
- config: MultisigConfig.from({
157
+ config: AccountConfig.from({
158
158
  owners: [
159
159
  {
160
160
  owner: '0x1111111111111111111111111111111111111111',
@@ -162,7 +162,7 @@ describe('toRpc', () => {
162
162
  },
163
163
  ],
164
164
  threshold: 1,
165
- version: MultisigConfig.maxVersion,
165
+ version: AccountConfig.maxVersion,
166
166
  }),
167
167
  }).config,
168
168
  ).toMatchInlineSnapshot(
@@ -171,25 +171,25 @@ describe('toRpc', () => {
171
171
  })
172
172
 
173
173
  test('error: rejects excess root approvals', () => {
174
- const spec = MultisigSimulation.fromRpc(rpc)
174
+ const spec = AccountSimulation.fromRpc(rpc)
175
175
 
176
176
  expect(() =>
177
- MultisigSimulation.toRpc({
177
+ AccountSimulation.toRpc({
178
178
  ...spec,
179
179
  approvals: Array.from({ length: 9 }, () => spec.approvals[0]!),
180
180
  }),
181
181
  ).toThrowErrorMatchingInlineSnapshot(
182
- `[MultisigSimulation.InvalidSimulationError: Invalid multisig simulation: approval count exceeds 8.]`,
182
+ `[AccountSimulation.InvalidSimulationError: Invalid account simulation: approval count exceeds 8.]`,
183
183
  )
184
184
  })
185
185
  test('error: rejects nested approvals', () => {
186
186
  expect(() =>
187
- MultisigSimulation.toRpc({
187
+ AccountSimulation.toRpc({
188
188
  ...rpc,
189
- approvals: [{ type: 'multisig', spec: rpc }],
189
+ approvals: [{ type: 'configurable', spec: rpc }],
190
190
  } as never),
191
191
  ).toThrowErrorMatchingInlineSnapshot(
192
- `[MultisigSimulation.InvalidSimulationError: Invalid multisig simulation: only untagged primitive owner approvals are allowed.]`,
192
+ `[AccountSimulation.InvalidSimulationError: Invalid account simulation: only untagged primitive owner approvals are allowed.]`,
193
193
  )
194
194
  })
195
195
  })
@@ -3,13 +3,13 @@ import * as Errors from '../core/Errors.js'
3
3
  import * as Hex from '../core/Hex.js'
4
4
  import type { Compute } from '../core/internal/types.js'
5
5
  import * as Rlp from '../core/Rlp.js'
6
- import * as MultisigConfig from './MultisigConfig.js'
6
+ import * as AccountConfig from './AccountConfig.js'
7
7
  import type * as SignatureEnvelope from './SignatureEnvelope.js'
8
8
 
9
- /** Native multisig owner approval used for RPC simulation. */
9
+ /** Configurable account owner approval used for RPC simulation. */
10
10
  export type Approval = PrimitiveApproval
11
11
 
12
- /** JSON-RPC native multisig owner approval used for RPC simulation. */
12
+ /** JSON-RPC configurable account owner approval used for RPC simulation. */
13
13
  export type ApprovalRpc = PrimitiveApproval
14
14
 
15
15
  /** Primitive owner approval used for RPC simulation. */
@@ -22,7 +22,7 @@ export type PrimitiveApproval = {
22
22
  owner: Address.Address
23
23
  }
24
24
 
25
- /** JSON-RPC representation of a native multisig simulation spec. */
25
+ /** JSON-RPC representation of an account simulation spec. */
26
26
  export type Rpc = Compute<{
27
27
  /** Owner approvals to model. */
28
28
  approvals: readonly ApprovalRpc[]
@@ -30,27 +30,27 @@ export type Rpc = Compute<{
30
30
  config: Hex.Hex
31
31
  }>
32
32
 
33
- /** Native multisig spec used to construct an RPC simulation signature. */
33
+ /** Account simulation spec used to construct an RPC simulation signature. */
34
34
  export type Spec = Compute<{
35
35
  /** Owner approvals to model. */
36
36
  approvals: readonly Approval[]
37
37
  /** Complete applicable configuration. */
38
- config: MultisigConfig.Config
38
+ config: AccountConfig.Config
39
39
  }>
40
40
 
41
41
  /**
42
- * Converts a JSON-RPC multisig simulation spec to its domain representation.
42
+ * Converts a JSON-RPC account simulation spec to its domain representation.
43
43
  *
44
44
  * @example
45
45
  * ```ts twoslash
46
46
  * // @noErrors
47
- * import { MultisigSimulation } from 'ox/tempo'
47
+ * import { AccountSimulation } from 'ox/tempo'
48
48
  *
49
- * const spec = MultisigSimulation.fromRpc(specRpc)
49
+ * const spec = AccountSimulation.fromRpc(specRpc)
50
50
  * ```
51
51
  *
52
- * @param spec - JSON-RPC multisig simulation spec.
53
- * @returns The multisig simulation spec with decoded configurations.
52
+ * @param spec - JSON-RPC account simulation spec.
53
+ * @returns The account simulation spec with decoded configurations.
54
54
  */
55
55
  export function fromRpc(spec: Rpc): Spec {
56
56
  const { approvals, config } = spec
@@ -63,25 +63,25 @@ export declare namespace fromRpc {
63
63
  export type ErrorType =
64
64
  | Hex.isEqual.ErrorType
65
65
  | InvalidSimulationError
66
- | MultisigConfig.assert.ErrorType
66
+ | AccountConfig.assert.ErrorType
67
67
  | Rlp.fromHex.ErrorType
68
68
  | Rlp.toHex.ErrorType
69
69
  | Errors.GlobalErrorType
70
70
  }
71
71
 
72
72
  /**
73
- * Converts a multisig simulation spec to its JSON-RPC representation.
73
+ * Converts an account simulation spec to its JSON-RPC representation.
74
74
  *
75
75
  * @example
76
76
  * ```ts twoslash
77
77
  * // @noErrors
78
- * import { MultisigSimulation } from 'ox/tempo'
78
+ * import { AccountSimulation } from 'ox/tempo'
79
79
  *
80
- * const specRpc = MultisigSimulation.toRpc(spec)
80
+ * const specRpc = AccountSimulation.toRpc(spec)
81
81
  * ```
82
82
  *
83
- * @param spec - Multisig simulation spec.
84
- * @returns The JSON-RPC multisig simulation spec with encoded configurations.
83
+ * @param spec - Account simulation spec.
84
+ * @returns The JSON-RPC account simulation spec with encoded configurations.
85
85
  */
86
86
  export function toRpc(spec: Spec): Rpc {
87
87
  const { approvals, config } = spec
@@ -101,7 +101,7 @@ export declare namespace toRpc {
101
101
  export type ErrorType =
102
102
  | Hex.fromNumber.ErrorType
103
103
  | InvalidSimulationError
104
- | MultisigConfig.assert.ErrorType
104
+ | AccountConfig.assert.ErrorType
105
105
  | Rlp.fromHex.ErrorType
106
106
  | Errors.GlobalErrorType
107
107
  }
@@ -120,14 +120,14 @@ function assertApprovals(approvals: readonly unknown[]) {
120
120
  throw new InvalidSimulationError({
121
121
  reason: 'only untagged primitive owner approvals are allowed',
122
122
  })
123
- if (approvals.length > MultisigConfig.maxSignatures)
123
+ if (approvals.length > AccountConfig.maxSignatures)
124
124
  throw new InvalidSimulationError({
125
- reason: `approval count exceeds ${MultisigConfig.maxSignatures}`,
125
+ reason: `approval count exceeds ${AccountConfig.maxSignatures}`,
126
126
  })
127
127
  }
128
128
 
129
129
  /** @internal */
130
- function deserializeConfig(config: Hex.Hex): MultisigConfig.Config {
130
+ function deserializeConfig(config: Hex.Hex): AccountConfig.Config {
131
131
  const tuple = Rlp.toHex(config)
132
132
  if (!Array.isArray(tuple) || tuple.length !== 4)
133
133
  throw new InvalidSimulationError({ reason: 'invalid config encoding' })
@@ -151,18 +151,16 @@ function deserializeConfig(config: Hex.Hex): MultisigConfig.Config {
151
151
  )
152
152
  )
153
153
  throw new InvalidSimulationError({ reason: 'invalid config encoding' })
154
- const value = MultisigConfig.fromTuple(
155
- tuple as unknown as MultisigConfig.Tuple,
156
- )
157
- MultisigConfig.assert(value)
154
+ const value = AccountConfig.fromTuple(tuple as unknown as AccountConfig.Tuple)
155
+ AccountConfig.assert(value)
158
156
  if (!Hex.isEqual(config, serializeConfig(value)))
159
157
  throw new InvalidSimulationError({ reason: 'noncanonical config encoding' })
160
158
  return value
161
159
  }
162
160
 
163
161
  /** @internal */
164
- function serializeConfig(config: MultisigConfig.Input): Hex.Hex {
165
- return Rlp.fromHex(MultisigConfig.toTuple(config))
162
+ function serializeConfig(config: AccountConfig.Input): Hex.Hex {
163
+ return Rlp.fromHex(AccountConfig.toTuple(config))
166
164
  }
167
165
 
168
166
  /**
@@ -175,11 +173,11 @@ function shimKeyData(data: Hex.Hex): Hex.Hex {
175
173
  return Hex.fromNumber(size, { size: 2 })
176
174
  }
177
175
 
178
- /** Thrown when a native multisig simulation spec is invalid. */
176
+ /** Thrown when an account simulation spec is invalid. */
179
177
  export class InvalidSimulationError extends Errors.BaseError {
180
- override readonly name = 'MultisigSimulation.InvalidSimulationError'
178
+ override readonly name = 'AccountSimulation.InvalidSimulationError'
181
179
  constructor(options: InvalidSimulationError.Options) {
182
- super(`Invalid multisig simulation: ${options.reason}.`)
180
+ super(`Invalid account simulation: ${options.reason}.`)
183
181
  }
184
182
  }
185
183
 
@@ -18,7 +18,7 @@ const signature = {
18
18
  type: 'secp256k1',
19
19
  } as const satisfies SignatureEnvelope.Secp256k1
20
20
 
21
- const multisig = {
21
+ const configurable = {
22
22
  account: '0x2222222222222222222222222222222222222222',
23
23
  config: {
24
24
  salt: `0x${'00'.repeat(32)}`,
@@ -29,8 +29,8 @@ const multisig = {
29
29
  ],
30
30
  },
31
31
  signatures: [signature],
32
- type: 'multisig',
33
- } as const satisfies SignatureEnvelope.Multisig
32
+ type: 'configurable',
33
+ } as const satisfies SignatureEnvelope.Configurable
34
34
 
35
35
  test('accepts primitive signatures', () => {
36
36
  const signed = KeyAuthorization.from(authorization, { signature })
@@ -40,10 +40,10 @@ test('accepts primitive signatures', () => {
40
40
  >()
41
41
  })
42
42
 
43
- test('accepts multisig signatures and account-bound grants', () => {
43
+ test('accepts configurable signatures and account-bound grants', () => {
44
44
  const signed = KeyAuthorization.from(
45
- { ...authorization, account: multisig.account, type: 'multisig' },
46
- { signature: multisig },
45
+ { ...authorization, account: configurable.account, type: 'configurable' },
46
+ { signature: configurable },
47
47
  )
48
48
  expectTypeOf(signed).toMatchTypeOf<KeyAuthorization.Signed>()
49
49
  expectTypeOf(
@@ -51,11 +51,11 @@ test('accepts multisig signatures and account-bound grants', () => {
51
51
  ).toMatchTypeOf<KeyAuthorization.Rpc>()
52
52
  })
53
53
 
54
- test('requires an account for multisig grants', () => {
55
- type Multisig = Extract<KeyAuthorization.Input, { type: 'multisig' }>
56
- expectTypeOf<Multisig['account']>().toEqualTypeOf<TempoAddress.Address>()
54
+ test('requires an account for configurable grants', () => {
55
+ type Configurable = Extract<KeyAuthorization.Input, { type: 'configurable' }>
56
+ expectTypeOf<Configurable['account']>().toEqualTypeOf<TempoAddress.Address>()
57
57
  expectTypeOf<
58
- Extract<KeyAuthorization.Signed, { type: 'multisig' }>['account']
58
+ Extract<KeyAuthorization.Signed, { type: 'configurable' }>['account']
59
59
  >().toEqualTypeOf<`0x${string}`>()
60
60
  expectTypeOf<
61
61
  Omit<Extract<KeyAuthorization.Rpc, { keyType: 'multisig' }>, 'account'>
@@ -63,13 +63,13 @@ test('requires an account for multisig grants', () => {
63
63
  expectTypeOf<{
64
64
  address: `0x${string}`
65
65
  chainId: bigint
66
- type: 'multisig'
66
+ type: 'configurable'
67
67
  }>().not.toExtend<KeyAuthorization.Input>()
68
68
  expectTypeOf<{
69
69
  account: undefined
70
70
  address: `0x${string}`
71
71
  chainId: bigint
72
- type: 'multisig'
72
+ type: 'configurable'
73
73
  }>().not.toExtend<KeyAuthorization.Input>()
74
74
  expectTypeOf<{
75
75
  account: null
@@ -118,13 +118,13 @@ test('rejects keychain signatures', () => {
118
118
  expectTypeOf(rpc).toMatchTypeOf<KeyAuthorization.Rpc>()
119
119
  })
120
120
 
121
- test('resolves Tempo address bindings for multisig grants', () => {
121
+ test('resolves Tempo address bindings for configurable grants', () => {
122
122
  const signed = KeyAuthorization.from(
123
123
  {
124
124
  account: TempoAddress.format(authorization.address),
125
125
  address: TempoAddress.format(authorization.address),
126
126
  chainId: 1n,
127
- type: 'multisig',
127
+ type: 'configurable',
128
128
  },
129
129
  { signature },
130
130
  )