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,28 +6,28 @@ 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 TransactionEnvelopeEip2930<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 TxEnvelopeEip2930<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
  /** Base fee per gas. */
14
14
  gasPrice?: bigintType | undefined;
15
15
  }>;
16
- export type Rpc<signed extends boolean = boolean> = TransactionEnvelopeEip2930<signed, Hex.Hex, Hex.Hex, '0x1'>;
16
+ export type Rpc<signed extends boolean = boolean> = TxEnvelopeEip2930<signed, Hex.Hex, Hex.Hex, '0x1'>;
17
17
  export type Serialized = `${SerializedType}${string}`;
18
18
  export declare const serializedType: "0x01";
19
19
  export type SerializedType = typeof serializedType;
20
- export type Signed = TransactionEnvelopeEip2930<true>;
20
+ export type Signed = TxEnvelopeEip2930<true>;
21
21
  export declare const type: "eip2930";
22
22
  export type Type = typeof type;
23
23
  /**
24
- * Asserts a {@link ox#TransactionEnvelopeEip2930.TransactionEnvelopeEip2930} is valid.
24
+ * Asserts a {@link ox#TxEnvelopeEip2930.TxEnvelopeEip2930} is valid.
25
25
  *
26
26
  * @example
27
27
  * ```ts twoslash
28
- * import { TransactionEnvelopeEip2930, Value } from 'ox'
28
+ * import { TxEnvelopeEip2930, Value } from 'ox'
29
29
  *
30
- * TransactionEnvelopeEip2930.assert({
30
+ * TxEnvelopeEip2930.assert({
31
31
  * gasPrice: 2n ** 256n - 1n + 1n,
32
32
  * chainId: 1,
33
33
  * to: '0x0000000000000000000000000000000000000000',
@@ -40,18 +40,18 @@ export type Type = typeof type;
40
40
  *
41
41
  * @param envelope - The transaction envelope to assert.
42
42
  */
43
- export declare function assert(envelope: PartialBy<TransactionEnvelopeEip2930, 'type'>): void;
43
+ export declare function assert(envelope: PartialBy<TxEnvelopeEip2930, 'type'>): void;
44
44
  export declare namespace assert {
45
45
  type ErrorType = Address.assert.ErrorType | TransactionEnvelope.InvalidChainIdError | TransactionEnvelope.GasPriceTooHighError | Errors.GlobalErrorType;
46
46
  }
47
47
  /**
48
- * Deserializes a {@link ox#TransactionEnvelopeEip2930.TransactionEnvelopeEip2930} from its serialized form.
48
+ * Deserializes a {@link ox#TxEnvelopeEip2930.TxEnvelopeEip2930} from its serialized form.
49
49
  *
50
50
  * @example
51
51
  * ```ts twoslash
52
- * import { TransactionEnvelopeEip2930 } from 'ox'
52
+ * import { TxEnvelopeEip2930 } from 'ox'
53
53
  *
54
- * const envelope = TransactionEnvelopeEip2930.deserialize('0x01ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
54
+ * const envelope = TxEnvelopeEip2930.deserialize('0x01ef0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0')
55
55
  * // @log: {
56
56
  * // @log: type: 'eip2930',
57
57
  * // @log: nonce: 785n,
@@ -65,7 +65,7 @@ export declare namespace assert {
65
65
  * @param serialized - The serialized transaction.
66
66
  * @returns Deserialized Transaction Envelope.
67
67
  */
68
- export declare function deserialize(serialized: Serialized): TransactionEnvelopeEip2930;
68
+ export declare function deserialize(serialized: Serialized): TxEnvelopeEip2930;
69
69
  export declare namespace deserialize {
70
70
  type ErrorType = Errors.GlobalErrorType;
71
71
  }
