Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(network_wallet_services): AND-6684 Move STX config from Firebase…
… to Network Config (#4125)
- Loading branch information
1 parent
c3c888f
commit 1bd5a82
Showing
18 changed files
with
140 additions
and
242 deletions.
There are no files selected for viewing
194 changes: 0 additions & 194 deletions
194
blockchainApi/src/main/java/com/blockchain/api/coinnetworks/MockInterceptor.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ enum class NetworkType { | |
EVM, | ||
BTC, | ||
XLM, | ||
STX, | ||
NOT_SUPPORTED | ||
} | ||
|
||
|
10 changes: 10 additions & 0 deletions
10
common/domain/src/main/java/com/blockchain/domain/wallet/CoinType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.blockchain.domain.wallet | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class CoinType( | ||
val network: NetworkType, | ||
val type: Int, | ||
val purpose: Int | ||
) |
35 changes: 35 additions & 0 deletions
35
core/src/main/java/com/blockchain/core/chains/dynamicselfcustody/data/CoinTypeStore.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.blockchain.core.chains.dynamicselfcustody.data | ||
|
||
import com.blockchain.api.coinnetworks.data.CoinTypeDto | ||
import com.blockchain.api.services.AssetDiscoveryApiService | ||
import com.blockchain.store.Fetcher | ||
import com.blockchain.store.Store | ||
import com.blockchain.store.impl.Freshness | ||
import com.blockchain.store.impl.FreshnessMediator | ||
import com.blockchain.store_caches_persistedjsonsqldelight.PersistedJsonSqlDelightStoreBuilder | ||
import com.blockchain.storedatasource.FlushableDataSource | ||
import kotlinx.serialization.builtins.ListSerializer | ||
|
||
class CoinTypeStore( | ||
private val discoveryService: AssetDiscoveryApiService | ||
) : Store<List<CoinTypeDto>> by PersistedJsonSqlDelightStoreBuilder() | ||
.build( | ||
storeId = STORE_ID, | ||
fetcher = Fetcher.ofOutcome( | ||
mapper = { | ||
discoveryService.allCoinTypes() | ||
} | ||
), | ||
dataSerializer = ListSerializer(CoinTypeDto.serializer()), | ||
mediator = FreshnessMediator(Freshness.DURATION_24_HOURS) | ||
), | ||
FlushableDataSource { | ||
|
||
override fun invalidate() { | ||
markAsStale() | ||
} | ||
|
||
companion object { | ||
private const val STORE_ID = "CoinTypeStore" | ||
} | ||
} |
Oops, something went wrong.