2023-11-06 21:37:18 +00:00
|
|
|
import 'package:cw_wownero/api/wallet.dart' as wownero_wallet;
|
2023-11-17 01:44:17 +00:00
|
|
|
import 'package:stackwallet/models/node_model.dart';
|
|
|
|
import 'package:stackwallet/utilities/default_nodes.dart';
|
|
|
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
|
|
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
2023-11-06 18:26:33 +00:00
|
|
|
import 'package:stackwallet/wallets/crypto_currency/intermediate/cryptonote_currency.dart';
|
|
|
|
|
|
|
|
class Wownero extends CryptonoteCurrency {
|
2023-11-17 01:44:17 +00:00
|
|
|
Wownero(super.network) {
|
|
|
|
switch (network) {
|
|
|
|
case CryptoCurrencyNetwork.main:
|
|
|
|
coin = Coin.wownero;
|
|
|
|
default:
|
|
|
|
throw Exception("Unsupported network: $network");
|
|
|
|
}
|
|
|
|
}
|
2023-11-06 18:26:33 +00:00
|
|
|
|
|
|
|
@override
|
2023-11-06 21:37:18 +00:00
|
|
|
int get minConfirms => 15;
|
2023-11-06 18:26:33 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool validateAddress(String address) {
|
2023-11-06 21:37:18 +00:00
|
|
|
return wownero_wallet.validateAddress(address);
|
2023-11-06 18:26:33 +00:00
|
|
|
}
|
2023-11-17 01:44:17 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
NodeModel get defaultNode {
|
|
|
|
switch (network) {
|
|
|
|
case CryptoCurrencyNetwork.main:
|
|
|
|
return NodeModel(
|
|
|
|
host: "https://wownero.stackwallet.com",
|
|
|
|
port: 34568,
|
|
|
|
name: DefaultNodes.defaultName,
|
|
|
|
id: DefaultNodes.buildId(Coin.wownero),
|
|
|
|
useSSL: true,
|
|
|
|
enabled: true,
|
|
|
|
coinName: Coin.wownero.name,
|
|
|
|
isFailover: true,
|
|
|
|
isDown: false,
|
|
|
|
trusted: true,
|
|
|
|
);
|
|
|
|
|
|
|
|
default:
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
}
|
2024-04-17 18:04:10 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
return other is Wownero && other.network == network;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => Object.hash(Wownero, network);
|
2023-11-06 18:26:33 +00:00
|
|
|
}
|