xo-orderbook-client-rs
// Requires an authenticated client. Forces a fresh chain read.
use xo_orderbook_client::orderbook::types::request::UpdateBalanceAllowanceRequest;
let resp = client
.update_balance_allowance(UpdateBalanceAllowanceRequest::default())
.await?;curl --request GET \
--url https://orderbooks.xo.market/balance-allowance/update \
--header 'XO_API_KEY: <api-key>'import requests
url = "https://orderbooks.xo.market/balance-allowance/update"
headers = {"XO_API_KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {XO_API_KEY: '<api-key>'}};
fetch('https://orderbooks.xo.market/balance-allowance/update', 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://orderbooks.xo.market/balance-allowance/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"XO_API_KEY: <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://orderbooks.xo.market/balance-allowance/update"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("XO_API_KEY", "<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://orderbooks.xo.market/balance-allowance/update")
.header("XO_API_KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/balance-allowance/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["XO_API_KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balance": "12345678",
"allowance": "10000000",
"smart_account": "CAFE000000000000000000000000000000000A11"
}Account
Refresh balance & allowance
Cache-invalidation variant of /balance-allowance. Forces a
fresh chain read; otherwise identical wire shape.
GET
/
balance-allowance
/
update
xo-orderbook-client-rs
// Requires an authenticated client. Forces a fresh chain read.
use xo_orderbook_client::orderbook::types::request::UpdateBalanceAllowanceRequest;
let resp = client
.update_balance_allowance(UpdateBalanceAllowanceRequest::default())
.await?;curl --request GET \
--url https://orderbooks.xo.market/balance-allowance/update \
--header 'XO_API_KEY: <api-key>'import requests
url = "https://orderbooks.xo.market/balance-allowance/update"
headers = {"XO_API_KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {XO_API_KEY: '<api-key>'}};
fetch('https://orderbooks.xo.market/balance-allowance/update', 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://orderbooks.xo.market/balance-allowance/update",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"XO_API_KEY: <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://orderbooks.xo.market/balance-allowance/update"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("XO_API_KEY", "<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://orderbooks.xo.market/balance-allowance/update")
.header("XO_API_KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://orderbooks.xo.market/balance-allowance/update")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["XO_API_KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"balance": "12345678",
"allowance": "10000000",
"smart_account": "CAFE000000000000000000000000000000000A11"
}Authorizations
L2 HMAC request signature. See Authentication.
Query Parameters
Available options:
COLLATERAL, CONDITIONAL Response
OK
USDC cash balance in micro-units, decimal string. (XO does
not currently honour asset_type=CONDITIONAL — see endpoint
description.)
Available cash after open-order reservations, decimal-string
micro-USDC. balance - allowance is the amount earmarked
against resting BUY orders.
User's smart-account address as hex without 0x prefix
(e.g. "CAFE000000000000000000000000000000000A11").
null for plain EOA users with no smart account. XO-only
field — not part of the canonical CLOB wire contract.