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
@@ -6,8 +6,8 @@ import * as Hex from './Hex.js';
6
6
  import type { Assign, Compute, PartialBy, UnionPartialBy } from './internal/types.js';
7
7
  import * as Rlp from './Rlp.js';
8
8
  import * as Signature from './Signature.js';
9
- import * as TransactionEnvelope from './TransactionEnvelope.js';
10
- export type TransactionEnvelopeEip1559<signed extends boolean = boolean, bigintType = bigint, numberType = number, type extends string = Type> = Compute<TransactionEnvelope.Base<type, signed, bigintType, numberType> & {
9
+ import * as TransactionEnvelope from './TxEnvelope.js';
10
+ export type TxEnvelopeEip1559<signed extends boolean = boolean, bigintType = bigint, numberType = number, type extends string = Type> = Compute<TransactionEnvelope.Base<type, signed, bigintType, numberType> & {
11
11
  /** EIP-2930 Access List. */
12
12
  accessList?: AccessList.AccessList | undefined;
13
13
  /** Total fee per gas in wei (gasPrice/baseFeePerGas + maxPriorityFeePerGas). */
@@ -15,21 +15,21 @@ export type TransactionEnvelopeEip1559<signed extends boolean = boolean, bigintT
15
15
  /** Max priority fee per gas (in wei). */
16
16
  maxPriorityFeePerGas?: bigintType | undefined;
17
17
  }>;
18
- export type Rpc<signed extends boolean = boolean> = TransactionEnvelopeEip1559<signed, Hex.Hex, Hex.Hex, '0x2'>;
18
+ export type Rpc<signed extends boolean = boolean> = TxEnvelopeEip1559<signed, Hex.Hex, Hex.Hex, '0x2'>;
19
19
  export type Serialized = `${SerializedType}${string}`;
20
20
  export declare const serializedType: "0x02";
21
21
  export type SerializedType = typeof serializedType;
22
- export type Signed = TransactionEnvelopeEip1559<true>;
22
+ export type Signed = TxEnvelopeEip1559<true>;
23
23
  export declare const type: "eip1559";
24
24
  export type Type = typeof type;
25
25
  /**
26
- * Asserts a {@link ox#TransactionEnvelopeEip1559.TransactionEnvelopeEip1559} is valid.
26
+ * Asserts a {@link ox#TxEnvelopeEip1559.TxEnvelopeEip1559} is valid.
27
27
  *
28
28
  * @example
29
29
  * ```ts twoslash
30
- * import { TransactionEnvelopeEip1559, Value } from 'ox'
30
+ * import { TxEnvelopeEip1559, Value } from 'ox'
31
31
  *
32
- * TransactionEnvelopeEip1559.assert({
32
+ * TxEnvelopeEip1559.assert({
33
33
  * maxFeePerGas: 2n ** 256n - 1n + 1n,
34
34
  * chainId: 1,
35
35
  * to: '0x0000000000000000000000000000000000000000',
@@ -42,18 +42,18 @@ export type Type = typeof type;
42
42
  *
43
43
  * @param envelope - The transaction envelope to assert.
44
44
  */
45
- export declare function assert(envelope: PartialBy<TransactionEnvelopeEip1559, 'type'>): void;
45
+ export declare function assert(envelope: PartialBy<TxEnvelopeEip1559, 'type'>): void;
46
46
  export declare namespace assert {
47
47
  type ErrorType = Address.assert.ErrorType | TransactionEnvelope.InvalidChainIdError | TransactionEnvelope.FeeCapTooHighError | TransactionEnvelope.TipAboveFeeCapError | Errors.GlobalErrorType;
48
48
  }
49
49
  /**
50
- * Deserializes a {@link ox#TransactionEnvelopeEip1559.TransactionEnvelopeEip1559} from its serialized form.
50
+ * Deserializes a {@link ox#TxEnvelopeEip1559.TxEnvelopeEip1559} from its serialized form.
51
51
  *
52
52
  * @example
53
53
  * ```ts twoslash
54
- * import { TransactionEnvelopeEip1559 } from 'ox'
54
+ * import { TxEnvelopeEip1559 } from 'ox'
55
55
  *
56
- * const envelope = TransactionEnvelopeEip1559.deserialize('0x02ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
56
+ * const envelope = TxEnvelopeEip1559.deserialize('0x02ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
57
57
  * // @log: {
58
58
  * // @log: type: 'eip1559',
59
59
  * // @log: nonce: 785n,
@@ -67,7 +67,7 @@ export declare namespace assert {
67
67
  * @param serialized - The serialized transaction.
68
68
  * @returns Deserialized Transaction Envelope.
69
69
  */
70
- export declare function deserialize(serialized: Serialized): Compute<TransactionEnvelopeEip1559>;
70
+ export declare function deserialize(serialized: Serialized): Compute<TxEnvelopeEip1559>;
71
71
  export declare namespace deserialize {
72
72
  type ErrorType = Errors.GlobalErrorType;
73
73
  }
@@ -76,9 +76,9 @@ export declare namespace deserialize {
76
76
  *
77
77
  * @example
78
78
  * ```ts twoslash
79
- * import { TransactionEnvelopeEip1559, Value } from 'ox'
79
+ * import { TxEnvelopeEip1559, Value } from 'ox'
80
80
  *
81
- * const envelope = TransactionEnvelopeEip1559.from({
81
+ * const envelope = TxEnvelopeEip1559.from({
82
82
  * chainId: 1,
83
83
  * maxFeePerGas: Value.fromGwei('10'),
84
84
  * maxPriorityFeePerGas: Value.fromGwei('1'),
@@ -93,9 +93,9 @@ export declare namespace deserialize {
93
93
  * It is possible to attach a `signature` to the transaction envelope.
94
94
  *
95
95
  * ```ts twoslash
96
- * import { Secp256k1, TransactionEnvelopeEip1559, Value } from 'ox'
96
+ * import { Secp256k1, TxEnvelopeEip1559, Value } from 'ox'
97
97
  *
98
- * const envelope = TransactionEnvelopeEip1559.from({
98
+ * const envelope = TxEnvelopeEip1559.from({
99
99
  * chainId: 1,
100
100
  * maxFeePerGas: Value.fromGwei('10'),
101
101
  * maxPriorityFeePerGas: Value.fromGwei('1'),
@@ -104,11 +104,11 @@ export declare namespace deserialize {
104
104
  * })
105
105
  *
106
106
  * const signature = Secp256k1.sign({
107
- * payload: TransactionEnvelopeEip1559.getSignPayload(envelope),
107
+ * payload: TxEnvelopeEip1559.getSignPayload(envelope),
108
108
  * privateKey: '0x...',
109
109
  * })
110
110
  *
111
- * const envelope_signed = TransactionEnvelopeEip1559.from(envelope, { // [!code focus]
111
+ * const envelope_signed = TxEnvelopeEip1559.from(envelope, { // [!code focus]
112
112
  * signature, // [!code focus]
113
113
  * }) // [!code focus]
114
114
  * // @log: {
@@ -127,12 +127,12 @@ export declare namespace deserialize {
127
127
  * @example
128
128
  * ### From Serialized
129
129
  *
130
- * It is possible to instantiate an EIP-1559 Transaction Envelope from a {@link ox#TransactionEnvelopeEip1559.Serialized} value.
130
+ * It is possible to instantiate an EIP-1559 Transaction Envelope from a {@link ox#TxEnvelopeEip1559.Serialized} value.
131
131
  *
132
132
  * ```ts twoslash
133
- * import { TransactionEnvelopeEip1559 } from 'ox'
133
+ * import { TxEnvelopeEip1559 } from 'ox'
134
134
  *
135
- * const envelope = TransactionEnvelopeEip1559.from('0x02f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
135
+ * const envelope = TxEnvelopeEip1559.from('0x02f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
136
136
  * // @log: {
137
137
  * // @log: chainId: 1,
138
138
  * // @log: maxFeePerGas: 10000000000n,
@@ -147,27 +147,27 @@ export declare namespace deserialize {
147
147
  * @param options - Options.
148
148
  * @returns An EIP-1559 Transaction Envelope.
149
149
  */
150
- export declare function from<const envelope extends UnionPartialBy<TransactionEnvelopeEip1559, 'type'> | Serialized, const signature extends Signature.Signature | undefined = undefined>(envelope: envelope | UnionPartialBy<TransactionEnvelopeEip1559, 'type'> | Serialized, options?: from.Options<signature>): from.ReturnType<envelope, signature>;
150
+ export declare function from<const envelope extends UnionPartialBy<TxEnvelopeEip1559, 'type'> | Serialized, const signature extends Signature.Signature | undefined = undefined>(envelope: envelope | UnionPartialBy<TxEnvelopeEip1559, 'type'> | Serialized, options?: from.Options<signature>): from.ReturnType<envelope, signature>;
151
151
  export declare namespace from {
152
152
  type Options<signature extends Signature.Signature | undefined = undefined> = {
153
153
  signature?: signature | Signature.Signature | undefined;
154
154
  };
155
- type ReturnType<envelope extends UnionPartialBy<TransactionEnvelopeEip1559, 'type'> | Hex.Hex = TransactionEnvelopeEip1559 | Hex.Hex, signature extends Signature.Signature | undefined = undefined> = Compute<envelope extends Hex.Hex ? TransactionEnvelopeEip1559 : Assign<envelope, (signature extends Signature.Signature ? Readonly<signature> : {}) & {
155
+ type ReturnType<envelope extends UnionPartialBy<TxEnvelopeEip1559, 'type'> | Hex.Hex = TxEnvelopeEip1559 | Hex.Hex, signature extends Signature.Signature | undefined = undefined> = Compute<envelope extends Hex.Hex ? TxEnvelopeEip1559 : Assign<envelope, (signature extends Signature.Signature ? Readonly<signature> : {}) & {
156
156
  readonly type: 'eip1559';
157
157
  }>>;
158
158
  type ErrorType = deserialize.ErrorType | assert.ErrorType | Errors.GlobalErrorType;
159
159
  }
160
160
  /**
161
- * Returns the payload to sign for a {@link ox#TransactionEnvelopeEip1559.TransactionEnvelopeEip1559}.
161
+ * Returns the payload to sign for a {@link ox#TxEnvelopeEip1559.TxEnvelopeEip1559}.
162
162
  *
163
163
  * @example
164
164
  * The example below demonstrates how to compute the sign payload which can be used
165
165
  * with ECDSA signing utilities like {@link ox#Secp256k1.(sign:function)}.
166
166
  *
167
167
  * ```ts twoslash
168
- * import { Secp256k1, TransactionEnvelopeEip1559 } from 'ox'
168
+ * import { Secp256k1, TxEnvelopeEip1559 } from 'ox'
169
169
  *
170
- * const envelope = TransactionEnvelopeEip1559.from({
170
+ * const envelope = TxEnvelopeEip1559.from({
171
171
  * chainId: 1,
172
172
  * nonce: 0n,
173
173
  * maxFeePerGas: 1000000000n,
@@ -176,7 +176,7 @@ export declare namespace from {
176
176
  * value: 1000000000000000000n,
177
177
  * })
178
178
  *
179
- * const payload = TransactionEnvelopeEip1559.getSignPayload(envelope) // [!code focus]
179
+ * const payload = TxEnvelopeEip1559.getSignPayload(envelope) // [!code focus]
180
180
  * // @log: '0x...'
181
181
  *
182
182
  * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
@@ -185,19 +185,19 @@ export declare namespace from {
185
185
  * @param envelope - The transaction envelope to get the sign payload for.
186
186
  * @returns The sign payload.
187
187
  */
188
- export declare function getSignPayload(envelope: TransactionEnvelopeEip1559): getSignPayload.ReturnType;
188
+ export declare function getSignPayload(envelope: TxEnvelopeEip1559): getSignPayload.ReturnType;
189
189
  export declare namespace getSignPayload {
190
190
  type ReturnType = Hex.Hex;
191
191
  type ErrorType = hash.ErrorType | Errors.GlobalErrorType;
192
192
  }
193
193
  /**
194
- * Hashes a {@link ox#TransactionEnvelopeEip1559.TransactionEnvelopeEip1559}. This is the "transaction hash".
194
+ * Hashes a {@link ox#TxEnvelopeEip1559.TxEnvelopeEip1559}. This is the "transaction hash".
195
195
  *
196
196
  * @example
197
197
  * ```ts twoslash
198
- * import { Secp256k1, TransactionEnvelopeEip1559 } from 'ox'
198
+ * import { Secp256k1, TxEnvelopeEip1559 } from 'ox'
199
199
  *
200
- * const envelope = TransactionEnvelopeEip1559.from({
200
+ * const envelope = TxEnvelopeEip1559.from({
201
201
  * chainId: 1,
202
202
  * nonce: 0n,
203
203
  * maxFeePerGas: 1000000000n,
@@ -207,20 +207,20 @@ export declare namespace getSignPayload {
207
207
  * })
208
208
  *
209
209
  * const signature = Secp256k1.sign({
210
- * payload: TransactionEnvelopeEip1559.getSignPayload(envelope),
210
+ * payload: TxEnvelopeEip1559.getSignPayload(envelope),
211
211
  * privateKey: '0x...'
212
212
  * })
213
213
  *
214
- * const envelope_signed = TransactionEnvelopeEip1559.from(envelope, { signature })
214
+ * const envelope_signed = TxEnvelopeEip1559.from(envelope, { signature })
215
215
  *
216
- * const hash = TransactionEnvelopeEip1559.hash(envelope_signed) // [!code focus]
216
+ * const hash = TxEnvelopeEip1559.hash(envelope_signed) // [!code focus]
217
217
  * ```
218
218
  *
219
219
  * @param envelope - The EIP-1559 Transaction Envelope to hash.
220
220
  * @param options - Options.
221
221
  * @returns The hash of the transaction envelope.
222
222
  */
223
- export declare function hash<presign extends boolean = false>(envelope: TransactionEnvelopeEip1559<presign extends true ? false : true>, options?: hash.Options<presign>): hash.ReturnType;
223
+ export declare function hash<presign extends boolean = false>(envelope: TxEnvelopeEip1559<presign extends true ? false : true>, options?: hash.Options<presign>): hash.ReturnType;
224
224
  export declare namespace hash {
225
225
  type Options<presign extends boolean = false> = {
226
226
  /** Whether to hash this transaction for signing. @default false */
@@ -230,13 +230,13 @@ export declare namespace hash {
230
230
  type ErrorType = Hash.keccak256.ErrorType | serialize.ErrorType | Errors.GlobalErrorType;
231
231
  }
232
232
  /**
233
- * Serializes a {@link ox#TransactionEnvelopeEip1559.TransactionEnvelopeEip1559}.
233
+ * Serializes a {@link ox#TxEnvelopeEip1559.TxEnvelopeEip1559}.
234
234
  *
235
235
  * @example
236
236
  * ```ts twoslash
237
- * import { TransactionEnvelopeEip1559, Value } from 'ox'
237
+ * import { TxEnvelopeEip1559, Value } from 'ox'
238
238
  *
239
- * const envelope = TransactionEnvelopeEip1559.from({
239
+ * const envelope = TxEnvelopeEip1559.from({
240
240
  * chainId: 1,
241
241
  * maxFeePerGas: Value.fromGwei('10'),
242
242
  * maxPriorityFeePerGas: Value.fromGwei('1'),
@@ -244,7 +244,7 @@ export declare namespace hash {
244
244
  * value: Value.fromEther('1'),
245
245
  * })
246
246
  *
247
- * const serialized = TransactionEnvelopeEip1559.serialize(envelope) // [!code focus]
247
+ * const serialized = TxEnvelopeEip1559.serialize(envelope) // [!code focus]
248
248
  * ```
249
249
  *
250
250
  * @example
@@ -253,9 +253,9 @@ export declare namespace hash {
253
253
  * It is possible to attach a `signature` to the serialized Transaction Envelope.
254
254
  *
255
255
  * ```ts twoslash
256
- * import { Secp256k1, TransactionEnvelopeEip1559, Value } from 'ox'
256
+ * import { Secp256k1, TxEnvelopeEip1559, Value } from 'ox'
257
257
  *
258
- * const envelope = TransactionEnvelopeEip1559.from({
258
+ * const envelope = TxEnvelopeEip1559.from({
259
259
  * chainId: 1,
260
260
  * maxFeePerGas: Value.fromGwei('10'),
261
261
  * maxPriorityFeePerGas: Value.fromGwei('1'),
@@ -264,11 +264,11 @@ export declare namespace hash {
264
264
  * })
265
265
  *
266
266
  * const signature = Secp256k1.sign({
267
- * payload: TransactionEnvelopeEip1559.getSignPayload(envelope),
267
+ * payload: TxEnvelopeEip1559.getSignPayload(envelope),
268
268
  * privateKey: '0x...',
269
269
  * })
270
270
  *
271
- * const serialized = TransactionEnvelopeEip1559.serialize(envelope, { // [!code focus]
271
+ * const serialized = TxEnvelopeEip1559.serialize(envelope, { // [!code focus]
272
272
  * signature, // [!code focus]
273
273
  * }) // [!code focus]
274
274
  *
@@ -279,7 +279,7 @@ export declare namespace hash {
279
279
  * @param options - Options.
280
280
  * @returns The serialized Transaction Envelope.
281
281
  */
282
- export declare function serialize(envelope: PartialBy<TransactionEnvelopeEip1559, 'type'>, options?: serialize.Options): Serialized;
282
+ export declare function serialize(envelope: PartialBy<TxEnvelopeEip1559, 'type'>, options?: serialize.Options): Serialized;
283
283
  export declare namespace serialize {
284
284
  type Options = {
285
285
  /** Signature to append to the serialized Transaction Envelope. */
@@ -288,13 +288,13 @@ export declare namespace serialize {
288
288
  type ErrorType = assert.ErrorType | Hex.fromNumber.ErrorType | Signature.toTuple.ErrorType | Hex.concat.ErrorType | Rlp.fromHex.ErrorType | Errors.GlobalErrorType;
289
289
  }
290
290
  /**
291
- * Converts an {@link ox#TransactionEnvelopeEip1559.TransactionEnvelopeEip1559} to an {@link ox#TransactionEnvelopeEip1559.Rpc}.
291
+ * Converts an {@link ox#TxEnvelopeEip1559.TxEnvelopeEip1559} to an {@link ox#TxEnvelopeEip1559.Rpc}.
292
292
  *
293
293
  * @example
294
294
  * ```ts twoslash
295
- * import { RpcRequest, TransactionEnvelopeEip1559, Value } from 'ox'
295
+ * import { RpcRequest, TxEnvelopeEip1559, Value } from 'ox'
296
296
  *
297
- * const envelope = TransactionEnvelopeEip1559.from({
297
+ * const envelope = TxEnvelopeEip1559.from({
298
298
  * chainId: 1,
299
299
  * nonce: 0n,
300
300
  * gas: 21000n,
@@ -302,7 +302,7 @@ export declare namespace serialize {
302
302
  * value: Value.fromEther('1'),
303
303
  * })
304
304
  *
305
- * const envelope_rpc = TransactionEnvelopeEip1559.toRpc(envelope) // [!code focus]
305
+ * const envelope_rpc = TxEnvelopeEip1559.toRpc(envelope) // [!code focus]
306
306
  *
307
307
  * const request = RpcRequest.from({
308
308
  * id: 0,
@@ -314,18 +314,18 @@ export declare namespace serialize {
314
314
  * @param envelope - The EIP-1559 transaction envelope to convert.
315
315
  * @returns An RPC-formatted EIP-1559 transaction envelope.
316
316
  */
317
- export declare function toRpc(envelope: Omit<TransactionEnvelopeEip1559, 'type'>): Rpc;
317
+ export declare function toRpc(envelope: Omit<TxEnvelopeEip1559, 'type'>): Rpc;
318
318
  export declare namespace toRpc {
319
319
  type ErrorType = Signature.extract.ErrorType | Errors.GlobalErrorType;
320
320
  }
321
321
  /**
322
- * Validates a {@link ox#TransactionEnvelopeEip1559.TransactionEnvelopeEip1559}. Returns `true` if the envelope is valid, `false` otherwise.
322
+ * Validates a {@link ox#TxEnvelopeEip1559.TxEnvelopeEip1559}. Returns `true` if the envelope is valid, `false` otherwise.
323
323
  *
324
324
  * @example
325
325
  * ```ts twoslash
326
- * import { TransactionEnvelopeEip1559, Value } from 'ox'
326
+ * import { TxEnvelopeEip1559, Value } from 'ox'
327
327
  *
328
- * const valid = TransactionEnvelopeEip1559.assert({
328
+ * const valid = TxEnvelopeEip1559.assert({
329
329
  * maxFeePerGas: 2n ** 256n - 1n + 1n,
330
330
  * chainId: 1,
331
331
  * to: '0x0000000000000000000000000000000000000000',
@@ -336,8 +336,8 @@ export declare namespace toRpc {
336
336
  *
337
337
  * @param envelope - The transaction envelope to validate.
338
338
  */
339
- export declare function validate(envelope: PartialBy<TransactionEnvelopeEip1559, 'type'>): boolean;
339
+ export declare function validate(envelope: PartialBy<TxEnvelopeEip1559, 'type'>): boolean;
340
340
  export declare namespace validate {
341
341
  type ErrorType = Errors.GlobalErrorType;
342
342
  }
343
- //# sourceMappingURL=TransactionEnvelopeEip1559.d.ts.map
343
+ //# sourceMappingURL=TxEnvelopeEip1559.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TxEnvelopeEip1559.d.ts","sourceRoot":"","sources":["../../core/TxEnvelopeEip1559.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAC7C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,KAAK,MAAM,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,EACV,MAAM,EACN,OAAO,EACP,SAAS,EACT,cAAc,EACf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,mBAAmB,MAAM,iBAAiB,CAAA;AAEtD,MAAM,MAAM,iBAAiB,CAC3B,MAAM,SAAS,OAAO,GAAG,OAAO,EAChC,UAAU,GAAG,MAAM,EACnB,UAAU,GAAG,MAAM,EACnB,IAAI,SAAS,MAAM,GAAG,IAAI,IACxB,OAAO,CACT,mBAAmB,C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