UNPKG

@web3auth/no-modal

Version:
20 lines (17 loc) 883 B
import { SolanaSignMessage, SolanaSignTransaction, SolanaSignAndSendTransaction } from '@solana/wallet-standard-features'; import { getWallets } from '@wallet-standard/app'; export { getWallets as createSolanaMipd } from '@wallet-standard/app'; import { StandardConnect } from '@wallet-standard/features'; import { walletStandardConnector } from './walletStandardConnector.js'; const hasSolanaWalletStandardFeatures = wallet => { const { chains, features } = wallet; const isSolana = chains.some(chain => chain.startsWith("solana")); if (!isSolana) return; const hasRequiredFeatures = [StandardConnect, SolanaSignMessage, SolanaSignTransaction, SolanaSignAndSendTransaction].every(feature => Object.keys(features).includes(feature)); if (!hasRequiredFeatures) return false; return true; }; export { hasSolanaWalletStandardFeatures, walletStandardConnector };