localStorage.dart 1.1 KB

12345678910111213141516171819202122232425262728
  1. import 'package:get_storage/get_storage.dart';
  2. const String sdk_storage_key = 'polka_wallet_sdk';
  3. const String sdk_evm_storage_key = 'polka_wallet_sdk_evm';
  4. /// this is where we save keyPairs locally
  5. class KeyringStorage {
  6. static final _storage = () => GetStorage(sdk_storage_key);
  7. final keyPairs = [].val('keyPairs', getBox: _storage);
  8. final contacts = [].val('contacts', getBox: _storage);
  9. final ReadWriteValue<String?> currentPubKey =
  10. ''.val('currentPubKey', getBox: _storage);
  11. final encryptedRawSeeds = {}.val('encryptedRawSeeds', getBox: _storage);
  12. final encryptedMnemonics = {}.val('encryptedMnemonics', getBox: _storage);
  13. }
  14. class KeyringEVMStorage {
  15. static final _storage = () => GetStorage(sdk_evm_storage_key);
  16. final keyPairs = [].val('keyPairs', getBox: _storage);
  17. final contacts = [].val('contacts', getBox: _storage);
  18. final ReadWriteValue<String?> currentAddress =
  19. ''.val('currentAddress', getBox: _storage);
  20. final encryptedPrivateKeys = {}.val('encryptedPrivateKeys', getBox: _storage);
  21. final encryptedMnemonics = {}.val('encryptedMnemonics', getBox: _storage);
  22. }