Skip to content

Meld ​

@openrampkit/adapter-meld gets fiat onramp quotes from many providers through Meld, picks the best one, and sends the user to that provider's widget.

New adapter

This adapter is new and still in progress. Some provider details are marked TO VERIFY in the source (listed below).

ts
import { meld } from '@openrampkit/adapter-meld'

meld({
  apiKey: process.env.MELD_API_KEY!,
  env: 'production',
  webhookSecret: process.env.MELD_WEBHOOK_SECRET,
})

To get the keys, see Get provider keys.

Options ​

OptionTypeDefaultDescription
apiKeystringrequiredSent as Authorization: BASIC <apiKey>
env'sandbox' | 'production'requiredSandbox is https://api-sb.meld.io. The server checks env against livemode.
serviceProvidersstring[]all on your accountOnly quote these providers, e.g. ['TRANSAK', 'BANXA']
webhookSecretstringnoneWebhook profile secret. Without it, webhooks are rejected.
webhookUrlstringthe request URLThe URL registered in the Meld profile (the signature covers it). Set it when a proxy rewrites URLs.
deliverAssetsMeldDeliverAsset[]USDC on Base, Ethereum, Polygon, ArbitrumAssets to buy, most preferred first. A destination token that is not in the list gets no quote (NO_QUOTES).
defaultCountrystring'US'Country for quotes when the session has none
versionstring'2026-02-03'Meld-Version header
apiUrlstringby envAPI base URL

Legs ​

One leg per payment method. Static legs (used when the catalog fails): card, apple_pay, google_pay, upi (IN, INR), pix (BR, BRL), binance_pay, sepa (EUR countries), ach (US, USD), and these regional methods:

Leg and methodMeld codeCountriesFiat
sepa_instantSEPA_INSTANTEUR countriesEUR
faster_paymentsUK_FASTER_PAYMENTS (the catalog also maps FPS)GBGBP
open_bankingOPEN_BANKINGEU, GB, IS, LIany
idealIDEALNLEUR
bancontactBANCONTACTBEEUR
blikBLIKPLPLN
payidPAYIDAUAUD
interacINTERACCACAD
speiSPEI (the catalog also maps STP)MXMXN
psePSECOCOP
khipuKHIPUCLCLP
impsIMPSININR
mpesaMPESAKEKES
mobile_moneyMOBILE_MONEY29 countries in Africa and Asiaany

The catalog also maps SOFORT, ASTROPAY, PAYPAL, VENMO, CASH_APP, ZELLE, REVOLUT_PAY, REVOLUT and MERCADOPAGO. Meld lists the codes and their countries on its payment method coverage page (read on 2026-10-04). The live catalog (GET /service-providers/properties/payment-methods, cached for an hour per country and currency) builds the legs for the user's country and currency.

  • Surface: REDIRECT to the chosen provider's widget (serviceProviderWidgetUrl, else Meld's hosted widgetUrl). The modal shows the provider's name.
  • Delivers to deliverTo.address (a hop) or the destination address.

Quotes and start ​

  • Quote: POST /payments/crypto/quote returns one quote per provider. The one with the most crypto out is the leg quote. The full list is in quote.data.providers. The guarantee is estimate: the chosen provider sets the final price. Quotes expire after 5 minutes (quoteExpiresAt(5)).
  • Fees, in the fiat currency, all with included: true: the provider's transactionFee (provider), networkFee (network) and partnerFee (app).
  • Start: POST /crypto/session/widget (sessionType: 'BUY') with the chosen provider, the wallet, the amount, redirectUrl, the user's IP when known, externalCustomerId (the user id) and externalSessionId (the leg ref, ork_{random}).
  • Status: GET /payments/transactions?externalSessionIds={ref}.
  • providerRef: the Meld transaction id. Meld gives it once the user starts to pay, so the start step has none.
  • Transactions: a settled transaction's hash is the destination transaction.
Meld statusLeg
SETTLEDsucceeded
PENDING_CREATED, TWO_FA_REQUIREDrequires_action
PENDING, TWO_FA_PROVIDED, ACCEPTED, AUTHORIZEDprocessing, detail code processing
SETTLING, PARTIALLY_SETTLEDprocessing, detail code settling
ERRORprocessing, detail code delayed (ERROR is temporary at Meld)
FAILED, DECLINED, CANCELLED, AUTHORIZATION_EXPIREDfailed
REFUNDEDrefunded
otherno event: the adapter logs the unknown status once (statusMap), and the leg keeps its current step

Webhooks ​

Create a Meld webhook profile with the URL {baseUrl}/webhooks/meld and pass its secret as webhookSecret.

  • Verification: Meld-Signature is the base64url (with padding) HMAC-SHA256 of {Meld-Signature-Timestamp}.{webhookUrl}.{body}. The adapter checks it with verifyTimestampedHmac from @openrampkit/adapter.
  • Only TRANSACTION_CRYPTO_* events are read. On a settled event, the adapter reads the transaction for the amount and the transaction hash.

Verified vs TO VERIFY ​

  • Verified: the USDC (Ethereum) and USDC_BASE currency codes.
  • TO VERIFY: USDC_POLYGON and USDC_ARBITRUM.
  • TO VERIFY: the UPI and BINANCE_PAY payment method codes. The coverage list has BINANCE_P2P and BINANCE_CASH_BALANCE, not BINANCE_PAY.
  • TO VERIFY: MERCADO_PAGO. The coverage list spells it MERCADOPAGO, and the adapter sends that spelling.
  • TO VERIFY: Meld documents no timestamp tolerance for webhooks. The adapter rejects timestamps more than 5 minutes off.

MIT licensed