JSPM

@deriverse/client-state

1.0.8
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 35
  • Score
    100M100P100Q86475F
  • License Apache-2.0

Client state management utilities for Deriverse SDK on Solana.

Package Exports

  • @deriverse/client-state

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-state

What 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.
  • ClientState class 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 build

Publish

npm publish

License

Apache-2.0. See LICENSE.