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",
"addressTo": "8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC",
"usePermit": false
}
'import requests
url = "https://api-partner.houdiniswap.com/v2/dex/approve"
payload = {
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"addressTo": "8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC",
"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',
addressTo: '8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC',
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',
'addressTo' => '8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC',
'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 \"addressTo\": \"8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC\",\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 \"addressTo\": \"8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC\",\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 \"addressTo\": \"8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC\",\n \"usePermit\": false\n}"
response = http.request(request)
puts response.read_body{
"approvals": [
{
"from": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"data": "0x095ea7b30000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000000000000000000000000000000000003b9aca00",
"fromChain": {
"id": "6689b73ec90e45f3b3e5150a",
"name": "Ethereum",
"shortName": "ethereum",
"shortNameV1": "ETH",
"kind": "evm",
"chainId": 1,
"enabled": true,
"icon": "https://api.houdiniswap.com/assets/networks/ETH.png",
"created": "2024-07-06T10:21:18.000Z",
"explorerUrl": "https://etherscan.io/tx/{txHash}",
"addressUrl": "https://etherscan.io/address/{address}",
"addressValidation": "^0x[a-fA-F0-9]{40}$",
"tokenAddressValidation": "^0x[a-fA-F0-9]{40}$"
}
}
],
"signatures": []
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}{}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"fields": {},
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}Get token approval data
Returns what the wallet must approve before a DEX swap. Call this first — both arrays come back empty when the allowance already covers the swap.
approvals— transactions to send. After sending them, poll Check token allowance until it returns true.signatures— EIP-712 permits to sign instead, when the token and provider both support EIP-2612
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",
"addressTo": "8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC",
"usePermit": false
}
'import requests
url = "https://api-partner.houdiniswap.com/v2/dex/approve"
payload = {
"quoteId": "69a02882f48d56c923119d95",
"addressFrom": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"addressTo": "8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC",
"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',
addressTo: '8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC',
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',
'addressTo' => '8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC',
'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 \"addressTo\": \"8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC\",\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 \"addressTo\": \"8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC\",\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 \"addressTo\": \"8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC\",\n \"usePermit\": false\n}"
response = http.request(request)
puts response.read_body{
"approvals": [
{
"from": "0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40",
"to": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"data": "0x095ea7b30000000000000000000000001111111254eeb25477b68fb85ed929f73a960582000000000000000000000000000000000000000000000000000000003b9aca00",
"fromChain": {
"id": "6689b73ec90e45f3b3e5150a",
"name": "Ethereum",
"shortName": "ethereum",
"shortNameV1": "ETH",
"kind": "evm",
"chainId": 1,
"enabled": true,
"icon": "https://api.houdiniswap.com/assets/networks/ETH.png",
"created": "2024-07-06T10:21:18.000Z",
"explorerUrl": "https://etherscan.io/tx/{txHash}",
"addressUrl": "https://etherscan.io/address/{address}",
"addressValidation": "^0x[a-fA-F0-9]{40}$",
"tokenAddressValidation": "^0x[a-fA-F0-9]{40}$"
}
}
],
"signatures": []
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}{}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"fields": {},
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}{
"message": "<string>",
"code": "<string>",
"requestId": "<string>"
}Authorizations
Send Authorization: <ApiKey>:<ApiSecret> — joined by a colon, raw. No Bearer prefix, no base64.
Body
Quote ID from a prior quote response.
"69a02882f48d56c923119d95"
Address from which the amount will be deducted (EVM or Tron)
^(0x[0-9a-fA-F]{40}|T[1-9A-HJ-NP-Za-km-z]{33})$"0xb7dE6b6eEBF7401aFea5a49D6405C9048fEf2d40"
Destination address on the output chain. Only required by routes whose approval step signs the destination, currently HyperCore withdrawals. Format follows the output chain, so it is not restricted to EVM.
"8jZnXYnZB1MJQG6zBXyouzcycsaPTrZtPXPHDNifjYaC"
Whether to use permit instead of approve. Defaults to true for swaps that support it.
false
Response
What the wallet must approve; both arrays empty if nothing is needed
Transactions the wallet must send before the swap. Empty when the allowance already covers it.
Show child attributes
Show child attributes
Messages to sign instead of sending an approval transaction, when the token and provider both support it. Pass the signed results to signatures on Create exchange.
Show child attributes
Show child attributes