tempo.ts 0.10.5 → 0.11.1

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 (203) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +0 -41
  3. package/dist/viem/Account.d.ts +8 -3
  4. package/dist/viem/Account.d.ts.map +1 -1
  5. package/dist/viem/Account.js +9 -2
  6. package/dist/viem/Account.js.map +1 -1
  7. package/dist/viem/Actions/account.d.ts.map +1 -1
  8. package/dist/viem/Actions/account.js +1 -1
  9. package/dist/viem/Actions/account.js.map +1 -1
  10. package/dist/viem/Actions/amm.d.ts +1 -1
  11. package/dist/viem/Actions/amm.d.ts.map +1 -1
  12. package/dist/viem/Actions/amm.js +1 -2
  13. package/dist/viem/Actions/amm.js.map +1 -1
  14. package/dist/viem/Actions/dex.d.ts +0 -35
  15. package/dist/viem/Actions/dex.d.ts.map +1 -1
  16. package/dist/viem/Actions/dex.js +0 -43
  17. package/dist/viem/Actions/dex.js.map +1 -1
  18. package/dist/viem/Actions/fee.d.ts +1 -1
  19. package/dist/viem/Actions/fee.d.ts.map +1 -1
  20. package/dist/viem/Actions/fee.js +1 -1
  21. package/dist/viem/Actions/fee.js.map +1 -1
  22. package/dist/viem/Actions/nonce.d.ts.map +1 -1
  23. package/dist/viem/Actions/nonce.js +6 -4
  24. package/dist/viem/Actions/nonce.js.map +1 -1
  25. package/dist/viem/Actions/token.d.ts +1 -2
  26. package/dist/viem/Actions/token.d.ts.map +1 -1
  27. package/dist/viem/Actions/token.js +1 -2
  28. package/dist/viem/Actions/token.js.map +1 -1
  29. package/dist/viem/Chain.d.ts +34 -34
  30. package/dist/viem/Chain.d.ts.map +1 -1
  31. package/dist/viem/Chain.js +2 -0
  32. package/dist/viem/Chain.js.map +1 -1
  33. package/dist/viem/Decorator.d.ts +0 -27
  34. package/dist/viem/Decorator.d.ts.map +1 -1
  35. package/dist/viem/Decorator.js +0 -1
  36. package/dist/viem/Decorator.js.map +1 -1
  37. package/dist/viem/Formatters.d.ts.map +1 -1
  38. package/dist/viem/Formatters.js +5 -3
  39. package/dist/viem/Formatters.js.map +1 -1
  40. package/dist/viem/Transaction.d.ts +8 -5
  41. package/dist/viem/Transaction.d.ts.map +1 -1
  42. package/dist/viem/Transaction.js +13 -3
  43. package/dist/viem/Transaction.js.map +1 -1
  44. package/dist/viem/index.d.ts +10 -1
  45. package/dist/viem/index.d.ts.map +1 -1
  46. package/dist/viem/index.js +1 -1
  47. package/dist/viem/index.js.map +1 -1
  48. package/dist/viem/internal/types.d.ts +1 -1
  49. package/dist/viem/internal/types.d.ts.map +1 -1
  50. package/dist/wagmi/Actions/dex.d.ts +1 -45
  51. package/dist/wagmi/Actions/dex.d.ts.map +1 -1
  52. package/dist/wagmi/Actions/dex.js +0 -55
  53. package/dist/wagmi/Actions/dex.js.map +1 -1
  54. package/dist/wagmi/Connector.d.ts +1 -1
  55. package/dist/wagmi/Connector.d.ts.map +1 -1
  56. package/dist/wagmi/Connector.js +1 -2
  57. package/dist/wagmi/Connector.js.map +1 -1
  58. package/dist/wagmi/Hooks/dex.d.ts +3 -46
  59. package/dist/wagmi/Hooks/dex.d.ts.map +1 -1
  60. package/dist/wagmi/Hooks/dex.js +2 -54
  61. package/dist/wagmi/Hooks/dex.js.map +1 -1
  62. package/dist/wagmi/index.d.ts +1 -1
  63. package/dist/wagmi/index.d.ts.map +1 -1
  64. package/dist/wagmi/index.js +1 -1
  65. package/dist/wagmi/index.js.map +1 -1
  66. package/package.json +5 -13
  67. package/src/viem/Account.test.ts +1 -1
  68. package/src/viem/Account.ts +11 -2
  69. package/src/viem/Actions/account.ts +1 -1
  70. package/src/viem/Actions/amm.ts +1 -2
  71. package/src/viem/Actions/dex.test.ts +1 -195
  72. package/src/viem/Actions/dex.ts +0 -53
  73. package/src/viem/Actions/fee.test.ts +2 -2
  74. package/src/viem/Actions/fee.ts +1 -1
  75. package/src/viem/Actions/nonce.test.ts +27 -14
  76. package/src/viem/Actions/nonce.ts +6 -4
  77. package/src/viem/Actions/token.test.ts +18 -52
  78. package/src/viem/Actions/token.ts +1 -2
  79. package/src/viem/Chain.ts +3 -1
  80. package/src/viem/Decorator.ts +0 -30
  81. package/src/viem/Formatters.ts +9 -3
  82. package/src/viem/Transaction.ts +23 -7
  83. package/src/viem/e2e.test.ts +19 -0
  84. package/src/viem/index.ts +12 -1
  85. package/src/viem/internal/types.ts +1 -1
  86. package/src/wagmi/Actions/dex.test.ts +0 -26
  87. package/src/wagmi/Actions/dex.ts +1 -111
  88. package/src/wagmi/Actions/nonce.test.ts +8 -4
  89. package/src/wagmi/Actions/token.test.ts +2 -2
  90. package/src/wagmi/Connector.ts +1 -2
  91. package/src/wagmi/Hooks/dex.test.ts +0 -26
  92. package/src/wagmi/Hooks/dex.ts +1 -88
  93. package/src/wagmi/Hooks/nonce.test.ts +3 -3
  94. package/src/wagmi/index.ts +4 -1
  95. package/dist/ox/AuthorizationTempo.d.ts +0 -450
  96. package/dist/ox/AuthorizationTempo.d.ts.map +0 -1
  97. package/dist/ox/AuthorizationTempo.js +0 -433
  98. package/dist/ox/AuthorizationTempo.js.map +0 -1
  99. package/dist/ox/KeyAuthorization.d.ts +0 -356
  100. package/dist/ox/KeyAuthorization.d.ts.map +0 -1
  101. package/dist/ox/KeyAuthorization.js +0 -359
  102. package/dist/ox/KeyAuthorization.js.map +0 -1
  103. package/dist/ox/Order.d.ts +0 -92
  104. package/dist/ox/Order.d.ts.map +0 -1
  105. package/dist/ox/Order.js +0 -88
  106. package/dist/ox/Order.js.map +0 -1
  107. package/dist/ox/OrdersFilters.d.ts +0 -72
  108. package/dist/ox/OrdersFilters.d.ts.map +0 -1
  109. package/dist/ox/OrdersFilters.js +0 -100
  110. package/dist/ox/OrdersFilters.js.map +0 -1
  111. package/dist/ox/Pagination.d.ts +0 -128
  112. package/dist/ox/Pagination.d.ts.map +0 -1
  113. package/dist/ox/Pagination.js +0 -78
  114. package/dist/ox/Pagination.js.map +0 -1
  115. package/dist/ox/PoolId.d.ts +0 -18
  116. package/dist/ox/PoolId.d.ts.map +0 -1
  117. package/dist/ox/PoolId.js +0 -13
  118. package/dist/ox/PoolId.js.map +0 -1
  119. package/dist/ox/RpcSchema.d.ts +0 -32
  120. package/dist/ox/RpcSchema.d.ts.map +0 -1
  121. package/dist/ox/RpcSchema.js +0 -2
  122. package/dist/ox/RpcSchema.js.map +0 -1
  123. package/dist/ox/SignatureEnvelope.d.ts +0 -260
  124. package/dist/ox/SignatureEnvelope.d.ts.map +0 -1
  125. package/dist/ox/SignatureEnvelope.js +0 -477
  126. package/dist/ox/SignatureEnvelope.js.map +0 -1
  127. package/dist/ox/Tick.d.ts +0 -115
  128. package/dist/ox/Tick.d.ts.map +0 -1
  129. package/dist/ox/Tick.js +0 -127
  130. package/dist/ox/Tick.js.map +0 -1
  131. package/dist/ox/TokenId.d.ts +0 -25
  132. package/dist/ox/TokenId.d.ts.map +0 -1
  133. package/dist/ox/TokenId.js +0 -41
  134. package/dist/ox/TokenId.js.map +0 -1
  135. package/dist/ox/TokenRole.d.ts +0 -11
  136. package/dist/ox/TokenRole.d.ts.map +0 -1
  137. package/dist/ox/TokenRole.js +0 -22
  138. package/dist/ox/TokenRole.js.map +0 -1
  139. package/dist/ox/Transaction.d.ts +0 -201
  140. package/dist/ox/Transaction.d.ts.map +0 -1
  141. package/dist/ox/Transaction.js +0 -167
  142. package/dist/ox/Transaction.js.map +0 -1
  143. package/dist/ox/TransactionEnvelopeTempo.d.ts +0 -470
  144. package/dist/ox/TransactionEnvelopeTempo.d.ts.map +0 -1
  145. package/dist/ox/TransactionEnvelopeTempo.js +0 -547
  146. package/dist/ox/TransactionEnvelopeTempo.js.map +0 -1
  147. package/dist/ox/TransactionReceipt.d.ts +0 -155
  148. package/dist/ox/TransactionReceipt.d.ts.map +0 -1
  149. package/dist/ox/TransactionReceipt.js +0 -136
  150. package/dist/ox/TransactionReceipt.js.map +0 -1
  151. package/dist/ox/TransactionRequest.d.ts +0 -76
  152. package/dist/ox/TransactionRequest.d.ts.map +0 -1
  153. package/dist/ox/TransactionRequest.js +0 -93
  154. package/dist/ox/TransactionRequest.js.map +0 -1
  155. package/dist/ox/index.d.ts +0 -14
  156. package/dist/ox/index.d.ts.map +0 -1
  157. package/dist/ox/index.js +0 -14
  158. package/dist/ox/index.js.map +0 -1
  159. package/dist/prool/Instance.d.ts +0 -101
  160. package/dist/prool/Instance.d.ts.map +0 -1
  161. package/dist/prool/Instance.js +0 -136
  162. package/dist/prool/Instance.js.map +0 -1
  163. package/dist/prool/chain.json +0 -238
  164. package/dist/prool/index.d.ts +0 -2
  165. package/dist/prool/index.d.ts.map +0 -1
  166. package/dist/prool/index.js +0 -2
  167. package/dist/prool/index.js.map +0 -1
  168. package/src/ox/AuthorizationTempo.test.ts +0 -1256
  169. package/src/ox/AuthorizationTempo.ts +0 -648
  170. package/src/ox/KeyAuthorization.test.ts +0 -1332
  171. package/src/ox/KeyAuthorization.ts +0 -540
  172. package/src/ox/Order.test.ts +0 -78
  173. package/src/ox/Order.ts +0 -125
  174. package/src/ox/OrdersFilters.test.ts +0 -182
  175. package/src/ox/OrdersFilters.ts +0 -125
  176. package/src/ox/Pagination.test.ts +0 -162
  177. package/src/ox/Pagination.ts +0 -164
  178. package/src/ox/PoolId.test.ts +0 -33
  179. package/src/ox/PoolId.ts +0 -27
  180. package/src/ox/RpcSchema.ts +0 -35
  181. package/src/ox/SignatureEnvelope.test.ts +0 -1876
  182. package/src/ox/SignatureEnvelope.ts +0 -791
  183. package/src/ox/Tick.test.ts +0 -281
  184. package/src/ox/Tick.ts +0 -181
  185. package/src/ox/TokenId.test.ts +0 -40
  186. package/src/ox/TokenId.ts +0 -50
  187. package/src/ox/TokenRole.test.ts +0 -16
  188. package/src/ox/TokenRole.ts +0 -27
  189. package/src/ox/Transaction.test.ts +0 -523
  190. package/src/ox/Transaction.ts +0 -332
  191. package/src/ox/TransactionEnvelopeTempo.test.ts +0 -1352
  192. package/src/ox/TransactionEnvelopeTempo.ts +0 -905
  193. package/src/ox/TransactionReceipt.ts +0 -190
  194. package/src/ox/TransactionRequest.ts +0 -147
  195. package/src/ox/e2e.test.ts +0 -1393
  196. package/src/ox/index.ts +0 -13
  197. package/src/prool/Instance.test.ts +0 -43
  198. package/src/prool/Instance.ts +0 -247
  199. package/src/prool/chain.json +0 -238
  200. package/src/prool/index.ts +0 -1
  201. package/src/viem/Actions/__snapshots__/dex.test.ts.snap +0 -850
  202. package/src/wagmi/Actions/__snapshots__/dex.test.ts.snap +0 -310
  203. package/src/wagmi/Hooks/__snapshots__/dex.test.ts.snap +0 -457
