Configure the Top-up user journey
Query parameters used to customize the user journey
General query parameters (generalSettings
)
generalSettings
)Parameter | Description |
---|---|
apiKey required | Your publishable API key. This is used to assign customers and transactions to your MoonPay account. |
currencyCode required | The code of the cryptocurrency (e.g., btc, eth, matic) you want the customer to purchase. The customer will not be able to select another currency. To differentiate between networks, use the currency codes listed in the MoonPay Dashboard. |
walletAddress required | The cryptocurrency wallet address the purchased funds will be sent to. If you pass a valid wallet address the customer won't be prompted to enter one. When pre-filling wallet addresses, you must pass currencyCode and sign the URL. Values need to be URL encoded in order to generate a valid signature. |
theme | Enable dark mode or light mode as the default appearance for the widget. Possible values are dark, light. |
enabledMethods | Comma separated top-up methods you want to enable. By default, we'll expose all of the supported methods. However, you can choose between: 1. dex - wallet-to-wallet transfer2. mesh - direct cyrpto transfer from centralized exchanges3. moonpay-balance - transfer to your wallet from MoonPay Balance4. fiat - fiat-to-crypto transfer using our MoonPay on-ramp experience5. onramper - Onramper fiat-to-crypto experience supporting a lot of other fiat payment methods. |
Dex (wallet-to-wallet transfer) specific parameters (dexSettings
)
dexSettings
)Parameter | Description |
---|---|
defaultAmount | The amount in the crypto currency you want to get from the transfer |
fromToken | Object with the information about the token you want to send from the connected wallet to the wallet address provided in generalSettings :{ chainName: 'ethereum', currencyCode: 'eth' } |
toToken | Object with the information about the token you want get from the connected wallet to the wallet address provided in generalSettings :{ chainName: 'solana' } |
Fiat (fiat-to-crypto wallet transfer) specific parameters (fiatSettings
)
fiatSettings
)Parameter | Description |
---|---|
baseCurrencyCode | The code of the fiat currency (e.g. usd, aud, gbp) you want the customer to purchase with. Refer to our Currencies API to get a full list of supported currencies. |
baseCurrencyAmount | A positive integer representing how much fiat the customer wants to spend. Best used together with the baseCurrencyCode & currencyCode parameters.Refer to our Currencies API to get the minimum and maximum values for each currency. |
Example configuration
{
generalSettings:{
enabledMethods: ['dex', 'mesh', 'moonpay-balance', 'fiat', 'onramper'],
theme: 'light', // or 'dark'
apiKey: 'pk_test_123',
walletAddress: '0x1234567890123456789012345678901234567890',
currencyCode: 'eth',
},
dexSettings: {
fromToken: {
chainName: 'ethereum',
currencyCode: 'eth'
},
toToken: {
chainName: 'solana'
},
defaultAmount: 0.05
},
fiatSettings: {
baseCurrencyAmount: 100,
baseCurrencyCode: 'USD'
}
}
Updated about 2 months ago
What’s Next