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

Commit 209a232

Browse files
committed
Update primitives and localize
1 parent 7ee56b1 commit 209a232

84 files changed

Lines changed: 2800 additions & 74 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<uses-permission android:name="android.permission.CAMERA" />
1111
<uses-permission android:name="android.permission.VIBRATE" />
1212

13+
<!-- android:fullBackupContent="false"-->
1314
<application
1415
android:allowBackup="false"
15-
android:fullBackupContent="false"
16-
android:dataExtractionRules="@xml/backup_rules"
16+
android:fullBackupContent="@xml/backup_rules"
1717
android:hardwareAccelerated="true"
1818
android:icon="@mipmap/ic_launcher"
1919
android:label="@string/application.name"

app/src/main/kotlin/com/gemwallet/android/MainViewModel.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ class MainViewModel @Inject constructor(
170170
is PushNotificationData.PushNotificationPayloadType,
171171
is PushNotificationData.Swap,
172172
null -> intent
173+
174+
is PushNotificationData.Stake -> {
175+
onWallet(data.walletId.id)
176+
Intent().apply {
177+
setData("${assetRouteUri}/${data.assetId}".toUri())
178+
}
179+
}
173180
}
174181
}
175182
} else {

app/src/main/kotlin/com/gemwallet/android/services/ShowSystemNotification.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ class ShowSystemNotification @Inject constructor(@ApplicationContext val applica
5353
showNotification(title, subtitle, channelId, extra, "${assetRouteUri}/${data.assetId}".toUri())
5454
}
5555

56+
override fun showNotification(
57+
title: String?,
58+
subtitle: String?,
59+
channelId: String?,
60+
data: PushNotificationData.Stake
61+
) {
62+
val extra = Bundle().apply {
63+
putString("walletId", data.walletId.id)
64+
}
65+
showNotification(title, subtitle, channelId, extra, "${assetRouteUri}/${data.assetId}".toUri())
66+
}
67+
5668
override fun showNotification(
5769
title: String?,
5870
subtitle: String?,

blockchain/src/main/kotlin/com/gemwallet/android/blockchain/clients/ethereum/EvmChainData.kt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
package com.gemwallet.android.blockchain.clients.ethereum
22

33
import com.gemwallet.android.model.ChainSignData
4-
import com.wallet.core.primitives.StakeData
4+
import com.wallet.core.primitives.ContractCallData
5+
import com.wallet.core.primitives.swap.ApprovalData
56
import uniffi.gemstone.GemTransactionLoadMetadata
67
import java.math.BigInteger
8+
import kotlin.String
79

810
data class EvmChainData(
911
val chainId: Int,
1012
val nonce: BigInteger,
11-
val stakeData: StakeData?,
13+
val stakeData: ContractCallData?,
1214
) : ChainSignData
1315

1416

@@ -17,9 +19,17 @@ fun GemTransactionLoadMetadata.Evm.toChainData(): EvmChainData {
1719
chainId = chainId.toInt(),
1820
nonce = BigInteger.valueOf(nonce.toLong()),
1921
stakeData = contractCall?.let {
20-
StakeData(
21-
data = it.callData,
22-
to = it.contractAddress
22+
ContractCallData(
23+
contractAddress = it.contractAddress,
24+
callData = it.callData,
25+
approval = it.approval?.let {
26+
ApprovalData(
27+
token = it.token,
28+
spender = it.spender,
29+
value = it.value,
30+
)
31+
},
32+
gasLimit = it.gasLimit,
2333
)
2434
}
2535
)

blockchain/src/main/kotlin/com/gemwallet/android/blockchain/clients/ethereum/EvmSignClient.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ class EvmSignClient(
287287
throw Exception("Doesn't support")
288288
}
289289
val meta = chainData as EvmChainData
290-
val toAddress = meta.stakeData?.to ?: throw java.lang.IllegalArgumentException("No stake data")
291-
val stakeData = meta.stakeData.data?.decodeHex() ?: throw java.lang.IllegalArgumentException("No stake data")
290+
val toAddress = meta.stakeData?.contractAddress ?: throw java.lang.IllegalArgumentException("No stake data")
291+
val stakeData = meta.stakeData.callData.decodeHex() ?: throw java.lang.IllegalArgumentException("No stake data")
292292
val fee = fee as GasFee
293293
val valueData = when (params) {
294294
is ConfirmParams.Stake.DelegateParams -> finalAmount.toByteArray()

blockchain/src/main/kotlin/com/gemwallet/android/blockchain/services/StakeService.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.wallet.core.primitives.Chain
66
import com.wallet.core.primitives.DelegationBase
77
import com.wallet.core.primitives.DelegationState
88
import com.wallet.core.primitives.DelegationValidator
9+
import com.wallet.core.primitives.StakeProviderType
910
import uniffi.gemstone.GemDelegationState
1011
import uniffi.gemstone.GemGateway
1112

@@ -29,6 +30,7 @@ class StakeService(
2930
isActive = item.isActive,
3031
commission = item.commission,
3132
apr = item.apr,
33+
providerType = StakeProviderType.Stake,
3234
)
3335
}
3436
} catch (_: Throwable) {

core

Submodule core updated 582 files

data/coordinators/src/main/kotlin/com/gemwallet/android/data/coordinates/transaction/GetTransactionDetailsImpl.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ class TransactionDetailsAggregateImpl(
125125
TransactionType.StakeRewards,
126126
TransactionType.StakeRedelegate,
127127
TransactionType.StakeWithdraw,
128+
TransactionType.EarnWithdraw,
129+
TransactionType.EarnDeposit,
128130
TransactionType.Swap,
129131
TransactionType.StakeFreeze,
130132
TransactionType.StakeUnfreeze,
@@ -177,6 +179,8 @@ class TransactionDetailsAggregateImpl(
177179
TransactionType.StakeFreeze,
178180
TransactionType.StakeUnfreeze,
179181
TransactionType.PerpetualModifyPosition,
182+
TransactionType.EarnWithdraw,
183+
TransactionType.EarnDeposit,
180184
TransactionType.StakeWithdraw -> null
181185
TransactionType.Swap -> this@TransactionDetailsAggregateImpl.swapProvider?.let { TransactionDetailsValue.Destination.Provider(it) }
182186
TransactionType.Transfer,

data/coordinators/src/main/kotlin/com/gemwallet/android/data/coordinates/transaction/GetTransactionsImpl.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class TransactionDataAggregateImpl(
8383
TransactionType.StakeUndelegate,
8484
TransactionType.StakeRedelegate,
8585
TransactionType.StakeWithdraw,
86+
TransactionType.EarnWithdraw,
87+
TransactionType.EarnDeposit,
8688
TransactionType.AssetActivation,
8789
TransactionType.StakeRewards,
8890
TransactionType.SmartContractCall,
@@ -104,7 +106,9 @@ class TransactionDataAggregateImpl(
104106
TransactionType.StakeRewards,
105107
TransactionType.StakeRedelegate,
106108
TransactionType.StakeWithdraw,
109+
TransactionType.EarnWithdraw,
107110
TransactionType.StakeDelegate,
111+
TransactionType.EarnDeposit,
108112
TransactionType.PerpetualOpenPosition,
109113
TransactionType.StakeFreeze,
110114
TransactionType.StakeUnfreeze,

data/repositories/src/main/kotlin/com/gemwallet/android/data/repositoreis/nft/NftRepository.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import com.wallet.core.primitives.NFTCollection
1919
import com.wallet.core.primitives.NFTData
2020
import com.wallet.core.primitives.NFTImages
2121
import com.wallet.core.primitives.NFTResource
22+
import com.wallet.core.primitives.VerificationStatus
2223
import com.wallet.core.primitives.Wallet
2324
import kotlinx.coroutines.ExperimentalCoroutinesApi
2425
import kotlinx.coroutines.flow.Flow
@@ -44,7 +45,7 @@ class NftRepository(
4445
imageUrl = it.collection.images.preview.url,
4546
previewImageUrl = it.collection.images.preview.url,
4647
originalSourceUrl = it.collection.images.preview.url,
47-
isVerified = it.collection.isVerified,
48+
status = it.collection.status,
4849
)
4950
} ?: emptyList()
5051
val fullAsset = response?.flatMap { item ->
@@ -140,7 +141,7 @@ private fun DbNFTCollection.mapToModel(links: List<DbNFTCollectionLink>) = NFTCo
140141
chain = this.chain,
141142
contractAddress = this.contractAddress,
142143
images = NFTImages(NFTResource(this.imageUrl, "")),
143-
isVerified = this.isVerified,
144+
status = this.status ?: VerificationStatus.Verified,
144145
links = links.map { AssetLink(it.name, it.url) },
145146
)
146147

0 commit comments

Comments
 (0)