Swap Widget
We offer an easy-to-integrate swap widget that allows Astrolescent to be integrated directly into your website.
You can add our swap widget by simply adding the following code to your website:
Setting defaults
The swap widget supports setting a selling and buying token and a default amount by adding it to the URL.
from
: the resource address the widget is sellingto
: the resource address the widget is buyingamount
: the amount of tokens that will be soldfeeComponent
: address of your fee component addressfee
: the fee you'd like to charge,0.01
= 1%,0.003
is 0.3%
To set up your own fee component, reach out to use on Telegram and we'll help you set it up.
For example, HUG uses the following settings:
Where to
is set to HUG's token address resource_rdx1t5kmyj54jt85malva7fxdrnpvgfgs623yt7ywdaval25vrdlmnwe97, and the amount
to 100, letting the widget display a trade of selling 100 XRD for HUG.
Last updated