2022-08-26 08:11:35 +00:00
|
|
|
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.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.monero:
|
|
|
|
return Uri.parse("https://xmrchain.net/tx/$txid");
|
2022-09-27 08:09:31 +00:00
|
|
|
case Coin.wownero:
|
|
|
|
return Uri.parse("https://explore.wownero.com/search?value=$txid");
|
2022-08-26 08:11:35 +00:00
|
|
|
case Coin.firo:
|
|
|
|
return Uri.parse("https://explorer.firo.org/tx/$txid");
|
|
|
|
case Coin.firoTestNet:
|
|
|
|
return Uri.parse("https://testexplorer.firo.org/tx/$txid");
|
2022-09-26 20:32:53 +00:00
|
|
|
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");
|
2022-09-23 21:02:53 +00:00
|
|
|
case Coin.namecoin:
|
|
|
|
return Uri.parse("https://chainz.cryptoid.info/nmc/tx.dws?$txid.htm");
|
2022-08-26 08:11:35 +00:00
|
|
|
}
|
|
|
|
}
|