@@ -73,13 +73,21 @@ var fixedURLWhitelist = []string{
73
73
"https://shiftcrypto.support/" ,
74
74
// Exchange rates.
75
75
"https://www.coingecko.com/" ,
76
- // Block explorers.
76
+ // Block explorers (btc) .
77
77
"https://blockstream.info/tx/" ,
78
78
"https://blockstream.info/testnet/tx/" ,
79
+ "https://mempool.space/tx/" ,
80
+ "https://mempool.space/testnet/tx/" ,
81
+ // Block explorers (ltc).
79
82
"https://sochain.com/tx/LTCTEST/" ,
80
83
"https://blockchair.com/litecoin/transaction/" ,
84
+ // Block explorers (eth).
81
85
"https://etherscan.io/tx/" ,
82
86
"https://goerli.etherscan.io/tx/" ,
87
+ "https://sepolia.etherscan.io/tx/" ,
88
+ "https://ethplorer.io/tx/" ,
89
+ "https://goerli.ethplorer.io/tx/" ,
90
+ "https://sepolia.ethplorer.io/tx/" ,
83
91
// Moonpay onramp
84
92
"https://www.moonpay.com/" ,
85
93
"https://support.moonpay.com/" ,
@@ -485,43 +493,51 @@ func (backend *Backend) Coin(code coinpkg.Code) (coinpkg.Coin, error) {
485
493
servers := backend .defaultElectrumXServers (code )
486
494
coin = btc .NewCoin (coinpkg .CodeRBTC , "Bitcoin Regtest" , "RBTC" , coinpkg .BtcUnitDefault , & chaincfg .RegressionNetParams , dbFolder , servers , "" , backend .socksProxy )
487
495
case code == coinpkg .CodeTBTC :
496
+ blockExplorerPrefix := backend .config .AppConfig ().Backend .TBTC .BlockExplorerTxPrefix
488
497
servers := backend .defaultElectrumXServers (code )
489
498
coin = btc .NewCoin (coinpkg .CodeTBTC , "Bitcoin Testnet" , "TBTC" , btcFormatUnit , & chaincfg .TestNet3Params , dbFolder , servers ,
490
- "https://blockstream.info/testnet/tx/" , backend .socksProxy )
499
+ blockExplorerPrefix , backend .socksProxy )
491
500
case code == coinpkg .CodeBTC :
501
+ blockExplorerPrefix := backend .config .AppConfig ().Backend .BTC .BlockExplorerTxPrefix
492
502
servers := backend .defaultElectrumXServers (code )
493
503
coin = btc .NewCoin (coinpkg .CodeBTC , "Bitcoin" , "BTC" , btcFormatUnit , & chaincfg .MainNetParams , dbFolder , servers ,
494
- "https://blockstream.info/tx/" , backend .socksProxy )
504
+ blockExplorerPrefix , backend .socksProxy )
495
505
case code == coinpkg .CodeTLTC :
506
+ blockExplorerPrefix := backend .config .AppConfig ().Backend .TLTC .BlockExplorerTxPrefix
496
507
servers := backend .defaultElectrumXServers (code )
497
508
coin = btc .NewCoin (coinpkg .CodeTLTC , "Litecoin Testnet" , "TLTC" , coinpkg .BtcUnitDefault , & ltc .TestNet4Params , dbFolder , servers ,
498
- "https://sochain.com/tx/LTCTEST/" , backend .socksProxy )
509
+ blockExplorerPrefix , backend .socksProxy )
499
510
case code == coinpkg .CodeLTC :
511
+ blockExplorerPrefix := backend .config .AppConfig ().Backend .LTC .BlockExplorerTxPrefix
500
512
servers := backend .defaultElectrumXServers (code )
501
513
coin = btc .NewCoin (coinpkg .CodeLTC , "Litecoin" , "LTC" , coinpkg .BtcUnitDefault , & ltc .MainNetParams , dbFolder , servers ,
502
- "https://blockchair.com/litecoin/transaction/" , backend .socksProxy )
514
+ blockExplorerPrefix , backend .socksProxy )
503
515
case code == coinpkg .CodeETH :
516
+ blockExplorerPrefix := backend .config .AppConfig ().Backend .ETH .BlockExplorerTxPrefix
504
517
etherScan := etherscan .NewEtherScan ("https://api.etherscan.io/api" , backend .etherScanHTTPClient )
505
518
coin = eth .NewCoin (etherScan , code , "Ethereum" , "ETH" , "ETH" , params .MainnetChainConfig ,
506
- "https://etherscan.io/tx/" ,
519
+ blockExplorerPrefix ,
507
520
etherScan ,
508
521
nil )
509
522
case code == coinpkg .CodeGOETH :
523
+ blockExplorerPrefix := backend .config .AppConfig ().Backend .GOETH .BlockExplorerTxPrefix
510
524
etherScan := etherscan .NewEtherScan ("https://api-goerli.etherscan.io/api" , backend .etherScanHTTPClient )
511
525
coin = eth .NewCoin (etherScan , code , "Ethereum Goerli" , "GOETH" , "GOETH" , params .GoerliChainConfig ,
512
- "https://goerli.etherscan.io/tx/" ,
526
+ blockExplorerPrefix ,
513
527
etherScan ,
514
528
nil )
515
529
case code == coinpkg .CodeSEPETH :
530
+ blockExplorerPrefix := backend .config .AppConfig ().Backend .SEPETH .BlockExplorerTxPrefix
516
531
etherScan := etherscan .NewEtherScan ("https://api-sepolia.etherscan.io/api" , backend .etherScanHTTPClient )
517
532
coin = eth .NewCoin (etherScan , code , "Ethereum Sepolia" , "SEPETH" , "SEPETH" , params .SepoliaChainConfig ,
518
- "https://sepolia.etherscan.io/tx/" ,
533
+ blockExplorerPrefix ,
519
534
etherScan ,
520
535
nil )
521
536
case erc20Token != nil :
537
+ blockExplorerPrefix := backend .config .AppConfig ().Backend .ETH .BlockExplorerTxPrefix
522
538
etherScan := etherscan .NewEtherScan ("https://api.etherscan.io/api" , backend .etherScanHTTPClient )
523
539
coin = eth .NewCoin (etherScan , erc20Token .code , erc20Token .name , erc20Token .unit , "ETH" , params .MainnetChainConfig ,
524
- "https://etherscan.io/tx/" ,
540
+ blockExplorerPrefix ,
525
541
etherScan ,
526
542
erc20Token .token ,
527
543
)
@@ -1028,3 +1044,8 @@ func (backend *Backend) SetWatchonly(rootFingerprint []byte, watchonly bool) err
1028
1044
& t ,
1029
1045
)
1030
1046
}
1047
+
1048
+ // AvailableExplorers returns a struct containing all available block explorers for each coin.
1049
+ func (backend * Backend ) AvailableExplorers () config.AvailableBlockExplorers {
1050
+ return config .AvailableExplorers
1051
+ }
0 commit comments