Repository navigation
0.4.0
Synced to ocp-protobuf-api@82202912.
Breaking. ocp.balance.v1.Balance had exactly one RPC and it has been replaced, so every
consumer of the service has work to do. There is no deprecation window: GetBalance is gone in the
same release that adds GetBalances.
Removed
-
GetBalance, along withGetBalanceRequestandGetBalanceResponse. -
GetBalancesResponse.Result.NOT_FOUND.OKandDENIEDkeep0and1, so no surviving case
renumbers and no positional mapping shifts underneath you. What changes is that "this owner has no
balance" no longer has a result code: an owner with nothing to report is simply absent from
balances_by_owner. Code that branched onNOT_FOUNDneeds to branch on a missing map entry
instead, and code that treated a non-OKresult as a hard failure will now seeOKwhere it used
to seeNOT_FOUND.
Added
-
GetBalances, a unary RPC that batches whatGetBalancedid one owner at a time.GetBalancesRequesttakesrepeated owners(1 to 1024) where the old request took a single
owner, plus an optionalrepeated mintsfilter (up to 1024). Leavingmintsempty returns
every mint each owner holds, which is the closest thing to the old behaviour.GetBalancesResponsereturnsmap<string, OwnerBalance> balances_by_owner, keyed by owner
address. EachOwnerBalancecarries thecore_mint_valuetotal in quarks that the old flat
response returned directly, plusmap<string, MintBalance> balances_by_mintkeyed by mint
address for the per-mint breakdown. So the scalar total still exists, one level further down.Like
GetBalancebefore it,GetBalancesRequestcarries no auth or signature field. It reads
balances for arbitrary owner accounts rather than the caller's own, so there is nothing to sign.
Migrating
A single-owner call maps across mechanically: wrap the owner in owners, leave mints empty, and
read balances_by_owner[owner]?.core_mint_value where you read core_mint_value before. Treat a
missing entry as the old NOT_FOUND. The per-mint breakdown and the multi-owner batch are new
capability, not something the old shape expressed, so nothing forces you to use either.