ox 0.14.66 → 0.14.68

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 (242) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/_cjs/core/AbiEvent.js +45 -1
  3. package/_cjs/core/AbiEvent.js.map +1 -1
  4. package/_cjs/core/AbiParameters.js +6 -2
  5. package/_cjs/core/AbiParameters.js.map +1 -1
  6. package/_cjs/core/Address.js +24 -21
  7. package/_cjs/core/Address.js.map +1 -1
  8. package/_cjs/core/Base58.js +14 -4
  9. package/_cjs/core/Base58.js.map +1 -1
  10. package/_cjs/core/Blobs.js +26 -34
  11. package/_cjs/core/Blobs.js.map +1 -1
  12. package/_cjs/core/Bytes.js +56 -13
  13. package/_cjs/core/Bytes.js.map +1 -1
  14. package/_cjs/core/Cbor.js +33 -18
  15. package/_cjs/core/Cbor.js.map +1 -1
  16. package/_cjs/core/FrameReceipt.js +6 -2
  17. package/_cjs/core/FrameReceipt.js.map +1 -1
  18. package/_cjs/core/Hex.js +54 -21
  19. package/_cjs/core/Hex.js.map +1 -1
  20. package/_cjs/core/Json.js +15 -2
  21. package/_cjs/core/Json.js.map +1 -1
  22. package/_cjs/core/Rlp.js +138 -94
  23. package/_cjs/core/Rlp.js.map +1 -1
  24. package/_cjs/core/RpcTransport.js +3 -1
  25. package/_cjs/core/RpcTransport.js.map +1 -1
  26. package/_cjs/core/Siwe.js +2 -2
  27. package/_cjs/core/Siwe.js.map +1 -1
  28. package/_cjs/core/Transaction.js +6 -3
  29. package/_cjs/core/Transaction.js.map +1 -1
  30. package/_cjs/core/TransactionReceipt.js +12 -4
  31. package/_cjs/core/TransactionReceipt.js.map +1 -1
  32. package/_cjs/core/TransactionRequest.js +6 -2
  33. package/_cjs/core/TransactionRequest.js.map +1 -1
  34. package/_cjs/core/TxEnvelopeEip4844.js +1 -1
  35. package/_cjs/core/TxEnvelopeEip4844.js.map +1 -1
  36. package/_cjs/core/TypedData.js +19 -8
  37. package/_cjs/core/TypedData.js.map +1 -1
  38. package/_cjs/core/internal/abiParameters.js +59 -18
  39. package/_cjs/core/internal/abiParameters.js.map +1 -1
  40. package/_cjs/core/internal/address.js +32 -0
  41. package/_cjs/core/internal/address.js.map +1 -0
  42. package/_cjs/core/internal/base58.js +11 -9
  43. package/_cjs/core/internal/base58.js.map +1 -1
  44. package/_cjs/core/internal/bytes.js +13 -22
  45. package/_cjs/core/internal/bytes.js.map +1 -1
  46. package/_cjs/core/internal/caches.js +1 -0
  47. package/_cjs/core/internal/caches.js.map +1 -1
  48. package/_cjs/core/internal/cursor.js +32 -10
  49. package/_cjs/core/internal/cursor.js.map +1 -1
  50. package/_cjs/core/internal/hex.js +3 -3
  51. package/_cjs/core/internal/hex.js.map +1 -1
  52. package/_cjs/core/internal/lru.js +6 -5
  53. package/_cjs/core/internal/lru.js.map +1 -1
  54. package/_cjs/core/internal/promise.js +3 -3
  55. package/_cjs/core/internal/promise.js.map +1 -1
  56. package/_cjs/erc6492/SignatureErc6492.js +1 -1
  57. package/_cjs/erc6492/SignatureErc6492.js.map +1 -1
  58. package/_cjs/tempo/SignatureEnvelope.js +7 -38
  59. package/_cjs/tempo/SignatureEnvelope.js.map +1 -1
  60. package/_cjs/tempo/Transaction.js +13 -7
  61. package/_cjs/tempo/Transaction.js.map +1 -1
  62. package/_cjs/tempo/TransactionRequest.js +23 -19
  63. package/_cjs/tempo/TransactionRequest.js.map +1 -1
  64. package/_cjs/tempo/TxEnvelopeTempo.js +23 -4
  65. package/_cjs/tempo/TxEnvelopeTempo.js.map +1 -1
  66. package/_cjs/tempo/ZoneId.js +3 -0
  67. package/_cjs/tempo/ZoneId.js.map +1 -1
  68. package/_cjs/tempo/internal/virtualMasterPool.js +12 -3
  69. package/_cjs/tempo/internal/virtualMasterPool.js.map +1 -1
  70. package/_cjs/tempo/internal/webauthnData.js +57 -0
  71. package/_cjs/tempo/internal/webauthnData.js.map +1 -0
  72. package/_cjs/version.js +1 -1
  73. package/_esm/core/AbiEvent.js +69 -0
  74. package/_esm/core/AbiEvent.js.map +1 -1
  75. package/_esm/core/AbiParameters.js +8 -2
  76. package/_esm/core/AbiParameters.js.map +1 -1
  77. package/_esm/core/Address.js +27 -21
  78. package/_esm/core/Address.js.map +1 -1
  79. package/_esm/core/Base58.js +16 -4
  80. package/_esm/core/Base58.js.map +1 -1
  81. package/_esm/core/Blobs.js +38 -39
  82. package/_esm/core/Blobs.js.map +1 -1
  83. package/_esm/core/Bytes.js +66 -13
  84. package/_esm/core/Bytes.js.map +1 -1
  85. package/_esm/core/Cbor.js +33 -17
  86. package/_esm/core/Cbor.js.map +1 -1
  87. package/_esm/core/FrameReceipt.js +6 -2
  88. package/_esm/core/FrameReceipt.js.map +1 -1
  89. package/_esm/core/Hex.js +70 -21
  90. package/_esm/core/Hex.js.map +1 -1
  91. package/_esm/core/Json.js +21 -2
  92. package/_esm/core/Json.js.map +1 -1
  93. package/_esm/core/Rlp.js +146 -97
  94. package/_esm/core/Rlp.js.map +1 -1
  95. package/_esm/core/RpcTransport.js +4 -1
  96. package/_esm/core/RpcTransport.js.map +1 -1
  97. package/_esm/core/Siwe.js +2 -2
  98. package/_esm/core/Siwe.js.map +1 -1
  99. package/_esm/core/Transaction.js +6 -3
  100. package/_esm/core/Transaction.js.map +1 -1
  101. package/_esm/core/TransactionReceipt.js +12 -4
  102. package/_esm/core/TransactionReceipt.js.map +1 -1
  103. package/_esm/core/TransactionRequest.js +6 -2
  104. package/_esm/core/TransactionRequest.js.map +1 -1
  105. package/_esm/core/TxEnvelopeEip4844.js +1 -1
  106. package/_esm/core/TxEnvelopeEip4844.js.map +1 -1
  107. package/_esm/core/TypedData.js +24 -8
  108. package/_esm/core/TypedData.js.map +1 -1
  109. package/_esm/core/internal/abiParameters.js +78 -18
  110. package/_esm/core/internal/abiParameters.js.map +1 -1
  111. package/_esm/core/internal/address.js +41 -0
  112. package/_esm/core/internal/address.js.map +1 -0
  113. package/_esm/core/internal/base58.js +15 -9
  114. package/_esm/core/internal/base58.js.map +1 -1
  115. package/_esm/core/internal/bytes.js +14 -22
  116. package/_esm/core/internal/bytes.js.map +1 -1
  117. package/_esm/core/internal/caches.js +1 -0
  118. package/_esm/core/internal/caches.js.map +1 -1
  119. package/_esm/core/internal/cursor.js +37 -10
  120. package/_esm/core/internal/cursor.js.map +1 -1
  121. package/_esm/core/internal/hex.js +5 -3
  122. package/_esm/core/internal/hex.js.map +1 -1
  123. package/_esm/core/internal/lru.js +7 -5
  124. package/_esm/core/internal/lru.js.map +1 -1
  125. package/_esm/core/internal/promise.js +4 -3
  126. package/_esm/core/internal/promise.js.map +1 -1
  127. package/_esm/erc6492/SignatureErc6492.js +1 -1
  128. package/_esm/erc6492/SignatureErc6492.js.map +1 -1
  129. package/_esm/tempo/SignatureEnvelope.js +7 -41
  130. package/_esm/tempo/SignatureEnvelope.js.map +1 -1
  131. package/_esm/tempo/Transaction.js +15 -7
  132. package/_esm/tempo/Transaction.js.map +1 -1
  133. package/_esm/tempo/TransactionRequest.js +25 -19
  134. package/_esm/tempo/TransactionRequest.js.map +1 -1
  135. package/_esm/tempo/TxEnvelopeTempo.js +30 -4
  136. package/_esm/tempo/TxEnvelopeTempo.js.map +1 -1
  137. package/_esm/tempo/ZoneId.js +7 -1
  138. package/_esm/tempo/ZoneId.js.map +1 -1
  139. package/_esm/tempo/internal/virtualMasterPool.js +16 -3
  140. package/_esm/tempo/internal/virtualMasterPool.js.map +1 -1
  141. package/_esm/tempo/internal/webauthnData.js +79 -0
  142. package/_esm/tempo/internal/webauthnData.js.map +1 -0
  143. package/_esm/version.js +1 -1
  144. package/_types/core/AbiEvent.d.ts +36 -1
  145. package/_types/core/AbiEvent.d.ts.map +1 -1
  146. package/_types/core/AbiParameters.d.ts +1 -1
  147. package/_types/core/AbiParameters.d.ts.map +1 -1
  148. package/_types/core/Address.d.ts.map +1 -1
  149. package/_types/core/Base58.d.ts.map +1 -1
  150. package/_types/core/Blobs.d.ts +2 -3
  151. package/_types/core/Blobs.d.ts.map +1 -1
  152. package/_types/core/Bytes.d.ts +2 -0
  153. package/_types/core/Bytes.d.ts.map +1 -1
  154. package/_types/core/Cbor.d.ts +13 -6
  155. package/_types/core/Cbor.d.ts.map +1 -1
  156. package/_types/core/FrameReceipt.d.ts.map +1 -1
  157. package/_types/core/Hex.d.ts +3 -1
  158. package/_types/core/Hex.d.ts.map +1 -1
  159. package/_types/core/Json.d.ts.map +1 -1
  160. package/_types/core/Rlp.d.ts +38 -9
  161. package/_types/core/Rlp.d.ts.map +1 -1
  162. package/_types/core/RpcTransport.d.ts.map +1 -1
  163. package/_types/core/Siwe.d.ts.map +1 -1
  164. package/_types/core/Transaction.d.ts.map +1 -1
  165. package/_types/core/TransactionReceipt.d.ts.map +1 -1
  166. package/_types/core/TransactionRequest.d.ts.map +1 -1
  167. package/_types/core/TypedData.d.ts.map +1 -1
  168. package/_types/core/internal/abiParameters.d.ts +5 -5
  169. package/_types/core/internal/abiParameters.d.ts.map +1 -1
  170. package/_types/core/internal/address.d.ts +14 -0
  171. package/_types/core/internal/address.d.ts.map +1 -0
  172. package/_types/core/internal/base58.d.ts.map +1 -1
  173. package/_types/core/internal/bytes.d.ts +1 -10
  174. package/_types/core/internal/bytes.d.ts.map +1 -1
  175. package/_types/core/internal/caches.d.ts +1 -0
  176. package/_types/core/internal/caches.d.ts.map +1 -1
  177. package/_types/core/internal/cursor.d.ts +7 -2
  178. package/_types/core/internal/cursor.d.ts.map +1 -1
  179. package/_types/core/internal/hex.d.ts.map +1 -1
  180. package/_types/core/internal/lru.d.ts.map +1 -1
  181. package/_types/core/internal/promise.d.ts.map +1 -1
  182. package/_types/erc6492/SignatureErc6492.d.ts +1 -1
  183. package/_types/erc6492/SignatureErc6492.d.ts.map +1 -1
  184. package/_types/tempo/SignatureEnvelope.d.ts.map +1 -1
  185. package/_types/tempo/Transaction.d.ts.map +1 -1
  186. package/_types/tempo/TransactionRequest.d.ts.map +1 -1
  187. package/_types/tempo/TxEnvelopeTempo.d.ts.map +1 -1
  188. package/_types/tempo/ZoneId.d.ts +3 -1
  189. package/_types/tempo/ZoneId.d.ts.map +1 -1
  190. package/_types/tempo/internal/virtualMasterPool.d.ts.map +1 -1
  191. package/_types/tempo/internal/webauthnData.d.ts +26 -0
  192. package/_types/tempo/internal/webauthnData.d.ts.map +1 -0
  193. package/_types/version.d.ts +1 -1
  194. package/core/AbiEvent.ts +72 -0
  195. package/core/AbiParameters.ts +8 -1
  196. package/core/Address.ts +25 -20
  197. package/core/Base58.ts +15 -4
  198. package/core/Blobs.ts +47 -51
  199. package/core/Bytes.ts +68 -17
  200. package/core/Cbor.ts +33 -13
  201. package/core/FrameReceipt.ts +6 -2
  202. package/core/Hex.ts +79 -22
  203. package/core/Json.ts +23 -2
  204. package/core/Rlp.ts +184 -94
  205. package/core/RpcTransport.ts +4 -1
  206. package/core/Siwe.ts +2 -2
  207. package/core/Transaction.ts +6 -3
  208. package/core/TransactionReceipt.ts +13 -4
  209. package/core/TransactionRequest.ts +10 -6
  210. package/core/TxEnvelopeEip4844.ts +1 -1
  211. package/core/TypedData.ts +26 -8
  212. package/core/internal/abiParameters.ts +82 -23
  213. package/core/internal/address.ts +38 -0
  214. package/core/internal/base58.ts +14 -9
  215. package/core/internal/bytes.ts +13 -23
  216. package/core/internal/caches.ts +1 -0
  217. package/core/internal/cursor.ts +44 -16
  218. package/core/internal/hex.ts +5 -3
  219. package/core/internal/lru.ts +6 -7
  220. package/core/internal/promise.ts +5 -3
  221. package/erc6492/SignatureErc6492.ts +1 -1
  222. package/package.json +1 -1
  223. package/tempo/AccountSimulation.test.ts +1 -1
  224. package/tempo/SignatureEnvelope.test.ts +89 -1
  225. package/tempo/SignatureEnvelope.ts +7 -43
  226. package/tempo/SignaturePreAuthorized.test.ts +1 -1
  227. package/tempo/Transaction.ts +15 -9
  228. package/tempo/TransactionRequest.ts +31 -24
  229. package/tempo/TxEnvelopeTempo.test.ts +52 -0
  230. package/tempo/TxEnvelopeTempo.ts +32 -6
  231. package/tempo/ZoneId.test.ts +11 -0
  232. package/tempo/ZoneId.ts +7 -1
  233. package/tempo/internal/virtualMasterPool.ts +18 -4
  234. package/tempo/internal/webauthnData.ts +89 -0
  235. package/version.ts +1 -1
  236. package/_cjs/core/internal/uid.js +0 -17
  237. package/_cjs/core/internal/uid.js.map +0 -1
  238. package/_esm/core/internal/uid.js +0 -15
  239. package/_esm/core/internal/uid.js.map +0 -1
  240. package/_types/core/internal/uid.d.ts +0 -3
  241. package/_types/core/internal/uid.d.ts.map +0 -1
  242. package/core/internal/uid.ts +0 -15
