npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@atomiqlabs/storage-rn-async

v2.0.1

Published

A react native async-storage implementation for atomiqlabs SDK

Downloads

52

Readme

@atomiqlabs/storage-rn-async

@atomiqlabs/storage-rn-async is the React Native storage adapter for the Atomiq SDK. The SDK uses browser IndexedDB by default. React Native does not have browser IndexedDB, so mobile apps need to provide storage explicitly. This package does that by using @react-native-async-storage/async-storage as the backend.

What this package provides

  • RNAsyncUnifiedStorage: persistent unified swap storage used by the SDK for swap records and indexed queries.
  • RNAsyncStorageManager: persistent storage manager used for chain-specific SDK stores.

Each constructor takes a key prefix so your app can namespace Atomiq data inside AsyncStorage.

When to use it

Use this package when you run the Atomiq SDK in:

  • React Native mobile apps
  • Expo / React Native runtimes with AsyncStorage available

If you run the SDK in the browser, you usually do not need this package because the SDK already uses IndexedDB there.

Installation

npm install @atomiqlabs/sdk @atomiqlabs/storage-rn-async

This adapter uses @react-native-async-storage/async-storage under the hood, so your React Native app must support that package.

SDK Usage

Pass RNAsyncUnifiedStorage as swapStorage and RNAsyncStorageManager as chainStorageCtor when creating the swapper.

import {BitcoinNetwork, SwapperFactory, TypedSwapper} from "@atomiqlabs/sdk";
import {RNAsyncStorageManager, RNAsyncUnifiedStorage} from "@atomiqlabs/storage-rn-async";

const chains = [SolanaInitializer, StarknetInitializer, CitreaInitializer] as const;
type SupportedChains = typeof chains;

const Factory = new SwapperFactory<SupportedChains>(chains);

const swapper: TypedSwapper<SupportedChains> = Factory.newSwapper({
    chains: {
        ...
    },
    bitcoinNetwork: BitcoinNetwork.MAINNET,
    // React Native does not provide the browser IndexedDB storage
    // used by default in web environments, so provide AsyncStorage-backed adapters.
    swapStorage: chainId => new RNAsyncUnifiedStorage(`atomiq_sdk_chain_${chainId}_`),
    chainStorageCtor: name => new RNAsyncStorageManager(`atomiq_sdk_store_${name}_`)
});

await swapper.init();

Notes

  • Both storage adapters store data under the prefixes you pass in, so pick stable prefixes that do not collide with the rest of your app's AsyncStorage keys.
  • RNAsyncUnifiedStorage builds the SDK's indexed storage behavior on top of AsyncStorage, which is a plain key-value backend, hence the indexing is handled in-memory - this is therefore only suitable for single-client environments with <10,000 swaps saved.
  • Persistence depends on the durability of the app's AsyncStorage data on the device.