ox 0.9.16 → 0.10.0

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 (216) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +4 -4
  3. package/TxEnvelope/package.json +6 -0
  4. package/TxEnvelopeEip1559/package.json +6 -0
  5. package/TxEnvelopeEip2930/package.json +6 -0
  6. package/TxEnvelopeEip4844/package.json +6 -0
  7. package/TxEnvelopeEip7702/package.json +6 -0
  8. package/TxEnvelopeLegacy/package.json +6 -0
  9. package/_cjs/core/{TransactionEnvelope.js → TxEnvelope.js} +1 -1
  10. package/_cjs/core/TxEnvelope.js.map +1 -0
  11. package/_cjs/core/{TransactionEnvelopeEip1559.js → TxEnvelopeEip1559.js} +2 -2
  12. package/_cjs/core/TxEnvelopeEip1559.js.map +1 -0
  13. package/_cjs/core/{TransactionEnvelopeEip2930.js → TxEnvelopeEip2930.js} +2 -2
  14. package/_cjs/core/TxEnvelopeEip2930.js.map +1 -0
  15. package/_cjs/core/{TransactionEnvelopeEip4844.js → TxEnvelopeEip4844.js} +4 -4
  16. package/_cjs/core/TxEnvelopeEip4844.js.map +1 -0
  17. package/_cjs/core/{TransactionEnvelopeEip7702.js → TxEnvelopeEip7702.js} +4 -4
  18. package/_cjs/core/TxEnvelopeEip7702.js.map +1 -0
  19. package/_cjs/core/{TransactionEnvelopeLegacy.js → TxEnvelopeLegacy.js} +2 -2
  20. package/_cjs/core/TxEnvelopeLegacy.js.map +1 -0
  21. package/_cjs/core/WebAuthnP256.js +1 -1
  22. package/_cjs/core/WebAuthnP256.js.map +1 -1
  23. package/_cjs/erc8021/Attribution.js +36 -6
  24. package/_cjs/erc8021/Attribution.js.map +1 -1
  25. package/_cjs/index.docs.js +1 -0
  26. package/_cjs/index.docs.js.map +1 -1
  27. package/_cjs/index.js +7 -7
  28. package/_cjs/index.js.map +1 -1
  29. package/_cjs/tempo/AuthorizationTempo.js +101 -0
  30. package/_cjs/tempo/AuthorizationTempo.js.map +1 -0
  31. package/_cjs/tempo/KeyAuthorization.js +123 -0
  32. package/_cjs/tempo/KeyAuthorization.js.map +1 -0
  33. package/_cjs/tempo/PoolId.js +10 -0
  34. package/_cjs/tempo/PoolId.js.map +1 -0
  35. package/_cjs/tempo/SignatureEnvelope.js +394 -0
  36. package/_cjs/tempo/SignatureEnvelope.js.map +1 -0
  37. package/_cjs/tempo/Tick.js +77 -0
  38. package/_cjs/tempo/Tick.js.map +1 -0
  39. package/_cjs/tempo/TokenId.js +28 -0
  40. package/_cjs/tempo/TokenId.js.map +1 -0
  41. package/_cjs/tempo/TokenRole.js +26 -0
  42. package/_cjs/tempo/TokenRole.js.map +1 -0
  43. package/_cjs/tempo/Transaction.js +80 -0
  44. package/_cjs/tempo/Transaction.js.map +1 -0
  45. package/_cjs/tempo/TransactionReceipt.js +26 -0
  46. package/_cjs/tempo/TransactionReceipt.js.map +1 -0
  47. package/_cjs/tempo/TransactionRequest.js +53 -0
  48. package/_cjs/tempo/TransactionRequest.js.map +1 -0
  49. package/_cjs/tempo/TxEnvelopeTempo.js +267 -0
  50. package/_cjs/tempo/TxEnvelopeTempo.js.map +1 -0
  51. package/_cjs/tempo/index.js +15 -0
  52. package/_cjs/tempo/index.js.map +1 -0
  53. package/_cjs/version.js +1 -1
  54. package/_esm/core/Blobs.js +8 -8
  55. package/_esm/core/{TransactionEnvelope.js → TxEnvelope.js} +11 -11
  56. package/_esm/core/TxEnvelope.js.map +1 -0
  57. package/_esm/core/{TransactionEnvelopeEip1559.js → TxEnvelopeEip1559.js} +42 -42
  58. package/_esm/core/TxEnvelopeEip1559.js.map +1 -0
  59. package/_esm/core/{TransactionEnvelopeEip2930.js → TxEnvelopeEip2930.js} +43 -43
  60. package/_esm/core/TxEnvelopeEip2930.js.map +1 -0
  61. package/_esm/core/{TransactionEnvelopeEip4844.js → TxEnvelopeEip4844.js} +42 -42
  62. package/_esm/core/TxEnvelopeEip4844.js.map +1 -0
  63. package/_esm/core/{TransactionEnvelopeEip7702.js → TxEnvelopeEip7702.js} +40 -40
  64. package/_esm/core/TxEnvelopeEip7702.js.map +1 -0
  65. package/_esm/core/{TransactionEnvelopeLegacy.js → TxEnvelopeLegacy.js} +42 -42
  66. package/_esm/core/TxEnvelopeLegacy.js.map +1 -0
  67. package/_esm/core/WebAuthnP256.js +1 -1
  68. package/_esm/core/WebAuthnP256.js.map +1 -1
  69. package/_esm/erc8021/Attribution.js +58 -13
  70. package/_esm/erc8021/Attribution.js.map +1 -1
  71. package/_esm/index.docs.js +1 -0
  72. package/_esm/index.docs.js.map +1 -1
  73. package/_esm/index.js +192 -192
  74. package/_esm/index.js.map +1 -1
  75. package/_esm/tempo/AuthorizationTempo.js +664 -0
  76. package/_esm/tempo/AuthorizationTempo.js.map +1 -0
  77. package/_esm/tempo/KeyAuthorization.js +426 -0
  78. package/_esm/tempo/KeyAuthorization.js.map +1 -0
  79. package/_esm/tempo/PoolId.js +28 -0
  80. package/_esm/tempo/PoolId.js.map +1 -0
  81. package/_esm/tempo/SignatureEnvelope.js +660 -0
  82. package/_esm/tempo/SignatureEnvelope.js.map +1 -0
  83. package/_esm/tempo/Tick.js +147 -0
  84. package/_esm/tempo/Tick.js.map +1 -0
  85. package/_esm/tempo/TokenId.js +71 -0
  86. package/_esm/tempo/TokenId.js.map +1 -0
  87. package/_esm/tempo/TokenRole.js +40 -0
  88. package/_esm/tempo/TokenRole.js.map +1 -0
  89. package/_esm/tempo/Transaction.js +167 -0
  90. package/_esm/tempo/Transaction.js.map +1 -0
  91. package/_esm/tempo/TransactionReceipt.js +138 -0
  92. package/_esm/tempo/TransactionReceipt.js.map +1 -0
  93. package/_esm/tempo/TransactionRequest.js +99 -0
  94. package/_esm/tempo/TransactionRequest.js.map +1 -0
  95. package/_esm/tempo/TxEnvelopeTempo.js +607 -0
  96. package/_esm/tempo/TxEnvelopeTempo.js.map +1 -0
  97. package/_esm/tempo/index.js +298 -0
  98. package/_esm/tempo/index.js.map +1 -0
  99. package/_esm/version.js +1 -1
  100. package/_types/core/Blobs.d.ts +8 -8
  101. package/_types/core/{TransactionEnvelope.d.ts → TxEnvelope.d.ts} +11 -11
  102. package/_types/core/TxEnvelope.d.ts.map +1 -0
  103. package/_types/core/{TransactionEnvelopeEip1559.d.ts → TxEnvelopeEip1559.d.ts} +54 -54
  104. package/_types/core/TxEnvelopeEip1559.d.ts.map +1 -0
  105. package/_types/core/{TransactionEnvelopeEip2930.d.ts → TxEnvelopeEip2930.d.ts} +55 -55
  106. package/_types/core/TxEnvelopeEip2930.d.ts.map +1 -0
  107. package/_types/core/{TransactionEnvelopeEip4844.d.ts → TxEnvelopeEip4844.d.ts} +54 -54
  108. package/_types/core/TxEnvelopeEip4844.d.ts.map +1 -0
  109. package/_types/core/{TransactionEnvelopeEip7702.d.ts → TxEnvelopeEip7702.d.ts} +49 -49
  110. package/_types/core/TxEnvelopeEip7702.d.ts.map +1 -0
  111. package/_types/core/{TransactionEnvelopeLegacy.d.ts → TxEnvelopeLegacy.d.ts} +54 -54
  112. package/_types/core/TxEnvelopeLegacy.d.ts.map +1 -0
  113. package/_types/core/WebAuthnP256.d.ts +1 -1
  114. package/_types/core/WebAuthnP256.d.ts.map +1 -1
  115. package/_types/erc8021/Attribution.d.ts +20 -6
  116. package/_types/erc8021/Attribution.d.ts.map +1 -1
  117. package/_types/index.d.ts +192 -192
  118. package/_types/index.d.ts.map +1 -1
  119. package/_types/index.docs.d.ts +1 -0
  120. package/_types/index.docs.d.ts.map +1 -1
  121. package/_types/tempo/AuthorizationTempo.d.ts +688 -0
  122. package/_types/tempo/AuthorizationTempo.d.ts.map +1 -0
  123. package/_types/tempo/KeyAuthorization.d.ts +437 -0
  124. package/_types/tempo/KeyAuthorization.d.ts.map +1 -0
  125. package/_types/tempo/PoolId.d.ts +33 -0
  126. package/_types/tempo/PoolId.d.ts.map +1 -0
  127. package/_types/tempo/SignatureEnvelope.d.ts +438 -0
  128. package/_types/tempo/SignatureEnvelope.d.ts.map +1 -0
  129. package/_types/tempo/Tick.d.ts +120 -0
  130. package/_types/tempo/Tick.d.ts.map +1 -0
  131. package/_types/tempo/TokenId.d.ts +55 -0
  132. package/_types/tempo/TokenId.d.ts.map +1 -0
  133. package/_types/tempo/TokenRole.d.ts +29 -0
  134. package/_types/tempo/TokenRole.d.ts.map +1 -0
  135. package/_types/tempo/Transaction.d.ts +208 -0
  136. package/_types/tempo/Transaction.d.ts.map +1 -0
  137. package/_types/tempo/TransactionReceipt.d.ts +165 -0
  138. package/_types/tempo/TransactionReceipt.d.ts.map +1 -0
  139. package/_types/tempo/TransactionRequest.d.ts +89 -0
  140. package/_types/tempo/TransactionRequest.d.ts.map +1 -0
  141. package/_types/tempo/TxEnvelopeTempo.d.ts +551 -0
  142. package/_types/tempo/TxEnvelopeTempo.d.ts.map +1 -0
  143. package/_types/tempo/index.d.ts +300 -0
  144. package/_types/tempo/index.d.ts.map +1 -0
  145. package/_types/version.d.ts +1 -1
  146. package/core/Blobs.ts +8 -8
  147. package/core/{TransactionEnvelope.ts → TxEnvelope.ts} +10 -10
  148. package/core/{TransactionEnvelopeEip1559.ts → TxEnvelopeEip1559.ts} +60 -69
  149. package/core/{TransactionEnvelopeEip2930.ts → TxEnvelopeEip2930.ts} +61 -72
  150. package/core/{TransactionEnvelopeEip4844.ts → TxEnvelopeEip4844.ts} +62 -71
  151. package/core/{TransactionEnvelopeEip7702.ts → TxEnvelopeEip7702.ts} +58 -67
  152. package/core/{TransactionEnvelopeLegacy.ts → TxEnvelopeLegacy.ts} +59 -68
  153. package/core/WebAuthnP256.ts +3 -1
  154. package/erc8021/Attribution.ts +77 -15
  155. package/index.docs.ts +1 -0
  156. package/index.ts +192 -195
  157. package/package.json +91 -31
  158. package/tempo/AuthorizationTempo/package.json +6 -0
  159. package/tempo/AuthorizationTempo.test.ts +1293 -0
  160. package/tempo/AuthorizationTempo.ts +884 -0
  161. package/tempo/KeyAuthorization/package.json +6 -0
  162. package/tempo/KeyAuthorization.test.ts +1373 -0
  163. package/tempo/KeyAuthorization.ts +622 -0
  164. package/tempo/PoolId/package.json +6 -0
  165. package/tempo/PoolId.test.ts +33 -0
  166. package/tempo/PoolId.ts +42 -0
  167. package/tempo/SignatureEnvelope/package.json +6 -0
  168. package/tempo/SignatureEnvelope.test.ts +1877 -0
  169. package/tempo/SignatureEnvelope.ts +973 -0
  170. package/tempo/Tick/package.json +6 -0
  171. package/tempo/Tick.test.ts +281 -0
  172. package/tempo/Tick.ts +186 -0
  173. package/tempo/TokenId/package.json +6 -0
  174. package/tempo/TokenId.test.ts +40 -0
  175. package/tempo/TokenId.ts +80 -0
  176. package/tempo/TokenRole/package.json +6 -0
  177. package/tempo/TokenRole.test.ts +16 -0
  178. package/tempo/TokenRole.ts +45 -0
  179. package/tempo/Transaction/package.json +6 -0
  180. package/tempo/Transaction.test.ts +523 -0
  181. package/tempo/Transaction.ts +339 -0
  182. package/tempo/TransactionReceipt/package.json +6 -0
  183. package/tempo/TransactionReceipt.ts +200 -0
  184. package/tempo/TransactionRequest/package.json +6 -0
  185. package/tempo/TransactionRequest.ts +160 -0
  186. package/tempo/TxEnvelopeTempo/package.json +6 -0
  187. package/tempo/TxEnvelopeTempo.test.ts +1371 -0
  188. package/tempo/TxEnvelopeTempo.ts +972 -0
  189. package/tempo/e2e.test.ts +1387 -0
  190. package/tempo/index.ts +308 -0
  191. package/tempo/package.json +6 -0
  192. package/version.ts +1 -1
  193. package/TransactionEnvelope/package.json +0 -6
  194. package/TransactionEnvelopeEip1559/package.json +0 -6
  195. package/TransactionEnvelopeEip2930/package.json +0 -6
  196. package/TransactionEnvelopeEip4844/package.json +0 -6
  197. package/TransactionEnvelopeEip7702/package.json +0 -6
  198. package/TransactionEnvelopeLegacy/package.json +0 -6
  199. package/_cjs/core/TransactionEnvelope.js.map +0 -1
  200. package/_cjs/core/TransactionEnvelopeEip1559.js.map +0 -1
  201. package/_cjs/core/TransactionEnvelopeEip2930.js.map +0 -1
  202. package/_cjs/core/TransactionEnvelopeEip4844.js.map +0 -1
  203. package/_cjs/core/TransactionEnvelopeEip7702.js.map +0 -1
  204. package/_cjs/core/TransactionEnvelopeLegacy.js.map +0 -1
  205. package/_esm/core/TransactionEnvelope.js.map +0 -1
  206. package/_esm/core/TransactionEnvelopeEip1559.js.map +0 -1
  207. package/_esm/core/TransactionEnvelopeEip2930.js.map +0 -1
  208. package/_esm/core/TransactionEnvelopeEip4844.js.map +0 -1
  209. package/_esm/core/TransactionEnvelopeEip7702.js.map +0 -1
  210. package/_esm/core/TransactionEnvelopeLegacy.js.map +0 -1
  211. package/_types/core/TransactionEnvelope.d.ts.map +0 -1
  212. package/_types/core/TransactionEnvelopeEip1559.d.ts.map +0 -1
  213. package/_types/core/TransactionEnvelopeEip2930.d.ts.map +0 -1
  214. package/_types/core/TransactionEnvelopeEip4844.d.ts.map +0 -1
  215. package/_types/core/TransactionEnvelopeEip7702.d.ts.map +0 -1
  216. package/_types/core/TransactionEnvelopeLegacy.d.ts.map +0 -1
