ox 0.14.29 → 0.14.31

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 (54) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/_cjs/core/AbiParameters.js +2 -1
  3. package/_cjs/core/AbiParameters.js.map +1 -1
  4. package/_cjs/core/internal/abiParameters.js +10 -2
  5. package/_cjs/core/internal/abiParameters.js.map +1 -1
  6. package/_cjs/tempo/KeyAuthorization.js +39 -10
  7. package/_cjs/tempo/KeyAuthorization.js.map +1 -1
  8. package/_cjs/tempo/MultisigConfig.js +26 -26
  9. package/_cjs/tempo/MultisigConfig.js.map +1 -1
  10. package/_cjs/tempo/SignatureEnvelope.js +189 -55
  11. package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
  12. package/_cjs/version.js +1 -1
  13. package/_esm/core/AbiParameters.js +4 -1
  14. package/_esm/core/AbiParameters.js.map +1 -1
  15. package/_esm/core/internal/abiParameters.js +17 -2
  16. package/_esm/core/internal/abiParameters.js.map +1 -1
  17. package/_esm/tempo/KeyAuthorization.js +41 -9
  18. package/_esm/tempo/KeyAuthorization.js.map +1 -1
  19. package/_esm/tempo/MultisigConfig.js +53 -81
  20. package/_esm/tempo/MultisigConfig.js.map +1 -1
  21. package/_esm/tempo/SignatureEnvelope.js +202 -75
  22. package/_esm/tempo/SignatureEnvelope.js.map +1 -1
  23. package/_esm/tempo/index.js +2 -2
  24. package/_esm/version.js +1 -1
  25. package/_types/core/AbiParameters.d.ts.map +1 -1
  26. package/_types/core/internal/abiParameters.d.ts.map +1 -1
  27. package/_types/core/internal/rpcSchemas/eth.d.ts +16 -0
  28. package/_types/core/internal/rpcSchemas/eth.d.ts.map +1 -1
  29. package/_types/tempo/KeyAuthorization.d.ts +22 -16
  30. package/_types/tempo/KeyAuthorization.d.ts.map +1 -1
  31. package/_types/tempo/MultisigConfig.d.ts +43 -83
  32. package/_types/tempo/MultisigConfig.d.ts.map +1 -1
  33. package/_types/tempo/SignatureEnvelope.d.ts +62 -40
  34. package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
  35. package/_types/tempo/index.d.ts +2 -2
  36. package/_types/version.d.ts +1 -1
  37. package/core/AbiParameters.ts +3 -1
  38. package/core/internal/abiParameters.ts +17 -2
  39. package/core/internal/rpcSchemas/eth.ts +16 -0
  40. package/package.json +11 -1
  41. package/tempo/KeyAuthorization.test-d/package.json +6 -0
  42. package/tempo/KeyAuthorization.test-d.ts +62 -0
  43. package/tempo/KeyAuthorization.test.ts +132 -0
  44. package/tempo/KeyAuthorization.ts +76 -29
  45. package/tempo/MultisigConfig.test.ts +86 -37
  46. package/tempo/MultisigConfig.ts +75 -132
  47. package/tempo/SignatureEnvelope.test-d/package.json +6 -0
  48. package/tempo/SignatureEnvelope.test-d.ts +97 -0
  49. package/tempo/SignatureEnvelope.test.ts +322 -30
  50. package/tempo/SignatureEnvelope.ts +314 -118
  51. package/tempo/e2e.test.ts +22 -207
  52. package/tempo/index.ts +2 -2
  53. package/tempo/multisig.e2e.test.ts +582 -0
  54. package/version.ts +1 -1
@@ -4,6 +4,7 @@ import * as Errors from '../core/Errors.js';
4
4
  import * as Hex from '../core/Hex.js';
5
5
  import type { Assign, Compute, IsNarrowable, OneOf, PartialBy, UnionPartialBy } from '../core/internal/types.js';
6
6
  import type * as PublicKey from '../core/PublicKey.js';
7
+ import * as Rlp from '../core/Rlp.js';
7
8
  import * as ox_Secp256k1 from '../core/Secp256k1.js';
8
9
  import * as Signature from '../core/Signature.js';
9
10
  import type * as WebAuthnP256 from '../core/WebAuthnP256.js';
@@ -51,7 +52,9 @@ export type GetType<envelope extends PartialBy<SignatureEnvelope, 'type'> | unkn
51
52
  userAddress: Address.Address;
