A solana wallet adapter for testing on browser.
$ npm install solana-wallet-adapter-browser-test
# or yarn
$ yarn add solana-wallet-adapter-browser-test
# or pnpm
$ pnpm add solana-wallet-adapter-browser-test
import { useMemo } from "react";
import { WalletProvider } from "@solana/wallet-adapter-react";
import { Keypair } from "@solana/web3.js";
import {
BrowserTestWalletAdapter,
StaticBrowserTestWallet,
} from "solana-wallet-adapter-browser-test";
const App = (props) => {
const { children } = props;
const wallets = useMemo(
() => [
// Do not use this wallet adapter on production.
...(process.env.NODE_ENV === "production"
? []
: [
new BrowserTestWalletAdapter({
keypair: Keypair.generate(),
}),
new BrowserTestWalletAdapter({
name: "Another BrowserTest Wallet",
wallet: new StaticBrowserTestWallet(Keypair.genrate()),
}),
]),
],
[]
);
return <WalletProvider wallets={wallets}>{children}</WalletProvider>;
};
MIT © Gwon Seonggwang