mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-16 17:27:39 +00:00
namecoin tweaks
This commit is contained in:
parent
49d5a1eaf2
commit
76aca78dbb
5 changed files with 5113 additions and 5125 deletions
|
@ -14,8 +14,6 @@ import 'package:stackwallet/models/balance.dart';
|
|||
import 'package:stackwallet/models/isar/models/isar_models.dart' as isar_models;
|
||||
import 'package:stackwallet/models/node_model.dart';
|
||||
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
||||
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/particl/particl_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/stellar/stellar_wallet.dart';
|
||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
|
@ -142,15 +140,7 @@ abstract class CoinServiceAPI {
|
|||
throw UnimplementedError("moved");
|
||||
|
||||
case Coin.namecoin:
|
||||
return NamecoinWallet(
|
||||
walletId: walletId,
|
||||
walletName: walletName,
|
||||
coin: coin,
|
||||
secureStore: secureStorageInterface,
|
||||
tracker: tracker,
|
||||
cachedClient: cachedClient,
|
||||
client: client,
|
||||
);
|
||||
throw UnimplementedError("moved");
|
||||
|
||||
case Coin.nano:
|
||||
throw UnimplementedError("moved");
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -45,9 +45,12 @@ class Namecoin extends Bip39HDCurrency {
|
|||
case DerivePathType.bip44:
|
||||
purpose = 44;
|
||||
break;
|
||||
case DerivePathType.bip49:
|
||||
purpose = 49;
|
||||
break;
|
||||
|
||||
// TODO: [prio=low] Add P2SH support. Disable for now as our p2sh was actually p2sh-p2wpkh (wrapped segwit)
|
||||
// case DerivePathType.bip49:
|
||||
// purpose = 49;
|
||||
// break;
|
||||
|
||||
case DerivePathType.bip84:
|
||||
purpose = 84;
|
||||
break;
|
||||
|
@ -103,7 +106,7 @@ class Namecoin extends Bip39HDCurrency {
|
|||
{required coinlib.ECPublicKey publicKey,
|
||||
required DerivePathType derivePathType}) {
|
||||
switch (derivePathType) {
|
||||
// case DerivePathType.bip16: // TODO: [prio=low] Add P2SH support.
|
||||
// case DerivePathType.bip16:
|
||||
|
||||
case DerivePathType.bip44:
|
||||
final addr = coinlib.P2PKHAddress.fromPublicKey(
|
||||
|
@ -113,6 +116,7 @@ class Namecoin extends Bip39HDCurrency {
|
|||
|
||||
return (address: addr, addressType: AddressType.p2pkh);
|
||||
|
||||
// TODO: [prio=low] Add P2SH support. Disable for now as our p2sh was actually p2sh-p2wpkh (wrapped segwit)
|
||||
// case DerivePathType.bip49:
|
||||
|
||||
case DerivePathType.bip84:
|
||||
|
@ -151,8 +155,9 @@ class Namecoin extends Bip39HDCurrency {
|
|||
|
||||
@override
|
||||
List<DerivePathType> get supportedDerivationPathTypes => [
|
||||
// DerivePathType.bip16, // TODO: [prio=low] Add P2SH support.
|
||||
// DerivePathType.bip16,
|
||||
DerivePathType.bip44,
|
||||
// TODO: [prio=low] Add P2SH support. Disable for now as our p2sh was actually p2sh-p2wpkh (wrapped segwit)
|
||||
// DerivePathType.bip49,
|
||||
DerivePathType.bip84,
|
||||
];
|
||||
|
|
|
@ -15,7 +15,6 @@ class NamecoinWallet extends Bip39HDWallet
|
|||
|
||||
NamecoinWallet(CryptoCurrencyNetwork network) : super(Namecoin(network));
|
||||
|
||||
// TODO: double check these filter operations are correct and do not require additional parameters
|
||||
@override
|
||||
FilterOperation? get changeAddressFilterOperation =>
|
||||
FilterGroup.and(standardChangeAddressFilters);
|
||||
|
@ -45,9 +44,17 @@ class NamecoinWallet extends Bip39HDWallet
|
|||
// ===========================================================================
|
||||
|
||||
@override
|
||||
Future<({bool blocked, String? blockedReason, String? utxoLabel})>
|
||||
checkBlockUTXO(Map<String, dynamic> jsonUTXO, String? scriptPubKeyHex,
|
||||
Map<String, dynamic> jsonTX, String? utxoOwnerAddress) async {
|
||||
Future<
|
||||
({
|
||||
bool blocked,
|
||||
String? blockedReason,
|
||||
String? utxoLabel,
|
||||
})> checkBlockUTXO(
|
||||
Map<String, dynamic> jsonUTXO,
|
||||
String? scriptPubKeyHex,
|
||||
Map<String, dynamic> jsonTX,
|
||||
String? utxoOwnerAddress,
|
||||
) async {
|
||||
// Namecoin doesn't have special outputs like tokens, ordinals, etc.
|
||||
return (blocked: false, blockedReason: null, utxoLabel: null);
|
||||
}
|
||||
|
@ -72,7 +79,7 @@ class NamecoinWallet extends Bip39HDWallet
|
|||
Future<void> updateTransactions() async {
|
||||
final currentChainHeight = await fetchChainHeight();
|
||||
|
||||
// TODO: [prio=low] switch to V2 transactions.
|
||||
// TODO: [prio=high] switch to V2 transactions.
|
||||
final data = await fetchTransactionsV1(
|
||||
addresses: await fetchAddressesForElectrumXScan(),
|
||||
currentChainHeight: currentChainHeight,
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue