mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
store user added token contracts in wallet hive box for now
This commit is contained in:
parent
e99ef7497c
commit
b1d5b7f6ea
2 changed files with 19 additions and 0 deletions
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -112,4 +112,22 @@ mixin WalletCache {
|
|||
value: balance.toJsonIgnoreCoin(),
|
||||
);
|
||||
}
|
||||
|
||||
// Ethereum specific
|
||||
List<String> getWalletTokenContractAddresses() {
|
||||
return DB.instance.get<dynamic>(
|
||||
boxName: _walletId,
|
||||
key: DBKeys.ethTokenContracts,
|
||||
) as List<String>? ??
|
||||
[];
|
||||
}
|
||||
|
||||
Future<void> updateWalletTokenContractAddresses(
|
||||
List<String> contractAddresses) async {
|
||||
await DB.instance.put<dynamic>(
|
||||
boxName: _walletId,
|
||||
key: DBKeys.ethTokenContracts,
|
||||
value: contractAddresses,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue