Swap widget: Embed & customize
Last updated
Last updated
Keeper Swap Widget provides users of your website with a handy tool for exchanging tokens of the Waves ecosystem at the best price. The widget displays all exchange options and suggests the most profitable one in real time. Check the Demos!
By default, the widget uses built-in Signer to connect a user wallet: Keeper, WX Network, or Ledger. However, if Signer is already implemented on your website, you can pass the Signer object and the user address to the widget so the user don't have to log in twice.
What’s more, you can become our partner and receive a portion of fee from each exchange made in Keeper Swap Widget embedded in your website.
Keeper Swap Widget charges a fee for each exchange: 0.1% of the output amount. You can get a significant part of that fee. At the start, we pay 50% of fees to our partners!
How to become a partner:
Fill out the form to get your referral key.
Embed the widget on your website and specify the key as a referrer
option when creating your widget, like this:
Enjoy your income!
Add the script to your site:
The widget is ready to use!
Please note that connecting ledger will not work in these demos, because usb access is disallowed on codepen.
referrer
: your referral key to get a part of fees
theme: 'dark'
theme (light one is default)
initialFromAssetId
, initialToAssetId
: asset pair chosen by default
toAssetIds
: list of assets allowed to swap to: for example, you can allow users to buy the token of your project only
useInternalSigner: false
: specify the setting and call setWallet()
function described below to use Signer implemented on your website instead of widget's built-in Signer. Here's the demo
Example:
setWallet()
Use it to pass a user wallet to Keeper Swap Widget if Signer is implemented on your website.
Connect the user wallet:
Disconnect the user wallet:
destroy()
is needed to remove the widget if it's no longer needed: