Commit cbf1bcf
fix(transaction-pay-controller): account override fixes (#8724)
## Summary
Fixes in `transaction-pay-controller`'s Relay strategy that together
unblock Money Account deposits via MetaMask Pay (and any other
delegation-based deposit flow targeting Arbitrum USDC).
1. Funding-leg recipient should be `transaction.txParams.from`, not
`request.from`
2. Arbitrum-USDC → Hypercore rewrite must be gated on `perpsDeposit`
Ref: https://consensyssoftware.atlassian.net/browse/CONF-1324
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Adjusts Relay quote transaction construction and chain/token rewrite
behavior for Arbitrum USDC deposits; mistakes here could misroute funds
or produce incorrect quotes for delegation-based flows.
>
> **Overview**
> Fixes Relay quoting for delegation-based flows when `accountOverride`
causes `request.from` to differ from the executing delegator.
>
> Relay now funds the **delegator address**
(`transaction.txParams.from`) when building the initial token-transfer
leg (falling back to `request.from` if unset), and the Arbitrum-USDC →
Hypercore (Hyperliquid) quote rewrite is now **only applied for
`TransactionType.perpsDeposit`** (not for other transaction types or
post-quote flows). Tests and the changelog are updated to cover these
cases.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
882ea79. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Jyoti Puri <jyotipuri@gmail.com>1 parent 40465f7 commit cbf1bcf
3 files changed
Lines changed: 122 additions & 4 deletions
File tree
- packages/transaction-pay-controller
- src/strategy/relay
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
10 | 16 | | |
11 | 17 | | |
12 | 18 | | |
| |||
Lines changed: 97 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
457 | 519 | | |
458 | 520 | | |
459 | 521 | | |
| |||
2751 | 2813 | | |
2752 | 2814 | | |
2753 | 2815 | | |
2754 | | - | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
2755 | 2820 | | |
2756 | 2821 | | |
2757 | 2822 | | |
| |||
2767 | 2832 | | |
2768 | 2833 | | |
2769 | 2834 | | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
2770 | 2866 | | |
2771 | 2867 | | |
2772 | 2868 | | |
| |||
Lines changed: 19 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
346 | 349 | | |
347 | 350 | | |
348 | 351 | | |
| 352 | + | |
| 353 | + | |
349 | 354 | | |
350 | 355 | | |
351 | 356 | | |
352 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
353 | 361 | | |
354 | 362 | | |
355 | 363 | | |
| |||
364 | 372 | | |
365 | 373 | | |
366 | 374 | | |
| 375 | + | |
| 376 | + | |
367 | 377 | | |
368 | 378 | | |
369 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
370 | 383 | | |
371 | 384 | | |
372 | 385 | | |
373 | 386 | | |
| 387 | + | |
| 388 | + | |
374 | 389 | | |
| 390 | + | |
375 | 391 | | |
376 | 392 | | |
377 | 393 | | |
| |||
0 commit comments