From 23bb5b247e475e65ec3ef542f2086883a963fb0e Mon Sep 17 00:00:00 2001 From: poocart <7067483+poocart@users.noreply.github.com> Date: Thu, 24 Aug 2023 14:07:47 +0300 Subject: [PATCH] chore --- src/sdk/sdk.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 68fc23e..b68383f 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -203,11 +203,10 @@ export class Sdk { constructor(walletProvider: WalletProviderLike, optionsLike?: EnvNames | SdkOptions) { let options: SdkOptions = {}; + let walletConnectProvider; if (isWalletConnectProvider(walletProvider)) { - walletProvider = new WalletConnect2WalletProvider(walletProvider as EthereumProvider); - } - - if (!isWalletProvider(walletProvider)) { + walletConnectProvider = new WalletConnect2WalletProvider(walletProvider as EthereumProvider); + } else if (!isWalletProvider(walletProvider)) { throw new Exception('Invalid wallet provider'); } @@ -250,7 +249,7 @@ export class Sdk { this.services = { networkService: new NetworkService(networkOptions, networkName), - walletService: new WalletService(walletProvider, { + walletService: new WalletService(walletConnectProvider ?? walletProvider, { omitProviderNetworkCheck: omitWalletProviderNetworkCheck, }), sessionService: new SessionService({