Expand description
Cost conversion and attribution (spec 009, 3.8.1 and 3.10.4).
A charge is observed only from a cost the remote side reported for the
exchange, converted to the deployment’s units by a declared rate and
rounded up; estimated from reported usage and a declared price table;
unknown otherwise. Units are not money: the reported amount and
currency are kept verbatim in the exchange record.
Structs§
- Price
Table - Deployment units per unit of reported usage (for example per token), declared by the host.
- Unit
Rate - Deployment units per reported unit (per currency unit, or per remote unit). Declared by the host; never negative.
Enums§
- Cost
Error - Why a cost could not be converted. The charge is then
unknown.
Functions§
- attribute
- Attribute an exchange’s charge to its members (3.10.4).
received[i]is whether memberi, in attempt-id order, received the response. Receivers get integer shares summing exactly to the total, the firsttotal % receiversone unit more; a member that stopped waiting getsunknown, so its reservation stays liability until reconciled. Anunknowntotal, or no receiver, leaves every memberunknown. - convert_
bound - A per-call disclosure in remote units, in deployment units, rounded up.
- convert_
charge - A charge in remote units, in deployment units. A charge that cannot be
converted is
unknown, never clipped. - convert_
units - Whole remote units times the rate, rounded up.
- observed_
from_ amount - An
observedcharge from a reported amount;unknownwhen it cannot be converted. - sum_
charges - The sum of a member list’s charges:
observedonly when all are,unknownwhen any is,estimatedotherwise. - units_
from_ amount - A decimal amount as reported, times the rate, rounded up to whole units.