2021-12-24 12:52:08 +00:00
|
|
|
import 'package:bitcoin_flutter/bitcoin_flutter.dart' as bitcoin;
|
2022-01-18 16:27:33 +00:00
|
|
|
import 'package:cw_bitcoin/electrum.dart';
|
2021-12-24 12:52:08 +00:00
|
|
|
import 'package:cw_bitcoin/utils.dart';
|
|
|
|
import 'package:cw_bitcoin/bitcoin_address_record.dart';
|
|
|
|
import 'package:cw_bitcoin/electrum_wallet_addresses.dart';
|
|
|
|
import 'package:cw_core/wallet_info.dart';
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
import 'package:mobx/mobx.dart';
|
|
|
|
|
|
|
|
part 'litecoin_wallet_addresses.g.dart';
|
|
|
|
|
|
|
|
class LitecoinWalletAddresses = LitecoinWalletAddressesBase
|
|
|
|
with _$LitecoinWalletAddresses;
|
|
|
|
|
|
|
|
abstract class LitecoinWalletAddressesBase extends ElectrumWalletAddresses
|
|
|
|
with Store {
|
|
|
|
LitecoinWalletAddressesBase(
|
|
|
|
WalletInfo walletInfo,
|
|
|
|
{@required List<BitcoinAddressRecord> initialAddresses,
|
2022-01-18 16:27:33 +00:00
|
|
|
int initialRegularAddressIndex = 0,
|
|
|
|
int initialChangeAddressIndex = 0,
|
|
|
|
ElectrumClient electrumClient,
|
2021-12-24 12:52:08 +00:00
|
|
|
@required bitcoin.HDWallet mainHd,
|
|
|
|
@required bitcoin.HDWallet sideHd,
|
2022-01-18 16:27:33 +00:00
|
|
|
@required bitcoin.NetworkType networkType})
|
2021-12-24 12:52:08 +00:00
|
|
|
: super(
|
|
|
|
walletInfo,
|
|
|
|
initialAddresses: initialAddresses,
|
2022-01-18 16:27:33 +00:00
|
|
|
initialRegularAddressIndex: initialRegularAddressIndex,
|
|
|
|
initialChangeAddressIndex: initialChangeAddressIndex,
|
2021-12-24 12:52:08 +00:00
|
|
|
mainHd: mainHd,
|
2022-01-18 16:27:33 +00:00
|
|
|
sideHd: sideHd,
|
|
|
|
electrumClient: electrumClient,
|
|
|
|
networkType: networkType);
|
2021-12-24 12:52:08 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
String getAddress({@required int index, @required bitcoin.HDWallet hd}) =>
|
|
|
|
generateP2WPKHAddress(hd: hd, index: index, networkType: networkType);
|
|
|
|
}
|