Fetch the simulated price for a swap on JupiterSwap.

Input: None

Returns: The swap price on Jupiter for a given input and output token mint address.

Example: Fetch the JupiterSwap price for exchanging 1 SOL into USDC.

{ "jupiterSwapTask": { "inTokenAddress": "So11111111111111111111111111111111111111112", "outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } }

Example: Fetch the JupiterSwap price for exchanging 1000 SOL into USDC.

{ "jupiterSwapTask": { "inTokenAddress": "So11111111111111111111111111111111111111112", "outTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "baseAmount": "1000" } }

Implements

Constructors

Properties

RoutesFilters?: "allowList" | "denyList"

JupiterSwapTask RoutesFilters.

SwapAmount?: "baseAmount" | "quoteAmount" | "baseAmountString" | "quoteAmountString"

JupiterSwapTask SwapAmount.

allowList?: IFilterList

A list of AMM markets to allow.

baseAmount?: number

The amount of in_token_address tokens to swap.

baseAmountString?: string

The amount of in_token_address tokens to swap.

denyList?: IFilterList

A list of AMM markets to deny.

inTokenAddress: string

The input token address.

outTokenAddress: string

The output token address.

quoteAmount?: number

The amount of out_token_address tokens to swap.

quoteAmountString?: string

The amount of out_token_address tokens to swap.

slippage: number

The allowable slippage on the swap in decimal form (e.g. 0.5 is 0.5% slippage)

Methods

  • Converts this JupiterSwapTask to JSON.

    Returns {
        [k: string]: any;
    }

    JSON object

    • [k: string]: any
  • Creates a new JupiterSwapTask instance using the specified properties.

    Parameters

    Returns JupiterSwapTask

    JupiterSwapTask instance

  • Decodes a JupiterSwapTask message from the specified reader or buffer.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    • Optional length: number

      Message length if known beforehand

    Returns JupiterSwapTask

    JupiterSwapTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Decodes a JupiterSwapTask message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns JupiterSwapTask

    JupiterSwapTask

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Encodes the specified JupiterSwapTask message. Does not implicitly verify messages.

    Parameters

    • message: IJupiterSwapTask

      JupiterSwapTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Encodes the specified JupiterSwapTask message, length delimited. Does not implicitly verify messages.

    Parameters

    • message: IJupiterSwapTask

      JupiterSwapTask message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Creates a JupiterSwapTask message from a plain object. Also converts values to their respective internal types.

    Parameters

    • object: {
          [k: string]: any;
      }

      Plain object

      • [k: string]: any

    Returns JupiterSwapTask

    JupiterSwapTask

  • Gets the default type url for JupiterSwapTask

    Parameters

    • Optional typeUrlPrefix: string

      your custom typeUrlPrefix(default "type.googleapis.com")

    Returns string

    The default type url

  • Creates a plain object from a JupiterSwapTask message. Also converts values to other types if specified.

    Parameters

    • message: JupiterSwapTask

      JupiterSwapTask

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

    • [k: string]: any
  • Verifies a JupiterSwapTask message.

    Parameters

    • message: {
          [k: string]: any;
      }

      Plain object to verify

      • [k: string]: any

    Returns string

    null if valid, otherwise the reason why it is not