Off-Chain Settlement
Get Off-Chain Order Book
Read one off-chain book, refusing on-chain ones
GET
/
orderbooks
/
stocks
/
api
/
offchain
/
order-books
/
{orderBookId}
curl "https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/clx_ob_stock_001" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/${orderBookId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const body = await res.json();
if (!body.success && body.error.code === 'WRONG_SETTLEMENT_MODE') {
// this book settles on chain
}
{
"success": true,
"data": {
"id": "clx_ob_stock_001",
"name": "Nyala Fund I",
"symbol": "NYF1",
"status": "ACTIVE",
"tokenType": "STOCK_TOKEN",
"settlementMode": "OFF_CHAIN",
"custodyContract": null,
"minOrderSize": "1000000",
"tickSize": "10000",
"makerFeeBps": 5,
"takerFeeBps": 15
}
}
{
"success": false,
"data": null,
"error": {
"code": "WRONG_SETTLEMENT_MODE",
"message": "Use on-chain API for this order book"
}
}
Returns a single book, provided it settles off chain. An on-chain book resolves but is then refused with
WRONG_SETTLEMENT_MODE, so this route can be used as a settlement-mode assertion as well as a read.
Imported books resolve here too, but since only on-chain books can be imported, they always take the refusal.
Path Parameters
string
required
Order book ID.
Response Fields
Same shape as Get Order Book.curl "https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/clx_ob_stock_001" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/${orderBookId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const body = await res.json();
if (!body.success && body.error.code === 'WRONG_SETTLEMENT_MODE') {
// this book settles on chain
}
{
"success": true,
"data": {
"id": "clx_ob_stock_001",
"name": "Nyala Fund I",
"symbol": "NYF1",
"status": "ACTIVE",
"tokenType": "STOCK_TOKEN",
"settlementMode": "OFF_CHAIN",
"custodyContract": null,
"minOrderSize": "1000000",
"tickSize": "10000",
"makerFeeBps": 5,
"takerFeeBps": 15
}
}
{
"success": false,
"data": null,
"error": {
"code": "WRONG_SETTLEMENT_MODE",
"message": "Use on-chain API for this order book"
}
}
Error Codes
| Code | HTTP | Cause |
|---|---|---|
WRONG_SETTLEMENT_MODE | 400 | The book settles on chain |
ORDER_BOOK_NOT_FOUND | 404 | No such book on this instance, and not imported |
⌘I
curl "https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/clx_ob_stock_001" \
-H "X-API-Key: trusset_your_key_here"
const res = await fetch(
`https://api.trusset.org/orderbooks/stocks/api/offchain/order-books/${orderBookId}`,
{ headers: { 'X-API-Key': 'trusset_your_key_here' } }
);
const body = await res.json();
if (!body.success && body.error.code === 'WRONG_SETTLEMENT_MODE') {
// this book settles on chain
}
{
"success": true,
"data": {
"id": "clx_ob_stock_001",
"name": "Nyala Fund I",
"symbol": "NYF1",
"status": "ACTIVE",
"tokenType": "STOCK_TOKEN",
"settlementMode": "OFF_CHAIN",
"custodyContract": null,
"minOrderSize": "1000000",
"tickSize": "10000",
"makerFeeBps": 5,
"takerFeeBps": 15
}
}
{
"success": false,
"data": null,
"error": {
"code": "WRONG_SETTLEMENT_MODE",
"message": "Use on-chain API for this order book"
}
}
