From 0accec81e0e4966157da5c27fef75e6f4d726bef Mon Sep 17 00:00:00 2001 From: gooxp Date: Wed, 28 Feb 2024 19:15:27 +0400 Subject: [PATCH] Removed address type from wallet connect connector --- packages/solana/src/connectors/WalletConnectConnector.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/solana/src/connectors/WalletConnectConnector.ts b/packages/solana/src/connectors/WalletConnectConnector.ts index f3a0fc03fa..e3ec97888a 100644 --- a/packages/solana/src/connectors/WalletConnectConnector.ts +++ b/packages/solana/src/connectors/WalletConnectConnector.ts @@ -5,7 +5,6 @@ import { SolStoreUtil } from '@web3modal/scaffold-utils/solana' import { UniversalProviderFactory } from './universalProvider' -import type { Address } from '@web3modal/scaffold-utils/solana' import type UniversalProvider from '@walletconnect/universal-provider' import type { Connector } from './BaseConnector' @@ -77,7 +76,7 @@ export class WalletConnectConnector extends BaseConnector implements Connector { UniversalProviderFactory.getProvider().then(provider => { if (provider.session?.namespaces['solana']?.accounts?.length) { const [defaultAccount] = provider.session.namespaces['solana'].accounts - const address = defaultAccount?.split(':')[2] as Address + const address = defaultAccount?.split(':')[2] ?? "" SolStoreUtil.setIsConnected(true) SolStoreUtil.setAddress(address) } @@ -241,7 +240,7 @@ export class WalletConnectConnector extends BaseConnector implements Connector { }) .then(providerResult => { if (!providerResult) { throw new Error('Failed connection.') } - const address = providerResult.namespaces['solana']?.accounts[0]?.split(':')[2] as Address ?? null + const address = providerResult.namespaces['solana']?.accounts[0]?.split(':')[2] ?? null if (address && this.qrcode) { resolve(address) } else { reject(new Error('Could not resolve address')) }