curl --request GET \
--url https://txline.txodds.com/api/scores/stat-validation \
--header 'Authorization: Bearer <token>' \
--header 'X-Api-Token: <api-key>'import requests
url = "https://txline.txodds.com/api/scores/stat-validation"
headers = {
"Authorization": "Bearer <token>",
"X-Api-Token": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'X-Api-Token': '<api-key>'}
};
fetch('https://txline.txodds.com/api/scores/stat-validation', 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://txline.txodds.com/api/scores/stat-validation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Api-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://txline.txodds.com/api/scores/stat-validation"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Api-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://txline.txodds.com/api/scores/stat-validation")
.header("Authorization", "Bearer <token>")
.header("X-Api-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://txline.txodds.com/api/scores/stat-validation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Api-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"Ts": 123,
"StatToProve": {
"Key": 123,
"Value": 123,
"Period": 123
},
"EventStatRoot": "<string>",
"Summary": {
"FixtureId": 123,
"UpdateStats": {
"UpdateCount": 123,
"MinTimestamp": 123,
"MaxTimestamp": 123
},
"EventStatsSubTreeRoot": "<string>"
},
"StatProof": {},
"SubTreeProof": {},
"MainTreeProof": {},
"StatToProve2": {
"Key": 123,
"Value": 123,
"Period": 123
},
"StatProof2": {}
}"<string>""<string>""<string>""<string>"Get a Merkle proof for fixture statistics
This endpoint provides a deep cryptographic proof for statistics within a single scores update. The TxODDS Oracle data is structured in a three-level Merkle hierarchy:
- A main batch contains summaries for multiple fixtures.
- Each fixture summary is the root of a sub-tree of all score update events for that fixture.
- Each score update event is the root of a sub-tree of all the individual statistics it contains.
This endpoint returns the full set of proofs needed to connect the stat(s) all the way to the main batch root published on-chain.
Request Modes
The endpoint supports two mutually exclusive request formats:
- Legacy Mode (
statKey,statKey2): Returns aScoresStatValidationpayload containing proofs for one or two specific statistics. - V2 Mode (
statKeys): Accepts a comma-separated list of keys and returns aScoresStatValidationV2payload supporting dynamic N-dimensional proofs across any number of requested statistics.
On-Chain Execution
With the returned data, the user can execute an on-chain transaction to validate that a supplied strategy holds against the extracted stats. For example, validating that a team’s score exceeded a threshold, or that the difference between two scores meets a specific binary condition.
curl --request GET \
--url https://txline.txodds.com/api/scores/stat-validation \
--header 'Authorization: Bearer <token>' \
--header 'X-Api-Token: <api-key>'import requests
url = "https://txline.txodds.com/api/scores/stat-validation"
headers = {
"Authorization": "Bearer <token>",
"X-Api-Token": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {Authorization: 'Bearer <token>', 'X-Api-Token': '<api-key>'}
};
fetch('https://txline.txodds.com/api/scores/stat-validation', 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://txline.txodds.com/api/scores/stat-validation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Api-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://txline.txodds.com/api/scores/stat-validation"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("X-Api-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://txline.txodds.com/api/scores/stat-validation")
.header("Authorization", "Bearer <token>")
.header("X-Api-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://txline.txodds.com/api/scores/stat-validation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Api-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"Ts": 123,
"StatToProve": {
"Key": 123,
"Value": 123,
"Period": 123
},
"EventStatRoot": "<string>",
"Summary": {
"FixtureId": 123,
"UpdateStats": {
"UpdateCount": 123,
"MinTimestamp": 123,
"MaxTimestamp": 123
},
"EventStatsSubTreeRoot": "<string>"
},
"StatProof": {},
"SubTreeProof": {},
"MainTreeProof": {},
"StatToProve2": {
"Key": 123,
"Value": 123,
"Period": 123
},
"StatProof2": {}
}"<string>""<string>""<string>""<string>"Authorizations
User's session JWT.
The user's long-lived API token, obtained from the activation endpoint.
Headers
Bearer token for the user's session JWT.
The user's long-lived API token.
Query Parameters
The ID of the fixture for the scores event.
The sequence number of the specific scores event within the fixture's history.
Legacy Mode: The key identifying the specific statistic to validate (e.g., 1 for 'Participant1_Score').
Legacy Mode: The key identifying an optional second statistic to validate for two-stat predicates.
V2 Mode: Comma-separated list of stat keys used in N-stat validation strategies.
Response
- ScoresStatValidation
- ScoresStatValidationV2
Show child attributes
Show child attributes
Show child attributes
Show child attributes
- Nil · object
- ProofNode · object[]
- Nil · object
- ProofNode · object[]
- Nil · object
- ProofNode · object[]
Show child attributes
Show child attributes
- Nil · object
- ProofNode · object[]
Was this page helpful?