curl --request POST \
--url https://api.velora.xyz/transactions/{chainId} \
--header 'Content-Type: application/json' \
--data '
{
"priceRoute": {
"blockNumber": 123,
"network": 1,
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"srcAmount": "1000000000000000000",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destDecimals": 123,
"destAmount": "1000000000000000000",
"bestRoute": [
{}
],
"gasCostUSD": "<string>",
"gasCost": "<string>",
"version": "<string>",
"contractAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenTransferProxy": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"contractMethod": "<string>",
"partnerFee": 123,
"srcUSD": "<string>",
"destUSD": "<string>",
"partner": "<string>",
"maxImpactReached": true,
"hmac": "<string>"
},
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"userAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"destDecimals": 123,
"srcAmount": "1000000000000000000",
"destAmount": "1000000000000000000",
"slippage": 5000,
"txOrigin": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"receiver": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partner": "my-app-name",
"partnerAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partnerFeeBps": "<string>",
"permit": "<string>",
"deadline": 123,
"isCapSurplus": true,
"takeSurplus": false,
"isSurplusToUser": false,
"isDirectFeeTransfer": false
}
'import requests
url = "https://api.velora.xyz/transactions/{chainId}"
payload = {
"priceRoute": {
"blockNumber": 123,
"network": 1,
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"srcAmount": "1000000000000000000",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destDecimals": 123,
"destAmount": "1000000000000000000",
"bestRoute": [{}],
"gasCostUSD": "<string>",
"gasCost": "<string>",
"version": "<string>",
"contractAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenTransferProxy": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"contractMethod": "<string>",
"partnerFee": 123,
"srcUSD": "<string>",
"destUSD": "<string>",
"partner": "<string>",
"maxImpactReached": True,
"hmac": "<string>"
},
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"userAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"destDecimals": 123,
"srcAmount": "1000000000000000000",
"destAmount": "1000000000000000000",
"slippage": 5000,
"txOrigin": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"receiver": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partner": "my-app-name",
"partnerAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partnerFeeBps": "<string>",
"permit": "<string>",
"deadline": 123,
"isCapSurplus": True,
"takeSurplus": False,
"isSurplusToUser": False,
"isDirectFeeTransfer": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
priceRoute: {
blockNumber: 123,
network: 1,
srcToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
srcDecimals: 123,
srcAmount: '1000000000000000000',
destToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
destDecimals: 123,
destAmount: '1000000000000000000',
bestRoute: [{}],
gasCostUSD: '<string>',
gasCost: '<string>',
version: '<string>',
contractAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
tokenTransferProxy: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
contractMethod: '<string>',
partnerFee: 123,
srcUSD: '<string>',
destUSD: '<string>',
partner: '<string>',
maxImpactReached: true,
hmac: '<string>'
},
srcToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
destToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
userAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
srcDecimals: 123,
destDecimals: 123,
srcAmount: '1000000000000000000',
destAmount: '1000000000000000000',
slippage: 5000,
txOrigin: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
receiver: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
partner: 'my-app-name',
partnerAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
partnerFeeBps: '<string>',
permit: '<string>',
deadline: 123,
isCapSurplus: true,
takeSurplus: false,
isSurplusToUser: false,
isDirectFeeTransfer: false
})
};
fetch('https://api.velora.xyz/transactions/{chainId}', 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.velora.xyz/transactions/{chainId}",
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([
'priceRoute' => [
'blockNumber' => 123,
'network' => 1,
'srcToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'srcDecimals' => 123,
'srcAmount' => '1000000000000000000',
'destToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'destDecimals' => 123,
'destAmount' => '1000000000000000000',
'bestRoute' => [
[
]
],
'gasCostUSD' => '<string>',
'gasCost' => '<string>',
'version' => '<string>',
'contractAddress' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'tokenTransferProxy' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'contractMethod' => '<string>',
'partnerFee' => 123,
'srcUSD' => '<string>',
'destUSD' => '<string>',
'partner' => '<string>',
'maxImpactReached' => true,
'hmac' => '<string>'
],
'srcToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'destToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'userAddress' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'srcDecimals' => 123,
'destDecimals' => 123,
'srcAmount' => '1000000000000000000',
'destAmount' => '1000000000000000000',
'slippage' => 5000,
'txOrigin' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'receiver' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'partner' => 'my-app-name',
'partnerAddress' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'partnerFeeBps' => '<string>',
'permit' => '<string>',
'deadline' => 123,
'isCapSurplus' => true,
'takeSurplus' => false,
'isSurplusToUser' => false,
'isDirectFeeTransfer' => false
]),
CURLOPT_HTTPHEADER => [
"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.velora.xyz/transactions/{chainId}"
payload := strings.NewReader("{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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.velora.xyz/transactions/{chainId}")
.header("Content-Type", "application/json")
.body("{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velora.xyz/transactions/{chainId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}"
response = http.request(request)
puts response.read_body{
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"value": "0",
"data": "<string>",
"gasPrice": "16000000000",
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"gas": "<string>",
"chainId": 1
}{
"errorType": "PricingError",
"details": "Error getting price data"
}{
"errorType": "PricingError",
"details": "Error getting price data"
}Build Market swap transaction
Build calldata for an Augustus v6.2 swap from a Market priceRoute.
curl --request POST \
--url https://api.velora.xyz/transactions/{chainId} \
--header 'Content-Type: application/json' \
--data '
{
"priceRoute": {
"blockNumber": 123,
"network": 1,
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"srcAmount": "1000000000000000000",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destDecimals": 123,
"destAmount": "1000000000000000000",
"bestRoute": [
{}
],
"gasCostUSD": "<string>",
"gasCost": "<string>",
"version": "<string>",
"contractAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenTransferProxy": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"contractMethod": "<string>",
"partnerFee": 123,
"srcUSD": "<string>",
"destUSD": "<string>",
"partner": "<string>",
"maxImpactReached": true,
"hmac": "<string>"
},
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"userAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"destDecimals": 123,
"srcAmount": "1000000000000000000",
"destAmount": "1000000000000000000",
"slippage": 5000,
"txOrigin": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"receiver": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partner": "my-app-name",
"partnerAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partnerFeeBps": "<string>",
"permit": "<string>",
"deadline": 123,
"isCapSurplus": true,
"takeSurplus": false,
"isSurplusToUser": false,
"isDirectFeeTransfer": false
}
'import requests
url = "https://api.velora.xyz/transactions/{chainId}"
payload = {
"priceRoute": {
"blockNumber": 123,
"network": 1,
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"srcAmount": "1000000000000000000",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destDecimals": 123,
"destAmount": "1000000000000000000",
"bestRoute": [{}],
"gasCostUSD": "<string>",
"gasCost": "<string>",
"version": "<string>",
"contractAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"tokenTransferProxy": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"contractMethod": "<string>",
"partnerFee": 123,
"srcUSD": "<string>",
"destUSD": "<string>",
"partner": "<string>",
"maxImpactReached": True,
"hmac": "<string>"
},
"srcToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"destToken": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"userAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"srcDecimals": 123,
"destDecimals": 123,
"srcAmount": "1000000000000000000",
"destAmount": "1000000000000000000",
"slippage": 5000,
"txOrigin": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"receiver": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partner": "my-app-name",
"partnerAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"partnerFeeBps": "<string>",
"permit": "<string>",
"deadline": 123,
"isCapSurplus": True,
"takeSurplus": False,
"isSurplusToUser": False,
"isDirectFeeTransfer": False
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
priceRoute: {
blockNumber: 123,
network: 1,
srcToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
srcDecimals: 123,
srcAmount: '1000000000000000000',
destToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
destDecimals: 123,
destAmount: '1000000000000000000',
bestRoute: [{}],
gasCostUSD: '<string>',
gasCost: '<string>',
version: '<string>',
contractAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
tokenTransferProxy: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
contractMethod: '<string>',
partnerFee: 123,
srcUSD: '<string>',
destUSD: '<string>',
partner: '<string>',
maxImpactReached: true,
hmac: '<string>'
},
srcToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
destToken: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
userAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
srcDecimals: 123,
destDecimals: 123,
srcAmount: '1000000000000000000',
destAmount: '1000000000000000000',
slippage: 5000,
txOrigin: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
receiver: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
partner: 'my-app-name',
partnerAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
partnerFeeBps: '<string>',
permit: '<string>',
deadline: 123,
isCapSurplus: true,
takeSurplus: false,
isSurplusToUser: false,
isDirectFeeTransfer: false
})
};
fetch('https://api.velora.xyz/transactions/{chainId}', 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.velora.xyz/transactions/{chainId}",
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([
'priceRoute' => [
'blockNumber' => 123,
'network' => 1,
'srcToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'srcDecimals' => 123,
'srcAmount' => '1000000000000000000',
'destToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'destDecimals' => 123,
'destAmount' => '1000000000000000000',
'bestRoute' => [
[
]
],
'gasCostUSD' => '<string>',
'gasCost' => '<string>',
'version' => '<string>',
'contractAddress' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'tokenTransferProxy' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'contractMethod' => '<string>',
'partnerFee' => 123,
'srcUSD' => '<string>',
'destUSD' => '<string>',
'partner' => '<string>',
'maxImpactReached' => true,
'hmac' => '<string>'
],
'srcToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'destToken' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'userAddress' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'srcDecimals' => 123,
'destDecimals' => 123,
'srcAmount' => '1000000000000000000',
'destAmount' => '1000000000000000000',
'slippage' => 5000,
'txOrigin' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'receiver' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'partner' => 'my-app-name',
'partnerAddress' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'partnerFeeBps' => '<string>',
'permit' => '<string>',
'deadline' => 123,
'isCapSurplus' => true,
'takeSurplus' => false,
'isSurplusToUser' => false,
'isDirectFeeTransfer' => false
]),
CURLOPT_HTTPHEADER => [
"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.velora.xyz/transactions/{chainId}"
payload := strings.NewReader("{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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.velora.xyz/transactions/{chainId}")
.header("Content-Type", "application/json")
.body("{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.velora.xyz/transactions/{chainId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"priceRoute\": {\n \"blockNumber\": 123,\n \"network\": 1,\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destDecimals\": 123,\n \"destAmount\": \"1000000000000000000\",\n \"bestRoute\": [\n {}\n ],\n \"gasCostUSD\": \"<string>\",\n \"gasCost\": \"<string>\",\n \"version\": \"<string>\",\n \"contractAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"tokenTransferProxy\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"contractMethod\": \"<string>\",\n \"partnerFee\": 123,\n \"srcUSD\": \"<string>\",\n \"destUSD\": \"<string>\",\n \"partner\": \"<string>\",\n \"maxImpactReached\": true,\n \"hmac\": \"<string>\"\n },\n \"srcToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"destToken\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"userAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"srcDecimals\": 123,\n \"destDecimals\": 123,\n \"srcAmount\": \"1000000000000000000\",\n \"destAmount\": \"1000000000000000000\",\n \"slippage\": 5000,\n \"txOrigin\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"receiver\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partner\": \"my-app-name\",\n \"partnerAddress\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"partnerFeeBps\": \"<string>\",\n \"permit\": \"<string>\",\n \"deadline\": 123,\n \"isCapSurplus\": true,\n \"takeSurplus\": false,\n \"isSurplusToUser\": false,\n \"isDirectFeeTransfer\": false\n}"
response = http.request(request)
puts response.read_body{
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"value": "0",
"data": "<string>",
"gasPrice": "16000000000",
"maxFeePerGas": "<string>",
"maxPriorityFeePerGas": "<string>",
"gas": "<string>",
"chainId": 1
}{
"errorType": "PricingError",
"details": "Error getting price data"
}{
"errorType": "PricingError",
"details": "Error getting price data"
}Path Parameters
EVM chain ID. Matches priceRoute.network.
EVM chain ID. Supported values today include 1 (Mainnet), 10 (Optimism), 56 (BSC), 137 (Polygon), 8453 (Base), 42161 (Arbitrum), 43114 (Avalanche), 100 (Gnosis). The set is open — call GET /chains for the live list.
1
Query Parameters
Gas price to use for the transaction, in WEI.
Skip on-chain balance, allowance, and transaction-failure checks. The response omits the gas field when enabled.
Skip the gas estimate. The response omits the gas field when enabled.
Return only the contract call parameters instead of a full transaction object.
Return an EIP-1559 transaction with maxFeePerGas and maxPriorityFeePerGas in place of gasPrice.
Body
The priceRoute block returned by GET /prices, passed verbatim — do not recompute or re-encode.
Show child attributes
Show child attributes
Source token address. A token symbol listed in /tokens can be used instead.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Destination token address. A token symbol listed in /tokens can be used instead.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Address of the transaction caller (msg.sender). When using an intermediary contract, userAddress should correspond to msg.sender and receiver to the recipient.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Source token decimals. Can be omitted if a token symbol is used in srcToken.
Destination token decimals. Can be omitted if a token symbol is used in destToken.
Source amount in WEI/raw units. Required when side=SELL. On side=BUY it can be omitted if slippage is provided.
"1000000000000000000"
Destination amount in WEI/raw units. Required when side=BUY. On side=SELL it can be omitted if slippage is provided.
"1000000000000000000"
Allowed slippage in basis points (0–10000). 250 = 2.5%. Required when the non-fixed amount (destAmount on SELL, srcAmount on BUY) is omitted.
0 <= x <= 10000When msg.sender differs from the transaction sender, pass the sender here along with userAddress.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Recipient of the swap output, for Swap & Transfer. Omit when userAddress receives.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Partner string. Used for analytics and fee attribution on your project's swaps.
"my-app-name"
Address entitled to claim partner fees or surplus.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Partner fee in basis points, used with partnerAddress. 200 = 2%.
Signed permit payload (hex). Lets the swap skip the separate approve transaction.
Unix timestamp (seconds) after which the transaction is no longer valid.
Cap collected surplus at 1%.
Collect positive slippage as surplus. Works with partnerAddress.
Route positive slippage / surplus to the user instead of the partner.
Transfer the partner fee directly rather than accruing it in the Fee Vault.
Response
Augustus calldata + tx fields.
Augustus calldata + tx envelope ready to broadcast.
End-user wallet address (the userAddress from the request).
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
The Augustus v6.2 router. Send the transaction here; it is also the ERC-20 spender to approve.
^0x[a-fA-F0-9]{40}$"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
Native token amount in WEI to send with the transaction. "0" for ERC-20 sources.
"0"
Encoded swap calldata.
Suggested gas price in WEI. Replaced by maxFeePerGas / maxPriorityFeePerGas when eip1559=true.
"16000000000"
EIP-1559 max fee per gas in WEI. Present when eip1559=true.
EIP-1559 max priority fee per gas in WEI. Present when eip1559=true.
Gas limit estimate from the API's transaction checks. Returned by POST /transactions unless ignoreChecks or ignoreGasEstimate is set; omitted by GET /swap, where you estimate locally before broadcasting.
EVM chain ID. Supported values today include 1 (Mainnet), 10 (Optimism), 56 (BSC), 137 (Polygon), 8453 (Base), 42161 (Arbitrum), 43114 (Avalanche), 100 (Gnosis). The set is open — call GET /chains for the live list.
1
Was this page helpful?