WIP: Update namecoin network

This commit is contained in:
Likho 2022-09-13 12:58:04 +02:00
parent 1419023ec9
commit 567d549747
5 changed files with 10 additions and 9 deletions

View file

@ -2250,7 +2250,7 @@ class BitcoinWallet extends CoinServiceAPI {
batches[batchNumber] = {};
}
final scripthash = _convertToScriptHash(allAddresses[i], _network);
final id = const Uuid().v1();
final id = Logger.isTestEnv ? "$i" : const Uuid().v1();
requestIdToAddressMap[id] = allAddresses[i];
batches[batchNumber]!.addAll({
id: [scripthash]

View file

@ -1875,7 +1875,7 @@ class BitcoinCashWallet extends CoinServiceAPI {
batches[batchNumber] = {};
}
final scripthash = _convertToScriptHash(allAddresses[i], _network);
final id = const Uuid().v1();
final id = Logger.isTestEnv ? "$i" : const Uuid().v1();
requestIdToAddressMap[id] = allAddresses[i];
batches[batchNumber]!.addAll({
id: [scripthash]

View file

@ -1914,7 +1914,7 @@ class DogecoinWallet extends CoinServiceAPI {
batches[batchNumber] = {};
}
final scripthash = _convertToScriptHash(allAddresses[i], _network);
final id = const Uuid().v1();
final id = Logger.isTestEnv ? "$i" : const Uuid().v1();
requestIdToAddressMap[id] = allAddresses[i];
batches[batchNumber]!.addAll({
id: [scripthash]

View file

@ -75,7 +75,7 @@ bip32.BIP32 getBip32NodeFromRoot(
int chain, int index, bip32.BIP32 root, DerivePathType derivePathType) {
String coinType;
switch (root.network.wif) {
case 0x80: // nmc mainnet wif
case 0xb4: // nmc mainnet wif
coinType = "7"; // nmc mainnet
break;
default:
@ -159,6 +159,7 @@ class NamecoinWallet extends CoinServiceAPI {
@override
Future<Decimal> get availableBalance async {
final data = await utxoData;
print("DATA IN GET BALANCE IS $data");
return Format.satoshisToAmount(
data.satoshiBalance - data.satoshiBalanceUnconfirmed);
}
@ -3027,9 +3028,9 @@ class NamecoinWallet extends CoinServiceAPI {
// Namecoin Network
final namecoin = NetworkType(
messagePrefix: '\x18Bitcoin Signed Message:\n',
messagePrefix: '\x18Namecoin Signed Message:\n',
bech32: 'bc',
bip32: Bip32Type(public: 0x0488b21e, private: 0x0488ade4),
pubKeyHash: 0x00,
scriptHash: 0x05,
wif: 0x80);
pubKeyHash: 0x34, //From 52
scriptHash: 0x0d, //13
wif: 0xb4); //from 180

View file

@ -79,7 +79,7 @@ class PriceAPI {
Map<Coin, Tuple2<Decimal, double>> result = {};
try {
final uri = Uri.parse(
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=${baseCurrency.toLowerCase()}&ids=monero,bitcoin,epic-cash,zcoin,dogecoin,bitcoin-cash&order=market_cap_desc&per_page=10&page=1&sparkline=false");
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=${baseCurrency.toLowerCase()}&ids=monero,bitcoin,epic-cash,zcoin,dogecoin,bitcoin-cash,namecoin&order=market_cap_desc&per_page=10&page=1&sparkline=false");
// final uri = Uri.parse(
// "https://api.coingecko.com/api/v3/coins/markets?vs_currency=${baseCurrency.toLowerCase()}&ids=monero%2Cbitcoin%2Cepic-cash%2Czcoin%2Cdogecoin&order=market_cap_desc&per_page=10&page=1&sparkline=false");