Validate an unsigned transaction matches a prior simulation
curl --request POST \
--url https://quoter.api.enso.build/api/v1/validate \
--header 'Content-Type: application/json' \
--header 'x-request-id: <x-request-id>' \
--data '
{
"simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"transaction": {
"data": "0xabcdef",
"to": "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E",
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"value": "1000000000000000000",
"chainId": 1
}
}
'import requests
url = "https://quoter.api.enso.build/api/v1/validate"
payload = {
"simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"transaction": {
"data": "0xabcdef",
"to": "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E",
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"value": "1000000000000000000",
"chainId": 1
}
}
headers = {
"x-request-id": "<x-request-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-request-id': '<x-request-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
simulationId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
transaction: {
data: '0xabcdef',
to: '0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E',
from: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
value: '1000000000000000000',
chainId: 1
}
})
};
fetch('https://quoter.api.enso.build/api/v1/validate', 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://quoter.api.enso.build/api/v1/validate",
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([
'simulationId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'transaction' => [
'data' => '0xabcdef',
'to' => '0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E',
'from' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'value' => '1000000000000000000',
'chainId' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-request-id: <x-request-id>"
],
]);
$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://quoter.api.enso.build/api/v1/validate"
payload := strings.NewReader("{\n \"simulationId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"transaction\": {\n \"data\": \"0xabcdef\",\n \"to\": \"0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E\",\n \"from\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"value\": \"1000000000000000000\",\n \"chainId\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-request-id", "<x-request-id>")
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://quoter.api.enso.build/api/v1/validate")
.header("x-request-id", "<x-request-id>")
.header("Content-Type", "application/json")
.body("{\n \"simulationId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"transaction\": {\n \"data\": \"0xabcdef\",\n \"to\": \"0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E\",\n \"from\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"value\": \"1000000000000000000\",\n \"chainId\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://quoter.api.enso.build/api/v1/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-request-id"] = '<x-request-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"simulationId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"transaction\": {\n \"data\": \"0xabcdef\",\n \"to\": \"0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E\",\n \"from\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"value\": \"1000000000000000000\",\n \"chainId\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"simulationId": "<string>",
"checks": {
"chainId": true,
"data": true,
"to": true,
"value": true,
"from": true
}
}quote
Validate an unsigned transaction matches a prior simulation
Validate an unsigned transaction matches a prior simulation
POST
/
api
/
v1
/
validate
Validate an unsigned transaction matches a prior simulation
curl --request POST \
--url https://quoter.api.enso.build/api/v1/validate \
--header 'Content-Type: application/json' \
--header 'x-request-id: <x-request-id>' \
--data '
{
"simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"transaction": {
"data": "0xabcdef",
"to": "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E",
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"value": "1000000000000000000",
"chainId": 1
}
}
'import requests
url = "https://quoter.api.enso.build/api/v1/validate"
payload = {
"simulationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"transaction": {
"data": "0xabcdef",
"to": "0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E",
"from": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"value": "1000000000000000000",
"chainId": 1
}
}
headers = {
"x-request-id": "<x-request-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-request-id': '<x-request-id>', 'Content-Type': 'application/json'},
body: JSON.stringify({
simulationId: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
transaction: {
data: '0xabcdef',
to: '0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E',
from: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
value: '1000000000000000000',
chainId: 1
}
})
};
fetch('https://quoter.api.enso.build/api/v1/validate', 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://quoter.api.enso.build/api/v1/validate",
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([
'simulationId' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'transaction' => [
'data' => '0xabcdef',
'to' => '0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E',
'from' => '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045',
'value' => '1000000000000000000',
'chainId' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-request-id: <x-request-id>"
],
]);
$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://quoter.api.enso.build/api/v1/validate"
payload := strings.NewReader("{\n \"simulationId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"transaction\": {\n \"data\": \"0xabcdef\",\n \"to\": \"0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E\",\n \"from\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"value\": \"1000000000000000000\",\n \"chainId\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-request-id", "<x-request-id>")
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://quoter.api.enso.build/api/v1/validate")
.header("x-request-id", "<x-request-id>")
.header("Content-Type", "application/json")
.body("{\n \"simulationId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"transaction\": {\n \"data\": \"0xabcdef\",\n \"to\": \"0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E\",\n \"from\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"value\": \"1000000000000000000\",\n \"chainId\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://quoter.api.enso.build/api/v1/validate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-request-id"] = '<x-request-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"simulationId\": \"a1b2c3d4-e5f6-7890-abcd-ef1234567890\",\n \"transaction\": {\n \"data\": \"0xabcdef\",\n \"to\": \"0x80EbA3855878739F4710233A8a19d89Bdd2ffB8E\",\n \"from\": \"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\",\n \"value\": \"1000000000000000000\",\n \"chainId\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"valid": true,
"simulationId": "<string>",
"checks": {
"chainId": true,
"data": true,
"to": true,
"value": true,
"from": true
}
}Headers
Body
application/json
Was this page helpful?
⌘I
