pub struct SwapInput {
pub amount: String,
pub dex: SwapInputDex,
pub input_mint: Option<String>,
pub output_mint: Option<String>,
pub pool_address: Option<String>,
pub priority_fee: Option<String>,
pub slippage: i64,
pub swap_mode: SwapInputSwapMode,
pub user_address: SwapInputUserAddress,
}Expand description
SwapInput
JSON schema
{
"type": "object",
"required": [
"amount",
"dex",
"slippage",
"swapMode",
"userAddress"
],
"properties": {
"amount": {
"description": "Amount to swap. Use \"auto\" for full balance or percentage like \"50%\"",
"examples": [
"1000000000"
],
"type": "string"
},
"dex": {
"description": "DEX identifier for the trade",
"examples": [
"jupiter"
],
"type": "string",
"enum": [
"jupiter",
"kyberswap",
"raydium",
"pumpfun",
"moonshot",
"candy",
"launchpad"
]
},
"inputMint": {
"description": "Input token mint address",
"type": "string"
},
"outputMint": {
"description": "Output token mint address",
"type": "string"
},
"poolAddress": {
"description": "DEX pool address",
"examples": [
"58oQChx4yWmvKdwLLZzBi4ChoCc2fqCUWBkwMihLYQo2"
],
"type": "string"
},
"priorityFee": {
"description": "Priority fee in SOL to increase transaction processing speed",
"examples": [
"1000"
],
"type": "string"
},
"slippage": {
"description": "Slippage tolerance percentage",
"default": 10,
"examples": [
10
],
"type": "integer",
"format": "int64",
"maximum": 100.0,
"minimum": 0.0
},
"swapMode": {
"description": "Swap direction mode",
"examples": [
"ExactIn"
],
"type": "string",
"enum": [
"ExactIn",
"ExactOut"
]
},
"userAddress": {
"description": "Public key of the wallet initiating the transaction",
"examples": [
"oQPnhXAbLbMuKHESaGrbXT17CyvWCpLyERSJA9HCYd7"
],
"type": "string",
"maxLength": 64,
"minLength": 8
}
}
}Fields§
§amount: StringAmount to swap. Use “auto” for full balance or percentage like “50%”
dex: SwapInputDexDEX identifier for the trade
input_mint: Option<String>Input token mint address
output_mint: Option<String>Output token mint address
pool_address: Option<String>DEX pool address
priority_fee: Option<String>Priority fee in SOL to increase transaction processing speed
slippage: i64Slippage tolerance percentage
swap_mode: SwapInputSwapModeSwap direction mode
user_address: SwapInputUserAddressPublic key of the wallet initiating the transaction
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SwapInput
impl<'de> Deserialize<'de> for SwapInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SwapInput
impl RefUnwindSafe for SwapInput
impl Send for SwapInput
impl Sync for SwapInput
impl Unpin for SwapInput
impl UnsafeUnpin for SwapInput
impl UnwindSafe for SwapInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more