52
53
  } ? 'keychain' : envelope extends {
53
54
  account: Address.Address;
54
- genesisConfigId: `0x${string}`;
55
+ signatures: any;
56
+ } | {
57
+ init: MultisigConfig.Config;
55
58
  signatures: any;
56
59
  } ? 'multisig' : never;
57
60
  /**
@@ -82,6 +85,10 @@ export type SignatureEnvelope<bigintType = bigint, numberType = number> = OneOf<
82
85
  * RPC-formatted signature envelope.
83
86
  */
84
87
  export type SignatureEnvelopeRpc = OneOf<Secp256k1Rpc | P256Rpc | WebAuthnRpc | KeychainRpc | MultisigRpc>;
88
+ /** Primitive signature envelope accepted by protocol sidecars. */
89
+ export type Primitive<bigintType = bigint, numberType = number> = OneOf<Secp256k1<bigintType, numberType> | P256<bigintType, numberType> | WebAuthn<bigintType, numberType>>;
90
+ /** RPC-formatted primitive signature envelope. */
91
+ export type PrimitiveRpc = OneOf<Secp256k1Rpc | P256Rpc | WebAuthnRpc>;
85
92
  /**
86
93
  * Keychain signature version.
87
94
  *
@@ -111,9 +118,10 @@ export type KeychainRpc = {
111
118
  /**
112
119
  * Native multisig signature (type `0x05`).
113
120
  *
114
- * Wraps a set of primitive owner approvals (secp256k1, p256, or webAuthn) over the
115
- * multisig owner approval digest. The transaction sender is the derived `account`,
116
- * authorized once the recovered owner weights meet the configured threshold.
121
+ * Wraps a set of owner approvals (secp256k1, p256, webAuthn, or nested
122
+ * multisig) over the multisig owner approval digest. The transaction sender is
123
+ * the derived `account`, authorized once the recovered owner weights meet the
124
+ * configured threshold.
117
125
  *
118
126
  * [TIP-1061](https://tips.sh/1061)
119
127
  */
@@ -121,9 +129,11 @@ export type Multisig<bigintType = bigint, numberType = number> = {
121
129
  type: 'multisig';
122
130
  /** Native multisig account address. */
123
131
  account: Address.Address;
124
- /** Permanent config ID derived from the initial multisig config. */
125
- genesisConfigId: Hex.Hex;
126
- /** Primitive owner approvals over the multisig owner approval digest. */
132
+ /**
133
+ * Owner approvals over the multisig owner approval digest. Each approval is
134
+ * either a primitive signature or a nested multisig signature (keychain
135
+ * approvals are invalid).
136
+ */
127
137
  signatures: readonly SignatureEnvelope<bigintType, numberType>[];
128
138
  /**
129
139
  * Initial native multisig config for bootstrapping this account. Present only on
@@ -132,22 +142,22 @@ export type Multisig<bigintType = bigint, numberType = number> = {
132
142
  */
133
143
  init?: MultisigConfig.Config<numberType> | undefined;
134
144
  };
