Mirra
IntegrationsCrypto

Jupiter

SDK reference for jupiter operations

Overview

Jupiter DEX integration for Solana token swaps and portfolio management

  • Category: crypto
  • Auth Required: No
  • Supported Modes: standard, delegated

Operations

swap

Execute a token swap on Jupiter DEX. Returns normalized FLAT structure with transaction, signerWallet, inputMint, outputMint, inputAmount, expectedOutputAmount, priceImpact, slippageBps. No nested objects.

Arguments:

  • inputMint (string, required): Input token mint address
  • outputMint (string, required): Output token mint address
  • amount (number, required): Amount to swap (in smallest unit)
  • inputDecimals (number, required): Number of decimals for input token
  • slippageBps (number, optional): Slippage tolerance in basis points (default: 50)

Returns:

AdapterOperationResult - Returns { type, transaction, requestId, signerWallet, expiresAt, inputMint, outputMint, inputAmount, inputDecimals, expectedOutputAmount, priceImpact, slippageBps, hasRoutePlan, routeStepCount }. FLAT structure.

Response Fields:

FieldTypeDescription
type'pending_transaction'Response type
transactionstringBase64 encoded serialized transaction
requestIdstringJupiter request ID (for execute endpoint)
signerWalletstringWallet address that needs to sign
expiresAtstringExpiration timestamp (ISO 8601)
inputMintstringInput token mint address
outputMintstringOutput token mint address
inputAmountstringInput amount as string
inputDecimalsnumberInput token decimals
expectedOutputAmountstringExpected output amount
priceImpactstringPrice impact percentage
slippageBpsnumberSlippage tolerance in basis points
hasRoutePlanbooleanWhether swap has a route plan
routeStepCountnumberNumber of steps in route

Example:

const result = await mirra.jupiter.swap({
  inputMint: "example",
  outputMint: "example",
  amount: 10,
  inputDecimals: 10
});

getHoldings

Get token holdings for a wallet. Returns normalized FLAT structure with owner, solBalance, totalValueUsd, tokenCount, and tokens array.

Arguments:

  • walletAddress (string, optional): Wallet address to check (uses actor wallet if not provided)

Returns:

AdapterOperationResult - Returns { owner, solBalance, totalValueUsd, tokenCount, tokens[] }. Each token has FLAT fields: mint, symbol, name, decimals, balance, uiBalance, logoURI, priceUsd, valueUsd, accountCount. No nested objects.

Response Fields:

FieldTypeDescription
ownerstringWallet owner address
solBalancenumberNative SOL balance
totalValueUsdnumberTotal portfolio value in USD
tokenCountnumberNumber of tokens held
tokensJupiterTokenBalance[]List of token balances
tokens item fields (JupiterTokenBalance)
FieldTypeDescription
mintstringToken mint address
symbolstringToken symbol
namestringToken name
decimalsnumberToken decimals
balancestringRaw balance string
uiBalancenumberHuman-readable balance
logoURIstringToken logo URL (empty if not available)
priceUsdnumberToken price in USD (0 if not available)
valueUsdnumberTotal value in USD (0 if not available)
accountCountnumberNumber of token accounts for this mint

Example:

const result = await mirra.jupiter.getHoldings({});

getTokenSecurity

Get token security information using Jupiter Shield. Returns normalized FLAT structure with riskLevel, warningCount, and security flags.

Arguments:

  • tokenMint (string, required): Token mint address to check security for

Returns:

AdapterOperationResult - Returns { mint, riskLevel, warningCount, hasCriticalWarning, hasFreezableWarning, hasMintableWarning, warnings[] }. Each warning has FLAT fields: type, message, severity, source. No nested objects.

Response Fields:

FieldTypeDescription
mintstringToken mint address
riskLevel``'safe''low'
warningCountnumberNumber of warnings
hasCriticalWarningbooleanWhether there are critical warnings
hasFreezableWarningbooleanWhether token can be frozen
hasMintableWarningbooleanWhether token can be minted
warningsJupiterSecurityWarning[]List of security warnings
warnings item fields (JupiterSecurityWarning)
FieldTypeDescription
typestringWarning type
messagestringWarning message
severity``'info''warning'
sourcestringWarning source (empty if not available)

Example:

const result = await mirra.jupiter.getTokenSecurity({
  tokenMint: "example"
});

searchTokens

Search for tokens by symbol, name, or mint address. Returns normalized FLAT token results with all fields flattened.

Arguments:

  • query (string, required): Search query (symbol, name, or mint address)

Returns:

AdapterOperationResult - Returns { query, count, results[] }. Each result has FLAT fields: mint, symbol, name, decimals, iconUrl, twitter, telegram, website, holderCount, circSupply, totalSupply, mintAuthorityDisabled, freezeAuthorityDisabled, organicScore, isVerified, fdv, marketCap, priceUsd, liquidity, dailyPriceChange, tags[]. No nested audit or stats objects.

Response Fields:

