Configure the Top-up user journey

Query parameters used to customize the user journey

General query parameters (generalSettings)

ParameterDescription
apiKey requiredYour publishable API key. This is used to assign customers and transactions to your MoonPay account.
currencyCoderequiredThe 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.
walletAddressrequiredThe 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.
themeEnable 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 transfer
2. mesh - direct cyrpto transfer from centralized exchanges
3. moonpay-balance - transfer to your wallet from MoonPay Balance
4. fiat - fiat-to-crypto transfer using our MoonPay on-ramp experience
5. onramper - Onramper fiat-to-crypto experience supporting a lot of other fiat payment methods.

Dex (wallet-to-wallet transfer) specific parameters (dexSettings)

ParameterDescription
defaultAmountThe amount in the crypto currency you want to get from the transfer
fromTokenObject 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' }
toTokenObject 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)


ParameterDescription
baseCurrencyCodeThe 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.
baseCurrencyAmountA 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'  
      }  
    }