Skip to main content
This guide shows you how to let a customer add money to an account in your product from whatever they hold. The customer chooses how much to send; you choose where it lands. You need an OMS publishable key (pk_...) and the SDK installed.

Add a funding flow

Render Fund with the destination address, token, and chain. The customer picks a source and an amount, and the funds arrive as the token you set.
The customer sets the amount they send, and the amount that arrives reflects fees and price movement along the route. to.token locks the destination token. On Fund, to.chain sets the initial chain, and the customer can switch it. To let the customer change the token too, replace token with defaultToken and pair it with either chain or defaultChain.

Open a specific funding method

Without paymentMethod, the customer chooses between their connected wallet, a crypto transfer, a card, and an exchange account. Set it to open one directly.
Card and exchange availability depends on the customer’s country, and the widget hides methods that cannot serve them. Exchange funding appears only when you pass the onramp prop, as in the example above, and must be enabled for your project; contact the team to turn it on. For card funding, from.currency takes an ISO 4217 code such as USD or EUR, and from.amount is in that currency. The widget offers the card providers available in the customer’s country and shows the amount each delivers before the customer pays. Card and bank purchases have a minimum and maximum that depend on the country, currency, and destination token. The widget reads them before quoting: an amount under the minimum shows “Minimum purchase is X CUR”, disables the button, and skips the quote. To validate an amount in your own UI, use useMeldPurchaseLimits.

Limit and order the funding methods

fundMethodsList sets which methods appear and in what order. Add hideUnlistedFundMethods to remove the rest instead of showing them disabled.
Accepted values are connected-wallet, crypto-transfer, cc-onramp, and exchange.

Fix the amount that arrives

To have the customer enter the amount they receive instead of the amount they send, set type to EXACT_OUTPUT. This applies to connected wallet funding; card and exchange funding always use the amount sent.

Fund straight into a contract

Pass to.calldata to run a contract call, such as a vault deposit, with the funds as they arrive. See contract calls on arrival.

From your server

To fund an address without a UI, quote and execute an intent with the API. See quotes and execution.