135
- export type MultisigRpc = {
136
- type: 'multisig';
145
+ /** RPC-formatted native multisig signature. */
146
+ export type MultisigRpc = OneOf<{
147
+ /** Existing native multisig account. */
137
148
  account: Address.Address;
138
- /**
139
- * The permanent multisig config ID (TIP-1061 wire field `config_id`).
140
- * Maps to `genesisConfigId` on the typed
141
- * {@link ox#SignatureEnvelope.Multisig} envelope.
142
- */
143
- configId: Hex.Hex;
144
- /**
145
- * Encoded primitive owner approvals (raw serialized signatures), matching the
146
- * node's `Vec<Bytes>` representation.
147
- */
148
- signatures: readonly Serialized[];
149
- init?: MultisigConfig.Config | undefined;
150
- };
149
+ /** Structured owner approvals. */
150
+ signatures: readonly SignatureEnvelopeRpc[];
151
+ /** Multisig RPC signatures are untagged. */
152
+ type?: undefined;
153
+ } | {
154
+ /** Initial config for bootstrapping a native multisig account. */
155
+ init: MultisigConfig.Config;
156
+ /** Structured owner approvals. */
157
+ signatures: readonly SignatureEnvelopeRpc[];
158
+ /** Multisig RPC signatures are untagged. */
159
+ type?: undefined;
160
+ }>;
151
161
  export type P256<bigintType = bigint, numberType = number> = {
152
162
  prehash: boolean;
153
163
  publicKey: PublicKey.PublicKey;
@@ -215,7 +225,7 @@ export type Type = (typeof types)[number];
215
225
  */
216
226
  export declare function assert(envelope: PartialBy<SignatureEnvelope, 'type'>): void;
217
227
  export declare namespace assert {
218
- type ErrorType = CoercionError | MissingPropertiesError | MultisigConfig.assert.ErrorType | Signature.assert.ErrorType | Errors.GlobalErrorType;
228
+ type ErrorType = CoercionError | InvalidMultisigApprovalError | MissingPropertiesError | MultisigConfig.assert.ErrorType | MultisigConfig.getAddress.ErrorType | Signature.assert.ErrorType | Errors.GlobalErrorType;
219
229
  }
220
230
  /**
221
231
  * Extracts the address of the signer from a {@link ox#SignatureEnvelope.SignatureEnvelope}.
@@ -430,9 +440,9 @@ export declare function deserialize(value: Serialized): SignatureEnvelope;
430
440
  * @example
431
441
  * ### Multisig (from genesis config)
432
442
  *
433
- * Pass `genesisConfig` to derive `account` and `genesisConfigId` automatically.
434
- * Set `init: true` to opt into bootstrap (uses `genesisConfig` as the
435
- * bootstrap `init`); omit `init` for subsequent (non-bootstrap) transactions.
443
+ * Pass `genesisConfig` to derive `account` automatically. Set `init: true` to
444
+ * opt into bootstrap (uses `genesisConfig` as the bootstrap `init`); omit
445
+ * `init` for subsequent (non-bootstrap) transactions.
436
446
  *
437
447
  * ```ts twoslash
438
448
  * import { Secp256k1 } from 'ox'
@@ -474,9 +484,9 @@ export declare namespace from {
474
484
  payload?: Hex.Hex | Bytes.Bytes | undefined;
475
485
  };
476
486
  /**
477
- * Multisig envelope input variant where `account` and `genesisConfigId` are derived
478
- * from the supplied `genesisConfig`. Pass `init: true` to opt into bootstrap
479
- * (uses `genesisConfig` as the bootstrap `init`); omit `init` for subsequent
487
+ * Multisig envelope input variant where `account` is derived from the
488
+ * supplied `genesisConfig`. Pass `init: true` to opt into bootstrap (uses
489
+ * `genesisConfig` as the bootstrap `init`); omit `init` for subsequent
480
490
  * (non-bootstrap) transactions.
481
491
  */
482
492
  type MultisigFromGenesisConfig = {
@@ -512,7 +522,7 @@ export declare namespace from {
512
522
  */
513
523
  export declare function fromRpc(envelope: SignatureEnvelopeRpc): SignatureEnvelope;
514
524
  export declare namespace fromRpc {
515
- type ErrorType = CoercionError | InvalidSerializedError | Signature.fromRpc.ErrorType | Errors.GlobalErrorType;
525
+ type ErrorType = assert.ErrorType | CoercionError | InvalidSerializedError | MultisigConfig.getAddress.ErrorType | Signature.fromRpc.ErrorType | Errors.GlobalErrorType;
516
526
  }
517
527
  /**
518
528
  * Determines the signature type of an envelope.
@@ -541,6 +551,7 @@ export declare function getType<envelope extends PartialBy<SignatureEnvelope, 't
541
551
  * - WebAuthn: `0x02` + webauthnData (variable) + r (32) + s (32) + pubKeyX (32) + pubKeyY (32)
542
552
  * - Keychain V1: `0x03` + userAddress (20) + inner signature (recursive)
543
553
  * - Keychain V2: `0x04` + userAddress (20) + inner signature (recursive)
554
+ * - Multisig: `0x05` + RLP `[account | init, signatures]`
544
555
  *
545
556
  * [Signature Types](https://docs.tempo.xyz/protocol/transactions/spec-tempo-transaction#signature-types)
546
557
  *
@@ -567,6 +578,7 @@ export declare namespace serialize {
567
578
  */
568
579
  magic?: boolean | undefined;
569
580
  };
581
+ type ErrorType = assert.ErrorType | CoercionError | Hex.concat.ErrorType | Hex.fromNumber.ErrorType | Hex.fromString.ErrorType | Rlp.fromHex.ErrorType | Signature.toHex.ErrorType | Errors.GlobalErrorType;
570
582
  }
571
583
  /**
572
584
  * Orders native multisig owner approvals into the strictly-ascending
@@ -577,10 +589,10 @@ export declare namespace serialize {
577
589
  * ({@link ox#MultisigConfig.(getSignPayload:function)}), so the signer of
578
590
  * every approval is recovered against that digest and the list is sorted by the
579
591
  * recovered owner address. Works for any owner key type (secp256k1, p256,
580
- * webAuthn, keychain).
592
+ * webAuthn).
581
593
  *
582
- * Config updates never change `account`/`genesisConfigId`, so the genesis
583
- * config is the correct input even for post-update transactions.
594
+ * Config updates never change `account`, so the genesis config is the correct
595
+ * input even for post-update transactions.
584
596
  *
585
597
  * @example
586
598
  * ```ts twoslash
@@ -619,18 +631,15 @@ export declare namespace sortMultisigApprovals {
619
631
  type Value = {
620
632
  /** The inner transaction sign payload (`tx.signature_hash()`). */
621
633
  payload: Hex.Hex | Bytes.Bytes;
622
- /** The primitive owner approvals to order. */
634
+ /** The owner approvals to order. */
623
635
  signatures: readonly SignatureEnvelope[];
624
636
  } & OneOf<{
625
637
  /** The native multisig account address. */
626
638
  account: Address.Address;
627
- /** The permanent config ID. */
628
- genesisConfigId: Hex.Hex;
629
639
  } | {
630
640
  /**
631
641
  * The initial multisig config (the bootstrap config that derived the
632
- * permanent `account` and `genesisConfigId`). Used to derive both values
633
- * automatically.
642
+ * permanent `account`). Used to derive the account automatically.
634
643
  */
635
644
  genesisConfig: MultisigConfig.Config;
636
645
  }>;
