UNPKG

@frakt-protocol/frakt-sdk

Version:

Frakt SDK for interacting with frakt.xyz protocols

48 lines (47 loc) 3.35 kB
/// <reference types="node" /> import { Program, web3 } from '@project-serum/anchor'; import { NftLendingV2 } from './idl/nft_lending_v2'; import { CollectionInfoView, DepositView, LoanView, TimeBasedLiquidityPoolView, PriceBasedLiquidityPoolView, LotTicketView, FarmerView, LendingStakeView } from './types'; declare type ReturnAnchorProgram = (programId: web3.PublicKey, connection: web3.Connection) => Program<NftLendingV2>; export declare const returnAnchorProgram: ReturnAnchorProgram; declare type DecodedCollectionInfo = (decodedCollection: any, address: web3.PublicKey) => CollectionInfoView; export declare const decodedCollectionInfo: DecodedCollectionInfo; declare type DecodedLendingStake = (decodedLendingStake: any, address: web3.PublicKey) => LendingStakeView; export declare const decodedLendingStake: DecodedLendingStake; declare type DecodedFarmer = (decodedFarmer: any, address: web3.PublicKey) => FarmerView; export declare const decodedFarmer: DecodedFarmer; declare type DecodedTimeBasedLiquidityPool = (decodedLiquidityPool: any, address: web3.PublicKey) => TimeBasedLiquidityPoolView; export declare const decodedTimeBasedLiquidityPool: DecodedTimeBasedLiquidityPool; declare type DecodedPriceBasedLiquidityPool = (decodedLiquidityPool: any, address: web3.PublicKey) => PriceBasedLiquidityPoolView; export declare const decodedPriceBasedLiquidityPool: DecodedPriceBasedLiquidityPool; declare type decodedDeposit = (decodedDeposit: any, address: web3.PublicKey) => DepositView; export declare const decodedDeposit: decodedDeposit; declare type DecodedLoan = (decodedLoan: any, address: web3.PublicKey) => LoanView; export declare const decodedLoan: DecodedLoan; declare type DecodeLoan = (buffer: Buffer, connection: web3.Connection, programId: web3.PublicKey) => any; export declare const decodeLoan: DecodeLoan; declare type DecodeLotTicket = (buffer: Buffer, lotTicketPubkey: web3.PublicKey, connection: web3.Connection, programId: web3.PublicKey) => LotTicketView; export declare const decodeLotTicket: DecodeLotTicket; declare type GetMetaplexEditionPda = (mintPubkey: web3.PublicKey) => web3.PublicKey; export declare const getMetaplexEditionPda: GetMetaplexEditionPda; export declare const anchorRawBNsAndPubkeysToNumsAndStrings: (rawAccount: any) => any; export declare const getMostOptimalLoansClosestToNeededSolInBulk: ({ neededSol, possibleLoans, }: { possibleLoans: { nftMint: string; loanValue: number; interest: number; }[]; neededSol: number; }) => { nftMint: string; loanValue: number; interest: number; }[]; export declare function objectBNsAndPubkeysToNums(obj: any): any; export declare const createAndSendV0Tx: (connection: web3.Connection, txInstructions: web3.TransactionInstruction[], signer: web3.Signer, additionalSigners: web3.Signer[], lookupTablePubkey: web3.PublicKey, skipPreflight?: boolean | undefined) => Promise<void>; declare type FindTokenRecordPda = (mintPubkey: web3.PublicKey, token: web3.PublicKey) => web3.PublicKey; export declare const findTokenRecordPda: FindTokenRecordPda; declare type GetMetaplexMetadata = (mintPubkey: web3.PublicKey) => web3.PublicKey; export declare const getMetaplexMetadata: GetMetaplexMetadata; export declare const findRuleSetPDA: (payer: web3.PublicKey, name: string) => Promise<web3.PublicKey>; export {};