Skip to content

Commit

Permalink
Removed address type from wallet connect connector
Browse files Browse the repository at this point in the history
  • Loading branch information
gooxpf committed Feb 28, 2024
1 parent 2a208a3 commit 0accec8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/solana/src/connectors/WalletConnectConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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')) }
Expand Down

0 comments on commit 0accec8

Please sign in to comment.