Swap Tokens
Execute a token swap within a wallet.
Path parameters
ID of the wallet.
Headers
ID of your Privy app.
Request authorization signature. If multiple signatures are required, they should be comma separated.
Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the request must be processed.
Idempotency keys ensure API requests are executed only once within a 24-hour window.
Request body
Example request
{
"amount_type": "exact_input",
"base_amount": "1000000000000000000",
"destination": {
"asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"caip2": "eip155:1"
},
"slippage_bps": 50,
"source": {
"asset_address": "native",
"caip2": "eip155:1"
}
}Response
Swap initiated successfully.
Example response
{
"estimated_fees": [
{
"amount": "0.20",
"recipient": "0x1234567890abcdef1234567890abcdef12345678",
"type": "relayer"
}
],
"estimated_gas": {
"amount": "0.0001",
"base_amount": "100000000000000",
"gas_asset": "ETH"
},
"fees": [
{
"amount": "0.20",
"recipient": "0x1234567890abcdef1234567890abcdef12345678",
"type": "relayer"
}
],
"gas": {
"amount": "0.0001",
"base_amount": "100000000000000",
"gas_asset": "ETH"
}
}Changes
Changed in 9 of the 46 revisions of this API.10226
- ▲
the
///response's property type changed fromstringto no type for statusresponse-property-type-changed
- ○
added the new optional
headerrequest parameterprivy-request-expirynew-optional-request-parameter
- ○
added
subschema #2to the///response propertyallOflist for the response statusresponse-property-all-of-added
- ○
removed the
0.6enum value from the///response property for the response statusresponse-property-enum-value-removed
- ○
removed the
0.7enum value from the///response property for the response statusresponse-property-enum-value-removed
- ○
removed the
0.8enum value from the///response property for the response statusresponse-property-enum-value-removed
- ○
removed the
0.9enum value from the///response property for the response statusresponse-property-enum-value-removed
- ▲
- ▲
added to the
/response propertyoneOflist for the response statusresponse-property-one-of-added
- ○
added
tvm_transactiondiscriminator mapping keys to the/response property for the response statusresponse-property-discriminator-mapping-added
- ▲
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
- ▲
added to the
/response propertyoneOflist for the response statusresponse-property-one-of-added
- ○
added the optional property
///to the response with the statusresponse-optional-property-added
- ○
added the optional property
///to the response with the statusresponse-optional-property-added
- ○
added the optional property
///to the response with the statusresponse-optional-property-added
- ○
added
custodian_transactiondiscriminator mapping keys to the/response property for the response statusresponse-property-discriminator-mapping-added
- ○
removed the
finalizedenum value from the////response property for the response statusresponse-property-enum-value-removed
- ▲
- ○
added the optional property
///to the response with the statusresponse-optional-property-added
- ○
added the optional property
///to the response with the statusresponse-optional-property-added
- ○
removed
subschema #2from theresponse propertyallOflist for the response statusresponse-property-all-of-removed
- ○
removed
subschema #2from theresponse propertyallOflist for the response statusresponse-property-all-of-removed
- ○
added
subschema #2to theresponse propertyanyOflist for the response statusresponse-property-any-of-added
- ○
added
subschema #2to theresponse propertyanyOflist for the response statusresponse-property-any-of-added
- ○
- ▲
the response property
became nullable for the statusresponse-property-became-nullable
- ▲
the response property
/became nullable for the statusresponse-property-became-nullable
- ▲
the response property
became nullable for the statusresponse-property-became-nullable
- ▲
the response property
/became nullable for the statusresponse-property-became-nullable
- ▲
the
/response's property type changed from no type toobjectnullfor statusresponse-property-type-changed
- ▲
the
/response's property type changed from no type toobjectnullfor statusresponse-property-type-changed
- ▲
- ▲
the
request property type changed fromnumbertointegerrequest-property-type-changed
- ●
the
request property's max was set to10000.00request-property-max-set
- ●
the
request property's min was set to0.00request-property-min-set
- ▲
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
added the optional property
to the response with the statusresponse-optional-property-added
- ○
- ○
added the new optional request property
/new-optional-request-property
- ○
added the new optional request property
new-optional-request-property
- ○
added the optional property
to the response with the statusresponse-optional-property-added
This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○