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
@@ -1,13 +1,13 @@
1
1
  import { Address, Hash, P256 } from 'ox'
2
2
  import {
3
+ AccountConfig,
4
+ AccountOperation,
3
5
  KeyAuthorization,
4
- MultisigConfig,
5
- MultisigOperation,
6
6
  SignatureEnvelope,
7
7
  TxEnvelopeTempo,
8
8
  } from 'ox/tempo'
9
9
  import { describe, expect, test } from 'vitest'
10
- import { factory } from '../../test/tempo/multisig.js'
10
+ import { factory } from '../../test/tempo/configurableAccounts.js'
11
11
 
12
12
  const owners = [1n, 2n, 3n]
13
13
  .map((value, index) => {
@@ -30,15 +30,15 @@ const owners = [1n, 2n, 3n]
30
30
  .sort((a, b) => a.address.localeCompare(b.address))
31
31
  const owner_1 = owners[0]!.address
32
32
  const owner_2 = owners[1]!.address
33
- const config = MultisigConfig.from({
33
+ const config = AccountConfig.from({
34
34
  owners: [
35
35
  { owner: owner_1, weight: 1 },
36
36
  { owner: owner_2, weight: 1 },
37
37
  ],
38
38
  threshold: 2,
39
39
  })
40
- const currentConfig = MultisigConfig.from({ ...config, version: 1n })
41
- const account = MultisigConfig.getAddress(config, { factory })
40
+ const currentConfig = AccountConfig.from({ ...config, version: 1n })
41
+ const account = AccountConfig.getAddress(config, { factory })
42
42
  const ownerSignature_1 = owners[0]!.signature
43
43
  const approval_1 = SignatureEnvelope.serialize(ownerSignature_1)
44
44
  const approval_2 = SignatureEnvelope.serialize(owners[1]!.signature)
@@ -62,14 +62,14 @@ const keyAuthorization = KeyAuthorization.serialize(
62
62
  }),
63
63
  )
64
64
 
65
- const transactionHash_ = MultisigConfig.getSignPayload({
65
+ const transactionHash_ = AccountConfig.getSignPayload({
66
66
  account,
67
67
  config: currentConfig,
68
68
  payload: TxEnvelopeTempo.getSignPayload(
69
69
  TxEnvelopeTempo.deserialize(transaction),
70
70
  ),
71
71
  })
72
- const keyAuthorizationHash = MultisigConfig.getSignPayload({
72
+ const keyAuthorizationHash = AccountConfig.getSignPayload({
73
73
  account,
74
74
  config: currentConfig,
75
75
  payload: KeyAuthorization.getSignPayload(
@@ -136,13 +136,13 @@ function approvalAddresses(
136
136
  describe('getHash', () => {
137
137
  test('transaction and key authorization', () => {
138
138
  expect({
139
- keyAuthorization: MultisigOperation.getHash({
139
+ keyAuthorization: AccountOperation.getHash({
140
140
  account,
141
141
  config: currentConfig,
142
142
  keyAuthorization,
143
143
  type: 'keyAuthorization',
144
144
  }),
145
- transaction: MultisigOperation.getHash({
145
+ transaction: AccountOperation.getHash({
146
146
  account,
147
147
  config: currentConfig,
148
148
  transaction,
@@ -150,8 +150,8 @@ describe('getHash', () => {
150
150
  }),
151
151
  }).toMatchInlineSnapshot(`
152
152
  {
153
- "keyAuthorization": "0xa83016f0e94c4a6125483ffeba3abb0a8df1bc0f5a503f63639e806b793520bb",
154
- "transaction": "0x2d7e3c7c38a9acf85f0a9d70a39b0e9e5a05d92c7a73b633a47a45be4a112b3b",
153
+ "keyAuthorization": "0xd18f389ae23bdc81939861c9a1079201968a2ec5fbd67ad1063556b46af8914f",
154
+ "transaction": "0x246027f7c6940fb4b68a746c49819c1c45737aa6c975aafcce721b4a619a9ab1",
155
155
  }
156
156
  `)
157
157
  })
@@ -159,7 +159,7 @@ describe('getHash', () => {
159
159
 
160
160
  describe('selectApprovals', () => {
161
161
  test('selects a deterministic weighted quorum', async () => {
162
- const config = MultisigConfig.from({
162
+ const config = AccountConfig.from({
163
163
  owners: [
164
164
  { owner: owners[0]!.address, weight: 2 },
165
165
  { owner: owners[1]!.address, weight: 1 },
@@ -167,8 +167,8 @@ describe('selectApprovals', () => {
167
167
  ],
168
168
  threshold: 3,
169
169
  })
170
- const account = MultisigConfig.getAddress(config, { factory })
171
- const hash = MultisigOperation.getHash({
170
+ const account = AccountConfig.getAddress(config, { factory })
171
+ const hash = AccountOperation.getHash({
172
172
  account,
173
173
  config: { ...config, version: 1n },
174
174
  transaction,
@@ -176,7 +176,7 @@ describe('selectApprovals', () => {
176
176
  })
177
177
  const approvals = owners.map((owner) => signApproval(owner, hash))
178
178
  const alternate = signApproval(owners[0]!, hash, `0x${'01'.repeat(32)}`)
179
- const selection = await MultisigOperation.selectApprovals({
179
+ const selection = await AccountOperation.selectApprovals({
180
180
  account,
181
181
  approvals: [
182
182
  approvals[2]!,
@@ -188,7 +188,7 @@ describe('selectApprovals', () => {
188
188
  config,
189
189
  hash,
190
190
  })
191
- const reversed = await MultisigOperation.selectApprovals({
191
+ const reversed = await AccountOperation.selectApprovals({
192
192
  account,
193
193
  approvals: [
194
194
  approvals[0]!,
@@ -224,7 +224,7 @@ describe('selectApprovals', () => {
224
224
  `)
225
225
  })
226
226
  test('accepts an explicit account from a chain-configured factory', async () => {
227
- const selected = await MultisigOperation.selectApprovals({
227
+ const selected = await AccountOperation.selectApprovals({
228
228
  account,
229
229
  approvals: [],
230
230
  config,
@@ -232,7 +232,7 @@ describe('selectApprovals', () => {
232
232
  })
233
233
  expect(selected.weight).toMatchInlineSnapshot(`0`)
234
234
  })
235
- test('rejects keychain and multisig owner approvals', async () => {
235
+ test('rejects keychain and configurable owner approvals', async () => {
236
236
  for (const signature of [
237
237
  SignatureEnvelope.from({
238
238
  inner: ownerSignature_1,
@@ -247,19 +247,19 @@ describe('selectApprovals', () => {
247
247
  }),
248
248
  ])
249
249
  await expect(
250
- MultisigOperation.selectApprovals({
250
+ AccountOperation.selectApprovals({
251
251
  account,
252
252
  approvals: [SignatureEnvelope.serialize(signature)],
253
253
  config,
254
254
  hash: transactionHash_,
255
255
  }),
256
256
  ).rejects.toThrowErrorMatchingInlineSnapshot(
257
- `[MultisigOperation.InvalidApprovalError: Invalid multisig approval: only primitive signatures can approve a multisig operation.]`,
257
+ `[AccountOperation.InvalidApprovalError: Invalid operation approval: only primitive signatures can approve an account operation.]`,
258
258
  )
259
259
  })
260
260
 
261
261
  test('rejects invalid and non-owner approvals', async () => {
262
- const hash = MultisigOperation.getHash({
262
+ const hash = AccountOperation.getHash({
263
263
  account,
264
264
  config: currentConfig,
265
265
  transaction,
@@ -272,24 +272,24 @@ describe('selectApprovals', () => {
272
272
  const nonOwner = signApproval(owners[2]!, hash)
273
273
 
274
274
  await expect(
275
- MultisigOperation.selectApprovals({
275
+ AccountOperation.selectApprovals({
276
276
  account,
277
277
  approvals: [invalid],
278
278
  config,
279
279
  hash,
280
280
  }),
281
281
  ).rejects.toThrowErrorMatchingInlineSnapshot(
282
- `[MultisigOperation.InvalidApprovalError: Invalid multisig approval: signature from owner 0x07e1ed8ea0e9601e5546b0a03aed683df3601407 is invalid.]`,
282
+ `[AccountOperation.InvalidApprovalError: Invalid operation approval: signature from owner 0x07e1ed8ea0e9601e5546b0a03aed683df3601407 is invalid.]`,
283
283
  )
284
284
  await expect(
285
- MultisigOperation.selectApprovals({
285
+ AccountOperation.selectApprovals({
286
286
  account,
287
287
  approvals: [nonOwner],
288
288
  config,
289
289
  hash,
290
290
  }),
291
291
  ).rejects.toThrowErrorMatchingInlineSnapshot(
292
- `[MultisigOperation.InvalidApprovalError: Invalid multisig approval: signature is from non-owner 0xd3a9f047ad43d7e2e4e7e491f1fe2e657a2651b6.]`,
292
+ `[AccountOperation.InvalidApprovalError: Invalid operation approval: signature is from non-owner 0xd3a9f047ad43d7e2e4e7e491f1fe2e657a2651b6.]`,
293
293
  )
294
294
  })
295
295
  })
@@ -298,13 +298,13 @@ describe('serializeKeyAuthorization', () => {
298
298
  test('behavior: current and initial authorizations', async () => {
299
299
  const results = []
300
300
  for (const applicableConfig of [currentConfig, config]) {
301
- const hash = MultisigOperation.getHash({
301
+ const hash = AccountOperation.getHash({
302
302
  account,
303
303
  config: applicableConfig,
304
304
  keyAuthorization,
305
305
  type: 'keyAuthorization',
306
306
  })
307
- const selection = await MultisigOperation.selectApprovals({
307
+ const selection = await AccountOperation.selectApprovals({
308
308
  account,
309
309
  approvals: [
310
310
  signApproval(owners[1]!, hash),
@@ -313,7 +313,7 @@ describe('serializeKeyAuthorization', () => {
313
313
  config: applicableConfig,
314
314
  hash,
315
315
  })
316
- const serialized = MultisigOperation.serializeKeyAuthorization(
316
+ const serialized = AccountOperation.serializeKeyAuthorization(
317
317
  keyAuthorization,
318
318
  {
319
319
  account,
@@ -324,16 +324,16 @@ describe('serializeKeyAuthorization', () => {
324
324
  const value = KeyAuthorization.deserialize(serialized)
325
325
  results.push({
326
326
  account:
327
- value.signature?.type === 'multisig'
327
+ value.signature?.type === 'configurable'
328
328
  ? value.signature.account
329
329
  : undefined,
330
330
  hash: Hash.keccak256(serialized),
331
331
  signatureCount:
332
- value.signature?.type === 'multisig'
332
+ value.signature?.type === 'configurable'
333
333
  ? value.signature.signatures.length
334
334
  : 0,
335
335
  version:
336
- value.signature?.type === 'multisig'
336
+ value.signature?.type === 'configurable'
337
337
  ? value.signature.config.version
338
338
  : undefined,
339
339
  })
@@ -342,14 +342,14 @@ describe('serializeKeyAuthorization', () => {
342
342
  expect(results).toMatchInlineSnapshot(`
343
343
  [
344
344
  {
345
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
346
- "hash": "0xcd4283709cc1853dc8ed9cc4dd8c3b6a22e1b01f19ad3f6348f4bebe79590408",
345
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
346
+ "hash": "0x8d72c92f8aca5cf651ff914a928a32b1717e51b70fce97e305aaab02617474f5",
347
347
  "signatureCount": 2,
348
348
  "version": 1n,
349
349
  },
350
350
  {
351
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
352
- "hash": "0x1f66e6adc4ddf8ac9d4575f518be11509ca616ac13d4e0a286b4eef7b96959f2",
351
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
352
+ "hash": "0x1dce79ae000bb60526cbe3b18be29d517319ee0958b01e5e3e89608e19c13459",
353
353
  "signatureCount": 2,
354
354
  "version": 0n,
355
355
  },
@@ -358,7 +358,7 @@ describe('serializeKeyAuthorization', () => {
358
358
  })
359
359
 
360
360
  test('error: signed authorization', async () => {
361
- const selection = await MultisigOperation.selectApprovals({
361
+ const selection = await AccountOperation.selectApprovals({
362
362
  account,
363
363
  approvals: [
364
364
  signApproval(owners[0]!, keyAuthorizationHash),
@@ -367,7 +367,7 @@ describe('serializeKeyAuthorization', () => {
367
367
  config: currentConfig,
368
368
  hash: keyAuthorizationHash,
369
369
  })
370
- const signed = MultisigOperation.serializeKeyAuthorization(
370
+ const signed = AccountOperation.serializeKeyAuthorization(
371
371
  keyAuthorization,
372
372
  {
373
373
  account,
@@ -377,13 +377,13 @@ describe('serializeKeyAuthorization', () => {
377
377
  )
378
378
 
379
379
  expect(() =>
380
- MultisigOperation.serializeKeyAuthorization(signed, {
380
+ AccountOperation.serializeKeyAuthorization(signed, {
381
381
  account,
382
382
  approvals: selection.selectedApprovals,
383
383
  config: currentConfig,
384
384
  }),
385
385
  ).toThrowErrorMatchingInlineSnapshot(
386
- `[MultisigOperation.InvalidOperationError: Invalid multisig operation: keyAuthorization must not contain a signature.]`,
386
+ `[AccountOperation.InvalidOperationError: Invalid account operation: keyAuthorization must not contain a signature.]`,
387
387
  )
388
388
  })
389
389
  })
@@ -392,13 +392,13 @@ describe('serializeTransaction', () => {
392
392
  test('current and initial transactions', async () => {
393
393
  const results = []
394
394
  for (const applicableConfig of [currentConfig, config]) {
395
- const hash = MultisigOperation.getHash({
395
+ const hash = AccountOperation.getHash({
396
396
  account,
397
397
  config: applicableConfig,
398
398
  transaction,
399
399
  type: 'transaction',
400
400
  })
401
- const selection = await MultisigOperation.selectApprovals({
401
+ const selection = await AccountOperation.selectApprovals({
402
402
  account,
403
403
  approvals: [
404
404
  signApproval(owners[1]!, hash),
@@ -407,7 +407,7 @@ describe('serializeTransaction', () => {
407
407
  config: applicableConfig,
408
408
  hash,
409
409
  })
410
- const operation = MultisigOperation.from({
410
+ const operation = AccountOperation.from({
411
411
  account,
412
412
  approvals: selection.approvals,
413
413
  config: applicableConfig,
@@ -421,19 +421,19 @@ describe('serializeTransaction', () => {
421
421
  updatedAt: 1,
422
422
  weight: selection.weight,
423
423
  })
424
- const serialized = MultisigOperation.serializeTransaction(operation, {
424
+ const serialized = AccountOperation.serializeTransaction(operation, {
425
425
  approvals: selection.selectedApprovals,
426
426
  })
427
427
  const value = TxEnvelopeTempo.deserialize(serialized)
428
428
  results.push({
429
429
  account: value.signature?.account,
430
430
  version:
431
- value.signature?.type === 'multisig'
431
+ value.signature?.type === 'configurable'
432
432
  ? value.signature.config.version
433
433
  : undefined,
434
434
  hash: Hash.keccak256(serialized),
435
435
  signatureCount:
436
- value.signature?.type === 'multisig'
436
+ value.signature?.type === 'configurable'
437
437
  ? value.signature.signatures.length
438
438
  : 0,
439
439
  type: serialized.slice(0, 4),
@@ -443,15 +443,15 @@ describe('serializeTransaction', () => {
443
443
  expect(results).toMatchInlineSnapshot(`
444
444
  [
445
445
  {
446
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
447
- "hash": "0x6a034f208339f7eaa4a42b3fa03aad5df77ebe83659dac2e4d2b11226d221928",
446
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
447
+ "hash": "0x75106153400c34efbeb7380828e3fef939340eb0a3a42dda6a22f798f94665d0",
448
448
  "signatureCount": 2,
449
449
  "type": "0x76",
450
450
  "version": 1n,
451
451
  },
452
452
  {
453
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
454
- "hash": "0x04d36e54d7a816b080dfa03370da6fbeb3523ce3eff5211d7f22a3c7e87476ee",
453
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
454
+ "hash": "0x2718b956492b1f8ff4e25165ac425e9e7064580b76eb087ce764e263723152bc",
455
455
  "signatureCount": 2,
456
456
  "type": "0x76",
457
457
  "version": 0n,
@@ -480,13 +480,13 @@ describe('serializeTransaction', () => {
480
480
  ] as const
481
481
  const results = []
482
482
  for (const transaction of transactions) {
483
- const hash = MultisigOperation.getHash({
483
+ const hash = AccountOperation.getHash({
484
484
  account,
485
485
  config: currentConfig,
486
486
  transaction,
487
487
  type: 'transaction',
488
488
  })
489
- const selection = await MultisigOperation.selectApprovals({
489
+ const selection = await AccountOperation.selectApprovals({
490
490
  account,
491
491
  approvals: [
492
492
  signApproval(owners[0]!, hash),
@@ -495,8 +495,8 @@ describe('serializeTransaction', () => {
495
495
  config: currentConfig,
496
496
  hash,
497
497
  })
498
- const serialized = MultisigOperation.serializeTransaction(
499
- MultisigOperation.from({
498
+ const serialized = AccountOperation.serializeTransaction(
499
+ AccountOperation.from({
500
500
  account,
501
501
  approvals: selection.approvals,
502
502
  config: currentConfig,
@@ -517,7 +517,7 @@ describe('serializeTransaction', () => {
517
517
  feePayerSignature: value.feePayerSignature,
518
518
  from: value.from,
519
519
  signatureCount:
520
- value.signature?.type === 'multisig'
520
+ value.signature?.type === 'configurable'
521
521
  ? value.signature.signatures.length
522
522
  : 0,
523
523
  type: serialized.slice(0, 4),
@@ -528,7 +528,7 @@ describe('serializeTransaction', () => {
528
528
  [
529
529
  {
530
530
  "feePayerSignature": null,
531
- "from": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
531
+ "from": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
532
532
  "signatureCount": 2,
533
533
  "type": "0x78",
534
534
  },
@@ -538,7 +538,7 @@ describe('serializeTransaction', () => {
538
538
  "s": 6n,
539
539
  "yParity": 0,
540
540
  },
541
- "from": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
541
+ "from": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
542
542
  "signatureCount": 2,
543
543
  "type": "0x78",
544
544
  },
@@ -547,7 +547,7 @@ describe('serializeTransaction', () => {
547
547
  })
548
548
 
549
549
  test('rejects an approval not retained by the operation', async () => {
550
- const hash = MultisigOperation.getHash({
550
+ const hash = AccountOperation.getHash({
551
551
  account,
552
552
  config: currentConfig,
553
553
  transaction,
@@ -555,13 +555,13 @@ describe('serializeTransaction', () => {
555
555
  })
556
556
  const approval_1 = signApproval(owners[0]!, hash)
557
557
  const approval_2 = signApproval(owners[1]!, hash)
558
- const selection = await MultisigOperation.selectApprovals({
558
+ const selection = await AccountOperation.selectApprovals({
559
559
  account,
560
560
  approvals: [approval_1],
561
561
  config: currentConfig,
562
562
  hash,
563
563
  })
564
- const operation = MultisigOperation.from({
564
+ const operation = AccountOperation.from({
565
565
  account,
566
566
  approvals: selection.approvals,
567
567
  config: currentConfig,
@@ -577,19 +577,19 @@ describe('serializeTransaction', () => {
577
577
  })
578
578
 
579
579
  expect(() =>
580
- MultisigOperation.serializeTransaction(operation, {
580
+ AccountOperation.serializeTransaction(operation, {
581
581
  approvals: [approval_2],
582
582
  }),
583
583
  ).toThrowErrorMatchingInlineSnapshot(
584
- `[MultisigOperation.InvalidOperationError: Invalid multisig operation: transaction signature is not a retained approval.]`,
584
+ `[AccountOperation.InvalidOperationError: Invalid account operation: transaction signature is not a retained approval.]`,
585
585
  )
586
586
  })
587
587
  })
588
588
 
589
589
  describe('from', () => {
590
590
  test('transaction states', () => {
591
- const pending = MultisigOperation.from(transactionPending)
592
- const submitting = MultisigOperation.from({
591
+ const pending = AccountOperation.from(transactionPending)
592
+ const submitting = AccountOperation.from({
593
593
  ...transactionPending,
594
594
  approvals: [approval_1, approval_2],
595
595
  expiresAt: 10,
@@ -598,7 +598,7 @@ describe('from', () => {
598
598
  submissionId,
599
599
  weight: 2,
600
600
  })
601
- const success = MultisigOperation.from({
601
+ const success = AccountOperation.from({
602
602
  ...transactionPending,
603
603
  approvals: [approval_1, approval_2],
604
604
  signatureCount: 2,
@@ -610,7 +610,7 @@ describe('from', () => {
610
610
  expect({ pending, submitting, success }).toMatchInlineSnapshot(`
611
611
  {
612
612
  "pending": {
613
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
613
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
614
614
  "approvals": [
615
615
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
616
616
  ],
@@ -630,7 +630,7 @@ describe('from', () => {
630
630
  "version": 1n,
631
631
  },
632
632
  "createdAt": 1,
633
- "hash": "0x2d7e3c7c38a9acf85f0a9d70a39b0e9e5a05d92c7a73b633a47a45be4a112b3b",
633
+ "hash": "0x246027f7c6940fb4b68a746c49819c1c45737aa6c975aafcce721b4a619a9ab1",
634
634
  "signatureCount": 1,
635
635
  "status": "pending",
636
636
  "threshold": 2,
@@ -640,7 +640,7 @@ describe('from', () => {
640
640
  "weight": 1,
641
641
  },
642
642
  "submitting": {
643
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
643
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
644
644
  "approvals": [
645
645
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
646
646
  "0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
@@ -662,7 +662,7 @@ describe('from', () => {
662
662
  },
663
663
  "createdAt": 1,
664
664
  "expiresAt": 10,
665
- "hash": "0x2d7e3c7c38a9acf85f0a9d70a39b0e9e5a05d92c7a73b633a47a45be4a112b3b",
665
+ "hash": "0x246027f7c6940fb4b68a746c49819c1c45737aa6c975aafcce721b4a619a9ab1",
666
666
  "signatureCount": 2,
667
667
  "status": "submitting",
668
668
  "submissionId": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
@@ -673,7 +673,7 @@ describe('from', () => {
673
673
  "weight": 2,
674
674
  },
675
675
  "success": {
676
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
676
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
677
677
  "approvals": [
678
678
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
679
679
  "0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
@@ -694,7 +694,7 @@ describe('from', () => {
694
694
  "version": 1n,
695
695
  },
696
696
  "createdAt": 1,
697
- "hash": "0x2d7e3c7c38a9acf85f0a9d70a39b0e9e5a05d92c7a73b633a47a45be4a112b3b",
697
+ "hash": "0x246027f7c6940fb4b68a746c49819c1c45737aa6c975aafcce721b4a619a9ab1",
698
698
  "signatureCount": 2,
699
699
  "status": "success",
700
700
  "threshold": 2,
@@ -716,9 +716,9 @@ describe('from', () => {
716
716
  }),
717
717
  { format: 'feePayer', sender: account },
718
718
  )
719
- const operation = MultisigOperation.from({
719
+ const operation = AccountOperation.from({
720
720
  ...transactionPending,
721
- hash: MultisigConfig.getSignPayload({
721
+ hash: AccountConfig.getSignPayload({
722
722
  account,
723
723
  config: currentConfig,
724
724
  payload: TxEnvelopeTempo.getSignPayload(
@@ -735,7 +735,7 @@ describe('from', () => {
735
735
  },
736
736
  `
737
737
  {
738
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
738
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
739
739
  "approvals": [
740
740
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
741
741
  ],
@@ -777,9 +777,9 @@ describe('from', () => {
777
777
  }),
778
778
  { format: 'feePayer' },
779
779
  )
780
- const operation = MultisigOperation.from({
780
+ const operation = AccountOperation.from({
781
781
  ...transactionPending,
782
- hash: MultisigConfig.getSignPayload({
782
+ hash: AccountConfig.getSignPayload({
783
783
  account,
784
784
  config: currentConfig,
785
785
  payload: TxEnvelopeTempo.getSignPayload(
@@ -793,10 +793,10 @@ describe('from', () => {
793
793
  })
794
794
 
795
795
  test('initial transaction', () => {
796
- const operation = MultisigOperation.from({
796
+ const operation = AccountOperation.from({
797
797
  ...transactionPending,
798
798
  config,
799
- hash: MultisigConfig.getSignPayload({
799
+ hash: AccountConfig.getSignPayload({
800
800
  account,
801
801
  config,
802
802
  payload: TxEnvelopeTempo.getSignPayload(
@@ -812,7 +812,7 @@ describe('from', () => {
812
812
  },
813
813
  `
814
814
  {
815
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
815
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
816
816
  "approvals": [
817
817
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
818
818
  ],
@@ -846,9 +846,9 @@ describe('from', () => {
846
846
  })
847
847
 
848
848
  test('key authorization states', () => {
849
- const pending = MultisigOperation.from(keyAuthorizationPending)
849
+ const pending = AccountOperation.from(keyAuthorizationPending)
850
850
  const authorization = KeyAuthorization.deserialize(keyAuthorization)
851
- const success = MultisigOperation.from({
851
+ const success = AccountOperation.from({
852
852
  ...keyAuthorizationPending,
853
853
  approvals: [approval_1, approval_2],
854
854
  keyAuthorization: KeyAuthorization.serialize(
@@ -857,7 +857,7 @@ describe('from', () => {
857
857
  account,
858
858
  config: currentConfig,
859
859
  signatures: [ownerSignature_1, owners[1]!.signature],
860
- type: 'multisig',
860
+ type: 'configurable',
861
861
  },
862
862
  }),
863
863
  ),
@@ -869,7 +869,7 @@ describe('from', () => {
869
869
  expect({ pending, success }).toMatchInlineSnapshot(`
870
870
  {
871
871
  "pending": {
872
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
872
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
873
873
  "approvals": [
874
874
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
875
875
  ],
@@ -889,8 +889,8 @@ describe('from', () => {
889
889
  "version": 1n,
890
890
  },
891
891
  "createdAt": 1,
892
- "hash": "0xa83016f0e94c4a6125483ffeba3abb0a8df1bc0f5a503f63639e806b793520bb",
893
- "keyAuthorization": "0xf838f782107980943333333333333333333333333333333333333333846b49d2008080808094ef6b17836e1b3647105c3084124485e3e1b0ab7f",
892
+ "hash": "0xd18f389ae23bdc81939861c9a1079201968a2ec5fbd67ad1063556b46af8914f",
893
+ "keyAuthorization": "0xf838f782107980943333333333333333333333333333333333333333846b49d20080808080940f8659dd87410f00a1668211ecda7ac7f9c9fd13",
894
894
  "signatureCount": 1,
895
895
  "status": "pending",
896
896
  "threshold": 2,
@@ -899,7 +899,7 @@ describe('from', () => {
899
899
  "weight": 1,
900
900
  },
901
901
  "success": {
902
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
902
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
903
903
  "approvals": [
904
904
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
905
905
  "0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
@@ -920,8 +920,8 @@ describe('from', () => {
920
920
  "version": 1n,
921
921
  },
922
922
  "createdAt": 1,
923
- "hash": "0xa83016f0e94c4a6125483ffeba3abb0a8df1bc0f5a503f63639e806b793520bb",
924
- "keyAuthorization": "0xf901b3f782107980943333333333333333333333333333333333333333846b49d2008080808094ef6b17836e1b3647105c3084124485e3e1b0ab7fb9017805f9017494ef6b17836e1b3647105c3084124485e3e1b0ab7ff852a000000000000000000000000000000000000000000000000000000000000000000102eed69407e1ed8ea0e9601e5546b0a03aed683df360140701d694288f0cd85005f34168f731a468aef268c2f9456f01f90108b88201000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200b88201000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
923
+ "hash": "0xd18f389ae23bdc81939861c9a1079201968a2ec5fbd67ad1063556b46af8914f",
924
+ "keyAuthorization": "0xf901b3f782107980943333333333333333333333333333333333333333846b49d20080808080940f8659dd87410f00a1668211ecda7ac7f9c9fd13b9017805f90174940f8659dd87410f00a1668211ecda7ac7f9c9fd13f852a000000000000000000000000000000000000000000000000000000000000000000102eed69407e1ed8ea0e9601e5546b0a03aed683df360140701d694288f0cd85005f34168f731a468aef268c2f9456f01f90108b88201000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200b88201000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
925
925
  "signatureCount": 2,
926
926
  "status": "success",
927
927
  "threshold": 2,
@@ -941,15 +941,15 @@ describe('from', () => {
941
941
  account,
942
942
  config,
943
943
  signatures: [ownerSignature_1, owners[1]!.signature],
944
- type: 'multisig',
944
+ type: 'configurable',
945
945
  },
946
946
  }),
947
947
  )
948
- const operation = MultisigOperation.from({
948
+ const operation = AccountOperation.from({
949
949
  ...keyAuthorizationPending,
950
950
  approvals: [approval_1, approval_2],
951
951
  config,
952
- hash: MultisigConfig.getSignPayload({
952
+ hash: AccountConfig.getSignPayload({
953
953
  account,
954
954
  config,
955
955
  payload: KeyAuthorization.getSignPayload(authorization),
@@ -967,7 +967,7 @@ describe('from', () => {
967
967
  },
968
968
  `
969
969
  {
970
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
970
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
971
971
  "approvals": [
972
972
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
973
973
  "0x01000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000047cf27b188d034f7e8a52380304b51ac3c08969e277f21b35a60b48fc4766997807775510db8ed040293d9ac69f7430dbba7dade63ce982299e04b79d227873d100",
@@ -1004,8 +1004,8 @@ describe('from', () => {
1004
1004
 
1005
1005
  describe('RPC conversion', () => {
1006
1006
  test('round-trips transaction and key authorization operations', () => {
1007
- const transactionRpc = MultisigOperation.toRpc(transactionPending)
1008
- const keyAuthorizationRpc = MultisigOperation.toRpc(keyAuthorizationPending)
1007
+ const transactionRpc = AccountOperation.toRpc(transactionPending)
1008
+ const keyAuthorizationRpc = AccountOperation.toRpc(keyAuthorizationPending)
1009
1009
 
1010
1010
  expect(() =>
1011
1011
  JSON.stringify({ keyAuthorizationRpc, transactionRpc }),
@@ -1013,7 +1013,7 @@ describe('RPC conversion', () => {
1013
1013
  expect({ keyAuthorizationRpc, transactionRpc }).toMatchInlineSnapshot(`
1014
1014
  {
1015
1015
  "keyAuthorizationRpc": {
1016
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
1016
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
1017
1017
  "approvals": [
1018
1018
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
1019
1019
  ],
@@ -1033,8 +1033,8 @@ describe('RPC conversion', () => {
1033
1033
  "version": "0x1",
1034
1034
  },
1035
1035
  "createdAt": 1,
1036
- "hash": "0xa83016f0e94c4a6125483ffeba3abb0a8df1bc0f5a503f63639e806b793520bb",
1037
- "keyAuthorization": "0xf838f782107980943333333333333333333333333333333333333333846b49d2008080808094ef6b17836e1b3647105c3084124485e3e1b0ab7f",
1036
+ "hash": "0xd18f389ae23bdc81939861c9a1079201968a2ec5fbd67ad1063556b46af8914f",
1037
+ "keyAuthorization": "0xf838f782107980943333333333333333333333333333333333333333846b49d20080808080940f8659dd87410f00a1668211ecda7ac7f9c9fd13",
1038
1038
  "signatureCount": 1,
1039
1039
  "status": "pending",
1040
1040
  "threshold": 2,
@@ -1043,7 +1043,7 @@ describe('RPC conversion', () => {
1043
1043
  "weight": 1,
1044
1044
  },
1045
1045
  "transactionRpc": {
1046
- "account": "0xef6b17836e1b3647105c3084124485e3e1b0ab7f",
1046
+ "account": "0x0f8659dd87410f00a1668211ecda7ac7f9c9fd13",
1047
1047
  "approvals": [
1048
1048
  "0x01000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000065ecbe4d1a6330a44c8f7ef951d4bf165e6c6b721efada985fb41661bc6e7fd6c8734640c4998ff7e374b06ce1a64a2ecd82ab036384fb83d9a79b127a27d503200",
1049
1049
  ],
@@ -1063,7 +1063,7 @@ describe('RPC conversion', () => {
1063
1063
  "version": "0x1",
1064
1064
  },
1065
1065
  "createdAt": 1,
1066
- "hash": "0x2d7e3c7c38a9acf85f0a9d70a39b0e9e5a05d92c7a73b633a47a45be4a112b3b",
1066
+ "hash": "0x246027f7c6940fb4b68a746c49819c1c45737aa6c975aafcce721b4a619a9ab1",
1067
1067
  "signatureCount": 1,
1068
1068
  "status": "pending",
1069
1069
  "threshold": 2,
@@ -1074,11 +1074,11 @@ describe('RPC conversion', () => {
1074
1074
  },
1075
1075
  }
1076
1076
  `)
1077
- expect(MultisigOperation.fromRpc(transactionRpc)).toStrictEqual(
1078
- MultisigOperation.from(transactionPending),
1077
+ expect(AccountOperation.fromRpc(transactionRpc)).toStrictEqual(
1078
+ AccountOperation.from(transactionPending),
1079
1079
  )
1080
- expect(MultisigOperation.fromRpc(keyAuthorizationRpc)).toStrictEqual(
1081
- MultisigOperation.from(keyAuthorizationPending),
1080
+ expect(AccountOperation.fromRpc(keyAuthorizationRpc)).toStrictEqual(
1081
+ AccountOperation.from(keyAuthorizationPending),
1082
1082
  )
1083
1083
  })
1084
1084
  })
@@ -1175,7 +1175,7 @@ describe('validation', () => {
1175
1175
  name: 'weight unreachable by the retained owner approvals',
1176
1176
  operation: {
1177
1177
  ...transactionPending,
1178
- config: MultisigConfig.from({
1178
+ config: AccountConfig.from({
1179
1179
  owners: [
1180
1180
  { owner: owner_1, weight: 1 },
1181
1181
  { owner: owner_2, weight: 2 },
@@ -1194,7 +1194,7 @@ describe('validation', () => {
1194
1194
  operation: {
1195
1195
  ...transactionPending,
1196
1196
  account: '0x0000000000000000000000000000000000000000',
1197
- hash: MultisigConfig.getSignPayload({
1197
+ hash: AccountConfig.getSignPayload({
1198
1198
  account: '0x0000000000000000000000000000000000000000',
1199
1199
  config: currentConfig,
1200
1200
  payload: TxEnvelopeTempo.getSignPayload(
@@ -1271,21 +1271,21 @@ describe('validation', () => {
1271
1271
  account,
1272
1272
  config,
1273
1273
  signatures: [ownerSignature_1],
1274
- type: 'multisig',
1274
+ type: 'configurable',
1275
1275
  }),
1276
1276
  ],
1277
1277
  },
1278
1278
  },
1279
1279
  ])('rejects $name', ({ operation }) => {
1280
1280
  expect(() =>
1281
- MultisigOperation.from(operation as MultisigOperation.Operation),
1282
- ).toThrowError(MultisigOperation.InvalidOperationError)
1281
+ AccountOperation.from(operation as AccountOperation.Operation),
1282
+ ).toThrowError(AccountOperation.InvalidOperationError)
1283
1283
  })
1284
1284
  test('accepts initial accounts validated by the chain', () => {
1285
- const value = MultisigOperation.from({
1285
+ const value = AccountOperation.from({
1286
1286
  ...transactionPending,
1287
1287
  config,
1288
- hash: MultisigOperation.getHash({
1288
+ hash: AccountOperation.getHash({
1289
1289
  account,
1290
1290
  config,
1291
1291
  transaction,
@@ -1297,14 +1297,14 @@ describe('validation', () => {
1297
1297
  })
1298
1298
 
1299
1299
  test('rejects noncanonical RPC quantities', () => {
1300
- const operation = MultisigOperation.toRpc(transactionPending)
1300
+ const operation = AccountOperation.toRpc(transactionPending)
1301
1301
  expect(() =>
1302
- MultisigOperation.fromRpc({
1302
+ AccountOperation.fromRpc({
1303
1303
  ...operation,
1304
1304
  config: { ...operation.config, version: '0x01' },
1305
1305
  }),
1306
1306
  ).toThrowError(
1307
- 'Invalid multisig operation: config.version must use canonical quantity encoding.',
1307
+ 'Invalid account operation: config.version must use canonical quantity encoding.',
1308
1308
  )
1309
1309
  })
1310
1310
 
@@ -1319,7 +1319,7 @@ describe('validation', () => {
1319
1319
  account,
1320
1320
  config: currentConfig,
1321
1321
  signatures: [ownerSignature_1, owners[2]!.signature],
1322
- type: 'multisig',
1322
+ type: 'configurable',
1323
1323
  },
1324
1324
  }),
1325
1325
  ),
@@ -1328,15 +1328,15 @@ describe('validation', () => {
1328
1328
  weight: 2,
1329
1329
  } as const
1330
1330
 
1331
- expect(() => MultisigOperation.from(operation)).toThrowError(
1332
- 'Invalid multisig operation: key authorization signature is not a retained approval.',
1331
+ expect(() => AccountOperation.from(operation)).toThrowError(
1332
+ 'Invalid account operation: key authorization signature is not a retained approval.',
1333
1333
  )
1334
1334
  })
1335
1335
 
1336
1336
  test('rejects unordered key authorization approvals', () => {
1337
1337
  const authorization = KeyAuthorization.deserialize(keyAuthorization)
1338
1338
  const signatures = [
1339
- ...SignatureEnvelope.sortMultisigApprovals({
1339
+ ...SignatureEnvelope.sortApprovals({
1340
1340
  account,
1341
1341
  config: currentConfig,
1342
1342
  payload: KeyAuthorization.getSignPayload(authorization),
@@ -1352,7 +1352,7 @@ describe('validation', () => {
1352
1352
  account,
1353
1353
  config: currentConfig,
1354
1354
  signatures,
1355
- type: 'multisig',
1355
+ type: 'configurable',
1356
1356
  },
1357
1357
  }),
1358
1358
  ),
@@ -1361,8 +1361,8 @@ describe('validation', () => {
1361
1361
  weight: 2,
1362
1362
  } as const
1363
1363
 
1364
- expect(() => MultisigOperation.from(operation)).toThrowError(
1365
- 'Invalid multisig operation: key authorization approvals are not canonically ordered.',
1364
+ expect(() => AccountOperation.from(operation)).toThrowError(
1365
+ 'Invalid account operation: key authorization approvals are not canonically ordered.',
1366
1366
  )
1367
1367
  })
1368
1368
 
@@ -1377,7 +1377,7 @@ describe('validation', () => {
1377
1377
  account,
1378
1378
  config: currentConfig,
1379
1379
  signatures: [ownerSignature_1, ownerSignature_1],
1380
- type: 'multisig',
1380
+ type: 'configurable',
1381
1381
  },
1382
1382
  }),
1383
1383
  ),
@@ -1386,13 +1386,13 @@ describe('validation', () => {
1386
1386
  weight: 2,
1387
1387
  } as const
1388
1388
 
1389
- expect(() => MultisigOperation.from(operation)).toThrowError(
1390
- 'Invalid multisig operation: key authorization contains duplicate owner approvals.',
1389
+ expect(() => AccountOperation.from(operation)).toThrowError(
1390
+ 'Invalid account operation: key authorization contains duplicate owner approvals.',
1391
1391
  )
1392
1392
  })
1393
1393
 
1394
1394
  test('accepts case-insensitive initial configs', () => {
1395
- const config = MultisigConfig.from({
1395
+ const config = AccountConfig.from({
1396
1396
  owners: [
1397
1397
  {
1398
1398
  owner: Address.checksum(owner_1),
@@ -1406,7 +1406,7 @@ describe('validation', () => {
1406
1406
  salt: `0x${'AB'.repeat(32)}`,
1407
1407
  threshold: 2,
1408
1408
  })
1409
- const account = MultisigConfig.getAddress(config, { factory })
1409
+ const account = AccountConfig.getAddress(config, { factory })
1410
1410
  const authorization = KeyAuthorization.from({
1411
1411
  account,
1412
1412
  address: '0x3333333333333333333333333333333333333333',
@@ -1415,7 +1415,7 @@ describe('validation', () => {
1415
1415
  isAdmin: false,
1416
1416
  type: 'secp256k1',
1417
1417
  })
1418
- const signatures = SignatureEnvelope.sortMultisigApprovals({
1418
+ const signatures = SignatureEnvelope.sortApprovals({
1419
1419
  account,
1420
1420
  config,
1421
1421
  payload: KeyAuthorization.getSignPayload(authorization),
@@ -1425,12 +1425,12 @@ describe('validation', () => {
1425
1425
  SignatureEnvelope.serialize(signature),
1426
1426
  )
1427
1427
 
1428
- const operation = MultisigOperation.from({
1428
+ const operation = AccountOperation.from({
1429
1429
  account,
1430
1430
  approvals,
1431
1431
  config,
1432
1432
  createdAt: 1,
1433
- hash: MultisigConfig.getSignPayload({
1433
+ hash: AccountConfig.getSignPayload({
1434
1434
  account,
1435
1435
  config,
1436
1436
  payload: KeyAuthorization.getSignPayload(authorization),
@@ -1441,7 +1441,7 @@ describe('validation', () => {
1441
1441
  account,
1442
1442
  config,
1443
1443
  signatures,
1444
- type: 'multisig',
1444
+ type: 'configurable',
1445
1445
  },
1446
1446
  }),
1447
1447
  ),