stack_wallet/lib/utilities/block_explorers.dart
julian 056fa1947c Merge remote-tracking branch 'origin/staging' into add-ethereum
# Conflicts:
#	lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart
#	lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart
#	lib/pages/wallet_view/wallet_view.dart
#	lib/services/price.dart
#	lib/utilities/assets.dart
#	pubspec.lock
#	pubspec.yaml
2023-02-14 08:24:04 -06:00

43 lines
1.7 KiB
Dart

import 'package:stackwallet/utilities/enums/coin_enum.dart';
Uri getBlockExplorerTransactionUrlFor({
required Coin coin,
required String txid,
}) {
switch (coin) {
case Coin.bitcoin:
return Uri.parse("https://chain.so/tx/BTC/$txid");
case Coin.litecoin:
return Uri.parse("https://chain.so/tx/LTC/$txid");
case Coin.litecoinTestNet:
return Uri.parse("https://chain.so/tx/LTCTEST/$txid");
case Coin.bitcoinTestNet:
return Uri.parse("https://chain.so/tx/BTCTEST/$txid");
case Coin.dogecoin:
return Uri.parse("https://chain.so/tx/DOGE/$txid");
case Coin.dogecoinTestNet:
return Uri.parse("https://chain.so/tx/DOGETEST/$txid");
case Coin.epicCash:
// TODO: Handle this case.
throw UnimplementedError("missing block explorer for epic cash");
case Coin.ethereum:
return Uri.parse("https://etherscan.io/tx/$txid");
case Coin.monero:
return Uri.parse("https://xmrchain.net/tx/$txid");
case Coin.wownero:
return Uri.parse("https://explore.wownero.com/search?value=$txid");
case Coin.firo:
return Uri.parse("https://explorer.firo.org/tx/$txid");
case Coin.firoTestNet:
return Uri.parse("https://testexplorer.firo.org/tx/$txid");
case Coin.bitcoincash:
return Uri.parse("https://blockchair.com/bitcoin-cash/transaction/$txid");
case Coin.bitcoincashTestnet:
return Uri.parse(
"https://blockexplorer.one/bitcoin-cash/testnet/tx/$txid");
case Coin.namecoin:
return Uri.parse("https://chainz.cryptoid.info/nmc/tx.dws?$txid.htm");
case Coin.particl:
return Uri.parse("https://chainz.cryptoid.info/part/tx.dws?$txid.htm");
}
}