package com.samourai.wallet.util;

import com.samourai.wallet.SamouraiWallet;

public class BlockExplorerUtil {

    private static CharSequence[] blockExplorers = { "Smartbit", "UASF Explorer", "Blockchain Reader (Yogh)" };
    private static CharSequence[] blockExplorerTxUrls = { "https://www.smartbit.com.au/tx/", "https://uasf-explorer.satoshiportal.com/tx/", "http://srv1.yogh.io/#tx:id:" };
    private static CharSequence[] blockExplorerAddressUrls = { "https://www.smartbit.com.au/address/", "https://uasf-explorer.satoshiportal.com/address/", "http://srv1.yogh.io/#addr:id:" };

    private static CharSequence[] tBlockExplorers = { "Smartbit" };
    private static CharSequence[] tBlockExplorerTxUrls = { "https://testnet.smartbit.com.au/tx/" };
    private static CharSequence[] tBlockExplorerAddressUrls = { "https://testnet.smartbit.com.au/address/" };

    private static BlockExplorerUtil instance = null;

    private BlockExplorerUtil() { ; }

    public static BlockExplorerUtil getInstance() {

        if(instance == null) {
            instance = new BlockExplorerUtil();
        }

        return instance;
    }

    public CharSequence[] getBlockExplorers() {

        if(SamouraiWallet.getInstance().isTestNet())    {
            return tBlockExplorers;
        }
        else    {
            return blockExplorers;
        }

    }

    public CharSequence[] getBlockExplorerTxUrls() {

        if(SamouraiWallet.getInstance().isTestNet())    {
            return tBlockExplorerTxUrls;
        }
        else    {
            return blockExplorerTxUrls;
        }

    }

    public CharSequence[] getBlockExplorerAddressUrls() {

        if(SamouraiWallet.getInstance().isTestNet())    {
            return tBlockExplorerAddressUrls;
        }
        else    {
            return blockExplorerAddressUrls;
        }

    }

}

@@ -214,16 +214,31 @@
  (Yogh)%22
+, %22BlockCypher%22
  %7D;%0A    
@@ -398,24 +398,64 @@
 .io/#tx:id:%22
+, %22https://live.blockcypher.com/btc/tx/%22
  %7D;%0A    priv
@@ -632,16 +632,61 @@
 ddr:id:%22
+, %22https://live.blockcypher.com/btc/address/%22
  %7D;%0A%0A   
@@ -746,16 +746,31 @@
 martbit%22
+, %22BlockCypher%22
  %7D;%0A    
@@ -857,24 +857,73 @@
 .com.au/tx/%22
+, %22https://live.blockcypher.com/bitcoin-test/tx/%22
  %7D;%0A    priv
@@ -1012,32 +1012,86 @@
 com.au/address/%22
+, %22https://live.blockcypher.com/bitcoin-test/address/%22
  %7D;%0A%0A    private

add BlockCypher main/test net