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

102 lines
2.4 KiB
Dart
Raw Normal View History

2023-11-15 21:59:01 +00:00
import 'package:nanodart/nanodart.dart';
import '../../../models/isar/models/blockchain_data/address.dart';
import '../../../models/node_model.dart';
import '../../../utilities/default_nodes.dart';
import '../../../utilities/enums/derive_path_type_enum.dart';
import '../crypto_currency.dart';
import '../intermediate/nano_currency.dart';
2023-11-15 21:59:01 +00:00
class Banano extends NanoCurrency {
Banano(super.network) {
switch (network) {
case CryptoCurrencyNetwork.main:
2024-05-15 21:20:45 +00:00
_id = "banano";
_idMain = "banano";
_name = "Banano";
_uriScheme = "ban";
_ticker = "BAN";
2023-11-15 21:59:01 +00:00
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
int get fractionDigits => 29;
@override
BigInt get satsPerCoin => BigInt.parse(
"100000000000000000000000000000",
); // 1*10^29
2023-11-15 21:59:01 +00:00
@override
int get minConfirms => 1;
2024-05-15 21:20:45 +00:00
@override
AddressType get primaryAddressType => AddressType.banano;
2023-11-15 21:59:01 +00:00
@override
String get defaultRepresentative =>
"ban_1ka1ium4pfue3uxtntqsrib8mumxgazsjf58gidh1xeo5te3whsq8z476goo";
@override
int get nanoAccountType => NanoAccountType.BANANO;
@override
NodeModel get defaultNode {
switch (network) {
case CryptoCurrencyNetwork.main:
return NodeModel(
host: "https://kaliumapi.appditto.com/api",
port: 443,
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,
);
default:
throw UnimplementedError();
}
}
@override
2024-05-15 21:20:45 +00:00
Uri defaultBlockExplorer(String txid) {
switch (network) {
case CryptoCurrencyNetwork.main:
return Uri.parse("https://www.bananolooker.com/block/$txid");
default:
throw Exception(
"Unsupported network for defaultBlockExplorer(): $network",
);
}
}
@override
2024-05-15 21:20:45 +00:00
DerivePathType get primaryDerivePathType => throw UnsupportedError(
"$runtimeType does not use bitcoin style derivation paths",
);
2023-11-15 21:59:01 +00:00
}