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
@@ -7,8 +7,8 @@ import * as Hex from './Hex.js';
7
7
  import type { Assign, Compute, PartialBy, UnionPartialBy } from './internal/types.js';
8
8
  import * as Rlp from './Rlp.js';
9
9
  import * as Signature from './Signature.js';
10
- import * as TransactionEnvelope from './TransactionEnvelope.js';
11
- export type TransactionEnvelopeEip7702<signed extends boolean = boolean, bigintType = bigint, numberType = number, type extends string = Type> = Compute<TransactionEnvelope.Base<type, signed, bigintType, numberType> & {
10
+ import * as TransactionEnvelope from './TxEnvelope.js';
11
+ export type TxEnvelopeEip7702<signed extends boolean = boolean, bigintType = bigint, numberType = number, type extends string = Type> = Compute<TransactionEnvelope.Base<type, signed, bigintType, numberType> & {
12
12
  /** EIP-2930 Access List. */
13
13
  accessList?: AccessList.AccessList | undefined;
14
14
  /** EIP-7702 Authorization List. */
@@ -18,21 +18,21 @@ export type TransactionEnvelopeEip7702<signed extends boolean = boolean, bigintT
18
18
  /** Max priority fee per gas (in wei). */
19
19
  maxPriorityFeePerGas?: bigintType | undefined;
20
20
  }>;
21
- export type Rpc<signed extends boolean = boolean> = TransactionEnvelopeEip7702<signed, Hex.Hex, Hex.Hex, '0x4'>;
21
+ export type Rpc<signed extends boolean = boolean> = TxEnvelopeEip7702<signed, Hex.Hex, Hex.Hex, '0x4'>;
22
22
  export type Serialized = `${SerializedType}${string}`;
23
- export type Signed = TransactionEnvelopeEip7702<true>;
23
+ export type Signed = TxEnvelopeEip7702<true>;
24
24
  export declare const serializedType: "0x04";
25
25
  export type SerializedType = typeof serializedType;
26
26
  export declare const type: "eip7702";
27
27
  export type Type = typeof type;
28
28
  /**
29
- * Asserts a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702} is valid.
29
+ * Asserts a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702} is valid.
30
30
  *
31
31
  * @example
32
32
  * ```ts twoslash
33
- * import { TransactionEnvelopeEip7702, Value } from 'ox'
33
+ * import { TxEnvelopeEip7702, Value } from 'ox'
34
34
  *
35
- * TransactionEnvelopeEip7702.assert({
35
+ * TxEnvelopeEip7702.assert({
36
36
  * authorizationList: [],
37
37
  * maxFeePerGas: 2n ** 256n - 1n + 1n,
38
38
  * chainId: 1,
@@ -46,18 +46,18 @@ export type Type = typeof type;
46
46
  *
47
47
  * @param envelope - The transaction envelope to assert.
48
48
  */
49
- export declare function assert(envelope: PartialBy<TransactionEnvelopeEip7702, 'type'>): void;
49
+ export declare function assert(envelope: PartialBy<TxEnvelopeEip7702, 'type'>): void;
50
50
  export declare namespace assert {
51
51
  type ErrorType = Address.assert.ErrorType | TransactionEnvelope.InvalidChainIdError | Errors.GlobalErrorType;
52
52
  }
53
53
  /**
54
- * Deserializes a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702} from its serialized form.
54
+ * Deserializes a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702} from its serialized form.
55
55
  *
56
56
  * @example
57
57
  * ```ts twoslash
58
- * import { TransactionEnvelopeEip7702 } from 'ox'
58
+ * import { TxEnvelopeEip7702 } from 'ox'
59
59
  *
60
- * const envelope = TransactionEnvelopeEip7702.deserialize('0x04ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
60
+ * const envelope = TxEnvelopeEip7702.deserialize('0x04ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
61
61
  * // @log: {
62
62
  * // @log: authorizationList: [...],
63
63
  * // @log: type: 'eip7702',
@@ -72,7 +72,7 @@ export declare namespace assert {
72
72
  * @param serialized - The serialized transaction.
73
73
  * @returns Deserialized Transaction Envelope.
74
74
  */
75
- export declare function deserialize(serialized: Serialized): Compute<TransactionEnvelopeEip7702>;
75
+ export declare function deserialize(serialized: Serialized): Compute<TxEnvelopeEip7702>;
76
76
  export declare namespace deserialize {
77
77
  type ErrorType = Errors.GlobalErrorType;
78
78
  }
@@ -81,7 +81,7 @@ export declare namespace deserialize {
81
81
  *
82
82
  * @example
83
83
  * ```ts twoslash
84
- * import { Authorization, Secp256k1, TransactionEnvelopeEip7702, Value } from 'ox'
84
+ * import { Authorization, Secp256k1, TxEnvelopeEip7702, Value } from 'ox'
85
85
  *
86
86
  * const authorization = Authorization.from({
87
87
  * address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
@@ -96,7 +96,7 @@ export declare namespace deserialize {
96
96
  *
97
97
  * const authorizationList = [Authorization.from(authorization, { signature })]
98
98
  *
99
- * const envelope = TransactionEnvelopeEip7702.from({ // [!code focus]
99
+ * const envelope = TxEnvelopeEip7702.from({ // [!code focus]
100
100
  * authorizationList, // [!code focus]
101
101
  * chainId: 1, // [!code focus]
102
102
  * maxFeePerGas: Value.fromGwei('10'), // [!code focus]
@@ -113,9 +113,9 @@ export declare namespace deserialize {
113
113
  *
114
114
  * ```ts twoslash
115
115
  * // @noErrors
116
- * import { Secp256k1, TransactionEnvelopeEip7702, Value } from 'ox'
116
+ * import { Secp256k1, TxEnvelopeEip7702, Value } from 'ox'
117
117
  *
118
- * const envelope = TransactionEnvelopeEip7702.from({
118
+ * const envelope = TxEnvelopeEip7702.from({
119
119
  * authorizationList: [...],
120
120
  * chainId: 1,
121
121
  * maxFeePerGas: Value.fromGwei('10'),
@@ -125,11 +125,11 @@ export declare namespace deserialize {
125
125
  * })
126
126
  *
127
127
  * const signature = Secp256k1.sign({
128
- * payload: TransactionEnvelopeEip7702.getSignPayload(envelope),
128
+ * payload: TxEnvelopeEip7702.getSignPayload(envelope),
129
129
  * privateKey: '0x...',
130
130
  * })
131
131
  *
132
- * const envelope_signed = TransactionEnvelopeEip7702.from(envelope, { // [!code focus]
132
+ * const envelope_signed = TxEnvelopeEip7702.from(envelope, { // [!code focus]
133
133
  * signature, // [!code focus]
134
134
  * }) // [!code focus]
135
135
  * // @log: {
@@ -149,12 +149,12 @@ export declare namespace deserialize {
149
149
  * @example
150
150
  * ### From Serialized
151
151
  *
152
- * It is possible to instantiate an EIP-7702 Transaction Envelope from a {@link ox#TransactionEnvelopeEip7702.Serialized} value.
152
+ * It is possible to instantiate an EIP-7702 Transaction Envelope from a {@link ox#TxEnvelopeEip7702.Serialized} value.
153
153
  *
154
154
  * ```ts twoslash
155
- * import { TransactionEnvelopeEip7702 } from 'ox'
155
+ * import { TxEnvelopeEip7702 } from 'ox'
156
156
  *
157
- * const envelope = TransactionEnvelopeEip7702.from('0x04f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
157
+ * const envelope = TxEnvelopeEip7702.from('0x04f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
158
158
  * // @log: {
159
159
  * // @log: authorizationList: [...],
160
160
  * // @log: chainId: 1,
@@ -169,18 +169,18 @@ export declare namespace deserialize {
169
169
  * @param options - Options.
170
170
  * @returns An EIP-7702 Transaction Envelope.
171
171
  */
172
- export declare function from<const envelope extends UnionPartialBy<TransactionEnvelopeEip7702, 'type'> | Serialized, const signature extends Signature.Signature | undefined = undefined>(envelope: envelope | UnionPartialBy<TransactionEnvelopeEip7702, 'type'> | Serialized, options?: from.Options<signature>): from.ReturnType<envelope, signature>;
172
+ export declare function from<const envelope extends UnionPartialBy<TxEnvelopeEip7702, 'type'> | Serialized, const signature extends Signature.Signature | undefined = undefined>(envelope: envelope | UnionPartialBy<TxEnvelopeEip7702, 'type'> | Serialized, options?: from.Options<signature>): from.ReturnType<envelope, signature>;
173
173
  export declare namespace from {
174
174
  type Options<signature extends Signature.Signature | undefined = undefined> = {
175
175
  signature?: signature | Signature.Signature | undefined;
176
176
  };
177
- type ReturnType<envelope extends UnionPartialBy<TransactionEnvelopeEip7702, 'type'> | Hex.Hex = TransactionEnvelopeEip7702 | Hex.Hex, signature extends Signature.Signature | undefined = undefined> = Compute<envelope extends Hex.Hex ? TransactionEnvelopeEip7702 : Assign<envelope, (signature extends Signature.Signature ? Readonly<signature> : {}) & {
177
+ type ReturnType<envelope extends UnionPartialBy<TxEnvelopeEip7702, 'type'> | Hex.Hex = TxEnvelopeEip7702 | Hex.Hex, signature extends Signature.Signature | undefined = undefined> = Compute<envelope extends Hex.Hex ? TxEnvelopeEip7702 : Assign<envelope, (signature extends Signature.Signature ? Readonly<signature> : {}) & {
178
178
  readonly type: 'eip7702';
179
179
  }>>;
180
180
  type ErrorType = deserialize.ErrorType | assert.ErrorType | Errors.GlobalErrorType;
181
181
  }
182
182
  /**
183
- * Returns the payload to sign for a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702}.
183
+ * Returns the payload to sign for a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702}.
184
184
  *
185
185
  * @example
186
186
  * The example below demonstrates how to compute the sign payload which can be used
@@ -188,9 +188,9 @@ export declare namespace from {
188
188
  *
189
189
  * ```ts twoslash
190
190
  * // @noErrors
191
- * import { Secp256k1, TransactionEnvelopeEip7702 } from 'ox'
191
+ * import { Secp256k1, TxEnvelopeEip7702 } from 'ox'
192
192
  *
193
- * const envelope = TransactionEnvelopeEip7702.from({
193
+ * const envelope = TxEnvelopeEip7702.from({
194
194
  * authorizationList: [...],
195
195
  * chainId: 1,
196
196
  * nonce: 0n,
@@ -200,7 +200,7 @@ export declare namespace from {
200
200
  * value: 1000000000000000000n,
201
201
  * })
202
202
  *
203
- * const payload = TransactionEnvelopeEip7702.getSignPayload(envelope) // [!code focus]
203
+ * const payload = TxEnvelopeEip7702.getSignPayload(envelope) // [!code focus]
204
204
  * // @log: '0x...'
205
205
  *
206
206
  * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
@@ -209,20 +209,20 @@ export declare namespace from {
209
209
  * @param envelope - The transaction envelope to get the sign payload for.
210
210
  * @returns The sign payload.
211
211
  */
212
- export declare function getSignPayload(envelope: TransactionEnvelopeEip7702): getSignPayload.ReturnType;
212
+ export declare function getSignPayload(envelope: TxEnvelopeEip7702): getSignPayload.ReturnType;
213
213
  export declare namespace getSignPayload {
214
214
  type ReturnType = Hex.Hex;
215
215
  type ErrorType = hash.ErrorType | Errors.GlobalErrorType;
216
216
  }
217
217
  /**
218
- * Hashes a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702}. This is the "transaction hash".
218
+ * Hashes a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702}. This is the "transaction hash".
219
219
  *
220
220
  * @example
221
221
  * ```ts twoslash
222
222
  * // @noErrors
223
- * import { Secp256k1, TransactionEnvelopeEip7702 } from 'ox'
223
+ * import { Secp256k1, TxEnvelopeEip7702 } from 'ox'
224
224
  *
225
- * const envelope = TransactionEnvelopeEip7702.from({
225
+ * const envelope = TxEnvelopeEip7702.from({
226
226
  * authorizationList: [...],
227
227
  * chainId: 1,
228
228
  * nonce: 0n,
@@ -233,20 +233,20 @@ export declare namespace getSignPayload {
233
233
  * })
234
234
  *
235
235
  * const signature = Secp256k1.sign({
236
- * payload: TransactionEnvelopeEip7702.getSignPayload(envelope),
236
+ * payload: TxEnvelopeEip7702.getSignPayload(envelope),
237
237
  * privateKey: '0x...'
238
238
  * })
239
239
  *
240
- * const envelope_signed = TransactionEnvelopeEip7702.from(envelope, { signature })
240
+ * const envelope_signed = TxEnvelopeEip7702.from(envelope, { signature })
241
241
  *
242
- * const hash = TransactionEnvelopeEip7702.hash(envelope_signed) // [!code focus]
242
+ * const hash = TxEnvelopeEip7702.hash(envelope_signed) // [!code focus]
243
243
  * ```
244
244
  *
245
245
  * @param envelope - The EIP-7702 Transaction Envelope to hash.
246
246
  * @param options - Options.
247
247
  * @returns The hash of the transaction envelope.
248
248
  */
249
- export declare function hash<presign extends boolean = false>(envelope: TransactionEnvelopeEip7702<presign extends true ? false : true>, options?: hash.Options<presign>): hash.ReturnType;
249
+ export declare function hash<presign extends boolean = false>(envelope: TxEnvelopeEip7702<presign extends true ? false : true>, options?: hash.Options<presign>): hash.ReturnType;
250
250
  export declare namespace hash {
251
251
  type Options<presign extends boolean = false> = {
252
252
  /** Whether to hash this transaction for signing. @default false */
@@ -256,12 +256,12 @@ export declare namespace hash {
256
256
  type ErrorType = Hash.keccak256.ErrorType | serialize.ErrorType | Errors.GlobalErrorType;
257
257
  }
258
258
  /**
259
- * Serializes a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702}.
259
+ * Serializes a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702}.
260
260
  *
261
261
  * @example
262
262
  * ```ts twoslash
263
263
  * // @noErrors
264
- * import { Authorization, Secp256k1, TransactionEnvelopeEip7702, Value } from 'ox'
264
+ * import { Authorization, Secp256k1, TxEnvelopeEip7702, Value } from 'ox'
265
265
  *
266
266
  * const authorization = Authorization.from({
267
267
  * address: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
@@ -276,7 +276,7 @@ export declare namespace hash {
276
276
  *
277
277
  * const authorizationList = [Authorization.from(authorization, { signature })]
278
278
  *
279
- * const envelope = TransactionEnvelopeEip7702.from({
279
+ * const envelope = TxEnvelopeEip7702.from({
280
280
  * authorizationList,
281
281
  * chainId: 1,
282
282
  * maxFeePerGas: Value.fromGwei('10'),
@@ -284,7 +284,7 @@ export declare namespace hash {
284
284
  * value: Value.fromEther('1'),
285
285
  * })
286
286
  *
287
- * const serialized = TransactionEnvelopeEip7702.serialize(envelope) // [!code focus]
287
+ * const serialized = TxEnvelopeEip7702.serialize(envelope) // [!code focus]
288
288
  * ```
289
289
  *
290
290
  * @example
@@ -294,9 +294,9 @@ export declare namespace hash {
294
294
  *
295
295
  * ```ts twoslash
296
296
  * // @noErrors
297
- * import { Secp256k1, TransactionEnvelopeEip7702, Value } from 'ox'
297
+ * import { Secp256k1, TxEnvelopeEip7702, Value } from 'ox'
298
298
  *
299
- * const envelope = TransactionEnvelopeEip7702.from({
299
+ * const envelope = TxEnvelopeEip7702.from({
300
300
  * authorizationList: [...],
301
301
  * chainId: 1,
302
302
  * maxFeePerGas: Value.fromGwei('10'),
@@ -305,11 +305,11 @@ export declare namespace hash {
305
305
  * })
306
306
  *
307
307
  * const signature = Secp256k1.sign({
308
- * payload: TransactionEnvelopeEip7702.getSignPayload(envelope),
308
+ * payload: TxEnvelopeEip7702.getSignPayload(envelope),
309
309
  * privateKey: '0x...',
310
310
  * })
311
311
  *
312
- * const serialized = TransactionEnvelopeEip7702.serialize(envelope, { // [!code focus]
312
+ * const serialized = TxEnvelopeEip7702.serialize(envelope, { // [!code focus]
313
313
  * signature, // [!code focus]
314
314
  * }) // [!code focus]
315
315
  *
@@ -320,7 +320,7 @@ export declare namespace hash {
320
320
  * @param options - Options.
321
321
  * @returns The serialized Transaction Envelope.
322
322
  */
323
- export declare function serialize(envelope: PartialBy<TransactionEnvelopeEip7702, 'type'>, options?: serialize.Options): Serialized;
323
+ export declare function serialize(envelope: PartialBy<TxEnvelopeEip7702, 'type'>, options?: serialize.Options): Serialized;
324
324
  export declare namespace serialize {
325
325
  type Options = {
326
326
  /** Signature to append to the serialized Transaction Envelope. */
@@ -329,13 +329,13 @@ export declare namespace serialize {
329
329
  type ErrorType = assert.ErrorType | Hex.fromNumber.ErrorType | Signature.toTuple.ErrorType | Hex.concat.ErrorType | Rlp.fromHex.ErrorType | Errors.GlobalErrorType;
330
330
  }
331
331
  /**
332
- * Validates a {@link ox#TransactionEnvelopeEip7702.TransactionEnvelopeEip7702}. Returns `true` if the envelope is valid, `false` otherwise.
332
+ * Validates a {@link ox#TxEnvelopeEip7702.TxEnvelopeEip7702}. Returns `true` if the envelope is valid, `false` otherwise.
333
333
  *
334
334
  * @example
335
335
  * ```ts twoslash
336
- * import { TransactionEnvelopeEip7702, Value } from 'ox'
336
+ * import { TxEnvelopeEip7702, Value } from 'ox'
337
337
  *
338
- * const valid = TransactionEnvelopeEip7702.validate({
338
+ * const valid = TxEnvelopeEip7702.validate({
339
339
  * authorizationList: [],
340
340
  * maxFeePerGas: 2n ** 256n - 1n + 1n,
341
341
  * chainId: 1,
@@ -347,8 +347,8 @@ export declare namespace serialize {
347
347
  *
348
348
  * @param envelope - The transaction envelope to validate.
349
349
  */
350
- export declare function validate(envelope: PartialBy<TransactionEnvelopeEip7702, 'type'>): boolean;
350
+ export declare function validate(envelope: PartialBy<TxEnvelopeEip7702, 'type'>): boolean;
351
351
  export declare namespace validate {
352
352
  type ErrorType = Errors.GlobalErrorType;
353
353
  }
354
- //# sourceMappingURL=TransactionEnvelopeEip7702.d.ts.map
354
+ //# sourceMappingURL=TxEnvelopeEip7702.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TxEnvelopeEip7702.d.ts","sourceRoot":"","sources":["../../core/TxEnvelopeEip7702.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,C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,OAAO,CAAC,OAAO,SAAS,OAAO,GAAG,KAAK,IAAI;QAC9C,mEAAmE;QACnE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAA;KACxC,CAAA;IAED,KAAK,UAAU,GAAG,GAAG,CAAC,GAAG,CAAA;IAEzB,KAAK,SAAS,GACV,IAAI,CAAC,SAAS,CAAC,SAAS,GACxB,SAAS,CAAC,SAAS,GACnB,MAAM,CAAC,eAAe,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,SAAS,CAAC,iBAAiB,EAAE,MAAM,CAAC,EAC9C,OAAO,GAAE,SAAS,CAAC,OAAY,GAC9B,UAAU,CAqCZ;AAED,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,KAAK,OAAO,GAAG;QACb,kEAAkE;QAClE,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,GAAG,SAAS,CAAA;KAC5C,CAAA;IAED,KAAK,SAAS,GACV,MAAM,CAAC,SAAS,GAChB,GAAG,CAAC,UAAU,CAAC,SAAS,GACxB,SAAS,CAAC,OAAO,CAAC,SAAS,GAC3B,GAAG,CAAC,MAAM,CAAC,SAAS,GACpB,GAAG,CAAC,OAAO,CAAC,SAAS,GACrB,MAAM,CAAC,eAAe,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,iBAAiB,EAAE,MAAM,CAAC,WAOtE;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,KAAK,SAAS,GAAG,MAAM,CAAC,eAAe,CAAA;CACxC"}
@@ -5,24 +5,24 @@ import * as Hex from './Hex.js';
5
5
  import type { Assign, Branded, Compute, PartialBy, UnionPartialBy } from './internal/types.js';
6
6
  import * as Rlp from './Rlp.js';
7
7
  import * as Signature from './Signature.js';
8
- import * as TransactionEnvelope from './TransactionEnvelope.js';
9
- export type TransactionEnvelopeLegacy<signed extends boolean = boolean, bigintType = bigint, numberType = number, type extends string = Type> = Compute<PartialBy<TransactionEnvelope.Base<type, signed, bigintType, numberType>, 'chainId'> & {
8
+ import * as TransactionEnvelope from './TxEnvelope.js';
9
+ export type TxEnvelopeLegacy<signed extends boolean = boolean, bigintType = bigint, numberType = number, type extends string = Type> = Compute<PartialBy<TransactionEnvelope.Base<type, signed, bigintType, numberType>, 'chainId'> & {
10
10
  /** Base fee per gas. */
11
11
  gasPrice?: bigintType | undefined;
12
12
  }>;
13
- export type Rpc<signed extends boolean = boolean> = TransactionEnvelopeLegacy<signed, Hex.Hex, Hex.Hex, '0x0'>;
13
+ export type Rpc<signed extends boolean = boolean> = TxEnvelopeLegacy<signed, Hex.Hex, Hex.Hex, '0x0'>;
14
14
  export type Serialized = Branded<`0x${string}`, 'legacy'>;
15
- export type Signed = TransactionEnvelopeLegacy<true>;
15
+ export type Signed = TxEnvelopeLegacy<true>;
16
16
  export declare const type = "legacy";
17
17
  export type Type = typeof type;
18
18
  /**
19
- * Asserts a {@link ox#TransactionEnvelopeLegacy.TransactionEnvelopeLegacy} is valid.
19
+ * Asserts a {@link ox#TxEnvelopeLegacy.TxEnvelopeLegacy} is valid.
20
20
  *
21
21
  * @example
22
22
  * ```ts twoslash
23
- * import { TransactionEnvelopeLegacy, Value } from 'ox'
23
+ * import { TxEnvelopeLegacy, Value } from 'ox'
24
24
  *
25
- * TransactionEnvelopeLegacy.assert({
25
+ * TxEnvelopeLegacy.assert({
26
26
  * gasPrice: 2n ** 256n - 1n + 1n,
27
27
  * chainId: 1,
28
28
  * to: '0x0000000000000000000000000000000000000000',
@@ -35,18 +35,18 @@ export type Type = typeof type;
35
35
  *
36
36
  * @param envelope - The transaction envelope to assert.
37
37
  */
38
- export declare function assert(envelope: PartialBy<TransactionEnvelopeLegacy, 'type'>): void;
38
+ export declare function assert(envelope: PartialBy<TxEnvelopeLegacy, 'type'>): void;
39
39
  export declare namespace assert {
40
40
  type ErrorType = Address.assert.ErrorType | TransactionEnvelope.InvalidChainIdError | TransactionEnvelope.GasPriceTooHighError | Errors.GlobalErrorType;
41
41
  }
42
42
  /**
43
- * Deserializes a {@link ox#TransactionEnvelopeLegacy.TransactionEnvelopeLegacy} from its serialized form.
43
+ * Deserializes a {@link ox#TxEnvelopeLegacy.TxEnvelopeLegacy} from its serialized form.
44
44
  *
45
45
  * @example
46
46
  * ```ts twoslash
47
- * import { TransactionEnvelopeLegacy } from 'ox'
47
+ * import { TxEnvelopeLegacy } from 'ox'
48
48
  *
49
- * const envelope = TransactionEnvelopeLegacy.deserialize('0x01ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
49
+ * const envelope = TxEnvelopeLegacy.deserialize('0x01ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
50
50
  * // @log: {
51
51
  * // @log: type: 'legacy',
52
52
  * // @log: nonce: 785n,
@@ -60,7 +60,7 @@ export declare namespace assert {
60
60
  * @param serialized - The serialized transaction.
61
61
  * @returns Deserialized Transaction Envelope.
62
62
  */
63
- export declare function deserialize(serialized: Hex.Hex): Compute<TransactionEnvelopeLegacy>;
63
+ export declare function deserialize(serialized: Hex.Hex): Compute<TxEnvelopeLegacy>;
64
64
  export declare namespace deserialize {
65
65
  type ErrorType = Errors.GlobalErrorType;
66
66
  }
@@ -69,9 +69,9 @@ export declare namespace deserialize {
69
69
  *
70
70
  * @example
71
71
  * ```ts twoslash
72
- * import { TransactionEnvelopeLegacy, Value } from 'ox'
72
+ * import { TxEnvelopeLegacy, Value } from 'ox'
73
73
  *
74
- * const envelope = TransactionEnvelopeLegacy.from({
74
+ * const envelope = TxEnvelopeLegacy.from({
75
75
  * gasPrice: Value.fromGwei('10'),
76
76
  * to: '0x0000000000000000000000000000000000000000',
77
77
  * value: Value.fromEther('1'),
@@ -84,9 +84,9 @@ export declare namespace deserialize {
84
84
  * It is possible to attach a `signature` to the transaction envelope.
85
85
  *
86
86
  * ```ts twoslash
87
- * import { Secp256k1, TransactionEnvelopeLegacy, Value } from 'ox'
87
+ * import { Secp256k1, TxEnvelopeLegacy, Value } from 'ox'
88
88
  *
89
- * const envelope = TransactionEnvelopeLegacy.from({
89
+ * const envelope = TxEnvelopeLegacy.from({
90
90
  * chainId: 1,
91
91
  * gasPrice: Value.fromGwei('10'),
92
92
  * to: '0x0000000000000000000000000000000000000000',
@@ -94,11 +94,11 @@ export declare namespace deserialize {
94
94
  * })
95
95
  *
96
96
  * const signature = Secp256k1.sign({
97
- * payload: TransactionEnvelopeLegacy.getSignPayload(envelope),
97
+ * payload: TxEnvelopeLegacy.getSignPayload(envelope),
98
98
  * privateKey: '0x...',
99
99
  * })
100
100
  *
101
- * const envelope_signed = TransactionEnvelopeLegacy.from(envelope, { // [!code focus]
101
+ * const envelope_signed = TxEnvelopeLegacy.from(envelope, { // [!code focus]
102
102
  * signature, // [!code focus]
103
103
  * }) // [!code focus]
104
104
  * // @log: {
@@ -117,12 +117,12 @@ export declare namespace deserialize {
117
117
  * @example
118
118
  * ### From Serialized
119
119
  *
120
- * It is possible to instantiate an legacy Transaction Envelope from a {@link ox#TransactionEnvelopeLegacy.Serialized} value.
120
+ * It is possible to instantiate an legacy Transaction Envelope from a {@link ox#TxEnvelopeLegacy.Serialized} value.
121
121
  *
122
122
  * ```ts twoslash
123
- * import { TransactionEnvelopeLegacy } from 'ox'
123
+ * import { TxEnvelopeLegacy } from 'ox'
124
124
  *
125
- * const envelope = TransactionEnvelopeLegacy.from('0xf858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
125
+ * const envelope = TxEnvelopeLegacy.from('0xf858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
126
126
  * // @log: {
127
127
  * // @log: chainId: 1,
128
128
  * // @log: gasPrice: 10000000000n,
@@ -136,12 +136,12 @@ export declare namespace deserialize {
136
136
  * @param options - Options.
137
137
  * @returns A legacy Transaction Envelope.
138
138
  */
139
- export declare function from<const envelope extends UnionPartialBy<TransactionEnvelopeLegacy, 'type'> | Hex.Hex, const signature extends Signature.Signature | undefined = undefined>(envelope: envelope | UnionPartialBy<TransactionEnvelopeLegacy, 'type'> | Hex.Hex, options?: from.Options<signature>): from.ReturnType<envelope, signature>;
139
+ export declare function from<const envelope extends UnionPartialBy<TxEnvelopeLegacy, 'type'> | Hex.Hex, const signature extends Signature.Signature | undefined = undefined>(envelope: envelope | UnionPartialBy<TxEnvelopeLegacy, 'type'> | Hex.Hex, options?: from.Options<signature>): from.ReturnType<envelope, signature>;
140
140
  export declare namespace from {
141
141
  type Options<signature extends Signature.Signature | undefined = undefined> = {
142
142
  signature?: signature | Signature.Signature | undefined;
143
143
  };
144
- type ReturnType<envelope extends UnionPartialBy<TransactionEnvelopeLegacy, 'type'> | Hex.Hex = TransactionEnvelopeLegacy | Hex.Hex, signature extends Signature.Signature | undefined = undefined> = Compute<envelope extends Hex.Hex ? TransactionEnvelopeLegacy : Assign<envelope, (signature extends Signature.Signature ? Readonly<signature & {
144
+ type ReturnType<envelope extends UnionPartialBy<TxEnvelopeLegacy, 'type'> | Hex.Hex = TxEnvelopeLegacy | Hex.Hex, signature extends Signature.Signature | undefined = undefined> = Compute<envelope extends Hex.Hex ? TxEnvelopeLegacy : Assign<envelope, (signature extends Signature.Signature ? Readonly<signature & {
145
145
  v: signature['yParity'] extends 0 ? 27 : 28;
146
146
  }> : {}) & {
147
147
  readonly type: 'legacy';
@@ -149,7 +149,7 @@ export declare namespace from {
149
149
  type ErrorType = deserialize.ErrorType | assert.ErrorType | Errors.GlobalErrorType;
150
150
  }
151
151
  /**
152
- * Returns the payload to sign for a {@link ox#TransactionEnvelopeLegacy.TransactionEnvelopeLegacy}.
152
+ * Returns the payload to sign for a {@link ox#TxEnvelopeLegacy.TxEnvelopeLegacy}.
153
153
  *
154
154
  * @example
155
155
  * The example below demonstrates how to compute the sign payload which can be used
@@ -157,9 +157,9 @@ export declare namespace from {
157
157
  *
158
158
  * ```ts twoslash
159
159
  * // @noErrors
160
- * import { Secp256k1, TransactionEnvelopeLegacy } from 'ox'
160
+ * import { Secp256k1, TxEnvelopeLegacy } from 'ox'
161
161
  *
162
- * const envelope = TransactionEnvelopeLegacy.from({
162
+ * const envelope = TxEnvelopeLegacy.from({
163
163
  * nonce: 0n,
164
164
  * gasPrice: 1000000000n,
165
165
  * gas: 21000n,
@@ -167,7 +167,7 @@ export declare namespace from {
167
167
  * value: 1000000000000000000n,
168
168
  * })
169
169
  *
170
- * const payload = TransactionEnvelopeLegacy.getSignPayload(envelope) // [!code focus]
170
+ * const payload = TxEnvelopeLegacy.getSignPayload(envelope) // [!code focus]
171
171
  * // @log: '0x...'
172
172
  *
173
173
  * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
@@ -176,19 +176,19 @@ export declare namespace from {
176
176
  * @param envelope - The transaction envelope to get the sign payload for.
177
177
  * @returns The sign payload.
178
178
  */
179
- export declare function getSignPayload(envelope: TransactionEnvelopeLegacy<false>): getSignPayload.ReturnType;
179
+ export declare function getSignPayload(envelope: TxEnvelopeLegacy<false>): getSignPayload.ReturnType;
180
180
  export declare namespace getSignPayload {
181
181
  type ReturnType = Hex.Hex;
182
182
  type ErrorType = hash.ErrorType | Errors.GlobalErrorType;
183
183
  }
184
184
  /**
185
- * Hashes a {@link ox#TransactionEnvelopeLegacy.TransactionEnvelopeLegacy}. This is the "transaction hash".
185
+ * Hashes a {@link ox#TxEnvelopeLegacy.TxEnvelopeLegacy}. This is the "transaction hash".
186
186
  *
187
187
  * @example
188
188
  * ```ts twoslash
189
- * import { Secp256k1, TransactionEnvelopeLegacy } from 'ox'
189
+ * import { Secp256k1, TxEnvelopeLegacy } from 'ox'
190
190
  *
191
- * const envelope = TransactionEnvelopeLegacy.from({
191
+ * const envelope = TxEnvelopeLegacy.from({
192
192
  * chainId: 1,
193
193
  * nonce: 0n,
194
194
  * gasPrice: 1000000000n,
@@ -198,20 +198,20 @@ export declare namespace getSignPayload {
198
198
  * })
199
199
  *
200
200
  * const signature = Secp256k1.sign({
201
- * payload: TransactionEnvelopeLegacy.getSignPayload(envelope),
201
+ * payload: TxEnvelopeLegacy.getSignPayload(envelope),
202
202
  * privateKey: '0x...'
203
203
  * })
204
204
  *
205
- * const envelope_signed = TransactionEnvelopeLegacy.from(envelope, { signature })
205
+ * const envelope_signed = TxEnvelopeLegacy.from(envelope, { signature })
206
206
  *
207
- * const hash = TransactionEnvelopeLegacy.hash(envelope_signed) // [!code focus]
207
+ * const hash = TxEnvelopeLegacy.hash(envelope_signed) // [!code focus]
208
208
  * ```
209
209
  *
210
210
  * @param envelope - The Legacy Transaction Envelope to hash.
211
211
  * @param options - Options.
212
212
  * @returns The hash of the transaction envelope.
213
213
  */
214
- export declare function hash<presign extends boolean = false>(envelope: TransactionEnvelopeLegacy<presign extends true ? false : true>, options?: hash.Options<presign>): hash.ReturnType;
214
+ export declare function hash<presign extends boolean = false>(envelope: TxEnvelopeLegacy<presign extends true ? false : true>, options?: hash.Options<presign>): hash.ReturnType;
215
215
  export declare namespace hash {
216
216
  type Options<presign extends boolean = false> = {
217
217
  /** Whether to hash this transaction for signing. @default false */
@@ -221,21 +221,21 @@ export declare namespace hash {
221
221
  type ErrorType = Hash.keccak256.ErrorType | serialize.ErrorType | Errors.GlobalErrorType;
222
222
  }
223
223
  /**
224
- * Serializes a {@link ox#TransactionEnvelopeLegacy.TransactionEnvelopeLegacy}.
224
+ * Serializes a {@link ox#TxEnvelopeLegacy.TxEnvelopeLegacy}.
225
225
  *
226
226
  * @example
227
227
  * ```ts twoslash
228
228
  * // @noErrors
229
- * import { TransactionEnvelopeLegacy } from 'ox'
229
+ * import { TxEnvelopeLegacy } from 'ox'
230
230
  *
231
- * const envelope = TransactionEnvelopeLegacy.from({
231
+ * const envelope = TxEnvelopeLegacy.from({
232
232
  * chainId: 1,
233
233
  * gasPrice: Value.fromGwei('10'),
234
234
  * to: '0x0000000000000000000000000000000000000000',
235
235
  * value: Value.fromEther('1'),
236
236
  * })
237
237
  *
238
- * const serialized = TransactionEnvelopeLegacy.serialize(envelope) // [!code focus]
238
+ * const serialized = TxEnvelopeLegacy.serialize(envelope) // [!code focus]
239
239
  * ```
240
240
  *
241
241
  * @example
@@ -245,9 +245,9 @@ export declare namespace hash {
245
245
  *
246
246
  * ```ts twoslash
247
247
  * // @noErrors
248
- * import { Secp256k1, TransactionEnvelopeLegacy, Value } from 'ox'
248
+ * import { Secp256k1, TxEnvelopeLegacy, Value } from 'ox'
249
249
  *
250
- * const envelope = TransactionEnvelopeLegacy.from({
250
+ * const envelope = TxEnvelopeLegacy.from({
251
251
  * chainId: 1,
252
252
  * gasPrice: Value.fromGwei('10'),
253
253
  * to: '0x0000000000000000000000000000000000000000',
@@ -255,11 +255,11 @@ export declare namespace hash {
255
255
  * })
256
256
  *
257
257
  * const signature = Secp256k1.sign({
258
- * payload: TransactionEnvelopeLegacy.getSignPayload(envelope),
258
+ * payload: TxEnvelopeLegacy.getSignPayload(envelope),
259
259
  * privateKey: '0x...',
260
260
  * })
261
261
  *
262
- * const serialized = TransactionEnvelopeLegacy.serialize(envelope, { // [!code focus]
262
+ * const serialized = TxEnvelopeLegacy.serialize(envelope, { // [!code focus]
263
263
  * signature, // [!code focus]
264
264
  * }) // [!code focus]
265
265
  *
@@ -270,7 +270,7 @@ export declare namespace hash {
270
270
  * @param options - Options.
271
271
  * @returns The serialized Transaction Envelope.
272
272
  */
273
- export declare function serialize(envelope: PartialBy<TransactionEnvelopeLegacy, 'type'>, options?: serialize.Options): Serialized;
273
+ export declare function serialize(envelope: PartialBy<TxEnvelopeLegacy, 'type'>, options?: serialize.Options): Serialized;
274
274
  export declare namespace serialize {
275
275
  type Options = {
276
276
  /** Signature to append to the serialized Transaction Envelope. */
@@ -279,13 +279,13 @@ export declare namespace serialize {
279
279
  type ErrorType = assert.ErrorType | Hex.fromNumber.ErrorType | Hex.trimLeft.ErrorType | Rlp.fromHex.ErrorType | Signature.InvalidVError | Errors.GlobalErrorType;
280
280
  }
281
281
  /**
282
- * Converts an {@link ox#TransactionEnvelopeLegacy.TransactionEnvelopeLegacy} to an {@link ox#TransactionEnvelopeLegacy.Rpc}.
282
+ * Converts an {@link ox#TxEnvelopeLegacy.TxEnvelopeLegacy} to an {@link ox#TxEnvelopeLegacy.Rpc}.
283
283
  *
284
284
  * @example
285
285
  * ```ts twoslash
286
- * import { RpcRequest, TransactionEnvelopeLegacy, Value } from 'ox'
286
+ * import { RpcRequest, TxEnvelopeLegacy, Value } from 'ox'
287
287
  *
288
- * const envelope = TransactionEnvelopeLegacy.from({
288
+ * const envelope = TxEnvelopeLegacy.from({
289
289
  * chainId: 1,
290
290
  * nonce: 0n,
291
291
  * gas: 21000n,
@@ -293,7 +293,7 @@ export declare namespace serialize {
293
293
  * value: Value.fromEther('1'),
294
294
  * })
295
295
  *
296
- * const envelope_rpc = TransactionEnvelopeLegacy.toRpc(envelope) // [!code focus]
296
+ * const envelope_rpc = TxEnvelopeLegacy.toRpc(envelope) // [!code focus]
297
297
  *
298
298
  * const request = RpcRequest.from({
299
299
  * id: 0,
@@ -305,18 +305,18 @@ export declare namespace serialize {
305
305
  * @param envelope - The legacy transaction envelope to convert.
306
306
  * @returns An RPC-formatted legacy transaction envelope.
307
307
  */
308
- export declare function toRpc(envelope: Omit<TransactionEnvelopeLegacy, 'type'>): Rpc;
308
+ export declare function toRpc(envelope: Omit<TxEnvelopeLegacy, 'type'>): Rpc;
309
309
  export declare namespace toRpc {
310
310
  type ErrorType = Signature.extract.ErrorType | Errors.GlobalErrorType;
311
311
  }
312
312
  /**
313
- * Validates a {@link ox#TransactionEnvelopeLegacy.TransactionEnvelopeLegacy}. Returns `true` if the envelope is valid, `false` otherwise.
313
+ * Validates a {@link ox#TxEnvelopeLegacy.TxEnvelopeLegacy}. Returns `true` if the envelope is valid, `false` otherwise.
314
314
  *
315
315
  * @example
316
316
  * ```ts twoslash
317
- * import { TransactionEnvelopeLegacy, Value } from 'ox'
317
+ * import { TxEnvelopeLegacy, Value } from 'ox'
318
318
  *
319
- * const valid = TransactionEnvelopeLegacy.assert({
319
+ * const valid = TxEnvelopeLegacy.assert({
320
320
  * gasPrice: 2n ** 256n - 1n + 1n,
321
321
  * chainId: 1,
322
322
  * to: '0x0000000000000000000000000000000000000000',
@@ -327,8 +327,8 @@ export declare namespace toRpc {
327
327
  *
328
328
  * @param envelope - The transaction envelope to validate.
329
329
  */
330
- export declare function validate(envelope: PartialBy<TransactionEnvelopeLegacy, 'type'>): boolean;
330
+ export declare function validate(envelope: PartialBy<TxEnvelopeLegacy, 'type'>): boolean;
331
331
  export declare namespace validate {
332
332
  type ErrorType = Errors.GlobalErrorType;
333
333
  }
334
- //# sourceMappingURL=TransactionEnvelopeLegacy.d.ts.map
334
+ //# sourceMappingURL=TxEnvelopeLegacy.d.ts.map