Skip to content

Conversation

samholmes
Copy link
Contributor

@samholmes samholmes commented Aug 15, 2025

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

#5691

Requirements

If you have made any visual changes to the GUI. Make sure you have:

  • Tested on iOS device
  • Tested on Android device
  • Tested on small-screen device (iPod Touch)
  • Tested on large-screen device (tablet)

cursor[bot]

This comment was marked as outdated.

Copy link
Collaborator

@Jon-edge Jon-edge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with the other PR, address non-deprecation warnings.
Really simple hands off task with gpt-5-fast in Cursor if claude+opencode is struggling for some reason on this.

Also, try to trim down the logging noise if possible.

walletAddress == null ? '' : `&walletAddress=${walletAddress}`

if (direction === 'buy') {
url = `https://api.moonpay.com/v3/currencies/${cryptoCurrencyObj.code}/buy_quote/?apiKey=${apiKey}&quoteCurrencyCode=${cryptoCurrencyObj.code}&baseCurrencyCode=${fiatCode}&paymentMethod=${paymentMethod}&areFeesIncluded=true&${amountParam}${walletAddressParam}`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make https://api.moonpay.com/v3/currencies/ a constant at the top of the file

Copy link
Contributor Author

@samholmes samholmes Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to infoOptions for the provider so we can swap out the URL for dev/e2e testing on mock servers/sandboxes/prod (meastro)

coin: BanxaCryptoCoin,
allowedCurrencyCodes: Record<FiatDirection, FiatProviderAssetMap>
): void => {
const wallet =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be using account.currencyConfig[pluginId].allTokens. We might not have
the wallet for a supported asset.

Comment on lines 1007 to 1001
if (!checkMinMax(exchangeAmount, paymentObj)) {
if (gt(exchangeAmount, paymentObj.max)) {
console.warn(
`Banxa: ${paymentType} over limit for ${fiatCode}: ${exchangeAmount} > ${paymentObj.max}`
)
} else if (lt(exchangeAmount, paymentObj.min)) {
console.warn(
`Banxa: ${paymentType} under limit for ${fiatCode}: ${exchangeAmount} < ${paymentObj.min}`
)
}
continue
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original provider threw min/max errors

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One commit to fix all cases of fetchQuote not throwing when it should!

? bityQuote.output.minimum_amount
: bityQuote.input.minimum_amount
if (minimumAmount != null && lt(amount, minimumAmount)) {
// Under minimum
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw the appropriate FiatProviderError

if (amountType === 'fiat') {
if (gt(exchangeAmount, '1000')) {
// Over limit
console.error(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw the appropriate FiatProviderError

if (lt(kBityQuote.output.amount, exchangeAmount)) {
// Over limit
console.error(
'Bity fetchQuote error: Buy crypto amount exceeds 1000 fiat equivalent',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw the appropriate FiatProviderError

if (lt(kBityQuote.input.amount, exchangeAmount)) {
// Over limit
console.error(
'Bity fetchQuote error: Sell crypto amount exceeds 1000 fiat equivalent',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throw the appropriate FiatProviderError

@samholmes samholmes force-pushed the sam/all-ramp-plugins branch from 0d0138a to 37c5bde Compare September 9, 2025 19:14
cursor[bot]

This comment was marked as outdated.

This is an attempt to get the agent to automatically document lessons
learned to the docs/ directory. This way conventions are maintained and
over time as the agent is course corrected.
- Create docs/localization-guidelines.md with mandatory UI string localization rules
- Create docs/component-styling-guidelines.md with styled HOC usage patterns
- Update AGENTS.md with Documentation section indexing all docs/ files
- Add rule requiring all docs/ markdown files to be indexed in AGENTS.md
- Add localized strings for TradeRegionSelectScene to en_US.ts
@samholmes samholmes force-pushed the sam/all-ramp-plugins branch from 37c5bde to 212ac91 Compare September 9, 2025 23:33
cursor[bot]

This comment was marked as outdated.

@Jon-edge
Copy link
Collaborator

Jon-edge commented Sep 11, 2025

@codex

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +44 to +49
const config = {
initOptions,
store,
account,
navigation: null as any, // Navigation will be provided by components that need it
onLogEvent: () => {},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P0] Pass real navigation to ramp plugins

Every ramp plugin is instantiated with navigation: null in useRampPlugins, yet the plugin implementations call navigation.navigate/pop during quote approval (for example banxaRampPlugin around its approveQuote handler). When a user taps a quote the plugin will dereference null and crash before any webview or approval flow can start. The hook should supply a real NavigationBase or the plugins must guard against navigation being absent; otherwise no ramp purchase/sell flow can complete.

Useful? React with 👍 / 👎.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a valid bug

This file contains run configuration such as RN_SIMULATOR and RN_PORT
to be used by a rn-ios script. This is for development purposes
This is a consistent card design for the new fiat buy UI.
- Implement TradeCreateScene and TradeOptionSelectScene for buy/sell flow
- Add Paybis as first ramp plugin with full API integration
- Create reusable hooks for ramp plugin management (useRampPlugins, useRampQuotes)
- Add payment type icon system with comprehensive mappings
- Implement quote fetching and comparison across multiple providers
- Add best rate badge component for quote comparison
- Create ramp plugin type definitions and store utilities
- Add comprehensive documentation for migration and architecture
- Include unit tests for payment types and store IDs
- Update navigation and deeplink handlers for ramp flows

BREAKING CHANGE: Replaces legacy FiatPluginUi with new ramp plugin system
Include plugin IDs in React Query key so quotes refetch when
region/currency/wallet changes affect available plugins. Simplify
queryFn to always check current plugins while reusing valid cached
quotes.
Comment on lines +841 to +848
const openWebView = async (): Promise<void> => {
await new Promise<void>((resolve, reject) => {
navigation.navigate('guiPluginWebView', {
url: urlObj.href,
onUrlChange: async (uri: string): Promise<void> => {
console.log('Moonpay WebView url change: ' + uri)

if (uri.startsWith(RETURN_URL_PAYMENT)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can crash since navigation can be null

Comment on lines +1118 to +1124
const openWebView = async (): Promise<void> => {
navigation.navigate('guiPluginWebView', {
url: webviewUrl,
onUrlChange: newUrl => {
handleUrlChange(newUrl).catch(showError)
}
})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the other comment, this can crash due to navigation being null

Comment on lines +94 to +101
const handleQuotePress = async (quote: RampQuoteResult): Promise<void> => {
try {
await quote.approveQuote({
coreWallet: rampQuoteRequest.wallet!
})
} catch (error) {
console.error('Failed to approve quote:', error)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to inject navigation

Copy link
Collaborator

@Jon-edge Jon-edge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix the navigation issue

Copy link
Collaborator

@Jon-edge Jon-edge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex fix comments

Copy link

@codex fix comments

For now, I can only help with PRs you've created.

@samholmes
Copy link
Contributor Author

Replaced by #5740

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants