Expand description
Receipt-level accessors and utilities.
Provides a field-oriented interface over LazyBalance::Receipt,
treating it as a virtual struct
composed via discriminants.
§Semantics
A receipt represents a claim over deposited value:
deposit -> issue receipt
balance mutation -> affects value
withdraw -> resolve receiptCaptures:
principal,sharesbiascheckpoint
§Logical Structure
ⓘ
struct <T as LazyBalance>::Receipt {
ReceiptAsset.0: T::Asset, // principal
ReceiptAsset.1: T::Asset, // shares
ReceiptRational: T::Rational, // bias
ReceiptTime: T::Time, // checkpoint
}- discriminants = field identifiers
.0,.1= multiple values (Many)
ⓘ
ReceiptAsset => Many(T::Asset)
ReceiptRational => Some(T::Rational)
ReceiptTime => Some(T::Time)Type projection:
Tdefines schema- storage via
VirtualDynField
§Context
ShareBalanceContext supplies:
- bounds (
VirtualDynBound) - empty extensions (
empty_virtual_extension!)
Structure is abstract; layout comes from context.
Functions§
- bias
- Returns the scaling factor (share-price) associated with the receipt at the time of deposit.
- checkpoint
- Returns the checkpoint time of the receipt.
- principal
- Returns the original deposit value of the receipt.
- set_
bias - Sets the scaling factor (share-price) associated with the receipt at the time of deposit.
- set_
checkpoint - Sets the checkpoint time of the receipt.
- set_
principal - Sets the original deposit value of the receipt.
- set_
shares - Sets the total shares provided for the receipt.
- shares
- Returns the total shares provided for the receipt.