@@ -107,6 +107,11 @@ export declare namespace decodeParameter {
107
107
  const sizeOfLength = 32
108
108
  const sizeOfOffset = 32
109
109
 
110
+ const arrayRegex = /^(.*)\[(\d+)?\]$/
111
+
112
+ /** `[max, min]` of each integer type, keyed by `size` and `signed`. */
113
+ const integerBounds = new Map<number, readonly [max: bigint, min: bigint]>()
114
+
110
115
  /** @internal */
111
116
  export function decodeAddress(
112
117
  cursor: Cursor.Cursor,
@@ -124,14 +129,13 @@ export function decodeAddress(
124
129
  })
125
130
  const wrap = (address: Hex.Hex) =>
126
131
  checksum ? Address.checksum(address) : address
127
- return [wrap(Hex.fromBytes(Bytes.slice(value, -20))), 32]
132
+ return [wrap(Hex.fromBytes(value.subarray(12))), 32]
128
133
  }
129
134
 
130
135
  export declare namespace decodeAddress {
131
136
  type ErrorType =
132
137
  | Address.InvalidAddressError
133
138
  | Hex.fromBytes.ErrorType
134
- | Bytes.slice.ErrorType
135
139
  | Errors.GlobalErrorType
136
140
  }
137
141
 
@@ -152,7 +156,7 @@ export function decodeArray(
152
156
  // Note: zero-length fixed arrays (`T[0]`) are not dynamic.
153
157
  if (length === null) {
154
158
  // Dealing with a dynamic type, so get the offset of the array data.
155
- const offset = Bytes.toNumber(cursor.readBytes(sizeOfOffset))
159
+ const offset = toOffset(cursor.readBytes(sizeOfOffset))
156
160
 
157
161
  // Start is the static position of current slot + offset.
158
162
  const start = staticPosition + offset
@@ -160,7 +164,7 @@ export function decodeArray(
160
164
 
161
165
  // Get the length of the array from the offset.
162
166
  cursor.setPosition(start)
163
- const length = Bytes.toNumber(cursor.readBytes(sizeOfLength))
167
+ const length = toOffset(cursor.readBytes(sizeOfLength))
164
168
 
165
169
  // Check if the array has any dynamic children.
166
170
  const dynamicChild = hasDynamicChild(param)
@@ -195,7 +199,7 @@ export function decodeArray(
195
199
  // we need to decode the offset of the array data.
196
200
  if (hasDynamicChild(param)) {
197
201
  // Dealing with dynamic types, so get the offset of the array data.
198
- const offset = Bytes.toNumber(cursor.readBytes(sizeOfOffset))
202
+ const offset = toOffset(cursor.readBytes(sizeOfOffset))
199
203
 
200
204
  // Start is the static position of current slot + offset.
201
205
  const start = staticPosition + offset
@@ -238,7 +242,7 @@ export function decodeArray(
238
242
  }
239
243
 
240
244
  export declare namespace decodeArray {
241
- type ErrorType = Bytes.toNumber.ErrorType | Errors.GlobalErrorType
245
+ type ErrorType = Errors.GlobalErrorType
242
246
  }
243
247
 
244
248
  /** @internal */
@@ -259,12 +263,12 @@ export function decodeBytes(
259
263
  const [_, size] = param.type.split('bytes')
260
264
  if (!size) {
261
265
  // Dealing with dynamic types, so get the offset of the bytes data.
262
- const offset = Bytes.toNumber(cursor.readBytes(32))
266
+ const offset = toOffset(cursor.readBytes(32))
263
267
 
264
268
  // Set position of the cursor to start of bytes data.
265
269
  cursor.setPosition(staticPosition + offset)
266
270
 
267
- const length = Bytes.toNumber(cursor.readBytes(32))
271
+ const length = toOffset(cursor.readBytes(32))
268
272
 
269
273
  // If there is no length, we have zero data.
270
274
  if (length === 0) {
@@ -282,13 +286,22 @@ export function decodeBytes(
282
286
 
283
287
  // Read the whole slot so that a slot cut short of its padding is out of bounds.
284
288
  const word = cursor.readBytes(32)
285
- return [Hex.fromBytes(word.subarray(0, Number.parseInt(size, 10))), 32]
289
+ const size_ = Number.parseInt(size, 10)
290
+ // The value occupies the high `size` bytes of the word; the rest must be
291
+ // zero padding.
292
+ for (let i = size_; i < 32; i++)
293
+ if (word[i] !== 0)
294
+ throw new AbiParameters.BytesSizeMismatchError({
295
+ expectedSize: size_,
296
+ value: Hex.fromBytes(word),
297
+ })
298
+ return [Hex.fromBytes(word.subarray(0, size_)), 32]
286
299
  }
287
300
 
288
301
  export declare namespace decodeBytes {
289
302
  type ErrorType =
303
+ | AbiParameters.BytesSizeMismatchError
290
304
  | Hex.fromBytes.ErrorType
291
- | Bytes.toNumber.ErrorType
292
305
  | Errors.GlobalErrorType
293
306
  }
294
307
 
@@ -297,8 +310,13 @@ export function decodeNumber(
297
310
  cursor: Cursor.Cursor,
298
311
  param: AbiParameters.Parameter,
299
312
  ) {
300
- const signed = param.type.startsWith('int')
301
- const size = Number.parseInt(param.type.split('int')[1] || '256', 10)
313
+ const { type } = param
314
+ // `uint256` is the common case: skip parsing its sign and size.
315
+ const signed = type !== 'uint256' && type.startsWith('int')
316
+ const size =
317
+ type === 'uint256'
318
+ ? 256
319
+ : Number.parseInt(type.split('int')[1] || '256', 10)
302
320
  const value = Bytes.toBigInt(cursor.readBytes(32), { signed })
303
321
  // The word must hold a value that fits the declared size (zero-padded for
304
322
  // unsigned, sign-extended for signed types).
@@ -353,7 +371,7 @@ export function decodeTuple(
353
371
  // tuple data.
354
372
  if (hasDynamicChild(param)) {
355
373
  // Dealing with dynamic types, so get the offset of the tuple data.
356
- const offset = Bytes.toNumber(cursor.readBytes(sizeOfOffset))
374
+ const offset = toOffset(cursor.readBytes(sizeOfOffset))
357
375
 
358
376
  // Start is the static position of referencing slot + offset.
359
377
  const start = staticPosition + offset
@@ -389,7 +407,7 @@ export function decodeTuple(
389
407
  }
390
408
 
391
409
  export declare namespace decodeTuple {
392
- type ErrorType = Bytes.toNumber.ErrorType | Errors.GlobalErrorType
410
+ type ErrorType = Errors.GlobalErrorType
393
411
  }
394
412
 
395
413
  /** @internal */
@@ -398,13 +416,13 @@ export function decodeString(
398
416
  { staticPosition }: { staticPosition: number },
399
417
  ) {
400
418
  // Get offset to start of string data.
401
- const offset = Bytes.toNumber(cursor.readBytes(32))
419
+ const offset = toOffset(cursor.readBytes(32))
402
420
 
403
421
  // Start is the static position of current slot + offset.
404
422
  const start = staticPosition + offset
405
423
  cursor.setPosition(start)
406
424
 
407
- const length = Bytes.toNumber(cursor.readBytes(32))
425
+ const length = toOffset(cursor.readBytes(32))
408
426
 
409
427
  // If there is no length, we have zero data (empty string).
410
428
  if (length === 0) {
@@ -423,7 +441,6 @@ export function decodeString(
423
441
 
424
442
  export declare namespace decodeString {
425
443
  type ErrorType =
426
- | Bytes.toNumber.ErrorType
427
444
  | Bytes.toString.ErrorType
428
445
  | Bytes.trimLeft.ErrorType
429
446
  | Errors.GlobalErrorType
@@ -561,7 +578,7 @@ export function encode(preparedParameters: PreparedParameter[]): Hex.Hex {
561
578
  }
562
579
 
563
580
  // 3. Concatenate static and dynamic parts.
564
- return Hex.concat(...staticParameters, ...dynamicParameters)
581
+ return join(staticParameters, dynamicParameters)
565
582
  }
566
583
 
567
584
  /** @internal */
@@ -643,7 +660,7 @@ export function encodeArray<const parameter extends AbiParameters.Parameter>(
643
660
  }
644
661
  return {
645
662
  dynamic: false,
646
- encoded: Hex.concat(...preparedParameters.map(({ encoded }) => encoded)),
663
+ encoded: join(preparedParameters.map(({ encoded }) => encoded)),
647
664
  }
648
665
  }
649
666
 
@@ -724,8 +741,7 @@ export function encodeNumber(
724
741
  { signed, size }: { signed: boolean; size: number },
725
742
  ): PreparedParameter {
726
743
  if (typeof size === 'number') {
727
- const max = 2n ** (BigInt(size) - (signed ? 1n : 0n)) - 1n
728
- const min = signed ? -max - 1n : 0n
744
+ const [max, min] = getIntegerBounds(signed, size)
729
745
  if (value > max || value < min)
730
746
  throw new Hex.IntegerOutOfRangeError({
731
747
  max: max.toString(),
@@ -807,7 +823,7 @@ export function encodeTuple<
807
823
  dynamic,
808
824
  encoded: dynamic
809
825
  ? encode(preparedParameters)
810
- : Hex.concat(...preparedParameters.map(({ encoded }) => encoded)),
826
+ : join(preparedParameters.map(({ encoded }) => encoded)),
811
827
  }
812
828
  }
813
829
 
@@ -820,7 +836,9 @@ export declare namespace encodeTuple {
820
836
  export function getArrayComponents(
821
837
  type: string,
822
838
  ): [length: number | null, innerType: string] | undefined {
823
- const matches = type.match(/^(.*)\[(\d+)?\]$/)
839
+ // Only array types end with `]`, so skip the regex for every other type.
840
+ if (type.charCodeAt(type.length - 1) !== 93) return undefined
841
+ const matches = type.match(arrayRegex)
824
842
  return matches
825
843
  ? // Return `null` if the array is dynamic.
826
844
  [matches[2]! ? Number(matches[2]!) : null, matches[1]!]
@@ -848,3 +866,44 @@ export function hasDynamicChild(param: AbiParameters.Parameter) {
848
866
 
849
867
  return false
850
868
  }
869
+
870
+ /** @internal */
871
+ function getIntegerBounds(signed: boolean, size: number) {
872
+ const key = size * 2 + (signed ? 1 : 0)
873
+ let bounds = integerBounds.get(key)
874
+ if (!bounds) {
875
+ const max = 2n ** (BigInt(size) - (signed ? 1n : 0n)) - 1n
876
+ bounds = [max, signed ? -max - 1n : 0n]
877
+ integerBounds.set(key, bounds)
878
+ }
879
+ return bounds
880
+ }
881
+
882
+ /**
883
+ * Concatenates encoded parts with a single join, so that arrays of any length
884
+ * avoid spreading into `Hex.concat`.
885
+ *
886
+ * @internal
887
+ */
888
+ function join(...lists: readonly (readonly Hex.Hex[])[]): Hex.Hex {
889
+ const parts: string[] = []
890
+ for (const list of lists)
891
+ for (let i = 0; i < list.length; i++) parts.push(list[i]!.slice(2))
892
+ return `0x${parts.join('')}`
893
+ }
894
+
895
+ /**
896
+ * Reads an offset or length word as a number. Like `Bytes.toNumber` before it
897
+ * checked for safe integers, values above 6 bytes stay lossy, so that the
898
+ * cursor reports them as out of bounds.
899
+ *
900
+ * @internal
901
+ */
902
+ function toOffset(word: Bytes.Bytes): number {
903
+ let i = 0
904
+ while (i < 26 && word[i] === 0) i++
905
+ if (i < 26) return Number(Hex.fromBytes(word))
906
+ let value = 0
907
+ for (; i < 32; i++) value = value * 256 + word[i]!
908
+ return value
909
+ }
@@ -0,0 +1,38 @@
1
+ const length = 42
2
+
3
+ const ZERO = 48 // '0'
4
+ const NINE = 57 // '9'
5
+ const A_UPPER = 65 // 'A'
6
+ const F_UPPER = 70 // 'F'
7
+ const A_LOWER = 97 // 'a'
8
+ const F_LOWER = 102 // 'f'
9
+ const X_LOWER = 120 // 'x'
10
+
11
+ /**
12
+ * Combined shape + lowercase classification for an Ethereum address string.
13
+ * Avoids the regex / try-catch / error-allocation overhead in the hot path
14
+ * and avoids a second pass for callers that need both pieces of metadata
15
+ * (e.g. strict validation).
16
+ *
17
+ * - `0` = invalid shape (not `0x[0-9a-fA-F]{40}`)
18
+ * - `1` = valid shape, all-lowercase hex body (no checksum to verify)
19
+ * - `2` = valid shape, contains at least one `A-F` upper char
20
+ *
21
+ * @internal
22
+ */
23
+ export function classify(value: string): 0 | 1 | 2 {
24
+ if (typeof value !== 'string' || value.length !== length) return 0
25
+ if (value.charCodeAt(0) !== ZERO || value.charCodeAt(1) !== X_LOWER) return 0
26
+ let hasUpper = false
27
+ for (let i = 2; i < length; i++) {
28
+ const code = value.charCodeAt(i)
29
+ if (code >= ZERO && code <= NINE) continue
30
+ if (code >= A_LOWER && code <= F_LOWER) continue
31
+ if (code >= A_UPPER && code <= F_UPPER) {
32
+ hasUpper = true
33
+ continue
34
+ }
35
+ return 0
36
+ }
37
+ return hasUpper ? 2 : 1
38
+ }
@@ -72,7 +72,7 @@ export const alphabetToInteger = /* __PURE__ */ Object.freeze<
72
72
 
73
73
  /** @internal */
74
74
  export function from(value: Hex.Hex | Bytes.Bytes) {
75
- let bytes = Bytes.from(value)
75
+ const bytes = Bytes.from(value)
76
76
 
77
77
  let integer = (() => {
78
78
  let hex = value
@@ -80,19 +80,24 @@ export function from(value: Hex.Hex | Bytes.Bytes) {
80
80
  return BigInt(hex as string)
81
81
  })()
82
82
 
83
+ // Divide by 58^9, the largest power of 58 below 2^53, so each BigInt
84
+ // division yields nine digits that number arithmetic can split.
83
85
  let result = ''
84
86
  while (integer > 0n) {
85
- const remainder = Number(integer % 58n)
86
- integer = integer / 58n
87
- result = integerToAlphabet[remainder] + result
87
+ let remainder = Number(integer % 7_427_658_739_644_928n)
88
+ integer /= 7_427_658_739_644_928n
89
+ // Every chunk but the most significant one is zero-padded to nine digits.
90
+ for (let i = 0; i < 9 && (remainder > 0 || integer > 0n); i++) {
91
+ result = integerToAlphabet[remainder % 58] + result
92
+ remainder = Math.floor(remainder / 58)
93
+ }
88
94
  }
89
95
 
90
- while (bytes.length > 1 && bytes[0] === 0) {
91
- result = '1' + result
92
- bytes = bytes.slice(1)
93
- }
96
+ // Count leading zero bytes (all but the last byte) without copying.
97
+ let zeros = 0
98
+ while (zeros < bytes.length - 1 && bytes[zeros] === 0) zeros++
94
99
 
95
- return result
100
+ return '1'.repeat(zeros) + result
96
101
  }
97
102
 
98
103
  /** @internal */
@@ -65,25 +65,20 @@ export declare namespace assertEndOffset {
65
65
  | Errors.GlobalErrorType
66
66
  }
67
67
 
68
- /** @internal */
69
- export const charCodeMap = {
70
- zero: 48,
71
- nine: 57,
72
- A: 65,
73
- F: 70,
74
- a: 97,
75
- f: 102,
76
- } as const
68
+ /** Nibble value of each ASCII hex digit, or `-1` for any other character. */
69
+ const base16 = /*#__PURE__*/ (() => {
70
+ const table = new Int8Array(128).fill(-1)
71
+ for (let i = 0; i < 10; i++) table[48 + i] = i
72
+ for (let i = 0; i < 6; i++) {
73
+ table[65 + i] = 10 + i
74
+ table[97 + i] = 10 + i
75
+ }
76
+ return table
77
+ })()
77
78
 
78
79
  /** @internal */
79
80
  export function charCodeToBase16(char: number) {
80
- if (char >= charCodeMap.zero && char <= charCodeMap.nine)
81
- return char - charCodeMap.zero
82
- if (char >= charCodeMap.A && char <= charCodeMap.F)
83
- return char - (charCodeMap.A - 10)
84
- if (char >= charCodeMap.a && char <= charCodeMap.f)
85
- return char - (charCodeMap.a - 10)
86
- return undefined
81
+ return char < 128 ? base16[char]! : -1
87
82
  }
88
83
 
89
84
  /** @internal */
@@ -97,11 +92,7 @@ export function pad(bytes: Bytes.Bytes, options: pad.Options = {}) {
97
92
  type: 'Bytes',
98
93
  })
99
94
  const paddedBytes = new Uint8Array(size)
100
- for (let i = 0; i < size; i++) {
101
- const padEnd = dir === 'right'
102
- paddedBytes[padEnd ? i : size - i - 1] =
103
- bytes[padEnd ? i : bytes.length - i - 1]!
104
- }
95
+ paddedBytes.set(bytes, dir === 'right' ? 0 : size - bytes.length)
105
96
  return paddedBytes
106
97
  }
107
98
 
@@ -128,8 +119,7 @@ export function trim(
128
119
 
129
120
  let sliceLength = 0
130
121
  for (let i = 0; i < data.length - 1; i++) {
131
- if (data[dir === 'left' ? i : data.length - i - 1]!.toString() === '0')
132
- sliceLength++
122
+ if (data[dir === 'left' ? i : data.length - i - 1] === 0) sliceLength++
133
123
  else break
134
124
  }
135
125
  data =
@@ -9,4 +9,5 @@ import { LruMap } from './lru.js'
9
9
  export const caches = {
10
10
  checksum: /*#__PURE__*/ new LruMap<Address.Address>(8192),
11
11
  signatureHash: /*#__PURE__*/ new LruMap<Hex.Hex>(8192),
12
+ typeHash: /*#__PURE__*/ new LruMap<Hex.Hex>(1024),
12
13
  }
@@ -6,7 +6,13 @@ export type Cursor = {
6
6
  bytes: Bytes
7
7
  dataView: DataView
8
8
  position: number
9
- positionReadCount: Map<number, number>
9
+ /**
10
+ * Positions read so far, so a repeated read can be counted. Word-aligned
11
+ * positions, where ABI data is read, go in a bit set with one bit per 32
12
+ * bytes; other positions go in a set. Both are allocated on first use.
13
+ */
14
+ alignedReads: Uint8Array | undefined
15
+ unalignedReads: Set<number> | undefined
10
16
  /** Total number of bytes read. */
11
17
  readSize: number
12
18
  /** Maximum total number of bytes that can be read. */
@@ -18,7 +24,6 @@ export type Cursor = {
18
24
  assertReadSize(length: number): void
19
25
  assertPosition(position: number): void
20
26
  decrementPosition(offset: number): void
21
- getReadCount(position?: number): number
22
27
  incrementPosition(offset: number): void
23
28
  inspectByte(position?: number): Bytes[number]
24
29
  inspectBytes(length: number, position?: number): Bytes
@@ -44,9 +49,19 @@ export type Cursor = {
44
49
 
45
50
  const staticCursor: Cursor = {
46
51
  bytes: new Uint8Array(),
47
- dataView: new DataView(new ArrayBuffer(0)),
52
+ // Lazy: most cursors (e.g. ABI decoding) never read through a `DataView`.
53
+ get dataView() {
54
+ const dataView = new DataView(
55
+ this.bytes.buffer,
56
+ this.bytes.byteOffset,
57
+ this.bytes.byteLength,
58
+ )
59
+ Object.defineProperty(this, 'dataView', { value: dataView })
60
+ return dataView
61
+ },
48
62
  position: 0,
49
- positionReadCount: new Map(),
63
+ alignedReads: undefined,
64
+ unalignedReads: undefined,
50
65
  readSize: 0,
51
66
  readSizeLimit: Number.POSITIVE_INFINITY,
52
67
  recursiveReadCount: 0,
@@ -79,9 +94,6 @@ const staticCursor: Cursor = {
79
94
  this.assertPosition(position)
80
95
  this.position = position
81
96
  },
82
- getReadCount(position) {
83
- return this.positionReadCount.get(position || this.position) || 0
84
- },
85
97
  incrementPosition(offset) {
86
98
  if (offset < 0) throw new NegativeOffsetError({ offset })
87
99
  const position = this.position + offset
@@ -211,9 +223,29 @@ const staticCursor: Cursor = {
211
223
  },
212
224
  _touch() {
213
225
  if (this.recursiveReadLimit === Number.POSITIVE_INFINITY) return
214
- const count = this.getReadCount()
215
- this.positionReadCount.set(this.position, count + 1)
216
- if (count > 0) this.recursiveReadCount++
226
+ const { position } = this
227
+ if (position % 32 !== 0 || position > this.bytes.length) {
228
+ const reads = (this.unalignedReads ??= new Set())
229
+ if (reads.has(position)) this.recursiveReadCount++
230
+ else reads.add(position)
231
+ return
232
+ }
233
+ // One bit per 32-byte word, so the set is at most 1/256 the size of the
234
+ // data. It grows with the furthest word read rather than being sized to
235
+ // the whole input up front. Plain arithmetic rather than bitwise operators
236
+ // on lengths and positions, which would coerce them to 32-bit integers.
237
+ const word = position / 32
238
+ const index = Math.floor(word / 8)
239
+ let reads = this.alignedReads
240
+ if (!reads || index >= reads.length) {
241
+ const max = Math.floor(this.bytes.length / 256) + 1
242
+ const next = new Uint8Array(Math.min(max, Math.max(64, (index + 1) * 2)))
243
+ if (reads) next.set(reads)
244
+ reads = this.alignedReads = next
245
+ }
246
+ const bit = 1 << (word % 8)
247
+ if (reads[index]! & bit) this.recursiveReadCount++
248
+ else reads[index]! |= bit
217
249
  },
218
250
  }
219
251
 
@@ -224,12 +256,8 @@ export function create(
224
256
  ): Cursor {
225
257
  const cursor: Cursor = Object.create(staticCursor)
226
258
  cursor.bytes = bytes
227
- cursor.dataView = new DataView(
228
- bytes.buffer,
229
- bytes.byteOffset,
230
- bytes.byteLength,
231
- )
232
- cursor.positionReadCount = new Map()
259
+ cursor.alignedReads = undefined
260
+ cursor.unalignedReads = undefined
233
261
  cursor.recursiveReadLimit = recursiveReadLimit
234
262
  // `recursiveReadLimit` allows one read per position plus that many repeated
235
263
  // reads. Allow as many bytes as that number of 32-byte reads, so that reads
@@ -67,7 +67,9 @@ export function pad(hex_: Hex.Hex, options: pad.Options = {}) {
67
67
 
68
68
  if (size === 0) return hex_
69
69
 
70
- const hex = hex_.replace('0x', '')
70
+ // Same result as `hex_.replace('0x', '')`, without a search when the prefix
71
+ // is present.
72
+ const hex = hex_.startsWith('0x') ? hex_.slice(2) : hex_.replace('0x', '')
71
73
  if (hex.length > size * 2)
72
74
  throw new Hex.SizeExceedsPaddingSizeError({
73
75
  size: Math.ceil(hex.length / 2),
@@ -94,11 +96,11 @@ export function trim(
94
96
  ): trim.ReturnType {
95
97
  const { dir = 'left' } = options
96
98
 
97
- let data = value.replace('0x', '')
99
+ let data = value.startsWith('0x') ? value.slice(2) : value.replace('0x', '')
98
100
 
99
101
  let sliceLength = 0
100
102
  for (let i = 0; i < data.length - 1; i++) {
101
- if (data[dir === 'left' ? i : data.length - i - 1]!.toString() === '0')
103
+ if (data.charCodeAt(dir === 'left' ? i : data.length - i - 1) === 48)
102
104
  sliceLength++
103
105
  else break
104
106
  }
@@ -14,20 +14,19 @@ export class LruMap<value = unknown> extends Map<string, value> {
14
14
 
15
15
  override get(key: string) {
16
16
  const value = super.get(key)
17
-
18
- if (super.has(key) && value !== undefined) {
19
- this.delete(key)
20
- super.set(key, value)
21
- }
22
-
17
+ if (value === undefined) return value
18
+ super.delete(key)
19
+ super.set(key, value)
23
20
  return value
24
21
  }
25
22
 
26
23
  override set(key: string, value: value) {
24
+ // Re-insert so that an existing key becomes the most recently used.
25
+ super.delete(key)
27
26
  super.set(key, value)
28
27
  if (this.maxSize && this.size > this.maxSize) {
29
28
  const firstKey = this.keys().next().value
30
- if (firstKey) this.delete(firstKey)
29
+ if (firstKey !== undefined) this.delete(firstKey)
31
30
  }
32
31
  return this
33
32
  }
@@ -5,7 +5,7 @@ export function withTimeout<data>(
5
5
  fn: withTimeout.Fn<data>,
6
6
  options: withTimeout.Options,
7
7
  ): Promise<data> {
8
- const { errorInstance = new TimeoutError(), timeout, signal } = options
8
+ const { errorInstance, timeout, signal } = options
9
9
  return new Promise((resolve, reject) => {
10
10
  ;(async () => {
11
11
  let timeoutId: any
@@ -16,12 +16,14 @@ export function withTimeout<data>(
16
16
  if (signal) {
17
17
  controller.abort()
18
18
  } else {
19
- reject(errorInstance)
19
+ reject(errorInstance ?? new TimeoutError())
20
20
  }
21
21
  }, timeout) as any
22
22
  resolve(await fn({ signal: controller.signal }))
23
23
  } catch (err) {
24
- if ((err as Error)?.name === 'AbortError') reject(errorInstance)
24
+ // Only build the error once the request has timed out.
25
+ if ((err as Error)?.name === 'AbortError')
26
+ reject(errorInstance ?? new TimeoutError())
25
27
  reject(err)
26
28
  } finally {
27
29
  clearTimeout(timeoutId)
@@ -28,7 +28,7 @@ export const magicBytes =
28
28
  * Deployless ERC-6492 signature verification bytecode.
29
29
  */
30
30
  export const universalSignatureValidatorBytecode =
31
- '0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572'
31
+ '0x608060405234801561001057600080fd5b506040516106ad3803806106ad83398101604081905261002f91610537565b600061003c848484610048565b9050806000526001601ff35b60007f649264926492649264926492649264926492649264926492649264926492649261007483610425565b036101e7576000606080848060200190518101906100929190610590565b60405192955090935091506000906001600160a01b038516906100b69085906105f6565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b908790600401610612565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d1919061064c565b6001600160e01b0319161494505050505061041e565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e906102279087908790600401610612565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610268919061064c565b6001600160e01b03191614905061041e565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061068d83398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e761043e565b5060208201516040808401518451859392600091859190811061030c5761030c610676565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061068d83398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b604080516000808252602082018084528a905260ff841692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa1580156103e0573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906104165750886001600160a01b0316816001600160a01b0316145b955050505050505b9392505050565b600060208251101561043657600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461047157600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b838110156104a557818101518382015260200161048d565b50506000910152565b600082601f8301126104bf57600080fd5b81516001600160401b038111156104d8576104d8610474565b604051601f8201601f19908116603f011681016001600160401b038111828210171561050657610506610474565b60405281815283820160200185101561051e57600080fd5b61052f82602083016020870161048a565b949350505050565b60008060006060848603121561054c57600080fd5b83516105578161045c565b6020850151604086015191945092506001600160401b0381111561057a57600080fd5b610586868287016104ae565b9150509250925092565b6000806000606084860312156105a557600080fd5b83516105b08161045c565b60208501519093506001600160401b038111156105cc57600080fd5b6105d8868287016104ae565b604086015190935090506001600160401b0381111561057a57600080fd5b6000825161060881846020870161048a565b9190910192915050565b828152604060208201526000825180604084015261063781606085016020870161048a565b601f01601f1916919091016060019392505050565b60006020828403121561065e57600080fd5b81516001600160e01b03198116811461041e57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572'
32
32
 
33
33
  /**
34
34
  * ABI for the ERC-6492 universal deployless signature validator contract.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ox",
3
3
  "description": "Ethereum Standard Library",
4
- "version": "0.14.66",
4
+ "version": "0.14.68",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -79,7 +79,7 @@ describe('fromRpc', () => {
79
79
  expect(() =>
80
80
  AccountSimulation.fromRpc({ ...rpc, config: `${config}00` }),
81
81
  ).toThrowErrorMatchingInlineSnapshot(
82
- `[AccountSimulation.InvalidSimulationError: Invalid account simulation: noncanonical config encoding.]`,
82
+ `[Rlp.TrailingBytesError: RLP payload encodes a single item, but \`1\` trailing byte remains.]`,
83
83
  )
84
84
  })
85
85