Using the Solana Wallet Adapter

If your dApp uses the Solana Wallet Adapter, you just have to add the Solflare Wallet Adapter to the list of supported wallets.

Install the latest wallets package with

npm install @solana/wallet-adapter-wallets@latest

Then update the code to look like this:

import {
  SolflareWalletAdapter,
  /* ... other adapters ... */
} from '@solana/wallet-adapter-wallets';

const wallets = useMemo(
  () => [
    new SolflareWalletAdapter(),
    // ... other adapters ...
  ],
  []
);

<WalletProvider autoConnect wallets={wallets}>

Alternatively, you can install only the Solflare adapter directly

npm install @solana/wallet-adapter-solflare@latest

Then update the code:

import { SolflareWalletAdapter } from '@solana/wallet-adapter-solflare';
import { /* ... other adapters ... */ } from '@solana/wallet-adapter-wallets';


const wallets = useMemo(
  () => [
    new SolflareWalletAdapter(),
    // ... other adapters ...
  ],
  []
);

<WalletProvider autoConnect wallets={wallets}>

Last updated