Swaps
Get Swap Quote
Get a price quote for swapping tokens within a wallet.
post/v1/wallets/{wallet_id}/swap/quote
Path parameters
wallet_idstring required
ID of the wallet.
Headers
privy-app-idstring required
ID of your Privy app.
privy-authorization-signaturestring
Request authorization signature. If multiple signatures are required, they should be comma separated.
privy-request-expirystring
Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the request must be processed.
Request body
Example request
{
"amount_type": "exact_input",
"base_amount": "1000000000000000000",
"destination": {
"asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
},
"source": {
"asset_address": "native",
"caip2": "eip155:1"
}
}Response
Swap quote retrieved successfully.
Example response
{
"caip2": "eip155:1",
"est_output_amount": "2000000000",
"gas_estimate": "150000",
"input_amount": "1000000000000000000",
"input_token": "native",
"minimum_output_amount": "1980000000",
"output_token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
}