import { isSolanaWallet } from '@dynamic-labs/solana'; import { dynamicClient } from '<path to client file>'; const wallet = dynamicClient.wallets.primary; if (!wallet || !isSolanaWallet(wallet)) { throw new Error('This wallet is not a Solana wallet'); } const connection = dynamicClient.solana.getConnection();
To override the default Web3.js Connection settings (e.g. commitment, RPC URLs), pass options to the client’s Solana extension: dynamicClient.solana.getConnection({ commitment: 'confirmed', ... }) (see Get Connection above).