Developer quickstart
Get a BTC → EVM/TON/Solana quote in under a minute. The SDK wraps the TeleSwap REST API, so you can also do everything below over plain HTTP.
1. Install
npm install @teleportdao/teleswap-sdk
2. Estimate a swap
import { TeleswapSDK } from '@teleportdao/teleswap-sdk';
const sdk = new TeleswapSDK();
// Quote bridging 0.001 BTC → the native token on Optimism
const estimate = await sdk.wrapAndSwapEstimate(0.001, 'optimism', undefined);
console.log(estimate.outputAmount); // expected output
console.log(estimate.teleswapFee); // full fee breakdown (in BTC)
3. Build, sign & track
- Build an unsigned Bitcoin transaction with
wrapAndSwapUnsigned, sign it with your Bitcoin wallet, and broadcast it. - Track it with
getRequestStatusByTxIduntilstateisDone.
Next steps
- Installation & setup — including a
thirdPartyIdto earn fees - Wrap & Swap (BTC → EVM/TON)
- Swap & Unwrap (EVM/TON → BTC)
- Full SDK reference and API reference