Skip to content

Commit

Permalink
fix: resolve issue with connecting to solana namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
RyukTheCoder authored and yeager-eren committed Jan 29, 2025
1 parent 74179d2 commit 1bde858
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions wallets/shared/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,15 @@ export const evmChainsToRpcMap = (
};

export const getSolanaAccounts: Connect = async ({ instance }) => {
// Asking for account from wallet.
const solanaResponse = await instance.connect();
let account = '';
if (instance.isConnected && instance.publicKey) {
account = instance.publicKey.toString();
} else {
// Asking for account from wallet if not connected or no public key available.
const solanaResponse = await instance.connect();
account = solanaResponse.publicKey.toString();
}

const account = solanaResponse.publicKey.toString();
return {
accounts: [account],
chainId: Networks.SOLANA,
Expand Down

0 comments on commit 1bde858

Please sign in to comment.