FieldTypeDescription
querystringSearch query used
countnumberNumber of results
resultsJupiterTokenSearchResult[]List of matching tokens
results item fields (JupiterTokenSearchResult)
FieldTypeDescription
mintstringToken mint address
symbolstringToken symbol
namestringToken name
decimalsnumberToken decimals
iconUrlstringToken icon URL (empty if not available)
twitterstringTwitter handle (empty if not available)
telegramstringTelegram link (empty if not available)
websitestringWebsite URL (empty if not available)
holderCountnumberNumber of token holders
circSupplynumberCirculating supply
totalSupplynumberTotal supply
tokenProgramstringToken program ID
launchpadstringLaunchpad name (empty if not available)
mintAuthorityDisabledbooleanWhether mint authority is disabled
freezeAuthorityDisabledbooleanWhether freeze authority is disabled
topHoldersPercentagenumberPercentage held by top holders
devBalancePercentagenumberPercentage held by dev
isSuspiciousbooleanWhether token is flagged as suspicious
highSingleOwnershipbooleanWhether there is high single ownership
organicScorenumberOrganic activity score
organicScoreLabelstringOrganic score label
isVerifiedbooleanWhether token is verified
fdvnumberFully diluted valuation (0 if not available)
marketCapnumberMarket cap (0 if not available)
priceUsdnumberPrice in USD (0 if not available)
liquiditynumberLiquidity (0 if not available)
dailyPriceChangenumber24h price change (0 if not available)
dailyHolderChangenumber24h holder change (0 if not available)
dailyLiquidityChangenumber24h liquidity change (0 if not available)
dailyVolumeChangenumber24h volume change (0 if not available)
dailyBuyVolumenumber24h buy volume (0 if not available)
dailySellVolumenumber24h sell volume (0 if not available)
tagsstring[]Token tags

Example:

const result = await mirra.jupiter.searchTokens({
  query: "example"
});

refreshSwap

Refresh an expired swap with new quote and transaction. Returns normalized FLAT structure.

Arguments:

  • feedItemId (string, required): Feed item ID containing the swap to refresh
  • swapId (string, required): Original swap ID
  • inputMint (string, required): Input token mint address
  • outputMint (string, required): Output token mint address
  • amount (number, required): Amount to swap (in UI units)
  • inputDecimals (number, required): Input token decimals
  • slippageBps (number, optional): Slippage tolerance in basis points

Returns:

AdapterOperationResult - Returns { type, transaction, requestId, signerWallet, expiresAt, refreshedAt, inputMint, outputMint, inputAmount, inputDecimals, expectedOutputAmount, priceImpact, slippageBps, hasRoutePlan, routeStepCount }. FLAT structure.

Response Fields:

FieldTypeDescription
type'pending_transaction'Response type
transactionstringBase64 encoded serialized transaction
requestIdstringJupiter request ID (for execute endpoint)
signerWalletstringWallet address that needs to sign
expiresAtstringExpiration timestamp (ISO 8601)
refreshedAtstringRefresh timestamp (ISO 8601)
inputMintstringInput token mint address
outputMintstringOutput token mint address
inputAmountstringInput amount as string
inputDecimalsnumberInput token decimals
expectedOutputAmountstringExpected output amount
priceImpactstringPrice impact percentage
slippageBpsnumberSlippage tolerance in basis points
hasRoutePlanbooleanWhether swap has a route plan
routeStepCountnumberNumber of steps in route

Example:

const result = await mirra.jupiter.refreshSwap({
  feedItemId: "abc123",
  swapId: "abc123",
  inputMint: "example",
  outputMint: "example",
  amount: 10,
  inputDecimals: 10
});

launchToken

Launch a new token on Solana via Jupiter Studio. Creates a DBC (Dynamic Bonding Curve) pool. The user must have uploaded a token image in this conversation — pass the image URL provided in the chat. Returns a pending_transaction for the user to sign. FLAT structure.

Arguments:

  • tokenName (string, required): Name of the token
  • tokenSymbol (string, required): Token ticker symbol
  • tokenDescription (string, optional): Description for the token metadata
  • tokenImageUrl (string, required): URL of the uploaded token image (from user message)
  • quoteMint (string, optional): Quote token mint address. Defaults to USDC (EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v). Can also use SOL or JUP mint.
  • initialMarketCap (number, optional): Initial market cap in quote token units (default: 16000 for meme preset)
  • migrationMarketCap (number, optional): Market cap threshold for graduation/migration (default: 69000 for meme preset)
  • antiSniping (boolean, optional): Enable anti-sniping protection (default: false)
  • feeBps (number, optional): Creator trading fee in basis points: 100 (1%) or 200 (2%). Default: 100
  • isLpLocked (boolean, optional): Lock LP tokens (default: true)
  • website (string, optional): Project website URL for token metadata
  • twitter (string, optional): Twitter/X URL for token metadata
  • telegram (string, optional): Telegram URL for token metadata

Returns:

AdapterOperationResult - Returns { type, transaction, mint, signerWallet, expiresAt, tokenName, tokenSymbol, imageUrl }. FLAT structure.

Response Fields:

FieldTypeDescription
type'pending_transaction'Response type
transactionstringBase64 encoded unsigned transaction
mintstringNew token mint address
signerWalletstringWallet that needs to sign
expiresAtstringExpiration timestamp (ISO 8601)
tokenNamestringToken name
tokenSymbolstringToken symbol
imageUrlstringOnchain image URL (from Jupiter)

Example:

const result = await mirra.jupiter.launchToken({
  tokenName: "example",
  tokenSymbol: "example",
  tokenImageUrl: "example"
});

On this page