Simple token balance manager that uses localStorage to store transactions.
To do this, this class the list of all transactions and their corresponding amounts.
When a transaction is added, it is added to the list.
When a transaction is removed, it is removed from the list.
The balance is the sum of all the amounts in the list.
See
IapticProductDefinition.tokenType
IapticProductDefinition.tokenValue
Example
consttokensManager = newIapticTokensManager(iaptic); // ... tokensManager is now tracking consumable purchases that have a tokenType defined. constbalance = tokensManager.getBalance('coin');
Simple token balance manager that uses localStorage to store transactions.
To do this, this class the list of all transactions and their corresponding amounts.
When a transaction is added, it is added to the list. When a transaction is removed, it is removed from the list.
The balance is the sum of all the amounts in the list.
See
Example