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:

<iframe 
    src="https://astrolescent.com/widget" 
    width="467px" height="750px" frameborder="0">
</iframe>    

Setting defaults

The swap widget supports setting a selling and buying token, as well as a default amount, by adding it to the URL.

  • from: the resource address the widget is selling

  • to: the resource address the widget is buying

  • amount: the amount of tokens that will be sold

For example, HUG uses the following settings:

<iframe 
    src="https://astrolescent.com/widget?to=resource_rdx1t5kmyj54jt85malva7fxdrnpvgfgs623yt7ywdaval25vrdlmnwe97&amount=100" 
    width="467px" height="750px" frameborder="0">
</iframe>

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