πŸš€Widget Quick Start

circle-check

No need for API keys

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 http://testnet.lnswap.org:8081arrow-up-right or embed the widget into your site from http://testnet.lnswap.org:8081/widget.jsarrow-up-right.

Discord: https://discord.gg/8jGPCKmnnAarrow-up-right

Twitter: https://twitter.com/ln_swaparrow-up-right

Email: [email protected]envelope

Install the widget

The best way to interact with our API is to use the below code to make it available on your site:

<div id="root"></div>
<script src="https://widget.lnswap.org/widget.js"  
	id="LNSwap-Widget-Script" 
    data-config="{'name': 'lnswap', 'config': {'targetElementId': 'root'}}">
</script>
circle-info

Note: You can use the same script on any site. Just drop into your static page and lnswap function should be available globally or under window.lnswap

Create your first swap request

To create your first swap request, populate the values below and call the lnswap function which will make the required call to LNSwap API.

circle-exclamation

Take a look at different swap types you can trigger using the widget:

circle-info

Note that you can listen to widget updates from the host page via cross-origin communicationsarrow-up-right as below.

Last updated