import { BN } from "@coral-xyz/anchor"; import { Commitment, PublicKey, TransactionInstruction, TransactionSignature, VersionedTransaction } from "@solana/web3.js"; import { BaseClient, type ProtocolPolicyClient, type TxOptions } from "../base"; import { LoopscaleBorrowPolicy } from "../../deser/integrationPolicies"; import { LoopscaleLoan, LoopscaleMarketInformation, LoopscaleStrategy } from "../../deser"; import { BorrowMarketAccounts, BorrowPrincipalAccounts, BorrowPrincipalParams, CreateLoanParams, DepositCollateralAccounts, DepositCollateralParams, LoopscaleBorrowPrincipalTerms, LoopscaleBorrowQuoteTerms, LoopscaleBorrowTxBuilder, LoopscaleCoreClient, LoopscaleMaxQuoteParams, LoopscaleQuote, PriceLoansAccounts, RepayPrincipalAccounts, RepayPrincipalParams, UpdateWeightMatrixAccounts, UpdateWeightMatrixParams, WithdrawCollateralAccounts, WithdrawCollateralParams } from "./core"; export type Tuple5 = [number, number, number, number, number]; export declare class LoopscaleBorrowClient implements ProtocolPolicyClient { private readonly core; readonly txBuilder: LoopscaleBorrowTxBuilder; constructor(core: LoopscaleCoreClient); get base(): BaseClient; get programId(): PublicKey; get integrationAuthorityPda(): PublicKey; getEventAuthorityPda(): PublicKey; getLoanPda: (nonce: BN, borrower?: PublicKey) => PublicKey; getLoanTokenAta(loan: PublicKey, mint: PublicKey, tokenProgram?: PublicKey): PublicKey; fetchPolicy(): Promise; setPolicy(policy: LoopscaleBorrowPolicy, txOptions?: TxOptions): Promise; clearPolicy(txOptions?: TxOptions): Promise; fetchLoan(loan: PublicKey): Promise; fetchOwnedLoan(loan: PublicKey, borrower?: PublicKey): Promise; fetchRegisteredLoans(commitment?: Commitment): Promise; fetchMarketInformation(marketInformation: PublicKey): Promise; fetchStrategy(strategy: PublicKey): Promise; fetchMaxQuotes(params: LoopscaleMaxQuoteParams): Promise; selectBestQuote(quotes: LoopscaleQuote[], externalYieldSource?: number, borrowAmount?: BN): Promise; fetchBestQuote(params: LoopscaleMaxQuoteParams): Promise; resolveBorrowMarketAccounts(params: { strategy: PublicKey | LoopscaleStrategy; collateralMint: PublicKey; expectedApy: BN; }): Promise; resolveBorrowTermsFromStrategy(params: { strategy: PublicKey | LoopscaleStrategy; principalMint: PublicKey; assetIdentifier: PublicKey; expectedApy: BN; expectedLqt: Tuple5; }): Promise; resolveBorrowTermsFromTargetStrategy(params: { strategy: PublicKey | LoopscaleStrategy; principalMint: PublicKey; assetIdentifier: PublicKey; requestedDurationIndex?: number; }): Promise; resolveBorrowTermsFromQuote(params: { principalMint: PublicKey; collateralMint: PublicKey; assetIdentifier: PublicKey; collateralAmount: BN; borrowAmount: BN; durationType: number; duration: number; externalYieldSource?: number; }): Promise; buildApiCreateLoanIxs(params: CreateLoanParams): Promise<{ loan: PublicKey; ixs: TransactionInstruction[]; }>; buildApiDepositCollateralIxs(params: { loan: PublicKey; depositMint: PublicKey; amount: BN; assetType: number; assetIdentifier: PublicKey; assetIndexGuidance: number[]; }): Promise; buildApiBorrowPrincipalIxs(params: { loan: PublicKey; strategy: PublicKey; amount: BN; assetIndexGuidance: number[]; duration: number; expectedLoanValues: { expectedApy: BN; expectedLqt: Tuple5; }; skipSolUnwrap: boolean; }): Promise; buildApiWithdrawCollateralIxs(params: { loan: PublicKey; collateralMint: PublicKey; amount: BN; collateralIndex: number; assetIndexGuidance: number[]; expectedLoanValues: { expectedApy: BN; expectedLqt: Tuple5; }; }): Promise; buildApiRepayPrincipalIxs(params: { loan: PublicKey; strategy: PublicKey; amount: BN; ledgerIndex: number; repayAll: boolean; }): Promise; cosignTransaction(params: { tx: VersionedTransaction; identifier: string; }): Promise; createLoan(params: CreateLoanParams, txOptions?: TxOptions): Promise; closeLoan(loan: PublicKey, txOptions?: TxOptions): Promise; depositCollateral(params: DepositCollateralParams, accounts: DepositCollateralAccounts, txOptions?: TxOptions): Promise; /** @deprecated */ updateWeightMatrix(params: UpdateWeightMatrixParams, accounts: UpdateWeightMatrixAccounts, txOptions?: TxOptions): Promise; borrowPrincipal(params: BorrowPrincipalParams, accounts: BorrowPrincipalAccounts, txOptions?: TxOptions): Promise; withdrawCollateral(params: WithdrawCollateralParams, accounts: WithdrawCollateralAccounts, txOptions?: TxOptions): Promise; repayPrincipal(params: RepayPrincipalParams, accounts: RepayPrincipalAccounts, txOptions?: TxOptions): Promise; /** @deprecated */ resolveLedgerStrategyAccounts(strategy: PublicKey): Promise<{ strategy: PublicKey; marketInformation: PublicKey; principalMint: PublicKey; }>; getPriceLoansAccounts(commitment?: Commitment): Promise; }