@iqprotocol/account
v0.19.1
Published
This package is part of [IQ Protocol JS SDK.](https://github.com/iqlabsorg/iq-sdk-js)
Downloads
38
Keywords
Readme
Account State Management
This package is part of IQ Protocol JS SDK.
| :exclamation: The package is in development and breaking changes should be expected. Use at your own risk! | |:------------------------------------------------------------------------------------------------------------------|
This is high level package which provides tools for IQ Protocol off-chain account state management.
It is storage and blockchain agnostic and relies on injected providers.
For example, it uses storage provider (e.g. Postgres Store) to persist account information and manage off-chain state.
It also allows to automatically initialize account state using blockchain provider (e.g. EIP155BlockchainProvider).
Use this package when you need an off-chain onboarding and account state management.
Installation
yarn add @iqprotocol/account
Usage
import { AccountManager, AccountStateManager } from '@iqprotocol/account';
import { PostgresStore } from '@iqprotocol/postgres-store';
import { EIP155BlockchainProvider } from '@iqprotocol/eip155';
const store = new PostgresStore(...);
const accountManager = new AccountManager({ store });
const blockchain = new EIP155BlockchainProvider(...);
const accountStateManager = new AccountStateManager({ store, blockchain });