import { AccountInfo, Connection, PublicKey, TransactionInstruction } from "@solana/web3.js"; import { WrapperVaultState } from "./state/wrapperVault"; import { GlobalConfigState } from "./state/globalConfig"; import { AccountMap, ProtocolKind, Quote, QuoteContext, QuoteParams, SwapParams } from "./types"; import { KlendState } from "./sources/klend"; import { SaveState } from "./sources/save"; import { MarginfiState } from "./sources/marginfi"; import { LuloState } from "./sources/lulo"; import { KvaultState } from "./sources/kvault"; export type ProtocolState = { kind: ProtocolKind.Klend; state: KlendState; } | { kind: ProtocolKind.Kvault; state: KvaultState; } | { kind: ProtocolKind.Save; state: SaveState; } | { kind: ProtocolKind.Marginfi; state: MarginfiState; } | { kind: ProtocolKind.Lulo; state: LuloState; }; export type SourceKind = "kvault" | "klend" | "save" | "lulo" | "marginfi"; export interface SourceConstraints { minDeposit: bigint | null; minWithdraw: bigint | null; } export declare class Overpass { readonly key: PublicKey; readonly wrapperMint: PublicKey; readonly underlyingMint: PublicKey; readonly protocol: ProtocolKind; readonly wrapperVault: WrapperVaultState; private state; private globalConfig; constructor(key: PublicKey, wrapperVault: WrapperVaultState); getQuoteContext(currentSlot: bigint, unixTimestamp: bigint): QuoteContext; getGlobalConfig(): GlobalConfigState; static fetchGlobalConfig(connection: Connection, programId?: PublicKey): Promise<{ pda: PublicKey; state: GlobalConfigState | null; }>; static fetchSourceConstraints(connection: Connection, source: PublicKey, kind: SourceKind): Promise; static fromAccount(key: PublicKey, data: Uint8Array): Overpass; static fromState(key: PublicKey, wrapperVault: WrapperVaultState, protocolState: ProtocolState): Overpass; static fromKlendSource(args: { source: PublicKey; sourceAcct: AccountInfo; wrapperMint: PublicKey; }): Overpass; static fromSaveSource(args: { source: PublicKey; sourceAcct: AccountInfo; wrapperMint: PublicKey; }): Overpass; static fromMarginfiSource(args: { source: PublicKey; sourceAcct: AccountInfo; wrapperMint: PublicKey; underlyingTokenProgram: PublicKey; }): Overpass; static fromLuloSource(args: { source: PublicKey; sourceAcct: AccountInfo; wrapperMint: PublicKey; }): Overpass; static fromKvaultSource(connection: Connection, args: { source: PublicKey; sourceAcct: AccountInfo; wrapperMint: PublicKey; underlyingTokenProgram: PublicKey; useFarms?: boolean; }): Promise; getAccountsToUpdate(): PublicKey[]; update(accountMap: AccountMap): void; hasDynamicAccounts(): boolean; hasPendingDynamicAccounts(): boolean; quote(params: QuoteParams, ctx: QuoteContext): Quote; getNavPerShare(ctx: QuoteContext): bigint | null; getProjectedApy(ctx: QuoteContext): number | null; getProtocolState(): ProtocolState; getSwapAndAccountMetas(params: SwapParams): SwapAndAccountMetas; private buildAccountMetas; } export interface SwapAndAccountMetas { instruction: TransactionInstruction; lookupTableAddresses: PublicKey[]; }