Widget
This guide walks you through the steps to embed the swap widget in your website in 2 minutes — whether your site is already a decentralized application (dApp) or not.
With the swap widget, your users can buy & trade ERC-20 tokens on the Toob Finance without leaving your site!
Installing the Widgets Library
To get started, install the widgets library using npm or Yarn.
Adding the Widget to Your App
Next, embed the React component in your application.
Customizing the Widget
You can set optional parameters to tailor the appearance and functionality of the widget to fit your dApp.
Param | Type | Default | |
---|---|---|---|
mode | buy/swap | buy | |
width | number | 480 | |
inputToken | TokenType | ETH | only |
outputtoken | TokenType | undefined | |
amount | string | undefined | |
theme | Theme | undefined | |
slippage | number | 0.5 |
TokenType
represents the symbol of the tokens supported by Toob Finance. You can check Token Listing for the token listing.
Last updated