Updated on 2026-08-14
This commit is contained in:
parent
a6323c268c
commit
71dd38f1fd
4 changed files with 8 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ import com.tangem.data.walletconnect.sign.SignStateConverter.toSigning
|
|||
import com.tangem.domain.walletconnect.WcAnalyticEvents
|
||||
import com.tangem.domain.walletconnect.model.WcRequestError
|
||||
import com.tangem.domain.walletconnect.model.WcRequestError.Companion.code
|
||||
import com.tangem.domain.walletconnect.model.WcRequestError.Companion.message
|
||||
import com.tangem.domain.walletconnect.usecase.method.WcSignState
|
||||
import com.tangem.domain.walletconnect.usecase.method.WcSignStep
|
||||
import kotlinx.coroutines.Job
|
||||
|
|
@ -65,10 +66,12 @@ internal class WcSignUseCaseDelegate<MiddleAction, SignModel>(
|
|||
val step = state.domainStep as? WcSignStep.Result ?: return@onEach
|
||||
val event = step.result.fold(
|
||||
ifLeft = { error ->
|
||||
val errorMessage = error.message() ?: ""
|
||||
WcAnalyticEvents.SignatureRequestFailed(
|
||||
rawRequest = context.rawSdkRequest,
|
||||
network = context.network,
|
||||
errorCode = error.code() ?: error::class.simpleName.orEmpty(),
|
||||
errorMessage = errorMessage,
|
||||
)
|
||||
},
|
||||
ifRight = {
|
||||
|
|
|
|||
|
|
@ -49,8 +49,8 @@ sealed class WcRequestError {
|
|||
is SendTransactionError.NetworkError -> message
|
||||
is SendTransactionError.DataError -> message
|
||||
is SendTransactionError.UnknownError -> ex?.message
|
||||
is SendTransactionError.TangemSdkError,
|
||||
SendTransactionError.DemoCardError,
|
||||
is SendTransactionError.TangemSdkError -> "TangemSdkError code: ${this.code}"
|
||||
SendTransactionError.DemoCardError -> "DemoCardError"
|
||||
SendTransactionError.UserCancelledError,
|
||||
is SendTransactionError.CreateAccountUnderfunded,
|
||||
-> null
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ sealed class WcAnalyticEvents(
|
|||
rawRequest: WcSdkSessionRequest,
|
||||
network: Network,
|
||||
errorCode: String,
|
||||
errorMessage: String,
|
||||
) : WcAnalyticEvents(
|
||||
event = "Signature Request Failed",
|
||||
params = mapOf(
|
||||
|
|
@ -150,6 +151,7 @@ sealed class WcAnalyticEvents(
|
|||
AnalyticsParam.Key.METHOD_NAME to rawRequest.request.method,
|
||||
AnalyticsParam.Key.BLOCKCHAIN to network.name,
|
||||
AnalyticsParam.Key.ERROR_CODE to errorCode,
|
||||
AnalyticsParam.Key.ERROR_MESSAGE to errorMessage,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
# https://github.com/tangem/tangem-sdk-android/
|
||||
# https://github.com/tangem/vico
|
||||
|
||||
tangemBlockchainSdk = "releases-5.28-1217"
|
||||
tangemBlockchainSdk = "releases-5.28-1218"
|
||||
#tangemBlockchainSdk = "0.0.1" # Keep it! - used for local builds
|
||||
tangemCardSdk = "releases-5.28-559"
|
||||
#tangemCardSdk = "0.0.1" # Keep it! - used for local builds ^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue