diff --git a/lib/db/hive/db.dart b/lib/db/hive/db.dart index 5c4f252e6..9f73a4962 100644 --- a/lib/db/hive/db.dart +++ b/lib/db/hive/db.dart @@ -253,4 +253,5 @@ abstract class DBKeys { static const String isFavorite = "isFavorite"; static const String id = "id"; static const String storedChainHeight = "storedChainHeight"; + static const String ethTokenContracts = "ethTokenContracts"; } diff --git a/lib/services/mixins/wallet_cache.dart b/lib/services/mixins/wallet_cache.dart index 7d859e74c..b5c4e2e75 100644 --- a/lib/services/mixins/wallet_cache.dart +++ b/lib/services/mixins/wallet_cache.dart @@ -112,4 +112,22 @@ mixin WalletCache { value: balance.toJsonIgnoreCoin(), ); } + + // Ethereum specific + List getWalletTokenContractAddresses() { + return DB.instance.get( + boxName: _walletId, + key: DBKeys.ethTokenContracts, + ) as List? ?? + []; + } + + Future updateWalletTokenContractAddresses( + List contractAddresses) async { + await DB.instance.put( + boxName: _walletId, + key: DBKeys.ethTokenContracts, + value: contractAddresses, + ); + } }