Skip to main content

1) Install

npm install @satsterminal-sdk/bridge
# or via suite
npm install satsterminal-sdk

2) Initialize the client

import { BridgeSDK } from "@satsterminal-sdk/bridge";
// or: import { createBridgeClient } from "@satsterminal-sdk/bridge";

const bridge = new BridgeSDK({
  apiKey: process.env.API_KEY!,
  baseUrl: process.env.BRIDGE_BASE_URL, // optional override
});

3) USDC -> USDB (Spark)

Request a quote, send USDC, then submit the transaction and poll status.
const quote = await bridge.spark.stables.quote({
  sourceChain: "solana",
  amount: "1000000", // USDC in smallest units (6 decimals)
  userSparkAddress: "spark1...",
});

// User sends USDC to quote.depositAddress on the source chain.
const { bridgeId } = await bridge.spark.stables.submit({
  quoteId: quote.quoteId,
  txHash: "<source-chain-tx-hash>",
  sourceAddress: "<source-chain-address>",
});

const status = await bridge.spark.stables.process(bridgeId);
// or: await bridge.spark.stables.status({ id: bridgeId });

4) Track status

const status = await bridge.spark.stables.status({ id: bridgeId });
console.log(status);
Common statuses
  • processing: deposit submitted, waiting for verification
  • confirming: tx found, waiting for chain confirmations
  • minting: Brale transfer in progress
  • completed: USDB sent to Spark
  • failed: terminal failure