Skip to main content
The Satora Swaps SDK is pure TypeScript with no WASM or native dependencies. It works in React Native out of the box - you just need to provide storage adapters since IndexedDB is not available.

Installation


Storage Adapters

The SDK requires two storage interfaces: WalletStorage (for your mnemonic and key index) and SwapStorage (for swap state). On the web, the SDK ships IdbWalletStorage and IdbSwapStorage backed by IndexedDB. In React Native, you need to implement these interfaces using a native storage solution. Below is a complete implementation using react-native-mmkv, a fast key-value storage library for React Native.

Key Storage

Swap Storage


Initialize Client

From here, all SDK methods (createLightningToEvmSwapGeneric, createArkadeToEvmSwapGeneric, claim, getSwap, listAllSwaps, etc.) work identically to the web version.

EVM Transactions

React Native does not have window.ethereum or BrowserProvider. For EVM interactions (depositing stablecoins, manual claiming on Ethereum), use ethers.js with a direct provider:
See the EVM to BTC page for complete examples with React Native tabs.

Notes

  1. Secure storage - MMKV stores data unencrypted by default. For production apps, enable MMKV encryption or use a secure enclave for the mnemonic.
  2. Alternative storage - You can use any storage backend (AsyncStorage, expo-sqlite, etc.) by implementing the WalletStorage and SwapStorage interfaces.
  3. WebSocket support - React Native has built-in WebSocket support, so the SDK’s SwapStatusWatcher (used internally by subscribeToSwaps(...) for real-time swap status updates) works without changes.
  4. No polyfills needed - The SDK uses only standard JavaScript APIs available in React Native.