Updated on 2026-08-14
This commit is contained in:
parent
d270021a08
commit
ef355397fa
7 changed files with 594 additions and 4 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 java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
|
|
@ -144,6 +145,20 @@ public class ServerApiElectrum {
|
|||
this.host = host;
|
||||
this.port = port;
|
||||
|
||||
if (proto.equals("tcp")) {
|
||||
return doElectrumRequestTcp(electrumRequest, host, port);
|
||||
} else {
|
||||
return 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")) {
|
||||
return doElectrumRequestTcp(electrumRequest, host, port);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue