Updated on 2026-08-14
This commit is contained in:
parent
3affe7395c
commit
dec052b7c4
11 changed files with 73 additions and 12 deletions
|
|
@ -1 +1 @@
|
|||
Subproject commit 4a1be08512fe2b45504f2bdaa0e35f5c11e11319
|
||||
Subproject commit a13406537ec4b05f930131b151ea6ebb1c0b5ca3
|
||||
|
|
@ -434,6 +434,16 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : "algorand",
|
||||
"symbol" : "ALGO",
|
||||
"name" : "Algorand",
|
||||
"networks" : [
|
||||
{
|
||||
"networkId" : "algorand/test"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : "arbitrum-one",
|
||||
"symbol" : "ETH",
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ internal class ConfigManagerImpl @Inject constructor() : ConfigManager {
|
|||
jsonRpc = accessTokens.bitcoin?.jsonRPC,
|
||||
blockBookRest = accessTokens.bitcoin?.blockBookRest,
|
||||
),
|
||||
algorand = GetBlockAccessToken(rest = accessTokens.algorand?.rest),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ data class GetBlockAccessTokens(
|
|||
@Json(name = "litecoin") val litecoin: GetBlockToken?,
|
||||
@Json(name = "dash") val dash: GetBlockToken?,
|
||||
@Json(name = "bitcoin") val bitcoin: GetBlockToken?,
|
||||
@Json(name = "algorand") val algorand: GetBlockToken?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ fun getActiveIconRes(blockchainId: String): Int {
|
|||
"vechain", "vechain/test" -> R.drawable.img_vechain_22
|
||||
"aptos", "aptos/test" -> R.drawable.img_aptos_22
|
||||
"shibarium", "shibarium/test" -> R.drawable.img_shibarium_22
|
||||
"algorand", "algorand/test" -> R.drawable.img_algorand_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -101,6 +102,7 @@ fun getActiveIconResByNetworkId(networkId: String): Int {
|
|||
"vechain", "vechain/test" -> R.drawable.img_vechain_22
|
||||
"aptos", "aptos/test" -> R.drawable.img_aptos_22
|
||||
"shibarium", "shibarium/test" -> R.drawable.img_shibarium_22
|
||||
"algorand", "algorand/test" -> R.drawable.img_algorand_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -149,6 +151,7 @@ fun getActiveIconResByCoinId(coinId: String): Int {
|
|||
"vechain" -> R.drawable.img_vechain_22
|
||||
"aptos" -> R.drawable.img_aptos_22
|
||||
"shibarium" -> R.drawable.img_shibarium_22
|
||||
"algorand" -> R.drawable.img_algorand_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -200,6 +203,7 @@ fun getGreyedOutIconRes(blockchainId: String): Int {
|
|||
"vechain", "vechain/test" -> R.drawable.ic_vechain_22
|
||||
"aptos", "aptos/test" -> R.drawable.ic_aptos_22
|
||||
"shibarium", "shibarium/test" -> R.drawable.ic_shibarium_22
|
||||
"algorand", "algorand/test" -> R.drawable.ic_algorand_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
|
|
@ -251,6 +255,7 @@ fun getGreyedOutIconResByNetworkId(networkId: String): Int {
|
|||
"vechain", "vechain/test" -> R.drawable.ic_vechain_22
|
||||
"aptos", "aptos/test" -> R.drawable.ic_aptos_22
|
||||
"shibarium", "shibarium/test" -> R.drawable.ic_shibarium_22
|
||||
"algorand", "algorand/test" -> R.drawable.ic_algorand_22
|
||||
else -> R.drawable.ic_alert_24
|
||||
}
|
||||
}
|
||||
10
core/ui/src/main/res/drawable/ic_algorand_22.xml
Normal file
10
core/ui/src/main/res/drawable/ic_algorand_22.xml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M6.908,16L8.504,13.245L10.101,10.5L11.688,7.745L11.95,7.309L12.067,7.745L12.554,9.559L12.009,10.5L10.412,13.245L8.826,16H10.734L12.33,13.245L13.158,11.819L13.547,13.245L14.287,16H16L15.26,13.245L14.52,10.5L14.326,9.792L15.513,7.745H13.781L13.722,7.541L13.119,5.291L13.041,5H11.376L11.337,5.058L9.78,7.745L8.183,10.5L6.596,13.245L5,16H6.908Z" />
|
||||
</vector>
|
||||
16
core/ui/src/main/res/drawable/img_algorand_22.xml
Normal file
16
core/ui/src/main/res/drawable/img_algorand_22.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="22dp"
|
||||
android:height="22dp"
|
||||
android:viewportWidth="22"
|
||||
android:viewportHeight="22">
|
||||
<group>
|
||||
<clip-path
|
||||
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z"/>
|
||||
<path
|
||||
android:pathData="M11,0L11,0A11,11 0,0 1,22 11L22,11A11,11 0,0 1,11 22L11,22A11,11 0,0 1,0 11L0,11A11,11 0,0 1,11 0z"
|
||||
android:fillColor="#000000"/>
|
||||
<path
|
||||
android:pathData="M6.908,16L8.504,13.245L10.101,10.5L11.688,7.745L11.95,7.309L12.067,7.745L12.554,9.559L12.009,10.5L10.412,13.245L8.826,16H10.734L12.33,13.245L13.158,11.819L13.547,13.245L14.287,16H16L15.26,13.245L14.52,10.5L14.326,9.792L15.513,7.745H13.781L13.722,7.541L13.119,5.291L13.041,5H11.376L11.337,5.058L9.78,7.745L8.183,10.5L6.596,13.245L5,16H6.908Z"
|
||||
android:fillColor="#ffffff"/>
|
||||
</group>
|
||||
</vector>
|
||||
|
|
@ -80,9 +80,11 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
|
|||
"vechain/test" -> Blockchain.VeChainTestnet
|
||||
"aptos" -> Blockchain.Aptos
|
||||
"aptos/test" -> Blockchain.AptosTestnet
|
||||
"" -> Blockchain.Playa3ull // FIXME
|
||||
"shibarium" -> Blockchain.Shibarium
|
||||
"shibarium/test" -> Blockchain.ShibariumTestnet
|
||||
"" -> Blockchain.Playa3ull // FIXME
|
||||
"algorand" -> Blockchain.Algorand
|
||||
"algorand/test" -> Blockchain.AlgorandTestnet
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
|
@ -164,9 +166,11 @@ fun Blockchain.toNetworkId(): String {
|
|||
Blockchain.VeChainTestnet -> "vechain/test"
|
||||
Blockchain.Aptos -> "aptos"
|
||||
Blockchain.AptosTestnet -> "aptos/test"
|
||||
Blockchain.Playa3ull -> "" // FIXME
|
||||
Blockchain.Shibarium -> "shibarium"
|
||||
Blockchain.ShibariumTestnet -> "shibarium/test"
|
||||
Blockchain.Playa3ull -> "" // FIXME
|
||||
Blockchain.Algorand -> "algorand"
|
||||
Blockchain.AlgorandTestnet -> "algorand/test"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -218,10 +222,12 @@ fun Blockchain.toCoinId(): String {
|
|||
Blockchain.VeChain, Blockchain.VeChainTestnet -> "vechain"
|
||||
Blockchain.Aptos -> "aptos"
|
||||
Blockchain.AptosTestnet -> "aptos/test"
|
||||
Blockchain.Unknown -> "unknown"
|
||||
Blockchain.Playa3ull -> "" // FIXME
|
||||
Blockchain.Shibarium -> "bone-shibaswap"
|
||||
Blockchain.ShibariumTestnet -> "bone-shibaswap/test"
|
||||
Blockchain.Playa3ull -> "" // FIXME
|
||||
Blockchain.Algorand -> "algorand"
|
||||
Blockchain.AlgorandTestnet -> "algorand/test"
|
||||
Blockchain.Unknown -> "unknown"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,11 @@ class DefaultWalletManagersFacade(
|
|||
|
||||
resultFactory.getResult(walletManager)
|
||||
} catch (e: BlockchainSdkError.AccountNotFound) {
|
||||
resultFactory.getNoAccountResult(walletManager = walletManager, customMessage = e.customMessage)
|
||||
resultFactory.getNoAccountResult(
|
||||
walletManager = walletManager,
|
||||
customMessage = e.customMessage,
|
||||
amountToCreateAccount = e.amountToCreateAccount,
|
||||
)
|
||||
} catch (e: Throwable) {
|
||||
Timber.w(e, "Unable to update a wallet manager for: ${walletManager.wallet.blockchain}")
|
||||
|
||||
|
|
@ -288,7 +292,11 @@ class DefaultWalletManagersFacade(
|
|||
return try {
|
||||
resultFactory.getResult(walletManager)
|
||||
} catch (e: BlockchainSdkError.AccountNotFound) {
|
||||
resultFactory.getNoAccountResult(walletManager = walletManager, customMessage = e.customMessage)
|
||||
resultFactory.getNoAccountResult(
|
||||
walletManager = walletManager,
|
||||
customMessage = e.customMessage,
|
||||
amountToCreateAccount = e.amountToCreateAccount,
|
||||
)
|
||||
} catch (e: Throwable) {
|
||||
Timber.w(e, "Unable to update a wallet manager for: ${walletManager.wallet.blockchain}")
|
||||
|
||||
|
|
|
|||
|
|
@ -40,13 +40,17 @@ internal class UpdateWalletManagerResultFactory {
|
|||
)
|
||||
}
|
||||
|
||||
fun getNoAccountResult(walletManager: WalletManager, customMessage: String): UpdateWalletManagerResult {
|
||||
fun getNoAccountResult(
|
||||
walletManager: WalletManager,
|
||||
customMessage: String,
|
||||
amountToCreateAccount: BigDecimal?,
|
||||
): UpdateWalletManagerResult {
|
||||
val wallet = walletManager.wallet
|
||||
val blockchain = wallet.blockchain
|
||||
val firstWalletToken = wallet.getTokens().firstOrNull()
|
||||
val amountToCreateAccount = blockchain.amountToCreateAccount(firstWalletToken)
|
||||
val amount = amountToCreateAccount ?: blockchain.amountToCreateAccount(firstWalletToken)
|
||||
|
||||
return if (amountToCreateAccount == null) {
|
||||
return if (amount == null) {
|
||||
Timber.w("Unable to get required amount to create account for: $blockchain")
|
||||
UpdateWalletManagerResult.Unreachable(
|
||||
selectedAddress = wallet.address,
|
||||
|
|
@ -56,7 +60,7 @@ internal class UpdateWalletManagerResultFactory {
|
|||
UpdateWalletManagerResult.NoAccount(
|
||||
selectedAddress = wallet.address,
|
||||
addresses = getAvailableAddresses(wallet.addresses),
|
||||
amountToCreateAccount = amountToCreateAccount,
|
||||
amountToCreateAccount = amount,
|
||||
errorMessage = customMessage,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ web3j = "4.10.1"
|
|||
# endregion Other libraries
|
||||
|
||||
# region Tangem
|
||||
tangemBlockchainSdk = "develop-482"
|
||||
tangemBlockchainSdk = "develop-483"
|
||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
tangemCardSdk = "develop-324"
|
||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue