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
  } from './internal/types.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 TransactionEnvelopeEip7702<
18
+ export type TxEnvelopeEip7702<
19
19
  signed extends boolean = boolean,
20
20
  bigintType = bigint,
21
21
  numberType = number,
@@ -33,7 +33,7 @@ export type TransactionEnvelopeEip7702<
33
33
  }
34
34
  >
35
35
 
36
- export type Rpc<signed extends boolean = boolean> = TransactionEnvelopeEip7702<
36
+ export type Rpc<signed extends boolean = boolean> = TxEnvelopeEip7702<
37
37
  signed,
38
38
  Hex.Hex,
39
39
  Hex.Hex,
@@ -42,7 +42,7 @@ export type Rpc<signed extends boolean = boolean> = TransactionEnvelopeEip7702<
42
42
 
43
43
  export type Serialized = `${SerializedType}${string}`
44
44
 
45
- export type Signed = TransactionEnvelopeEip7702<true>
45
+ export type Signed = TxEnvelopeEip7702<true>
46
46
 
47
47
  export const serializedType = '0x04' as const
48
48
  export type SerializedType = typeof serializedType
@@ -51,13 +51,13 @@ export const type = 'eip7702' as const
51
51
  export type Type = typeof type
52
52
 
53
53
  /**
54
- * Asserts a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702} is valid.
54
+ * Asserts a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702} is valid.
55
55
  *
56
56
  * @example
57
57
  * ```ts twoslash
58
- * import { TransactionEnvelopeEip7702, Value } from 'ox'
58
+ * import { TxEnvelopeEip7702, Value } from 'ox'
59
59
  *
60
- * TransactionEnvelopeEip7702.assert({
60
+ * TxEnvelopeEip7702.assert({
61
61
  * authorizationList: [],
62
62
  * maxFeePerGas: 2n ** 256n - 1n + 1n,
63
63
  * chainId: 1,
@@ -71,9 +71,7 @@ export type Type = typeof type
71
71
  *
72
72
  * @param envelope - The transaction envelope to assert.
73
73
  */
