stack_wallet/lib/wallets/crypto_currency/coins/wownero.dart

110 lines
2.7 KiB
Dart
Raw Normal View History

2023-11-06 21:37:18 +00:00
import 'package:cw_wownero/api/wallet.dart' as wownero_wallet;
import 'package:stackwallet/models/node_model.dart';
import 'package:stackwallet/utilities/default_nodes.dart';
2024-05-15 21:20:45 +00:00
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
import 'package:stackwallet/wallets/crypto_currency/intermediate/cryptonote_currency.dart';
class Wownero extends CryptonoteCurrency {
Wownero(super.network) {
2024-05-15 21:20:45 +00:00
_idMain = "wownero";
_uriScheme = "wownero";
switch (network) {
case CryptoCurrencyNetwork.main:
2024-05-15 21:20:45 +00:00
_id = _idMain;
_name = "Wownero";
_ticker = "WOW";
default:
throw Exception("Unsupported network: $network");
}
}
2024-05-15 21:20:45 +00:00
late final String _id;
@override
String get identifier => _id;
late final String _idMain;
@override
String get mainNetId => _idMain;
late final String _name;
@override
String get prettyName => _name;
late final String _uriScheme;
@override
String get uriScheme => _uriScheme;
late final String _ticker;
@override
String get ticker => _ticker;
@override
2023-11-06 21:37:18 +00:00
int get minConfirms => 15;
@override
bool validateAddress(String address) {
2023-11-06 21:37:18 +00:00
return wownero_wallet.validateAddress(address);
}
@override
NodeModel get defaultNode {
switch (network) {
case CryptoCurrencyNetwork.main:
return NodeModel(
host: "https://wownero.stackwallet.com",
port: 34568,
name: DefaultNodes.defaultName,
2024-05-15 21:20:45 +00:00
id: DefaultNodes.buildId(this),
useSSL: true,
enabled: true,
2024-05-15 21:20:45 +00:00
coinName: identifier,
isFailover: true,
isDown: false,
trusted: true,
);
default:
throw UnimplementedError();
}
}
@override
2024-05-15 21:20:45 +00:00
int get defaultSeedPhraseLength => 14;
@override
int get fractionDigits => 11;
@override
bool get hasBuySupport => false;
@override
2024-05-15 21:20:45 +00:00
bool get hasMnemonicPassphraseSupport => false;
@override
List<int> get possibleMnemonicLengths => [defaultSeedPhraseLength, 25];
@override
BigInt get satsPerCoin => BigInt.from(100000000000);
@override
int get targetBlockTimeSeconds => 120;
@override
DerivePathType get primaryDerivePathType => throw UnsupportedError(
"$runtimeType does not use bitcoin style derivation paths",
);
@override
Uri defaultBlockExplorer(String txid) {
switch (network) {
case CryptoCurrencyNetwork.main:
return Uri.parse("https://explore.wownero.com/search?value=$txid");
default:
throw Exception(
"Unsupported network for defaultBlockExplorer(): $network",
);
}
}
}