Updated on 2026-08-14
This commit is contained in:
parent
0f72ef3b9f
commit
f5e56b881e
1 changed files with 18 additions and 13 deletions
|
|
@ -19,6 +19,7 @@ import kotlinx.coroutines.flow.Flow
|
|||
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||
import timber.log.Timber
|
||||
|
||||
@Suppress("LargeClass")
|
||||
internal class DefaultLegacyWalletConnectRepository(
|
||||
private val application: Application,
|
||||
private val wcRequestDeserializer: WcJrpcRequestsDeserializer,
|
||||
|
|
@ -72,19 +73,23 @@ internal class DefaultLegacyWalletConnectRepository(
|
|||
}
|
||||
}
|
||||
|
||||
WalletKit.initialize(Wallet.Params.Init(core = CoreClient)) { error ->
|
||||
Timber.e("Error while initializing Web3Wallet: $error")
|
||||
scope.launch {
|
||||
_events.emit(
|
||||
WalletConnectEvents.SessionApprovalError(
|
||||
WalletConnectError.ExternalApprovalError(error.throwable.message),
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val walletDelegate = defineWalletDelegate()
|
||||
WalletKit.setWalletDelegate(walletDelegate)
|
||||
WalletKit.initialize(
|
||||
Wallet.Params.Init(core = CoreClient),
|
||||
onSuccess = {
|
||||
val walletDelegate = defineWalletDelegate()
|
||||
WalletKit.setWalletDelegate(walletDelegate)
|
||||
},
|
||||
onError = { error ->
|
||||
Timber.e("Error while initializing Web3Wallet: $error")
|
||||
scope.launch {
|
||||
_events.emit(
|
||||
WalletConnectEvents.SessionApprovalError(
|
||||
WalletConnectError.ExternalApprovalError(error.throwable.message),
|
||||
),
|
||||
)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
private fun defineWalletDelegate(): WalletKit.WalletDelegate {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue