package com.samourai.wallet.util;

import com.samourai.wallet.SamouraiWallet;

public class BlockExplorerUtil {

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

    private static CharSequence[] tBlockExplorers = { "Smartbit", "BlockCypher" };
    private static CharSequence[] tBlockExplorerTxUrls = { "https://testnet.smartbit.com.au/tx/", "https://live.blockcypher.com/btc-testnet/tx/" };
    private static CharSequence[] tBlockExplorerAddressUrls = { "https://testnet.smartbit.com.au/address/", "https://live.blockcypher.com/btc-testnet/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;
        }

    }

}

@@ -174,25 +174,8 @@
 it%22,
- %22UASF Explorer%22,
  %22Bl
@@ -204,32 +204,39 @@
 %22, %22BlockCypher%22
+, %22OXT%22
  %7D;%0A    private 
@@ -319,55 +319,8 @@
 x/%22,
- %22https://uasf-explorer.satoshiportal.com/tx/%22,
  %22ht
@@ -381,24 +381,57 @@
 com/btc/tx/%22
+, %22https://m.oxt.me/transaction/%22
  %7D;%0A    priv
@@ -534,60 +534,41 @@
 http
-s
 ://
-uasf-explorer.satoshiportal.com/address/
+srv1.yogh.io/#addr:id:
 %22, %22http
 ://s
@@ -567,33 +567,45 @@
 http
+s
 ://
-srv1.yogh.io/#addr:id:
+live.blockcypher.com/btc/address/
 %22, %22

add OXT block explorer