Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
poocart committed Aug 24, 2023
1 parent f1de770 commit 23bb5b2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/sdk/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down Expand Up @@ -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({
Expand Down

0 comments on commit 23bb5b2

Please sign in to comment.