Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit dafd3ca

Browse files
committed
Update subscription endpoints to grouped chains
1 parent 4dae02d commit dafd3ca

5 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎core‎

Submodule core updated 143 files

‎data/repositories/src/main/kotlin/com/gemwallet/android/data/repositoreis/device/DeviceRepository.kt‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import com.gemwallet.android.data.service.store.ConfigStore
2121
import com.gemwallet.android.data.services.gemapi.GemDeviceApiClient
2222
import com.gemwallet.android.ext.model
2323
import com.gemwallet.android.ext.os
24+
import com.wallet.core.primitives.AddressChains
2425
import com.wallet.core.primitives.ChainAddress
2526
import com.wallet.core.primitives.Device
2627
import com.wallet.core.primitives.MigrateDeviceIdRequest
@@ -231,9 +232,10 @@ class DeviceRepository(
231232

232233
private fun localSubscriptions(wallets: List<Wallet>): List<WalletSubscription> {
233234
return wallets.map { wallet ->
234-
val subscriptions = wallet.accounts.map { account ->
235-
ChainAddress(account.chain, account.address)
236-
}
235+
val subscriptions = wallet.accounts.groupBy { account -> account.address }
236+
.map { entry ->
237+
AddressChains(entry.key, entry.value.map { it.chain })
238+
}
237239
WalletSubscription(
238240
walletId = wallet.id,
239241
source = wallet.source,

‎gemcore/src/main/kotlin/com/wallet/core/primitives/AddressName.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import kotlinx.serialization.SerialName
1111
data class AddressName (
1212
val chain: Chain,
1313
val address: String,
14-
val name: String
14+
val name: String,
15+
val type: AddressType? = null
1516
)
1617

‎gemcore/src/main/kotlin/com/wallet/core/primitives/Scan.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ enum class AddressType(val string: String) {
1515
Contract("contract"),
1616
@SerialName("validator")
1717
Validator("validator"),
18+
@SerialName("contact")
19+
Contact("contact"),
1820
}
1921

2022
@Serializable

‎gemcore/src/main/kotlin/com/wallet/core/primitives/Subscription.kt‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,17 @@ package com.wallet.core.primitives
77
import kotlinx.serialization.Serializable
88
import kotlinx.serialization.SerialName
99

10+
@Serializable
11+
data class AddressChains (
12+
val address: String,
13+
val chains: List<Chain>
14+
)
15+
1016
@Serializable
1117
data class WalletSubscription (
1218
val walletId: String,
1319
val source: WalletSource? = null,
14-
val subscriptions: List<ChainAddress>
20+
val subscriptions: List<AddressChains>
1521
)
1622

1723
@Serializable

0 commit comments

Comments
 (0)