Skip to main content

Install

npm install satsterminal-sdk
# or swaps only
npm install @satsterminal-sdk/swaps
# or borrow only
npm install @satsterminal-sdk/borrow

Initialize (suite)

import { createClient } from "satsterminal-sdk";
import { ChainType } from "@satsterminal-sdk/borrow";

const { swaps, borrow } = createClient({
  apiKey: process.env.API_KEY!,
  borrow: {
    chain: ChainType.BASE,
    wallet: /* your wallet provider */
  }
});

First requests

  • Swaps: await swaps.popularTokens({}); or await swaps.swapQuote({...});
  • Borrow: await borrow.setup(); then await borrow.startNewLoan();

Node/TypeScript

TypeScript is supported out of the box. For Node, use v18+ to align with fetch and current toolchain.