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
| Flow | Direction | What it does |
|---|---|---|
wrapAndSwap | Bitcoin → EVM/TON/Solana | Convert BTC into a destination-chain token (ERC-20, Jetton, or SPL) |
swapAndUnwrap | EVM/TON/Solana → Bitcoin | Convert a destination-chain token back into BTC |
Each flow has three stages you can call independently:
- Estimate — quote the output amount and fees → Estimating output & fees.
- Build — create an unsigned transaction or contract-call inputs → Wrap & Swap and Swap & Unwrap.
- 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
BurnRoutercontract. - Cross-chain networks (Ethereum, Optimism, Arbitrum, Base, Unichain) — reach Bitcoin
via a base network, with the inter-chain hop bridged through
Across; call the
EthConnectorcontract.
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.