ox 0.14.45 → 0.14.46

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 (89) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/Frame/package.json +6 -0
  3. package/FrameReceipt/package.json +6 -0
  4. package/FrameSignature/package.json +6 -0
  5. package/TxEnvelopeEip8141/package.json +6 -0
  6. package/_cjs/core/Frame.js +147 -0
  7. package/_cjs/core/Frame.js.map +1 -0
  8. package/_cjs/core/FrameReceipt.js +34 -0
  9. package/_cjs/core/FrameReceipt.js.map +1 -0
  10. package/_cjs/core/FrameSignature.js +203 -0
  11. package/_cjs/core/FrameSignature.js.map +1 -0
  12. package/_cjs/core/Transaction.js +18 -2
  13. package/_cjs/core/Transaction.js.map +1 -1
  14. package/_cjs/core/TransactionReceipt.js +10 -0
  15. package/_cjs/core/TransactionReceipt.js.map +1 -1
  16. package/_cjs/core/TransactionRequest.js +11 -1
  17. package/_cjs/core/TransactionRequest.js.map +1 -1
  18. package/_cjs/core/TxEnvelopeEip8141.js +283 -0
  19. package/_cjs/core/TxEnvelopeEip8141.js.map +1 -0
  20. package/_cjs/core/internal/curves.js +6 -0
  21. package/_cjs/core/internal/curves.js.map +1 -0
  22. package/_cjs/core/internal/quantity.js +10 -0
  23. package/_cjs/core/internal/quantity.js.map +1 -0
  24. package/_cjs/erc4337/UserOperationReceipt.js.map +1 -1
  25. package/_cjs/index.js +6 -2
  26. package/_cjs/index.js.map +1 -1
  27. package/_cjs/version.js +1 -1
  28. package/_esm/core/Frame.js +311 -0
  29. package/_esm/core/Frame.js.map +1 -0
  30. package/_esm/core/FrameReceipt.js +72 -0
  31. package/_esm/core/FrameReceipt.js.map +1 -0
  32. package/_esm/core/FrameSignature.js +422 -0
  33. package/_esm/core/FrameSignature.js.map +1 -0
  34. package/_esm/core/Transaction.js +18 -2
  35. package/_esm/core/Transaction.js.map +1 -1
  36. package/_esm/core/TransactionReceipt.js +10 -0
  37. package/_esm/core/TransactionReceipt.js.map +1 -1
  38. package/_esm/core/TransactionRequest.js +11 -1
  39. package/_esm/core/TransactionRequest.js.map +1 -1
  40. package/_esm/core/TxEnvelopeEip8141.js +490 -0
  41. package/_esm/core/TxEnvelopeEip8141.js.map +1 -0
  42. package/_esm/core/internal/curves.js +19 -0
  43. package/_esm/core/internal/curves.js.map +1 -0
  44. package/_esm/core/internal/quantity.js +14 -0
  45. package/_esm/core/internal/quantity.js.map +1 -0
  46. package/_esm/erc4337/UserOperationReceipt.js.map +1 -1
  47. package/_esm/index.js +73 -0
  48. package/_esm/index.js.map +1 -1
  49. package/_esm/version.js +1 -1
  50. package/_types/core/Frame.d.ts +290 -0
  51. package/_types/core/Frame.d.ts.map +1 -0
  52. package/_types/core/FrameReceipt.d.ts +92 -0
  53. package/_types/core/FrameReceipt.d.ts.map +1 -0
  54. package/_types/core/FrameSignature.d.ts +357 -0
  55. package/_types/core/FrameSignature.d.ts.map +1 -0
  56. package/_types/core/Transaction.d.ts +29 -4
  57. package/_types/core/Transaction.d.ts.map +1 -1
  58. package/_types/core/TransactionReceipt.d.ts +15 -6
  59. package/_types/core/TransactionReceipt.d.ts.map +1 -1
  60. package/_types/core/TransactionRequest.d.ts +10 -4
  61. package/_types/core/TransactionRequest.d.ts.map +1 -1
  62. package/_types/core/TxEnvelopeEip8141.d.ts +343 -0
  63. package/_types/core/TxEnvelopeEip8141.d.ts.map +1 -0
  64. package/_types/core/internal/curves.d.ts +19 -0
  65. package/_types/core/internal/curves.d.ts.map +1 -0
  66. package/_types/core/internal/quantity.d.ts +10 -0
  67. package/_types/core/internal/quantity.d.ts.map +1 -0
  68. package/_types/erc4337/UserOperationReceipt.d.ts +1 -1
  69. package/_types/erc4337/UserOperationReceipt.d.ts.map +1 -1
  70. package/_types/index.d.ts +73 -0
  71. package/_types/index.d.ts.map +1 -1
  72. package/_types/tempo/Transaction.d.ts +2 -0
  73. package/_types/tempo/Transaction.d.ts.map +1 -1
  74. package/_types/tempo/TransactionReceipt.d.ts +2 -0
  75. package/_types/tempo/TransactionReceipt.d.ts.map +1 -1
  76. package/_types/version.d.ts +1 -1
  77. package/core/Frame.ts +443 -0
  78. package/core/FrameReceipt.ts +117 -0
  79. package/core/FrameSignature.ts +606 -0
  80. package/core/Transaction.ts +73 -4
  81. package/core/TransactionReceipt.ts +41 -4
  82. package/core/TransactionRequest.ts +26 -2
  83. package/core/TxEnvelopeEip8141.ts +717 -0
  84. package/core/internal/curves.ts +22 -0
  85. package/core/internal/quantity.ts +16 -0
  86. package/erc4337/UserOperationReceipt.ts +1 -6
  87. package/index.ts +73 -0
  88. package/package.json +21 -1
  89. package/version.ts +1 -1
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Curve constants, inlined so that modules needing nothing but an order do not
3
+ * pull a curve implementation into the bundle.
4
+ *
5
+ * These are fixed by the curve specifications and are asserted against
6
+ * `@noble/curves` in `src/core/_test/curves.test.ts`.
7
+ *
8
+ * @internal
9
+ */
10
+
11
+ /**
12
+ * Order of the secp256r1 (P-256) curve.
13
+ *
14
+ * @see https://www.secg.org/sec2-v2.pdf
15
+ * @internal
16
+ */
17
+ export const p256N =
18
+ 0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551n
19
+
20
+ /** Order of the secp256k1 curve. @internal */
21
+ export const secp256k1N =
22
+ 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141n
@@ -0,0 +1,16 @@
1
+ import * as Hex from '../Hex.js'
2
+
3
+ /**
4
+ * Converts a "numberish" value (`Hex.Hex | bigint | number`) to an RPC quantity
5
+ * (`Hex.Hex`). Hex values are passed through unchanged; numbers and bigints are
6
+ * encoded via {@link ox#Hex.(fromNumber:function)}.
7
+ *
8
+ * @internal
9
+ */
10
+ export function fromNumberish(
11
+ value: Hex.Hex | bigint | number,
12
+ options?: Hex.fromNumber.Options,
13
+ ): Hex.Hex {
14
+ if (typeof value === 'string') return value
15
+ return Hex.fromNumber(value, options)
16
+ }
@@ -51,12 +51,7 @@ export type Rpc<
51
51
  entryPointVersion,
