-
-
Notifications
You must be signed in to change notification settings - Fork 282
fix: MMPay fiat payment fixes #8987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
OGPoyraz
wants to merge
34
commits into
main
Choose a base branch
from
ogp/fiat-money-account-deposit-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
4530da6
feat: add getAmountData callback to TransactionPayController
OGPoyraz 70c06c3
fix: fiat moneyAccountDeposit three-phase relay submit
OGPoyraz 876a525
fix: lint errors and update tests for fiat submit changes
OGPoyraz 61064db
Fix lint
OGPoyraz d5ac30b
docs: update transaction-pay-controller changelog
OGPoyraz c894ce0
Update changelog
OGPoyraz 59236fb
fix: only reject rate drift when rate worsens, not improves
OGPoyraz 4786428
Update changelog
OGPoyraz e87e784
fix: lint errors in fiat-submit tests
OGPoyraz 176207b
fix: skip source balance check for relay execute flow
OGPoyraz 48d856b
fix: use accountOverride for wallet address in fiat flow
OGPoyraz 3dbd8f2
fix: revert isExecute balance skip test changes
OGPoyraz 794ad91
fix: remove hasFiatStrategy totals test
OGPoyraz b63168e
fix: pass fiatPaymentAmount to totals for correct fiat total calculation
OGPoyraz 26ef707
Fix the total derivation
OGPoyraz 56e7a33
test: add coverage for fiat strategy payment amount in totals
OGPoyraz e36f8af
Address PR review feedback from matthewwalsh0
OGPoyraz eee7376
feat: skip discovery quote for simple fiat deposits (Perps, Predict)
OGPoyraz e8acf57
feat: fee-as-buffer strategy, simple relay path, and file split for f…
OGPoyraz fe4fc11
fix: decouple processTransactions from isPostQuote in relay-quotes
OGPoyraz 50d7476
fix: set skipProcessTransactions for simple fiat relay to fix recipie…
OGPoyraz f4f7ba4
fix: sum nested call values for EIP-7702 batch transaction
OGPoyraz 90e9a8e
fix: post-quote gas handling for zero-balance fiat-funded accounts
OGPoyraz fcb6e36
test: add coverage for EIP-7702 batch value summing and update changelog
OGPoyraz 25ece51
test: achieve 100% coverage for relay-quotes, feature-flags, and fiat…
OGPoyraz e03e64b
revert: remove unvalidated chainId/networkClientId override in fiat-s…
OGPoyraz 55c412f
fix: detect Polygon native token for post-quote gas subtraction
OGPoyraz ba47bef
fix: skip batch gas estimation when accountOverride diverges from txP…
OGPoyraz 7c27231
fix: use accountOverride for wallet address in fiat-quotes
OGPoyraz 6e97dae
fix: skip source balance check for relay execute flow
OGPoyraz 57a14f2
fix: bump fee reserve multiplier to 1.2 and move rate drift check to …
OGPoyraz 0f35336
Merge branch 'main' into ogp/fiat-money-account-deposit-fix
OGPoyraz d4d107c
fix: add missing 67.0.0 link in transaction-controller changelog
OGPoyraz 4808a41
Merge branch 'main' into ogp/fiat-money-account-deposit-fix
OGPoyraz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,15 +10,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |
| ### Added | ||
|
|
||
| - Adding processing for postQuote transactions with paymentOverride defined ([#8967](https://github.com/MetaMask/core/pull/8967)) | ||
| - Add optional `getAmountData` callback and `TransactionPayController:getAmountData` messenger action for client-side nested calldata re-encoding ([#8987](https://github.com/MetaMask/core/pull/8987)) | ||
| - Add `@metamask/keyring-controller` `^26.0.0` as a dependency ([#8972](https://github.com/MetaMask/core/pull/8972)) | ||
| - The package was already imported at runtime by `src/strategy/relay/hyperliquid-withdraw.ts` but wasn't declared in `package.json`; this PR fixes the omission. | ||
|
|
||
| ### Changed | ||
|
|
||
| - Fiat submit now uses a three-phase relay flow with fee-as-buffer strategy after on-ramp settlement, and simple deposits (Perps, Predict) skip to a single EXACT_INPUT relay quote for cheaper fees ([#8987](https://github.com/MetaMask/core/pull/8987)) | ||
| - Fiat quote submission now treats the provider code (e.g. `transak-native`) as the canonical form when resolving the provider from a ramps quote, while continuing to accept the legacy path form (e.g. `/providers/transak-native`) for backwards compatibility ([#9004](https://github.com/MetaMask/core/pull/9004)) | ||
| - Live token balance queries now respect the `confirmations_pay_extended.excludeChainIdsFromInfura` feature flag, skipping the Infura endpoint preference for excluded chains ([#8992](https://github.com/MetaMask/core/pull/8992)) | ||
| - Bump `@metamask/assets-controllers` from `^108.3.0` to `^108.5.0` ([#8981](https://github.com/MetaMask/core/pull/8981), [#8999](https://github.com/MetaMask/core/pull/8999)) | ||
| - Bump `@metamask/assets-controller` from `^8.0.2` to `^8.3.2` ([#8981](https://github.com/MetaMask/core/pull/8981), [#8985](https://github.com/MetaMask/core/pull/8985), [#8999](https://github.com/MetaMask/core/pull/8999)) | ||
|
|
||
| ### Fixed | ||
|
|
||
| - Fix fiat `moneyAccountDeposit` failing after on-ramp settlement by adding `getAmountData` callback for calldata re-encoding and correcting wallet address, quote amount, and slippage validation ([#8987](https://github.com/MetaMask/core/pull/8987)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this not the same as in |
||
| - Bump `@metamask/remote-feature-flag-controller` from `^4.2.1` to `^4.2.2` ([#8986](https://github.com/MetaMask/core/pull/8986)) | ||
| - Bump `@metamask/ramps-controller` from `^14.1.0` to `^14.1.1` ([#8989](https://github.com/MetaMask/core/pull/8989)) | ||
| - Bump `@metamask/bridge-status-controller` from `^72.0.0` to `^72.0.2` ([#8990](https://github.com/MetaMask/core/pull/8990), [#8999](https://github.com/MetaMask/core/pull/8999)) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,8 @@ export async function getFiatQuotes( | |
| const state = messenger.call('TransactionPayController:getState'); | ||
| const transactionData = state.transactionData[transactionId]; | ||
| const amountFiat = transactionData?.fiatPayment?.amountFiat; | ||
| const walletAddress = transaction.txParams.from as Hex; | ||
| const walletAddress = (transactionData?.accountOverride ?? | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is still not needed right as |
||
| transaction.txParams.from) as Hex; | ||
| const requiredTokens = getRequiredTokens(transactionData?.tokens); | ||
| const fiatAsset = deriveFiatAssetForFiatPayment(transaction, messenger); | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't how EIP-7702 works. The
tois thefromso you'd just be passing value to yourself, plus each call is empowered to pass value as it uses a soliditycallthat includes its owndata,to, andvalue.What issue were you trying to fix?