tempo.ts 0.4.4 → 0.5.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 (45) hide show
  1. package/README.md +2 -3
  2. package/dist/chains.d.ts +15 -1
  3. package/dist/chains.d.ts.map +1 -1
  4. package/dist/chains.js +2 -1
  5. package/dist/chains.js.map +1 -1
  6. package/dist/prool/Instance.d.ts +12 -4
  7. package/dist/prool/Instance.d.ts.map +1 -1
  8. package/dist/prool/Instance.js +34 -18
  9. package/dist/prool/Instance.js.map +1 -1
  10. package/dist/viem/Actions/faucet.d.ts +34 -1
  11. package/dist/viem/Actions/faucet.d.ts.map +1 -1
  12. package/dist/viem/Actions/faucet.js +35 -0
  13. package/dist/viem/Actions/faucet.js.map +1 -1
  14. package/dist/viem/Chain.d.ts +6 -0
  15. package/dist/viem/Chain.d.ts.map +1 -1
  16. package/dist/viem/Chain.js +3 -1
  17. package/dist/viem/Chain.js.map +1 -1
  18. package/dist/viem/Formatters.js +1 -1
  19. package/dist/viem/Formatters.js.map +1 -1
  20. package/dist/viem/Transaction.d.ts +4 -1
  21. package/dist/viem/Transaction.d.ts.map +1 -1
  22. package/dist/viem/Transaction.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/chains.ts +2 -1
  25. package/src/ox/TransactionEnvelopeAA.test.ts +2 -663
  26. package/src/ox/e2e.test.ts +659 -0
  27. package/src/prool/Instance.ts +51 -23
  28. package/src/tsconfig.json +2 -2
  29. package/src/viem/Actions/amm.test.ts +68 -58
  30. package/src/viem/Actions/dex.test.ts +339 -283
  31. package/src/viem/Actions/faucet.ts +63 -1
  32. package/src/viem/Actions/fee.test.ts +34 -43
  33. package/src/viem/Actions/policy.test.ts +115 -81
  34. package/src/viem/Actions/reward.test.ts +92 -74
  35. package/src/viem/Actions/token.test.ts +691 -529
  36. package/src/viem/Chain.ts +3 -1
  37. package/src/viem/Formatters.ts +1 -1
  38. package/src/viem/Transaction.ts +4 -1
  39. package/src/viem/e2e.test.ts +451 -472
  40. package/src/wagmi/Actions/amm.test.ts +2 -5
  41. package/src/wagmi/Actions/dex.test.ts +2 -1
  42. package/src/wagmi/Actions/token.test.ts +2 -1
  43. package/src/wagmi/Hooks/amm.test.ts +2 -5
  44. package/src/wagmi/Hooks/dex.test.ts +2 -1
  45. package/src/wagmi/Hooks/token.test.ts +2 -1
