Updated on 2026-08-14
This commit is contained in:
parent
5787ea5849
commit
03c8fd3257
3 changed files with 15 additions and 4 deletions
|
|
@ -104,6 +104,7 @@ public class TokenEngine extends CoinEngine {
|
|||
|
||||
public String GetBalanceAlterValue(TangemCard mCard) {
|
||||
String dec = mCard.getDecimalBalanceAlter();
|
||||
if(dec.isEmpty()) return "-- -- --";
|
||||
BigDecimal d = convertToEth(dec);
|
||||
String s = d.toString();
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,16 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
|
||||
val apiHelper = ServerApiHelper()
|
||||
apiHelper.setLastVersionListener { response ->
|
||||
if (response!! != BuildConfig.VERSION_NAME) Toast.makeText(this, "There is a new application version: " + response.toString(), Toast.LENGTH_LONG).show()
|
||||
try {
|
||||
val responseVersionName=response.trim(' ','\n','\r','\t')
|
||||
val responseBuildVersion=responseVersionName.split('.').last()
|
||||
val appBuildVersion=BuildConfig.VERSION_NAME.split('.').last()
|
||||
if (responseBuildVersion.toInt()>appBuildVersion.toInt()) Toast.makeText(this, "There is a new application version: $responseVersionName", Toast.LENGTH_LONG).show()
|
||||
}
|
||||
catch (E: Exception)
|
||||
{
|
||||
E.printStackTrace()
|
||||
}
|
||||
}
|
||||
apiHelper.requestLastVersion()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,6 +273,8 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
updateViews()
|
||||
srlLoadedWallet!!.isRefreshing = false
|
||||
// refresh()
|
||||
requestInfura(ServerApiHelper.INFURA_ETH_GET_BALANCE, "")
|
||||
requestInfura(ServerApiHelper.INFURA_ETH_GET_TRANSACTION_COUNT, "")
|
||||
return@onInfuraSuccess
|
||||
}
|
||||
card!!.setBalanceConfirmed(balance)
|
||||
|
|
@ -281,6 +283,8 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
|
||||
Log.i("$TAG eth_call", balanceCap)
|
||||
|
||||
requestInfura(ServerApiHelper.INFURA_ETH_GET_BALANCE, "")
|
||||
requestInfura(ServerApiHelper.INFURA_ETH_GET_TRANSACTION_COUNT, "")
|
||||
} catch (e: JSONException) {
|
||||
e.printStackTrace()
|
||||
} catch (e: NumberFormatException) {
|
||||
|
|
@ -797,9 +801,6 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
// updateETH.execute(reqETH, reqNonce, reqBalance)
|
||||
|
||||
requestInfura(ServerApiHelper.INFURA_ETH_CALL, engine.getContractAddress(card))
|
||||
requestInfura(ServerApiHelper.INFURA_ETH_GET_BALANCE, "")
|
||||
requestInfura(ServerApiHelper.INFURA_ETH_GET_TRANSACTION_COUNT, "")
|
||||
|
||||
|
||||
requestRateInfo("ethereum")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue