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