curl --request POST \
--url https://payments.magicblock.app/v1/swap/swap \
--header 'Content-Type: application/json' \
--data '
{
"userPublicKey": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
"quoteResponse": {
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "1000000",
"outputMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
"outAmount": "999519",
"otherAmountThreshold": "994522",
"swapMode": "ExactIn",
"slippageBps": 50,
"priceImpactPct": "0",
"routePlan": []
}
}
'{
"swapTransaction": "AQABA...base64...",
"lastValidBlockHeight": 318120000
}Private Payments API
Swap
POST
/
v1
/
swap
/
swap
curl --request POST \
--url https://payments.magicblock.app/v1/swap/swap \
--header 'Content-Type: application/json' \
--data '
{
"userPublicKey": "3rXKwQ1kpjBd5tdcco32qsvqUh1BnZjcYnS5kYrP7AYE",
"quoteResponse": {
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "1000000",
"outputMint": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
"outAmount": "999519",
"otherAmountThreshold": "994522",
"swapMode": "ExactIn",
"slippageBps": 50,
"priceImpactPct": "0",
"routePlan": []
}
}
'{
"swapTransaction": "AQABA...base64...",
"lastValidBlockHeight": 318120000
}ボディ
application/json
レスポンス
Swap transaction

