Supported swap parameters
Onramper lets you customize your swap experience by adding parameters to the widget URL.
Parameter | Type | Description |
---|---|---|
swap_defaultSource | string | The default source token to be displayed. |
swap_defaultTarget | string | The default target token to be displayed. |
swap_defaultAmount | string | The default amount to be displayed (must be used with swap_defaultSource). |
swap_sourceWallets | string | Specifies source wallet addresses for individual tokens in the swap widget. |
swap_sourceNetworkWallets | string | Provides a source wallet address for all tokens on a specific blockchain network. |
swap_targetWallets | string | Defines target wallet addresses for individual tokens in the swap widget. |
swap_targetNetworkWallets | string | Specifies a target wallet address for all tokens on a particular blockchain network. |
Default Source
Set a default source token to be displayed for the initial widget load using the swap_defaultSource
https://buy.onramper.com/?mode=swap&swap_defaultSource=usdc_ethereum
Default Target
Set a default target token to be displayed for the initial widget load using the swap_defaultTarget
https://buy.onramper.com/?mode=swap&swap_defaultTarget=usdc_solana
Default Amount
Set a default source amount to be displayed for the initial widget load using the swap_defaultAmount
. This must be used with swap_defaultSource
.
https://buy.onramper.com/?mode=swap&swap_defaultSource=usdc_ethereum&swap_defaultAmount=140
Source Wallets
The swap_sourceWallets
parameter allows you to define the source wallet addresses for individual tokens used in the swap widget. Each wallet address should be formatted as a combination of the Token ID (Onramper ID) and the wallet address, separated by a colon.
For example:
BTC:3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5.
To pass multiple addresses, separate them with commas.
BTC:3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5,ETH:0xb794f5ea0ba39494ce839613fffba74279579268.
Source Network Wallets
The swap_sourceNetworkWallets
parameter allows you to specify a source wallet address that works for all tokens on a specific blockchain network. This is particularly useful for networks that support multiple tokens. Format the parameter as the Network ID followed by the wallet address, such as
ETHEREUM:0xb794f5ea0ba39494ce839613fffba74279579268.
By utilizing this parameter, you simplify the process for users by automatically associating the source wallet with all compatible tokens on the defined network.
To pass multiple addresses, separate them with commas.
ETHEREUM:3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5,SOLANA:0xb794f5ea0ba39494ce839613fffba74279579268.
Target Wallets
The swap_targetWallets
parameter is used to define the target wallet addresses for individual tokens in the swap widget. Each wallet address should be formatted with the Token ID and wallet address separated by a colon, like:
BTC:3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5
To include multiple target wallets, separate them with commas:
BTC:3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5,ETH:0xb794f5ea0ba39494ce839613fffba74279579268.
Target Network Wallets
The swap_targetNetworkWallets
parameter enables you to specify a single target wallet address for all tokens within a specific blockchain network. Use the Network ID followed by the wallet address in the format: NETWORK_ID:wallet_address
. For example:
ETHEREUM:0xb794f5ea0ba39494ce839613fffba74279579268.
This parameter simplifies the process of targeting wallets for multiple tokens on the same blockchain, enhancing the user experience by automatically associating the wallet with the relevant tokens.
To pass multiple addresses, separate them with commas.
ETHEREUM:3FZbgi29cpjq2GjdwV8eyHuJJnkLtktZc5,SOLANA:0xb794f5ea0ba39494ce839613fffba74279579268.
Updated 29 days ago