Skip to main content
The wallet stores its data in two repositories:
  • The wallet repository stores virtual outputs, onchain outputs, transaction history, and wallet settings.
  • The contract repository stores the contracts that the wallet watches.
Pass both repositories to Wallet.create in the storage option. If you omit storage, the wallet uses IndexedDB. Node.js and React Native don’t provide IndexedDB, so pass storage there.
Repositories don’t store the wallet identity. Keep the mnemonic or seed in your platform’s secure storage.

Choose a repository

The examples on this page assume that you set up identity and the providers as in Create your Wallet, or as in Expo/React Native for React Native apps. storage also accepts intentRepository, which tracks your batch registration requests, and virtualTxRepository. Both are optional and experimental.

IndexedDB

The IndexedDB repositories use a database named arkade-service-worker by default. To use a different database, pass its name to each repository:

SQLite

The SQLite repositories work with any SQLite driver. You connect your driver through a SQLExecutor: an object with three async methods, run, get, and all. The SDK creates its tables on first use. You own the database connection, and the SDK never closes it. The Node.js example uses the built-in node:sqlite module, which is stable from Node.js 22.13.0. The Expo example uses expo-sqlite.

Table prefix

The SQLite repositories add the prefix ark_ to every table name. To keep more than one wallet in the same database, give each wallet its own prefix. A prefix can contain only letters, digits, and underscores, and it can’t start with a digit.

Realm

The Realm repositories take an open Realm instance. When you open the Realm:
  • Add ArkRealmSchemas to the schema list.
  • Set schemaVersion to ARK_REALM_SCHEMA_VERSION or higher.
  • Call runArkRealmMigrations in onMigration.

In-memory

The in-memory repositories keep data only in memory. The data is lost when the process exits. Use them for tests and short-lived scripts.

Migrate from storage adapters

SDK 0.4 deprecates the storage adapters, and SDK 0.5 removes them. Move to repositories before you upgrade to 0.5.
Replace each storage adapter with a repository: To keep the data that an adapter stored, copy it to the new wallet repository with migrateWalletRepository. Give it the addresses to copy: boarding addresses in onchain, and Arkade addresses in offchain. The function does nothing if there is no data to migrate or if the migration is already done. It never deletes the old data.
migrateWalletRepository copies wallet data only. Packages that store their own contract data supply their own migration, for example migrateToSwapRepository in @arkade-os/boltz-swap.

Next Steps