Skip to main content

TeleSwap SDK

@teleportdao/teleswap-sdk enables secure, seamless bridging and swapping of BTC across blockchains. It wraps the TeleSwap REST API so you can quote, build, and track swaps from TypeScript.

Two core flows​

FlowDirectionWhat it does
wrapAndSwapBitcoin → EVM/TON/SolanaConvert BTC into a destination-chain token (ERC-20, Jetton, or SPL)
swapAndUnwrapEVM/TON/Solana → BitcoinConvert a destination-chain token back into BTC

Each flow has three stages you can call independently:

  1. Estimate — quote the output amount and fees → Estimating output & fees.
  2. Build — create an unsigned transaction or contract-call inputs → Wrap & Swap and Swap & Unwrap.
  3. Track — follow status and history → Status & history.

Source & target networks​

  • Source network — always Bitcoin.
  • Target networks — EVM networks, TON, and Solana. See Supported Assets & Chains for the full, current token list per chain.
Base vs. cross-chain (developer detail)

The SDK splits EVM targets into two kinds, which only affects which contract you call for the token → BTC direction:

  • Base networks (Polygon, BNB) — connect to Bitcoin directly; call the BurnRouter contract.
  • Cross-chain networks (Ethereum, Optimism, Arbitrum, Base, Unichain) — reach Bitcoin via a base network, with the inter-chain hop bridged through Across; call the EthConnector contract.

Users never see this distinction — they just pick a destination chain. See Swap & Unwrap.

Direct contract calls

You don't have to broadcast through the SDK. The build methods can return raw contract-call inputs so you can call the relevant contract directly. See Swap & Unwrap.

Next steps​