Build a bet intent
curl --request GET \
--url https://api.counsel.markets/markets/{id}/bet-intentimport requests
url = "https://api.counsel.markets/markets/{id}/bet-intent"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.counsel.markets/markets/{id}/bet-intent', 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.counsel.markets/markets/{id}/bet-intent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.counsel.markets/markets/{id}/bet-intent"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.counsel.markets/markets/{id}/bet-intent")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.counsel.markets/markets/{id}/bet-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"tx": {},
"pool_account": "<string>",
"destination_tag": 123,
"source_tag": 2606220005,
"amount_xrp": 10,
"projected_implied_odds_after": {
"implied_prob": 123,
"payout_per_unit": 123
},
"market": {
"id": "<string>",
"question": "<string>",
"outcome": 123,
"outcome_label": "<string>"
}
}{
"errors": [
"invalid account address"
]
}{
"errors": [
"invalid account address"
]
}{
"error": "market not found"
}Markets
Build a bet intent
An unsigned XRPL Payment ready to sign with your own key, plus the projected parimutuel odds after your stake. counsel never holds a key.
GET
/
markets
/
{id}
/
bet-intent
Build a bet intent
curl --request GET \
--url https://api.counsel.markets/markets/{id}/bet-intentimport requests
url = "https://api.counsel.markets/markets/{id}/bet-intent"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.counsel.markets/markets/{id}/bet-intent', 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.counsel.markets/markets/{id}/bet-intent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.counsel.markets/markets/{id}/bet-intent"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.counsel.markets/markets/{id}/bet-intent")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.counsel.markets/markets/{id}/bet-intent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"tx": {},
"pool_account": "<string>",
"destination_tag": 123,
"source_tag": 2606220005,
"amount_xrp": 10,
"projected_implied_odds_after": {
"implied_prob": 123,
"payout_per_unit": 123
},
"market": {
"id": "<string>",
"question": "<string>",
"outcome": 123,
"outcome_label": "<string>"
}
}{
"errors": [
"invalid account address"
]
}{
"errors": [
"invalid account address"
]
}{
"error": "market not found"
}Returns an unsigned XRPL
Payment for a specific bet, the pool account, the DestinationTag (the outcome) and SourceTag (counsel’s attribution), and projected_implied_odds_after: the line including your own stake, since a parimutuel line moves with every bet. Sign the tx with your own wallet and submit it to the XRP Ledger. counsel never holds a key.Path Parameters
Market id.
Query Parameters
The bettor's XRPL classic address.
Outcome index (also the DestinationTag).
Stake in XRP.
Response
Unsigned bet Payment + projected odds
Unsigned XRPL Payment. Sign it with your own key and submit it.
Example:
2606220005
Example:
10
Show child attributes
Show child attributes
Show child attributes
Show child attributes