@@ -12,10 +12,10 @@ import type {
12
12
  import * as Kzg from './Kzg.js'
13
13
  import * as Rlp from './Rlp.js'
14
14
  import * as Signature from './Signature.js'
15
- import * as TransactionEnvelope from './TransactionEnvelope.js'
16
- import * as TransactionEnvelopeEip1559 from './TransactionEnvelopeEip1559.js'
15
+ import * as TransactionEnvelope from './TxEnvelope.js'
16
+ import * as TxEnvelopeEip1559 from './TxEnvelopeEip1559.js'
17
17
 
18
- export type TransactionEnvelopeEip4844<
18
+ export type TxEnvelopeEip4844<
19
19
  signed extends boolean = boolean,
20
20
  bigintType = bigint,
21
21
  numberType = number,
@@ -37,7 +37,7 @@ export type TransactionEnvelopeEip4844<
37
37
  }
38
38
  >
39
39
 
40
- export type Rpc<signed extends boolean = boolean> = TransactionEnvelopeEip4844<
40
+ export type Rpc<signed extends boolean = boolean> = TxEnvelopeEip4844<
41
41
  signed,
42
42
  Hex.Hex,
43
43
  Hex.Hex,
@@ -49,19 +49,19 @@ export type Serialized = `${SerializedType}${string}`
49
49
  export const serializedType = '0x03' as const
