/** * PIT Protocol SDK * * A TypeScript SDK for interacting with the PIT prediction market protocol on Solana. * * ## Quick Start * * ```typescript * import { * createProgram, * createTradeInstruction, * getMarketAddress, * PythPriceService, * MarketWatcher, * PoolType, * } from "@pit-protocol/sdk"; * import { AnchorProvider } from "@coral-xyz/anchor"; * * // Create program instance * const provider = new AnchorProvider(connection, wallet, { commitment: "confirmed" }); * const program = createProgram(provider); * * // Create trade instruction (async) * const ix = await createTradeInstruction(program, { * weekNumber: 1, * poolType: PoolType.High, * strikeIndex: 0, * isHit: true, * amount: new BN(1_000_000_000), * isBuy: true, * user: wallet.publicKey, * // ... other params * }); * * // User sends the transaction * const tx = new Transaction().add(ix); * await sendAndConfirmTransaction(connection, tx, [wallet]); * * // Get Pyth price * const priceService = new PythPriceService(); * const price = await priceService.getLatestPrice(); * console.log(`SOL/USD: $${price.price}`); * * // Start keeper bot * const watcher = new MarketWatcher({ * connection, * signer: keeperKeypair, * weekNumber: 1, * }); * await watcher.start(); * ``` */ // Core types export * from "./types.js"; export * from "./constants.js"; // Program utilities export { createProgram, createReadOnlyProgram, createProgramWithKeypair, IDL } from "./program.js"; export type { PitProgram, Pit } from "./program.js"; // Account utilities export * from "./accounts/index.js"; // Instruction builders (export specific items to avoid conflicts) export { createInitializeMarketInstruction, createZeroQVector, createInitializeRegistryInstruction, createCreateMarketMintsInstruction, createInitializeMetadataInstruction, createTradeInstruction, createMarkExtremeInstruction, createSettleMarketInstruction, createRedeemInstruction, createClaimFeesInstruction, createWithdrawSubsidyInstruction, createPauseMarketInstruction, createUnpauseMarketInstruction, createSetNicknameInstruction, } from "./instructions/index.js"; // Math utilities export * from "./math.js"; // Outcome calculation export * from "./outcome/index.js"; // Pyth price service export * from "./pyth/index.js"; // Keeper module export * from "./keeper/index.js"; // Utility functions export * from "./utils/index.js"; // Transaction parser export * from "./txParser.js";