Skip to content

The trial balance, on commitments and on openings. The operator's.

GET
/v1/trial-balance
curl --request GET \
--url https://example.com/v1/trial-balance \
--header 'Authorization: Bearer <token>'

Checks that the book adds up, from one view. It is the operator’s: any other caller is refused as ERR-NotAuthorised. asset narrows the check to one asset. The route also accepts amount, which belongs to can_spend, and ignores it. Any other parameter, and an asset that is not a valid symbol, is refused as ERR-MalformedCommand.

amount

For can_spend: the amount, in minor units.

string | null
asset

The asset.

string | null

The answer, from one consistent view (REQ-QR-2).

Media typeapplication/json

trial_balance (SPEC §8.2, INV-5): the operator’s.

object
accounts
required

How many kernel accounts the commitment check summed.

integer format: uint64
rows
required

The check on openings, per asset.

Array<object>

One asset’s trial balance on openings.

object
asset
required

The asset.

string
openings
required

The signed sum of openings, minor units: zero when it balances.

string
unbalanced
required

Every (currency, layer) that does not sum to zero. Empty when the book balances.

Array<object>

One unbalanced (currency, layer) of the commitment check.

object
currency
required

The kernel currency tag.

integer format: uint32
layer
required

The balance layer.

integer format: uint64
view
required

The view it was read at.

integer format: uint64
Examplegenerated
{
"accounts": 1,
"rows": [
{
"asset": "example",
"openings": "example"
}
],
"unbalanced": [
{
"currency": 1,
"layer": 1
}
],
"view": 1
}

Refused, with the named condition. The status is the alternative’s x-http-status.

Media typeapplication/json
One of:
ERR-NotAuthorised
object
description
required
Allowed value: The initiating principal holds no authority that covers this operation, account, asset or bound
error
required
Allowed value: ERR-NotAuthorised
Example
{
"description": "The initiating principal holds no authority that covers this operation, account, asset or bound",
"error": "ERR-NotAuthorised"
}

Refused, with the named condition. The status is the alternative’s x-http-status.

Media typeapplication/json
One of:
ERR-NotAuthorised
object
description
required
Allowed value: The initiating principal holds no authority that covers this operation, account, asset or bound
error
required
Allowed value: ERR-NotAuthorised
Example
{
"description": "The initiating principal holds no authority that covers this operation, account, asset or bound",
"error": "ERR-NotAuthorised"
}
Retry-After
integer

On ERR-DecisionUnavailable (503): seconds to wait before retrying with the same client key (DEC-27 (g)).