Class JupiterClient

Hierarchy

  • JupiterClient

Constructors

  • Parameters

    • __namedParameters: {
          connection: Connection;
          url?: string;
      }
      • connection: Connection
      • Optional url?: string

    Returns JupiterClient

Properties

connection: Connection
lookupTableCahce: Map<string, AddressLookupTableAccount> = ...
url: string

Methods

  • Get the jupiter instructions from transaction by filtering out instructions to compute budget and associated token programs

    Parameters

    • __namedParameters: {
          inputMint: PublicKey;
          outputMint: PublicKey;
          transactionMessage: TransactionMessage;
      }

    Returns TransactionInstruction[]

  • Get routes for a swap

    Parameters

    • __namedParameters: {
          amount: BN;
          excludeDexes?: string[];
          inputMint: PublicKey;
          maxAccounts?: number;
          onlyDirectRoutes?: boolean;
          outputMint: PublicKey;
          slippageBps?: number;
          swapMode?: SwapMode;
      }
      • amount: BN
      • Optional excludeDexes?: string[]
      • inputMint: PublicKey
      • Optional maxAccounts?: number
      • Optional onlyDirectRoutes?: boolean
      • outputMint: PublicKey
      • Optional slippageBps?: number
      • Optional swapMode?: SwapMode

    Returns Promise<QuoteResponse>

  • **

    Deprecated

    • use getQuote Get routes for a swap

    Parameters

    • __namedParameters: {
          amount: BN;
          inputMint: PublicKey;
          onlyDirectRoutes?: boolean;
          outputMint: PublicKey;
          slippageBps?: number;
          swapMode?: SwapMode;
      }
      • amount: BN
      • inputMint: PublicKey
      • Optional onlyDirectRoutes?: boolean
      • outputMint: PublicKey
      • Optional slippageBps?: number
      • Optional swapMode?: SwapMode

    Returns Promise<Route[]>

  • **

    Deprecated

    • use getSwap Get a swap transaction for a route

    Parameters

    • __namedParameters: {
          route: Route;
          slippageBps?: number;
          userPublicKey: PublicKey;
      }

    Returns Promise<VersionedTransaction>

  • Get the transaction message and lookup tables for a transaction

    Parameters

    • transaction: {
          transaction: VersionedTransaction;
      }
      • transaction: VersionedTransaction

    Returns Promise<{
        lookupTables: AddressLookupTableAccount[];
        transactionMessage: TransactionMessage;
    }>

Generated using TypeDoc