ox 0.14.63 → 0.14.65

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 (131) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/_cjs/core/AbiError.js +6 -2
  3. package/_cjs/core/AbiError.js.map +1 -1
  4. package/_cjs/core/AbiEvent.js +4 -0
  5. package/_cjs/core/AbiEvent.js.map +1 -1
  6. package/_cjs/core/AbiFunction.js +2 -2
  7. package/_cjs/core/AbiFunction.js.map +1 -1
  8. package/_cjs/core/AbiItem.js +6 -7
  9. package/_cjs/core/AbiItem.js.map +1 -1
  10. package/_cjs/core/Base32.js +15 -1
  11. package/_cjs/core/Base32.js.map +1 -1
  12. package/_cjs/core/Bytes.js +4 -5
  13. package/_cjs/core/Bytes.js.map +1 -1
  14. package/_cjs/core/Cbor.js +13 -2
  15. package/_cjs/core/Cbor.js.map +1 -1
  16. package/_cjs/core/Hex.js +2 -3
  17. package/_cjs/core/Hex.js.map +1 -1
  18. package/_cjs/core/Rlp.js +49 -8
  19. package/_cjs/core/Rlp.js.map +1 -1
  20. package/_cjs/core/RpcTransport.js +9 -4
  21. package/_cjs/core/RpcTransport.js.map +1 -1
  22. package/_cjs/core/Siwe.js +4 -0
  23. package/_cjs/core/Siwe.js.map +1 -1
  24. package/_cjs/core/TypedData.js +2 -2
  25. package/_cjs/core/TypedData.js.map +1 -1
  26. package/_cjs/core/internal/abiItem.js +1 -1
  27. package/_cjs/core/internal/abiItem.js.map +1 -1
  28. package/_cjs/erc4337/UserOperation.js +7 -4
  29. package/_cjs/erc4337/UserOperation.js.map +1 -1
  30. package/_cjs/erc8021/Attribution.js +13 -3
  31. package/_cjs/erc8021/Attribution.js.map +1 -1
  32. package/_cjs/tempo/SignaturePreAuthorized.js +177 -0
  33. package/_cjs/tempo/SignaturePreAuthorized.js.map +1 -0
  34. package/_cjs/tempo/Tick.js +3 -2
  35. package/_cjs/tempo/Tick.js.map +1 -1
  36. package/_cjs/tempo/index.js +2 -1
  37. package/_cjs/tempo/index.js.map +1 -1
  38. package/_cjs/version.js +1 -1
  39. package/_esm/core/AbiError.js +6 -2
  40. package/_esm/core/AbiError.js.map +1 -1
  41. package/_esm/core/AbiEvent.js +5 -0
  42. package/_esm/core/AbiEvent.js.map +1 -1
  43. package/_esm/core/AbiFunction.js +2 -2
  44. package/_esm/core/AbiFunction.js.map +1 -1
  45. package/_esm/core/AbiItem.js +8 -7
  46. package/_esm/core/AbiItem.js.map +1 -1
  47. package/_esm/core/Base32.js +17 -2
  48. package/_esm/core/Base32.js.map +1 -1
  49. package/_esm/core/Bytes.js +4 -5
  50. package/_esm/core/Bytes.js.map +1 -1
  51. package/_esm/core/Cbor.js +16 -2
  52. package/_esm/core/Cbor.js.map +1 -1
  53. package/_esm/core/Hex.js +3 -3
  54. package/_esm/core/Hex.js.map +1 -1
  55. package/_esm/core/Rlp.js +56 -8
  56. package/_esm/core/Rlp.js.map +1 -1
  57. package/_esm/core/RpcTransport.js +12 -4
  58. package/_esm/core/RpcTransport.js.map +1 -1
  59. package/_esm/core/Siwe.js +5 -0
  60. package/_esm/core/Siwe.js.map +1 -1
  61. package/_esm/core/TypedData.js +7 -6
  62. package/_esm/core/TypedData.js.map +1 -1
  63. package/_esm/core/internal/abiItem.js +2 -1
  64. package/_esm/core/internal/abiItem.js.map +1 -1
  65. package/_esm/erc4337/UserOperation.js +10 -4
  66. package/_esm/erc4337/UserOperation.js.map +1 -1
  67. package/_esm/erc8021/Attribution.js +15 -3
  68. package/_esm/erc8021/Attribution.js.map +1 -1
  69. package/_esm/tempo/SignaturePreAuthorized.js +314 -0
  70. package/_esm/tempo/SignaturePreAuthorized.js.map +1 -0
  71. package/_esm/tempo/Tick.js +4 -3
  72. package/_esm/tempo/Tick.js.map +1 -1
  73. package/_esm/tempo/index.js +8 -0
  74. package/_esm/tempo/index.js.map +1 -1
  75. package/_esm/version.js +1 -1
  76. package/_types/core/AbiError.d.ts +2 -2
  77. package/_types/core/AbiError.d.ts.map +1 -1
  78. package/_types/core/AbiEvent.d.ts.map +1 -1
  79. package/_types/core/AbiFunction.d.ts +1 -1
  80. package/_types/core/AbiFunction.d.ts.map +1 -1
  81. package/_types/core/AbiItem.d.ts.map +1 -1
  82. package/_types/core/Base32.d.ts +8 -3
  83. package/_types/core/Base32.d.ts.map +1 -1
  84. package/_types/core/Bytes.d.ts.map +1 -1
  85. package/_types/core/Cbor.d.ts.map +1 -1
  86. package/_types/core/Hex.d.ts.map +1 -1
  87. package/_types/core/Rlp.d.ts +9 -2
  88. package/_types/core/Rlp.d.ts.map +1 -1
  89. package/_types/core/RpcTransport.d.ts.map +1 -1
  90. package/_types/core/Siwe.d.ts.map +1 -1
  91. package/_types/core/internal/abiItem.d.ts +3 -1
  92. package/_types/core/internal/abiItem.d.ts.map +1 -1
  93. package/_types/erc4337/UserOperation.d.ts +20 -2
  94. package/_types/erc4337/UserOperation.d.ts.map +1 -1
  95. package/_types/erc8021/Attribution.d.ts.map +1 -1
  96. package/_types/package.json +1 -0
  97. package/_types/tempo/SignatureEnvelope.d.ts +4 -4
  98. package/_types/tempo/SignaturePreAuthorized.d.ts +192 -0
  99. package/_types/tempo/SignaturePreAuthorized.d.ts.map +1 -0
  100. package/_types/tempo/Tick.d.ts.map +1 -1
  101. package/_types/tempo/index.d.ts +8 -0
  102. package/_types/tempo/index.d.ts.map +1 -1
  103. package/_types/version.d.ts +1 -1
  104. package/core/AbiError.ts +33 -22
  105. package/core/AbiEvent.ts +7 -0
  106. package/core/AbiFunction.ts +7 -5
  107. package/core/AbiItem.ts +8 -7
  108. package/core/Base32.ts +17 -3
  109. package/core/Bytes.ts +3 -5
  110. package/core/Cbor.ts +20 -2
  111. package/core/Hex.ts +4 -4
  112. package/core/Rlp.ts +55 -5
  113. package/core/RpcTransport.ts +12 -4
  114. package/core/Siwe.ts +5 -0
  115. package/core/TypedData.ts +7 -6
  116. package/core/internal/abiItem.ts +13 -2
  117. package/erc4337/UserOperation.ts +37 -3
  118. package/erc8021/Attribution.ts +11 -7
  119. package/package.json +11 -1
  120. package/tempo/AccountSimulation.test.ts +1 -1
  121. package/tempo/SignatureEnvelope.test.ts +12 -0
  122. package/tempo/SignatureEnvelope.ts +4 -4
  123. package/tempo/SignaturePreAuthorized/package.json +6 -0
  124. package/tempo/SignaturePreAuthorized.test-d/package.json +6 -0
  125. package/tempo/SignaturePreAuthorized.test-d.ts +29 -0
  126. package/tempo/SignaturePreAuthorized.test.ts +410 -0
  127. package/tempo/SignaturePreAuthorized.ts +370 -0
  128. package/tempo/Tick.test.ts +10 -0
  129. package/tempo/Tick.ts +5 -3
  130. package/tempo/index.ts +9 -0
  131. package/version.ts +1 -1
