Lombard SDK V2
Integrate native Bitcoin staking into your own application, providing your community easy access to earning yield through liquid staking, with LBTC.
Our TypeScript Lombard SDK can be integrated into any frontend app: wallets, portfolio management apps, staking dashboards, custody portals.
If you're interested in integrating our Lombard SDK please fill out this Google Form and we will issue you with a partner Id.
Important: You must take all measures for your app and its users to comply with our Terms of Service, including removing access for unauthorized countries.
⭐️ New Features
LBTC is automatically minted by Lombard for users. This improves user experience, by the user explicitly agreeing for a small amount of LBTC to be diverted to Lombard's treasury to cover gas costs.
LBTC is optionally deployed immediately into DeFi Vaults, with the user explicitly agreeing to an ERC20 Permit approval and providing a contract call (e.g. deploying into DeFi Vault).
Demo
Demo app URL: https://demo-sdk.lombard.finance/
Github: https://github.com/lombard-finance/sdk-demo
Installation
Dependencies
The SDK requires the following peer dependencies:
Integration Guide
1. Exchange Rate & Minimum Deposit
Before users deposit BTC, display the exchange rate and minimum deposit amount:
Important: Deposits below minAmount will not be processed. Each individual deposit must exceed this threshold.
2. Select Output
Either:
2.a. Users stake their BTC and get LBTC: Users must sign a Network Fee authorization
2.b. Users stake their BTC directly into a DeFi Vault: Users must sign an ERC-20 Permit
2.a. Stake BTC, get LBTC
Users must authorize Lombard Protocol to deduct a small LBTC fee to contribute towards minting costs. Depending on the destination chain, this may be zero, but must still be signed.
Note: You can verify if a user has a valid fee authorization using
getNetworkFeeSignature
to prevent re-signing.
2.b. Stake BTC into a DeFi Vault
Enable automatic deployment of minted LBTC into DeFi operations. The authorization must be completed before the BTC deposit.
The authorization allows a vault contract to move LBTC tokens on behalf of the user when they are minted. Each chain has a list of supported vaults that can be retrieved using getStakeAndBakeVaults
.
Each vault has the following properties:
3. BTC Deposit Address Generation
Each deposit address is uniquely linked to:
Destination chain (where LBTC will be minted)
User's wallet address
Your partner ID
First, check for an existing address:
If no address exists, generate a new one:
4. Checking for deposits
Finally you can use getDepositsByAddress
to fetch and display the deposit history for a specified address.Comment
Last updated