Expand description
Pallet implementation of LazyBalance using virtual
structs and plugins.
Provides a generic, plugin-driven balance system where behavior is defined
by LazyBalance::BalanceFamily thin-delegated to Config::BalanceFamily,
rather than being hardcoded.
State is encoded using SumDynType and accessed through
VirtualDynField, enabling flexible virtual schemas.
Supports:
- lazy evaluation of balances
- snapshot-based time tracking via
VirtualNMap - typed dispatch through tagged input/output enums
Macrosยง
- impl_
product_ ๐alloc - Implements all virtual field and extension bindings for a
ProductType. - impl_
v_ ๐ext - Implements
VirtualDynExtensionfor aProductTypeextension field. - impl_
v_ ๐field - Implements
VirtualDynFieldfor aProductTypefield. - lazy_
input ๐ - Defines the
LazyInputenum forLazyBalanceoperations. - lazy_
output ๐ - Defines the
LazyOutputenum forLazyBalanceoperations.
Structsยง
- Dispatch
Policy - Execution policy for
LazyBalancepluginoperations. - Limits
Product - Virtual limits container for
LazyBalanceoperations. - Product
Type - A generic
virtualproduct structure used byLazyBalancecomponents.
Enumsยง
Traitsยง
- Product
Provider - Schema provider for
ProductTypetypical viaBalanceModelContext.
Functionsยง
- balance_
total - Returns total value of a
VirtualBalancefor a(variant, digest)pair viaLazyBalance::total_valueexecution. - can_
deposit - Checks if a deposit is allowed under current constraints via
LazyBalance::can_depositexecution. - can_
mint - Checks if minting is allowed under current constraints via
LazyBalance::can_withdrawexecution. - can_
reap - Checks if reaping is allowed under current constraints via
LazyBalance::can_reapexecution. - can_
withdraw - Checks if a withdrawal is allowed for a given
VirtualReceiptviaLazyBalance::can_withdrawexecution. - deposit
- Deposits value into a
VirtualBalanceviaLazyBalance::depositexecution. - deposit_
limits_ of - Returns deposit limits implementing
Extentfor aVirtualBalancecontext viaLazyBalance::deposit_limitsexecution. - drain
- Drains all value associated with a
(variant, digest)pair viaLazyBalance::drainexecution. - has_
deposits - Checks whether any deposits exist for a
(variant, digest)pair viaLazyBalance::has_depositsexecution. - mint
- Mints value into a
VirtualBalance(e.g. rewards/inflation) viaLazyBalance::mintexecution. - mint_
limits_ of - Returns mint limits implementing
Extentfor aVirtualBalancecontext viaLazyBalance::mint_limitsexecution. - reap
- Reaps (removes) value from a
VirtualBalance(e.g. penalties/deflation) viaLazyBalance::reapexecution. - reap_
limits_ of - Returns reap limits implementing
Extentfor aVirtualBalancecontext viaLazyBalance::reap_limitsexecution. - receipt_
active_ value - Returns the current (lazy-evaluated) value of a
VirtualReceiptviaLazyBalance::receipt_active_valueexecution. - receipt_
deposit_ value - Returns the original deposited value of a
VirtualReceiptviaLazyBalance::receipt_deposit_valueexecution. - withdraw
- Withdraws value from a
VirtualBalanceusing aVirtualReceiptviaLazyBalance::withdrawexecution.
Type Aliasesยง
- Lazy
Asset ๐Of - Convenient alias for the palletโs underlying asset type.
- Lazy
Balance ๐Of - Convenient alias for the palletโs
virtualbalance type. - Lazy
Error ๐Of - Convenient alias for the error type resolved from the lazy balance context.
- Lazy
IdOf ๐ - Convenient alias for the digest identifier used in lazy balance.
- Lazy
Receipt ๐Of - Convenient alias for the palletโs
virtualreceipt type. - Lazy
Variant ๐Of - Convenient alias for the variant (position) used in lazy balance.