Quick Start
Get your first Bitcoin-backed loan in under 5 minutes.Prerequisites
Before you begin, ensure you have:- Installed the SDK (
npm install @satsterminal-sdk/borrow) - An API key from SatsTerminal
- A Bitcoin wallet with signing capability
Step 1: Initialize the SDK
Step 2: Setup Your Account
Thesetup() method initializes your smart account and creates a session:
The first call to setup() will prompt the user to sign a message with their Bitcoin wallet. This signature is used to derive the smart account.
Step 3: Preview Fees Before Borrowing
If your UI needs to show fees up front, fetch quotes first and then request the fee breakdown for the selected quote:Step 4: Get a Loan
Use the high-levelgetLoan() method for the simplest experience:
Step 5: Deposit Bitcoin
WhenonDepositReady fires, send the required Bitcoin to the deposit address:
Deposit addresses are single-use and the quote remains locked for up to 6 hours. If the deposit is not received before that window ends, request a fresh quote and deposit address.
Step 6: Loan Complete
Once the deposit is confirmed and processed, the loan will be executed automatically. The borrowed stablecoins will be available in your smart account.Complete Example
What’s Next?
- Configuration - Customize SDK behavior
- Getting a Loan - Detailed loan guide
- API Reference - Full API documentation