Get token approval data
curl --request POST \
--url https://api-partner.houdiniswap.com/v2/dex/approve \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"usePermit": false
}
'import requests
url = "https://api-partner.houdiniswap.com/v2/dex/approve"
payload = {
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"usePermit": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteId: '69a02882f48d56c923119d95',
addressFrom: '0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40',
usePermit: false
})
};
fetch('https://api-partner.houdiniswap.com/v2/dex/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-partner.houdiniswap.com/v2/dex/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => '69a02882f48d56c923119d95',
'addressFrom' => '0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40',
'usePermit' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-partner.houdiniswap.com/v2/dex/approve"
payload := strings.NewReader("{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-partner.houdiniswap.com/v2/dex/approve")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-partner.houdiniswap.com/v2/dex/approve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}"
response = http.request(request)
puts response.read_body{
"approvals": [
{
"data": "<string>",
"to": "<string>",
"from": "<string>",
"fromChain": {
"icon": "<string>",
"addressValidation": "<string>",
"tokenAddressValidation": "<string>",
"id": "<string>",
"created": "2023-11-07T05:31:56Z",
"name": "<string>",
"shortName": "<string>",
"explorerUrl": "<string>",
"addressUrl": "<string>",
"kind": "<string>",
"enabled": true,
"shortNameV1": "<string>",
"modified": "2023-11-07T05:31:56Z",
"memoNeeded": true,
"hashUrl": "<string>",
"priority": 123,
"chainId": 123
}
}
],
"signatures": [
{
"data": {
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>",
"salt": "<string>"
},
"types": {},
"primaryType": "<string>",
"message": {}
},
"totalSteps": 123,
"step": 123,
"isComplete": true,
"key": "<string>",
"swapRequiredMetadata": {}
}
]
}{
"message": "<string>",
"code": "<string>",
"fields": {},
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}DEX
Get token approval data
Get approval transaction data for a DEX swap
Returns a list of required token approval transactions for the specified route. This endpoint should be polled until an empty approvals list is returned, indicating that all necessary approvals have been granted.
Returns either approval transactions or permit signatures depending on token and swap provider support. If the token supports EIP-2612 permits and the swap provider is configured for it, signatures will be returned
POST
/
dex
/
approve
Get token approval data
curl --request POST \
--url https://api-partner.houdiniswap.com/v2/dex/approve \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"usePermit": false
}
'import requests
url = "https://api-partner.houdiniswap.com/v2/dex/approve"
payload = {
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"usePermit": False
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteId: '69a02882f48d56c923119d95',
addressFrom: '0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40',
usePermit: false
})
};
fetch('https://api-partner.houdiniswap.com/v2/dex/approve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-partner.houdiniswap.com/v2/dex/approve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => '69a02882f48d56c923119d95',
'addressFrom' => '0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40',
'usePermit' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-partner.houdiniswap.com/v2/dex/approve"
payload := strings.NewReader("{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-partner.houdiniswap.com/v2/dex/approve")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-partner.houdiniswap.com/v2/dex/approve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"69a02882f48d56c923119d95\",\n \"addressFrom\": \"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40\",\n \"usePermit\": false\n}"
response = http.request(request)
puts response.read_body{
"approvals": [
{
"data": "<string>",
"to": "<string>",
"from": "<string>",
"fromChain": {
"icon": "<string>",
"addressValidation": "<string>",
"tokenAddressValidation": "<string>",
"id": "<string>",
"created": "2023-11-07T05:31:56Z",
"name": "<string>",
"shortName": "<string>",
"explorerUrl": "<string>",
"addressUrl": "<string>",
"kind": "<string>",
"enabled": true,
"shortNameV1": "<string>",
"modified": "2023-11-07T05:31:56Z",
"memoNeeded": true,
"hashUrl": "<string>",
"priority": 123,
"chainId": 123
}
}
],
"signatures": [
{
"data": {
"domain": {
"name": "<string>",
"version": "<string>",
"chainId": 123,
"verifyingContract": "<string>",
"salt": "<string>"
},
"types": {},
"primaryType": "<string>",
"message": {}
},
"totalSteps": 123,
"step": 123,
"isComplete": true,
"key": "<string>",
"swapRequiredMetadata": {}
}
]
}{
"message": "<string>",
"code": "<string>",
"fields": {},
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}Authorizations
Body
application/json
Quote ID from a prior quote response.
Example:
"69a02882f48d56c923119d95"
Address from which the amount will be deducted (EVM or Tron)
Pattern:
^(0x[0-9a-fA-F]{40}|T[1-9A-HJ-NP-Za-km-z]{33})$Example:
"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40"
Whether to use permit instead of approve. Defaults to true for swaps that support it.
Example:
false
⌘I