@@ -75,9 +75,9 @@ export declare namespace deserialize {
75
75
  * @example
76
76
  * ```ts twoslash
77
77
  * // @noErrors
78
- * import { TransactionEnvelopeEip2930, Value } from 'ox'
78
+ * import { TxEnvelopeEip2930, Value } from 'ox'
79
79
  *
80
- * const envelope = TransactionEnvelopeEip2930.from({
80
+ * const envelope = TxEnvelopeEip2930.from({
81
81
  * chainId: 1,
82
82
  * accessList: [...],
83
83
  * gasPrice: Value.fromGwei('10'),
@@ -92,9 +92,9 @@ export declare namespace deserialize {
92
92
  * It is possible to attach a `signature` to the transaction envelope.
93
93
  *
94
94
  * ```ts twoslash
95
- * import { Secp256k1, TransactionEnvelopeEip2930, Value } from 'ox'
95
+ * import { Secp256k1, TxEnvelopeEip2930, Value } from 'ox'
96
96
  *
97
- * const envelope = TransactionEnvelopeEip2930.from({
97
+ * const envelope = TxEnvelopeEip2930.from({
98
98
  * chainId: 1,
99
99
  * gasPrice: Value.fromGwei('10'),
100
100
  * to: '0x0000000000000000000000000000000000000000',
@@ -102,11 +102,11 @@ export declare namespace deserialize {
102
102
  * })
103
103
  *
104
104
  * const signature = Secp256k1.sign({
105
- * payload: TransactionEnvelopeEip2930.getSignPayload(envelope),
105
+ * payload: TxEnvelopeEip2930.getSignPayload(envelope),
106
106
  * privateKey: '0x...',
107
107
  * })
108
108
  *
109
- * const envelope_signed = TransactionEnvelopeEip2930.from(envelope, { // [!code focus]
109
+ * const envelope_signed = TxEnvelopeEip2930.from(envelope, { // [!code focus]
110
110
  * signature, // [!code focus]
111
111
  * }) // [!code focus]
112
112
  * // @log: {
@@ -124,12 +124,12 @@ export declare namespace deserialize {
124
124
  * @example
125
125
  * ### From Serialized
126
126
  *
127
- * It is possible to instantiate an EIP-2930 Transaction Envelope from a {@link ox#TransactionEnvelopeEip2930.Serialized} value.
127
+ * It is possible to instantiate an EIP-2930 Transaction Envelope from a {@link ox#TxEnvelopeEip2930.Serialized} value.
128
128
  *
129
129
  * ```ts twoslash
130
- * import { TransactionEnvelopeEip2930 } from 'ox'
130
+ * import { TxEnvelopeEip2930 } from 'ox'
131
131
  *
132
- * const envelope = TransactionEnvelopeEip2930.from('0x01f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
132
+ * const envelope = TxEnvelopeEip2930.from('0x01f858018203118502540be4008504a817c800809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c08477359400e1a001627c687261b0e7f8638af1112efa8a77e23656f6e7945275b19e9deed80261')
133
133
  * // @log: {
134
134
  * // @log: chainId: 1,
135
135
  * // @log: gasPrice: 10000000000n,
@@ -141,29 +141,29 @@ export declare namespace deserialize {
141
141
  *
142
142
  * @param envelope - The transaction object to convert.
143
143
  * @param options - Options.
144
- * @returns A {@link ox#TransactionEnvelopeEip2930.TransactionEnvelopeEip2930}
144
+ * @returns A {@link ox#TxEnvelopeEip2930.TxEnvelopeEip2930}
145
145
  */
146
- export declare function from<const envelope extends UnionPartialBy<TransactionEnvelopeEip2930, 'type'> | Serialized, const signature extends Signature.Signature | undefined = undefined>(envelope: envelope | UnionPartialBy<TransactionEnvelopeEip2930, 'type'> | Serialized, options?: from.Options<signature>): from.ReturnType<envelope, signature>;
146
+ export declare function from<const envelope extends UnionPartialBy<TxEnvelopeEip2930, 'type'> | Serialized, const signature extends Signature.Signature | undefined = undefined>(envelope: envelope | UnionPartialBy<TxEnvelopeEip2930, 'type'> | Serialized, options?: from.Options<signature>): from.ReturnType<envelope, signature>;
147
147
  export declare namespace from {
148
148
  type Options<signature extends Signature.Signature | undefined = undefined> = {
149
149
  signature?: signature | Signature.Signature | undefined;
150
150
  };
151
- type ReturnType<envelope extends UnionPartialBy<TransactionEnvelopeEip2930, 'type'> | Hex.Hex = TransactionEnvelopeEip2930 | Hex.Hex, signature extends Signature.Signature | undefined = undefined> = Compute<envelope extends Hex.Hex ? TransactionEnvelopeEip2930 : Assign<envelope, (signature extends Signature.Signature ? Readonly<signature> : {}) & {
151
+ type ReturnType<envelope extends UnionPartialBy<TxEnvelopeEip2930, 'type'> | Hex.Hex = TxEnvelopeEip2930 | Hex.Hex, signature extends Signature.Signature | undefined = undefined> = Compute<envelope extends Hex.Hex ? TxEnvelopeEip2930 : Assign<envelope, (signature extends Signature.Signature ? Readonly<signature> : {}) & {
152
152
  readonly type: 'eip2930';
153
153
  }>>;
154
154
  type ErrorType = deserialize.ErrorType | assert.ErrorType | Errors.GlobalErrorType;
155
155
  }
156
156
  /**
157
- * Returns the payload to sign for a {@link ox#TransactionEnvelopeEip2930.TransactionEnvelopeEip2930}.
157
+ * Returns the payload to sign for a {@link ox#TxEnvelopeEip2930.TxEnvelopeEip2930}.
158
158
  *
159
159
  * @example
160
160
  * The example below demonstrates how to compute the sign payload which can be used
161
161
  * with ECDSA signing utilities like {@link ox#Secp256k1.(sign:function)}.
162
162
  *
163
163
  * ```ts twoslash
164
- * import { Secp256k1, TransactionEnvelopeEip2930 } from 'ox'
164
+ * import { Secp256k1, TxEnvelopeEip2930 } from 'ox'
165
165
  *
166
- * const envelope = TransactionEnvelopeEip2930.from({
166
+ * const envelope = TxEnvelopeEip2930.from({
167
167
  * chainId: 1,
168
168
  * nonce: 0n,
169
169
  * gasPrice: 1000000000n,
@@ -172,7 +172,7 @@ export declare namespace from {
172
172
  * value: 1000000000000000000n,
173
173
  * })
174
174
  *
175
- * const payload = TransactionEnvelopeEip2930.getSignPayload(envelope) // [!code focus]
175
+ * const payload = TxEnvelopeEip2930.getSignPayload(envelope) // [!code focus]
176
176
  * // @log: '0x...'
177
177
  *
178
178
  * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
@@ -181,19 +181,19 @@ export declare namespace from {
181
181
  * @param envelope - The transaction envelope to get the sign payload for.
182
182
  * @returns The sign payload.
183
183
  */
184
- export declare function getSignPayload(envelope: TransactionEnvelopeEip2930): getSignPayload.ReturnType;
184
+ export declare function getSignPayload(envelope: TxEnvelopeEip2930): getSignPayload.ReturnType;
185
185
  export declare namespace getSignPayload {
186
186
  type ReturnType = Hex.Hex;
187
187
  type ErrorType = hash.ErrorType | Errors.GlobalErrorType;
188
188
  }
189
189
  /**
190
- * Hashes a {@link ox#TransactionEnvelopeEip2930.TransactionEnvelopeEip2930}. This is the "transaction hash".
190
+ * Hashes a {@link ox#TxEnvelopeEip2930.TxEnvelopeEip2930}. This is the "transaction hash".
191
191
  *
192
192
  * @example
193
193
  * ```ts twoslash
194
- * import { Secp256k1, TransactionEnvelopeEip2930 } from 'ox'
194
+ * import { Secp256k1, TxEnvelopeEip2930 } from 'ox'
195
195
  *
196
- * const envelope = TransactionEnvelopeEip2930.from({
196
+ * const envelope = TxEnvelopeEip2930.from({
197
197
  * chainId: 1,
198
198
  * nonce: 0n,
199
199
  * gasPrice: 1000000000n,
@@ -203,22 +203,22 @@ export declare namespace getSignPayload {
203
203
  * })
204
204
  *
205
205
  * const signature = Secp256k1.sign({
206
- * payload: TransactionEnvelopeEip2930.getSignPayload(envelope),
206
+ * payload: TxEnvelopeEip2930.getSignPayload(envelope),
207
207
  * privateKey: '0x...',
208
208
  * })
209
209
  *
210
- * const envelope_signed = TransactionEnvelopeEip2930.from(envelope, {
210
+ * const envelope_signed = TxEnvelopeEip2930.from(envelope, {
211
211
  * signature,
212
212
  * })
213
213
  *
214
- * const hash = TransactionEnvelopeEip2930.hash(envelope_signed) // [!code focus]
214
+ * const hash = TxEnvelopeEip2930.hash(envelope_signed) // [!code focus]
215
215
  * ```
216
216
  *
217
217
  * @param envelope - The EIP-2930 Transaction Envelope to hash.
218
218
  * @param options - Options.
219
219
  * @returns The hash of the transaction envelope.
220
220
  */
221
- export declare function hash<presign extends boolean = false>(envelope: TransactionEnvelopeEip2930<presign extends true ? false : true>, options?: hash.Options<presign>): hash.ReturnType;
221
+ export declare function hash<presign extends boolean = false>(envelope: TxEnvelopeEip2930<presign extends true ? false : true>, options?: hash.Options<presign>): hash.ReturnType;
222
222
  export declare namespace hash {
223
223
  type Options<presign extends boolean = false> = {
224
224
  /** Whether to hash this transaction for signing. @default false */
@@ -228,20 +228,20 @@ export declare namespace hash {
228
228
  type ErrorType = Hash.keccak256.ErrorType | serialize.ErrorType | Errors.GlobalErrorType;
229
229
  }
230
230
  /**
231
- * Serializes a {@link ox#TransactionEnvelopeEip2930.TransactionEnvelopeEip2930}.
231
+ * Serializes a {@link ox#TxEnvelopeEip2930.TxEnvelopeEip2930}.
232
232
  *
233
233
  * @example
234
234
  * ```ts twoslash
235
- * import { TransactionEnvelopeEip2930, Value } from 'ox'
235
+ * import { TxEnvelopeEip2930, Value } from 'ox'
236
236
  *
237
- * const envelope = TransactionEnvelopeEip2930.from({
237
+ * const envelope = TxEnvelopeEip2930.from({
238
238
  * chainId: 1,
239
239
  * gasPrice: Value.fromGwei('10'),
240
240
  * to: '0x0000000000000000000000000000000000000000',
241
241
  * value: Value.fromEther('1'),
242
242
  * })
243
243
  *
244
- * const serialized = TransactionEnvelopeEip2930.serialize(envelope) // [!code focus]
244
+ * const serialized = TxEnvelopeEip2930.serialize(envelope) // [!code focus]
245
245
  * ```
246
246
  *
247
247
  * @example
@@ -250,9 +250,9 @@ export declare namespace hash {
250
250
  * It is possible to attach a `signature` to the serialized Transaction Envelope.
251
251
  *
252
252
  * ```ts twoslash
253
- * import { Secp256k1, TransactionEnvelopeEip2930, Value } from 'ox'
253
+ * import { Secp256k1, TxEnvelopeEip2930, Value } from 'ox'
254
254
  *
255
- * const envelope = TransactionEnvelopeEip2930.from({
255
+ * const envelope = TxEnvelopeEip2930.from({
256
256
  * chainId: 1,
257
257
  * gasPrice: Value.fromGwei('10'),
258
258
  * to: '0x0000000000000000000000000000000000000000',
@@ -260,11 +260,11 @@ export declare namespace hash {
260
260
  * })
261
261
  *
262
262
  * const signature = Secp256k1.sign({
263
- * payload: TransactionEnvelopeEip2930.getSignPayload(envelope),
263
+ * payload: TxEnvelopeEip2930.getSignPayload(envelope),
264
264
  * privateKey: '0x...',
265
265
  * })
266
266
  *
267
- * const serialized = TransactionEnvelopeEip2930.serialize(envelope, { // [!code focus]
267
+ * const serialized = TxEnvelopeEip2930.serialize(envelope, { // [!code focus]
268
268
  * signature, // [!code focus]
269
269
  * }) // [!code focus]
270
270
  *
@@ -275,7 +275,7 @@ export declare namespace hash {
275
275
  * @param options - Options.
276
276
  * @returns The serialized Transaction Envelope.
277
277
  */
278
- export declare function serialize(envelope: PartialBy<TransactionEnvelopeEip2930, 'type'>, options?: serialize.Options): Serialized;
278
+ export declare function serialize(envelope: PartialBy<TxEnvelopeEip2930, 'type'>, options?: serialize.Options): Serialized;
279
279
  export declare namespace serialize {
280
280
  type Options = {
281
281
  /** Signature to append to the serialized Transaction Envelope. */
@@ -284,13 +284,13 @@ export declare namespace serialize {
284
284
  type ErrorType = assert.ErrorType | Hex.fromNumber.ErrorType | Signature.toTuple.ErrorType | Hex.concat.ErrorType | Rlp.fromHex.ErrorType | Errors.GlobalErrorType;
285
285
  }
286
286
  /**
287
- * Converts an {@link ox#TransactionEnvelopeEip2930.TransactionEnvelopeEip2930} to an {@link ox#TransactionEnvelopeEip2930.Rpc}.
287
+ * Converts an {@link ox#TxEnvelopeEip2930.TxEnvelopeEip2930} to an {@link ox#TxEnvelopeEip2930.Rpc}.
288
288
  *
289
289
  * @example
290
290
  * ```ts twoslash
291
- * import { RpcRequest, TransactionEnvelopeEip2930, Value } from 'ox'
291
+ * import { RpcRequest, TxEnvelopeEip2930, Value } from 'ox'
292
292
  *
293
- * const envelope = TransactionEnvelopeEip2930.from({
293
+ * const envelope = TxEnvelopeEip2930.from({
294
294
  * chainId: 1,
295
295
  * nonce: 0n,
296
296
  * gas: 21000n,
@@ -299,7 +299,7 @@ export declare namespace serialize {
299
299
  * value: Value.fromEther('1'),
300
300
  * })
301
301
  *
302
- * const envelope_rpc = TransactionEnvelopeEip2930.toRpc(envelope) // [!code focus]
302
+ * const envelope_rpc = TxEnvelopeEip2930.toRpc(envelope) // [!code focus]
303
303
  *
304
304
  * const request = RpcRequest.from({
305
305
  * id: 0,
@@ -311,18 +311,18 @@ export declare namespace serialize {
311
311
  * @param envelope - The EIP-2930 transaction envelope to convert.
312
312
  * @returns An RPC-formatted EIP-2930 transaction envelope.
313
313
  */
314
- export declare function toRpc(envelope: Omit<TransactionEnvelopeEip2930, 'type'>): Rpc;
314
+ export declare function toRpc(envelope: Omit<TxEnvelopeEip2930, 'type'>): Rpc;
315
315
  export declare namespace toRpc {
316
316
  type ErrorType = Signature.extract.ErrorType | Errors.GlobalErrorType;
317
317
  }
318
318
  /**
319
- * Validates a {@link ox#TransactionEnvelopeEip2930.TransactionEnvelopeEip2930}. Returns `true` if the envelope is valid, `false` otherwise.
319
+ * Validates a {@link ox#TxEnvelopeEip2930.TxEnvelopeEip2930}. Returns `true` if the envelope is valid, `false` otherwise.
320
320
  *
321
321
  * @example
322
322
  * ```ts twoslash
323
- * import { TransactionEnvelopeEip2930, Value } from 'ox'
323
+ * import { TxEnvelopeEip2930, Value } from 'ox'
324
324
  *
325
- * const valid = TransactionEnvelopeEip2930.assert({
325
+ * const valid = TxEnvelopeEip2930.assert({
326
326
  * gasPrice: 2n ** 256n - 1n + 1n,
327
327
  * chainId: 1,
328
328
  * to: '0x0000000000000000000000000000000000000000',
@@ -333,8 +333,8 @@ export declare namespace toRpc {
333
333
  *
334
334
  * @param envelope - The transaction envelope to validate.
335
335
  */
336
- export declare function validate(envelope: PartialBy<TransactionEnvelopeEip2930, 'type'>): boolean;
336
+ export declare function validate(envelope: PartialBy<TxEnvelopeEip2930, 'type'>): boolean;
337
337
  export declare namespace validate {
338
338
  type ErrorType = Errors.GlobalErrorType;
339
339
  }
340
- //# sourceMappingURL=TransactionEnvelopeEip2930.d.ts.map
340
+ //# sourceMappingURL=TxEnvelopeEip2930.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TxEnvelopeEip2930.d.ts","sourceRoot":"","sources":["../../core/TxEnvelopeEip2930.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,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG;IAC/D,4BAA4B;IAC5B,UAAU,CAAC,EAAE,UAAU,CAAC,UAAU,GAAG,SAAS,CAAA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