For the complete documentation index, see llms.txt. This page is also available as Markdown.

SwapInstructions

post

Retrieves swap instructions for a given account.

Authorizations
AuthorizationstringRequired
Path parameters
accountNamestringRequired
  • The name of the account for which to retrieve swap instructions.
Header parameters
AuthorizationstringRequired
  • The authorization token for the request.
Body
  • The body of the request, omitting the account name.
inputMintstringRequired

The mint address of the input token.

outputMintstringRequired

The mint address of the output token.

amountnumber · doubleRequired

The amount of input tokens to be exchanged.

slippagenumber · doubleOptional

The maximum allowable slippage for the transaction, expressed as a percentage. Optional.

feeBpsnumber · doubleOptional

The fee in basis points (bps) to be applied to the transaction. Optional.

dryrunbooleanOptional

If true, the transaction will be simulated but not executed. Optional.

broadcastbooleanOptional

If true, the transaction will be broadcast to the network. Optional.

Responses
200

A promise that resolves to a JupiterAPIResponse containing the result of the swap instructions execution.

application/json

Represents the structure of a response from the Jupiter API.

successbooleanRequired

Indicates whether the API request was successful.

messagestringRequired

A message providing additional information about the API response.

post/jupiter/{accountName}/swapInstructions
POST /jupiter/{accountName}/swapInstructions HTTP/1.1
Host: beta.usemoon.ai/
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 106

{
  "inputMint": "text",
  "outputMint": "text",
  "amount": 1,
  "slippage": 1,
  "feeBps": 1,
  "dryrun": true,
  "broadcast": true
}
200

A promise that resolves to a JupiterAPIResponse containing the result of the swap instructions execution.

{
  "success": true,
  "message": "text",
  "data": {
    "transaction": null,
    "function": "text",
    "params": [],
    "data": null,
    "success": true,
    "message": "text",
    "jupiter": null,
    "transactionHash": "text"
  }
}