# SDK Reference Overview

The Atomiq SDK provides a complete TypeScript/JavaScript interface for trustless cross-chain swaps between Bitcoin and smart chains (Solana, Starknet, EVM).

info

This page only contains the SDK API surface reference, for actual guides about how to integrate swaps please start with [SDK Guide](https://docs.atomiq.exchange/sdk-guide/.md).

## What You'll Find Here

### **Core SDK**

The main SDK package containing:

* [**Swapper**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/Swapper.md) - The central class for managing all swap operations

* [**SwapperFactory**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/SwapperFactory.md) - Configuration and initialization

* **Swap Classes** - Specific implementations and base abstractions for the different swap flows:

  * [ISwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwap.md) / [IEscrowSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IEscrowSwap.md) - Base and abstract swap building blocks
  * [ToBTCSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ToBTCSwap.md) / [ToBTCLNSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ToBTCLNSwap.md) - Smart chain to Bitcoin and Lightning
  * [FromBTCSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/FromBTCSwap.md) / [FromBTCLNSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/FromBTCLNSwap.md) / [FromBTCLNAutoSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/FromBTCLNAutoSwap.md) / [SpvFromBTCSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/SpvFromBTCSwap.md) - Bitcoin and Lightning to smart chain
  * [LnForGasSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/LnForGasSwap.md) / [OnchainForGasSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/OnchainForGasSwap.md) - Trusted gas swap flows
  * [IAddressSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IAddressSwap.md) / [IBTCWalletSwap](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IBTCWalletSwap.md) / [ISwapWithGasDrop](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/ISwapWithGasDrop.md) - Shared swap capability interfaces

* **Bitcoin** - [BitcoinWallet](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/BitcoinWallet.md), [IBitcoinWallet](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IBitcoinWallet.md), headers, RPC

* **Chains** - [ChainInterface](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/ChainInterface.md), [SwapContract](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SwapContract.md), [SpvVaultContract](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/SpvVaultContract.md) for chain integrations and contract abstractions

* **Errors** - [IntermediaryError](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IntermediaryError.md), [RequestError](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/RequestError.md), [TransactionRevertedError](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/TransactionRevertedError.md) for SDK and on-chain failure handling

* **LPs** - [Intermediary](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/Intermediary.md), [IntermediaryDiscovery](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/IntermediaryDiscovery.md) for working with liquidity providers

* **Lightning** - [LightningNetworkApi](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/LightningNetworkApi.md), [LNURLPay](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLPay.md), [LNURLWithdraw](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/LNURLWithdraw.md) for Lightning payments and LNURL

* **Messenger** - [Messenger](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/Messenger.md), [NostrMessenger](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/NostrMessenger.md) for data propagation/broadcasting layer between the SDK and Watchtowers

* **Pricing** - [ISwapPrice](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/ISwapPrice.md) for swap price API & fees

* **Storage** - [IUnifiedStorage](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IUnifiedStorage.md) for implementing custom storage backends

* **Swap Actions** - [SwapExecutionAction](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/SwapExecutionAction.md) for execution step modeling

* **Tokens** - [Token](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/Token.md), [TokenAmount](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/type-aliases/TokenAmount.md) for token metadata and amount handling

* **Utilities** - [SwapperUtils](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/classes/SwapperUtils.md) and helpers for address parsing, balance checking, token identification

### **Chain Integrations**

Chain-specific implementations you need based on your target blockchains:

* [**Solana**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-solana/src/.md)
* [**Starknet**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-starknet/src/.md)
* [**EVM**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-chain-evm/src/.md)

Each chain module includes:

* Chain-specific swap implementations
* Wallet integrations
* RPC configuration
* Network-specific types and utilities

### **Storage Adapters**

The SDK uses browser-based IndexedDB by default. To use the SDK in different environments, e.g. Node.js or React Native you need to use the respective storage adapter:

* File-based [**SQLite**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-sqlite/src/.md) storage (Node.js)
* [**React Native Async**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-rn-async/src/.md) storage

In case you need to integrate your own storage adapter for your environment check the [**IUnifiedStorage**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-sdk/src/interfaces/IUnifiedStorage.md) interface.

info

If you already have a key-value storage backend you can use the [**Memory Indexed KV**](https://docs.atomiq.exchange/sdk-reference/api/atomiq-storage-memory-indexed-kv/src/.md) to easily turn it into the swap storage backend. This keeps the necessary indexes in-memory so is only suitable for single-user swap storage (not for backend handling a great number of swaps).

***

**Ready to integrate?** Visit the [SDK Guide](https://docs.atomiq.exchange/sdk-guide/.md) for detailed tutorials and examples.

**Want to learn more about the Atomiq protocol?** Check out the [protocol overview](https://docs.atomiq.exchange/index.md).
