| 1 | import 'package:cw_core/hardware/hardware_account_data.dart'; |
| 2 | import 'package:cw_core/wallet_credentials.dart'; |
| 3 | import 'package:cw_core/wallet_info.dart'; |
| 4 | |
| 5 | class BitcoinNewWalletCredentials extends WalletCredentials { |
| 6 | BitcoinNewWalletCredentials({ |
| 7 | required String name, |
| 8 | WalletInfo? walletInfo, |
| 9 | String? password, |
| 10 | DerivationType? derivationType, |
| 11 | String? derivationPath, |
| 12 | String? passphrase, |
| 13 | this.mnemonic, |
| 14 | }) : super( |
| 15 | name: name, |
| 16 | walletInfo: walletInfo, |
| 17 | password: password, |
| 18 | passphrase: passphrase, |
| 19 | derivationInfo: DerivationInfo( |
| 20 | derivationType: derivationType, |
| 21 | derivationPath: derivationPath, |
| 22 | ), |
| 23 | ); |
| 24 | |
| 25 | final String? mnemonic; |
| 26 | } |
| 27 | |
| 28 | class BitcoinRestoreWalletFromSeedCredentials extends WalletCredentials { |
| 29 | BitcoinRestoreWalletFromSeedCredentials({ |
| 30 | required String name, |
| 31 | required String password, |
| 32 | required this.mnemonic, |
| 33 | WalletInfo? walletInfo, |
| 34 | required DerivationType derivationType, |
| 35 | required String derivationPath, |
| 36 | String? passphrase, |
| 37 | }) : super( |
| 38 | name: name, |
| 39 | password: password, |
| 40 | passphrase: passphrase, |
| 41 | walletInfo: walletInfo, |
| 42 | derivationInfo: DerivationInfo( |
| 43 | derivationType: derivationType, |
| 44 | derivationPath: derivationPath, |
| 45 | )); |
| 46 | |
| 47 | final String mnemonic; |
| 48 | } |
| 49 | |
| 50 | class BitcoinRestoreWalletFromWIFCredentials extends WalletCredentials { |
| 51 | BitcoinRestoreWalletFromWIFCredentials({ |
| 52 | required String name, |
| 53 | required String password, |
| 54 | required this.wif, |
| 55 | WalletInfo? walletInfo, |
| 56 | }) : super(name: name, password: password, walletInfo: walletInfo); |
| 57 | |
| 58 | final String wif; |
| 59 | } |
| 60 | |
| 61 | class BitcoinWalletFromKeysCredentials extends WalletCredentials { |
| 62 | BitcoinWalletFromKeysCredentials( |
| 63 | {required String name, |
| 64 | required String password, |
| 65 | required this.xpub, |
| 66 | WalletInfo? walletInfo, |
| 67 | super.hardwareWalletType}) |
| 68 | : super(name: name, password: password, walletInfo: walletInfo); |
| 69 | |
| 70 | final String xpub; |
| 71 | } |
| 72 | |
| 73 | class LitecoinWalletFromKeysCredentials extends WalletCredentials { |
| 74 | LitecoinWalletFromKeysCredentials( |
| 75 | {required String name, |
| 76 | required String password, |
| 77 | required this.xpub, |
| 78 | required this.scanSecret, |
| 79 | required this.spendPubkey, |
| 80 | WalletInfo? walletInfo, |
| 81 | super.hardwareWalletType}) |
| 82 | : super(name: name, password: password, walletInfo: walletInfo); |
| 83 | |
| 84 | final String xpub; |
| 85 | final String scanSecret; |
| 86 | final String spendPubkey; |
| 87 | } |
| 88 | |
| 89 | class BitcoinRestoreWalletFromHardware extends WalletCredentials { |
| 90 | BitcoinRestoreWalletFromHardware({ |
| 91 | required String name, |
| 92 | required this.hwAccountData, |
| 93 | WalletInfo? walletInfo, |
| 94 | }) : super(name: name, walletInfo: walletInfo); |
| 95 | |
| 96 | final HardwareAccountData hwAccountData; |
| 97 | } |