@solana/connector 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-TAAXHAV2.mjs → chunk-4K6QY4HR.mjs} +4 -4
- package/dist/{chunk-TAAXHAV2.mjs.map → chunk-4K6QY4HR.mjs.map} +1 -1
- package/dist/{chunk-EGYXJT54.mjs → chunk-F2QJH5ED.mjs} +3 -3
- package/dist/{chunk-EGYXJT54.mjs.map → chunk-F2QJH5ED.mjs.map} +1 -1
- package/dist/{chunk-P4ZLJI4L.js → chunk-JS4KJ2KK.js} +17 -17
- package/dist/{chunk-P4ZLJI4L.js.map → chunk-JS4KJ2KK.js.map} +1 -1
- package/dist/{chunk-P5A3XNFF.js → chunk-RIBOPAOD.js} +4 -4
- package/dist/{chunk-P5A3XNFF.js.map → chunk-RIBOPAOD.js.map} +1 -1
- package/dist/{chunk-D4JGBIP7.js → chunk-SJEZHNYF.js} +11 -11
- package/dist/{chunk-D4JGBIP7.js.map → chunk-SJEZHNYF.js.map} +1 -1
- package/dist/{chunk-6PBQ5CXV.mjs → chunk-WXYUUCSD.mjs} +3 -3
- package/dist/{chunk-6PBQ5CXV.mjs.map → chunk-WXYUUCSD.mjs.map} +1 -1
- package/dist/headless.js +111 -111
- package/dist/headless.mjs +2 -2
- package/dist/index.js +126 -126
- package/dist/index.mjs +3 -3
- package/dist/react.js +16 -16
- package/dist/react.mjs +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { installPolyfills, ConnectorErrorBoundary, isMainnetCluster, isDevnetCluster, isTestnetCluster, isLocalCluster, getClusterExplorerUrl, getClusterType, formatAddress, copyAddressToClipboard, createTransactionSigner, createGillTransactionSigner, NetworkError, ConnectorClient } from './chunk-
|
|
1
|
+
import { installPolyfills, ConnectorErrorBoundary, isMainnetCluster, isDevnetCluster, isTestnetCluster, isLocalCluster, getClusterExplorerUrl, getClusterType, formatAddress, copyAddressToClipboard, createTransactionSigner, createGillTransactionSigner, NetworkError, ConnectorClient } from './chunk-4K6QY4HR.mjs';
|
|
2
2
|
import { createLogger } from './chunk-5ZUVZZWU.mjs';
|
|
3
3
|
import React, { createContext, useContext, useSyncExternalStore, useMemo, useState, useCallback, useRef } from 'react';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -294,5 +294,5 @@ function useTransactionPreparer() {
|
|
|
294
294
|
}
|
|
295
295
|
|
|
296
296
|
export { ConnectorProvider, UnifiedProvider, useAccount, useCluster, useConnector, useConnectorClient, useGillSolanaClient, useGillTransactionSigner, useTransactionPreparer, useTransactionSigner, useWalletInfo };
|
|
297
|
-
//# sourceMappingURL=chunk-
|
|
298
|
-
//# sourceMappingURL=chunk-
|
|
297
|
+
//# sourceMappingURL=chunk-F2QJH5ED.mjs.map
|
|
298
|
+
//# sourceMappingURL=chunk-F2QJH5ED.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/connector-provider.tsx","../src/ui/unified-provider.tsx","../src/hooks/use-cluster.ts","../src/hooks/use-account.ts","../src/hooks/use-wallet-info.ts","../src/hooks/use-transaction-signer.ts","../src/hooks/use-gill-transaction-signer.ts","../src/hooks/use-gill-solana-client.ts","../src/hooks/use-transaction-preparer.ts"],"names":["jsx","useMemo","React","logger","useCallback"],"mappings":";;;;;;AAWA,IAAM,MAAA,GAAS,aAAa,mBAAmB,CAAA;AAE/C,gBAAA,EAAiB;AAcV,IAAM,gBAAA,GAAmB,cAAsC,IAAI,CAAA;AAC1E,gBAAA,CAAiB,WAAA,GAAc,kBAAA;AAe/B,SAAS,yBAAA,CAA0B;AAAA,EAC/B,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACJ,CAAA,EAIG;AACC,EAAA,IAAM,YAAY,MAAA,CAA+B,IAAI,GAgC/C,MAAA,GA9BY,KAAA,CAAM,YAAY,MAAM;AACtC,IAAA,IAAI,CAAC,SAAA,CAAU,OAAA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ext, useContext, useMemo, useRef, useSyncExternalStore } from 'react';\nimport type { ReactNode } from 'react';\nimport { ConnectorClient } from '../lib/core/connector-client';\nimport type { ConnectorConfig } from '../types/connector';\nimport type { ExtendedConnectorConfig } from '../config/default-config';\nimport { ConnectorErrorBoundary } from './error-boundary';\nimport { installPolyfills } from '../lib/utils/polyfills';\nimport { createLogger } from '../lib/utils/secure-logger';\n\nconst logger = createLogger('ConnectorProvider');\n\ninstallPolyfills();\n\ndeclare global {\n interface Window {\n __connectorClient?: ConnectorClient;\n }\n}\n\nexport type ConnectorSnapshot = ReturnType<ConnectorClient['getSnapshot']> & {\n select: (walletName: string) => Promise<void>;\n disconnect: () => Promise<void>;\n selectAccount: (address: string) => Promise<void>;\n};\n\nexport const ConnectorContext = createContext<ConnectorClient | null>(null);\nConnectorContext.displayName = 'ConnectorContext';\n\nexport interface MobileWalletAdapterConfig {\n appIdentity: {\n name: string;\n uri?: string;\n icon?: string;\n };\n remoteHostAuthority?: string;\n chains?: readonly string[];\n authorizationCache?: unknown;\n chainSelector?: unknown;\n onWalletNotFound?: (wallet: unknown) => Promise<void>;\n}\n\nfunction ConnectorProviderInternal({\n children,\n config,\n mobile,\n}: {\n children: ReactNode;\n config?: ConnectorConfig;\n mobile?: MobileWalletAdapterConfig;\n}) {\n const clientRef = useRef<ConnectorClient | null>(null);\n\n const getClient = React.useCallback(() => {\n if (!clientRef.current) {\n try {\n clientRef.current = new ConnectorClient(config);\n\n if (typeof window !== 'undefined') {\n window.__connectorClient = clientRef.current;\n }\n\n if (config?.debug) {\n logger.info('Client initialized successfully');\n }\n } catch (error) {\n const err = error as Error;\n logger.error('Failed to initialize client', { error: err });\n\n const extendedConfig = config as ExtendedConnectorConfig;\n if (extendedConfig?.errorBoundary?.onError) {\n extendedConfig.errorBoundary.onError(err, {\n componentStack: 'client-initialization',\n digest: `constructor-${new Date().toISOString()}`,\n });\n }\n\n return null;\n }\n }\n return clientRef.current;\n }, [config]);\n\n const client = getClient();\n\n React.useEffect(() => {\n const currentClient = clientRef.current;\n\n if (currentClient) {\n const privateClient = currentClient as unknown as { initialize?: () => void };\n if (privateClient.initialize && typeof privateClient.initialize === 'function') {\n privateClient.initialize();\n }\n }\n\n return () => {\n if (typeof window !== 'undefined') {\n window.__connectorClient = undefined;\n }\n if (currentClient && typeof currentClient.destroy === 'function') {\n currentClient.destroy();\n }\n };\n }, []);\n\n React.useEffect(() => {\n if (!mobile) return;\n let cancelled = false;\n (async () => {\n try {\n const mod = (await import(\n '@solana-mobile/wallet-standard-mobile'\n )) as typeof import('@solana-mobile/wallet-standard-mobile');\n if (cancelled) return;\n const {\n registerMwa,\n createDefaultAuthorizationCache,\n createDefaultChainSelector,\n createDefaultWalletNotFoundHandler,\n } = mod;\n const defaultChains: readonly `${string}:${string}`[] = [\n 'solana:mainnet',\n 'solana:devnet',\n 'solana:testnet',\n ];\n registerMwa({\n appIdentity: mobile.appIdentity,\n authorizationCache: mobile.authorizationCache ?? (createDefaultAuthorizationCache() as any),\n chains: (mobile.chains ?? defaultChains) as `${string}:${string}`[],\n chainSelector: mobile.chainSelector ?? (createDefaultChainSelector() as any),\n remoteHostAuthority: mobile.remoteHostAuthority,\n onWalletNotFound: mobile.onWalletNotFound ?? createDefaultWalletNotFoundHandler(),\n });\n } catch (e) {\n // Failed to register Mobile Wallet Adapter\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [mobile]);\n\n return <ConnectorContext.Provider value={client}>{children}</ConnectorContext.Provider>;\n}\n\nexport function ConnectorProvider({\n children,\n config,\n mobile,\n}: {\n children: ReactNode;\n config?: ExtendedConnectorConfig;\n mobile?: MobileWalletAdapterConfig;\n}) {\n const extendedConfig = config as ExtendedConnectorConfig;\n const errorBoundaryConfig = extendedConfig?.errorBoundary;\n\n if (!errorBoundaryConfig?.enabled) {\n return (\n <ConnectorProviderInternal config={config} mobile={mobile}>\n {children}\n </ConnectorProviderInternal>\n );\n }\n\n return (\n <ConnectorErrorBoundary\n maxRetries={errorBoundaryConfig.maxRetries ?? 3}\n onError={errorBoundaryConfig.onError}\n fallback={errorBoundaryConfig.fallback}\n >\n <ConnectorProviderInternal config={config} mobile={mobile}>\n {children}\n </ConnectorProviderInternal>\n </ConnectorErrorBoundary>\n );\n}\n\nexport function useConnector(): ConnectorSnapshot {\n const client = useContext(ConnectorContext);\n if (!client) {\n throw new Error(\n 'useConnector must be used within ConnectorProvider. ' +\n 'Wrap your app with <ConnectorProvider> or <UnifiedProvider> to use connector hooks.',\n );\n }\n\n const state = useSyncExternalStore(\n React.useCallback(cb => client.subscribe(cb), [client]),\n React.useCallback(() => client.getSnapshot(), [client]),\n React.useCallback(() => client.getSnapshot(), [client]),\n );\n\n const methods = useMemo(\n () => ({\n select: client.select.bind(client),\n disconnect: client.disconnect.bind(client),\n selectAccount: client.selectAccount.bind(client),\n }),\n [client],\n );\n\n return useMemo(\n () => ({\n ...state,\n ...methods,\n }),\n [state, methods],\n );\n}\n\nexport function useConnectorClient(): ConnectorClient | null {\n return useContext(ConnectorContext);\n}\n","'use client';\n\nimport type { ReactNode, ComponentType, PropsWithChildren } from 'react';\nimport { ConnectorProvider } from './connector-provider';\nimport type { MobileWalletAdapterConfig } from './connector-provider';\nimport type { ConnectorConfig } from '../types/connector';\nimport type { UnifiedConfig } from '../config/unified-config';\n\nexport interface UnifiedProviderProps {\n children: ReactNode;\n\n // NEW: Option 1 - Pass UnifiedConfig directly (recommended)\n config?: UnifiedConfig;\n\n // OLD: Option 2 - Pass configs separately (backward compatible)\n connectorConfig?: ConnectorConfig;\n mobile?: MobileWalletAdapterConfig;\n\n // Optional additional providers to wrap around children\n providers?: Array<{\n component: ComponentType<PropsWithChildren>;\n props?: Record<string, unknown>;\n }>;\n}\n\nexport function UnifiedProvider({ children, config, connectorConfig, mobile, providers = [] }: UnifiedProviderProps) {\n // Handle both new and old patterns\n const actualConnectorConfig = config?.connectorConfig ?? connectorConfig;\n const actualMobile = config?.mobile ?? mobile;\n\n // Start with connector provider as the base\n let content = (\n <ConnectorProvider config={actualConnectorConfig} mobile={actualMobile}>\n {children}\n </ConnectorProvider>\n );\n\n // Wrap with additional providers in reverse order\n // so they nest properly (first provider is outermost)\n for (let i = providers.length - 1; i >= 0; i--) {\n const { component: Provider, props = {} } = providers[i];\n content = <Provider {...props}>{content}</Provider>;\n }\n\n return content;\n}\n\n// Export with practical alias\nexport { UnifiedProvider as AppProvider };\n","/**\n * @solana/connector - useCluster hook\n *\n * React hook for managing Solana cluster (network) state\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport type { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';\nimport { useConnector, useConnectorClient } from '../ui/connector-provider';\nimport {\n getClusterExplorerUrl,\n isMainnetCluster,\n isDevnetCluster,\n isTestnetCluster,\n isLocalCluster,\n getClusterType,\n type ClusterType,\n} from '../utils/cluster';\n\nexport interface UseClusterReturn {\n /** Currently active cluster */\n cluster: SolanaCluster | null;\n /** All available clusters */\n clusters: SolanaCluster[];\n /** Set the active cluster */\n setCluster: (id: SolanaClusterId) => Promise<void>;\n /** Whether the current cluster is mainnet */\n isMainnet: boolean;\n /** Whether the current cluster is devnet */\n isDevnet: boolean;\n /** Whether the current cluster is testnet */\n isTestnet: boolean;\n /** Whether the current cluster is running locally */\n isLocal: boolean;\n /** Solana Explorer base URL for the current cluster */\n explorerUrl: string;\n /** Cluster type (mainnet, devnet, testnet, localnet, custom) */\n type: ClusterType | null;\n}\n\n/**\n * Hook for managing Solana cluster (network) selection\n *\n * @example\n * ```tsx\n * function ClusterSwitcher() {\n * const { cluster, clusters, setCluster, isMainnet } = useCluster()\n *\n * return (\n * <select\n * value={cluster?.id}\n * onChange={(e) => setCluster(e.target.value as SolanaClusterId)}\n * >\n * {clusters.map(c => (\n * <option key={c.id} value={c.id}>{c.label}</option>\n * ))}\n * </select>\n * )\n * }\n * ```\n */\nexport function useCluster(): UseClusterReturn {\n const { cluster, clusters } = useConnector();\n const client = useConnectorClient();\n\n if (!client) {\n throw new Error('useCluster must be used within ConnectorProvider');\n }\n\n const setCluster = useMemo(\n () => async (id: SolanaClusterId) => {\n await client.setCluster(id);\n },\n [client],\n );\n\n return useMemo(() => {\n const isMainnet = cluster ? isMainnetCluster(cluster) : false;\n const isDevnet = cluster ? isDevnetCluster(cluster) : false;\n const isTestnet = cluster ? isTestnetCluster(cluster) : false;\n const isLocal = cluster ? isLocalCluster(cluster) : false;\n const explorerUrl = cluster ? getClusterExplorerUrl(cluster) : '';\n const type = cluster ? getClusterType(cluster) : null;\n\n return {\n cluster,\n clusters,\n setCluster,\n isMainnet,\n isDevnet,\n isTestnet,\n isLocal,\n explorerUrl,\n type,\n };\n }, [cluster, clusters, setCluster]);\n}\n","/**\n * useAccount hook\n */\n\n'use client';\n\nimport React, { useState, useCallback, useMemo } from 'react';\nimport { useConnector } from '../ui/connector-provider';\nimport { copyAddressToClipboard, formatAddress, ClipboardErrorType, type ClipboardResult } from '../utils';\nimport type { AccountInfo } from '../types/accounts';\nimport { COPY_FEEDBACK_DURATION_MS } from '../lib/constants';\n\nexport interface UseAccountReturn {\n /** The connected wallet address */\n address: string | null;\n /** Full account info object */\n account: AccountInfo | null;\n /** Whether a wallet is connected */\n connected: boolean;\n /** Shortened formatted address for display */\n formatted: string;\n /** Copy the address to clipboard with enhanced result */\n copy: () => Promise<ClipboardResult>;\n /** Whether the address was recently copied */\n copied: boolean;\n /** All available accounts from the connected wallet */\n accounts: AccountInfo[];\n /** Select a different account from the connected wallet */\n selectAccount: (address: string) => Promise<void>;\n}\n\nexport function useAccount(): UseAccountReturn {\n const { selectedAccount, accounts, connected, selectAccount } = useConnector();\n const [copied, setCopied] = useState(false);\n const copyTimeoutRef = React.useRef<NodeJS.Timeout | undefined>(undefined);\n\n const account = useMemo(\n () => accounts.find((a: AccountInfo) => a.address === selectedAccount) ?? null,\n [accounts, selectedAccount],\n );\n\n const formatted = useMemo(() => (selectedAccount ? formatAddress(selectedAccount) : ''), [selectedAccount]);\n\n const copy = useCallback(async (): Promise<ClipboardResult> => {\n if (!selectedAccount) {\n return {\n success: false,\n error: ClipboardErrorType.EMPTY_VALUE,\n errorMessage: 'No account selected',\n };\n }\n\n if (copyTimeoutRef.current) {\n clearTimeout(copyTimeoutRef.current);\n }\n\n const result = await copyAddressToClipboard(selectedAccount, {\n onSuccess: () => {\n setCopied(true);\n copyTimeoutRef.current = setTimeout(() => setCopied(false), COPY_FEEDBACK_DURATION_MS);\n },\n });\n\n return result;\n }, [selectedAccount]);\n\n React.useEffect(() => {\n return () => {\n if (copyTimeoutRef.current) {\n clearTimeout(copyTimeoutRef.current);\n }\n };\n }, []);\n\n return useMemo(\n () => ({\n address: selectedAccount,\n account,\n connected,\n formatted,\n copy,\n copied,\n accounts,\n selectAccount,\n }),\n [selectedAccount, account, connected, formatted, copy, copied, accounts, selectAccount],\n );\n}\n","/**\n * @solana/connector - useWalletInfo hook\n *\n * React hook for getting information about the connected wallet\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport { useConnector } from '../ui/connector-provider';\nimport type { WalletInfo } from '../types/wallets';\n\n/**\n * Simplified wallet information for display purposes\n */\nexport interface WalletDisplayInfo {\n /** Wallet name */\n name: string;\n /** Wallet icon/logo URL if available */\n icon?: string;\n /** Whether the wallet extension is installed */\n installed: boolean;\n /** Whether the wallet supports Solana connections */\n connectable?: boolean;\n}\n\n/**\n * Return value from useWalletInfo hook\n */\nexport interface UseWalletInfoReturn {\n /** Name of the connected wallet (e.g., 'Phantom', 'Solflare') */\n name: string | null;\n /** Wallet icon/logo URL if available */\n icon: string | null;\n /** Whether the wallet extension is installed */\n installed: boolean;\n /** Whether the wallet supports Solana connections */\n connectable: boolean;\n /** Whether currently connected to the wallet */\n connected: boolean;\n /** Whether a connection attempt is in progress */\n connecting: boolean;\n /** All available wallets */\n wallets: WalletDisplayInfo[];\n}\n\n/**\n * Hook for getting information about the connected wallet\n * Provides wallet metadata, connection status, and capabilities\n *\n * @example\n * ```tsx\n * function WalletBadge() {\n * const { name, icon, connected, connecting } = useWalletInfo()\n *\n * if (connecting) return <p>Connecting...</p>\n * if (!connected) return <p>No wallet connected</p>\n *\n * return (\n * <div>\n * {icon && <img src={icon} alt={name} />}\n * <span>{name}</span>\n * </div>\n * )\n * }\n * ```\n */\nexport function useWalletInfo(): UseWalletInfoReturn {\n const { selectedWallet, wallets, connected, connecting } = useConnector();\n\n // Map WalletInfo[] to WalletDisplayInfo[] for simplified consumption\n const mappedWallets = useMemo<WalletDisplayInfo[]>(\n () =>\n wallets.map(\n (walletInfo: WalletInfo): WalletDisplayInfo => ({\n name: walletInfo.wallet.name,\n icon: walletInfo.wallet.icon,\n installed: walletInfo.installed,\n connectable: walletInfo.connectable,\n }),\n ),\n [wallets],\n );\n\n // Extract information about the currently selected wallet\n const selectedWalletInfo = useMemo(() => {\n if (!selectedWallet) {\n return {\n name: null,\n icon: null,\n installed: false,\n connectable: false,\n };\n }\n\n // Find the WalletInfo for the selected wallet\n const walletInfo = wallets.find((w: WalletInfo) => w.wallet.name === selectedWallet.name);\n\n return {\n name: selectedWallet.name,\n icon: selectedWallet.icon ?? null,\n installed: walletInfo?.installed ?? false,\n connectable: walletInfo?.connectable ?? false,\n };\n }, [selectedWallet, wallets]);\n\n return useMemo(\n () => ({\n ...selectedWalletInfo,\n connected,\n connecting,\n wallets: mappedWallets,\n }),\n [selectedWalletInfo, connected, connecting, mappedWallets],\n );\n}\n","/**\n * useTransactionSigner hook\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport { useConnector } from '../ui/connector-provider';\nimport { useConnectorClient } from '../ui/connector-provider';\nimport { createTransactionSigner, type TransactionSigner } from '../lib/transaction/transaction-signer';\nimport type { TransactionSignerCapabilities } from '../types/transactions';\n\n/**\n * Return value from useTransactionSigner hook\n */\nexport interface UseTransactionSignerReturn {\n /**\n * Transaction signer instance (null if not connected)\n * Use this to sign and send transactions\n */\n signer: TransactionSigner | null;\n\n /**\n * Whether a signer is available and ready to use\n * Useful for disabling transaction buttons\n */\n ready: boolean;\n\n /**\n * Current wallet address that will sign transactions\n * Null if no wallet connected\n */\n address: string | null;\n\n /**\n * Signer capabilities (what operations are supported)\n * Always available even if signer is null (shows all false)\n */\n capabilities: TransactionSignerCapabilities;\n}\n\nexport function useTransactionSigner(): UseTransactionSignerReturn {\n const { selectedWallet, selectedAccount, accounts, cluster, connected } = useConnector();\n const client = useConnectorClient();\n\n const account = useMemo(\n () => accounts.find(a => a.address === selectedAccount)?.raw ?? null,\n [accounts, selectedAccount],\n );\n\n const signer = useMemo(() => {\n if (!connected || !selectedWallet || !account) {\n return null;\n }\n\n return createTransactionSigner({\n wallet: selectedWallet,\n account,\n cluster: cluster ?? undefined,\n eventEmitter: client\n ? {\n emit: (event: unknown) => {\n client.emitEvent(event as import('../types/events').ConnectorEvent);\n },\n }\n : undefined,\n });\n }, [connected, selectedWallet, account, cluster, client]);\n\n const capabilities = useMemo(\n () =>\n signer?.getCapabilities() ?? {\n canSign: false,\n canSend: false,\n canSignMessage: false,\n supportsBatchSigning: false,\n },\n [signer],\n );\n\n return {\n signer,\n ready: Boolean(signer),\n address: selectedAccount,\n capabilities,\n };\n}\n","/**\n * @solana/connector - useGillTransactionSigner hook\n *\n * React hook for gill-compatible transaction signing\n * Use this when working with modern Solana libraries (@solana/kit, gill)\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport type { TransactionModifyingSigner } from 'gill';\nimport { useTransactionSigner } from './use-transaction-signer';\nimport { createGillTransactionSigner } from '../lib/transaction/gill-transaction-signer';\n\n/**\n * Return value from useGillTransactionSigner hook\n */\nexport interface UseGillTransactionSignerReturn {\n /**\n * Gill-compatible TransactionModifyingSigner instance (null if not connected)\n * Use this with modern Solana libraries (@solana/kit, gill)\n */\n signer: TransactionModifyingSigner | null;\n\n /**\n * Whether a signer is available and ready to use\n * Useful for disabling transaction buttons\n */\n ready: boolean;\n}\n\n/**\n * Hook for gill-compatible transaction signing\n *\n * Creates a TransactionPartialSigner that's compatible with @solana/kit and gill,\n * enabling seamless integration with modern Solana development patterns.\n *\n * This hook wraps the standard useTransactionSigner and adapts it to gill's\n * interface, allowing you to use modern libraries without type incompatibilities.\n *\n * @example\n * ```tsx\n * import { useGillTransactionSigner } from '@solana/connector';\n * import { getTransferSolInstruction } from 'gill/programs';\n * import { address, pipe, createTransactionMessage } from 'gill';\n *\n * function ModernTransfer() {\n * const { signer, ready } = useGillTransactionSigner();\n *\n * const handleTransfer = async (recipient: string, amount: number) => {\n * if (!signer) return;\n *\n * // Fully type-safe with gill!\n * const instruction = getTransferSolInstruction({\n * source: signer, // No type errors\n * destination: address(recipient),\n * amount\n * });\n *\n * const txMessage = pipe(\n * createTransactionMessage({ version: 0 }),\n * (tx) => setTransactionMessageFeePayerSigner(signer, tx), // Works!\n * // ...\n * );\n * };\n *\n * return (\n * <button onClick={handleTransfer} disabled={!ready}>\n * Send with Gill\n * </button>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // For backward compatibility, continue using useTransactionSigner\n * import { useTransactionSigner } from '@solana/connector';\n *\n * function LegacyTransfer() {\n * const { signer } = useTransactionSigner(); // Wallet adapter compatible\n * // Works with @solana/web3.js v1 and wallet-adapter\n * }\n * ```\n */\nexport function useGillTransactionSigner(): UseGillTransactionSignerReturn {\n const { signer: connectorSigner, ready } = useTransactionSigner();\n\n const gillSigner = useMemo(() => {\n if (!connectorSigner) return null;\n return createGillTransactionSigner(connectorSigner);\n }, [connectorSigner]);\n\n return {\n signer: gillSigner,\n ready,\n };\n}\n","/**\n * @solana/connector - useGillSolanaClient hook\n *\n * React hook for Gill's SolanaClient with built-in RPC and WebSocket subscriptions\n * Provides rpc, rpcSubscriptions, sendAndConfirmTransaction, and simulateTransaction\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport { createSolanaClient, type SolanaClient, type ModifiedClusterUrl } from 'gill';\nimport { useCluster } from './use-cluster';\nimport { useConnectorClient } from '../ui/connector-provider';\nimport type { ClusterType } from '../utils/cluster';\nimport { createLogger } from '../lib/utils/secure-logger';\n\nconst logger = createLogger('useGillSolanaClient');\n\n/**\n * Return value from useGillSolanaClient hook\n */\nexport interface UseGillSolanaClientReturn {\n /**\n * Gill SolanaClient instance with RPC and subscriptions (null if not available)\n * Includes: rpc, rpcSubscriptions, sendAndConfirmTransaction, simulateTransaction\n */\n client: SolanaClient | null;\n\n /**\n * Whether a client is available and ready to use\n */\n ready: boolean;\n\n /**\n * Cluster type (mainnet, devnet, testnet, localnet, custom)\n */\n clusterType: ClusterType | null;\n}\n\n/**\n * Hook for Gill's SolanaClient with automatic RPC and WebSocket subscription management\n *\n * Creates a fully configured SolanaClient based on the current cluster, providing:\n * - Type-safe RPC client\n * - WebSocket subscription client\n * - Built-in sendAndConfirmTransaction helper\n * - Built-in simulateTransaction helper\n *\n * The client is automatically recreated when the cluster changes.\n *\n * @example\n * ```tsx\n * import { useGillSolanaClient, useGillTransactionSigner } from '@solana/connector';\n * import { signTransactionMessageWithSigners } from 'gill';\n *\n * function SendTransaction() {\n * const { client, ready } = useGillSolanaClient();\n * const { signer } = useGillTransactionSigner();\n *\n * const handleSend = async (transaction) => {\n * if (!client || !signer) return;\n *\n * // Sign the transaction\n * const signed = await signTransactionMessageWithSigners(transaction);\n *\n * // Send and confirm using Gill's built-in helper\n * await client.sendAndConfirmTransaction(signed, {\n * commitment: 'confirmed'\n * });\n * };\n *\n * return (\n * <button onClick={handleSend} disabled={!ready}>\n * Send Transaction\n * </button>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Simulating a transaction\n * function SimulateTransaction() {\n * const { client } = useGillSolanaClient();\n *\n * const handleSimulate = async (transaction) => {\n * if (!client) return;\n *\n * const simulation = await client.simulateTransaction(transaction, {\n * sigVerify: false,\n * commitment: 'processed'\n * });\n *\n * console.log('Simulation result:', simulation);\n * };\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Direct RPC access\n * function GetBalance() {\n * const { client } = useGillSolanaClient();\n *\n * const fetchBalance = async (address: Address) => {\n * if (!client) return;\n *\n * const balance = await client.rpc.getBalance(address).send();\n * console.log('Balance:', balance);\n * };\n * }\n * ```\n */\nexport function useGillSolanaClient(): UseGillSolanaClientReturn {\n const { type } = useCluster();\n const connectorClient = useConnectorClient();\n\n const client = useMemo(() => {\n if (!type || !connectorClient) return null;\n\n try {\n // For non-custom clusters, use moniker\n if (type !== 'custom') {\n return createSolanaClient({\n urlOrMoniker: type,\n });\n }\n\n // For custom clusters, get RPC URL from connector client\n const rpcUrl = connectorClient.getRpcUrl();\n if (!rpcUrl) return null;\n\n return createSolanaClient({\n urlOrMoniker: rpcUrl as ModifiedClusterUrl,\n });\n } catch (error) {\n logger.error('Failed to create Gill Solana client', { error });\n return null;\n }\n }, [type, connectorClient]);\n\n return {\n client,\n ready: Boolean(client),\n clusterType: type,\n };\n}\n","/**\n * @solana/connector - useTransactionPreparer hook\n *\n * React hook for preparing transactions with automatic optimization\n * Handles blockhash fetching, compute unit limits, and transaction simulation\n */\n\n'use client';\n\nimport { useCallback } from 'react';\nimport {\n prepareTransaction,\n type PrepareTransactionConfig,\n type CompilableTransactionMessage,\n type TransactionMessageWithBlockhashLifetime,\n} from 'gill';\nimport { useGillSolanaClient } from './use-gill-solana-client';\nimport { NetworkError } from '../lib/errors';\n\n/**\n * Options for transaction preparation\n */\nexport interface TransactionPrepareOptions {\n /**\n * Multiplier applied to the simulated compute unit value\n * @default 1.1 (10% buffer)\n */\n computeUnitLimitMultiplier?: number;\n\n /**\n * Whether to force reset the compute unit limit value (if one is already set)\n * using the simulation response and computeUnitLimitMultiplier\n * @default false\n */\n computeUnitLimitReset?: boolean;\n\n /**\n * Whether to force reset the latest blockhash (if one is already set)\n * @default true\n */\n blockhashReset?: boolean;\n}\n\n/**\n * Return value from useTransactionPreparer hook\n */\nexport interface UseTransactionPreparerReturn {\n /**\n * Prepare a transaction for sending\n * Automatically adds:\n * - Compute unit limit (via simulation with optional multiplier)\n * - Latest blockhash (if not already set)\n *\n * @param transaction - The transaction to prepare\n * @param options - Optional preparation settings\n * @returns Prepared transaction with blockhash lifetime set\n */\n prepare: <TMessage extends CompilableTransactionMessage>(\n transaction: TMessage,\n options?: TransactionPrepareOptions,\n ) => Promise<TMessage & TransactionMessageWithBlockhashLifetime>;\n\n /**\n * Whether the preparer is ready to use\n * False if Solana client is not available\n */\n ready: boolean;\n}\n\n/**\n * Hook for preparing transactions with automatic optimization\n *\n * Uses Gill's prepareTransaction utility to:\n * 1. Simulate the transaction to determine optimal compute units\n * 2. Set compute unit limit (with configurable multiplier for safety margin)\n * 3. Fetch and set the latest blockhash (if not already present)\n *\n * This significantly improves transaction landing rates by ensuring proper\n * compute budget allocation and fresh blockhashes.\n *\n * @example\n * ```tsx\n * import { useTransactionPreparer, useGillTransactionSigner } from '@solana/connector';\n * import { pipe, createTransactionMessage, appendTransactionMessageInstructions } from 'gill';\n * import { getTransferSolInstruction } from 'gill/programs';\n *\n * function SendOptimizedTransaction() {\n * const { prepare, ready } = useTransactionPreparer();\n * const { signer } = useGillTransactionSigner();\n * const { client } = useGillSolanaClient();\n *\n * const handleSend = async (recipient: string, amount: bigint) => {\n * if (!ready || !signer || !client) return;\n *\n * // Build transaction message\n * const tx = pipe(\n * createTransactionMessage({ version: 0 }),\n * tx => setTransactionMessageFeePayerSigner(signer, tx),\n * tx => appendTransactionMessageInstructions([\n * getTransferSolInstruction({\n * source: signer,\n * destination: address(recipient),\n * amount: lamports(amount),\n * })\n * ], tx)\n * );\n *\n * // Prepare: auto-adds compute units + blockhash\n * const prepared = await prepare(tx);\n *\n * // Sign\n * const signed = await signTransactionMessageWithSigners(prepared);\n *\n * // Send and confirm\n * await client.sendAndConfirmTransaction(signed);\n * };\n *\n * return (\n * <button onClick={handleSend} disabled={!ready}>\n * Send Optimized Transaction\n * </button>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // With custom compute unit multiplier for high-priority transactions\n * const { prepare } = useTransactionPreparer();\n *\n * const prepared = await prepare(transaction, {\n * computeUnitLimitMultiplier: 1.3, // 30% buffer instead of default 10%\n * blockhashReset: true // Always fetch fresh blockhash\n * });\n * ```\n *\n * @example\n * ```tsx\n * // Force reset compute units even if already set\n * const { prepare } = useTransactionPreparer();\n *\n * const prepared = await prepare(transaction, {\n * computeUnitLimitReset: true, // Re-simulate and reset compute units\n * computeUnitLimitMultiplier: 1.2\n * });\n * ```\n */\nexport function useTransactionPreparer(): UseTransactionPreparerReturn {\n const { client, ready } = useGillSolanaClient();\n\n const prepare = useCallback(\n async <TMessage extends CompilableTransactionMessage>(\n transaction: TMessage,\n options: TransactionPrepareOptions = {},\n ): Promise<TMessage & TransactionMessageWithBlockhashLifetime> => {\n if (!client) {\n throw new NetworkError('RPC_ERROR', 'Solana client not available. Cannot prepare transaction.');\n }\n\n return prepareTransaction({\n transaction,\n rpc: client.rpc,\n computeUnitLimitMultiplier: options.computeUnitLimitMultiplier,\n computeUnitLimitReset: options.computeUnitLimitReset,\n blockhashReset: options.blockhashReset,\n });\n },\n [client],\n );\n\n return {\n prepare,\n ready,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/connector-provider.tsx","../src/ui/unified-provider.tsx","../src/hooks/use-cluster.ts","../src/hooks/use-account.ts","../src/hooks/use-wallet-info.ts","../src/hooks/use-transaction-signer.ts","../src/hooks/use-gill-transaction-signer.ts","../src/hooks/use-gill-solana-client.ts","../src/hooks/use-transaction-preparer.ts"],"names":["jsx","useMemo","React","logger","useCallback"],"mappings":";;;;;;AAWA,IAAM,MAAA,GAAS,aAAa,mBAAmB,CAAA;AAE/C,gBAAA,EAAiB;AAcV,IAAM,gBAAA,GAAmB,cAAsC,IAAI,CAAA;AAC1E,gBAAA,CAAiB,WAAA,GAAc,kBAAA;AAe/B,SAAS,yBAAA,CAA0B;AAAA,EAC/B,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACJ,CAAA,EAIG;AACC,EAAA,IAAM,YAAY,MAAA,CAA+B,IAAI,GAgC/C,MAAA,GA9BY,KAAA,CAAM,YAAY,MAAM;AACtC,IAAA,IAAI,CAAC,SAAA,CAAU,OAAA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Context, useContext, useMemo, useRef, useSyncExternalStore } from 'react';\nimport type { ReactNode } from 'react';\nimport { ConnectorClient } from '../lib/core/connector-client';\nimport type { ConnectorConfig } from '../types/connector';\nimport type { ExtendedConnectorConfig } from '../config/default-config';\nimport { ConnectorErrorBoundary } from './error-boundary';\nimport { installPolyfills } from '../lib/utils/polyfills';\nimport { createLogger } from '../lib/utils/secure-logger';\n\nconst logger = createLogger('ConnectorProvider');\n\ninstallPolyfills();\n\ndeclare global {\n interface Window {\n __connectorClient?: ConnectorClient;\n }\n}\n\nexport type ConnectorSnapshot = ReturnType<ConnectorClient['getSnapshot']> & {\n select: (walletName: string) => Promise<void>;\n disconnect: () => Promise<void>;\n selectAccount: (address: string) => Promise<void>;\n};\n\nexport const ConnectorContext = createContext<ConnectorClient | null>(null);\nConnectorContext.displayName = 'ConnectorContext';\n\nexport interface MobileWalletAdapterConfig {\n appIdentity: {\n name: string;\n uri?: string;\n icon?: string;\n };\n remoteHostAuthority?: string;\n chains?: readonly string[];\n authorizationCache?: unknown;\n chainSelector?: unknown;\n onWalletNotFound?: (wallet: unknown) => Promise<void>;\n}\n\nfunction ConnectorProviderInternal({\n children,\n config,\n mobile,\n}: {\n children: ReactNode;\n config?: ConnectorConfig;\n mobile?: MobileWalletAdapterConfig;\n}) {\n const clientRef = useRef<ConnectorClient | null>(null);\n\n const getClient = React.useCallback(() => {\n if (!clientRef.current) {\n try {\n clientRef.current = new ConnectorClient(config);\n\n if (typeof window !== 'undefined') {\n window.__connectorClient = clientRef.current;\n }\n\n if (config?.debug) {\n logger.info('Client initialized successfully');\n }\n } catch (error) {\n const err = error as Error;\n logger.error('Failed to initialize client', { error: err });\n\n const extendedConfig = config as ExtendedConnectorConfig;\n if (extendedConfig?.errorBoundary?.onError) {\n extendedConfig.errorBoundary.onError(err, {\n componentStack: 'client-initialization',\n digest: `constructor-${new Date().toISOString()}`,\n });\n }\n\n return null;\n }\n }\n return clientRef.current;\n }, [config]);\n\n const client = getClient();\n\n React.useEffect(() => {\n const currentClient = clientRef.current;\n\n if (currentClient) {\n const privateClient = currentClient as unknown as { initialize?: () => void };\n if (privateClient.initialize && typeof privateClient.initialize === 'function') {\n privateClient.initialize();\n }\n }\n\n return () => {\n if (typeof window !== 'undefined') {\n window.__connectorClient = undefined;\n }\n if (currentClient && typeof currentClient.destroy === 'function') {\n currentClient.destroy();\n }\n };\n }, []);\n\n React.useEffect(() => {\n if (!mobile) return;\n let cancelled = false;\n (async () => {\n try {\n const mod = (await import(\n '@solana-mobile/wallet-standard-mobile'\n )) as typeof import('@solana-mobile/wallet-standard-mobile');\n if (cancelled) return;\n const {\n registerMwa,\n createDefaultAuthorizationCache,\n createDefaultChainSelector,\n createDefaultWalletNotFoundHandler,\n } = mod;\n const defaultChains: readonly `${string}:${string}`[] = [\n 'solana:mainnet',\n 'solana:devnet',\n 'solana:testnet',\n ];\n registerMwa({\n appIdentity: mobile.appIdentity,\n authorizationCache: mobile.authorizationCache ?? (createDefaultAuthorizationCache() as any),\n chains: (mobile.chains ?? defaultChains) as `${string}:${string}`[],\n chainSelector: mobile.chainSelector ?? (createDefaultChainSelector() as any),\n remoteHostAuthority: mobile.remoteHostAuthority,\n onWalletNotFound: mobile.onWalletNotFound ?? createDefaultWalletNotFoundHandler(),\n });\n } catch (e) {\n // Failed to register Mobile Wallet Adapter\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [mobile]);\n\n return <ConnectorContext.Provider value={client}>{children}</ConnectorContext.Provider>;\n}\n\nexport function ConnectorProvider({\n children,\n config,\n mobile,\n}: {\n children: ReactNode;\n config?: ExtendedConnectorConfig;\n mobile?: MobileWalletAdapterConfig;\n}) {\n const extendedConfig = config as ExtendedConnectorConfig;\n const errorBoundaryConfig = extendedConfig?.errorBoundary;\n\n if (!errorBoundaryConfig?.enabled) {\n return (\n <ConnectorProviderInternal config={config} mobile={mobile}>\n {children}\n </ConnectorProviderInternal>\n );\n }\n\n return (\n <ConnectorErrorBoundary\n maxRetries={errorBoundaryConfig.maxRetries ?? 3}\n onError={errorBoundaryConfig.onError}\n fallback={errorBoundaryConfig.fallback}\n >\n <ConnectorProviderInternal config={config} mobile={mobile}>\n {children}\n </ConnectorProviderInternal>\n </ConnectorErrorBoundary>\n );\n}\n\nexport function useConnector(): ConnectorSnapshot {\n const client = useContext(ConnectorContext);\n if (!client) {\n throw new Error(\n 'useConnector must be used within ConnectorProvider. ' +\n 'Wrap your app with <ConnectorProvider> or <UnifiedProvider> to use connector hooks.',\n );\n }\n\n const state = useSyncExternalStore(\n React.useCallback(cb => client.subscribe(cb), [client]),\n React.useCallback(() => client.getSnapshot(), [client]),\n React.useCallback(() => client.getSnapshot(), [client]),\n );\n\n const methods = useMemo(\n () => ({\n select: client.select.bind(client),\n disconnect: client.disconnect.bind(client),\n selectAccount: client.selectAccount.bind(client),\n }),\n [client],\n );\n\n return useMemo(\n () => ({\n ...state,\n ...methods,\n }),\n [state, methods],\n );\n}\n\nexport function useConnectorClient(): ConnectorClient | null {\n return useContext(ConnectorContext);\n}\n","'use client';\n\nimport type { ReactNode, ComponentType, PropsWithChildren } from 'react';\nimport { ConnectorProvider } from './connector-provider';\nimport type { MobileWalletAdapterConfig } from './connector-provider';\nimport type { ConnectorConfig } from '../types/connector';\nimport type { UnifiedConfig } from '../config/unified-config';\n\nexport interface UnifiedProviderProps {\n children: ReactNode;\n\n // NEW: Option 1 - Pass UnifiedConfig directly (recommended)\n config?: UnifiedConfig;\n\n // OLD: Option 2 - Pass configs separately (backward compatible)\n connectorConfig?: ConnectorConfig;\n mobile?: MobileWalletAdapterConfig;\n\n // Optional additional providers to wrap around children\n providers?: Array<{\n component: ComponentType<PropsWithChildren>;\n props?: Record<string, unknown>;\n }>;\n}\n\nexport function UnifiedProvider({ children, config, connectorConfig, mobile, providers = [] }: UnifiedProviderProps) {\n // Handle both new and old patterns\n const actualConnectorConfig = config?.connectorConfig ?? connectorConfig;\n const actualMobile = config?.mobile ?? mobile;\n\n // Start with connector provider as the base\n let content = (\n <ConnectorProvider config={actualConnectorConfig} mobile={actualMobile}>\n {children}\n </ConnectorProvider>\n );\n\n // Wrap with additional providers in reverse order\n // so they nest properly (first provider is outermost)\n for (let i = providers.length - 1; i >= 0; i--) {\n const { component: Provider, props = {} } = providers[i];\n content = <Provider {...props}>{content}</Provider>;\n }\n\n return content;\n}\n\n// Export with practical alias\nexport { UnifiedProvider as AppProvider };\n","/**\n * @solana/connector - useCluster hook\n *\n * React hook for managing Solana cluster (network) state\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport type { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';\nimport { useConnector, useConnectorClient } from '../ui/connector-provider';\nimport {\n getClusterExplorerUrl,\n isMainnetCluster,\n isDevnetCluster,\n isTestnetCluster,\n isLocalCluster,\n getClusterType,\n type ClusterType,\n} from '../utils/cluster';\n\nexport interface UseClusterReturn {\n /** Currently active cluster */\n cluster: SolanaCluster | null;\n /** All available clusters */\n clusters: SolanaCluster[];\n /** Set the active cluster */\n setCluster: (id: SolanaClusterId) => Promise<void>;\n /** Whether the current cluster is mainnet */\n isMainnet: boolean;\n /** Whether the current cluster is devnet */\n isDevnet: boolean;\n /** Whether the current cluster is testnet */\n isTestnet: boolean;\n /** Whether the current cluster is running locally */\n isLocal: boolean;\n /** Solana Explorer base URL for the current cluster */\n explorerUrl: string;\n /** Cluster type (mainnet, devnet, testnet, localnet, custom) */\n type: ClusterType | null;\n}\n\n/**\n * Hook for managing Solana cluster (network) selection\n *\n * @example\n * ```tsx\n * function ClusterSwitcher() {\n * const { cluster, clusters, setCluster, isMainnet } = useCluster()\n *\n * return (\n * <select\n * value={cluster?.id}\n * onChange={(e) => setCluster(e.target.value as SolanaClusterId)}\n * >\n * {clusters.map(c => (\n * <option key={c.id} value={c.id}>{c.label}</option>\n * ))}\n * </select>\n * )\n * }\n * ```\n */\nexport function useCluster(): UseClusterReturn {\n const { cluster, clusters } = useConnector();\n const client = useConnectorClient();\n\n if (!client) {\n throw new Error('useCluster must be used within ConnectorProvider');\n }\n\n const setCluster = useMemo(\n () => async (id: SolanaClusterId) => {\n await client.setCluster(id);\n },\n [client],\n );\n\n return useMemo(() => {\n const isMainnet = cluster ? isMainnetCluster(cluster) : false;\n const isDevnet = cluster ? isDevnetCluster(cluster) : false;\n const isTestnet = cluster ? isTestnetCluster(cluster) : false;\n const isLocal = cluster ? isLocalCluster(cluster) : false;\n const explorerUrl = cluster ? getClusterExplorerUrl(cluster) : '';\n const type = cluster ? getClusterType(cluster) : null;\n\n return {\n cluster,\n clusters,\n setCluster,\n isMainnet,\n isDevnet,\n isTestnet,\n isLocal,\n explorerUrl,\n type,\n };\n }, [cluster, clusters, setCluster]);\n}\n","/**\n * useAccount hook\n */\n\n'use client';\n\nimport React, { useState, useCallback, useMemo } from 'react';\nimport { useConnector } from '../ui/connector-provider';\nimport { copyAddressToClipboard, formatAddress, ClipboardErrorType, type ClipboardResult } from '../utils';\nimport type { AccountInfo } from '../types/accounts';\nimport { COPY_FEEDBACK_DURATION_MS } from '../lib/constants';\n\nexport interface UseAccountReturn {\n /** The connected wallet address */\n address: string | null;\n /** Full account info object */\n account: AccountInfo | null;\n /** Whether a wallet is connected */\n connected: boolean;\n /** Shortened formatted address for display */\n formatted: string;\n /** Copy the address to clipboard with enhanced result */\n copy: () => Promise<ClipboardResult>;\n /** Whether the address was recently copied */\n copied: boolean;\n /** All available accounts from the connected wallet */\n accounts: AccountInfo[];\n /** Select a different account from the connected wallet */\n selectAccount: (address: string) => Promise<void>;\n}\n\nexport function useAccount(): UseAccountReturn {\n const { selectedAccount, accounts, connected, selectAccount } = useConnector();\n const [copied, setCopied] = useState(false);\n const copyTimeoutRef = React.useRef<NodeJS.Timeout | undefined>(undefined);\n\n const account = useMemo(\n () => accounts.find((a: AccountInfo) => a.address === selectedAccount) ?? null,\n [accounts, selectedAccount],\n );\n\n const formatted = useMemo(() => (selectedAccount ? formatAddress(selectedAccount) : ''), [selectedAccount]);\n\n const copy = useCallback(async (): Promise<ClipboardResult> => {\n if (!selectedAccount) {\n return {\n success: false,\n error: ClipboardErrorType.EMPTY_VALUE,\n errorMessage: 'No account selected',\n };\n }\n\n if (copyTimeoutRef.current) {\n clearTimeout(copyTimeoutRef.current);\n }\n\n const result = await copyAddressToClipboard(selectedAccount, {\n onSuccess: () => {\n setCopied(true);\n copyTimeoutRef.current = setTimeout(() => setCopied(false), COPY_FEEDBACK_DURATION_MS);\n },\n });\n\n return result;\n }, [selectedAccount]);\n\n React.useEffect(() => {\n return () => {\n if (copyTimeoutRef.current) {\n clearTimeout(copyTimeoutRef.current);\n }\n };\n }, []);\n\n return useMemo(\n () => ({\n address: selectedAccount,\n account,\n connected,\n formatted,\n copy,\n copied,\n accounts,\n selectAccount,\n }),\n [selectedAccount, account, connected, formatted, copy, copied, accounts, selectAccount],\n );\n}\n","/**\n * @solana/connector - useWalletInfo hook\n *\n * React hook for getting information about the connected wallet\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport { useConnector } from '../ui/connector-provider';\nimport type { WalletInfo } from '../types/wallets';\n\n/**\n * Simplified wallet information for display purposes\n */\nexport interface WalletDisplayInfo {\n /** Wallet name */\n name: string;\n /** Wallet icon/logo URL if available */\n icon?: string;\n /** Whether the wallet extension is installed */\n installed: boolean;\n /** Whether the wallet supports Solana connections */\n connectable?: boolean;\n}\n\n/**\n * Return value from useWalletInfo hook\n */\nexport interface UseWalletInfoReturn {\n /** Name of the connected wallet (e.g., 'Phantom', 'Solflare') */\n name: string | null;\n /** Wallet icon/logo URL if available */\n icon: string | null;\n /** Whether the wallet extension is installed */\n installed: boolean;\n /** Whether the wallet supports Solana connections */\n connectable: boolean;\n /** Whether currently connected to the wallet */\n connected: boolean;\n /** Whether a connection attempt is in progress */\n connecting: boolean;\n /** All available wallets */\n wallets: WalletDisplayInfo[];\n}\n\n/**\n * Hook for getting information about the connected wallet\n * Provides wallet metadata, connection status, and capabilities\n *\n * @example\n * ```tsx\n * function WalletBadge() {\n * const { name, icon, connected, connecting } = useWalletInfo()\n *\n * if (connecting) return <p>Connecting...</p>\n * if (!connected) return <p>No wallet connected</p>\n *\n * return (\n * <div>\n * {icon && <img src={icon} alt={name} />}\n * <span>{name}</span>\n * </div>\n * )\n * }\n * ```\n */\nexport function useWalletInfo(): UseWalletInfoReturn {\n const { selectedWallet, wallets, connected, connecting } = useConnector();\n\n // Map WalletInfo[] to WalletDisplayInfo[] for simplified consumption\n const mappedWallets = useMemo<WalletDisplayInfo[]>(\n () =>\n wallets.map(\n (walletInfo: WalletInfo): WalletDisplayInfo => ({\n name: walletInfo.wallet.name,\n icon: walletInfo.wallet.icon,\n installed: walletInfo.installed,\n connectable: walletInfo.connectable,\n }),\n ),\n [wallets],\n );\n\n // Extract information about the currently selected wallet\n const selectedWalletInfo = useMemo(() => {\n if (!selectedWallet) {\n return {\n name: null,\n icon: null,\n installed: false,\n connectable: false,\n };\n }\n\n // Find the WalletInfo for the selected wallet\n const walletInfo = wallets.find((w: WalletInfo) => w.wallet.name === selectedWallet.name);\n\n return {\n name: selectedWallet.name,\n icon: selectedWallet.icon ?? null,\n installed: walletInfo?.installed ?? false,\n connectable: walletInfo?.connectable ?? false,\n };\n }, [selectedWallet, wallets]);\n\n return useMemo(\n () => ({\n ...selectedWalletInfo,\n connected,\n connecting,\n wallets: mappedWallets,\n }),\n [selectedWalletInfo, connected, connecting, mappedWallets],\n );\n}\n","/**\n * useTransactionSigner hook\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport { useConnector } from '../ui/connector-provider';\nimport { useConnectorClient } from '../ui/connector-provider';\nimport { createTransactionSigner, type TransactionSigner } from '../lib/transaction/transaction-signer';\nimport type { TransactionSignerCapabilities } from '../types/transactions';\n\n/**\n * Return value from useTransactionSigner hook\n */\nexport interface UseTransactionSignerReturn {\n /**\n * Transaction signer instance (null if not connected)\n * Use this to sign and send transactions\n */\n signer: TransactionSigner | null;\n\n /**\n * Whether a signer is available and ready to use\n * Useful for disabling transaction buttons\n */\n ready: boolean;\n\n /**\n * Current wallet address that will sign transactions\n * Null if no wallet connected\n */\n address: string | null;\n\n /**\n * Signer capabilities (what operations are supported)\n * Always available even if signer is null (shows all false)\n */\n capabilities: TransactionSignerCapabilities;\n}\n\nexport function useTransactionSigner(): UseTransactionSignerReturn {\n const { selectedWallet, selectedAccount, accounts, cluster, connected } = useConnector();\n const client = useConnectorClient();\n\n const account = useMemo(\n () => accounts.find(a => a.address === selectedAccount)?.raw ?? null,\n [accounts, selectedAccount],\n );\n\n const signer = useMemo(() => {\n if (!connected || !selectedWallet || !account) {\n return null;\n }\n\n return createTransactionSigner({\n wallet: selectedWallet,\n account,\n cluster: cluster ?? undefined,\n eventEmitter: client\n ? {\n emit: (event: unknown) => {\n client.emitEvent(event as import('../types/events').ConnectorEvent);\n },\n }\n : undefined,\n });\n }, [connected, selectedWallet, account, cluster, client]);\n\n const capabilities = useMemo(\n () =>\n signer?.getCapabilities() ?? {\n canSign: false,\n canSend: false,\n canSignMessage: false,\n supportsBatchSigning: false,\n },\n [signer],\n );\n\n return {\n signer,\n ready: Boolean(signer),\n address: selectedAccount,\n capabilities,\n };\n}\n","/**\n * @solana/connector - useGillTransactionSigner hook\n *\n * React hook for gill-compatible transaction signing\n * Use this when working with modern Solana libraries (@solana/kit, gill)\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport type { TransactionModifyingSigner } from 'gill';\nimport { useTransactionSigner } from './use-transaction-signer';\nimport { createGillTransactionSigner } from '../lib/transaction/gill-transaction-signer';\n\n/**\n * Return value from useGillTransactionSigner hook\n */\nexport interface UseGillTransactionSignerReturn {\n /**\n * Gill-compatible TransactionModifyingSigner instance (null if not connected)\n * Use this with modern Solana libraries (@solana/kit, gill)\n */\n signer: TransactionModifyingSigner | null;\n\n /**\n * Whether a signer is available and ready to use\n * Useful for disabling transaction buttons\n */\n ready: boolean;\n}\n\n/**\n * Hook for gill-compatible transaction signing\n *\n * Creates a TransactionPartialSigner that's compatible with @solana/kit and gill,\n * enabling seamless integration with modern Solana development patterns.\n *\n * This hook wraps the standard useTransactionSigner and adapts it to gill's\n * interface, allowing you to use modern libraries without type incompatibilities.\n *\n * @example\n * ```tsx\n * import { useGillTransactionSigner } from '@solana/connector';\n * import { getTransferSolInstruction } from 'gill/programs';\n * import { address, pipe, createTransactionMessage } from 'gill';\n *\n * function ModernTransfer() {\n * const { signer, ready } = useGillTransactionSigner();\n *\n * const handleTransfer = async (recipient: string, amount: number) => {\n * if (!signer) return;\n *\n * // Fully type-safe with gill!\n * const instruction = getTransferSolInstruction({\n * source: signer, // No type errors\n * destination: address(recipient),\n * amount\n * });\n *\n * const txMessage = pipe(\n * createTransactionMessage({ version: 0 }),\n * (tx) => setTransactionMessageFeePayerSigner(signer, tx), // Works!\n * // ...\n * );\n * };\n *\n * return (\n * <button onClick={handleTransfer} disabled={!ready}>\n * Send with Gill\n * </button>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // For backward compatibility, continue using useTransactionSigner\n * import { useTransactionSigner } from '@solana/connector';\n *\n * function LegacyTransfer() {\n * const { signer } = useTransactionSigner(); // Wallet adapter compatible\n * // Works with @solana/web3.js v1 and wallet-adapter\n * }\n * ```\n */\nexport function useGillTransactionSigner(): UseGillTransactionSignerReturn {\n const { signer: connectorSigner, ready } = useTransactionSigner();\n\n const gillSigner = useMemo(() => {\n if (!connectorSigner) return null;\n return createGillTransactionSigner(connectorSigner);\n }, [connectorSigner]);\n\n return {\n signer: gillSigner,\n ready,\n };\n}\n","/**\n * @solana/connector - useGillSolanaClient hook\n *\n * React hook for Gill's SolanaClient with built-in RPC and WebSocket subscriptions\n * Provides rpc, rpcSubscriptions, sendAndConfirmTransaction, and simulateTransaction\n */\n\n'use client';\n\nimport { useMemo } from 'react';\nimport { createSolanaClient, type SolanaClient, type ModifiedClusterUrl } from 'gill';\nimport { useCluster } from './use-cluster';\nimport { useConnectorClient } from '../ui/connector-provider';\nimport type { ClusterType } from '../utils/cluster';\nimport { createLogger } from '../lib/utils/secure-logger';\n\nconst logger = createLogger('useGillSolanaClient');\n\n/**\n * Return value from useGillSolanaClient hook\n */\nexport interface UseGillSolanaClientReturn {\n /**\n * Gill SolanaClient instance with RPC and subscriptions (null if not available)\n * Includes: rpc, rpcSubscriptions, sendAndConfirmTransaction, simulateTransaction\n */\n client: SolanaClient | null;\n\n /**\n * Whether a client is available and ready to use\n */\n ready: boolean;\n\n /**\n * Cluster type (mainnet, devnet, testnet, localnet, custom)\n */\n clusterType: ClusterType | null;\n}\n\n/**\n * Hook for Gill's SolanaClient with automatic RPC and WebSocket subscription management\n *\n * Creates a fully configured SolanaClient based on the current cluster, providing:\n * - Type-safe RPC client\n * - WebSocket subscription client\n * - Built-in sendAndConfirmTransaction helper\n * - Built-in simulateTransaction helper\n *\n * The client is automatically recreated when the cluster changes.\n *\n * @example\n * ```tsx\n * import { useGillSolanaClient, useGillTransactionSigner } from '@solana/connector';\n * import { signTransactionMessageWithSigners } from 'gill';\n *\n * function SendTransaction() {\n * const { client, ready } = useGillSolanaClient();\n * const { signer } = useGillTransactionSigner();\n *\n * const handleSend = async (transaction) => {\n * if (!client || !signer) return;\n *\n * // Sign the transaction\n * const signed = await signTransactionMessageWithSigners(transaction);\n *\n * // Send and confirm using Gill's built-in helper\n * await client.sendAndConfirmTransaction(signed, {\n * commitment: 'confirmed'\n * });\n * };\n *\n * return (\n * <button onClick={handleSend} disabled={!ready}>\n * Send Transaction\n * </button>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Simulating a transaction\n * function SimulateTransaction() {\n * const { client } = useGillSolanaClient();\n *\n * const handleSimulate = async (transaction) => {\n * if (!client) return;\n *\n * const simulation = await client.simulateTransaction(transaction, {\n * sigVerify: false,\n * commitment: 'processed'\n * });\n *\n * console.log('Simulation result:', simulation);\n * };\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Direct RPC access\n * function GetBalance() {\n * const { client } = useGillSolanaClient();\n *\n * const fetchBalance = async (address: Address) => {\n * if (!client) return;\n *\n * const balance = await client.rpc.getBalance(address).send();\n * console.log('Balance:', balance);\n * };\n * }\n * ```\n */\nexport function useGillSolanaClient(): UseGillSolanaClientReturn {\n const { type } = useCluster();\n const connectorClient = useConnectorClient();\n\n const client = useMemo(() => {\n if (!type || !connectorClient) return null;\n\n try {\n // For non-custom clusters, use moniker\n if (type !== 'custom') {\n return createSolanaClient({\n urlOrMoniker: type,\n });\n }\n\n // For custom clusters, get RPC URL from connector client\n const rpcUrl = connectorClient.getRpcUrl();\n if (!rpcUrl) return null;\n\n return createSolanaClient({\n urlOrMoniker: rpcUrl as ModifiedClusterUrl,\n });\n } catch (error) {\n logger.error('Failed to create Gill Solana client', { error });\n return null;\n }\n }, [type, connectorClient]);\n\n return {\n client,\n ready: Boolean(client),\n clusterType: type,\n };\n}\n","/**\n * @solana/connector - useTransactionPreparer hook\n *\n * React hook for preparing transactions with automatic optimization\n * Handles blockhash fetching, compute unit limits, and transaction simulation\n */\n\n'use client';\n\nimport { useCallback } from 'react';\nimport {\n prepareTransaction,\n type PrepareTransactionConfig,\n type CompilableTransactionMessage,\n type TransactionMessageWithBlockhashLifetime,\n} from 'gill';\nimport { useGillSolanaClient } from './use-gill-solana-client';\nimport { NetworkError } from '../lib/errors';\n\n/**\n * Options for transaction preparation\n */\nexport interface TransactionPrepareOptions {\n /**\n * Multiplier applied to the simulated compute unit value\n * @default 1.1 (10% buffer)\n */\n computeUnitLimitMultiplier?: number;\n\n /**\n * Whether to force reset the compute unit limit value (if one is already set)\n * using the simulation response and computeUnitLimitMultiplier\n * @default false\n */\n computeUnitLimitReset?: boolean;\n\n /**\n * Whether to force reset the latest blockhash (if one is already set)\n * @default true\n */\n blockhashReset?: boolean;\n}\n\n/**\n * Return value from useTransactionPreparer hook\n */\nexport interface UseTransactionPreparerReturn {\n /**\n * Prepare a transaction for sending\n * Automatically adds:\n * - Compute unit limit (via simulation with optional multiplier)\n * - Latest blockhash (if not already set)\n *\n * @param transaction - The transaction to prepare\n * @param options - Optional preparation settings\n * @returns Prepared transaction with blockhash lifetime set\n */\n prepare: <TMessage extends CompilableTransactionMessage>(\n transaction: TMessage,\n options?: TransactionPrepareOptions,\n ) => Promise<TMessage & TransactionMessageWithBlockhashLifetime>;\n\n /**\n * Whether the preparer is ready to use\n * False if Solana client is not available\n */\n ready: boolean;\n}\n\n/**\n * Hook for preparing transactions with automatic optimization\n *\n * Uses Gill's prepareTransaction utility to:\n * 1. Simulate the transaction to determine optimal compute units\n * 2. Set compute unit limit (with configurable multiplier for safety margin)\n * 3. Fetch and set the latest blockhash (if not already present)\n *\n * This significantly improves transaction landing rates by ensuring proper\n * compute budget allocation and fresh blockhashes.\n *\n * @example\n * ```tsx\n * import { useTransactionPreparer, useGillTransactionSigner } from '@solana/connector';\n * import { pipe, createTransactionMessage, appendTransactionMessageInstructions } from 'gill';\n * import { getTransferSolInstruction } from 'gill/programs';\n *\n * function SendOptimizedTransaction() {\n * const { prepare, ready } = useTransactionPreparer();\n * const { signer } = useGillTransactionSigner();\n * const { client } = useGillSolanaClient();\n *\n * const handleSend = async (recipient: string, amount: bigint) => {\n * if (!ready || !signer || !client) return;\n *\n * // Build transaction message\n * const tx = pipe(\n * createTransactionMessage({ version: 0 }),\n * tx => setTransactionMessageFeePayerSigner(signer, tx),\n * tx => appendTransactionMessageInstructions([\n * getTransferSolInstruction({\n * source: signer,\n * destination: address(recipient),\n * amount: lamports(amount),\n * })\n * ], tx)\n * );\n *\n * // Prepare: auto-adds compute units + blockhash\n * const prepared = await prepare(tx);\n *\n * // Sign\n * const signed = await signTransactionMessageWithSigners(prepared);\n *\n * // Send and confirm\n * await client.sendAndConfirmTransaction(signed);\n * };\n *\n * return (\n * <button onClick={handleSend} disabled={!ready}>\n * Send Optimized Transaction\n * </button>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // With custom compute unit multiplier for high-priority transactions\n * const { prepare } = useTransactionPreparer();\n *\n * const prepared = await prepare(transaction, {\n * computeUnitLimitMultiplier: 1.3, // 30% buffer instead of default 10%\n * blockhashReset: true // Always fetch fresh blockhash\n * });\n * ```\n *\n * @example\n * ```tsx\n * // Force reset compute units even if already set\n * const { prepare } = useTransactionPreparer();\n *\n * const prepared = await prepare(transaction, {\n * computeUnitLimitReset: true, // Re-simulate and reset compute units\n * computeUnitLimitMultiplier: 1.2\n * });\n * ```\n */\nexport function useTransactionPreparer(): UseTransactionPreparerReturn {\n const { client, ready } = useGillSolanaClient();\n\n const prepare = useCallback(\n async <TMessage extends CompilableTransactionMessage>(\n transaction: TMessage,\n options: TransactionPrepareOptions = {},\n ): Promise<TMessage & TransactionMessageWithBlockhashLifetime> => {\n if (!client) {\n throw new NetworkError('RPC_ERROR', 'Solana client not available. Cannot prepare transaction.');\n }\n\n return prepareTransaction({\n transaction,\n rpc: client.rpc,\n computeUnitLimitMultiplier: options.computeUnitLimitMultiplier,\n computeUnitLimitReset: options.computeUnitLimitReset,\n blockhashReset: options.blockhashReset,\n });\n },\n [client],\n );\n\n return {\n prepare,\n ready,\n };\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRIBOPAOD_js = require('./chunk-RIBOPAOD.js');
|
|
4
4
|
var chunkSMUUAKC3_js = require('./chunk-SMUUAKC3.js');
|
|
5
5
|
var core = require('@wallet-ui/core');
|
|
6
6
|
var gill = require('gill');
|
|
@@ -162,7 +162,7 @@ function getDefaultConfig(options) {
|
|
|
162
162
|
persistClusterSelection = true,
|
|
163
163
|
clusterStorageKey,
|
|
164
164
|
enableErrorBoundary = true,
|
|
165
|
-
maxRetries =
|
|
165
|
+
maxRetries = chunkRIBOPAOD_js.DEFAULT_MAX_RETRIES,
|
|
166
166
|
onError
|
|
167
167
|
} = options, defaultClusters = clusters ?? [
|
|
168
168
|
core.createSolanaMainnet(),
|
|
@@ -223,7 +223,7 @@ function getDefaultConfig(options) {
|
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
function getInitialCluster(network = "mainnet-beta") {
|
|
226
|
-
return
|
|
226
|
+
return chunkRIBOPAOD_js.toClusterId(network);
|
|
227
227
|
}
|
|
228
228
|
function getDefaultMobileConfig(options) {
|
|
229
229
|
let baseUrl = options.appUrl || (typeof window < "u" ? window.location.origin : "https://localhost:3000");
|
|
@@ -239,7 +239,7 @@ function getDefaultMobileConfig(options) {
|
|
|
239
239
|
|
|
240
240
|
// src/config/unified-config.ts
|
|
241
241
|
function createConfig(options) {
|
|
242
|
-
let { network = "mainnet-beta", rpcUrl: customRpcUrl, ...connectorOptions } = options, normalizedNetwork =
|
|
242
|
+
let { network = "mainnet-beta", rpcUrl: customRpcUrl, ...connectorOptions } = options, normalizedNetwork = chunkRIBOPAOD_js.normalizeNetwork(typeof network == "string" ? network : "mainnet-beta"), rpcUrl = customRpcUrl || chunkRIBOPAOD_js.getDefaultRpcUrl(normalizedNetwork), rpcNetwork = normalizedNetwork === "mainnet" ? "mainnet-beta" : normalizedNetwork, connectorConfig = getDefaultConfig({
|
|
243
243
|
...connectorOptions,
|
|
244
244
|
network: rpcNetwork
|
|
245
245
|
}), mobile = options.enableMobile !== false && normalizedNetwork !== "localnet" ? getDefaultMobileConfig({
|
|
@@ -313,13 +313,13 @@ function createMessageSignerFromWallet(walletAddress, signMessageFn) {
|
|
|
313
313
|
address: walletAddress,
|
|
314
314
|
async modifyAndSignMessages(messages, config) {
|
|
315
315
|
if (messages.length !== 1)
|
|
316
|
-
throw new
|
|
316
|
+
throw new chunkRIBOPAOD_js.ValidationError("INVALID_FORMAT", "Wallets only support signing one message at a time", {
|
|
317
317
|
receivedCount: messages.length,
|
|
318
318
|
expectedCount: 1
|
|
319
319
|
});
|
|
320
320
|
let [message] = messages, { content, signatures: originalSignatures } = message;
|
|
321
321
|
if (config?.abortSignal?.aborted)
|
|
322
|
-
throw
|
|
322
|
+
throw chunkRIBOPAOD_js.Errors.userRejected("message signing");
|
|
323
323
|
try {
|
|
324
324
|
let signature = await signMessageFn(content);
|
|
325
325
|
console.log("Signature received from wallet:", {
|
|
@@ -347,9 +347,9 @@ function createMessageSignerFromWallet(walletAddress, signMessageFn) {
|
|
|
347
347
|
} catch (error) {
|
|
348
348
|
if (error instanceof Error) {
|
|
349
349
|
let message2 = error.message.toLowerCase();
|
|
350
|
-
throw message2.includes("user rejected") || message2.includes("user denied") ?
|
|
350
|
+
throw message2.includes("user rejected") || message2.includes("user denied") ? chunkRIBOPAOD_js.Errors.userRejected("message signing") : new chunkRIBOPAOD_js.TransactionError("SIGNING_FAILED", "Failed to sign message", void 0, error);
|
|
351
351
|
}
|
|
352
|
-
throw new
|
|
352
|
+
throw new chunkRIBOPAOD_js.TransactionError("SIGNING_FAILED", "Failed to sign message", {
|
|
353
353
|
originalError: String(error)
|
|
354
354
|
});
|
|
355
355
|
}
|
|
@@ -361,22 +361,22 @@ function createTransactionSendingSignerFromWallet(walletAddress, chain, sendTran
|
|
|
361
361
|
address: walletAddress,
|
|
362
362
|
async signAndSendTransactions(transactions, config) {
|
|
363
363
|
if (transactions.length !== 1)
|
|
364
|
-
throw new
|
|
364
|
+
throw new chunkRIBOPAOD_js.ValidationError("INVALID_FORMAT", "Wallets only support sending one transaction at a time", {
|
|
365
365
|
receivedCount: transactions.length,
|
|
366
366
|
expectedCount: 1
|
|
367
367
|
});
|
|
368
368
|
let [transaction] = transactions;
|
|
369
369
|
if (config?.abortSignal?.aborted)
|
|
370
|
-
throw
|
|
370
|
+
throw chunkRIBOPAOD_js.Errors.userRejected("transaction sending");
|
|
371
371
|
try {
|
|
372
372
|
let signatureString = await sendTransactionFn(transaction);
|
|
373
373
|
return [base58ToSignatureBytes(signatureString)];
|
|
374
374
|
} catch (error) {
|
|
375
375
|
if (error instanceof Error) {
|
|
376
376
|
let message = error.message.toLowerCase();
|
|
377
|
-
throw message.includes("user rejected") || message.includes("user denied") ?
|
|
377
|
+
throw message.includes("user rejected") || message.includes("user denied") ? chunkRIBOPAOD_js.Errors.userRejected("transaction sending") : message.includes("network") || message.includes("rpc") ? new chunkRIBOPAOD_js.TransactionError("SEND_FAILED", "Failed to send transaction", void 0, error) : new chunkRIBOPAOD_js.TransactionError("SEND_FAILED", "Failed to send transaction", void 0, error);
|
|
378
378
|
}
|
|
379
|
-
throw new
|
|
379
|
+
throw new chunkRIBOPAOD_js.TransactionError("SEND_FAILED", "Failed to send transaction", {
|
|
380
380
|
originalError: String(error)
|
|
381
381
|
});
|
|
382
382
|
}
|
|
@@ -417,7 +417,7 @@ function createKitSignersFromWallet(wallet, account, connection, network) {
|
|
|
417
417
|
walletAddress,
|
|
418
418
|
async (message) => {
|
|
419
419
|
if (!hasSignMessage)
|
|
420
|
-
throw
|
|
420
|
+
throw chunkRIBOPAOD_js.Errors.featureNotSupported("message signing");
|
|
421
421
|
try {
|
|
422
422
|
let results = await features["solana:signMessage"].signMessage({
|
|
423
423
|
account,
|
|
@@ -464,7 +464,7 @@ function createKitSignersFromWallet(wallet, account, connection, network) {
|
|
|
464
464
|
} catch (error) {
|
|
465
465
|
throw error instanceof Error ? error : new Error(String(error));
|
|
466
466
|
}
|
|
467
|
-
throw
|
|
467
|
+
throw chunkRIBOPAOD_js.Errors.featureNotSupported("transaction sending");
|
|
468
468
|
}
|
|
469
469
|
) : null;
|
|
470
470
|
return {
|
|
@@ -524,7 +524,7 @@ var SOLANA_CHAIN_IDS = {
|
|
|
524
524
|
"solana:testnet": SOLANA_CHAIN_IDS.testnet
|
|
525
525
|
};
|
|
526
526
|
function getChainIdFromCluster(cluster) {
|
|
527
|
-
let clusterType =
|
|
527
|
+
let clusterType = chunkRIBOPAOD_js.getClusterType(cluster);
|
|
528
528
|
return clusterType === "localnet" || clusterType === "custom" ? null : getChainIdFromClusterType(clusterType);
|
|
529
529
|
}
|
|
530
530
|
function getChainIdFromClusterId(clusterId) {
|
|
@@ -702,5 +702,5 @@ exports.sendRawTransaction = sendRawTransaction;
|
|
|
702
702
|
exports.signatureBytesToBase58 = signatureBytesToBase58;
|
|
703
703
|
exports.updateSignatureDictionary = updateSignatureDictionary;
|
|
704
704
|
exports.validateKnownSolanaChain = validateKnownSolanaChain;
|
|
705
|
-
//# sourceMappingURL=chunk-
|
|
706
|
-
//# sourceMappingURL=chunk-
|
|
705
|
+
//# sourceMappingURL=chunk-JS4KJ2KK.js.map
|
|
706
|
+
//# sourceMappingURL=chunk-JS4KJ2KK.js.map
|