Quote Tx Data Patching v0 API
The response body of the Quote API, for both v0 and
v1, contains a res.body.quote.tx.data, which is basically a swap transaction
data.
This data contains many fields that are necessary to perform a swap.
However we have found some use cases where the user may want to modify some of the fields.
This API allows you to modify some whitelisted fields.
Endpoint
PATCH https://api.swapscanner.io/v0/quote/data
Example Request
PATCH https://api.swapscanner.io/v0/quote/data
Content-Type: application/json
{
"data": "0xTransactionDataFromQuoteAPI",
"minOutput": {
"amount": "123"
}
}
Request Body
| Field | Type | Description |
|---|---|---|
data | (required) hex string | Transaction data from Quote API |
minOutput | (optional) object | An object containing parameters for slippage assertion. |
minOutput.amount | (required) hex string or integer string | Guaranteed minimum output amount that you want to receive. |
Response Codes
200: OK400: Bad Requestinvalid_date: givendatais not valid.no_changes: given request does not contain any modification.
403: Forbiddeninvalid_signature: signature within the givendatais invalid.
404: Not Foundfield_not_exists: field that you are trying to modify does not exist.
Response Body
A modified transaction data.
0x00000000...