@kamino-finance/kliquidity-sdk
Version:
Typescript SDK for interacting with the Kamino Liquidity (kliquidity) protocol
34 lines • 2.23 kB
TypeScript
import { AccountRole, Address, IInstruction } from '@solana/kit';
import Decimal from 'decimal.js';
import { QuoteResponse, SwapInstructionsResponse, Instruction } from '@jup-ag/api';
export declare const DEFAULT_JUP_API_ENDPOINT = "https://lite-api.jup.ag";
export declare const DEFAULT_JUP_SWAP_API = "https://lite-api.jup.ag/swap/v1";
export type SwapTransactionsResponse = {
setupTransaction: string | undefined;
swapTransaction: string;
cleanupTransaction: string | undefined;
};
interface SwapIInstructionsResponse {
tokenLedgerInstruction?: IInstruction;
computeBudgetInstructions: Array<IInstruction>;
setupInstructions: Array<IInstruction>;
swapInstruction: IInstruction;
cleanupInstruction?: IInstruction;
addressLookupTableAddresses: Array<Address>;
}
export declare class JupService {
static getBestRouteV6: (userAddress: Address, amount: Decimal, inputMint: Address, outputMint: Address, slippageBps: number, asLegacyTransaction?: boolean, maxAccounts?: number, onlyDirectRoutes?: boolean) => Promise<SwapIInstructionsResponse>;
static getBestRouteQuoteV6: (amount: Decimal, inputMint: Address, outputMint: Address, slippageBps: number, asLegacyTransaction?: boolean, maxAccounts?: number, onlyDirectRoutes?: boolean, jupEndpoint?: string) => Promise<QuoteResponse>;
static getSwapIxsFromQuote: (userAddress: Address, quote: QuoteResponse, wrapUnwrapSOL?: boolean, asLegacyTransaction?: boolean) => Promise<SwapInstructionsResponse>;
static getPrice: (inputMint: Address | string, outputMint: Address | string, jupEndpoint?: string) => Promise<number>;
static getPrices: (inputMints: (Address | string)[], outputMint: Address | string, jupEndpoint?: string) => Promise<Map<Address, Decimal>>;
static getDollarPrices(inputMints: (Address | string)[], jupEndpoint?: string): Promise<Map<Address, Decimal>>;
static getDollarPrice: (inputMint: Address | string, jupEndpoint?: string) => Promise<number>;
}
export declare function transformResponseIx(ix: Instruction): IInstruction;
export declare function getAccountRole({ isSigner, isMut }: {
isSigner: boolean;
isMut: boolean;
}): AccountRole;
export {};
//# sourceMappingURL=JupService.d.ts.map