Swap
Handles the swap operation for a given account.
- The name of the account to perform the swap for.
- The authorization token for the request.
- The input body for the Jupiter swap operation, excluding the account name.
The mint address of the input token.
The mint address of the output token.
The amount of input tokens to be exchanged.
The maximum allowable slippage for the transaction, expressed as a percentage. Optional.
The fee in basis points (bps) to be applied to the transaction. Optional.
If true, the transaction will be simulated but not executed. Optional.
If true, the transaction will be broadcast to the network. Optional.
A promise that resolves to a JupiterAPIResponse containing the result of the swap operation.
Represents the structure of a response from the Jupiter API.
Indicates whether the API request was successful.
A message providing additional information about the API response.
POST /jupiter/{accountName}/swap 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
}A promise that resolves to a JupiterAPIResponse containing the result of the swap operation.
{
"success": true,
"message": "text",
"data": {
"transaction": null,
"function": "text",
"params": [],
"data": null,
"success": true,
"message": "text",
"jupiter": null,
"transactionHash": "text"
}
}