@omnipair/program-interface
v0.9.8
Published
Omnipair program IDL, TypeScript types, and constants
Readme
@omnipair/program-interface
TypeScript interface for the Omnipair Solana program - an oracleless spot and margin money market protocol.
Installation
npm install @omnipair/program-interface
# or
yarn add @omnipair/program-interfaceUsage
import { Program } from "@coral-xyz/anchor";
import { IDL, Omnipair, PROGRAM_ID, derivePairAddress } from "@omnipair/program-interface";
// Create a typed program instance
const program = new Program<Omnipair>(IDL, PROGRAM_ID, provider);
// Fetch a pair account (fully typed)
const [pairAddress] = derivePairAddress(token0, token1);
const pair = await program.account.pair.fetch(pairAddress);
console.log("Reserve0:", pair.reserve0.toString());
console.log("Reserve1:", pair.reserve1.toString());Exports
IDL
The Anchor IDL JSON for the Omnipair program.
Types
All TypeScript types generated from the IDL:
Omnipair- The program type- Account types:
Pair,UserPosition,RateModel,FutarchyAuthority - Instruction argument types
- Event types
Constants
PROGRAM_ID- The Omnipair program IDSEEDS- PDA seed constants
Utilities
derivePairAddress(token0, token1)- Derive a Pair PDAderiveUserPositionAddress(pair, user)- Derive a UserPosition PDA
Peer Dependencies
@coral-xyz/anchor>= 0.30.0
License
MIT
