DODO Docs
Search
⌃K

API

Name
Type
Default
Text
provider
Eip1193Provider Or JsonRpcProvider
undefined
EIP-1193 provider
apikey
string
undefined
Required Params: please apply for an apikey from DODO before you import the Widgets in your project.
jsonRpcUrlMap
{ [chainId: number]: string[] }
Specify nodes of different chains
defaultChainId
number
1
Default Chain ID
tokenList
{
chainId: number;
address: string;
name: string;
decimals: number;
symbol: string;
logoURI: string;
}[] | 'all' | 'default' | 'coingecko'
'default' - Configuration
User 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;
}[]
undefined
Selectable List of Popular Tokens
defaultFromToken
{
chainId: number;
address: string;
name: string;
decimals: number;
symbol: string;
logoURI: string;
amount: number;
}
undefined
Default 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;
}
undefined
Default Destination Token Tips: the amount used for setting the default token amount, an optional param.
feeRate
number
0
Transaction fee rate. Unit: 1e18
rebateTo
string
undefined
Profit sharing address
theme
Theme
undefined
Can override theme, text, and style. Refer to the Instructions page for more information.
colorMode
'light' Or 'dark'
'light'
Light or dark mode
accessToken
string
undefined
Passed onto the accessTokenof the price inquiry interface
width
string Or number
375
Widget width
height
string Or number
494
Widget height
onTxFail
(error: Error, data: any) => void
undefined
Triggered if transaction fails
onTxSubmit
(tx: string, data: any) => void
undefined
Triggered after transaction is submitted
onTxSuccess
(tx: string, data: any) => void
undefined
Triggered if transaction executes successfully