XO state management and storage package for the XO Engine. This package provides a unified interface for managing local state persistence and synchronization with remote state servers.
⚠️ This project is in early development phase. Use it only if you understand what you are doing and accept the risks. Do not use funds you are not willing to lose. Minor version bumps may introduce breaking changes
The state package is responsible for:
npm install @xo-cash/state
import { createStorageAdapter, StorageType, State } from '@xo-cash/state';
// Create a storage adapter
const storage = await createStorageAdapter({
storageType: StorageType.INDEXEDDB,
databasePath: './',
databaseFilename: 'XO',
});
// Create a state instance
const state = new state(storage);
// Use the state
await state.storeTemplate(template);
const template = await state.getTemplate('template-id');
MIT