Widget Config

Widget Config
NameTypeDefaultText
providerEip1193Provider OrJsonRpcProviderundefinedEIP-1193 provider
apikeystringundefinedRequired Params: please apply for an apikey from DODO before you import the Widgets in your project.
jsonRpcUrlMap{ [chainId: number]: string[] }ConfigurationSpecify nodes of different chains
defaultChainIdnumber1Default Chain ID
tokenList{ chainId: number;address: string;name: string;decimals: number;symbol: string;logoURI: string;}[]'default' - ConfigurationUser tokenList: Oject Array Type

'all': All supported token source.

'default': Configuration

'coingecko': tokens list from coingeko.
popularTokenList{ chainId: number;address: string;name: string;decimals: number;symbol: string;logoURI: string;}[]undefinedSelectable List of Popular Tokens
defaultFromToken{ chainId: number;address: string;name: string;decimals: number;symbol: string;logoURI: string;amount: number;}undefinedDefault Origin Token

Tips: the amount used for setting the default token amount, an optional param.
defaultToToken{ chainId: number;address: string;name: string;decimals: number;symbol: string;logoURI: string;amount: number;}undefinedDefault Destination Token

Tips: the amount used for setting the default token amount, an optional param.
feeRatenumber0Transaction fee rate. Unit: 1e18
rebateTostringundefinedProfit sharing address
themeThemeundefinedCan override theme, text, and style. Refer to the Instructions page for more information.
colorMode'light' Or 'dark''light'Light or dark mode
accessTokenstringundefinedPassed onto the accessTokenof the price inquiry interface
widthstring Or number375Widget width
heightstring Or number494Widget height
onTxFail(error: Error, data: any) => voidundefinedTriggered if transaction fails
onTxSubmit(tx: string, data: any) => voidundefinedTriggered after transaction is submitted
onTxSuccess(tx: string, data: any) => voidundefinedTriggered if transaction executes successfully