Balances
Balance Interface
export interface Balance<T extends NumberType> {
amount: T;
tokenIds: UintRange<T>[];
ownershipTimes: UintRange<T>[];
}Interpreting Balances
Interpretation Algorithm
for (balance of balances) {
for (tokenIdRange of balance.tokenIds) {
for (ownershipTimeRange of balance.ownershipTimes) {
// User owns x(balance.amount) of (tokenIdRange) for the times (ownershipTimeRange)
}
}
}Example
Balance Subtraction
Handling Duplicates
Best Practices
Last updated