Skip to main content

createClient

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

const quote = await swaps.swapQuote({
  amount: "0.001",
  fromToken: "BTC",
  toToken: "USDC",
  address: "bc1...",
  protocol: "runes",
  params: {}
});

Borrow via suite

const setup = await borrow.setup();
const { userStatus } = setup;

// Start a new loan wallet (advanced)
await borrow.startNewLoan();

Legacy compatibility

Existing swaps partners can keep:
import { SatsTerminal } from "satsterminal-sdk";
const swaps = new SatsTerminal({ apiKey: process.env.API_KEY! });