tempo.ts 0.8.3 → 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.
- package/CHANGELOG.md +33 -0
- package/dist/ox/AuthorizationTempo.d.ts +450 -0
- package/dist/ox/AuthorizationTempo.d.ts.map +1 -0
- package/dist/ox/AuthorizationTempo.js +433 -0
- package/dist/ox/AuthorizationTempo.js.map +1 -0
- package/dist/ox/KeyAuthorization.d.ts +4 -4
- package/dist/ox/KeyAuthorization.d.ts.map +1 -1
- package/dist/ox/KeyAuthorization.js +5 -6
- package/dist/ox/KeyAuthorization.js.map +1 -1
- package/dist/ox/Transaction.d.ts +11 -10
- package/dist/ox/Transaction.d.ts.map +1 -1
- package/dist/ox/Transaction.js +10 -3
- package/dist/ox/Transaction.js.map +1 -1
- package/dist/ox/{TransactionEnvelopeAA.d.ts → TransactionEnvelopeTempo.d.ts} +73 -73
- package/dist/ox/TransactionEnvelopeTempo.d.ts.map +1 -0
- package/dist/ox/{TransactionEnvelopeAA.js → TransactionEnvelopeTempo.js} +65 -61
- package/dist/ox/TransactionEnvelopeTempo.js.map +1 -0
- package/dist/ox/TransactionReceipt.d.ts +3 -3
- package/dist/ox/TransactionReceipt.d.ts.map +1 -1
- package/dist/ox/TransactionReceipt.js +2 -2
- package/dist/ox/TransactionReceipt.js.map +1 -1
- package/dist/ox/TransactionRequest.d.ts +7 -5
- package/dist/ox/TransactionRequest.d.ts.map +1 -1
- package/dist/ox/TransactionRequest.js +9 -3
- package/dist/ox/TransactionRequest.js.map +1 -1
- package/dist/ox/index.d.ts +2 -1
- package/dist/ox/index.d.ts.map +1 -1
- package/dist/ox/index.js +2 -1
- package/dist/ox/index.js.map +1 -1
- package/dist/viem/Chain.d.ts +11 -6
- package/dist/viem/Chain.d.ts.map +1 -1
- package/dist/viem/Chain.js +1 -0
- package/dist/viem/Chain.js.map +1 -1
- package/dist/viem/Formatters.d.ts.map +1 -1
- package/dist/viem/Formatters.js +4 -17
- package/dist/viem/Formatters.js.map +1 -1
- package/dist/viem/Transaction.d.ts +21 -21
- package/dist/viem/Transaction.d.ts.map +1 -1
- package/dist/viem/Transaction.js +17 -30
- package/dist/viem/Transaction.js.map +1 -1
- package/dist/viem/internal/types.d.ts +2 -2
- package/dist/viem/internal/types.d.ts.map +1 -1
- package/dist/wagmi/Connector.d.ts +6 -12
- package/dist/wagmi/Connector.d.ts.map +1 -1
- package/dist/wagmi/Connector.js +73 -18
- package/dist/wagmi/Connector.js.map +1 -1
- package/package.json +1 -1
- package/src/ox/AuthorizationTempo.test.ts +1256 -0
- package/src/ox/AuthorizationTempo.ts +648 -0
- package/src/ox/KeyAuthorization.ts +8 -10
- package/src/ox/Transaction.test.ts +6 -6
- package/src/ox/Transaction.ts +25 -14
- package/src/ox/{TransactionEnvelopeAA.test.ts → TransactionEnvelopeTempo.test.ts} +326 -141
- package/src/ox/{TransactionEnvelopeAA.ts → TransactionEnvelopeTempo.ts} +93 -81
- package/src/ox/TransactionReceipt.ts +3 -3
- package/src/ox/TransactionRequest.ts +22 -8
- package/src/ox/e2e.test.ts +159 -78
- package/src/ox/index.ts +2 -1
- package/src/viem/Chain.ts +1 -0
- package/src/viem/Formatters.ts +6 -19
- package/src/viem/Transaction.ts +50 -68
- package/src/viem/e2e.test.ts +28 -42
- package/src/viem/internal/types.ts +2 -2
- package/src/wagmi/Connector.ts +104 -31
- package/dist/ox/TransactionEnvelopeAA.d.ts.map +0 -1
- package/dist/ox/TransactionEnvelopeAA.js.map +0 -1
package/src/viem/Transaction.ts
CHANGED
|
@@ -7,10 +7,8 @@ import {
|
|
|
7
7
|
type AccessList,
|
|
8
8
|
type Account,
|
|
9
9
|
type Address,
|
|
10
|
-
type AuthorizationList,
|
|
11
10
|
type FeeValuesEIP1559,
|
|
12
11
|
type ParseTransactionReturnType,
|
|
13
|
-
type SignedAuthorizationList,
|
|
14
12
|
type TransactionBase,
|
|
15
13
|
type TransactionRequestBase,
|
|
16
14
|
type TransactionSerializableBase,
|
|
@@ -29,9 +27,10 @@ import {
|
|
|
29
27
|
type TransactionType as viem_TransactionType,
|
|
30
28
|
} from 'viem'
|
|
31
29
|
import type { ExactPartial, OneOf, PartialBy } from '../internal/types.js'
|
|
30
|
+
import type * as AuthorizationTempo from '../ox/AuthorizationTempo.js'
|
|
32
31
|
import type * as KeyAuthorization from '../ox/KeyAuthorization.js'
|
|
33
32
|
import * as SignatureEnvelope from '../ox/SignatureEnvelope.js'
|
|
34
|
-
import * as
|
|
33
|
+
import * as TxTempo from '../ox/TransactionEnvelopeTempo.js'
|
|
35
34
|
import type * as ox_TransactionReceipt from '../ox/TransactionReceipt.js'
|
|
36
35
|
|
|
37
36
|
export type Transaction<
|
|
@@ -40,24 +39,25 @@ export type Transaction<
|
|
|
40
39
|
pending extends boolean = false,
|
|
41
40
|
> = OneOf<
|
|
42
41
|
| viem_Transaction<bigintType, numberType, pending>
|
|
43
|
-
|
|
|
42
|
+
| TransactionTempo<bigintType, numberType, pending>
|
|
44
43
|
>
|
|
45
44
|
export type TransactionRpc<pending extends boolean = false> = OneOf<
|
|
46
45
|
| viem_RpcTransaction<pending>
|
|
47
46
|
| (Omit<
|
|
48
|
-
|
|
49
|
-
'keyAuthorization' | 'signature'
|
|
47
|
+
TransactionTempo<Hex.Hex, Hex.Hex, pending, '0x76'>,
|
|
48
|
+
'authorizationList' | 'keyAuthorization' | 'signature'
|
|
50
49
|
> & {
|
|
50
|
+
authorizationList?: AuthorizationTempo.ListRpc | undefined
|
|
51
51
|
keyAuthorization?: KeyAuthorization.Rpc | null | undefined
|
|
52
52
|
signature: SignatureEnvelope.SignatureEnvelopeRpc
|
|
53
53
|
})
|
|
54
54
|
>
|
|
55
55
|
|
|
56
|
-
export type
|
|
56
|
+
export type TransactionTempo<
|
|
57
57
|
quantity = bigint,
|
|
58
58
|
index = number,
|
|
59
59
|
isPending extends boolean = boolean,
|
|
60
|
-
type = '
|
|
60
|
+
type = 'tempo',
|
|
61
61
|
> = PartialBy<
|
|
62
62
|
Omit<
|
|
63
63
|
TransactionBase<quantity, index, isPending>,
|
|
@@ -66,8 +66,8 @@ export type TransactionAA<
|
|
|
66
66
|
'r' | 's' | 'v' | 'yParity'
|
|
67
67
|
> & {
|
|
68
68
|
accessList: AccessList
|
|
69
|
-
authorizationList?:
|
|
70
|
-
calls: readonly
|
|
69
|
+
authorizationList?: AuthorizationTempo.ListSigned<quantity, index> | undefined
|
|
70
|
+
calls: readonly TxTempo.Call<quantity>[]
|
|
71
71
|
chainId: index
|
|
72
72
|
feeToken?: Address | undefined
|
|
73
73
|
feePayerSignature?: viem_Signature | undefined
|
|
@@ -84,10 +84,10 @@ export type TransactionRequest<
|
|
|
84
84
|
numberType = number,
|
|
85
85
|
> = OneOf<
|
|
86
86
|
| viem_TransactionRequest<bigintType, numberType>
|
|
87
|
-
|
|
|
87
|
+
| TransactionRequestTempo<bigintType, numberType>
|
|
88
88
|
>
|
|
89
89
|
export type TransactionRequestRpc = OneOf<
|
|
90
|
-
viem_RpcTransactionRequest |
|
|
90
|
+
viem_RpcTransactionRequest | TransactionRequestTempo<Hex.Hex, Hex.Hex, '0x76'>
|
|
91
91
|
>
|
|
92
92
|
|
|
93
93
|
export type TransactionReceipt<
|
|
@@ -107,16 +107,15 @@ export type TransactionReceiptRpc = TransactionReceipt<
|
|
|
107
107
|
ox_TransactionReceipt.RpcType
|
|
108
108
|
>
|
|
109
109
|
|
|
110
|
-
export type
|
|
110
|
+
export type TransactionRequestTempo<
|
|
111
111
|
quantity = bigint,
|
|
112
112
|
index = number,
|
|
113
|
-
type = '
|
|
113
|
+
type = 'tempo',
|
|
114
114
|
> = TransactionRequestBase<quantity, index, type> &
|
|
115
115
|
ExactPartial<FeeValuesEIP1559<quantity>> & {
|
|
116
116
|
accessList?: AccessList | undefined
|
|
117
|
-
authorizationList?: AuthorizationList<index, boolean> | undefined
|
|
118
117
|
keyAuthorization?: KeyAuthorization.Signed<quantity, index> | undefined
|
|
119
|
-
calls?: readonly
|
|
118
|
+
calls?: readonly TxTempo.Call<quantity>[] | undefined
|
|
120
119
|
feePayer?: Account | true | undefined
|
|
121
120
|
feeToken?: Address | bigint | undefined
|
|
122
121
|
nonceKey?: 'random' | quantity | undefined
|
|
@@ -125,17 +124,16 @@ export type TransactionRequestAA<
|
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
export type TransactionSerializable = OneOf<
|
|
128
|
-
viem_TransactionSerializable |
|
|
127
|
+
viem_TransactionSerializable | TransactionSerializableTempo
|
|
129
128
|
>
|
|
130
129
|
|
|
131
|
-
export type
|
|
130
|
+
export type TransactionSerializableTempo<
|
|
132
131
|
quantity = bigint,
|
|
133
132
|
index = number,
|
|
134
133
|
> = TransactionSerializableBase<quantity, index> &
|
|
135
134
|
ExactPartial<FeeValuesEIP1559<quantity>> & {
|
|
136
135
|
accessList?: AccessList | undefined
|
|
137
|
-
|
|
138
|
-
calls: readonly TxAA.Call<quantity>[]
|
|
136
|
+
calls: readonly TxTempo.Call<quantity>[]
|
|
139
137
|
chainId: number
|
|
140
138
|
feeToken?: Address | bigint | undefined
|
|
141
139
|
feePayerSignature?: viem_Signature | null | undefined
|
|
@@ -144,16 +142,16 @@ export type TransactionSerializableAA<
|
|
|
144
142
|
signature?: SignatureEnvelope.SignatureEnvelope<quantity, index> | undefined
|
|
145
143
|
validBefore?: index | undefined
|
|
146
144
|
validAfter?: index | undefined
|
|
147
|
-
type?: '
|
|
145
|
+
type?: 'tempo' | undefined
|
|
148
146
|
}
|
|
149
147
|
|
|
150
148
|
export type TransactionSerialized<
|
|
151
149
|
type extends TransactionType = TransactionType,
|
|
152
|
-
> = viem_TransactionSerialized<type> |
|
|
150
|
+
> = viem_TransactionSerialized<type> | TransactionSerializedTempo
|
|
153
151
|
|
|
154
|
-
export type
|
|
152
|
+
export type TransactionSerializedTempo = `0x76${string}`
|
|
155
153
|
|
|
156
|
-
export type TransactionType = viem_TransactionType | '
|
|
154
|
+
export type TransactionType = viem_TransactionType | 'tempo'
|
|
157
155
|
|
|
158
156
|
export function getType(
|
|
159
157
|
transaction: Record<string, unknown>,
|
|
@@ -167,7 +165,7 @@ export function getType(
|
|
|
167
165
|
typeof transaction.validBefore !== 'undefined' ||
|
|
168
166
|
typeof transaction.validAfter !== 'undefined'
|
|
169
167
|
)
|
|
170
|
-
return '
|
|
168
|
+
return 'tempo' as never
|
|
171
169
|
if (transaction.type) return transaction.type as never
|
|
172
170
|
return viem_getTransactionType(transaction) as never
|
|
173
171
|
}
|
|
@@ -175,7 +173,7 @@ export function getType(
|
|
|
175
173
|
export function isTempo(transaction: Record<string, unknown>) {
|
|
176
174
|
try {
|
|
177
175
|
const type = getType(transaction)
|
|
178
|
-
return type === '
|
|
176
|
+
return type === 'tempo'
|
|
179
177
|
} catch {
|
|
180
178
|
return false
|
|
181
179
|
}
|
|
@@ -191,7 +189,7 @@ export function deserialize<
|
|
|
191
189
|
? Hex.slice(serializedTransaction, -26, -6)
|
|
192
190
|
: undefined
|
|
193
191
|
return {
|
|
194
|
-
...
|
|
192
|
+
...deserializeTempo(serializedTransaction as `0x76${string}`),
|
|
195
193
|
from,
|
|
196
194
|
} as never
|
|
197
195
|
}
|
|
@@ -202,8 +200,8 @@ export declare namespace deserialize {
|
|
|
202
200
|
export type ReturnValue<
|
|
203
201
|
serialized extends
|
|
204
202
|
TransactionSerializedGeneric = TransactionSerializedGeneric,
|
|
205
|
-
> = serialized extends
|
|
206
|
-
?
|
|
203
|
+
> = serialized extends TransactionSerializedTempo
|
|
204
|
+
? TransactionSerializableTempo
|
|
207
205
|
: ParseTransactionReturnType<serialized>
|
|
208
206
|
}
|
|
209
207
|
|
|
@@ -236,8 +234,11 @@ export async function serialize(
|
|
|
236
234
|
}
|
|
237
235
|
|
|
238
236
|
const type = getType(transaction)
|
|
239
|
-
if (type === '
|
|
240
|
-
return
|
|
237
|
+
if (type === 'tempo')
|
|
238
|
+
return serializeTempo(
|
|
239
|
+
transaction as TransactionSerializableTempo,
|
|
240
|
+
signature,
|
|
241
|
+
)
|
|
241
242
|
|
|
242
243
|
throw new Error('Unsupported transaction type')
|
|
243
244
|
}
|
|
@@ -246,19 +247,14 @@ export async function serialize(
|
|
|
246
247
|
// Internal
|
|
247
248
|
|
|
248
249
|
/** @internal */
|
|
249
|
-
function
|
|
250
|
-
serializedTransaction:
|
|
251
|
-
):
|
|
252
|
-
const {
|
|
253
|
-
|
|
250
|
+
function deserializeTempo(
|
|
251
|
+
serializedTransaction: TransactionSerializedTempo,
|
|
252
|
+
): TransactionSerializableTempo {
|
|
253
|
+
const { feePayerSignature, nonce, ...tx } = TxTempo.deserialize(
|
|
254
|
+
serializedTransaction,
|
|
255
|
+
)
|
|
254
256
|
return {
|
|
255
257
|
...tx,
|
|
256
|
-
authorizationList: authorizationList?.map((auth) => ({
|
|
257
|
-
...auth,
|
|
258
|
-
nonce: Number(auth.nonce ?? 0n),
|
|
259
|
-
r: Hex.fromNumber(auth.r, { size: 32 }),
|
|
260
|
-
s: Hex.fromNumber(auth.s, { size: 32 }),
|
|
261
|
-
})),
|
|
262
258
|
nonce: Number(nonce ?? 0n),
|
|
263
259
|
feePayerSignature: feePayerSignature
|
|
264
260
|
? {
|
|
@@ -267,12 +263,12 @@ function deserializeAA(
|
|
|
267
263
|
yParity: feePayerSignature.yParity,
|
|
268
264
|
}
|
|
269
265
|
: feePayerSignature,
|
|
270
|
-
} satisfies
|
|
266
|
+
} satisfies TransactionSerializableTempo
|
|
271
267
|
}
|
|
272
268
|
|
|
273
269
|
/** @internal */
|
|
274
|
-
async function
|
|
275
|
-
transaction:
|
|
270
|
+
async function serializeTempo(
|
|
271
|
+
transaction: TransactionSerializableTempo & {
|
|
276
272
|
feePayer?: Account | true | undefined
|
|
277
273
|
from?: Address | undefined
|
|
278
274
|
},
|
|
@@ -290,24 +286,10 @@ async function serializeAA(
|
|
|
290
286
|
return undefined
|
|
291
287
|
})()
|
|
292
288
|
|
|
293
|
-
const {
|
|
294
|
-
authorizationList,
|
|
295
|
-
chainId,
|
|
296
|
-
feePayer,
|
|
297
|
-
feePayerSignature,
|
|
298
|
-
nonce,
|
|
299
|
-
...rest
|
|
300
|
-
} = transaction
|
|
289
|
+
const { chainId, feePayer, feePayerSignature, nonce, ...rest } = transaction
|
|
301
290
|
|
|
302
291
|
const transaction_ox = {
|
|
303
292
|
...rest,
|
|
304
|
-
authorizationList: authorizationList?.map((auth) => ({
|
|
305
|
-
...auth,
|
|
306
|
-
nonce: BigInt(auth.nonce),
|
|
307
|
-
r: BigInt(auth.r!),
|
|
308
|
-
s: BigInt(auth.s!),
|
|
309
|
-
yParity: Number(auth.yParity),
|
|
310
|
-
})),
|
|
311
293
|
calls: rest.calls?.length
|
|
312
294
|
? rest.calls
|
|
313
295
|
: [
|
|
@@ -327,12 +309,12 @@ async function serializeAA(
|
|
|
327
309
|
: feePayer
|
|
328
310
|
? null
|
|
329
311
|
: undefined,
|
|
330
|
-
type: '
|
|
312
|
+
type: 'tempo',
|
|
331
313
|
...(nonce ? { nonce: BigInt(nonce) } : {}),
|
|
332
|
-
} satisfies
|
|
314
|
+
} satisfies TxTempo.TransactionEnvelopeTempo
|
|
333
315
|
|
|
334
316
|
if (signature && typeof transaction.feePayer === 'object') {
|
|
335
|
-
const tx =
|
|
317
|
+
const tx = TxTempo.from(transaction_ox, {
|
|
336
318
|
signature,
|
|
337
319
|
})
|
|
338
320
|
|
|
@@ -340,13 +322,13 @@ async function serializeAA(
|
|
|
340
322
|
if (transaction.from) return transaction.from
|
|
341
323
|
if (signature.type === 'secp256k1')
|
|
342
324
|
return Secp256k1.recoverAddress({
|
|
343
|
-
payload:
|
|
325
|
+
payload: TxTempo.getSignPayload(tx),
|
|
344
326
|
signature: signature.signature,
|
|
345
327
|
})
|
|
346
328
|
throw new Error('Unable to extract sender from transaction or signature.')
|
|
347
329
|
})()
|
|
348
330
|
|
|
349
|
-
const hash =
|
|
331
|
+
const hash = TxTempo.getFeePayerSignPayload(tx, {
|
|
350
332
|
sender,
|
|
351
333
|
})
|
|
352
334
|
|
|
@@ -354,13 +336,13 @@ async function serializeAA(
|
|
|
354
336
|
hash,
|
|
355
337
|
})
|
|
356
338
|
|
|
357
|
-
return
|
|
339
|
+
return TxTempo.serialize(tx, {
|
|
358
340
|
feePayerSignature: Signature.from(feePayerSignature),
|
|
359
341
|
})
|
|
360
342
|
}
|
|
361
343
|
|
|
362
344
|
if (feePayer === true) {
|
|
363
|
-
const serialized =
|
|
345
|
+
const serialized = TxTempo.serialize(transaction_ox, {
|
|
364
346
|
feePayerSignature: null,
|
|
365
347
|
signature,
|
|
366
348
|
})
|
|
@@ -372,7 +354,7 @@ async function serializeAA(
|
|
|
372
354
|
return serialized
|
|
373
355
|
}
|
|
374
356
|
|
|
375
|
-
return
|
|
357
|
+
return TxTempo.serialize(
|
|
376
358
|
// If we have specified a fee payer, the user will not be signing over the fee token.
|
|
377
359
|
// Defer the fee token signing to the fee payer.
|
|
378
360
|
{ ...transaction_ox, ...(feePayer ? { feeToken: undefined } : {}) },
|
package/src/viem/e2e.test.ts
CHANGED
|
@@ -68,9 +68,8 @@ describe('sendTransaction', () => {
|
|
|
68
68
|
expect(transactionIndex).toBeDefined()
|
|
69
69
|
expect(transaction).toMatchInlineSnapshot(`
|
|
70
70
|
{
|
|
71
|
-
"aaAuthorizationList": [],
|
|
72
71
|
"accessList": [],
|
|
73
|
-
"authorizationList":
|
|
72
|
+
"authorizationList": [],
|
|
74
73
|
"calls": [
|
|
75
74
|
{
|
|
76
75
|
"data": "0xdeadbeef",
|
|
@@ -83,7 +82,7 @@ describe('sendTransaction', () => {
|
|
|
83
82
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
84
83
|
"maxFeePerBlobGas": undefined,
|
|
85
84
|
"to": null,
|
|
86
|
-
"type": "
|
|
85
|
+
"type": "tempo",
|
|
87
86
|
"typeHex": "0x76",
|
|
88
87
|
"v": undefined,
|
|
89
88
|
"validAfter": null,
|
|
@@ -145,15 +144,14 @@ describe('sendTransaction', () => {
|
|
|
145
144
|
expect(transactionIndex).toBeDefined()
|
|
146
145
|
expect(transaction).toMatchInlineSnapshot(`
|
|
147
146
|
{
|
|
148
|
-
"aaAuthorizationList": [],
|
|
149
147
|
"accessList": [],
|
|
150
|
-
"authorizationList":
|
|
148
|
+
"authorizationList": [],
|
|
151
149
|
"data": undefined,
|
|
152
150
|
"feePayerSignature": undefined,
|
|
153
151
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
154
152
|
"maxFeePerBlobGas": undefined,
|
|
155
153
|
"to": null,
|
|
156
|
-
"type": "
|
|
154
|
+
"type": "tempo",
|
|
157
155
|
"typeHex": "0x76",
|
|
158
156
|
"v": undefined,
|
|
159
157
|
"validAfter": null,
|
|
@@ -210,9 +208,8 @@ describe('sendTransaction', () => {
|
|
|
210
208
|
expect(transactionIndex).toBeDefined()
|
|
211
209
|
expect(transaction).toMatchInlineSnapshot(`
|
|
212
210
|
{
|
|
213
|
-
"aaAuthorizationList": [],
|
|
214
211
|
"accessList": [],
|
|
215
|
-
"authorizationList":
|
|
212
|
+
"authorizationList": [],
|
|
216
213
|
"calls": [
|
|
217
214
|
{
|
|
218
215
|
"data": "0x",
|
|
@@ -224,7 +221,7 @@ describe('sendTransaction', () => {
|
|
|
224
221
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
225
222
|
"maxFeePerBlobGas": undefined,
|
|
226
223
|
"to": null,
|
|
227
|
-
"type": "
|
|
224
|
+
"type": "tempo",
|
|
228
225
|
"typeHex": "0x76",
|
|
229
226
|
"v": undefined,
|
|
230
227
|
"validAfter": null,
|
|
@@ -325,9 +322,8 @@ describe('sendTransaction', () => {
|
|
|
325
322
|
expect(transactionIndex).toBeDefined()
|
|
326
323
|
expect(transaction).toMatchInlineSnapshot(`
|
|
327
324
|
{
|
|
328
|
-
"aaAuthorizationList": [],
|
|
329
325
|
"accessList": [],
|
|
330
|
-
"authorizationList":
|
|
326
|
+
"authorizationList": [],
|
|
331
327
|
"calls": [
|
|
332
328
|
{
|
|
333
329
|
"data": "0xdeadbeef",
|
|
@@ -340,7 +336,7 @@ describe('sendTransaction', () => {
|
|
|
340
336
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
341
337
|
"maxFeePerBlobGas": undefined,
|
|
342
338
|
"to": null,
|
|
343
|
-
"type": "
|
|
339
|
+
"type": "tempo",
|
|
344
340
|
"typeHex": "0x76",
|
|
345
341
|
"v": undefined,
|
|
346
342
|
"validAfter": null,
|
|
@@ -410,15 +406,14 @@ describe('sendTransaction', () => {
|
|
|
410
406
|
expect(transactionIndex).toBeDefined()
|
|
411
407
|
expect(transaction).toMatchInlineSnapshot(`
|
|
412
408
|
{
|
|
413
|
-
"aaAuthorizationList": [],
|
|
414
409
|
"accessList": [],
|
|
415
|
-
"authorizationList":
|
|
410
|
+
"authorizationList": [],
|
|
416
411
|
"data": undefined,
|
|
417
412
|
"feePayerSignature": undefined,
|
|
418
413
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
419
414
|
"maxFeePerBlobGas": undefined,
|
|
420
415
|
"to": null,
|
|
421
|
-
"type": "
|
|
416
|
+
"type": "tempo",
|
|
422
417
|
"typeHex": "0x76",
|
|
423
418
|
"v": undefined,
|
|
424
419
|
"validAfter": null,
|
|
@@ -478,9 +473,8 @@ describe('sendTransaction', () => {
|
|
|
478
473
|
expect(transactionIndex).toBeDefined()
|
|
479
474
|
expect(transaction).toMatchInlineSnapshot(`
|
|
480
475
|
{
|
|
481
|
-
"aaAuthorizationList": [],
|
|
482
476
|
"accessList": [],
|
|
483
|
-
"authorizationList":
|
|
477
|
+
"authorizationList": [],
|
|
484
478
|
"calls": [
|
|
485
479
|
{
|
|
486
480
|
"data": "0x",
|
|
@@ -492,7 +486,7 @@ describe('sendTransaction', () => {
|
|
|
492
486
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
493
487
|
"maxFeePerBlobGas": undefined,
|
|
494
488
|
"to": null,
|
|
495
|
-
"type": "
|
|
489
|
+
"type": "tempo",
|
|
496
490
|
"typeHex": "0x76",
|
|
497
491
|
"v": undefined,
|
|
498
492
|
"validAfter": null,
|
|
@@ -608,9 +602,8 @@ describe('sendTransaction', () => {
|
|
|
608
602
|
expect(transactionIndex).toBeDefined()
|
|
609
603
|
expect(transaction).toMatchInlineSnapshot(`
|
|
610
604
|
{
|
|
611
|
-
"aaAuthorizationList": [],
|
|
612
605
|
"accessList": [],
|
|
613
|
-
"authorizationList":
|
|
606
|
+
"authorizationList": [],
|
|
614
607
|
"calls": [
|
|
615
608
|
{
|
|
616
609
|
"data": "0xdeadbeef",
|
|
@@ -624,7 +617,7 @@ describe('sendTransaction', () => {
|
|
|
624
617
|
"gas": 29012n,
|
|
625
618
|
"maxFeePerBlobGas": undefined,
|
|
626
619
|
"to": null,
|
|
627
|
-
"type": "
|
|
620
|
+
"type": "tempo",
|
|
628
621
|
"typeHex": "0x76",
|
|
629
622
|
"v": undefined,
|
|
630
623
|
"validAfter": null,
|
|
@@ -814,9 +807,8 @@ describe('sendTransaction', () => {
|
|
|
814
807
|
expect(transactionIndex).toBeDefined()
|
|
815
808
|
expect(transaction).toMatchInlineSnapshot(`
|
|
816
809
|
{
|
|
817
|
-
"aaAuthorizationList": [],
|
|
818
810
|
"accessList": [],
|
|
819
|
-
"authorizationList":
|
|
811
|
+
"authorizationList": [],
|
|
820
812
|
"calls": [
|
|
821
813
|
{
|
|
822
814
|
"data": "0xdeadbeef",
|
|
@@ -829,7 +821,7 @@ describe('sendTransaction', () => {
|
|
|
829
821
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
830
822
|
"maxFeePerBlobGas": undefined,
|
|
831
823
|
"to": null,
|
|
832
|
-
"type": "
|
|
824
|
+
"type": "tempo",
|
|
833
825
|
"typeHex": "0x76",
|
|
834
826
|
"v": undefined,
|
|
835
827
|
"validAfter": null,
|
|
@@ -903,15 +895,14 @@ describe('sendTransaction', () => {
|
|
|
903
895
|
expect(transactionIndex).toBeDefined()
|
|
904
896
|
expect(transaction).toMatchInlineSnapshot(`
|
|
905
897
|
{
|
|
906
|
-
"aaAuthorizationList": [],
|
|
907
898
|
"accessList": [],
|
|
908
|
-
"authorizationList":
|
|
899
|
+
"authorizationList": [],
|
|
909
900
|
"data": undefined,
|
|
910
901
|
"feePayerSignature": undefined,
|
|
911
902
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
912
903
|
"maxFeePerBlobGas": undefined,
|
|
913
904
|
"to": null,
|
|
914
|
-
"type": "
|
|
905
|
+
"type": "tempo",
|
|
915
906
|
"typeHex": "0x76",
|
|
916
907
|
"v": undefined,
|
|
917
908
|
"validAfter": null,
|
|
@@ -975,9 +966,8 @@ describe('sendTransaction', () => {
|
|
|
975
966
|
expect(transactionIndex).toBeDefined()
|
|
976
967
|
expect(transaction).toMatchInlineSnapshot(`
|
|
977
968
|
{
|
|
978
|
-
"aaAuthorizationList": [],
|
|
979
969
|
"accessList": [],
|
|
980
|
-
"authorizationList":
|
|
970
|
+
"authorizationList": [],
|
|
981
971
|
"calls": [
|
|
982
972
|
{
|
|
983
973
|
"data": "0x",
|
|
@@ -989,7 +979,7 @@ describe('sendTransaction', () => {
|
|
|
989
979
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
990
980
|
"maxFeePerBlobGas": undefined,
|
|
991
981
|
"to": null,
|
|
992
|
-
"type": "
|
|
982
|
+
"type": "tempo",
|
|
993
983
|
"typeHex": "0x76",
|
|
994
984
|
"v": undefined,
|
|
995
985
|
"validAfter": null,
|
|
@@ -1153,9 +1143,8 @@ describe('signTransaction', () => {
|
|
|
1153
1143
|
expect(transactionIndex).toBeDefined()
|
|
1154
1144
|
expect(transaction2).toMatchInlineSnapshot(`
|
|
1155
1145
|
{
|
|
1156
|
-
"aaAuthorizationList": [],
|
|
1157
1146
|
"accessList": [],
|
|
1158
|
-
"authorizationList":
|
|
1147
|
+
"authorizationList": [],
|
|
1159
1148
|
"calls": [
|
|
1160
1149
|
{
|
|
1161
1150
|
"data": "0xdeadbeef",
|
|
@@ -1168,7 +1157,7 @@ describe('signTransaction', () => {
|
|
|
1168
1157
|
"gas": 24002n,
|
|
1169
1158
|
"maxFeePerBlobGas": undefined,
|
|
1170
1159
|
"to": null,
|
|
1171
|
-
"type": "
|
|
1160
|
+
"type": "tempo",
|
|
1172
1161
|
"typeHex": "0x76",
|
|
1173
1162
|
"v": undefined,
|
|
1174
1163
|
"validAfter": null,
|
|
@@ -1326,9 +1315,8 @@ describe('relay', () => {
|
|
|
1326
1315
|
expect(transactionIndex).toBeDefined()
|
|
1327
1316
|
expect(transaction).toMatchInlineSnapshot(`
|
|
1328
1317
|
{
|
|
1329
|
-
"aaAuthorizationList": [],
|
|
1330
1318
|
"accessList": [],
|
|
1331
|
-
"authorizationList":
|
|
1319
|
+
"authorizationList": [],
|
|
1332
1320
|
"calls": [
|
|
1333
1321
|
{
|
|
1334
1322
|
"data": "0xe789744400000000000000000000000020c0000000000000000000000000000000000001",
|
|
@@ -1340,7 +1328,7 @@ describe('relay', () => {
|
|
|
1340
1328
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
1341
1329
|
"maxFeePerBlobGas": undefined,
|
|
1342
1330
|
"to": null,
|
|
1343
|
-
"type": "
|
|
1331
|
+
"type": "tempo",
|
|
1344
1332
|
"typeHex": "0x76",
|
|
1345
1333
|
"v": undefined,
|
|
1346
1334
|
"validAfter": null,
|
|
@@ -1457,9 +1445,8 @@ describe('relay', () => {
|
|
|
1457
1445
|
expect(transactionIndex).toBeDefined()
|
|
1458
1446
|
expect(transaction).toMatchInlineSnapshot(`
|
|
1459
1447
|
{
|
|
1460
|
-
"aaAuthorizationList": [],
|
|
1461
1448
|
"accessList": [],
|
|
1462
|
-
"authorizationList":
|
|
1449
|
+
"authorizationList": [],
|
|
1463
1450
|
"calls": [
|
|
1464
1451
|
{
|
|
1465
1452
|
"data": "0xe789744400000000000000000000000020c0000000000000000000000000000000000001",
|
|
@@ -1471,7 +1458,7 @@ describe('relay', () => {
|
|
|
1471
1458
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
1472
1459
|
"maxFeePerBlobGas": undefined,
|
|
1473
1460
|
"to": null,
|
|
1474
|
-
"type": "
|
|
1461
|
+
"type": "tempo",
|
|
1475
1462
|
"typeHex": "0x76",
|
|
1476
1463
|
"v": undefined,
|
|
1477
1464
|
"validAfter": null,
|
|
@@ -1569,9 +1556,8 @@ describe('relay', () => {
|
|
|
1569
1556
|
expect(transactionIndex).toBeDefined()
|
|
1570
1557
|
expect(transaction).toMatchInlineSnapshot(`
|
|
1571
1558
|
{
|
|
1572
|
-
"aaAuthorizationList": [],
|
|
1573
1559
|
"accessList": [],
|
|
1574
|
-
"authorizationList":
|
|
1560
|
+
"authorizationList": [],
|
|
1575
1561
|
"calls": [
|
|
1576
1562
|
{
|
|
1577
1563
|
"data": "0xe789744400000000000000000000000020c0000000000000000000000000000000000001",
|
|
@@ -1583,7 +1569,7 @@ describe('relay', () => {
|
|
|
1583
1569
|
"feeToken": "0x20c0000000000000000000000000000000000001",
|
|
1584
1570
|
"maxFeePerBlobGas": undefined,
|
|
1585
1571
|
"to": null,
|
|
1586
|
-
"type": "
|
|
1572
|
+
"type": "tempo",
|
|
1587
1573
|
"typeHex": "0x76",
|
|
1588
1574
|
"v": undefined,
|
|
1589
1575
|
"validAfter": null,
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
UnionPick,
|
|
12
12
|
} from '../../internal/types.js'
|
|
13
13
|
import type * as TokenId from '../../ox/TokenId.js'
|
|
14
|
-
import type {
|
|
14
|
+
import type { TransactionRequestTempo } from '../Transaction.js'
|
|
15
15
|
|
|
16
16
|
export type GetAccountParameter<
|
|
17
17
|
account extends Account | undefined = Account | undefined,
|
|
@@ -63,4 +63,4 @@ export type WriteParameters<
|
|
|
63
63
|
| 'throwOnReceiptRevert'
|
|
64
64
|
> &
|
|
65
65
|
GetFeeTokenParameter<chain> &
|
|
66
|
-
UnionPick<
|
|
66
|
+
UnionPick<TransactionRequestTempo, 'feePayer'>
|