Updated on 2026-08-14
This commit is contained in:
parent
ac6f73170e
commit
bdcd8f2ce8
25 changed files with 224 additions and 30 deletions
|
|
@ -1,5 +1,6 @@
|
|||
plugins {
|
||||
alias(deps.plugins.kotlin.jvm)
|
||||
alias(deps.plugins.ksp)
|
||||
id("configuration")
|
||||
}
|
||||
dependencies {
|
||||
|
|
@ -7,4 +8,8 @@ dependencies {
|
|||
/* Domain */
|
||||
implementation(projects.domain.wallets.models)
|
||||
implementation(projects.domain.tokens.models)
|
||||
|
||||
/* Other */
|
||||
implementation(deps.moshi)
|
||||
ksp(deps.moshi.kotlin.codegen)
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.tangem.domain.walletconnect.model
|
||||
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.domain.wallets.models.UserWalletId
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class WcSessionDTO(
|
||||
val topic: String,
|
||||
val walletId: UserWalletId,
|
||||
)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.tangem.domain.walletconnect.model.legacy
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Account(
|
||||
@Json(name = "chainId")
|
||||
val chainId: String,
|
||||
|
||||
@Json(name = "walletAddress")
|
||||
val walletAddress: String,
|
||||
|
||||
@Json(name = "derivationPath")
|
||||
val derivationPath: String?,
|
||||
)
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.tangem.domain.walletconnect.model.legacy
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Session(
|
||||
@Json(name = "topic")
|
||||
val topic: String,
|
||||
|
||||
@Json(name = "accounts")
|
||||
val accounts: List<Account>,
|
||||
)
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.tangem.domain.walletconnect.model.legacy
|
||||
|
||||
interface WalletConnectSessionsRepository {
|
||||
suspend fun loadSessions(userWallet: String): List<Session>
|
||||
|
||||
suspend fun saveSession(userWallet: String, session: Session)
|
||||
|
||||
suspend fun removeSession(userWallet: String, topic: String)
|
||||
}
|
||||
|
|
@ -5,4 +5,5 @@ package com.tangem.domain.walletconnect.model.sdkcopy
|
|||
*/
|
||||
data class WcSdkSession(
|
||||
val topic: String,
|
||||
val appMetaData: WcAppMetaData,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue