Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

max button ramp plugins #5700

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

Closed
samholmes wants to merge 23 commits into develop from sam/max-button-ramp-plugins
Closed

Conversation

@samholmes
Copy link
Contributor

@samholmes samholmes commented Aug 15, 2025
edited
Loading

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

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.

} else {
// Toggle on max mode
setIsMaxAmount(true)
setLastUsedInput('crypto')
Copy link
Collaborator

@Jon-edge Jon-edge Sep 5, 2025

Choose a reason for hiding this comment

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

Is this intentional for max mode?

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.

Meh

{/* Bottom Input (Crypto by design) */}
<InputRow>
<DropDownInputButton onPress={handleCryptDropdown}>
{selectedCrypto == null || selectedWallet == null ? (
Copy link
Collaborator

@Jon-edge Jon-edge Sep 5, 2025

Choose a reason for hiding this comment

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

When no wallet is selected, rendering FlagIcon with an empty URI may show a broken image; consider a placeholder or null.

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.

We'll make it null

Comment on lines 643 to 648
const ts = Math.floor(Date.now() / 1000)
let socn: string, tacn: string
let soam: number
Copy link
Collaborator

@Jon-edge Jon-edge Sep 5, 2025

Choose a reason for hiding this comment

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

Improve these var names.

Also, one decl per line.

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.

Yeah f*ck that noise.

Comment on lines 1022 to 1055
const cacheKey = getCacheKey(
direction,
fiatCode,
banxaCoin,
paymentType,
amountType
)
const cached = maxAmountCache.get(cacheKey)
const now = Date.now()

if (cached && now - cached.timestamp < MAX_CACHE_TTL) {
maxAmountString = cached.amount
} else {
if (amountType === 'fiat') {
maxAmountString = paymentObj.max
} else {
// For crypto, we need to fetch a quote with max fiat to get the crypto amount
const maxFiatQueryParams: any = {
account_reference: username,
payment_method_id: paymentObj.id,
source: direction === 'buy' ? fiatCode : banxaCoin,
target: direction === 'buy' ? banxaCoin : fiatCode
}
if (direction === 'buy') {
maxFiatQueryParams.source_amount = paymentObj.max
} else {
maxFiatQueryParams.target_amount = paymentObj.max
}
const maxResponse = await banxaFetch({
method: 'GET',
url,
hmacUser,
path: 'api/prices',
apiKey,
queryParams: maxFiatQueryParams
})
const maxPrices = asBanxaPricesResponse(maxResponse)
maxAmountString = maxPrices.data.prices[0].coin_amount
}
// Cache the result
maxAmountCache.set(cacheKey, {
amount: maxAmountString,
timestamp: now
Copy link
Collaborator

@Jon-edge Jon-edge Sep 5, 2025

Choose a reason for hiding this comment

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

Consider a shared cache utility to use across providers

samholmes reacted with thumbs up emoji
Copy link
Contributor Author

@samholmes samholmes Sep 11, 2025

Choose a reason for hiding this comment

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

We've decided over the should to drop caching because we observed that caching was not included as a feature for the original provider plugins architecture.

Comment on lines 265 to 290
const decimals =
denomination?.multiplier.match(/0/g)?.length ?? DECIMAL_PRECISION
Copy link
Collaborator

@Jon-edge Jon-edge Sep 5, 2025
edited
Loading

Choose a reason for hiding this comment

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

const decimals = denomination != null ? mulToPrecision(denomination.multiplier) : DECIMAL_PRECISION

samholmes reacted with thumbs up emoji
Copy link
Collaborator

Jon-edge commented Sep 5, 2025
edited
Loading

As with the other PRs, 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.

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
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.
@samholmes samholmes force-pushed the sam/max-button-ramp-plugins branch from e969e43 to ba4d205 Compare September 10, 2025 04:23
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

Reviewers

@Jon-edge Jon-edge Jon-edge left review comments

@cursor cursor[bot] cursor[bot] left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /