Widget Quick Start
Last updated
Last updated
All swaps are trustless and there's no risk to user funds. If user navigates away from the page or swap fails for any reason, user's Lightning invoice payment will be canceled in ~24 hours and their funds will return to their Lightning wallet.
You can integrate the library into your app and start making requests on mainnet right away. If you need help integrating or testing the widget, feel free to contact us.
If you prefer testnet you can test the available widget functions at or embed the widget into your site from .
Discord:
Twitter:
Email:
The best way to interact with our API is to use the below code to make it available on your site:
To create your first swap request, populate the values below and call the lnswap
function which will make the required call to LNSwap API.
Take a look at different swap types you can trigger using the widget:
How it works: Stacks contract calls are triggered when required STX (or SIP10) is locked into the and once it's confirmed, user calls one of the trigger
calls that can be found in the triggerswap contract.
Here's the latest triggerswap contract:
Note that you can listen to widget updates from the host page via as below.