1
1
import 'package:bitcoin_base/bitcoin_base.dart' ;
2
2
import 'package:bitcoin_base/src/exception/exception.dart' ;
3
3
import 'package:bitcoin_base/src/utils/enumerate.dart' ;
4
- import 'package:blockchain_utils/bip/coin_conf/coin_conf.dart' ;
5
- import 'package:blockchain_utils/bip/coin_conf/coins_conf.dart' ;
6
4
import 'package:blockchain_utils/blockchain_utils.dart' ;
7
5
8
6
/// Abstract class representing a base for UTXO-based cryptocurrency networks.
@@ -159,10 +157,10 @@ class BitcoinNetwork implements BasedUtxoNetwork {
159
157
@override
160
158
List <BitcoinAddressType > get supportedAddress => [
161
159
P2pkhAddressType .p2pkh,
162
- SegwitAddresType .p2wpkh,
160
+ SegwitAddressType .p2wpkh,
163
161
PubKeyAddressType .p2pk,
164
- SegwitAddresType .p2tr,
165
- SegwitAddresType .p2wsh,
162
+ SegwitAddressType .p2tr,
163
+ SegwitAddressType .p2wsh,
166
164
P2shAddressType .p2wshInP2sh,
167
165
P2shAddressType .p2wpkhInP2sh,
168
166
P2shAddressType .p2pkhInP2sh,
@@ -231,9 +229,9 @@ class LitecoinNetwork implements BasedUtxoNetwork {
231
229
@override
232
230
final List <BitcoinAddressType > supportedAddress = const [
233
231
P2pkhAddressType .p2pkh,
234
- SegwitAddresType .p2wpkh,
232
+ SegwitAddressType .p2wpkh,
235
233
PubKeyAddressType .p2pk,
236
- SegwitAddresType .p2wsh,
234
+ SegwitAddressType .p2wsh,
237
235
P2shAddressType .p2wshInP2sh,
238
236
P2shAddressType .p2wpkhInP2sh,
239
237
P2shAddressType .p2pkhInP2sh,
@@ -501,26 +499,21 @@ class PepeNetwork implements BasedUtxoNetwork {
501
499
class ElectraProtocolNetwork implements BasedUtxoNetwork {
502
500
/// Mainnet configuration with associated `CoinConf` .
503
501
static const ElectraProtocolNetwork mainnet = ElectraProtocolNetwork ._(
504
- "electraProtocolMainnet" ,
505
- CoinsConf .electraProtocolMainNet,
506
- );
502
+ "electraProtocolMainnet" , CoinsConf .electraProtocolMainNet);
507
503
508
504
/// Testnet configuration with associated `CoinConf` .
509
505
static const ElectraProtocolNetwork testnet = ElectraProtocolNetwork ._(
510
- "electraProtocolTestnet" ,
511
- CoinsConf .electraProtocolTestNet,
512
- );
506
+ "electraProtocolTestnet" , CoinsConf .electraProtocolTestNet);
513
507
514
508
/// Overrides the `conf` property from `BasedUtxoNetwork` with the associated `CoinConf` .
515
509
@override
516
510
final CoinConf conf;
517
-
518
- /// Constructor for creating a OmniXEP network with a specific configuration.
519
- const ElectraProtocolNetwork ._(this .value, this .conf);
520
-
521
511
@override
522
512
final String value;
523
513
514
+ /// Constructor for creating a Electra Protocol network with a specific configuration.
515
+ const ElectraProtocolNetwork ._(this .value, this .conf);
516
+
524
517
/// Retrieves the Wallet Import Format (WIF) version bytes from the associated `CoinConf` .
525
518
@override
526
519
List <int > get wifNetVer => conf.params.wifNetVer! ;
@@ -533,7 +526,8 @@ class ElectraProtocolNetwork implements BasedUtxoNetwork {
533
526
@override
534
527
List <int > get p2shNetVer => conf.params.p2shNetVer! ;
535
528
536
- /// Retrieves the Human-Readable Part (HRP) for Pay-to-Witness-Public-Key-Hash (P2WPKH) addresses.
529
+ /// Retrieves the Human-Readable Part (HRP) for Pay-to-Witness-Public-Key-Hash (P2WPKH) addresses
530
+ /// from the associated `CoinConf` .
537
531
@override
538
532
String get p2wpkhHrp => conf.params.p2wpkhHrp! ;
539
533
@@ -543,14 +537,14 @@ class ElectraProtocolNetwork implements BasedUtxoNetwork {
543
537
544
538
@override
545
539
final List <BitcoinAddressType > supportedAddress = const [
546
- PubKeyAddressType .p2pk,
547
540
P2pkhAddressType .p2pkh,
548
- SegwitAddresType .p2wpkh,
549
- SegwitAddresType .p2wsh,
550
- P2shAddressType .p2pkInP2sh,
551
- P2shAddressType .p2pkhInP2sh,
552
- P2shAddressType .p2wpkhInP2sh,
541
+ SegwitAddressType .p2wpkh,
542
+ PubKeyAddressType .p2pk,
543
+ SegwitAddressType .p2wsh,
553
544
P2shAddressType .p2wshInP2sh,
545
+ P2shAddressType .p2wpkhInP2sh,
546
+ P2shAddressType .p2pkhInP2sh,
547
+ P2shAddressType .p2pkInP2sh,
554
548
];
555
549
556
550
@override
@@ -559,13 +553,13 @@ class ElectraProtocolNetwork implements BasedUtxoNetwork {
559
553
return [
560
554
Bip44Coins .electraProtocol,
561
555
Bip49Coins .electraProtocol,
562
- Bip84Coins .electraProtocol,
556
+ Bip84Coins .electraProtocol
563
557
];
564
558
}
565
559
return [
566
560
Bip44Coins .electraProtocolTestnet,
567
561
Bip49Coins .electraProtocolTestnet,
568
- Bip84Coins .electraProtocolTestnet,
562
+ Bip84Coins .electraProtocolTestnet
569
563
];
570
564
}
571
565
}
0 commit comments