curl --request POST \
--url https://api.echo.xyz/sonar/v1/public/read-commitment-data \
--header 'Content-Type: application/json' \
--data '
{
"SaleUUID": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.echo.xyz/sonar/v1/public/read-commitment-data"
payload = { "SaleUUID": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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({SaleUUID: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.echo.xyz/sonar/v1/public/read-commitment-data', 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.echo.xyz/sonar/v1/public/read-commitment-data",
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([
'SaleUUID' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.echo.xyz/sonar/v1/public/read-commitment-data"
payload := strings.NewReader("{\n \"SaleUUID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.echo.xyz/sonar/v1/public/read-commitment-data")
.header("Content-Type", "application/json")
.body("{\n \"SaleUUID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.echo.xyz/sonar/v1/public/read-commitment-data")
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 \"SaleUUID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"Commitments": [
{
"Amounts": [
{
"Amount": "<string>",
"TokenAddress": "<string>",
"Wallet": "<string>"
}
],
"CommitmentID": "<string>",
"CreatedAt": "2023-11-07T05:31:56Z",
"ExtraDataParsed": {},
"ExtraDataRaw": "<string>",
"PriceDenominator": "<string>",
"PriceNumerator": "<string>",
"SaleSpecificEntityID": "<string>",
"PriceMicroUSD": "<string>"
}
],
"PaymentTokenDecimals": 1,
"TotalCommitmentAmount": "<string>",
"UniqueCommitmentCount": 1,
"ClearingPriceDenominator": "<string>",
"ClearingPriceMicroUSD": "<string>",
"ClearingPriceNumerator": "<string>",
"OfferedTokenDecimals": 1
}{
"code": "not_found",
"details": {},
"message": "<string>"
}read-commitment-data
Read data derived from the commitments to a sale contract. This includes the 100 latest commitments for a given sale, the total commitment amount, and the number of unique commitments. For auction sales, the current clearing price is also returned.
curl --request POST \
--url https://api.echo.xyz/sonar/v1/public/read-commitment-data \
--header 'Content-Type: application/json' \
--data '
{
"SaleUUID": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.echo.xyz/sonar/v1/public/read-commitment-data"
payload = { "SaleUUID": "3c90c3cc-0d44-4b50-8888-8dd25736052a" }
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({SaleUUID: '3c90c3cc-0d44-4b50-8888-8dd25736052a'})
};
fetch('https://api.echo.xyz/sonar/v1/public/read-commitment-data', 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.echo.xyz/sonar/v1/public/read-commitment-data",
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([
'SaleUUID' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.echo.xyz/sonar/v1/public/read-commitment-data"
payload := strings.NewReader("{\n \"SaleUUID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.echo.xyz/sonar/v1/public/read-commitment-data")
.header("Content-Type", "application/json")
.body("{\n \"SaleUUID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.echo.xyz/sonar/v1/public/read-commitment-data")
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 \"SaleUUID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"Commitments": [
{
"Amounts": [
{
"Amount": "<string>",
"TokenAddress": "<string>",
"Wallet": "<string>"
}
],
"CommitmentID": "<string>",
"CreatedAt": "2023-11-07T05:31:56Z",
"ExtraDataParsed": {},
"ExtraDataRaw": "<string>",
"PriceDenominator": "<string>",
"PriceNumerator": "<string>",
"SaleSpecificEntityID": "<string>",
"PriceMicroUSD": "<string>"
}
],
"PaymentTokenDecimals": 1,
"TotalCommitmentAmount": "<string>",
"UniqueCommitmentCount": 1,
"ClearingPriceDenominator": "<string>",
"ClearingPriceMicroUSD": "<string>",
"ClearingPriceNumerator": "<string>",
"OfferedTokenDecimals": 1
}{
"code": "not_found",
"details": {},
"message": "<string>"
}Response
Success response
Set if the sale is using an auction pricing strategy and the payment token is a USD stablecoin and the offered token decimals are configured. It contains the current clearing price in micro-USD (1 USD = 1,000,000 micro-USD) for one human-readable offered token (1 human-readable token = 10^OfferedTokenDecimals smallest units). Warning: this could lose precision, so ClearingPriceNumerator and ClearingPriceDenominator should be used as the machine-readable value.
Set if the sale is using an auction pricing strategy. The current clearing price _numerator_ as a number string. You can divide this by the ClearingPriceDenominator to get the current price, but you might lose precision. The clearing price is in smallest units of the payment token per smallest unit of the offered token.