Skip to content
SwapKit is a powerful suite of tools for building blockchain applications.
SwapKit logo SwapKit logo

SwapKit

Cross-chain swaps made easy

SwapKit provides everything you need to integrate blockchain functionality into your application with a single, unified API.

20+ Blockchains

Support for EVM chains, Bitcoin, Cosmos ecosystem, Solana, NEAR Protocol, Ripple (XRP), and more - all through one consistent interface.

Multi-Wallet Support

Connect with 20+ wallets including MetaMask, WalletConnect, Ledger, Keystore, and hardware wallets.

DeFi Protocols

Built-in integrations with THORChain, Chainflip, 1inch, and other leading DeFi protocols.

Type-Safe & Modern

Built with TypeScript for complete type safety and excellent developer experience.

// @noErrorValidation
import { createSwapKit, Chain, SwapKitApi } from '@swapkit/sdk';
// Initialize SwapKit
const swapKit = createSwapKit();
// Connect a keystore wallet (supports 20+ chains)
await swapKit.connectKeystore([Chain.Ethereum, Chain.Bitcoin, Chain.Ripple], 'your mnemonic phrase');
// Get wallet balances
const ethBalance = await swapKit.getBalance(Chain.Ethereum);
const btcBalance = await swapKit.getBalance(Chain.Bitcoin);
const xrpBalance = await swapKit.getBalance(Chain.Ripple);
// Get a swap quote
const { routes } = await SwapKitApi.getSwapQuote({
sellAsset: 'ETH.ETH',
sellAmount: '1000000000000000000', // 1 ETH in wei
buyAsset: 'BTC.BTC',
sourceAddress: swapKit.getAddress(Chain.Ethereum),
destinationAddress: swapKit.getAddress(Chain.Bitcoin),
slippage: 3
});
// Execute the swap
if (routes.length > 0) {
const txHash = await swapKit
.swap({ route: routes[0] });
}

Unified API

One consistent API for all chains and protocols. No need to learn different interfaces for each blockchain.

Production Ready

Battle-tested in production by THORSwap and other leading DeFi applications.

Modular Design

Use only what you need - from lightweight toolboxes to the full SDK.

Active Development

Regular updates, new chain integrations, and responsive community support.

  • 🔗 Cross-Chain Swaps: Seamlessly swap assets across different blockchains
  • 💰 Multi-Chain Wallets: Manage wallets and balances across all supported chains
  • 🔐 Hardware Wallet Support: Full support for Ledger, Trezor, and KeepKey
  • 📊 Real-Time Quotes: Get accurate swap quotes from multiple DEX aggregators
  • 🛠️ Toolbox System: Low-level utilities for direct blockchain interactions
  • 🔌 Plugin Architecture: Extend functionality with custom plugins
  • 📱 Mobile Ready: Works in React Native and mobile environments
  • ⚡ Optimized Performance: Efficient caching and request batching
Terminal window
bun add @swapkit/sdk
// @noErrorValidation
import { createSwapKit } from '@swapkit/sdk';
const swapKit = createSwapKit({
config: {
// Optional: Add SwapKit API key for enhanced features
apiKeys: {
swapKit: 'your-swapkit-api-key', // Get from https://api.swapkit.dev
}
}
});
// @noErrorValidation
import { createSwapKit, Chain, AssetValue, FeeOption } from '@swapkit/sdk';
// Initialize SwapKit
const swapKit = createSwapKit();
// Connect EVM wallet (MetaMask)
await swapKit.connectEVMWallet([Chain.Ethereum]);
// Get wallet balance
const balance = await swapKit.getBalance(Chain.Ethereum);
// Transfer ETH
const assetValue = AssetValue.from({
asset: 'ETH.ETH',
value: '0.1'
});
const txHash = await swapKit.transfer({
assetValue,
recipient: '0x742d35Cc6634C0532925a3b844Bc9e7595f6E321',
feeOptionKey: FeeOption.Fast
});

Discord

Join our Discord server for support and discussions with the community.

Join Discord →