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