74
- export function assert(
75
- envelope: PartialBy<TransactionEnvelopeEip7702, 'type'>,
76
- ) {
74
+ export function assert(envelope: PartialBy<TxEnvelopeEip7702, 'type'>) {
77
75
  const { authorizationList } = envelope
78
76
  if (authorizationList) {
79
77
  for (const authorization of authorizationList) {
@@ -83,8 +81,8 @@ export function assert(
83
81
  throw new TransactionEnvelope.InvalidChainIdError({ chainId })
84
82
  }
85
83
  }
86
- TransactionEnvelopeEip1559.assert(
87
- envelope as {} as TransactionEnvelopeEip1559.TransactionEnvelopeEip1559,
84
+ TxEnvelopeEip1559.assert(
85
+ envelope as {} as TxEnvelopeEip1559.TxEnvelopeEip1559,
88
86
  )
89
87
  }
90
88
 
@@ -96,13 +94,13 @@ export declare namespace assert {
96
94
  }
97
95
 
98
96
  /**
99
- * Deserializes a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702} from its serialized form.
97
+ * Deserializes a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702} from its serialized form.
100
98
  *
101
99
  * @example
102
100
  * ```ts twoslash
103
- * import { TransactionEnvelopeEip7702 } from 'ox'
101
+ * import { TxEnvelopeEip7702 } from 'ox'
104
102
  *
105
- * const envelope = TransactionEnvelopeEip7702.deserialize('0x04ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
103
+ * const envelope = TxEnvelopeEip7702.deserialize('0x04ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
106
104
  * // @log: {
107
105
  * // @log: authorizationList: [...],
108
106
  * // @log: type: 'eip7702',
@@ -119,7 +117,7 @@ export declare namespace assert {
119
117
  */
120
118
  export function deserialize(
121
119
  serialized: Serialized,
122
- ): Compute<TransactionEnvelopeEip7702> {
120
+ ): Compute<TxEnvelopeEip7702> {
123
121
  const transactionArray = Rlp.toHex(Hex.slice(serialized, 1))
124
122
 
125
123
  const [
@@ -166,7 +164,7 @@ export function deserialize(
166
164
  let transaction = {
167
165
  chainId: Number(chainId),
168
166
  type,
169
- } as TransactionEnvelopeEip7702
167
+ } as TxEnvelopeEip7702
170
168
  if (Hex.validate(to) && to !== '0x') transaction.to = to
171
169
  if (Hex.validate(gas) && gas !== '0x') transaction.gas = BigInt(gas)
172
170
  if (Hex.validate(data) && data !== '0x') transaction.data = data
@@ -190,7 +188,7 @@ export function deserialize(
190
188
  transaction = {
191
189
  ...transaction,
192
190
  ...signature,
193
- } as TransactionEnvelopeEip7702
191
+ } as TxEnvelopeEip7702
194
192
 
195
193
  assert(transaction)
196
194
 
@@ -206,7 +204,7 @@ export declare namespace deserialize {
206
204
  *
207
205
  * @example
208
206
  * ```ts twoslash
209
- * import { Authorization, Secp256k1, TransactionEnvelopeEip7702, Value } from 'ox'
207
+ * import { Authorization, Secp256k1, TxEnvelopeEip7702, Value } from 'ox'
210
208
  *
211
209
  * const authorization = Authorization.from({
212
210
  * address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
@@ -221,7 +219,7 @@ export declare namespace deserialize {
221
219
  *
222
220
  * const authorizationList = [Authorization.from(authorization, { signature })]
223
221
  *
224
- * const envelope = TransactionEnvelopeEip7702.from({ // [!code focus]
222
+ * const envelope = TxEnvelopeEip7702.from({ // [!code focus]
225
223
  * authorizationList, // [!code focus]
226
224
  * chainId: 1, // [!code focus]
227
225
  * maxFeePerGas: Value.fromGwei('10'), // [!code focus]
@@ -238,9 +236,9 @@ export declare namespace deserialize {
238
236
  *
239
237
  * ```ts twoslash
240
238
  * // @noErrors
241
- * import { Secp256k1, TransactionEnvelopeEip7702, Value } from 'ox'
239
+ * import { Secp256k1, TxEnvelopeEip7702, Value } from 'ox'
242
240
  *
243
- * const envelope = TransactionEnvelopeEip7702.from({
241
+ * const envelope = TxEnvelopeEip7702.from({
244
242
  * authorizationList: [...],
245
243
  * chainId: 1,
246
244
  * maxFeePerGas: Value.fromGwei('10'),
@@ -250,11 +248,11 @@ export declare namespace deserialize {
250
248
  * })
251
249
  *
252
250
  * const signature = Secp256k1.sign({
253
- * payload: TransactionEnvelopeEip7702.getSignPayload(envelope),
251
+ * payload: TxEnvelopeEip7702.getSignPayload(envelope),
254
252
  * privateKey: '0x...',
255
253
  * })
256
254
  *
257
- * const envelope_signed = TransactionEnvelopeEip7702.from(envelope, { // [!code focus]
255
+ * const envelope_signed = TxEnvelopeEip7702.from(envelope, { // [!code focus]
258
256
  * signature, // [!code focus]
259
257
  * }) // [!code focus]
260
258
  * // @log: {
@@ -274,12 +272,12 @@ export declare namespace deserialize {
274
272
  * @example
275
273
  * ### From Serialized
276
274
  *
277
- * It is possible to instantiate an EIP-7702 Transaction Envelope from a {@link ox#TransactionEnvelopeEip7702.Serialized} value.
275
+ * It is possible to instantiate an EIP-7702 Transaction Envelope from a {@link ox#TxEnvelopeEip7702.Serialized} value.
278
276
  *
279
277
  * ```ts twoslash
280
- * import { TransactionEnvelopeEip7702 } from 'ox'
278
+ * import { TxEnvelopeEip7702 } from 'ox'
281
279
  *
282
- * const envelope = TransactionEnvelopeEip7702.from('0x04f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
280
+ * const envelope = TxEnvelopeEip7702.from('0x04f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
283
281
  * // @log: {
284
282
  * // @log: authorizationList: [...],
285
283
  * // @log: chainId: 1,
@@ -295,22 +293,17 @@ export declare namespace deserialize {
295
293
  * @returns An EIP-7702 Transaction Envelope.
296
294
  */
297
295
  export function from<
298
- const envelope extends
299
- | UnionPartialBy<TransactionEnvelopeEip7702, 'type'>
300
- | Serialized,
296
+ const envelope extends UnionPartialBy<TxEnvelopeEip7702, 'type'> | Serialized,
301
297
  const signature extends Signature.Signature | undefined = undefined,
302
298
  >(
303
- envelope:
304
- | envelope
305
- | UnionPartialBy<TransactionEnvelopeEip7702, 'type'>
306
- | Serialized,
299
+ envelope: envelope | UnionPartialBy<TxEnvelopeEip7702, 'type'> | Serialized,
307
300
  options: from.Options<signature> = {},
308
301
  ): from.ReturnType<envelope, signature> {
309
302
  const { signature } = options
310
303
 
311
304
  const envelope_ = (
312
305
  typeof envelope === 'string' ? deserialize(envelope) : envelope
313
- ) as TransactionEnvelopeEip7702
306
+ ) as TxEnvelopeEip7702
314
307
 
315
308
  assert(envelope_)
316
309
 
@@ -328,13 +321,13 @@ export declare namespace from {
328
321
  }
329
322
 
330
323
  type ReturnType<
331
- envelope extends
332
- | UnionPartialBy<TransactionEnvelopeEip7702, 'type'>
333
- | Hex.Hex = TransactionEnvelopeEip7702 | Hex.Hex,
324
+ envelope extends UnionPartialBy<TxEnvelopeEip7702, 'type'> | Hex.Hex =
325
+ | TxEnvelopeEip7702
326
+ | Hex.Hex,
334
327
  signature extends Signature.Signature | undefined = undefined,
335
328
  > = Compute<
336
329
  envelope extends Hex.Hex
337
- ? TransactionEnvelopeEip7702
330
+ ? TxEnvelopeEip7702
338
331
  : Assign<
339
332
  envelope,
340
333
  (signature extends Signature.Signature ? Readonly<signature> : {}) & {
@@ -350,7 +343,7 @@ export declare namespace from {
350
343
  }
351
344
 
352
345
  /**
353
- * Returns the payload to sign for a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702}.
346
+ * Returns the payload to sign for a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702}.
354
347
  *
355
348
  * @example
356
349
  * The example below demonstrates how to compute the sign payload which can be used
@@ -358,9 +351,9 @@ export declare namespace from {
358
351
  *
359
352
  * ```ts twoslash
360
353
  * // @noErrors
361
- * import { Secp256k1, TransactionEnvelopeEip7702 } from 'ox'
354
+ * import { Secp256k1, TxEnvelopeEip7702 } from 'ox'
362
355
  *
363
- * const envelope = TransactionEnvelopeEip7702.from({
356
+ * const envelope = TxEnvelopeEip7702.from({
364
357
  * authorizationList: [...],
365
358
  * chainId: 1,
366
359
  * nonce: 0n,
@@ -370,7 +363,7 @@ export declare namespace from {
370
363
  * value: 1000000000000000000n,
371
364
  * })
372
365
  *
373
- * const payload = TransactionEnvelopeEip7702.getSignPayload(envelope) // [!code focus]
366
+ * const payload = TxEnvelopeEip7702.getSignPayload(envelope) // [!code focus]
374
367
  * // @log: '0x...'
375
368
  *
376
369
  * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
@@ -380,7 +373,7 @@ export declare namespace from {
380
373
  * @returns The sign payload.
381
374
  */
382
375
  export function getSignPayload(
383
- envelope: TransactionEnvelopeEip7702,
376
+ envelope: TxEnvelopeEip7702,
384
377
  ): getSignPayload.ReturnType {
385
378
  return hash(envelope, { presign: true })
386
379
  }
@@ -392,14 +385,14 @@ export declare namespace getSignPayload {
392
385
  }
393
386
 
394
387
  /**
395
- * Hashes a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702}. This is the "transaction hash".
388
+ * Hashes a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702}. This is the "transaction hash".
396
389
  *
397
390
  * @example
398
391
  * ```ts twoslash
399
392
  * // @noErrors
400
- * import { Secp256k1, TransactionEnvelopeEip7702 } from 'ox'
393
+ * import { Secp256k1, TxEnvelopeEip7702 } from 'ox'
401
394
  *
402
- * const envelope = TransactionEnvelopeEip7702.from({
395
+ * const envelope = TxEnvelopeEip7702.from({
403
396
  * authorizationList: [...],
404
397
  * chainId: 1,
405
398
  * nonce: 0n,
@@ -410,13 +403,13 @@ export declare namespace getSignPayload {
410
403
  * })
411
404
  *
412
405
  * const signature = Secp256k1.sign({
413
- * payload: TransactionEnvelopeEip7702.getSignPayload(envelope),
406
+ * payload: TxEnvelopeEip7702.getSignPayload(envelope),
414
407
  * privateKey: '0x...'
415
408
  * })
416
409
  *
417
- * const envelope_signed = TransactionEnvelopeEip7702.from(envelope, { signature })
410
+ * const envelope_signed = TxEnvelopeEip7702.from(envelope, { signature })
418
411
  *
419
- * const hash = TransactionEnvelopeEip7702.hash(envelope_signed) // [!code focus]
412
+ * const hash = TxEnvelopeEip7702.hash(envelope_signed) // [!code focus]
420
413
  * ```
421
414
  *
422
415
  * @param envelope - The EIP-7702 Transaction Envelope to hash.
@@ -424,7 +417,7 @@ export declare namespace getSignPayload {
424
417
  * @returns The hash of the transaction envelope.
425
418
  */
426
419
  export function hash<presign extends boolean = false>(
427
- envelope: TransactionEnvelopeEip7702<presign extends true ? false : true>,
420
+ envelope: TxEnvelopeEip7702<presign extends true ? false : true>,
428
421
  options: hash.Options<presign> = {},
429
422
  ): hash.ReturnType {
430
423
  const { presign } = options
@@ -457,12 +450,12 @@ export declare namespace hash {
457
450
  }
458
451
 
459
452
  /**
460
- * Serializes a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702}.
453
+ * Serializes a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702}.
461
454
  *
462
455
  * @example
463
456
  * ```ts twoslash
464
457
  * // @noErrors
465
- * import { Authorization, Secp256k1, TransactionEnvelopeEip7702, Value } from 'ox'
458
+ * import { Authorization, Secp256k1, TxEnvelopeEip7702, Value } from 'ox'
466
459
  *
467
460
  * const authorization = Authorization.from({
468
461
  * address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
@@ -477,7 +470,7 @@ export declare namespace hash {
477
470
  *
478
471
  * const authorizationList = [Authorization.from(authorization, { signature })]
479
472
  *
480
- * const envelope = TransactionEnvelopeEip7702.from({
473
+ * const envelope = TxEnvelopeEip7702.from({
481
474
  * authorizationList,
482
475
  * chainId: 1,
483
476
  * maxFeePerGas: Value.fromGwei('10'),
@@ -485,7 +478,7 @@ export declare namespace hash {
485
478
  * value: Value.fromEther('1'),
486
479
  * })
487
480
  *
488
- * const serialized = TransactionEnvelopeEip7702.serialize(envelope) // [!code focus]
481
+ * const serialized = TxEnvelopeEip7702.serialize(envelope) // [!code focus]
489
482
  * ```
490
483
  *
491
484
  * @example
@@ -495,9 +488,9 @@ export declare namespace hash {
495
488
  *
496
489
  * ```ts twoslash
497
490
  * // @noErrors
498
- * import { Secp256k1, TransactionEnvelopeEip7702, Value } from 'ox'
491
+ * import { Secp256k1, TxEnvelopeEip7702, Value } from 'ox'
499
492
  *
500
- * const envelope = TransactionEnvelopeEip7702.from({
493
+ * const envelope = TxEnvelopeEip7702.from({
501
494
  * authorizationList: [...],
502
495
  * chainId: 1,
503
496
  * maxFeePerGas: Value.fromGwei('10'),
@@ -506,11 +499,11 @@ export declare namespace hash {
506
499
  * })
507
500
  *
508
501
  * const signature = Secp256k1.sign({
509
- * payload: TransactionEnvelopeEip7702.getSignPayload(envelope),
502
+ * payload: TxEnvelopeEip7702.getSignPayload(envelope),
510
503
  * privateKey: '0x...',
511
504
  * })
512
505
  *
513
- * const serialized = TransactionEnvelopeEip7702.serialize(envelope, { // [!code focus]
506
+ * const serialized = TxEnvelopeEip7702.serialize(envelope, { // [!code focus]
514
507
  * signature, // [!code focus]
515
508
  * }) // [!code focus]
516
509
  *
@@ -522,7 +515,7 @@ export declare namespace hash {
522
515
  * @returns The serialized Transaction Envelope.
523
516
  */
524
517
  export function serialize(
525
- envelope: PartialBy<TransactionEnvelopeEip7702, 'type'>,
518
+ envelope: PartialBy<TxEnvelopeEip7702, 'type'>,
526
519
  options: serialize.Options = {},
527
520
  ): Serialized {
528
521
  const {
@@ -579,13 +572,13 @@ export declare namespace serialize {
579
572
  }
580
573
 
581
574
  /**
582
- * Validates a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702}. Returns `true` if the envelope is valid, `false` otherwise.
575
+ * Validates a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702}. Returns `true` if the envelope is valid, `false` otherwise.
583
576
  *
584
577
  * @example
585
578
  * ```ts twoslash
586
- * import { TransactionEnvelopeEip7702, Value } from 'ox'
579
+ * import { TxEnvelopeEip7702, Value } from 'ox'
587
580
  *
588
- * const valid = TransactionEnvelopeEip7702.validate({
581
+ * const valid = TxEnvelopeEip7702.validate({
589
582
  * authorizationList: [],
590
583
  * maxFeePerGas: 2n ** 256n - 1n + 1n,
591
584
  * chainId: 1,
@@ -597,9 +590,7 @@ export declare namespace serialize {
597
590
  *
598
591
  * @param envelope - The transaction envelope to validate.
599
592
  */
600
- export function validate(
601
- envelope: PartialBy<TransactionEnvelopeEip7702, 'type'>,
602
- ) {
593
+ export function validate(envelope: PartialBy<TxEnvelopeEip7702, 'type'>) {
603
594
  try {
604
595
  assert(envelope)
605
596
  return true