52
52
  Hex.Hex,
53
53
  Hex.Hex,
54
- TransactionReceipt.TransactionReceipt<
55
- TransactionReceipt.RpcStatus,
56
- TransactionReceipt.RpcType,
57
- Hex.Hex,
58
- Hex.Hex
59
- >
54
+ TransactionReceipt.Rpc
60
55
  >
61
56
 
62
57
  /**
package/index.ts CHANGED
@@ -1547,6 +1547,60 @@ export * as Fee from './core/Fee.js'
1547
1547
  * @category Execution Spec
1548
1548
  */
1549
1549
  export * as Filter from './core/Filter.js'
1550
+ /**
1551
+ * Utilities for constructing, validating, and encoding [EIP-8141](https://eips.ethereum.org/EIPS/eip-8141) call frames.
1552
+ *
1553
+ * A {@link ox#Frame.Frame} describes a call with an execution mode, approval flags,
1554
+ * and separate execution and state gas limits.
1555
+ *
1556
+ * @example
1557
+ * ### Creating Frames
1558
+ *
1559
+ * Use {@link ox#Frame.(from:function)} to construct a frame with named mode and flags.
1560
+ *
1561
+ * ```ts twoslash
1562
+ * import { Frame } from 'ox'
1563
+ *
1564
+ * const frame = Frame.from({
1565
+ * flags: 'approveExecutionAndPayment',
1566
+ * gas: 50_000n,
1567
+ * mode: 'verify'
1568
+ * })
1569
+ * ```
1570
+ *
1571
+ * @category Transaction Envelopes
1572
+ */
1573
+ export * as Frame from './core/Frame.js'
1574
+ /**
1575
+ * Utilities for converting EIP-8141 frame receipts between RPC and decoded forms.
1576
+ *
1577
+ * Frame receipts include execution gas, state gas, logs, and execution status.
1578
+ *
1579
+ * @category Execution Spec
1580
+ */
1581
+ export * as FrameReceipt from './core/FrameReceipt.js'
1582
+ /**
1583
+ * Utilities for constructing, validating, and encoding [EIP-8141](https://eips.ethereum.org/EIPS/eip-8141) signature entries.
1584
+ *
1585
+ * Supports {@link ox#FrameSignature.Arbitrary}, {@link ox#FrameSignature.Secp256k1},
1586
+ * and {@link ox#FrameSignature.P256} entries. An empty payload selects the canonical
1587
+ * transaction signing hash.
1588
+ *
1589
+ * @example
1590
+ * ### Creating Signature Entries
1591
+ *
1592
+ * Use {@link ox#FrameSignature.(from:function)} to wrap arbitrary witness bytes.
1593
+ *
1594
+ * ```ts twoslash
1595
+ * import { FrameSignature } from 'ox'
1596
+ *
1597
+ * const entry = FrameSignature.from('0xaabb')
1598
+ * // @log: { payload: '0x', scheme: 'arbitrary', signature: '0xaabb' }
1599
+ * ```
1600
+ *
1601
+ * @category Transaction Envelopes
1602
+ */
1603
+ export * as FrameSignature from './core/FrameSignature.js'
1550
1604
  /**
1551
1605
  * Utility functions for hashing (keccak256, sha256, etc).
1552
1606
  *
@@ -3270,6 +3324,25 @@ export * as TxEnvelopeEip4844 from './core/TxEnvelopeEip4844.js'
3270
3324
  * @category Transaction Envelopes
3271
3325
  */
