This commit is contained in:
Matthew Fosse 2024-03-04 15:19:44 -08:00
parent b8f4c07d6f
commit 660e3ec427
2 changed files with 26 additions and 27 deletions

View file

@ -31,19 +31,28 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
Map<String, int>? initialRegularAddressIndex,
Map<String, int>? initialChangeAddressIndex,
}) : super(
mnemonic: mnemonic,
password: password,
walletInfo: walletInfo,
unspentCoinsInfo: unspentCoinsInfo,
networkType: networkParam == null
? bitcoin.bitcoin
: networkParam == BitcoinNetwork.mainnet
? bitcoin.bitcoin
: bitcoin.testnet,
initialAddresses: initialAddresses,
initialBalance: initialBalance,
seedBytes: seedBytes,
currency: CryptoCurrency.btc) {
mnemonic: mnemonic,
password: password,
walletInfo: walletInfo,
unspentCoinsInfo: unspentCoinsInfo,
networkType: networkParam == null
? bitcoin.bitcoin
: networkParam == BitcoinNetwork.mainnet
? bitcoin.bitcoin
: bitcoin.testnet,
initialAddresses: initialAddresses,
initialBalance: initialBalance,
seedBytes: seedBytes,
currency: CryptoCurrency.btc,
balanceFactory: (
{required int confirmed, required int unconfirmed, required int frozen}) {
return ElectrumBalance(
confirmed: confirmed,
unconfirmed: unconfirmed,
frozen: frozen,
);
},
) {
walletAddresses = BitcoinWalletAddresses(
walletInfo,
electrumClient: electrumClient,
@ -109,4 +118,4 @@ abstract class BitcoinWalletBase extends ElectrumWallet with Store {
networkParam: snp.network,
);
}
}
}

View file

@ -32,15 +32,6 @@ part 'lightning_wallet.g.dart';
class LightningWallet = LightningWalletBase with _$LightningWallet;
ElectrumBalance myBalanceFactory(
{required int confirmed, required int unconfirmed, required int frozen}) {
return ElectrumBalance(
confirmed: confirmed,
unconfirmed: unconfirmed,
frozen: frozen,
);
}
abstract class LightningWalletBase
extends ElectrumWalletBase<LightningBalance, LightningTransactionInfo> with Store {
bool _isTransactionUpdating;
@ -72,13 +63,12 @@ abstract class LightningWalletBase
initialBalance: initialBalance,
seedBytes: seedBytes,
currency: CryptoCurrency.btcln,
// balanceFactory: myBalanceFactory,
balanceFactory: (
{required int confirmed, required int unconfirmed, required int frozen}) {
return LightningBalance(
confirmed: 0,
unconfirmed: 0,
frozen: 0,
confirmed: confirmed,
unconfirmed: unconfirmed,
frozen: frozen,
);
},
) {