UNPKG

@frakt-protocol/frakt-sdk

Version:

Frakt SDK for interacting with frakt.xyz protocols

22 lines (21 loc) 1.43 kB
/// <reference types="node" /> import { Program, web3 } from '@project-serum/anchor'; import { AccountInfoData, AccountInfoParsed, GetInputAmount, GetOutputAmount, GetTokenAccount, ParseTokenAccount, UserNFT } from './types'; export declare const getInputAmount: ({ poolKeys, poolInfo, receiveToken, receiveAmount, payToken, slippage, }: GetInputAmount) => { amountIn: string; maxAmountIn: string; priceImpact: string; }; export declare const getOutputAmount: ({ poolKeys, poolInfo, payToken, payAmount, receiveToken, slippage, }: GetOutputAmount) => { amountOut: string; minAmountOut: string; priceImpact: string; }; export declare const decodeSplTokenAccountData: (tokenAccountDataEncoded: Buffer) => AccountInfoData; export declare const parseTokenAccount: ParseTokenAccount; export declare const getTokenAccount: ({ tokenMint, owner, connection, }: GetTokenAccount) => Promise<AccountInfoParsed | null>; export declare const getTokenAccountBalance: (lpTokenAccountInfo: AccountInfoParsed, lpDecimals: number) => number; export declare const shortenAddress: (address: string, chars?: number) => string; export declare const getNftCreators: (nft: UserNFT) => string[]; export declare const returnAnchorMultiRewardStaking: (programId: web3.PublicKey, connection: web3.Connection) => Promise<Program>; export declare const deriveMetadataPubkeyFromMint: (nftMint: web3.PublicKey) => Promise<web3.PublicKey>;