50
50
  export type SerializedType = typeof serializedType
51
51
 
52
- export type Signed = TransactionEnvelopeEip4844<true>
52
+ export type Signed = TxEnvelopeEip4844<true>
53
53
 
54
54
  export const type = 'eip4844' as const
55
55
  export type Type = 'eip4844'
56
56
 
57
57
  /**
58
- * Asserts a {@link ox#TransactionEnvelopeEip4844.TransactionEnvelopeEip4844} is valid.
58
+ * Asserts a {@link ox#TxEnvelopeEip4844.TxEnvelopeEip4844} is valid.
59
59
  *
60
60
  * @example
61
61
  * ```ts twoslash
62
- * import { TransactionEnvelopeEip4844, Value } from 'ox'
62
+ * import { TxEnvelopeEip4844, Value } from 'ox'
63
63
  *
64
- * TransactionEnvelopeEip4844.assert({
64
+ * TxEnvelopeEip4844.assert({
65
65
  * blobVersionedHashes: [],
66
66
  * chainId: 1,
67
67
  * to: '0x0000000000000000000000000000000000000000',
@@ -72,9 +72,7 @@ export type Type = 'eip4844'
72
72
  *
73
73
  * @param envelope - The transaction envelope to assert.
74
74
  */
75
- export function assert(
76
- envelope: PartialBy<TransactionEnvelopeEip4844, 'type'>,
77
- ) {
75
+ export function assert(envelope: PartialBy<TxEnvelopeEip4844, 'type'>) {
78
76
  const { blobVersionedHashes } = envelope
79
77
  if (blobVersionedHashes) {
80
78
  if (blobVersionedHashes.length === 0)
@@ -91,14 +89,14 @@ export function assert(
91
89
  })
92
90
  }
93
91
  }
