UNPKG

@solutiofi/sdk

Version:

This SDK provides a convenient way to interact with the SolutioFi API.

68 lines (67 loc) 1.61 kB
import type { QuoteResponse } from "@jup-ag/api"; import { VersionedTransaction } from "@solana/web3.js"; export interface SolutioFiSdkOptions { apiKey: string; baseUrl?: string; } export interface PriceInfo { id: string; type: string; price: number; } export interface PriceResponse { prices: PriceInfo[]; error: string | null; } export interface TokenInfo { program: string; account: string; hasTransferFee: boolean; mint: string; name: string; symbol: string; amount: number; decimals: number; imageUrl: string; cost: number; } export interface TokenResponse { data: TokenInfo[]; error: string | null; } export interface SwapAssetData { mint: string; inputAmount: string; decimals: number; slippage: string; asLegacyTransaction: boolean; onlyDirectRoutes: boolean; } export interface ProcessAssetData { asset: SwapAssetData; quote: QuoteResponse; transaction: VersionedTransaction; lastValidBlockHeight: number; } export interface MergeResponse { transactions: ProcessAssetData[]; failed: SwapAssetData[]; error: string | null; } export interface SpreadResponse { transactions: ProcessAssetData[]; failed: SwapAssetData[]; error: string | null; } export interface InputAssetStruct { mint: string; inputAmount: string; slippage: string; onlyDirectRoutes: boolean; } export interface TargetTokenStruct { mint: string; percentage: number; } export type PriorityFee = "fast" | "turbo" | "ultra"; export type AssetType = "assets" | "accounts" | "nfts";