Skip to content

[bug] Onramp: Meld URL omits countryCode, showing a fabricated "You receive" amount on load #5752

Description

@vinarmani

Link to minimal reproducible example

Open the Meld widget with the exact parameter set AppKit builds in OnRampController.setSelectedProvider():

https://meldcrypto.com/?publicKey=<MELD_PUBLIC_KEY>&destinationCurrencyCode=USDC&walletAddress=<ANY_EVM_ADDRESS>&externalCustomerId=<PROJECT_ID>

Substitute MELD_PUBLIC_KEY from packages/controllers/src/utils/ConstantsUtil.ts, any EVM address, and any project id. Or reach it in-app: connect a wallet on mainnet and open the OnRampProviders view, then pick Meld.

Steps to Reproduce

  1. Open the on-ramp and select Meld.
  2. Look at "You receive" before touching anything.

Expected: a real quote (~93-95 USDC for $100).
Actual: 0.001201 USDC, attributed to Binance Connect.

Entering or changing the fiat amount by hand replaces it with a correct quote (237.77 USDC for $250). So the wrong figure is only ever the initial render.

Summary

Two separate problems, one of which is fixable in AppKit.

1. The number is a static placeholder, not a mispriced quote. Loading the widget with different parameters returns the identical value every time:

URL params "You receive" on load
USDC, sourceAmount=100 0.001202 USDC
USDC, sourceAmount=500 0.001202 USDC
BTC, sourceAmount=100 0.001202 BTC
no destination currency 0.001202 BTC

Same number regardless of amount or asset — a skeleton value that is never replaced, because no quote request fires on load. This part is Meld's widget behaviour.

2. AppKit makes it worse by omitting countryCode. setSelectedProvider() appends only:

publicKey · destinationCurrencyCode · walletAddress · externalCustomerId

With no countryCode, Meld selects Binance Connect, which cannot serve US customers at all — Meld's own quote API returns NO_VALID_QUOTES for BINANCECONNECT+US, while US returns Stripe and Swapped. Adding countryCode=US to the same URL switches the provider and the fabricated figure never appears:

no countryCode  ->  "Binance Connect · 0.001202 USDC"
countryCode=US  ->  "Swapped · See more quotes"        (no bogus figure)

sourceAmount is also never sent. Meld documents it as defaulting to 100, but supplying it explicitly does not by itself trigger a quote — it populates the display only.

Suggested fix

Append countryCode (and ideally sourceAmount / sourceCurrencyCode) to the Meld URL in setSelectedProvider(). Country could come from the existing geo/locale signal, or be exposed as an on-ramp option so integrators can set it.

This is the same underlying complaint as #5394, which was closed as a feature request. The repro above shows it isn't cosmetic: users are shown a concrete "you receive" amount that is wrong by five orders of magnitude, next to an enabled "Buy" button.

List of related npm package versions

@reown/appkit 1.8.17, @reown/appkit-adapter-wagmi 1.8.17 (Nuxt 3 / Vue)

Node.js Version

18.19.0

Package Manager

yarn

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions