Skip to content

Commit

Permalink
feat(solana): Add Solflare (metamask snap) wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
gin-lsl committed Apr 11, 2024
1 parent 6b681e0 commit a35978b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
9 changes: 8 additions & 1 deletion packages/solana/src/wallets/built-in.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
import {
metadata_Backpack,
metadata_CoinbaseWallet,
metadata_MetaMask,
metadata_OkxWallet,
metadata_Phantom,
metadata_Trust,
metadata_WalletConnect,
} from '@ant-design/web3-assets';
import { CoinbaseWalletAdapter, TrustWalletAdapter } from '@solana/wallet-adapter-wallets';
import {
CoinbaseWalletAdapter,
SolflareWalletAdapter,
TrustWalletAdapter,
} from '@solana/wallet-adapter-wallets';

import { WalletConnectWalletAdapter } from '../wallet-connect-adapter';
import { StandardWalletFactory, WalletConnectWalletFactory, WalletFactory } from './factory';

export const CoinbaseWallet = () =>
WalletFactory(new CoinbaseWalletAdapter(), metadata_CoinbaseWallet);
export const TrustWallet = () => WalletFactory(new TrustWalletAdapter(), metadata_Trust);
export const MetamaskSnapWallet = () =>
WalletFactory(new SolflareWalletAdapter(), metadata_MetaMask);

export const PhantomWallet = () => StandardWalletFactory(metadata_Phantom);
export const OKXWallet = () => StandardWalletFactory(metadata_OkxWallet);
Expand Down
12 changes: 10 additions & 2 deletions packages/web3/src/solana/demos/more-wallets.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { ConnectButton, Connector } from '@ant-design/web3';
import { CoinbaseWallet, PhantomWallet, SolanaWeb3ConfigProvider } from '@ant-design/web3-solana';
import {
CoinbaseWallet,
MetamaskSnapWallet,
PhantomWallet,
SolanaWeb3ConfigProvider,
} from '@ant-design/web3-solana';

const App: React.FC = () => {
return (
<SolanaWeb3ConfigProvider autoConnect wallets={[CoinbaseWallet(), PhantomWallet()]}>
<SolanaWeb3ConfigProvider
autoConnect
wallets={[CoinbaseWallet(), PhantomWallet(), MetamaskSnapWallet()]}
>
<Connector>
<ConnectButton />
</Connector>
Expand Down

0 comments on commit a35978b

Please sign in to comment.