Omnipair program IDL, TypeScript types, and constants
npm install @omnipair/program-interfaceTypeScript interface for the Omnipair Solana program - an oracleless spot and margin money market protocol.
``bash`
npm install @omnipair/program-interfaceor
yarn add @omnipair/program-interface
`typescript
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
// 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());
`
- The program type
- Account types: Pair, UserPosition, RateModel, FutarchyAuthority
- Instruction argument types
- Event types$3
- PROGRAM_ID - The Omnipair program ID
- SEEDS - PDA seed constants$3
- derivePairAddress(token0, token1) - Derive a Pair PDA
- deriveUserPositionAddress(pair, user) - Derive a UserPosition PDAPeer Dependencies
-
@coral-xyz/anchor` >= 0.30.0MIT