feat: pass explicit params to RampsController:getQuotes and persist rampsQuote on fiatPayment#8628
Open
feat: pass explicit params to RampsController:getQuotes and persist rampsQuote on fiatPayment#8628
RampsController:getQuotes and persist rampsQuote on fiatPayment#8628Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ler:getState Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…tes and persist rampsQuote Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…fications Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
9da8fdd to
0d43e4a
Compare
OGPoyraz
commented
Apr 29, 2026
Comment on lines
+168
to
+169
| const rampsState = messenger.call('RampsController:getState'); | ||
| const selectedProviderId = rampsState.providers.selected?.id; |
Member
Author
There was a problem hiding this comment.
There will always be a selected provider as Ramps team mentioned. Even though this is undefined we will pick first quote.
OGPoyraz
commented
Apr 29, 2026
| const quotes = await messenger.call('RampsController:getQuotes', { | ||
| amount: adjustedAmount, | ||
| assetId: fiatAsset.caipAssetId, | ||
| fiat: 'USD', |
Member
Author
There was a problem hiding this comment.
'USD' will be hard lock for MMPay confirmations.
Contributor
There was a problem hiding this comment.
Not sure if fiat has any effect here as the currency is determined by the region. @saustrie-consensys @pkowalski can check and confirm
OGPoyraz
commented
Apr 29, 2026
Comment on lines
+127
to
+130
| messenger.call('TransactionPayController:updateFiatPayment', { | ||
| callback: (fiatPayment) => { | ||
| fiatPayment.rampsQuote = fiatQuote; | ||
| }, |
Member
Author
There was a problem hiding this comment.
Exact fiatPayment.rampsQuote will be required to start headless ramps operation in client, hence we will hold this in the fiatPayment state.
RampsController:getQuotes and persist rampsQuote on fiatPayment
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation
The fiat quote flow in
transaction-pay-controllerwas callingRampsController:getQuoteswithout specifying the asset, provider, or currency - relying on defaults or a hardcodedpickBestFiatQuotehelper that filtered for a specific staging provider.This PR:
RampsController:getQuotes:assetId(fromfiatAsset.caipAssetId),providers(fromRampsControllerState.providers.selected.id), andfiat: 'USD'.quotes.success[0]instead of searching by hardcoded provider name viapickBestFiatQuote.TransactionFiatPayment.rampsQuoteviaTransactionPayController:updateFiatPaymentso downstream consumers can access it.getRampsQuotehelper to isolate ramps state reading and quote fetching for readability.pickBestFiatQuoteand the unusedFiatQuotesResponsetype alias since they are no longer needed.RampsControllerGetStateActionto allowed actions so the messenger can read ramps controller state.References
Checklist
Note
Medium Risk
Changes the quote-selection and request parameters for fiat on-ramp quotes and adds persisted quote state, which could affect pricing/provider choice if the selected provider/state is incorrect; test coverage was updated to mitigate.
Overview
Fixes the fiat quote flow to call
RampsController:getQuoteswith explicitassetId(CAIP asset id),fiat: 'USD', andprovidersderived fromRampsController:getStaterather than relying on defaults and a hardcoded provider filter.The ramps selection logic is simplified to take
quotes.success[0], and the chosen ramps quote is now persisted onto per-transactionfiatPayment.rampsQuoteviaTransactionPayController:updateFiatPayment. Related cleanup removespickBestFiatQuote/unused type aliases, expands messengerAllowedActionsto includeRampsController:getState, updates unit tests accordingly, and documents the fix in the package changelog.Reviewed by Cursor Bugbot for commit 0ef966b. Bugbot is set up for automated code reviews on this repo. Configure here.