⚙️Customization
Rango Widget Config
Overview
The WidgetConfig
object allows you to customize your widget to fit your application's needs. The following sections provide a detailed breakdown of all available properties, organized by category.
You can customize your widget in the Playground and use the "Export Code" button at the top to obtain the final configuration.
1. Core Configuration
apiKey
(string) - RequiredYour API key for accessing the Rango API. This key is required to make widget requests.
apiUrl
(string) - OptionalThe base API URL for custom API endpoints.
walletConnectProjectId
(string) - OptionalThe Wallet Connect Project ID used for integrating WalletConnect. Obtain it from WalletConnect Cloud.
title
(string) - OptionalThe title that appears on top of the widget.
variant
(WidgetVariant) - OptionalThe layout variant of the widget.
'default'
: Standard view.'expanded'
: Expanded view showing multiple routes.'full-expanded'
: Full route information visible on the homepage.
amount
(number) - OptionalThe default value to be displayed in the swap input field.
2. Blockchain & Token Configuration
from
(BlockchainAndTokenConfig) - OptionalConfiguration for the source blockchain and token.
blockchains (string[]): A list of allowed source blockchains.
blockchain (string): The default blockchain.
token (Asset): The default token configuration.
to
(BlockchainAndTokenConfig) - OptionalConfiguration for the destination blockchain and token.
blockchains (string[]): A list of allowed destination blockchains.
blockchain (string): The default blockchain.
token (Asset): The default token configuration.
liquiditySources
(string[]) - OptionalA list of allowed DEXes and bridges used for routing liquidity.
excludeLiquiditySources
(boolean) - OptionalIf set to
true
, the liquidity sources defined inliquiditySources
will be excluded instead of included.
customDestination
(boolean) - OptionalEnables the user to enter a custom blockchain address as the destination.
3. Theme Configuration
theme
(WidgetTheme) - OptionalCustomize the visual appearance of the widget.
mode (
'auto' | 'light' | 'dark'
): Defines the theme mode.fontFamily (string): Sets the font for the widget. To do this, please also include your preferred font in your HTML file.
colors (object): Customize colors for both light and dark modes. (Please check playground to play with different colors and presets.)
dark: Color configuration for dark mode.
light: Color configuration for light mode.
borderRadius (number): The border radius for the widget container.
secondaryBorderRadius (number): The border radius for buttons within the widget.
singleTheme (boolean): If set to
true
, limits the widget to one theme (dark or light) based on themode
value.
4. Wallet & Signers Configuration
wallets
(string[]) - OptionalA list of supported wallet types for connecting to the widget. Example:
['metamask', 'phantom']
.
multiWallets
(boolean) - OptionalIf set to
true
, the user can connect multiple wallets. Otherwise, he could only connect one wallet at the same time. (Not recommended)
externalWallets
(boolean) - OptionalAllows external wallet integration.
signers
(SignersConfig) - OptionalCustom RPC configuration for specific blockchains.
customSolanaRPC (string): Custom Solana RPC endpoint URL.
trezorManifest
(TrezorManifest) - OptionalRequired for integrating Trezor wallets. Provide your app's URL and a contact email.
5. Affiliate Configuration
affiliate
(WidgetAffiliate) - OptionalConfiguration for charging affiliate fees. Please check widget monetization guide.
ref (string): Your affiliate referral code.
percent (number): The percentage of fees charged per transaction.
wallets (object): A map of blockchain names to affiliate wallet addresses.
6. Feature Toggles
features
(Features) - OptionalControls the visibility of various features. For example, you could hide the theme or language settings in widget if you want to control it from your dApp.
theme (
'visible' | 'hidden'
): Show/hide the theme feature.language (
'visible' | 'hidden'
): Show/hide the language selector.connectWalletButton (
'visible' | 'hidden'
): Show/hide the connect wallet button.notification (
'visible' | 'hidden'
): Show/hide the notification icon.liquiditySource (
'visible' | 'hidden'
): Show/hide liquidity source information.experimentalRoute (
'enabled' | 'disabled'
): Enable/disable experimental routing.
Sample Configuration Code
Last updated