@@ -1,547 +0,0 @@
1
- import * as AccessList from 'ox/AccessList';
2
- import * as Address from 'ox/Address';
3
- import * as Errors from 'ox/Errors';
4
- import * as Hash from 'ox/Hash';
5
- import * as Hex from 'ox/Hex';
6
- import * as Rlp from 'ox/Rlp';
7
- import * as Signature from 'ox/Signature';
8
- import * as TransactionEnvelope from 'ox/TransactionEnvelope';
9
- import * as AuthorizationTempo from './AuthorizationTempo.js';
10
- import * as KeyAuthorization from './KeyAuthorization.js';
11
- import * as SignatureEnvelope from './SignatureEnvelope.js';
12
- import * as TokenId from './TokenId.js';
13
- export const feePayerMagic = '0x78';
14
- export const serializedType = '0x76';
15
- export const type = 'tempo';
16
- /**
17
- * Asserts a {@link ox#TransactionEnvelopeTempo.TransactionEnvelopeTempo} is valid.
18
- *
19
- * @example
20
- * ```ts twoslash
21
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
22
- *
23
- * TransactionEnvelopeTempo.assert({
24
- * calls: [{ to: '0x0000000000000000000000000000000000000000', value: 0n }],
25
- * chainId: 1,
26
- * maxFeePerGas: 1000000000n,
27
- * })
28
- * ```
29
- *
30
- * @param envelope - The transaction envelope to assert.
31
- */
32
- export function assert(envelope) {
33
- const { calls, chainId, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter, } = envelope;
34
- // Calls must not be empty
35
- if (!calls || calls.length === 0)
36
- throw new CallsEmptyError();
37
- // validBefore must be greater than validAfter if both are set
38
- if (typeof validBefore === 'number' &&
39
- typeof validAfter === 'number' &&
40
- validBefore <= validAfter) {
41
- throw new InvalidValidityWindowError({
42
- validBefore: validBefore,
43
- validAfter: validAfter,
44
- });
45
- }
46
- // Validate each call
47
- if (calls)
48
- for (const call of calls)
49
- if (call.to)
50
- Address.assert(call.to, { strict: false });
51
- // Validate chain ID
52
- if (chainId <= 0)
53
- throw new TransactionEnvelope.InvalidChainIdError({ chainId });
54
- // Validate max fee per gas
55
- if (maxFeePerGas && BigInt(maxFeePerGas) > 2n ** 256n - 1n)
56
- throw new TransactionEnvelope.FeeCapTooHighError({
57
- feeCap: maxFeePerGas,
58
- });
59
- if (maxPriorityFeePerGas &&
60
- maxFeePerGas &&
61
- maxPriorityFeePerGas > maxFeePerGas)
62
- throw new TransactionEnvelope.TipAboveFeeCapError({
63
- maxFeePerGas,
64
- maxPriorityFeePerGas,
65
- });
66
- }
67
- /**
68
- * Deserializes a {@link ox#TransactionEnvelopeTempo.TransactionEnvelopeTempo} from its serialized form.
69
- *
70
- * @example
71
- * ```ts twoslash
72
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
73
- *
74
- * const envelope = TransactionEnvelopeTempo.deserialize('0x76f84a0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0808080')
75
- * // @log: {
76
- * // @log: type: 'tempo',
77
- * // @log: nonce: 785n,
78
- * // @log: maxFeePerGas: 2000000000n,
79
- * // @log: gas: 1000000n,
80
- * // @log: calls: [{ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n }],
81
- * // @log: }
82
- * ```
83
- *
84
- * @param serialized - The serialized transaction.
85
- * @returns Deserialized Transaction Envelope.
86
- */
87
- export function deserialize(serialized) {
88
- const transactionArray = Rlp.toHex(Hex.slice(serialized, 1));
89
- const [chainId, maxPriorityFeePerGas, maxFeePerGas, gas, calls, accessList, nonceKey, nonce, validBefore, validAfter, feeToken, feePayerSignatureOrSender, authorizationList, keyAuthorizationOrSignature, maybeSignature,] = transactionArray;
90
- const keyAuthorization = Array.isArray(keyAuthorizationOrSignature)
91
- ? keyAuthorizationOrSignature
92
- : undefined;
93
- const signature = keyAuthorization
94
- ? maybeSignature
95
- : keyAuthorizationOrSignature;
96
- if (!(transactionArray.length === 13 ||
97
- transactionArray.length === 14 ||
98
- transactionArray.length === 15))
99
- throw new TransactionEnvelope.InvalidSerializedError({
100
- attributes: {
101
- authorizationList,
102
- chainId,
103
- maxPriorityFeePerGas,
104
- maxFeePerGas,
105
- gas,
106
- calls,
107
- accessList,
108
- keyAuthorization,
109
- nonceKey,
110
- nonce,
111
- validBefore,
112
- validAfter,
113
- feeToken,
114
- feePayerSignatureOrSender,
115
- ...(transactionArray.length > 12
116
- ? {
117
- signature,
118
- }
119
- : {}),
120
- },
121
- serialized,
122
- type,
123
- });
124
- let transaction = {
125
- chainId: Number(chainId),
126
- type,
127
- };
128
- if (Hex.validate(gas) && gas !== '0x')
129
- transaction.gas = BigInt(gas);
130
- if (Hex.validate(nonce))
131
- transaction.nonce = nonce === '0x' ? 0n : BigInt(nonce);
132
- if (Hex.validate(maxFeePerGas) && maxFeePerGas !== '0x')
133
- transaction.maxFeePerGas = BigInt(maxFeePerGas);
134
- if (Hex.validate(maxPriorityFeePerGas) && maxPriorityFeePerGas !== '0x')
135
- transaction.maxPriorityFeePerGas = BigInt(maxPriorityFeePerGas);
136
- if (Hex.validate(nonceKey))
137
- transaction.nonceKey = nonceKey === '0x' ? 0n : BigInt(nonceKey);
138
- if (Hex.validate(validBefore) && validBefore !== '0x')
139
- transaction.validBefore = Number(validBefore);
140
- if (Hex.validate(validAfter) && validAfter !== '0x')
141
- transaction.validAfter = Number(validAfter);
142
- if (Hex.validate(feeToken) && feeToken !== '0x')
143
- transaction.feeToken = feeToken;
144
- // Parse calls array
145
- if (calls && calls !== '0x') {
146
- const callsArray = calls;
147
- transaction.calls = callsArray.map((callTuple) => {
148
- const [to, value, data] = callTuple;
149
- const call = {};
150
- if (to && to !== '0x')
151
- call.to = to;
152
- if (value && value !== '0x')
153
- call.value = BigInt(value);
154
- if (data && data !== '0x')
155
- call.data = data;
156
- return call;
157
- });
158
- }
159
- if (accessList?.length !== 0 && accessList !== '0x')
160
- transaction.accessList = AccessList.fromTupleList(accessList);
161
- if (authorizationList?.length !== 0 && authorizationList !== '0x')
162
- transaction.authorizationList = AuthorizationTempo.fromTupleList(authorizationList);
163
- if (feePayerSignatureOrSender !== '0x' &&
164
- feePayerSignatureOrSender !== undefined) {
165
- if (feePayerSignatureOrSender === '0x00' ||
166
- Address.validate(feePayerSignatureOrSender))
167
- transaction.feePayerSignature = null;
168
- else
169
- transaction.feePayerSignature = Signature.fromTuple(feePayerSignatureOrSender);
170
- }
171
- if (keyAuthorization)
172
- transaction.keyAuthorization = KeyAuthorization.fromTuple(keyAuthorization);
173
- const signatureEnvelope = signature
174
- ? SignatureEnvelope.deserialize(signature)
175
- : undefined;
176
- if (signatureEnvelope)
177
- transaction = {
178
- ...transaction,
179
- signature: signatureEnvelope,
180
- };
181
- assert(transaction);
182
- return transaction;
183
- }
184
- /**
185
- * Converts an arbitrary transaction object into a Tempo Transaction Envelope.
186
- *
187
- * @example
188
- * ```ts twoslash
189
- * import { Value } from 'ox'
190
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
191
- *
192
- * const envelope = TransactionEnvelopeTempo.from({ // [!code focus]
193
- * chainId: 1, // [!code focus]
194
- * calls: [{ to: '0x0000000000000000000000000000000000000000', value: Value.fromEther('1') }], // [!code focus]
195
- * maxFeePerGas: Value.fromGwei('10'), // [!code focus]
196
- * maxPriorityFeePerGas: Value.fromGwei('1'), // [!code focus]
197
- * }) // [!code focus]
198
- * ```
199
- *
200
- * @example
201
- * ### Attaching Signatures
202
- *
203
- * It is possible to attach a `signature` to the transaction envelope.
204
- *
205
- * ```ts twoslash
206
- * // @noErrors
207
- * import { Secp256k1, Value } from 'ox'
208
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
209
- *
210
- * const envelope = TransactionEnvelopeTempo.from({
211
- * chainId: 1,
212
- * calls: [{ to: '0x0000000000000000000000000000000000000000', value: Value.fromEther('1') }],
213
- * maxFeePerGas: Value.fromGwei('10'),
214
- * maxPriorityFeePerGas: Value.fromGwei('1'),
215
- * })
216
- *
217
- * const signature = Secp256k1.sign({
218
- * payload: TransactionEnvelopeTempo.getSignPayload(envelope),
219
- * privateKey: '0x...',
220
- * })
221
- *
222
- * const envelope_signed = TransactionEnvelopeTempo.from(envelope, { // [!code focus]
223
- * signature, // [!code focus]
224
- * }) // [!code focus]
225
- * // @log: {
226
- * // @log: chainId: 1,
227
- * // @log: calls: [{ to: '0x0000000000000000000000000000000000000000', value: 1000000000000000000n }],
228
- * // @log: maxFeePerGas: 10000000000n,
229
- * // @log: maxPriorityFeePerGas: 1000000000n,
230
- * // @log: type: 'tempo',
231
- * // @log: r: 125...n,
232
- * // @log: s: 642...n,
233
- * // @log: yParity: 0,
234
- * // @log: }
235
- * ```
236
- *
237
- * @example
238
- * ### From Serialized
239
- *
240
- * It is possible to instantiate a Tempo Transaction Envelope from a {@link ox#TransactionEnvelopeTempo.Serialized} value.
241
- *
242
- * ```ts twoslash
243
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
244
- *
245
- * const envelope = TransactionEnvelopeTempo.from('0x76f84a0182031184773594008477359400809470997970c51812dc3a010c7d01b50e0d17dc79c8880de0b6b3a764000080c0808080')
246
- * // @log: {
247
- * // @log: chainId: 1,
248
- * // @log: calls: [{ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n }],
249
- * // @log: maxFeePerGas: 10000000000n,
250
- * // @log: type: 'tempo',
251
- * // @log: }
252
- * ```
253
- *
254
- * @param envelope - The transaction object to convert.
255
- * @param options - Options.
256
- * @returns A Tempo Transaction Envelope.
257
- */
258
- export function from(envelope, options = {}) {
259
- const { feePayerSignature, signature } = options;
260
- const envelope_ = (typeof envelope === 'string' ? deserialize(envelope) : envelope);
261
- assert(envelope_);
262
- return {
263
- ...envelope_,
264
- ...(signature ? { signature: SignatureEnvelope.from(signature) } : {}),
265
- ...(feePayerSignature
266
- ? { feePayerSignature: Signature.from(feePayerSignature) }
267
- : {}),
268
- type: 'tempo',
269
- };
270
- }
271
- /**
272
- * Serializes a {@link ox#TransactionEnvelopeTempo.TransactionEnvelopeTempo}.
273
- *
274
- * @example
275
- * ```ts twoslash
276
- * // @noErrors
277
- * import { Value } from 'ox'
278
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
279
- *
280
- * const envelope = TransactionEnvelopeTempo.from({
281
- * chainId: 1,
282
- * calls: [{ to: '0x0000000000000000000000000000000000000000', value: Value.fromEther('1') }],
283
- * maxFeePerGas: Value.fromGwei('10'),
284
- * })
285
- *
286
- * const serialized = TransactionEnvelopeTempo.serialize(envelope) // [!code focus]
287
- * ```
288
- *
289
- * @example
290
- * ### Attaching Signatures
291
- *
292
- * It is possible to attach a `signature` to the serialized Transaction Envelope.
293
- *
294
- * ```ts twoslash
295
- * // @noErrors
296
- * import { Secp256k1, Value } from 'ox'
297
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
298
- *
299
- * const envelope = TransactionEnvelopeTempo.from({
300
- * chainId: 1,
301
- * calls: [{ to: '0x0000000000000000000000000000000000000000', value: Value.fromEther('1') }],
302
- * maxFeePerGas: Value.fromGwei('10'),
303
- * })
304
- *
305
- * const signature = Secp256k1.sign({
306
- * payload: TransactionEnvelopeTempo.getSignPayload(envelope),
307
- * privateKey: '0x...',
308
- * })
309
- *
310
- * const serialized = TransactionEnvelopeTempo.serialize(envelope, { // [!code focus]
311
- * signature, // [!code focus]
312
- * }) // [!code focus]
313
- *
314
- * // ... send `serialized` transaction to JSON-RPC `eth_sendRawTransaction`
315
- * ```
316
- *
317
- * @param envelope - The Transaction Envelope to serialize.
318
- * @param options - Options.
319
- * @returns The serialized Transaction Envelope.
320
- */
321
- export function serialize(envelope, options = {}) {
322
- const { accessList, authorizationList, calls, chainId, feeToken, gas, keyAuthorization, nonce, nonceKey, maxFeePerGas, maxPriorityFeePerGas, validBefore, validAfter, } = envelope;
323
- assert(envelope);
324
- const accessTupleList = AccessList.toTupleList(accessList);
325
- const signature = options.signature || envelope.signature;
326
- const authorizationTupleList = AuthorizationTempo.toTupleList(authorizationList);
327
- // Encode calls as RLP list of [to, value, data] tuples
328
- const callsTupleList = calls.map((call) => [
329
- call.to ?? '0x',
330
- call.value ? Hex.fromNumber(call.value) : '0x',
331
- call.data ?? '0x',
332
- ]);
333
- const feePayerSignatureOrSender = (() => {
334
- if (options.sender)
335
- return options.sender;
336
- const feePayerSignature = typeof options.feePayerSignature !== 'undefined'
337
- ? options.feePayerSignature
338
- : envelope.feePayerSignature;
339
- if (feePayerSignature === null)
340
- return '0x00';
341
- if (!feePayerSignature)
342
- return '0x';
343
- return Signature.toTuple(feePayerSignature);
344
- })();
345
- const serialized = [
346
- Hex.fromNumber(chainId),
347
- maxPriorityFeePerGas ? Hex.fromNumber(maxPriorityFeePerGas) : '0x',
348
- maxFeePerGas ? Hex.fromNumber(maxFeePerGas) : '0x',
349
- gas ? Hex.fromNumber(gas) : '0x',
350
- callsTupleList,
351
- accessTupleList,
352
- nonceKey ? Hex.fromNumber(nonceKey) : '0x',
353
- nonce ? Hex.fromNumber(nonce) : '0x',
354
- typeof validBefore === 'number' ? Hex.fromNumber(validBefore) : '0x',
355
- typeof validAfter === 'number' ? Hex.fromNumber(validAfter) : '0x',
356
- typeof feeToken === 'bigint' || typeof feeToken === 'string'
357
- ? TokenId.toAddress(feeToken)
358
- : '0x',
359
- feePayerSignatureOrSender,
360
- authorizationTupleList,
361
- ...(keyAuthorization ? [KeyAuthorization.toTuple(keyAuthorization)] : []),
362
- ...(signature
363
- ? [SignatureEnvelope.serialize(SignatureEnvelope.from(signature))]
364
- : []),
365
- ];
366
- return Hex.concat(options.format === 'feePayer' ? feePayerMagic : serializedType, Rlp.fromHex(serialized));
367
- }
368
- /**
369
- * Returns the payload to sign for a {@link ox#TransactionEnvelopeTempo.TransactionEnvelopeTempo}.
370
- *
371
- * @example
372
- * The example below demonstrates how to compute the sign payload which can be used
373
- * with ECDSA signing utilities like {@link ox#Secp256k1.(sign:function)}.
374
- *
375
- * ```ts twoslash
376
- * // @noErrors
377
- * import { Secp256k1 } from 'ox'
378
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
379
- *
380
- * const envelope = TransactionEnvelopeTempo.from({
381
- * chainId: 1,
382
- * calls: [{ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n }],
383
- * nonce: 0n,
384
- * maxFeePerGas: 1000000000n,
385
- * gas: 21000n,
386
- * })
387
- *
388
- * const payload = TransactionEnvelopeTempo.getSignPayload(envelope) // [!code focus]
389
- * // @log: '0x...'
390
- *
391
- * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
392
- * ```
393
- *
394
- * @param envelope - The transaction envelope to get the sign payload for.
395
- * @returns The sign payload.
396
- */
397
- export function getSignPayload(envelope) {
398
- return hash(envelope, { presign: true });
399
- }
400
- /**
401
- * Hashes a {@link ox#TransactionEnvelopeTempo.TransactionEnvelopeTempo}. This is the "transaction hash".
402
- *
403
- * @example
404
- * ```ts twoslash
405
- * // @noErrors
406
- * import { Secp256k1 } from 'ox'
407
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
408
- *
409
- * const envelope = TransactionEnvelopeTempo.from({
410
- * chainId: 1,
411
- * calls: [{ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n }],
412
- * nonce: 0n,
413
- * maxFeePerGas: 1000000000n,
414
- * gas: 21000n,
415
- * })
416
- *
417
- * const signature = Secp256k1.sign({
418
- * payload: TransactionEnvelopeTempo.getSignPayload(envelope),
419
- * privateKey: '0x...'
420
- * })
421
- *
422
- * const envelope_signed = TransactionEnvelopeTempo.from(envelope, { signature })
423
- *
424
- * const hash = TransactionEnvelopeTempo.hash(envelope_signed) // [!code focus]
425
- * ```
426
- *
427
- * @param envelope - The Tempo Transaction Envelope to hash.
428
- * @param options - Options.
429
- * @returns The hash of the transaction envelope.
430
- */
431
- export function hash(envelope, options = {}) {
432
- const serialized = serialize({
433
- ...envelope,
434
- ...(options.presign
435
- ? {
436
- signature: undefined,
437
- }
438
- : {}),
439
- });
440
- return Hash.keccak256(serialized);
441
- }
442
- /**
443
- * Returns the fee payer payload to sign for a {@link ox#TransactionEnvelopeTempo.TransactionEnvelopeTempo}.
444
- *
445
- * @example
446
- * ```ts twoslash
447
- * // @noErrors
448
- * import { Secp256k1 } from 'ox'
449
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
450
- *
451
- * const envelope = TransactionEnvelopeTempo.from({
452
- * chainId: 1,
453
- * calls: [{ to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8', value: 1000000000000000000n }],
454
- * nonce: 0n,
455
- * maxFeePerGas: 1000000000n,
456
- * gas: 21000n,
457
- * })
458
- *
459
- * const payload = TransactionEnvelopeTempo.getFeePayerSignPayload(envelope, {
460
- * sender: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045'
461
- * }) // [!code focus]
462
- * // @log: '0x...'
463
- *
464
- * const signature = Secp256k1.sign({ payload, privateKey: '0x...' })
465
- * ```
466
- *
467
- * @param envelope - The transaction envelope to get the fee payer sign payload for.
468
- * @param options - Options.
469
- * @returns The fee payer sign payload.
470
- */
471
- export function getFeePayerSignPayload(envelope, options) {
472
- const { sender } = options;
473
- const serialized = serialize({ ...envelope, signature: undefined }, {
474
- sender,
475
- format: 'feePayer',
476
- });
477
- return Hash.keccak256(serialized);
478
- }
479
- /**
480
- * Validates a {@link ox#TransactionEnvelopeTempo.TransactionEnvelopeTempo}. Returns `true` if the envelope is valid, `false` otherwise.
481
- *
482
- * @example
483
- * ```ts twoslash
484
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
485
- *
486
- * const valid = TransactionEnvelopeTempo.validate({
487
- * calls: [{ to: '0x0000000000000000000000000000000000000000', value: 0n }],
488
- * chainId: 1,
489
- * maxFeePerGas: 1000000000n,
490
- * })
491
- * // @log: true
492
- * ```
493
- *
494
- * @param envelope - The transaction envelope to validate.
495
- */
496
- export function validate(envelope) {
497
- try {
498
- assert(envelope);
499
- return true;
500
- }
501
- catch {
502
- return false;
503
- }
504
- }
505
- /**
506
- * Thrown when a transaction's calls list is empty.
507
- *
508
- * @example
509
- * ```ts twoslash
510
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
511
- *
512
- * TransactionEnvelopeTempo.assert({
513
- * calls: [],
514
- * chainId: 1,
515
- * })
516
- * // @error: TransactionEnvelopeTempo.CallsEmptyError: Calls list cannot be empty.
517
- * ```
518
- */
519
- export class CallsEmptyError extends Errors.BaseError {
520
- name = 'TransactionEnvelopeTempo.CallsEmptyError';
521
- constructor() {
522
- super('Calls list cannot be empty.');
523
- }
524
- }
525
- /**
526
- * Thrown when validBefore is not greater than validAfter.
527
- *
528
- * @example
529
- * ```ts twoslash
530
- * import { TransactionEnvelopeTempo } from 'ox/tempo'
531
- *
532
- * TransactionEnvelopeTempo.assert({
533
- * calls: [{ to: '0x0000000000000000000000000000000000000000' }],
534
- * chainId: 1,
535
- * validBefore: 100n,
536
- * validAfter: 200n,
537
- * })
538
- * // @error: TransactionEnvelopeTempo.InvalidValidityWindowError: validBefore (100) must be greater than validAfter (200).
539
- * ```
540
- */
541
- export class InvalidValidityWindowError extends Errors.BaseError {
542
- name = 'TransactionEnvelopeTempo.InvalidValidityWindowError';
543
- constructor({ validBefore, validAfter, }) {
544
- super(`validBefore (${validBefore}) must be greater than validAfter (${validAfter}).`);
545
- }
546
- }
547
- //# sourceMappingURL=TransactionEnvelopeTempo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TransactionEnvelopeTempo.js","sourceRoot":"","sources":["../../src/ox/TransactionEnvelopeTempo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,OAAO,MAAM,YAAY,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