@@ -652,9 +661,13 @@ export declare namespace sortMultisigApprovals {
652
661
  * @param envelope - The signature envelope to convert.
653
662
  * @returns The RPC signature envelope with hex values.
654
663
  */
655
- export declare function toRpc(envelope: SignatureEnvelope): SignatureEnvelopeRpc;
664
+ export declare function toRpc<const envelope extends toRpc.Input>(envelope: envelope): toRpc.ReturnType<envelope>;
656
665
  export declare namespace toRpc {
657
- type ErrorType = CoercionError | Signature.toRpc.ErrorType | Errors.GlobalErrorType;
666
+ /** Input accepted by {@link ox#SignatureEnvelope.(toRpc:function)}. */
667
+ type Input = SignatureEnvelope;
668
+ /** RPC signature envelope inferred from the input type. */
669
+ type ReturnType<envelope extends Input = Input> = GetType<envelope> extends 'secp256k1' ? Secp256k1Rpc : GetType<envelope> extends 'p256' ? P256Rpc : GetType<envelope> extends 'webAuthn' ? WebAuthnRpc : GetType<envelope> extends 'keychain' ? KeychainRpc : GetType<envelope> extends 'multisig' ? MultisigRpc : SignatureEnvelopeRpc;
670
+ type ErrorType = assert.ErrorType | CoercionError | Signature.toRpc.ErrorType | Errors.GlobalErrorType;
658
671
  }
659
672
  /**
660
673
  * Validates a signature envelope. Returns `true` if the envelope is valid, `false` otherwise.
@@ -824,6 +837,15 @@ export declare class InvalidSerializedError extends Errors.BaseError {
824
837
  serialized: Hex.Hex;
825
838
  });
826
839
  }
840
+ /**
841
+ * Error thrown when a native multisig owner approval is invalid.
842
+ */
843
+ export declare class InvalidMultisigApprovalError extends Errors.BaseError {
844
+ readonly name = "SignatureEnvelope.InvalidMultisigApprovalError";
845
+ constructor({ reason }: {
846
+ reason: string;
847
+ });
848
+ }
827
849
  /**
828
850
  * Error thrown when a signature envelope fails to verify.
829
851
  */
@@ -1 +1 @@
1
- {"version":3,"file":"SignatureEnvelope.d.ts","sourceRoot":"","sources":["../../tempo/SignatureEnvelope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,KAAK,KAAK,MAAM,kBAAkB,CAAA;AAC9C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R,OAAO,EACP,IAAI,GACL,EAAE;QACD,QAAQ,EAAE,OAAO,CAAA;QACjB,OAAO,EAAE,MAAM,EAAE,CAAA;QACjB,IAAI,EAAE,IAAI,GAAG,UAAU,GAAG,UAAU,CAAA;KACrC;CAKF;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,MAAM,CAAC,SAAS;IAC1D,SAAkB,IAAI,8CAA6C;gBACvD,EACV,MAAM,EACN,UAAU,GACX,EAAE;QACD,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,EAAE,GAAG,CAAC,GAAG,CAAA;KACpB;CAKF;AAED;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,MAAM,CAAC,SAAS;IAChE,SAAkB,IAAI,oDAAmD;gBAC7D,EAAE,MAAM,EAAE,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE;CAG3C;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,MAAM,CAAC,SAAS;IACrD,SAAkB,IAAI,yCAAwC;CAC/D"}
@@ -103,8 +103,8 @@ export * as KeyAuthorization from './KeyAuthorization.js';
103
103
  /**
104
104
  * Native multisig account utilities (TIP-1061).
105
105
  *
106
- * Derives stable multisig account addresses and permanent config IDs from a weighted
107
- * owner configuration, and computes the owner approval digest that owners sign.
106
+ * Derives stable multisig account addresses from a weighted owner
107
+ * configuration, and computes the owner approval digest that owners sign.
108
108
  *
109
109
  * [TIP-1061](https://tips.sh/1061)
110
110
  *
@@ -1,3 +1,3 @@
1
1
  /** @internal */
2
- export declare const version = "0.14.29";
2
+ export declare const version = "0.14.31";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -96,7 +96,9 @@ export function decode(
96
96
  const values: any = as === 'Array' ? [] : {}
97
97
  for (let i = 0; i < parameters.length; ++i) {
98
98
  const param = parameters[i] as Parameter
99
- cursor.setPosition(consumed)
99
+ // Zero-width types (e.g. `uint256[0]`, empty tuples) at the end of the
100
+ // data consume no bytes, so the cursor may already be exhausted.
101
+ if (consumed < bytes.length) cursor.setPosition(consumed)
100
102
  const [data, consumed_] = internal.decodeParameter(cursor, param, {
101
103
  checksumAddress,
102
104
  staticPosition: 0,
@@ -140,7 +140,8 @@ export function decodeArray(
140
140
 
141
141
  // If the length of the array is not known in advance (dynamic array),
142
142
  // this means we will need to wonder off to the pointer and decode.
143
- if (!length) {
143
+ // Note: zero-length fixed arrays (`T[0]`) are not dynamic.
144
+ if (length === null) {
144
145
  // Dealing with a dynamic type, so get the offset of the array data.
145
146
  const offset = Bytes.toNumber(cursor.readBytes(sizeOfOffset))
146
147
 
@@ -167,6 +168,12 @@ export function decodeArray(
167
168
  })
168
169
  consumed += consumed_
169
170
  value.push(data)
171
+ // Charge zero-width elements against the read limit to bound work
172
+ // on huge lengths of zero-width types (e.g. `uint256[0][]`).
173
+ if (consumed_ === 0) {
174
+ cursor.assertReadLimit()
175
+ cursor._touch()
176
+ }
170
177
  }
171
178
 
172
179
  // As we have gone wondering, restore to the original position + next slot.
@@ -211,6 +218,12 @@ export function decodeArray(
211
218
  })
212
219
  consumed += consumed_
213
220
  value.push(data)
221
+ // Charge zero-width elements against the read limit to bound work
222
+ // on huge lengths of zero-width types (e.g. `uint256[0][4294967295]`).
223
+ if (consumed_ === 0) {
224
+ cursor.assertReadLimit()
225
+ cursor._touch()
226
+ }
214
227
  }
215
228
  return [value, consumed]
216
229
  }
@@ -583,7 +596,9 @@ export function encodeArray<const parameter extends AbiParameters.Parameter>(
583
596
  type: `${parameter.type}[${length}]`,
584
597
  })
585
598
 
586
- let dynamicChild = false
599
+ // Zero-length fixed arrays of dynamic types (e.g. `string[0]`) are dynamic
600
+ // per the ABI spec, even though they have no elements to inspect.
601
+ let dynamicChild = value.length === 0 && hasDynamicChild(parameter)
587
602
  const preparedParameters: PreparedParameter[] = []
588
603
  for (let i = 0; i < value.length; i++) {
589
604
  const preparedParam = prepareParameter({
@@ -436,6 +436,22 @@ export type Eth = RpcSchema.From<
436
436
  }
437
437
  ReturnType: AccountProof.Rpc
438
438
  }
439
+ /**
440
+ * Returns the raw, serialized transaction specified by hash
441
+ *
442
+ * @example
443
+ * ```
444
+ * request({ method: 'eth_getRawTransactionByHash', params: ['0x...'] })
445
+ * // '0x...'
446
+ * ```
447
+ */
448
+ | {
449
+ Request: {
450
+ method: 'eth_getRawTransactionByHash'
451
+ params: [hash: Hex.Hex]
452
+ }
453
+ ReturnType: Hex.Hex | null
454
+ }
439
455
  /**
440
456
  * Returns the value from a storage position at an address
441
457
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ox",
3
3
  "description": "Ethereum Standard Library",
4
- "version": "0.14.29",
4
+ "version": "0.14.31",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -508,6 +508,11 @@
508
508
  "import": "./_esm/tempo/Channel.js",
509
509
  "default": "./_cjs/tempo/Channel.js"
510
510
  },
511
+ "./tempo/KeyAuthorization.test-d": {
512
+ "types": "./_types/tempo/KeyAuthorization.test-d.d.ts",
513
+ "import": "./_esm/tempo/KeyAuthorization.test-d.js",
514
+ "default": "./_cjs/tempo/KeyAuthorization.test-d.js"
515
+ },
511
516
  "./tempo/KeyAuthorization": {
512
517
  "types": "./_types/tempo/KeyAuthorization.d.ts",
513
518
  "import": "./_esm/tempo/KeyAuthorization.js",
@@ -538,6 +543,11 @@
538
543
  "import": "./_esm/tempo/RpcSchemaTempo.js",
539
544
  "default": "./_cjs/tempo/RpcSchemaTempo.js"
540
545
  },
546
+ "./tempo/SignatureEnvelope.test-d": {
547
+ "types": "./_types/tempo/SignatureEnvelope.test-d.d.ts",
548
+ "import": "./_esm/tempo/SignatureEnvelope.test-d.js",
549
+ "default": "./_cjs/tempo/SignatureEnvelope.test-d.js"
550
+ },
541
551
  "./tempo/SignatureEnvelope": {
542
552
  "types": "./_types/tempo/SignatureEnvelope.d.ts",
543
553
  "import": "./_esm/tempo/SignatureEnvelope.js",
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/tempo/KeyAuthorization.test-d.d.ts",
4
+ "main": "../../_cjs/tempo/KeyAuthorization.test-d.js",
5
+ "module": "../../_esm/tempo/KeyAuthorization.test-d.js"
6
+ }
@@ -0,0 +1,62 @@
1
+ import { expectTypeOf, test } from 'vitest'
2
+ import * as KeyAuthorization from './KeyAuthorization.js'
3
+ import type * as SignatureEnvelope from './SignatureEnvelope.js'
4
+
5
+ const authorization = {
6
+ address: '0x1111111111111111111111111111111111111111',
7
+ chainId: 1n,
8
+ type: 'secp256k1',
9
+ } as const satisfies KeyAuthorization.Input
10
+
11
+ const signature = {
12
+ signature: {
13
+ r: 1n,
14
+ s: 2n,
15
+ yParity: 0,
16
+ },
17
+ type: 'secp256k1',
18
+ } as const satisfies SignatureEnvelope.Secp256k1
19
+
20
+ const multisig = {
21
+ account: '0x2222222222222222222222222222222222222222',
22
+ signatures: [signature],
23
+ type: 'multisig',
24
+ } as const satisfies SignatureEnvelope.Multisig
25
+
26
+ test('accepts primitive signatures', () => {
27
+ const signed = KeyAuthorization.from(authorization, { signature })
28
+
29
+ expectTypeOf(signed.signature).toMatchTypeOf<
30
+ KeyAuthorization.Signed['signature']
31
+ >()
32
+ })
33
+
34
+ test('rejects multisig signatures', () => {
35
+ KeyAuthorization.from(authorization, {
36
+ // @ts-expect-error Key authorizations accept only primitive signatures.
37
+ signature: multisig,
38
+ })
39
+
40
+ const multisigRpc = {
41
+ account: multisig.account,
42
+ signatures: [
43
+ {
44
+ r: '0x01',
45
+ s: '0x02',
46
+ type: 'secp256k1',
47
+ yParity: '0x0',
48
+ },
49
+ ],
50
+ } as const satisfies SignatureEnvelope.MultisigRpc
51
+
52
+ const rpc: KeyAuthorization.Rpc = {
53
+ chainId: '0x1',
54
+ expiry: null,
55
+ keyId: authorization.address,
56
+ keyType: authorization.type,
57
+ // @ts-expect-error Key authorizations accept only primitive RPC signatures.
58
+ signature: multisigRpc,
59
+ }
60
+
61
+ expectTypeOf(rpc).toEqualTypeOf<KeyAuthorization.Rpc>()
62
+ })
@@ -53,6 +53,12 @@ const signature_webauthn = SignatureEnvelope.from({
53
53
  },
54
54
  })
55
55
 
56
+ const signature_multisig = SignatureEnvelope.from({
57
+ account: address,
58
+ signatures: [SignatureEnvelope.from(signature_secp256k1)],
59
+ type: 'multisig',
60
+ })
61
+
56
62
  describe('from', () => {
57
63
  test('default', () => {
58
64
  const authorization = KeyAuthorization.from({
@@ -441,9 +447,63 @@ describe('from', () => {
441
447
  }
442
448
  `)
443
449
  })
450
+
451
+ test('rejects a multisig signature', () => {
452
+ const authorization = KeyAuthorization.from({
453
+ address,
454
+ chainId: 1n,
455
+ type: 'secp256k1',
456
+ })
457
+
458
+ expect(() =>
459
+ KeyAuthorization.from(authorization, {
460
+ signature: signature_multisig as never,
461
+ }),
462
+ ).toThrowErrorMatchingInlineSnapshot(
463
+ `[KeyAuthorization.InvalidSignatureTypeError: Signature type \`multisig\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.]`,
464
+ )
465
+
466
+ expect(() =>
467
+ KeyAuthorization.from(authorization, {
468
+ signature: SignatureEnvelope.serialize(signature_multisig),
469
+ }),
470
+ ).toThrowErrorMatchingInlineSnapshot(
471
+ `[KeyAuthorization.InvalidSignatureTypeError: Signature type \`multisig\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.]`,
472
+ )
473
+
474
+ expect(() =>
475
+ KeyAuthorization.from({
476
+ ...authorization,
477
+ signature: signature_multisig,
478
+ } as never),
479
+ ).toThrowErrorMatchingInlineSnapshot(
480
+ `[KeyAuthorization.InvalidSignatureTypeError: Signature type \`multisig\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.]`,
481
+ )
482
+ })
444
483
  })
445
484
 
446
485
  describe('fromRpc', () => {
486
+ test('rejects a multisig signature', () => {
487
+ expect(() =>
488
+ KeyAuthorization.fromRpc({
489
+ chainId: '0x1',
490
+ expiry: null,
491
+ keyId: address,
492
+ keyType: 'secp256k1',
493
+ signature: {
494
+ account: address,
495
+ signatures: [
496
+ SignatureEnvelope.toRpc(
497
+ SignatureEnvelope.from(signature_secp256k1),
498
+ ),
499
+ ],
500
+ },
501
+ } as never),
502
+ ).toThrowErrorMatchingInlineSnapshot(
503
+ `[KeyAuthorization.InvalidSignatureTypeError: Signature type \`multisig\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.]`,
504
+ )
505
+ })
506
+
447
507
  test('secp256k1', () => {
448
508
  const authorization = KeyAuthorization.fromRpc({
449
509
  chainId: '0x1',
@@ -661,6 +721,17 @@ describe('fromRpc', () => {
661
721
  })
662
722
 
663
723
  describe('fromTuple', () => {
724
+ test('rejects a multisig signature', () => {
725
+ expect(() =>
726
+ KeyAuthorization.fromTuple([
727
+ ['0x1', '0x', address],
728
+ SignatureEnvelope.serialize(signature_multisig),
729
+ ]),
730
+ ).toThrowErrorMatchingInlineSnapshot(
731
+ `[KeyAuthorization.InvalidSignatureTypeError: Signature type \`multisig\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.]`,
732
+ )
733
+ })
734
+
664
735
  test('default', () => {
665
736
  const authorization = KeyAuthorization.fromTuple([
666
737
  [
@@ -998,6 +1069,19 @@ describe('getSignPayload', () => {
998
1069
  })
999
1070
 
1000
1071
  describe('deserialize', () => {
1072
+ test('rejects a multisig signature', () => {
1073
+ const serialized = Rlp.fromHex([
1074
+ ['0x1', '0x', address],
1075
+ SignatureEnvelope.serialize(signature_multisig),
1076
+ ])
1077
+
1078
+ expect(() =>
1079
+ KeyAuthorization.deserialize(serialized),
1080
+ ).toThrowErrorMatchingInlineSnapshot(
1081
+ `[KeyAuthorization.InvalidSignatureTypeError: Signature type \`multisig\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.]`,
1082
+ )
1083
+ })
1084
+
1001
1085
  test('default', () => {
1002
1086
  const authorization = KeyAuthorization.from({
1003
1087
  address,
@@ -1168,6 +1252,19 @@ describe('serialize', () => {
1168
1252
  })
1169
1253
 
1170
1254
  describe('toRpc', () => {
1255
+ test('rejects a multisig signature', () => {
1256
+ expect(() =>
1257
+ KeyAuthorization.toRpc({
1258
+ address,
1259
+ chainId: 1n,
1260
+ signature: signature_multisig,
1261
+ type: 'secp256k1',
1262
+ } as never),
1263
+ ).toThrowErrorMatchingInlineSnapshot(
1264
+ `[KeyAuthorization.InvalidSignatureTypeError: Signature type \`multisig\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.]`,
1265
+ )
1266
+ })
1267
+
1171
1268
  test('secp256k1', () => {
1172
1269
  const authorization = KeyAuthorization.from({
1173
1270
  address,
@@ -1425,6 +1522,19 @@ describe('toRpc', () => {
1425
1522
  })
1426
1523
 
1427
1524
  describe('toTuple', () => {
1525
+ test('rejects a multisig signature', () => {
1526
+ expect(() =>
1527
+ KeyAuthorization.toTuple({
1528
+ address,
1529
+ chainId: 1n,
1530
+ signature: signature_multisig,
1531
+ type: 'secp256k1',
1532
+ } as never),
1533
+ ).toThrowErrorMatchingInlineSnapshot(
1534
+ `[KeyAuthorization.InvalidSignatureTypeError: Signature type \`multisig\` is invalid for key authorizations; expected \`secp256k1\`, \`p256\`, or \`webAuthn\`.]`,
1535
+ )
1536
+ })
1537
+
1428
1538
  test('default', () => {
1429
1539
  const authorization = KeyAuthorization.from({
1430
1540
  address,
@@ -2432,6 +2542,28 @@ describe('admin keys (TIP-1049)', () => {
2432
2542
  expect(restored.account).toBe(account)
2433
2543
  })
2434
2544
 
2545
+ test('fromRpc: drops orphan isAdmin without account', () => {
2546
+ const authorization = KeyAuthorization.from(
2547
+ { address, chainId: 1n, type: 'secp256k1' },
2548
+ { signature: SignatureEnvelope.from(signature_secp256k1) },
2549
+ )
2550
+ const rpc = KeyAuthorization.toRpc(authorization)
2551
+ const restored = KeyAuthorization.fromRpc({ ...rpc, isAdmin: true })
2552
+ expect(restored.isAdmin).toBeUndefined()
2553
+ expect(restored.account).toBeUndefined()
2554
+ })
2555
+
2556
+ test('fromRpc: drops orphan account without isAdmin', () => {
2557
+ const authorization = KeyAuthorization.from(
2558
+ { address, chainId: 1n, type: 'secp256k1' },
2559
+ { signature: SignatureEnvelope.from(signature_secp256k1) },
2560
+ )
2561
+ const rpc = KeyAuthorization.toRpc(authorization)
2562
+ const restored = KeyAuthorization.fromRpc({ ...rpc, account })
2563
+ expect(restored.isAdmin).toBeUndefined()
2564
+ expect(restored.account).toBeUndefined()
2565
+ })
2566
+
2435
2567
  test('hash: changes when admin pair is added', () => {
2436
2568
  const plain = KeyAuthorization.from({
2437
2569
  address,