Getting Started
Quick start guide for developers integrating Lendaswap
Welcome to the Lendaswap developer portal. This guide will help you verify your integration environment and complete your first swap.
Your First Swap
Follow these steps to complete a $10 test swap from Bitcoin (Lightning) to USDC (Polygon).
Create Swap Request
Submit a request specifying your Polygon recipient address.
import { Client, IdbWalletStorage, IdbSwapStorage } from "@lendasat/lendaswap-sdk-pure";
const client = await Client.builder()
.withSignerStorage(new IdbWalletStorage())
.withSwapStorage(new IdbSwapStorage())
.build();
const result = await client.createLightningToEvmSwap({
targetAddress: "0xYourPolygonAddress",
targetToken: "usdc_pol",
targetChain: "polygon",
sourceAmount: 100000, // sats (~$10)
});
console.log("Pay this invoice:", result.response.ln_invoice);
console.log("Swap ID:", result.response.id);Pay via Lightning
Scan the lnInvoice returned in the response with any Lightning wallet (e.g., Phoenix, Wallet of Satoshi).
Claim (Gasless)
Wait for the status to become ServerFunded, then claim your tokens.
Polygon vs Ethereum: This example uses Polygon which supports gasless claiming via Gelato. For Ethereum destinations (usdc_eth, usdt_eth, xaut_eth), users must connect a wallet and pay gas fees. See Claim with WalletConnect.
// Wait for ServerFunded status, then claim
const swap = await client.getSwap(result.response.id);
if (swap.status === "serverfunded") {
const claimResult = await client.claim(result.response.id);
console.log("Claimed:", claimResult.success);
}Build with AI
We have generated an llms-full.txt file that converts all our documentation into a single markdown document following the llmstxt.org standard. Feed it to any AI coding agent (Claude, Cursor, Copilot, etc.) and it will have everything it needs to integrate the LendaSwap SDK into your project.
Next Steps
- Protocol Deep Dive - Understand the HTLC mechanics
- SDK & API Reference - Full SDK and REST API documentation