Updated on 2026-08-14
This commit is contained in:
commit
8ba700a436
11 changed files with 667 additions and 362 deletions
|
|
@ -12,7 +12,8 @@ public enum Blockchain {
|
|||
Ethereum("ETH", "ETH", 1.0, R.drawable.ic_logo_ethereum, "Ethereum"),
|
||||
EthereumTestNet("ETH/test", "ETH", 1.0, R.drawable.ic_logo_ethereum_testnet, "Ethereum Testnet"),
|
||||
Token("Token", "ERC20", 1.0, R.drawable.ic_logo_bat_token, "Ethereum"),
|
||||
BitcoinCash("BCH", "BCH", 100000000.0, R.drawable.ic_logo_bitcoin_cash, "Bitcoin Cash");
|
||||
BitcoinCash("BCH", "BCH", 100000000.0, R.drawable.ic_logo_bitcoin_cash, "Bitcoin Cash"),
|
||||
Litecoin("LTC", "LTC", 100000000.0, R.drawable.ic_logo_bitcoin, "Litecoin");
|
||||
|
||||
Blockchain(String ID, String currency, double multiplier, int imageResource, String officialName) {
|
||||
mID = ID;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.tangem.data.Blockchain;
|
|||
import com.tangem.domain.wallet.bch.BitcoinCashNode;
|
||||
import com.tangem.domain.wallet.btc.BitcoinNode;
|
||||
import com.tangem.domain.wallet.btc.BitcoinNodeTestNet;
|
||||
import com.tangem.domain.wallet.ltc.LitecoinNode;
|
||||
import com.tangem.wallet.R;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
|
|
@ -170,6 +171,7 @@ public class ServerApiElectrum {
|
|||
String host;
|
||||
int port;
|
||||
String proto;
|
||||
// todo - get available URL list from coinEngine, remove if( ctx.getBlockchain()==...)
|
||||
if (ctx.getBlockchain() == Blockchain.BitcoinTestNet) {
|
||||
BitcoinNodeTestNet bitcoinNodeTestNet = BitcoinNodeTestNet.values()[new Random().nextInt(BitcoinNodeTestNet.values().length)];
|
||||
host = bitcoinNodeTestNet.getHost();
|
||||
|
|
@ -203,6 +205,20 @@ public class ServerApiElectrum {
|
|||
this.host = host;
|
||||
this.port = port;
|
||||
|
||||
if (proto.equals("tcp")) {
|
||||
doElectrumRequestTcp(electrumRequest, host, port);
|
||||
} else {
|
||||
doElectrumRequestSsl(electrumRequest, host, port);
|
||||
}
|
||||
} else if (ctx.getBlockchain() == Blockchain.Litecoin) {
|
||||
LitecoinNode litecoinNode = LitecoinNode.values()[new Random().nextInt(LitecoinNode.values().length)];
|
||||
host = litecoinNode.getHost();
|
||||
port = litecoinNode.getPort();
|
||||
proto = litecoinNode.getProto();
|
||||
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
|
||||
if (proto.equals("tcp")) {
|
||||
doElectrumRequestTcp(electrumRequest, host, port);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue