Updated on 2026-08-14

This commit is contained in:
Tangem 2020-05-13 21:10:45 +03:00
parent 7c49298522
commit 30616bbfcd
2 changed files with 25 additions and 3 deletions

View file

@ -105,4 +105,25 @@ public enum Blockchain {
return getImageResource();
}
public String getUriScheme() {
String scheme = null;
switch (this) {
case Bitcoin:
case BitcoinDual:
scheme = "bitcoin";
break;
case Ethereum:
case Token:
case TokenEmv:
scheme = "ethereum";
break;
case Litecoin:
scheme = "litecoin";
break;
case Ripple:
scheme = "ripple";
}
return scheme;
}
}

View file

@ -197,10 +197,11 @@ public abstract class CoinEngine {
public abstract Uri getShareWalletUri();
public Uri getShareWalletUriEx(){
if (ctx.getBlockchain() == Blockchain.BitcoinCash)
return getShareWalletUri();
String scheme = ctx.getBlockchain().getUriScheme();
if (scheme != null)
return Uri.parse(scheme + ":" + getShareWalletUri());
else
return Uri.parse(ctx.getBlockchain().name().toLowerCase() + ":" + getShareWalletUri().toString());
return getShareWalletUri();
}
public abstract boolean checkNewTransactionAmount(Amount amount);