@deriverse/kit
v1.0.56
Published
TypeScript SDK for Deriverse on Solana. Built on [`@solana/kit`](https://www.npmjs.com/package/@solana/kit), `@deriverse/kit` helps load Deriverse account, market, and client state, build Deriverse instructions, and decode account and log data.
Readme
Deriverse SDK
TypeScript SDK for Deriverse on Solana. Built on @solana/kit, @deriverse/kit helps load Deriverse account, market, and client state, build Deriverse instructions, and decode account and log data.
Features
Spot and Swap
- Build spot order, cancel, mass-cancel, quote-replace, LP, and swap instructions
- Query spot order books, market metadata, and client spot orders
Perpetuals
- Build perpetual deposit, withdrawal, order, cancel, mass-cancel, quote-replace, seat buy/sell, leverage-change, statistics-reset, and upgrade-to-perp instructions
- Query perpetual order books, market metadata, client orders, and positions
Accounts and Data
- Discover Deriverse token, instrument, client, root, and community accounts
- Query client balances, open orders, and account state
- Decode Deriverse account models and transaction logs
- Use exported Zod schemas for runtime argument validation
VM / Vault Mode
- Build activation, deactivation, whitelist, withdrawal, and direct-withdraw instructions
Installation
npm install @deriverse/kitSolana Mainnet and Devnet Program IDs and Versions
Mainnet
PROGRAM_ID=DRVSpZ2YUYYKgZP8XtLhAGtT1zYSCKzeHfb4DgRnrgqD
VERSION=1Devnet
PROGRAM_ID=CDESjex4EDBKLwx9ZPzVbjiHEHatasb5fhSJZMzNfvw2
VERSION=7Examples
A comprehensive example is available at deriverse/kit-example.
Development
Prerequisites
- Node.js >=20.19.0, or a current Node.js 22+ release
- npm
- TypeScript is installed from dev dependencies
Setup
- Clone the repository:
git clone https://github.com/deriverse/kit.git
cd kit- Install dependencies:
npm install- Build the project:
npm run build- Run checks:
npm test
npm run lint
npm run format:checkLicense
Apache 2.0 License - see the LICENSE file for details.
