mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-21 22:58:49 +00:00
save frost keys and config in otherDataJsonString during SWB creation
This commit is contained in:
parent
0f73f76216
commit
8ba98d573c
1 changed files with 11 additions and 0 deletions
|
@ -42,6 +42,7 @@ import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/prefs.dart';
|
import 'package:stackwallet/utilities/prefs.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
||||||
|
import 'package:stackwallet/wallets/wallet/impl/bitcoin_frost_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/impl/epiccash_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/impl/epiccash_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cw_based_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cw_based_interface.dart';
|
||||||
|
@ -302,6 +303,16 @@ abstract class SWB {
|
||||||
await wallet.getMnemonicPassphrase();
|
await wallet.getMnemonicPassphrase();
|
||||||
} else if (wallet is PrivateKeyInterface) {
|
} else if (wallet is PrivateKeyInterface) {
|
||||||
backupWallet['privateKey'] = await wallet.getPrivateKey();
|
backupWallet['privateKey'] = await wallet.getPrivateKey();
|
||||||
|
} else if (wallet is BitcoinFrostWallet) {
|
||||||
|
String? keys = await wallet.getSerializedKeys();
|
||||||
|
String? config = await wallet.getMultisigConfig();
|
||||||
|
// TODO handle case in which either keys or config is null.
|
||||||
|
|
||||||
|
// Format keys and config as a JSON string and set otherDataJsonString.
|
||||||
|
Map<String, dynamic> otherData = {};
|
||||||
|
otherData["keys"] = keys;
|
||||||
|
otherData["config"] = config;
|
||||||
|
backupWallet['otherDataJsonString'] = jsonEncode(otherData);
|
||||||
}
|
}
|
||||||
backupWallet['coinName'] = wallet.info.coin.name;
|
backupWallet['coinName'] = wallet.info.coin.name;
|
||||||
backupWallet['storedChainHeight'] = wallet.info.cachedChainHeight;
|
backupWallet['storedChainHeight'] = wallet.info.cachedChainHeight;
|
||||||
|
|
Loading…
Reference in a new issue