createClient
Copy
import { createClient } from "satsterminal-sdk";
import { ChainType } from "@satsterminal-sdk/borrow";
const { swaps, borrow } = createClient({
apiKey: process.env.API_KEY!,
// omit borrow to skip initialization
borrow: {
chain: ChainType.BASE,
wallet: /* your wallet provider */
},
// bridge: coming soon
});
Swaps via suite
Copy
const quote = await swaps.swapQuote({
amount: "0.001",
fromToken: "BTC",
toToken: "USDC",
address: "bc1...",
protocol: "runes",
params: {}
});
Borrow via suite
Copy
const setup = await borrow.setup();
const { userStatus } = setup;
// Start a new loan wallet (advanced)
await borrow.startNewLoan();
Legacy compatibility
Existing swaps partners can keep:Copy
import { SatsTerminal } from "satsterminal-sdk";
const swaps = new SatsTerminal({ apiKey: process.env.API_KEY! });