Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Caution MetaMask internal reviewing guidelines:
|
| export function pickBestFiatQuote( | ||
| quotes: RampsQuotesResponse, | ||
| ): RampsQuote | undefined { | ||
| return quotes.success?.find( | ||
| // TODO: Implement provider selection logic; force Transak staging for now. | ||
| (quote) => quote.provider === '/providers/transak-native-staging', | ||
| ); | ||
| } |
There was a problem hiding this comment.
This currently blocks the PR and will change once we define together with Ramps team.
FiatStrategy and getQuotes functionalityFiatStrategy and getQuotes functionality
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| transactionId, | ||
| }); | ||
|
|
||
| const quotes = await messenger.call('RampsController:getQuotes', { |
There was a problem hiding this comment.
This will be changed to RampsController:getQuote but not exposed yet?
There was a problem hiding this comment.
I will sync with @georgeweiler on the controller change
Explanation
This PR introduces
FiatStrategy:TransactionPayStrategy.Fiatand registersFiatStrategyin strategy resolution.MMPAY_FIAT_ASSET_ID_BY_TX_TYPE).fiat-quotes.tswith relay-first estimation:fiatPayment.amountFiat+ selected payment methodstrategy: fiatquotefees.provider= relay provider/swap feefees.fiatProvider= ramps provider/network feefees.metaMask= MM fee (100 bps overamountFiat + adjustedAmountFiat)metamaskPay.bridgeFeeFiatwhen fiat provider fee exists.References
Checklist
Note
Medium Risk
Introduces a new payment strategy and fee bucket that changes quote selection and total/metrics calculations; incorrect mapping or fee aggregation could affect displayed costs and downstream analytics.
Overview
Adds a new
TransactionPayStrategy.Fiatwith aFiatStrategyimplementation that fetches quotes by first estimating a synthetic Relay quote, then requestingRampsController:getQuoteswith an adjusted fiat amount and returning a single combined quote.Extends transaction-pay state/types to support per-transaction
fiatPaymentinputs and a newfees.fiatProviderbucket, updates totals calculation andmetamaskPay.bridgeFeeFiatmetric aggregation to include fiat-provider fees when present, and wires in@metamask/ramps-controller(deps/tsconfig) plus unit tests for the new flow.Written by Cursor Bugbot for commit 23e8bab. This will update automatically on new commits. Configure here.