Skip to content

Commit

Permalink
Merge pull request #849 from tangem/merge_5.18_dev
Browse files Browse the repository at this point in the history
Merge 5.18 dev
  • Loading branch information
kozarezvlad authored Nov 29, 2024
2 parents 7c7ec20 + 355e698 commit 59b049b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.tangem.blockchain.common.BlockchainSdkConfig
import com.tangem.blockchain.common.network.providers.NetworkProvidersBuilder
import com.tangem.blockchain.common.network.providers.ProviderType
import com.tangem.blockchain.extensions.letNotBlank
import com.tangem.blockchain.network.API_CHIA3_TANGEM
import com.tangem.blockchain.network.API_CHIA_FIREACADEMY
import com.tangem.blockchain.network.API_CHIA_FIREACADEMY_TESTNET
import com.tangem.blockchain.network.API_CHIA_TANGEM
Expand All @@ -20,6 +21,7 @@ internal class ChiaProvidersBuilder(
return providerTypes.mapNotNull {
when (it) {
ProviderType.Chia.Tangem -> createTangemProvider()
ProviderType.Chia.TangemNew -> createTangemNewProvider()
ProviderType.Chia.FireAcademy -> createFireAcademyProvider(isTestnet = false)
else -> null
}
Expand All @@ -37,7 +39,17 @@ internal class ChiaProvidersBuilder(
ChiaJsonRpcProvider(
baseUrl = API_CHIA_TANGEM,
key = it,
isRequiredHexPrefixForTx = false,
isRequiredHexPrefixForTx = true,
)
}
}

private fun createTangemNewProvider(): ChiaNetworkProvider? {
return config.chiaTangemApiKey?.letNotBlank {
ChiaJsonRpcProvider(
baseUrl = API_CHIA3_TANGEM,
key = it,
isRequiredHexPrefixForTx = true,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ sealed interface ProviderType {

sealed interface Chia : ProviderType {
object Tangem : Chia
object TangemNew : Chia
object FireAcademy : Chia
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const val API_KASPA = "https://api.kaspa.org/"
const val API_CHIA_FIREACADEMY = "https://kraken.fireacademy.io/leaflet/"
const val API_CHIA_FIREACADEMY_TESTNET = "https://kraken.fireacademy.io/leaflet-testnet10/"
const val API_CHIA_TANGEM = "https://chia.tangem.com/"
const val API_CHIA3_TANGEM = "https://chia3.tangem.com/"
const val API_HEDERA_MIRROR_TESTNET = "https://testnet.mirrornode.hedera.com/api/v1/"
const val API_HEDERA_ARKHIA_MIRROR = "https://pool.arkhia.io/hedera/mainnet/api/v1/"
const val API_HEDERA_ARKHIA_MIRROR_TESTNET = "https://pool.arkhia.io/hedera/testnet/api/v1/"

0 comments on commit 59b049b

Please sign in to comment.