@@ -0,0 +1,659 @@
1
+ import {
2
+ Address,
3
+ P256,
4
+ Secp256k1,
5
+ Value,
6
+ WebAuthnP256,
7
+ WebCryptoP256,
8
+ } from 'ox'
9
+ import { getTransactionCount } from 'viem/actions'
10
+ import { expect, test } from 'vitest'
11
+ import { chainId } from '../../test/config.js'
12
+ import { client, fundAddress } from '../../test/viem/config.js'
13
+ import { SignatureEnvelope } from './index.js'
14
+ import * as Transaction from './Transaction.js'
15
+ import * as TransactionEnvelopeAA from './TransactionEnvelopeAA.js'
16
+
17
+ test('behavior: default (secp256k1)', async () => {
18
+ const privateKey = Secp256k1.randomPrivateKey()
19
+ const address = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey }))
20
+
21
+ await fundAddress(client, {
22
+ address,
23
+ })
24
+
25
+ const nonce = await getTransactionCount(client, {
26
+ address,
27
+ blockTag: 'pending',
28
+ })
29
+
30
+ const transaction = TransactionEnvelopeAA.from({
31
+ calls: [
32
+ {
33
+ to: '0x0000000000000000000000000000000000000000',
34
+ },
35
+ ],
36
+ chainId,
37
+ feeToken: '0x20c0000000000000000000000000000000000001',
38
+ nonce: BigInt(nonce),
39
+ gas: 100_000n,
40
+ maxFeePerGas: Value.fromGwei('20'),
41
+ maxPriorityFeePerGas: Value.fromGwei('10'),
42
+ })
43
+
44
+ const signature = Secp256k1.sign({
45
+ payload: TransactionEnvelopeAA.getSignPayload(transaction),
46
+ privateKey,
47
+ })
48
+
49
+ const serialized_signed = TransactionEnvelopeAA.serialize(transaction, {
50
+ signature: SignatureEnvelope.from(signature),
51
+ })
52
+
53
+ const receipt = await client.request({
54
+ method: 'eth_sendRawTransactionSync',
55
+ params: [serialized_signed],
56
+ })
57
+
58
+ expect(receipt).toBeDefined()
59
+
60
+ {
61
+ const response = await client.request({
62
+ method: 'eth_getTransactionByHash',
63
+ params: [receipt.transactionHash],
64
+ })
65
+ if (!response) throw new Error()
66
+
67
+ const {
68
+ blockNumber,
69
+ blockHash,
70
+ chainId,
71
+ hash,
72
+ // @ts-expect-error
73
+ feeToken: _,
74
+ from,
75
+ nonce,
76
+ maxFeePerGas,
77
+ maxPriorityFeePerGas,
78
+ // @ts-expect-error
79
+ signature,
80
+ ...rest
81
+ } = response
82
+
83
+ expect(blockNumber).toBeDefined()
84
+ expect(blockHash).toBeDefined()
85
+ expect(chainId).toBe(chainId)
86
+ expect(hash).toBe(receipt.transactionHash)
87
+ expect(from).toBe(address)
88
+ expect(maxFeePerGas).toBeDefined()
89
+ expect(maxPriorityFeePerGas).toBeDefined()
90
+ expect(nonce).toBeDefined()
91
+ expect(signature).toBeDefined()
92
+ expect(rest).toMatchInlineSnapshot(`
93
+ {
94
+ "aaAuthorizationList": [],
95
+ "accessList": [],
96
+ "calls": [
97
+ {
98
+ "data": null,
99
+ "input": "0x",
100
+ "to": "0x0000000000000000000000000000000000000000",
101
+ "value": "0x0",
102
+ },
103
+ ],
104
+ "feePayerSignature": null,
105
+ "gas": "0x186a0",
106
+ "gasPrice": "0x4a817c800",
107
+ "nonceKey": "0x0",
108
+ "transactionIndex": "0x1",
109
+ "type": "0x76",
110
+ "validAfter": null,
111
+ "validBefore": null,
112
+ }
113
+ `)
114
+ }
115
+
116
+ const {
117
+ blockNumber,
118
+ blockHash,
119
+ // @ts-expect-error
120
+ feeToken: _,
121
+ from,
122
+ logs,
123
+ logsBloom,
124
+ transactionHash,
125
+ ...rest
126
+ } = receipt
127
+
128
+ expect(blockNumber).toBeDefined()
129
+ expect(blockHash).toBeDefined()
130
+ expect(from).toBe(address)
131
+ expect(logs).toBeDefined()
132
+ expect(logsBloom).toBeDefined()
133
+ expect(transactionHash).toBe(receipt.transactionHash)
134
+ expect(rest).toMatchInlineSnapshot(`
135
+ {
136
+ "contractAddress": null,
137
+ "cumulativeGasUsed": "0x5c30",
138
+ "effectiveGasPrice": "0x4a817c800",
139
+ "gasUsed": "0x5c30",
140
+ "status": "0x1",
141
+ "to": "0x0000000000000000000000000000000000000000",
142
+ "transactionIndex": "0x1",
143
+ "type": "0x76",
144
+ }
145
+ `)
146
+ })
147
+
148
+ test('behavior: default (p256)', async () => {
149
+ const privateKey = P256.randomPrivateKey()
150
+ const publicKey = P256.getPublicKey({ privateKey })
151
+ const address = Address.fromPublicKey(publicKey)
152
+
153
+ await fundAddress(client, {
154
+ address,
155
+ })
156
+
157
+ const transaction = TransactionEnvelopeAA.from({
158
+ calls: [
159
+ {
160
+ to: '0x0000000000000000000000000000000000000000',
161
+ },
162
+ ],
163
+ chainId,
164
+ feeToken: '0x20c0000000000000000000000000000000000001',
165
+ gas: 100_000n,
166
+ maxFeePerGas: Value.fromGwei('20'),
167
+ maxPriorityFeePerGas: Value.fromGwei('10'),
168
+ })
169
+
170
+ const signature = P256.sign({
171
+ payload: TransactionEnvelopeAA.getSignPayload(transaction),
172
+ privateKey,
173
+ hash: false,
174
+ })
175
+
176
+ const serialized_signed = TransactionEnvelopeAA.serialize(transaction, {
177
+ signature: SignatureEnvelope.from({
178
+ signature,
179
+ publicKey,
180
+ prehash: false,
181
+ }),
182
+ })
183
+
184
+ const receipt = await client.request({
185
+ method: 'eth_sendRawTransactionSync',
186
+ params: [serialized_signed],
187
+ })
188
+
189
+ expect(receipt).toBeDefined()
190
+
191
+ {
192
+ const response = await client.request({
193
+ method: 'eth_getTransactionByHash',
194
+ params: [receipt.transactionHash],
195
+ })
196
+ if (!response) throw new Error()
197
+
198
+ const {
199
+ blockNumber,
200
+ blockHash,
201
+ chainId,
202
+ // @ts-expect-error
203
+ feeToken: _,
204
+ from,
205
+ hash,
206
+ nonce,
207
+ maxFeePerGas,
208
+ maxPriorityFeePerGas,
209
+ // @ts-expect-error
210
+ signature,
211
+ ...rest
212
+ } = response
213
+
214
+ expect(blockNumber).toBeDefined()
215
+ expect(blockHash).toBeDefined()
216
+ expect(chainId).toBe(chainId)
217
+ expect(from).toBe(address)
218
+ expect(hash).toBe(receipt.transactionHash)
219
+ expect(nonce).toBeDefined()
220
+ expect(maxFeePerGas).toBeDefined()
221
+ expect(maxPriorityFeePerGas).toBeDefined()
222
+ expect(signature).toBeDefined()
223
+ expect(rest).toMatchInlineSnapshot(`
224
+ {
225
+ "aaAuthorizationList": [],
226
+ "accessList": [],
227
+ "calls": [
228
+ {
229
+ "data": null,
230
+ "input": "0x",
231
+ "to": "0x0000000000000000000000000000000000000000",
232
+ "value": "0x0",
233
+ },
234
+ ],
235
+ "feePayerSignature": null,
236
+ "gas": "0x186a0",
237
+ "gasPrice": "0x4a817c800",
238
+ "nonceKey": "0x0",
239
+ "transactionIndex": "0x1",
240
+ "type": "0x76",
241
+ "validAfter": null,
242
+ "validBefore": null,
243
+ }
244
+ `)
245
+ }
246
+
247
+ const {
248
+ blockNumber,
249
+ blockHash,
250
+ // @ts-expect-error
251
+ feeToken: _,
252
+ from,
253
+ logs,
254
+ logsBloom,
255
+ transactionHash,
256
+ ...rest
257
+ } = receipt
258
+
259
+ expect(blockNumber).toBeDefined()
260
+ expect(blockHash).toBeDefined()
261
+ expect(from).toBe(address)
262
+ expect(logs).toBeDefined()
263
+ expect(logsBloom).toBeDefined()
264
+ expect(transactionHash).toBe(receipt.transactionHash)
265
+ expect(rest).toMatchInlineSnapshot(`
266
+ {
267
+ "contractAddress": null,
268
+ "cumulativeGasUsed": "0x6fb8",
269
+ "effectiveGasPrice": "0x4a817c800",
270
+ "gasUsed": "0x6fb8",
271
+ "status": "0x1",
272
+ "to": "0x0000000000000000000000000000000000000000",
273
+ "transactionIndex": "0x1",
274
+ "type": "0x76",
275
+ }
276
+ `)
277
+ })
278
+
279
+ test('behavior: default (p256 - webcrypto)', async () => {
280
+ const keyPair = await WebCryptoP256.createKeyPair()
281
+ const address = Address.fromPublicKey(keyPair.publicKey)
282
+
283
+ await fundAddress(client, {
284
+ address,
285
+ })
286
+
287
+ const transaction = TransactionEnvelopeAA.from({
288
+ calls: [
289
+ {
290
+ to: '0x0000000000000000000000000000000000000000',
291
+ },
292
+ ],
293
+ chainId,
294
+ feeToken: '0x20c0000000000000000000000000000000000001',
295
+ gas: 100_000n,
296
+ maxFeePerGas: Value.fromGwei('20'),
297
+ maxPriorityFeePerGas: Value.fromGwei('10'),
298
+ })
299
+
300
+ const signature = await WebCryptoP256.sign({
301
+ payload: TransactionEnvelopeAA.getSignPayload(transaction),
302
+ privateKey: keyPair.privateKey,
303
+ })
304
+
305
+ const serialized_signed = TransactionEnvelopeAA.serialize(transaction, {
306
+ signature: SignatureEnvelope.from({
307
+ signature,
308
+ publicKey: keyPair.publicKey,
309
+ prehash: true,
310
+ type: 'p256',
311
+ }),
312
+ })
313
+
314
+ const receipt = await client.request({
315
+ method: 'eth_sendRawTransactionSync',
316
+ params: [serialized_signed],
317
+ })
318
+
319
+ expect(receipt).toBeDefined()
320
+
321
+ {
322
+ const response = await client.request({
323
+ method: 'eth_getTransactionByHash',
324
+ params: [receipt.transactionHash],
325
+ })
326
+ if (!response) throw new Error()
327
+
328
+ const {
329
+ blockNumber,
330
+ blockHash,
331
+ chainId,
332
+ feeToken: _,
333
+ from,
334
+ hash,
335
+ nonce,
336
+ maxFeePerGas,
337
+ maxPriorityFeePerGas,
338
+ signature,
339
+ ...rest
340
+ } = response as any
341
+
342
+ expect(blockNumber).toBeDefined()
343
+ expect(blockHash).toBeDefined()
344
+ expect(chainId).toBeDefined()
345
+ expect(from).toBeDefined()
346
+ expect(hash).toBe(receipt.transactionHash)
347
+ expect(nonce).toBeDefined()
348
+ expect(maxFeePerGas).toBeDefined()
349
+ expect(maxPriorityFeePerGas).toBeDefined()
350
+ expect(signature).toBeDefined()
351
+ expect(rest).toMatchInlineSnapshot(`
352
+ {
353
+ "aaAuthorizationList": [],
354
+ "accessList": [],
355
+ "calls": [
356
+ {
357
+ "data": null,
358
+ "input": "0x",
359
+ "to": "0x0000000000000000000000000000000000000000",
360
+ "value": "0x0",
361
+ },
362
+ ],
363
+ "feePayerSignature": null,
364
+ "gas": "0x186a0",
365
+ "gasPrice": "0x4a817c800",
366
+ "nonceKey": "0x0",
367
+ "transactionIndex": "0x1",
368
+ "type": "0x76",
369
+ "validAfter": null,
370
+ "validBefore": null,
371
+ }
372
+ `)
373
+ }
374
+
375
+ const {
376
+ blockNumber,
377
+ blockHash,
378
+ // @ts-expect-error
379
+ feeToken: _,
380
+ from,
381
+ logs,
382
+ logsBloom,
383
+ transactionHash,
384
+ ...rest
385
+ } = receipt
386
+
387
+ expect(blockNumber).toBeDefined()
388
+ expect(blockHash).toBeDefined()
389
+ expect(from).toBeDefined()
390
+ expect(logs).toBeDefined()
391
+ expect(logsBloom).toBeDefined()
392
+ expect(transactionHash).toBe(receipt.transactionHash)
393
+ expect(rest).toMatchInlineSnapshot(`
394
+ {
395
+ "contractAddress": null,
396
+ "cumulativeGasUsed": "0x6fb8",
397
+ "effectiveGasPrice": "0x4a817c800",
398
+ "gasUsed": "0x6fb8",
399
+ "status": "0x1",
400
+ "to": "0x0000000000000000000000000000000000000000",
401
+ "transactionIndex": "0x1",
402
+ "type": "0x76",
403
+ }
404
+ `)
405
+ })
406
+
407
+ test('behavior: default (webauthn)', async () => {
408
+ const privateKey = P256.randomPrivateKey()
409
+ const publicKey = P256.getPublicKey({ privateKey })
410
+ const address = Address.fromPublicKey(publicKey)
411
+
412
+ await fundAddress(client, {
413
+ address,
414
+ })
415
+
416
+ const transaction = TransactionEnvelopeAA.from({
417
+ calls: [
418
+ {
419
+ to: '0x0000000000000000000000000000000000000000',
420
+ },
421
+ ],
422
+ chainId,
423
+ feeToken: '0x20c0000000000000000000000000000000000001',
424
+ gas: 100_000n,
425
+ maxFeePerGas: Value.fromGwei('20'),
426
+ maxPriorityFeePerGas: Value.fromGwei('10'),
427
+ })
428
+
429
+ const { metadata, payload } = WebAuthnP256.getSignPayload({
430
+ challenge: TransactionEnvelopeAA.getSignPayload(transaction),
431
+ rpId: 'localhost',
432
+ origin: 'http://localhost',
433
+ })
434
+
435
+ const signature = P256.sign({
436
+ payload,
437
+ privateKey,
438
+ hash: true,
439
+ })
440
+
441
+ const serialized_signed = TransactionEnvelopeAA.serialize(transaction, {
442
+ signature: SignatureEnvelope.from({
443
+ signature,
444
+ publicKey,
445
+ metadata,
446
+ }),
447
+ })
448
+
449
+ const receipt = await client.request({
450
+ method: 'eth_sendRawTransactionSync',
451
+ params: [serialized_signed],
452
+ })
453
+
454
+ expect(receipt).toBeDefined()
455
+
456
+ {
457
+ const response = await client.request({
458
+ method: 'eth_getTransactionByHash',
459
+ params: [receipt.transactionHash],
460
+ })
461
+ if (!response) throw new Error()
462
+
463
+ const {
464
+ blockNumber,
465
+ blockHash,
466
+ chainId,
467
+ // @ts-expect-error
468
+ feeToken: _,
469
+ from,
470
+ hash,
471
+ nonce,
472
+ maxFeePerGas,
473
+ maxPriorityFeePerGas,
474
+ // @ts-expect-error
475
+ signature,
476
+ ...rest
477
+ } = response
478
+
479
+ expect(blockNumber).toBeDefined()
480
+ expect(blockHash).toBeDefined()
481
+ expect(chainId).toBe(chainId)
482
+ expect(from).toBeDefined()
483
+ expect(hash).toBe(receipt.transactionHash)
484
+ expect(nonce).toBeDefined()
485
+ expect(maxFeePerGas).toBeDefined()
486
+ expect(maxPriorityFeePerGas).toBeDefined()
487
+ expect(signature).toBeDefined()
488
+ expect(rest).toMatchInlineSnapshot(`
489
+ {
490
+ "aaAuthorizationList": [],
491
+ "accessList": [],
492
+ "calls": [
493
+ {
494
+ "data": null,
495
+ "input": "0x",
496
+ "to": "0x0000000000000000000000000000000000000000",
497
+ "value": "0x0",
498
+ },
499
+ ],
500
+ "feePayerSignature": null,
501
+ "gas": "0x186a0",
502
+ "gasPrice": "0x4a817c800",
503
+ "nonceKey": "0x0",
504
+ "transactionIndex": "0x1",
505
+ "type": "0x76",
506
+ "validAfter": null,
507
+ "validBefore": null,
508
+ }
509
+ `)
510
+ }
511
+
512
+ const {
513
+ blockNumber,
514
+ blockHash,
515
+ // @ts-expect-error
516
+ feeToken: _,
517
+ from,
518
+ logs,
519
+ logsBloom,
520
+ transactionHash,
521
+ ...rest
522
+ } = receipt
523
+
524
+ expect(blockNumber).toBeDefined()
525
+ expect(blockHash).toBeDefined()
526
+ expect(from).toBe(address)
527
+ expect(logs).toBeDefined()
528
+ expect(logsBloom).toBeDefined()
529
+ expect(transactionHash).toBe(receipt.transactionHash)
530
+ expect(rest).toMatchInlineSnapshot(`
531
+ {
532
+ "contractAddress": null,
533
+ "cumulativeGasUsed": "0x79e8",
534
+ "effectiveGasPrice": "0x4a817c800",
535
+ "gasUsed": "0x79e8",
536
+ "status": "0x1",
537
+ "to": "0x0000000000000000000000000000000000000000",
538
+ "transactionIndex": "0x1",
539
+ "type": "0x76",
540
+ }
541
+ `)
542
+ })
543
+
544
+ test('behavior: feePayerSignature (user → feePayer)', async () => {
545
+ const feePayerPrivateKey = Secp256k1.randomPrivateKey()
546
+ const feePayerAddress = Address.fromPublicKey(
547
+ Secp256k1.getPublicKey({ privateKey: feePayerPrivateKey }),
548
+ )
549
+
550
+ const senderPrivateKey = Secp256k1.randomPrivateKey()
551
+ const senderAddress = Address.fromPublicKey(
552
+ Secp256k1.getPublicKey({ privateKey: senderPrivateKey }),
553
+ )
554
+
555
+ await fundAddress(client, {
556
+ address: feePayerAddress,
557
+ })
558
+
559
+ const nonce = await client.request({
560
+ method: 'eth_getTransactionCount',
561
+ params: [senderAddress, 'pending'],
562
+ })
563
+
564
+ //////////////////////////////////////////////////////////////////
565
+ // Sender flow
566
+
567
+ const transaction = TransactionEnvelopeAA.from({
568
+ calls: [{ to: '0x0000000000000000000000000000000000000000', value: 0n }],
569
+ chainId,
570
+ feePayerSignature: null,
571
+ nonce: BigInt(nonce),
572
+ gas: 100000n,
573
+ maxFeePerGas: Value.fromGwei('20'),
574
+ maxPriorityFeePerGas: Value.fromGwei('10'),
575
+ })
576
+
577
+ const signature = Secp256k1.sign({
578
+ payload: TransactionEnvelopeAA.getSignPayload(transaction),
579
+ // unfunded PK
580
+ privateKey: senderPrivateKey,
581
+ })
582
+
583
+ const transaction_signed = TransactionEnvelopeAA.from(transaction, {
584
+ signature: SignatureEnvelope.from(signature),
585
+ })
586
+
587
+ //////////////////////////////////////////////////////////////////
588
+ // Fee payer flow
589
+
590
+ const transaction_feePayer = TransactionEnvelopeAA.from({
591
+ ...transaction_signed,
592
+ feeToken: '0x20c0000000000000000000000000000000000001',
593
+ })
594
+
595
+ const feePayerSignature = Secp256k1.sign({
596
+ payload: TransactionEnvelopeAA.getFeePayerSignPayload(
597
+ transaction_feePayer,
598
+ { sender: senderAddress },
599
+ ),
600
+ privateKey: feePayerPrivateKey,
601
+ })
602
+
603
+ const serialized_signed = TransactionEnvelopeAA.serialize(
604
+ transaction_feePayer,
605
+ {
606
+ feePayerSignature,
607
+ },
608
+ )
609
+
610
+ const receipt = await client.request({
611
+ method: 'eth_sendRawTransactionSync',
612
+ params: [serialized_signed],
613
+ })
614
+
615
+ {
616
+ const {
617
+ blockNumber,
618
+ blockHash,
619
+ // @ts-expect-error
620
+ feeToken: _,
621
+ from,
622
+ logs,
623
+ logsBloom,
624
+ transactionHash,
625
+ transactionIndex,
626
+ ...rest
627
+ } = receipt
628
+
629
+ expect(blockNumber).toBeDefined()
630
+ expect(blockHash).toBeDefined()
631
+ expect(from).toBe(senderAddress)
632
+ expect(logs).toBeDefined()
633
+ expect(logsBloom).toBeDefined()
634
+ expect(transactionHash).toBe(receipt.transactionHash)
635
+ expect(transactionIndex).toBeDefined()
636
+ expect(rest).toMatchInlineSnapshot(`
637
+ {
638
+ "contractAddress": null,
639
+ "cumulativeGasUsed": "0x5c30",
640
+ "effectiveGasPrice": "0x4a817c800",
641
+ "gasUsed": "0x5c30",
642
+ "status": "0x1",
643
+ "to": "0x0000000000000000000000000000000000000000",
644
+ "type": "0x76",
645
+ }
646
+ `)
647
+ }
648
+
649
+ const { feePayer, feeToken, from } = (await client
650
+ .request({
651
+ method: 'eth_getTransactionByHash',
652
+ params: [receipt.transactionHash],
653
+ })
654
+ .then((tx) => Transaction.fromRpc(tx as any))) as any
655
+
656
+ expect(feePayer).toBe(feePayerAddress)
657
+ expect(feeToken).toBe('0x20c0000000000000000000000000000000000001')
658
+ expect(from).toBe(senderAddress)
659
+ })