94
- TransactionEnvelopeEip1559.assert(
95
- envelope as {} as TransactionEnvelopeEip1559.TransactionEnvelopeEip1559,
92
+ TxEnvelopeEip1559.assert(
93
+ envelope as {} as TxEnvelopeEip1559.TxEnvelopeEip1559,
96
94
  )
97
95
  }
98
96
 
99
97
  export declare namespace assert {
100
98
  type ErrorType =
101
- | TransactionEnvelopeEip1559.assert.ErrorType
99
+ | TxEnvelopeEip1559.assert.ErrorType
102
100
  | Hex.size.ErrorType
103
101
  | Hex.toNumber.ErrorType
104
102
  | Hex.slice.ErrorType
@@ -109,13 +107,13 @@ export declare namespace assert {
109
107
  }
110
108
 
111
109
  /**
112
- * Deserializes a {@link ox#TransactionEnvelopeEip4844.TransactionEnvelopeEip4844} from its serialized form.
110
+ * Deserializes a {@link ox#TxEnvelopeEip4844.TxEnvelopeEip4844} from its serialized form.
113
111
  *
114
112
  * @example
115
113
  * ```ts twoslash
116
- * import { TransactionEnvelopeEip4844 } from 'ox'
114
+ * import { TxEnvelopeEip4844 } from 'ox'
117
115
  *
118
- * const envelope = TransactionEnvelopeEip4844.deserialize('0x03ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
116
+ * const envelope = TxEnvelopeEip4844.deserialize('0x03ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
119
117
  * // @log: {
120
118
  * // @log: blobVersionedHashes: [...],
121
119
  * // @log: type: 'eip4844',
@@ -132,7 +130,7 @@ export declare namespace assert {
132
130
  */
133
131
  export function deserialize(
134
132
  serialized: Serialized,
135
- ): Compute<TransactionEnvelopeEip4844> {
133
+ ): Compute<TxEnvelopeEip4844> {
136
134
  const transactionOrWrapperArray = Rlp.toHex(Hex.slice(serialized, 1))
137
135
 
138
136
  const hasNetworkWrapper = transactionOrWrapperArray.length === 4
@@ -190,7 +188,7 @@ export function deserialize(
190
188
  blobVersionedHashes: blobVersionedHashes as Hex.Hex[],
191
189
  chainId: Number(chainId),
192
190
  type,
193
- } as TransactionEnvelopeEip4844
191
+ } as TxEnvelopeEip4844
194
192
  if (Hex.validate(to) && to !== '0x') transaction.to = to
195
193
  if (Hex.validate(gas) && gas !== '0x') transaction.gas = BigInt(gas)
196
194
  if (Hex.validate(data) && data !== '0x') transaction.data = data
@@ -219,7 +217,7 @@ export function deserialize(
219
217
  transaction = {
220
218
  ...transaction,
221
219
  ...signature,
222
- } as TransactionEnvelopeEip4844
220
+ } as TxEnvelopeEip4844
223
221
 
224
222
  assert(transaction)
225
223
 
@@ -236,13 +234,13 @@ export declare namespace deserialize {
236
234
  * @example
237
235
  * ```ts twoslash
238
236
  * // @noErrors
239
- * import { Blobs, TransactionEnvelopeEip4844, Value } from 'ox'
237
+ * import { Blobs, TxEnvelopeEip4844, Value } from 'ox'
240
238
  * import { kzg } from './kzg'
241
239
  *
242
240
  * const blobs = Blobs.from('0xdeadbeef')
243
241
  * const blobVersionedHashes = Blobs.toVersionedHashes(blobs, { kzg })
244
242
  *
245
- * const envelope = TransactionEnvelopeEip4844.from({
243
+ * const envelope = TxEnvelopeEip4844.from({
246
244
  * chainId: 1,
247
245
  * blobVersionedHashes,
248
246
  * maxFeePerBlobGas: Value.fromGwei('3'),
@@ -260,14 +258,14 @@ export declare namespace deserialize {
260
258
  *
261
259
  * ```ts twoslash
262
260
  * // @noErrors
263
- * import { Blobs, Secp256k1, TransactionEnvelopeEip4844, Value } from 'ox'
261
+ * import { Blobs, Secp256k1, TxEnvelopeEip4844, Value } from 'ox'
264
262
  * import { kzg } from './kzg'
265
263
  *
266
264
  * const blobs = Blobs.from('0xdeadbeef')
267
265
  * const sidecars = Blobs.toSidecars(blobs, { kzg })
268
266
  * const blobVersionedHashes = Blobs.sidecarsToVersionedHashes(sidecars)
269
267
  *
270
- * const envelope = TransactionEnvelopeEip4844.from({
268
+ * const envelope = TxEnvelopeEip4844.from({
271
269
  * blobVersionedHashes,
272
270
  * chainId: 1,
273
271
  * maxFeePerBlobGas: Value.fromGwei('3'),
@@ -278,11 +276,11 @@ export declare namespace deserialize {
278
276
  * })
279
277
  *
280
278
  * const signature = Secp256k1.sign({
281
- * payload: TransactionEnvelopeEip4844.getSignPayload(envelope),
279
+ * payload: TxEnvelopeEip4844.getSignPayload(envelope),
282
280
  * privateKey: '0x...',
283
281
  * })
284
282
  *
285
- * const envelope_signed = TransactionEnvelopeEip4844.from(envelope, { // [!code focus]
283
+ * const envelope_signed = TxEnvelopeEip4844.from(envelope, { // [!code focus]
286
284
  * sidecars, // [!code focus]
287
285
  * signature, // [!code focus]
288
286
  * }) // [!code focus]
@@ -304,12 +302,12 @@ export declare namespace deserialize {
304
302
  * @example
305
303
  * ### From Serialized
306
304
  *
307
- * It is possible to instantiate an EIP-4844 Transaction Envelope from a {@link ox#TransactionEnvelopeEip4844.Serialized} value.
305
+ * It is possible to instantiate an EIP-4844 Transaction Envelope from a {@link ox#TxEnvelopeEip4844.Serialized} value.
308
306
  *
309
307
  * ```ts twoslash
310
- * import { TransactionEnvelopeEip4844 } from 'ox'
308
+ * import { TxEnvelopeEip4844 } from 'ox'
311
309
  *
312
- * const envelope = TransactionEnvelopeEip4844.from('0x03f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
310
+ * const envelope = TxEnvelopeEip4844.from('0x03f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
313
311
  * // @log: {
314
312
  * // @log: blobVersionedHashes: [...],
315
313
  * // @log: chainId: 1,
@@ -325,22 +323,17 @@ export declare namespace deserialize {
325
323
  * @returns An EIP-4844 Transaction Envelope.
326
324
  */
327
325
  export function from<
328
- const envelope extends
329
- | UnionPartialBy<TransactionEnvelopeEip4844, 'type'>
330
- | Serialized,
326
+ const envelope extends UnionPartialBy<TxEnvelopeEip4844, 'type'> | Serialized,
331
327
  const signature extends Signature.Signature | undefined = undefined,
332
328
  >(
333
- envelope:
334
- | envelope
335
- | UnionPartialBy<TransactionEnvelopeEip4844, 'type'>
336
- | Serialized,
329
+ envelope: envelope | UnionPartialBy<TxEnvelopeEip4844, 'type'> | Serialized,
337
330
  options: from.Options<signature> = {},
338
331
  ): from.ReturnType<envelope, signature> {
339
332
  const { signature } = options
340
333
 
341
334
  const envelope_ = (
342
335
  typeof envelope === 'string' ? deserialize(envelope) : envelope
343
- ) as TransactionEnvelopeEip4844
336
+ ) as TxEnvelopeEip4844
344
337
 
345
338
  assert(envelope_)
346
339
 
@@ -358,13 +351,13 @@ export declare namespace from {
358
351
  }
359
352
 
360
353
  type ReturnType<
361
- envelope extends
362
- | UnionPartialBy<TransactionEnvelopeEip4844, 'type'>
363
- | Hex.Hex = TransactionEnvelopeEip4844 | Hex.Hex,
354
+ envelope extends UnionPartialBy<TxEnvelopeEip4844, 'type'> | Hex.Hex =
355
+ | TxEnvelopeEip4844
356
+ | Hex.Hex,
364
357
  signature extends Signature.Signature | undefined = undefined,
365
358
  > = Compute<
366
359
  envelope extends Hex.Hex
367
- ? TransactionEnvelopeEip4844
360
+ ? TxEnvelopeEip4844
368
361
  : Assign<
369
362
  envelope,
370
363
  (signature extends Signature.Signature ? Readonly<signature> : {}) & {
@@ -380,7 +373,7 @@ export declare namespace from {
380
373
  }
381
374
 
382
375
  /**
383
- * Returns the payload to sign for a {@link ox#TransactionEnvelopeEip4844.TransactionEnvelopeEip4844}.
376
+ * Returns the payload to sign for a {@link ox#TxEnvelopeEip4844.TxEnvelopeEip4844}.
384
377
  *
385
378
  * @example
386
379
  * The example below demonstrates how to compute the sign payload which can be used
@@ -388,13 +381,13 @@ export declare namespace from {
388
381
  *
389
382
  * ```ts twoslash
390
383
  * // @noErrors
391
- * import { Blobs, Secp256k1, TransactionEnvelopeEip4844 } from 'ox'
384
+ * import { Blobs, Secp256k1, TxEnvelopeEip4844 } from 'ox'
392
385
  * import { kzg } from './kzg'
393
386
  *
394
387
  * const blobs = Blobs.from('0xdeadbeef')
395
388
  * const blobVersionedHashes = Blobs.toVersionedHashes(blobs, { kzg })
396
389
  *
397
- * const envelope = TransactionEnvelopeEip4844.from({
390
+ * const envelope = TxEnvelopeEip4844.from({
398
391
  * blobVersionedHashes,
399
392
  * chainId: 1,
400
393
  * nonce: 0n,
@@ -404,7 +397,7 @@ export declare namespace from {
404
397
  * value: 1000000000000000000n,
405
398
  * })
406
399
  *
407
- * const payload = TransactionEnvelopeEip4844.getSignPayload(envelope) // [!code focus]
400
+ * const payload = TxEnvelopeEip4844.getSignPayload(envelope) // [!code focus]
408
401
  * // @log: '0x...'
409
402
  *
410
403
  * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
@@ -414,7 +407,7 @@ export declare namespace from {
414
407
  * @returns The sign payload.
415
408
  */
416
409
  export function getSignPayload(
417
- envelope: TransactionEnvelopeEip4844,
410
+ envelope: TxEnvelopeEip4844,
418
411
  ): getSignPayload.ReturnType {
419
412
  return hash(envelope, { presign: true })
420
413
  }
@@ -426,18 +419,18 @@ export declare namespace getSignPayload {
426
419
  }
427
420
 
428
421
  /**
429
- * Hashes a {@link ox#TransactionEnvelopeEip4844.TransactionEnvelopeEip4844}. This is the "transaction hash".
422
+ * Hashes a {@link ox#TxEnvelopeEip4844.TxEnvelopeEip4844}. This is the "transaction hash".
430
423
  *
431
424
  * @example
432
425
  * ```ts twoslash
433
426
  * // @noErrors
434
- * import { Blobs, TransactionEnvelopeEip4844 } from 'ox'
427
+ * import { Blobs, TxEnvelopeEip4844 } from 'ox'
435
428
  * import { kzg } from './kzg'
436
429
  *
437
430
  * const blobs = Blobs.from('0xdeadbeef')
438
431
  * const blobVersionedHashes = Blobs.toVersionedHashes(blobs, { kzg })
439
432
  *
440
- * const envelope = TransactionEnvelopeEip4844.from({
433
+ * const envelope = TxEnvelopeEip4844.from({
441
434
  * blobVersionedHashes,
442
435
  * chainId: 1,
443
436
  * nonce: 0n,
@@ -447,7 +440,7 @@ export declare namespace getSignPayload {
447
440
  * value: 1000000000000000000n,
448
441
  * })
449
442
  *
450
- * const hash = TransactionEnvelopeEip4844.hash(envelope) // [!code focus]
443
+ * const hash = TxEnvelopeEip4844.hash(envelope) // [!code focus]
451
444
  * ```
452
445
  *
453
446
  * @param envelope - The EIP-4844 Transaction Envelope to hash.
@@ -455,7 +448,7 @@ export declare namespace getSignPayload {
455
448
  * @returns The hash of the transaction envelope.
456
449
  */
457
450
  export function hash<presign extends boolean = false>(
458
- envelope: TransactionEnvelopeEip4844<presign extends true ? false : true>,
451
+ envelope: TxEnvelopeEip4844<presign extends true ? false : true>,
459
452
  options: hash.Options<presign> = {},
460
453
  ): hash.ReturnType {
461
454
  const { presign } = options
@@ -490,18 +483,18 @@ export declare namespace hash {
490
483
  }
491
484
 
492
485
  /**
493
- * Serializes a {@link ox#TransactionEnvelopeEip4844.TransactionEnvelopeEip4844}.
486
+ * Serializes a {@link ox#TxEnvelopeEip4844.TxEnvelopeEip4844}.
494
487
  *
495
488
  * @example
496
489
  * ```ts twoslash
497
490
  * // @noErrors
498
- * import { Blobs, TransactionEnvelopeEip4844 } from 'ox'
491
+ * import { Blobs, TxEnvelopeEip4844 } from 'ox'
499
492
  * import { kzg } from './kzg'
500
493
  *
501
494
  * const blobs = Blobs.from('0xdeadbeef')
502
495
  * const blobVersionedHashes = Blobs.toVersionedHashes(blobs, { kzg })
503
496
  *
504
- * const envelope = TransactionEnvelopeEip4844.from({
497
+ * const envelope = TxEnvelopeEip4844.from({
505
498
  * blobVersionedHashes,
506
499
  * chainId: 1,
507
500
  * maxFeePerGas: Value.fromGwei('10'),
@@ -509,7 +502,7 @@ export declare namespace hash {
509
502
  * value: Value.fromEther('1'),
510
503
  * })
511
504
  *
512
- * const serialized = TransactionEnvelopeEip4844.serialize(envelope) // [!code focus]
505
+ * const serialized = TxEnvelopeEip4844.serialize(envelope) // [!code focus]
513
506
  * ```
514
507
  *
515
508
  * @example
@@ -519,14 +512,14 @@ export declare namespace hash {
519
512
  *
520
513
  * ```ts twoslash
521
514
  * // @noErrors
522
- * import { Blobs, Secp256k1, TransactionEnvelopeEip4844, Value } from 'ox'
515
+ * import { Blobs, Secp256k1, TxEnvelopeEip4844, Value } from 'ox'
523
516
  * import { kzg } from './kzg'
524
517
  *
525
518
  * const blobs = Blobs.from('0xdeadbeef')
526
519
  * const sidecars = Blobs.toSidecars(blobs, { kzg })
527
520
  * const blobVersionedHashes = Blobs.sidecarsToVersionedHashes(blobs)
528
521
  *
529
- * const envelope = TransactionEnvelopeEip4844.from({
522
+ * const envelope = TxEnvelopeEip4844.from({
530
523
  * blobVersionedHashes,
531
524
  * chainId: 1,
532
525
  * maxFeePerBlobGas: Value.fromGwei('3'),
@@ -537,11 +530,11 @@ export declare namespace hash {
537
530
  * })
538
531
  *
539
532
  * const signature = Secp256k1.sign({
540
- * payload: TransactionEnvelopeEip4844.getSignPayload(envelope),
533
+ * payload: TxEnvelopeEip4844.getSignPayload(envelope),
541
534
  * privateKey: '0x...',
542
535
  * })
543
536
  *
544
- * const serialized = TransactionEnvelopeEip4844.serialize(envelope, { // [!code focus]
537
+ * const serialized = TxEnvelopeEip4844.serialize(envelope, { // [!code focus]
545
538
  * sidecars, // [!code focus]
546
539
  * signature, // [!code focus]
547
540
  * }) // [!code focus]
@@ -554,7 +547,7 @@ export declare namespace hash {
554
547
  * @returns The serialized Transaction Envelope.
555
548
  */
556
549
  export function serialize(
557
- envelope: PartialBy<TransactionEnvelopeEip4844, 'type'>,
550
+ envelope: PartialBy<TxEnvelopeEip4844, 'type'>,
558
551
  options: serialize.Options = {},
559
552
  ): Serialized {
560
553
  const {
@@ -632,18 +625,18 @@ export declare namespace serialize {
632
625
  }
633
626
 
634
627
  /**
635
- * Converts an {@link ox#TransactionEnvelopeEip4844.TransactionEnvelopeEip4844} to an {@link ox#TransactionEnvelopeEip4844.Rpc}.
628
+ * Converts an {@link ox#TxEnvelopeEip4844.TxEnvelopeEip4844} to an {@link ox#TxEnvelopeEip4844.Rpc}.
636
629
  *
637
630
  * @example
638
631
  * ```ts twoslash
639
632
  * // @noErrors
640
- * import { Blobs, RpcRequest, TransactionEnvelopeEip4844, Value } from 'ox'
633
+ * import { Blobs, RpcRequest, TxEnvelopeEip4844, Value } from 'ox'
641
634
  * import { kzg } from './kzg'
642
635
  *
643
636
  * const blobs = Blobs.from('0xdeadbeef')
644
637
  * const blobVersionedHashes = Blobs.toVersionedHashes(blobs, { kzg })
645
638
  *
646
- * const envelope = TransactionEnvelopeEip4844.from({
639
+ * const envelope = TxEnvelopeEip4844.from({
647
640
  * blobVersionedHashes,
648
641
  * chainId: 1,
649
642
  * nonce: 0n,
@@ -653,7 +646,7 @@ export declare namespace serialize {
653
646
  * value: Value.fromEther('1'),
654
647
  * })
655
648
  *
656
- * const envelope_rpc = TransactionEnvelopeEip4844.toRpc(envelope) // [!code focus]
649
+ * const envelope_rpc = TxEnvelopeEip4844.toRpc(envelope) // [!code focus]
657
650
  *
658
651
  * const request = RpcRequest.from({
659
652
  * id: 0,
@@ -665,7 +658,7 @@ export declare namespace serialize {
665
658
  * @param envelope - The EIP-4844 transaction envelope to convert.
666
659
  * @returns An RPC-formatted EIP-4844 transaction envelope.
667
660
  */
668
- export function toRpc(envelope: Omit<TransactionEnvelopeEip4844, 'type'>): Rpc {
661
+ export function toRpc(envelope: Omit<TxEnvelopeEip4844, 'type'>): Rpc {
669
662
  const signature = Signature.extract(envelope)
670
663
 
671
664
  return {
@@ -700,13 +693,13 @@ export declare namespace toRpc {
700
693
  }
701
694
 
702
695
  /**
703
- * Validates a {@link ox#TransactionEnvelopeEip4844.TransactionEnvelopeEip4844}. Returns `true` if the envelope is valid, `false` otherwise.
696
+ * Validates a {@link ox#TxEnvelopeEip4844.TxEnvelopeEip4844}. Returns `true` if the envelope is valid, `false` otherwise.
704
697
  *
705
698
  * @example
706
699
  * ```ts twoslash
707
- * import { TransactionEnvelopeEip4844, Value } from 'ox'
700
+ * import { TxEnvelopeEip4844, Value } from 'ox'
708
701
  *
709
- * const valid = TransactionEnvelopeEip4844.assert({
702
+ * const valid = TxEnvelopeEip4844.assert({
710
703
  * blobVersionedHashes: [],
711
704
  * chainId: 1,
712
705
  * to: '0x0000000000000000000000000000000000000000',
@@ -717,9 +710,7 @@ export declare namespace toRpc {
717
710
  *
718
711
  * @param envelope - The transaction envelope to validate.
719
712
  */
720
- export function validate(
721
- envelope: PartialBy<TransactionEnvelopeEip4844, 'type'>,
722
- ) {
713
+ export function validate(envelope: PartialBy<TxEnvelopeEip4844, 'type'>) {
723
714
  try {
724
715
  assert(envelope)
725
716
  return true