- The wallet repository stores virtual outputs, onchain outputs, transaction history, and wallet settings.
- The contract repository stores the contracts that the wallet watches.
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 namedarkade-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 aSQLExecutor: 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 prefixark_ 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
ArkRealmSchemasto the schema list. - Set
schemaVersiontoARK_REALM_SCHEMA_VERSIONor higher. - Call
runArkRealmMigrationsinonMigration.
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
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
- Service Worker - Run your wallet in a background service worker
- Expo/React Native - Set up Arkade in React Native applications