3272
3326
  export * as TxEnvelopeEip7702 from './core/TxEnvelopeEip7702.js'
3327
+ /**
3328
+ * Utilities for constructing, signing, and encoding EIP-8141 frame transactions.
3329
+ *
3330
+ * @example
3331
+ * ### Basic Usage
3332
+ *
3333
+ * ```ts twoslash
3334
+ * import { TxEnvelopeEip8141 } from 'ox'
3335
+ *
3336
+ * const envelope = TxEnvelopeEip8141.from({
3337
+ * chainId: 1,
3338
+ * frames: [{ gas: 50_000n, mode: 'sender' }],
3339
+ * sender: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8'
3340
+ * })
3341
+ * ```
3342
+ *
3343
+ * @category Transaction Envelopes
3344
+ */
3345
+ export * as TxEnvelopeEip8141 from './core/TxEnvelopeEip8141.js'
3273
3346
  /**
3274
3347
  * Utility functions for working
3275
3348
  * with **Legacy Transaction Envelopes**.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ox",
3
3
  "description": "Ethereum Standard Library",
4
- "version": "0.14.45",
4
+ "version": "0.14.46",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -222,6 +222,21 @@
222
222
  "import": "./_esm/core/Filter.js",
223
223
  "default": "./_cjs/core/Filter.js"
224
224
  },
225
+ "./Frame": {
226
+ "types": "./_types/core/Frame.d.ts",
227
+ "import": "./_esm/core/Frame.js",
228
+ "default": "./_cjs/core/Frame.js"
229
+ },
230
+ "./FrameReceipt": {
231
+ "types": "./_types/core/FrameReceipt.d.ts",
232
+ "import": "./_esm/core/FrameReceipt.js",
233
+ "default": "./_cjs/core/FrameReceipt.js"
234
+ },
235
+ "./FrameSignature": {
236
+ "types": "./_types/core/FrameSignature.d.ts",
237
+ "import": "./_esm/core/FrameSignature.js",
238
+ "default": "./_cjs/core/FrameSignature.js"
239
+ },
225
240
  "./Hash": {
226
241
  "types": "./_types/core/Hash.d.ts",
227
242
  "import": "./_esm/core/Hash.js",
@@ -372,6 +387,11 @@
372
387
  "import": "./_esm/core/TxEnvelopeEip7702.js",
373
388
  "default": "./_cjs/core/TxEnvelopeEip7702.js"
374
389
  },
390
+ "./TxEnvelopeEip8141": {
391
+ "types": "./_types/core/TxEnvelopeEip8141.d.ts",
392
+ "import": "./_esm/core/TxEnvelopeEip8141.js",
393
+ "default": "./_cjs/core/TxEnvelopeEip8141.js"
394
+ },
375
395
  "./TxEnvelopeLegacy": {
376
396
  "types": "./_types/core/TxEnvelopeLegacy.d.ts",
377
397
  "import": "./_esm/core/TxEnvelopeLegacy.js",
package/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** @internal */
2
- export const version = '0.14.45'
2
+ export const version = '0.14.46'