Types Reference
All types exported from@argyros/sdk.
Unions
SwapMode
type SwapMode = "ExactIn" | "ExactOut";
Chain
type Chain = "solana" | "fogo";
PriceImpactSeverity
type PriceImpactSeverity = "none" | "low" | "moderate" | "high" | "extreme";
Configuration
SDKConfig
interface SDKConfig {
apiKey: string;
chain?: Chain;
baseUrl?: string;
timeout?: number;
retries?: number;
}
Quote
QuoteRequest
interface QuoteRequest {
inputMint: string;
outputMint: string;
amount: string;
swapMode: SwapMode;
slippageBps?: number;
}
QuoteResponse
interface QuoteResponse {
inputMint: string;
outputMint: string;
amountIn: string;
amountOut: string;
priceImpactBps: number;
priceImpactPercent: string;
priceImpactSeverity: PriceImpactSeverity;
priceImpactWarning: string;
feeBps: number;
routes: RouteInfo[];
routePath: string[];
hopCount: number;
otherAmountThreshold: string;
}
RouteInfo
interface RouteInfo {
poolAddress: string;
poolType: string;
percent: number;
inputMint: string;
outputMint: string;
}
Swap
SwapRequest
interface SwapRequest {
userWallet: string;
inputMint: string;
outputMint: string;
amount: string;
swapMode: SwapMode;
slippageBps?: number;
skipSimulation?: boolean;
}
SwapResponse
interface SwapResponse {
transaction: string;
lastValidBlockHeight: number;
amountIn: string;
amountOut: string;
minAmountOut?: string;
maxAmountIn?: string;
feeAmount: string;
simulation?: SimulationResult;
computeUnitsEstimate?: number;
route: string[];
hopCount: number;
pools: string[];
isSplitRoute?: boolean;
splitPercents?: number[];
}
SimulationResult
interface SimulationResult {
success: boolean;
computeUnitsConsumed: number;
computeUnitsTotal: number;
logs: string[];
error: string;
slippageExceeded: boolean;
insufficientFunds: boolean;
accountsNeeded: string[];
}
Instructions
InstructionsRequest
interface InstructionsRequest {
userWallet: string;
inputMint: string;
outputMint: string;
amount: string;
swapMode: SwapMode;
slippageBps?: number;
}
InstructionsResponse
interface InstructionsResponse {
instructions: RawInstruction[];
addressLookupTableAddresses: string[];
amountIn: string;
amountOut: string;
otherAmountThreshold: string;
feeAmount: string;
hopCount: number;
route: string[];
pools: string[];
}
RawInstruction
interface RawInstruction {
programId: string;
accounts: RawAccountMeta[];
data: string;
}
RawAccountMeta
interface RawAccountMeta {
publicKey: string;
isSigner: boolean;
isWritable: boolean;
}
Errors
ArgyrosError
class ArgyrosError extends Error {
readonly statusCode: number;
readonly body?: unknown;
}
BadRequestError
class BadRequestError extends ArgyrosError {} // statusCode: 400
AuthError
class AuthError extends ArgyrosError {} // statusCode: 401
NoRouteError
class NoRouteError extends ArgyrosError {} // statusCode: 404
RateLimitError
class RateLimitError extends ArgyrosError {} // statusCode: 429
ServerError
class ServerError extends ArgyrosError {} // statusCode: 500