@@ -73,13 +73,21 @@ var fixedURLWhitelist = []string{
7373 "https://shiftcrypto.support/" ,
7474 // Exchange rates.
7575 "https://www.coingecko.com/" ,
76- // Block explorers.
76+ // Block explorers (btc) .
7777 "https://blockstream.info/tx/" ,
7878 "https://blockstream.info/testnet/tx/" ,
79+ "https://mempool.space/tx/" ,
80+ "https://mempool.space/testnet/tx/" ,
81+ // Block explorers (ltc).
7982 "https://sochain.com/tx/LTCTEST/" ,
8083 "https://blockchair.com/litecoin/transaction/" ,
84+ // Block explorers (eth).
8185 "https://etherscan.io/tx/" ,
8286 "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/" ,
8391 // Moonpay onramp
8492 "https://www.moonpay.com/" ,
8593 "https://support.moonpay.com/" ,
@@ -485,43 +493,51 @@ func (backend *Backend) Coin(code coinpkg.Code) (coinpkg.Coin, error) {
485493 servers := backend .defaultElectrumXServers (code )
486494 coin = btc .NewCoin (coinpkg .CodeRBTC , "Bitcoin Regtest" , "RBTC" , coinpkg .BtcUnitDefault , & chaincfg .RegressionNetParams , dbFolder , servers , "" , backend .socksProxy )
487495 case code == coinpkg .CodeTBTC :
496+ blockExplorerPrefix := backend .config .AppConfig ().Backend .TBTC .BlockExplorerTxPrefix
488497 servers := backend .defaultElectrumXServers (code )
489498 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 )
491500 case code == coinpkg .CodeBTC :
501+ blockExplorerPrefix := backend .config .AppConfig ().Backend .BTC .BlockExplorerTxPrefix
492502 servers := backend .defaultElectrumXServers (code )
493503 coin = btc .NewCoin (coinpkg .CodeBTC , "Bitcoin" , "BTC" , btcFormatUnit , & chaincfg .MainNetParams , dbFolder , servers ,
494- "https://blockstream.info/tx/" , backend .socksProxy )
504+ blockExplorerPrefix , backend .socksProxy )
495505 case code == coinpkg .CodeTLTC :
506+ blockExplorerPrefix := backend .config .AppConfig ().Backend .TLTC .BlockExplorerTxPrefix
496507 servers := backend .defaultElectrumXServers (code )
497508 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 )
499510 case code == coinpkg .CodeLTC :
511+ blockExplorerPrefix := backend .config .AppConfig ().Backend .LTC .BlockExplorerTxPrefix
500512 servers := backend .defaultElectrumXServers (code )
501513 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 )
503515 case code == coinpkg .CodeETH :
516+ blockExplorerPrefix := backend .config .AppConfig ().Backend .ETH .BlockExplorerTxPrefix
504517 etherScan := etherscan .NewEtherScan ("https://api.etherscan.io/api" , backend .etherScanHTTPClient )
505518 coin = eth .NewCoin (etherScan , code , "Ethereum" , "ETH" , "ETH" , params .MainnetChainConfig ,
506- "https://etherscan.io/tx/" ,
519+ blockExplorerPrefix ,
507520 etherScan ,
508521 nil )
509522 case code == coinpkg .CodeGOETH :
523+ blockExplorerPrefix := backend .config .AppConfig ().Backend .GOETH .BlockExplorerTxPrefix
510524 etherScan := etherscan .NewEtherScan ("https://api-goerli.etherscan.io/api" , backend .etherScanHTTPClient )
511525 coin = eth .NewCoin (etherScan , code , "Ethereum Goerli" , "GOETH" , "GOETH" , params .GoerliChainConfig ,
512- "https://goerli.etherscan.io/tx/" ,
526+ blockExplorerPrefix ,
513527 etherScan ,
514528 nil )
515529 case code == coinpkg .CodeSEPETH :
530+ blockExplorerPrefix := backend .config .AppConfig ().Backend .SEPETH .BlockExplorerTxPrefix
516531 etherScan := etherscan .NewEtherScan ("https://api-sepolia.etherscan.io/api" , backend .etherScanHTTPClient )
517532 coin = eth .NewCoin (etherScan , code , "Ethereum Sepolia" , "SEPETH" , "SEPETH" , params .SepoliaChainConfig ,
518- "https://sepolia.etherscan.io/tx/" ,
533+ blockExplorerPrefix ,
519534 etherScan ,
520535 nil )
521536 case erc20Token != nil :
537+ blockExplorerPrefix := backend .config .AppConfig ().Backend .ETH .BlockExplorerTxPrefix
522538 etherScan := etherscan .NewEtherScan ("https://api.etherscan.io/api" , backend .etherScanHTTPClient )
523539 coin = eth .NewCoin (etherScan , erc20Token .code , erc20Token .name , erc20Token .unit , "ETH" , params .MainnetChainConfig ,
524- "https://etherscan.io/tx/" ,
540+ blockExplorerPrefix ,
525541 etherScan ,
526542 erc20Token .token ,
527543 )
@@ -1028,3 +1044,7 @@ func (backend *Backend) SetWatchonly(rootFingerprint []byte, watchonly bool) err
10281044 & t ,
10291045 )
10301046}
1047+
1048+ func (backend * Backend ) AvailableExplorers () config.AvailableBlockExplorers {
1049+ return config .AvailableExplorers
1050+ }
0 commit comments