HoldingsReport
All holdings of one (address × chain) with an exact USD total.
as_of_ms is an integer ms-epoch timestamp (SPEC §4.4: ms epoch,
everywhere, always). unpriced lists the CAIP-19 ids of holdings
that carry no value, in input order, so a consumer knows exactly what
the total omits (SPEC §4.4 data_quality spirit: incompleteness is
first-class, never silent).
Fields
addressstrchain_idstrholdingstuple[Holding, ...]total_valueMoneyunpricedtuple[str, ...]as_of_msintassemble
assemble(cls, address: str, chain_id: str, holdings: Iterable[Holding], as_of_ms: int) -> HoldingsReport
Assemble a report from holdings; pinned algorithm.
total_value=Moneyof the EXACTDecimalsum ofh.value.amountover priced holdings, currency"USD", NO rounding, NO floats (SPEC rule #1), exact past any Decimal context precision.Decimal("0")when nothing is priced.- Raises
CurrencyMismatchErrorif any holding'svalue.currency != "USD". unpriced= tuple ofcaip19for holdings whosevalueisNone, input order preserved.holdingsstored as a tuple in input order.
Parameters
addressrequired, strnone
chain_idrequired, strnone
holdingsrequired, Iterable[Holding]none
as_of_msrequired, intnone
Raises
__init__
__init__(self, address: str, chain_id: str, holdings: tuple[Holding, ...], total_value: Money, unpriced: tuple[str, ...], as_of_ms: int) -> None
Parameters
addressrequired, strnone
chain_idrequired, strnone
holdingsrequired, tuple[Holding, ...]none
total_valuerequired, Moneynone
unpricedrequired, tuple[str, ...]none
as_of_msrequired, intnone