package/core/TypedData.ts CHANGED
@@ -758,7 +758,7 @@ export class InvalidStructTypeError extends Errors.BaseError {
758
758
  constructor({ type }: { type: string }) {
759
759
  super(`Struct type "${type}" is invalid.`, {
760
760
  metaMessages: [
761
- 'Struct type must contain only letters, digits, "_" and "$", and must not be a Solidity type.',
761
+ 'Struct type must contain only letters, digits, "_", "$" and ":", and must not be a Solidity type.',
762
762
  ],
763
763
  })
764
764
  }
@@ -893,7 +893,7 @@ export declare namespace encodeField {
893
893
  }
894
894
 
895
895
  const arraySuffixRegex = /(\[[0-9]*\])+$/
896
- const structNameRegex = /^[A-Za-z0-9_$]+$/
896
+ const structNameRegex = /^[A-Za-z0-9_$:]+$/
897
897
  const solidityTypeNameRegex = /^(u?int|bytes)[0-9]*$/
898
898
 
899
899
  /** @internal */
@@ -945,10 +945,11 @@ function isSolidityType(type: string) {
945
945
 
946
946
  /** @internal */
947
947
  function validateReference(type: string) {
948
- // Struct type must contain only letters, digits, `_` and `$`, and must not be
949
- // a Solidity type, so it cannot shadow a Solidity type or an array of one. A
950
- // struct such as `intent` or `bytesInfo` is valid, while `uint7` or `bytes33`
951
- // is rejected, since other implementations parse it as a Solidity type.
948
+ // Struct type must contain only letters, digits, `_`, `$` and `:`, and must
949
+ // not be a Solidity type, so it cannot shadow a Solidity type or an array of
950
+ // one. A struct such as `intent` or `bytesInfo` is valid, while `uint7` or
951
+ // `bytes33` is rejected, since other implementations parse it as a Solidity
952
+ // type.
952
953
  if (
953
954
  !structNameRegex.test(type) ||
954
955
  type === 'address' ||
@@ -52,7 +52,17 @@ export type ExtractForArgs<
52
52
  >
53
53
  }
54
54
  >
55
- : TupleToUnion<abiItems, abi, name, args> // convert back to union (removes `never` tuple entries: `['foo', never, 'bar'][number]` => `'foo' | 'bar'`)
55
+ : readonly [] extends args
56
+ ? TupleToUnion<abiItems, abi, name, args> extends infer zero
57
+ ? Compute<
58
+ zero & {
59
+ readonly overloads: UnionToTuple<
60
+ Exclude<abiItems[number], zero>
61
+ >
62
+ }
63
+ >
64
+ : never
65
+ : TupleToUnion<abiItems, abi, name, args> // convert back to union (removes `never` tuple entries: `['foo', never, 'bar'][number]` => `'foo' | 'bar'`)
56
66
  : never
57
67
  : abiItem
58
68
  : never
@@ -556,7 +566,8 @@ export function isArgOfType(
556
566
  return false
557
567
  // An overload whose fixed size differs from the value does not match.
558
568
  const bytes = abiParameterType.slice(5)
559
- if (!bytes) return true
569
+ // Dynamic `bytes` is hex or raw bytes. A plain string is only `string`.
570
+ if (!bytes) return arg instanceof Uint8Array || Hex.validate(arg)
560
571
  if (arg instanceof Uint8Array)
561
572
  return arg.length === Number.parseInt(bytes, 10)
562
573
  if (!Hex.validate(arg)) return false
@@ -601,12 +601,24 @@ export declare namespace hash {
601
601
  * @param userOperation - The user operation to convert.
602
602
  * @returns The init code.
603
603
  */
604
- export function toInitCode(userOperation: Partial<UserOperation>): Hex.Hex {
604
+ export function toInitCode(
605
+ userOperation: Partial<UserOperation>,
606
+ options: toInitCode.Options = {},
607
+ ): Hex.Hex {
608
+ const { forHash } = options
605
609
  const { authorization, factory, factoryData } = userOperation
606
610
  if (
607
611
  factory === '0x7702' ||
608
612
  factory === '0x7702000000000000000000000000000000000000'
609
613
  ) {
614
+ // Onchain, the EntryPoint detects EIP-7702 by the 20-byte `0x7702` marker
615
+ // and reads the initialization data from `initCode[20:]`.
616
+ if (!forHash)
617
+ return Hex.concat(
618
+ '0x7702000000000000000000000000000000000000',
619
+ factoryData ?? '0x',
620
+ )
621
+ // For the hash, the EntryPoint replaces the marker with the delegate.
610
622
  if (!authorization) return '0x7702000000000000000000000000000000000000'
611
623
  const delegation = authorization.address
612
624
  return Hex.concat(delegation, factoryData ?? '0x')
@@ -615,6 +627,18 @@ export function toInitCode(userOperation: Partial<UserOperation>): Hex.Hex {
615
627
  return Hex.concat(factory, factoryData ?? '0x')
616
628
  }
617
629
 
630
+ export declare namespace toInitCode {
631
+ type Options = {
632
+ /**
633
+ * Prepares the init code for hashing: replaces the EIP-7702 `0x7702`
634
+ * marker with the delegate address.
635
+ */
636
+ forHash?: boolean | undefined
637
+ }
638
+
639
+ type ErrorType = Hex.concat.ErrorType | Errors.GlobalErrorType
640
+ }
641
+
618
642
  /**
619
643
  * Transforms a User Operation into "packed" format.
620
644
  *
@@ -641,6 +665,7 @@ export function toInitCode(userOperation: Partial<UserOperation>): Hex.Hex {
641
665
  */
642
666
  export function toPacked(
643
667
  userOperation: UserOperation<'0.7' | '0.8', true>,
668
+ options: toPacked.Options = {},
644
669
  ): Packed {
645
670
  const {
646
671
  callGasLimit,
@@ -661,7 +686,7 @@ export function toPacked(
661
686
  Hex.padLeft(Hex.fromNumber(verificationGasLimit || 0n), 16),
662
687
  Hex.padLeft(Hex.fromNumber(callGasLimit || 0n), 16),
663
688
  )
664
- const initCode = toInitCode(userOperation)
689
+ const initCode = toInitCode(userOperation, { forHash: options.forHash })
665
690
  const gasFees = Hex.concat(
666
691
  Hex.padLeft(Hex.fromNumber(maxPriorityFeePerGas || 0n), 16),
667
692
  Hex.padLeft(Hex.fromNumber(maxFeePerGas || 0n), 16),
@@ -690,6 +715,15 @@ export function toPacked(
690
715
  }
691
716
 
692
717
  export declare namespace toPacked {
718
+ /** Packing options. */
719
+ export type Options = {
720
+ /**
721
+ * Prepares for hashing: replaces the EIP-7702 `initCode` marker with the
722
+ * delegate.
723
+ */
724
+ forHash?: boolean | undefined
725
+ }
726
+
693
727
  export type ErrorType = Errors.GlobalErrorType
694
728
  }
695
729
 
@@ -905,7 +939,7 @@ export function toTypedData(
905
939
  ): TypedData.Definition<typeof toTypedData.types, 'PackedUserOperation'> {
906
940
  const { chainId, entryPointAddress } = options
907
941
 
908
- const packedUserOp = toPacked(userOperation)
942
+ const packedUserOp = toPacked(userOperation, { forHash: true })
909
943
 
910
944
  return {
911
945
  domain: {
@@ -319,6 +319,8 @@ export function fromData(data: Hex.Hex): Attribution | undefined {
319
319
  // Extract codes
320
320
  const codesStart = -ercSuffixSize - 2 - codesLength
321
321
  const codesEnd = -ercSuffixSize - 2
322
+ // `Hex.slice` clamps a negative start that runs past the beginning of `data`.
323
+ if (Hex.size(data) + codesStart < 0) return undefined
322
324
  const codesHex = Hex.slice(data, codesStart, codesEnd)
323
325
  const codesString = Hex.toString(codesHex)
324
326
  const codes = codesString.length > 0 ? codesString.split(',') : []
@@ -340,6 +342,8 @@ export function fromData(data: Hex.Hex): Attribution | undefined {
340
342
  // Extract codes
341
343
  const codesStart = -ercSuffixSize - 2 - codesLength
342
344
  const codesEnd = -ercSuffixSize - 2
345
+ // `Hex.slice` clamps a negative start that runs past the beginning of `data`.
346
+ if (Hex.size(data) + codesStart < 0) return undefined
343
347
  const codesHex = Hex.slice(data, codesStart, codesEnd)
344
348
  const codesString = Hex.toString(codesHex)
345
349
  const codes = codesString.length > 0 ? codesString.split(',') : []
@@ -475,16 +479,16 @@ function schema2ToDataSuffix(attribution: AttributionSchemaId2): Hex.Hex {
475
479
 
476
480
  function schema2FromData(data: Hex.Hex): AttributionSchemaId2 | undefined {
477
481
  // cborLength is 2 bytes before schema ID
478
- const cborLengthHex = Hex.slice(
479
- data,
480
- -ercSuffixSize - 1 - 2,
481
- -ercSuffixSize - 1,
482
- )
482
+ const cborLengthStart = -ercSuffixSize - 1 - 2
483
+ const cborLengthEnd = -ercSuffixSize - 1
484
+ if (Hex.size(data) + cborLengthStart < 0) return undefined
485
+ const cborLengthHex = Hex.slice(data, cborLengthStart, cborLengthEnd)
483
486
  const cborLength = Hex.toNumber(cborLengthHex)
484
487
 
485
488
  // Extract CBOR data
486
- const cborStart = -ercSuffixSize - 1 - 2 - cborLength
487
- const cborEnd = -ercSuffixSize - 1 - 2
489
+ const cborStart = cborLengthStart - cborLength
490
+ if (Hex.size(data) + cborStart < 0) return undefined
491
+ const cborEnd = cborLengthStart
488
492
  const cborHex = Hex.slice(data, cborStart, cborEnd)
489
493
 
490
494
  // Decode CBOR
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ox",
3
3
  "description": "Ethereum Standard Library",
4
- "version": "0.14.63",
4
+ "version": "0.14.65",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -613,6 +613,16 @@
613
613
  "import": "./_esm/tempo/SignatureEnvelope.js",
614
614
  "default": "./_cjs/tempo/SignatureEnvelope.js"
615
615
  },
616
+ "./tempo/SignaturePreAuthorized.test-d": {
617
+ "types": "./_types/tempo/SignaturePreAuthorized.test-d.d.ts",
618
+ "import": "./_esm/tempo/SignaturePreAuthorized.test-d.js",
619
+ "default": "./_cjs/tempo/SignaturePreAuthorized.test-d.js"
620
+ },
621
+ "./tempo/SignaturePreAuthorized": {
622
+ "types": "./_types/tempo/SignaturePreAuthorized.d.ts",
623
+ "import": "./_esm/tempo/SignaturePreAuthorized.js",
624
+ "default": "./_cjs/tempo/SignaturePreAuthorized.js"
625
+ },
616
626
  "./tempo/TempoAddress": {
617
627
  "types": "./_types/tempo/TempoAddress.d.ts",
618
628
  "import": "./_esm/tempo/TempoAddress.js",
@@ -107,7 +107,7 @@ describe('fromRpc', () => {
107
107
  expect(() =>
108
108
  AccountSimulation.fromRpc({ ...rpc, config: noncanonical }),
109
109
  ).toThrowErrorMatchingInlineSnapshot(
110
- `[AccountSimulation.InvalidSimulationError: Invalid account simulation: invalid config encoding.]`,
110
+ `[Rlp.NonCanonicalError: RLP payload is not canonically encoded: single byte \`0x00\` is wrapped in an explicit length prefix instead of being encoded as itself.]`,
111
111
  )
112
112
  })
113
113
  })
@@ -1043,6 +1043,18 @@ describe('from', () => {
1043
1043
  expect(envelope.type).toBe('keychain')
1044
1044
  })
1045
1045
 
1046
+ test('behavior: defaults version to v2', () => {
1047
+ const envelope = SignatureEnvelope.from({
1048
+ inner: SignatureEnvelope.from(signature_secp256k1),
1049
+ userAddress: '0x1234567890123456789012345678901234567890',
1050
+ })
1051
+
1052
+ expect(envelope).toMatchObject({ version: 'v2' })
1053
+ expect(
1054
+ Hex.slice(SignatureEnvelope.serialize(envelope), 0, 1),
1055
+ ).toMatchInlineSnapshot(`"0x04"`)
1056
+ })
1057
+
1046
1058
  test('behavior: computes keyId from p256 inner publicKey', () => {
1047
1059
  const envelope = SignatureEnvelope.from({
1048
1060
  userAddress: '0x1234567890123456789012345678901234567890',
@@ -139,7 +139,7 @@ export type GetType<
139
139
  *
140
140
  * - **keychain** (type `0x03` V1, `0x04` V2): Access key signature that wraps an inner signature
141
141
  * (secp256k1, p256, or webAuthn). Format: type byte + user_address (20 bytes) + inner signature.
142
- * V2 binds the signature to the user account via `keccak256(sigHash || userAddress)`.
142
+ * V2 binds the signature to the user account via `keccak256(0x04 || sigHash || userAddress)`.
143
143
  * The protocol validates the access key authorization via the AccountKeychain precompile.
144
144
  *
145
145
  * - **configurable** (type `0x05`): Configurable account signature carrying the account address,
@@ -181,8 +181,8 @@ export type PrimitiveRpc = OneOf<Secp256k1Rpc | P256Rpc | WebAuthnRpc>
181
181
  * Keychain signature version.
182
182
  *
183
183
  * - `'v1'`: Legacy format. Inner signature signs the raw `sig_hash` directly. Deprecated at T1C.
184
- * - `'v2'`: Inner signature signs `keccak256(sig_hash || user_address)`, binding the signature
185
- * to the specific user account.
184
+ * - `'v2'`: Inner signature signs `keccak256(0x04 || sig_hash || user_address)`, binding the
185
+ * signature to the specific user account.
186
186
  */
187
187
  export type KeychainVersion = 'v1' | 'v2'
188
188
 
@@ -194,7 +194,7 @@ export type Keychain<bigintType = bigint, numberType = number> = {
194
194
  type: 'keychain'
195
195
  /** Root account address that this transaction is being executed for */
196
196
  userAddress: Address.Address
197
- /** Keychain signature version. @default 'v1' */
197
+ /** Keychain signature version. @default 'v2' */
198
198
  version?: KeychainVersion | undefined
199
199
  }
200
200
 
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/tempo/SignaturePreAuthorized.d.ts",
4
+ "main": "../../_cjs/tempo/SignaturePreAuthorized.js",
5
+ "module": "../../_esm/tempo/SignaturePreAuthorized.js"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/tempo/SignaturePreAuthorized.test-d.d.ts",
4
+ "main": "../../_cjs/tempo/SignaturePreAuthorized.test-d.js",
5
+ "module": "../../_esm/tempo/SignaturePreAuthorized.test-d.js"
6
+ }
@@ -0,0 +1,29 @@
1
+ import { expectTypeOf, test } from 'vitest'
2
+ import type * as Hex from '../core/Hex.js'
3
+ import type * as KeyAuthorization from './KeyAuthorization.js'
4
+ import type * as SignatureEnvelope from './SignatureEnvelope.js'
5
+ import * as SignaturePreAuthorized from './SignaturePreAuthorized.js'
6
+
7
+ test('magicBytes', () => {
8
+ expectTypeOf(
9
+ SignaturePreAuthorized.magicBytes,
10
+ ).toEqualTypeOf<'0x1165116511651165116511651165116511651165116511651165116511651165'>()
11
+ })
12
+
13
+ test('unwrap', () => {
14
+ const unwrapped = SignaturePreAuthorized.unwrap('0x')
15
+ expectTypeOf(
16
+ unwrapped.keyAuthorization,
17
+ ).toEqualTypeOf<KeyAuthorization.Signed>()
18
+ expectTypeOf(unwrapped.signature).toEqualTypeOf<SignatureEnvelope.Keychain>()
19
+ expectTypeOf(
20
+ SignaturePreAuthorized.from('0x'),
21
+ ).toEqualTypeOf<SignaturePreAuthorized.Unwrapped>()
22
+ })
23
+
24
+ test('wrap', () => {
25
+ expectTypeOf(SignaturePreAuthorized.wrap).returns.toEqualTypeOf<Hex.Hex>()
26
+ expectTypeOf(SignaturePreAuthorized.wrap)
27
+ .parameter(0)
28
+ .toEqualTypeOf<SignaturePreAuthorized.Unwrapped>()
29
+ })