You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deftoken_add(self, token_hash: UInt160) ->bool:
# true if added, false if already existsdeftoken_delete(self, token_hash: UInt160) ->bool:
# true if deleted, false if failed if not founddeftoken_delete_by_name(self, token_name: str) ->bool:
# true if deleted, false if e.g. not found
My current view is that a Wallet is merely as a container holding Accounts. Therefore adding these functions to account means an Account is associated with 0 or more tokens. There can be helpers for Wallet to aggregate balances of a certain token in all available accounts, but that is beyond the scope. The extra field of the Account can be used for storing the token hashes when exporting.
The text was updated successfully, but these errors were encountered:
The alternative is to add these functions to Wallet. The upside is that from a wallet you do a single import/add/delete. The downside is you're forced to use a Wallet and it has to search all accounts for balance every time, even though you might know certain accounts will never have any.
How should the token_delete_by_name(self, token_name: str) method be implemented? Currently, the only way to add a token is using token_add(self, token_hash: UInt160).
from #80 (comment)
My current view is that a
Wallet
is merely as a container holdingAccount
s. Therefore adding these functions to account means anAccount
is associated with 0 or more tokens. There can be helpers forWallet
to aggregate balances of a certain token in all available accounts, but that is beyond the scope. Theextra
field of theAccount
can be used for storing the token hashes when exporting.The text was updated successfully, but these errors were encountered: