Launching the OnRamp widget with custom parameters
The OnRamp widget allows you to pass custom parameters directly in the URL, enabling you to customize the widget's behavior and appearance at runtime. This feature helps create a seamless customer experience tailored to your specific needs.
Supported Launch Parameters
You can pass the following parameters in the URL when launching the widget:
const LAUNCH_PARAMS = {
sourceAsset: params.get('sourceAsset'),
source: params.get('source'),
targetAsset: params.get('targetAsset'),
sourceAmount: params.get('sourceAmount'),
targetAmount: params.get('targetAmount'),
institutionId: params.get('institutionId'),
address: params.get('address'),
lastChanged: params.get('lastChanged'),
themeID: params.get('themeID')
};
Description of Parameters
- sourceAsset: The type of asset being used as the source (e.g., "EUR").
- source: The underlying blockchain for the source asset (e.g., "TRX" for USDT on the Tron network).
- targetAsset: The type of asset you want to convert to (e.g., "USDT").
- sourceAmount: The amount of the source asset you wish to convert.
- targetAmount: The desired amount of the target asset after conversion.
- institutionId: The unique identifier for the institution (provided by your integration).
- address: The recipient's address for the transaction.
- lastChanged: A technical field that allows the rate recalculation on timeout to be based specifically on the input provided by the customer.
- themeID: The unique identifier for the custom theme applied to the widget.
Example URL
To launch the OnRamp widget with custom parameters, you can construct the URL as follows:
https://core-onramp-widget.anuk.tech/?institutionId=5d58d0ab-6ee8-468d-bab8-dc0b17393295&targetAmount=20&source=TRX&targetAsset=USDT&address={"address": "TAbc12345DEF67890GHIjklMnOpQrSTUvWxYz"}
Notes
- Ensure that all parameters are properly encoded in the URL to avoid errors during transmission.
- The widget will use the provided parameters to pre-fill the necessary fields, improving the customer experience by reducing the amount of input required from customers.
By utilizing these custom parameters, you can enhance the functionality of the OnRamp widget and streamline the process for your customers.
Updated about 2 months ago