@deriverse/client-state
v1.0.8
Published
Client state management utilities for Deriverse SDK on Solana.
Maintainers
Readme
@deriverse/client-state
TypeScript client-state utilities for Deriverse trading workflows on Solana.
This package is designed to work alongside @deriverse/kit and helps maintain in-memory client instrument state while processing Deriverse engine/log events.
Installation
npm install @deriverse/client-stateWhat This Package Provides
createClientState(...)for bootstrapping client instrument state from engine data.- State models for spot/perp balances and in-order exposure.
- Utility functions for collateral, leverage, liquidation, and health calculations.
ClientStateclass for applying and tracking account/instrument changes.
Minimal Usage
import { createClientState } from "@deriverse/client-state";
const state = await createClientState({
engine,
rpc,
instrIds: [1, 2]
});
if (!state) {
throw new Error("Unable to initialize client state");
}Build
npm run buildPublish
npm publishLicense
Apache-2.0. See LICENSE.
