Introduction

The Solana wallet connectors will generally have a couple of extra methods. Specifically, in order to interact using public actions with Solana.

Checking if a wallet is a Solana wallet

You can use the isSolanaWallet helper method to check if a wallet is a Solana wallet. That way, TypeScript will know which methods are available to you.

import { isSolanaWallet } from '@dynamic-labs/solana';

if (!isSolanaWallet(wallet)) {
  throw new Error('This wallet is not a Solana wallet');
}

const connection = await primaryWallet.getConnection();

Solana Wallet

MethodDescription
getConnection(): Promise<Connection>Retrieves the RPC connection
getSigner(): Promise<ISolana>Retrieves the solana signer for the wallet.

Examples

You can find examples of how to interact with Solana wallets in the examples section: