@solana/connector 0.1.10 → 0.2.0

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.
Files changed (55) hide show
  1. package/README.md +344 -88
  2. package/dist/{chunk-MN7XNCYI.js → chunk-BJAVJQLK.js} +6 -6
  3. package/dist/{chunk-MN7XNCYI.js.map → chunk-BJAVJQLK.js.map} +1 -1
  4. package/dist/{chunk-6AJJJG5B.js → chunk-BZ2VBJCZ.js} +618 -415
  5. package/dist/chunk-BZ2VBJCZ.js.map +1 -0
  6. package/dist/{chunk-ATYK5OKR.js → chunk-EM4KNOKG.js} +614 -194
  7. package/dist/chunk-EM4KNOKG.js.map +1 -0
  8. package/dist/{chunk-4JT24DIX.js → chunk-HN5AJF7F.js} +61 -20
  9. package/dist/chunk-HN5AJF7F.js.map +1 -0
  10. package/dist/{chunk-FVA4TUI4.mjs → chunk-HPQ5T32K.mjs} +4 -4
  11. package/dist/{chunk-FVA4TUI4.mjs.map → chunk-HPQ5T32K.mjs.map} +1 -1
  12. package/dist/{chunk-QOIQBWMP.mjs → chunk-IDTUFDNB.mjs} +531 -339
  13. package/dist/chunk-IDTUFDNB.mjs.map +1 -0
  14. package/dist/{chunk-WGZYKDXF.mjs → chunk-RTXUS5KG.mjs} +529 -115
  15. package/dist/chunk-RTXUS5KG.mjs.map +1 -0
  16. package/dist/{chunk-64LV76OK.js → chunk-SITQ4JWM.js} +23 -2
  17. package/dist/chunk-SITQ4JWM.js.map +1 -0
  18. package/dist/{chunk-7XHVZW2L.mjs → chunk-UCISIAOG.mjs} +60 -19
  19. package/dist/chunk-UCISIAOG.mjs.map +1 -0
  20. package/dist/{chunk-DKCZA2QI.mjs → chunk-ZZTY3O4N.mjs} +21 -3
  21. package/dist/chunk-ZZTY3O4N.mjs.map +1 -0
  22. package/dist/compat.d.mts +1 -1
  23. package/dist/compat.d.ts +1 -1
  24. package/dist/compat.js +2 -2
  25. package/dist/compat.mjs +1 -1
  26. package/dist/headless.d.mts +25 -7
  27. package/dist/headless.d.ts +25 -7
  28. package/dist/headless.js +196 -132
  29. package/dist/headless.mjs +4 -4
  30. package/dist/index.d.mts +4 -4
  31. package/dist/index.d.ts +4 -4
  32. package/dist/index.js +255 -175
  33. package/dist/index.mjs +5 -5
  34. package/dist/react.d.mts +230 -8
  35. package/dist/react.d.ts +230 -8
  36. package/dist/react.js +78 -42
  37. package/dist/react.mjs +2 -2
  38. package/dist/{standard-shim-BTUm7cur.d.mts → standard-shim-CGB88PPO.d.mts} +396 -54
  39. package/dist/{standard-shim-LsQ97i9T.d.ts → standard-shim-tmnQelaJ.d.ts} +396 -54
  40. package/dist/{transaction-signer-T-KVQFi8.d.ts → transaction-signer-7NaYmP5w.d.mts} +1 -0
  41. package/dist/{transaction-signer-T-KVQFi8.d.mts → transaction-signer-7NaYmP5w.d.ts} +1 -0
  42. package/dist/{walletconnect-D4JN6H2O.js → walletconnect-447EY3OJ.js} +8 -8
  43. package/dist/{walletconnect-D4JN6H2O.js.map → walletconnect-447EY3OJ.js.map} +1 -1
  44. package/dist/walletconnect-U455PO4I.mjs +3 -0
  45. package/dist/{walletconnect-I3PZUBTA.mjs.map → walletconnect-U455PO4I.mjs.map} +1 -1
  46. package/package.json +1 -1
  47. package/dist/chunk-4JT24DIX.js.map +0 -1
  48. package/dist/chunk-64LV76OK.js.map +0 -1
  49. package/dist/chunk-6AJJJG5B.js.map +0 -1
  50. package/dist/chunk-7XHVZW2L.mjs.map +0 -1
  51. package/dist/chunk-ATYK5OKR.js.map +0 -1
  52. package/dist/chunk-DKCZA2QI.mjs.map +0 -1
  53. package/dist/chunk-QOIQBWMP.mjs.map +0 -1
  54. package/dist/chunk-WGZYKDXF.mjs.map +0 -1
  55. package/dist/walletconnect-I3PZUBTA.mjs +0 -3
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- export { SOLANA_CHAIN_IDS, address, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createSignableMessage, createSolanaDevnet, createSolanaLocalnet, createSolanaMainnet, createSolanaTestnet, formatSignature, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getLatestBlockhash, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, isAccountAddress, isKitConnection, isKnownSolanaChain, isLegacyConnection, isSolanaChain, isWalletName, sendRawTransaction, validateKnownSolanaChain } from './chunk-FVA4TUI4.mjs';
2
- export { AccountElement, AppProvider, BalanceElement, ClusterElement, ConnectorProvider, DisconnectElement, SkeletonShine, TokenListElement, TransactionHistoryElement, UnifiedProvider, WalletConnectProvider, WalletListElement, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useConnector, useConnectorClient, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWalletConnectUri, useWalletInfo } from './chunk-WGZYKDXF.mjs';
3
- export { ClipboardErrorType, ConnectorClient, ConnectorErrorBoundary, EnhancedStorage, EnhancedStorageAdapter, PUBLIC_RPC_ENDPOINTS, TransactionSignerError, WalletErrorType, copyAddressToClipboard, copySignatureToClipboard, copyToClipboard, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, createKitTransactionSigner, createTransactionSigner, formatAddress, formatBigIntBalance, formatBigIntUsd, formatLamportsToSolSafe, formatNumber, formatSOL, formatTokenAmount, formatTokenBalanceSafe, getAddressUrl, getBlockUrl, getChainIdForWalletStandard, getClusterChainId, getClusterExplorerUrl, getClusterName, getClusterRpcUrl, getClusterType, getDefaultConfig, getDefaultMobileConfig, getDefaultRpcUrl, getNetworkDisplayName, getPolyfillStatus, getTokenUrl, getTransactionUrl, getWalletsRegistry, installPolyfills, isClipboardAvailable, isCryptoAvailable, isDevnet, isDevnetCluster, isLocalCluster, isLocalnet, isMainnet, isMainnetCluster, isPolyfillInstalled, isTestnet, isTestnetCluster, isTransactionSignerError, normalizeNetwork, parseConfigOptions, ready, toClusterId, truncate, validateConfigOptions, withErrorBoundary } from './chunk-QOIQBWMP.mjs';
1
+ export { SOLANA_CHAIN_IDS, address, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createSignableMessage, createSolanaDevnet, createSolanaLocalnet, createSolanaMainnet, createSolanaTestnet, formatSignature, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getLatestBlockhash, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, isAccountAddress, isKitConnection, isKnownSolanaChain, isLegacyConnection, isSolanaChain, isWalletName, sendRawTransaction, validateKnownSolanaChain } from './chunk-HPQ5T32K.mjs';
2
+ export { AccountElement, AppProvider, BalanceElement, ClusterElement, ConnectorErrorBoundary, ConnectorProvider, DisconnectElement, SkeletonShine, TokenListElement, TransactionHistoryElement, UnifiedProvider, WalletConnectProvider, WalletListElement, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useConnectWallet, useConnector, useConnectorClient, useDisconnectWallet, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWallet, useWalletConnectUri, useWalletConnectors, useWalletInfo, withErrorBoundary } from './chunk-RTXUS5KG.mjs';
3
+ export { ClipboardErrorType, ConnectorClient, EnhancedStorage, EnhancedStorageAdapter, INITIAL_WALLET_STATUS, PUBLIC_RPC_ENDPOINTS, TransactionSignerError, WALLET_STATE_VERSION, clearWalletState, copyAddressToClipboard, copySignatureToClipboard, copyToClipboard, createConnectorId, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createEnhancedStorageWalletState, createGillTransactionSigner, createKitTransactionSigner, createTransactionSigner, formatAddress, formatBigIntBalance, formatBigIntUsd, formatLamportsToSolSafe, formatNumber, formatSOL, formatTokenAmount, formatTokenBalanceSafe, getAddressUrl, getBlockUrl, getChainIdForWalletStandard, getClusterChainId, getClusterExplorerUrl, getClusterName, getClusterRpcUrl, getClusterType, getDefaultConfig, getDefaultMobileConfig, getDefaultRpcUrl, getNetworkDisplayName, getPolyfillStatus, getTokenUrl, getTransactionUrl, getWalletNameFromConnectorId, getWalletsRegistry, installPolyfills, isClipboardAvailable, isConnected, isConnecting, isCryptoAvailable, isDevnet, isDevnetCluster, isDisconnected, isLocalCluster, isLocalnet, isMainnet, isMainnetCluster, isPolyfillInstalled, isStatusError, isTestnet, isTestnetCluster, isTransactionSignerError, isWalletConnectorId, isWalletStatusError, normalizeNetwork, parseConfigOptions, ready, saveWalletState, toClusterId, toLegacyWalletState, truncate, validateConfigOptions } from './chunk-IDTUFDNB.mjs';
4
4
  export { isFailure, isSuccess, tryCatch, tryCatchSync } from './chunk-HO6QNKFM.mjs';
5
- export { createMockWalletConnectTransport, createWalletConnectTransport, createWalletConnectWallet, isWalletConnectAvailable, registerWalletConnectWallet } from './chunk-7XHVZW2L.mjs';
6
- export { ConfigurationError, ConnectionError, ConnectorError, Errors, LAMPORTS_PER_SOL, NetworkError, TransactionError, ValidationError, base58ToSignatureBytes, createKitSignersFromWallet, createMessageSignerFromWallet, createSolanaClient, createTransactionSendingSignerFromWallet, detectMessageModification, freezeSigner, getExplorerLink, getPublicSolanaRpcUrl, getUserFriendlyMessage, isConfigurationError, isConnectionError, isConnectorError, isNetworkError, isTransactionError, isValidationError, lamportsToSol, prepareTransaction, signatureBytesToBase58, solToLamports, toConnectorError, updateSignatureDictionary } from './chunk-DKCZA2QI.mjs';
5
+ export { createMockWalletConnectTransport, createWalletConnectTransport, createWalletConnectWallet, isWalletConnectAvailable, registerWalletConnectWallet } from './chunk-UCISIAOG.mjs';
6
+ export { ConfigurationError, ConnectionError, ConnectorError, Errors, LAMPORTS_PER_SOL, NetworkError, TransactionError, ValidationError, WalletErrorType, base58ToSignatureBytes, createKitSignersFromWallet, createMessageSignerFromWallet, createSolanaClient, createTransactionSendingSignerFromWallet, createWalletError, detectMessageModification, freezeSigner, getExplorerLink, getPublicSolanaRpcUrl, getUserFriendlyMessage, isConfigurationError, isConnectionError, isConnectorError, isNetworkError, isTransactionError, isValidationError, isWalletError, lamportsToSol, prepareTransaction, signatureBytesToBase58, solToLamports, toConnectorError, updateSignatureDictionary } from './chunk-ZZTY3O4N.mjs';
7
7
  //# sourceMappingURL=index.mjs.map
8
8
  //# sourceMappingURL=index.mjs.map
package/dist/react.d.mts CHANGED
@@ -1,14 +1,14 @@
1
- import { e as ConnectorConfig, M as MobileWalletAdapterConfig, j as ClusterType, A as AccountInfo, a5 as ClipboardResult, t as SolanaClient } from './standard-shim-BTUm7cur.mjs';
2
- export { c as ConnectorErrorBoundary, C as ConnectorProvider, d as ConnectorSnapshot, f as ConnectorState, D as DefaultConfigOptions, E as ExtendedConnectorConfig, S as SimplifiedWalletConnectConfig, W as WalletInfo, i as WalletStandardAccount, h as WalletStandardWallet, g as getDefaultConfig, b as getDefaultMobileConfig, u as useConnector, a as useConnectorClient, w as withErrorBoundary } from './standard-shim-BTUm7cur.mjs';
1
+ import { d as ConnectorConfig, M as MobileWalletAdapterConfig, Q as WalletError, l as WalletStatus, i as WalletConnectorId, m as SessionAccount, k as WalletSession, j as WalletConnectorMetadata, n as ConnectOptions, t as ClusterType, A as AccountInfo, at as ClipboardResult, Y as SolanaClient } from './standard-shim-CGB88PPO.mjs';
2
+ export { C as ConnectorProvider, c as ConnectorSnapshot, e as ConnectorState, D as DefaultConfigOptions, E as ExtendedConnectorConfig, S as SimplifiedWalletConnectConfig, W as WalletInfo, h as WalletStandardAccount, f as WalletStandardWallet, o as createConnectorId, g as getDefaultConfig, b as getDefaultMobileConfig, q as isConnected, r as isConnecting, s as isDisconnected, p as isWalletConnectorId, u as useConnector, a as useConnectorClient } from './standard-shim-CGB88PPO.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { ReactNode, ComponentType, PropsWithChildren } from 'react';
4
+ import React, { ReactNode, ComponentType, PropsWithChildren, Component, ErrorInfo } from 'react';
5
+ import { Address } from '@solana/addresses';
5
6
  import { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
6
7
  export { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
7
- import { a as TransactionSigner, v as TransactionSignerCapabilities } from './transaction-signer-T-KVQFi8.mjs';
8
+ import { a as TransactionSigner, v as TransactionSignerCapabilities } from './transaction-signer-7NaYmP5w.mjs';
8
9
  import { TransactionModifyingSigner } from '@solana/signers';
9
10
  import { TransactionMessage, TransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime } from '@solana/kit';
10
11
  export { Wallet, WalletAccount } from '@wallet-standard/base';
11
- import '@solana/addresses';
12
12
  import '@solana/keys';
13
13
  import '@solana-mobile/wallet-standard-mobile';
14
14
  import '@solana/transaction-messages';
@@ -100,6 +100,217 @@ declare function WalletConnectProvider({ children }: {
100
100
  */
101
101
  declare function useWalletConnectUri(): WalletConnectContextValue;
102
102
 
103
+ interface ErrorBoundaryState {
104
+ hasError: boolean;
105
+ error: Error | null;
106
+ errorInfo: ErrorInfo | null;
107
+ errorId: string;
108
+ retryCount: number;
109
+ }
110
+ interface ErrorBoundaryProps {
111
+ children: ReactNode;
112
+ fallback?: (error: WalletError, retry: () => void) => ReactNode;
113
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
114
+ maxRetries?: number;
115
+ enableRecovery?: boolean;
116
+ }
117
+ declare class ConnectorErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
118
+ private retryTimeouts;
119
+ constructor(props: ErrorBoundaryProps);
120
+ static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
121
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
122
+ componentWillUnmount(): void;
123
+ retry: () => void;
124
+ render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
125
+ }
126
+ declare function withErrorBoundary<P extends object>(Component: React.ComponentType<P>, errorBoundaryProps?: Omit<ErrorBoundaryProps, 'children'>): {
127
+ (props: P): react_jsx_runtime.JSX.Element;
128
+ displayName: string;
129
+ };
130
+
131
+ /**
132
+ * useWallet - vNext wallet status hook
133
+ *
134
+ * Provides access to the wallet status state machine and derived values.
135
+ * This is the primary hook for checking wallet connection state in vNext.
136
+ *
137
+ * @example
138
+ * ```tsx
139
+ * const { status, isConnected, isConnecting, account, accounts } = useWallet();
140
+ *
141
+ * if (status === 'connected') {
142
+ * console.log('Connected account:', account);
143
+ * }
144
+ * ```
145
+ */
146
+
147
+ /**
148
+ * Return type for useWallet hook
149
+ */
150
+ interface UseWalletReturn {
151
+ /**
152
+ * Current wallet status ('disconnected' | 'connecting' | 'connected' | 'error')
153
+ */
154
+ status: WalletStatus['status'];
155
+ /**
156
+ * Full wallet status object for advanced usage
157
+ */
158
+ walletStatus: WalletStatus;
159
+ /**
160
+ * Whether a wallet is connected
161
+ */
162
+ isConnected: boolean;
163
+ /**
164
+ * Whether a wallet connection is in progress
165
+ */
166
+ isConnecting: boolean;
167
+ /**
168
+ * Whether an error occurred
169
+ */
170
+ isError: boolean;
171
+ /**
172
+ * Error object if status is 'error'
173
+ */
174
+ error: Error | null;
175
+ /**
176
+ * Connected connector ID (null if not connected)
177
+ */
178
+ connectorId: WalletConnectorId | null;
179
+ /**
180
+ * Currently selected account address (null if not connected)
181
+ */
182
+ account: Address | null;
183
+ /**
184
+ * All available accounts (empty if not connected)
185
+ */
186
+ accounts: SessionAccount[];
187
+ /**
188
+ * Active session (null if not connected)
189
+ */
190
+ session: WalletSession | null;
191
+ }
192
+ /**
193
+ * Hook to access the current wallet status and connection state.
194
+ * This is the primary hook for checking wallet state in vNext.
195
+ */
196
+ declare function useWallet(): UseWalletReturn;
197
+
198
+ /**
199
+ * useWalletConnectors - vNext wallet connectors hook
200
+ *
201
+ * Provides access to available wallet connectors and their metadata.
202
+ *
203
+ * @example
204
+ * ```tsx
205
+ * const connectors = useWalletConnectors();
206
+ *
207
+ * return (
208
+ * <ul>
209
+ * {connectors.map(connector => (
210
+ * <li key={connector.id}>
211
+ * <img src={connector.icon} alt={connector.name} />
212
+ * {connector.name}
213
+ * </li>
214
+ * ))}
215
+ * </ul>
216
+ * );
217
+ * ```
218
+ */
219
+
220
+ /**
221
+ * Hook to access available wallet connectors.
222
+ * Returns an array of connector metadata (id, name, icon, ready state).
223
+ */
224
+ declare function useWalletConnectors(): WalletConnectorMetadata[];
225
+
226
+ /**
227
+ * useConnectWallet - vNext wallet connection hook
228
+ *
229
+ * Provides a function to connect to a wallet by connector ID.
230
+ *
231
+ * @example
232
+ * ```tsx
233
+ * const { connect, isConnecting, error } = useConnectWallet();
234
+ *
235
+ * return (
236
+ * <button
237
+ * onClick={() => connect('wallet-standard:phantom')}
238
+ * disabled={isConnecting}
239
+ * >
240
+ * {isConnecting ? 'Connecting...' : 'Connect Phantom'}
241
+ * </button>
242
+ * );
243
+ * ```
244
+ */
245
+
246
+ /**
247
+ * Return type for useConnectWallet hook
248
+ */
249
+ interface UseConnectWalletReturn {
250
+ /**
251
+ * Connect to a wallet by connector ID.
252
+ *
253
+ * @param connectorId - Stable connector identifier (e.g., 'wallet-standard:phantom')
254
+ * @param options - Connection options (silent mode, preferred account)
255
+ */
256
+ connect: (connectorId: WalletConnectorId, options?: ConnectOptions) => Promise<void>;
257
+ /**
258
+ * Whether a connection is currently in progress
259
+ */
260
+ isConnecting: boolean;
261
+ /**
262
+ * Error from the last connection attempt (null if none)
263
+ */
264
+ error: Error | null;
265
+ /**
266
+ * Reset the error state
267
+ */
268
+ resetError: () => void;
269
+ }
270
+ /**
271
+ * Hook to connect to a wallet by connector ID.
272
+ * Uses the vNext connectWallet API with silent-first support.
273
+ */
274
+ declare function useConnectWallet(): UseConnectWalletReturn;
275
+
276
+ /**
277
+ * useDisconnectWallet - vNext wallet disconnection hook
278
+ *
279
+ * Provides a function to disconnect the current wallet.
280
+ *
281
+ * @example
282
+ * ```tsx
283
+ * const { disconnect, isDisconnecting } = useDisconnectWallet();
284
+ *
285
+ * return (
286
+ * <button
287
+ * onClick={() => disconnect()}
288
+ * disabled={isDisconnecting}
289
+ * >
290
+ * {isDisconnecting ? 'Disconnecting...' : 'Disconnect'}
291
+ * </button>
292
+ * );
293
+ * ```
294
+ */
295
+ /**
296
+ * Return type for useDisconnectWallet hook
297
+ */
298
+ interface UseDisconnectWalletReturn {
299
+ /**
300
+ * Disconnect the current wallet session.
301
+ */
302
+ disconnect: () => Promise<void>;
303
+ /**
304
+ * Whether a disconnection is currently in progress
305
+ */
306
+ isDisconnecting: boolean;
307
+ }
308
+ /**
309
+ * Hook to disconnect the current wallet.
310
+ * Uses the vNext disconnectWallet API.
311
+ */
312
+ declare function useDisconnectWallet(): UseDisconnectWalletReturn;
313
+
103
314
  /**
104
315
  * @solana/connector - useCluster hook
105
316
  *
@@ -178,12 +389,15 @@ declare function useAccount(): UseAccountReturn;
178
389
  *
179
390
  * React hook for getting information about the connected wallet
180
391
  */
392
+
181
393
  /**
182
394
  * Simplified wallet information for display purposes
183
395
  */
184
396
  interface WalletDisplayInfo {
185
397
  /** Wallet name */
186
398
  name: string;
399
+ /** Stable connector ID for vNext API */
400
+ connectorId: WalletConnectorId;
187
401
  /** Wallet icon/logo URL if available */
188
402
  icon?: string;
189
403
  /** Whether the wallet extension is installed */
@@ -1198,12 +1412,18 @@ declare namespace ClusterElement {
1198
1412
  interface WalletListElementRenderProps {
1199
1413
  wallets: WalletDisplayInfo[];
1200
1414
  installedWallets: WalletDisplayInfo[];
1415
+ /** @deprecated Use `connectById` for vNext API */
1201
1416
  select: (walletName: string) => Promise<void>;
1417
+ /** Connect by connector ID (vNext API) */
1418
+ connectById: (connectorId: WalletConnectorId) => Promise<void>;
1202
1419
  connecting: boolean;
1203
1420
  }
1204
1421
  interface WalletListElementWalletProps {
1205
1422
  wallet: WalletDisplayInfo;
1423
+ /** @deprecated Use `connect` for clearer naming */
1206
1424
  select: () => Promise<void>;
1425
+ /** Connect to this wallet (vNext API) */
1426
+ connect: () => Promise<void>;
1207
1427
  connecting: boolean;
1208
1428
  }
1209
1429
  interface WalletListElementProps {
@@ -1215,8 +1435,10 @@ interface WalletListElementProps {
1215
1435
  variant?: 'list' | 'grid' | 'compact';
1216
1436
  /** Show wallet status badge */
1217
1437
  showStatus?: boolean;
1218
- /** Callback when a wallet is selected */
1438
+ /** @deprecated Use `onConnect` for vNext API */
1219
1439
  onSelect?: (walletName: string) => void;
1440
+ /** Callback when a wallet is connected (vNext API) */
1441
+ onConnect?: (connectorId: WalletConnectorId) => void;
1220
1442
  /** Custom render function for full control */
1221
1443
  render?: (props: WalletListElementRenderProps) => ReactNode;
1222
1444
  /** Custom render function for individual wallet items */
@@ -1268,7 +1490,7 @@ interface WalletListElementProps {
1268
1490
  * />
1269
1491
  * ```
1270
1492
  */
1271
- declare function WalletListElement({ installedOnly, className, variant, showStatus, onSelect, render, renderWallet, }: WalletListElementProps): react_jsx_runtime.JSX.Element;
1493
+ declare function WalletListElement({ installedOnly, className, variant, showStatus, onSelect, onConnect, render, renderWallet, }: WalletListElementProps): react_jsx_runtime.JSX.Element;
1272
1494
  declare namespace WalletListElement {
1273
1495
  var displayName: string;
1274
1496
  }
@@ -1468,4 +1690,4 @@ declare namespace SkeletonShine {
1468
1690
  var displayName: string;
1469
1691
  }
1470
1692
 
1471
- export { AccountElement, type AccountElementProps, type AccountElementRenderProps, AccountInfo, AppProvider, type AppProviderProps, BalanceElement, type BalanceElementProps, type BalanceElementRenderProps, ClusterElement, type ClusterElementProps, type ClusterElementRenderProps, ClusterType, ConnectorConfig, DisconnectElement, type DisconnectElementProps, MobileWalletAdapterConfig, SkeletonShine, type Token, type TokenBalance, TokenListElement, type TokenListElementProps, type TokenListElementRenderProps, TransactionHistoryElement, type TransactionHistoryElementProps, type TransactionHistoryElementRenderProps, type TransactionInfo, type TransactionPrepareOptions, type TransactionsQueryKeyOptions, UnifiedProvider, type UnifiedProviderProps, type UseAccountReturn, type UseBalanceOptions, type UseBalanceReturn, type UseClusterReturn, type UseGillSolanaClientReturn, type UseGillTransactionSignerReturn, type UseKitTransactionSignerReturn, type UseSolanaClientReturn, type UseTokensOptions, type UseTokensReturn, type UseTransactionPreparerReturn, type UseTransactionSignerReturn, type UseTransactionsOptions, type UseTransactionsReturn, type UseWalletInfoReturn, type WalletConnectContextValue, WalletConnectProvider, type WalletDisplayInfo, WalletListElement, type WalletListElementProps, type WalletListElementRenderProps, type WalletListElementWalletProps, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWalletConnectUri, useWalletInfo };
1693
+ export { AccountElement, type AccountElementProps, type AccountElementRenderProps, AccountInfo, AppProvider, type AppProviderProps, BalanceElement, type BalanceElementProps, type BalanceElementRenderProps, ClusterElement, type ClusterElementProps, type ClusterElementRenderProps, ClusterType, ConnectOptions, ConnectorConfig, ConnectorErrorBoundary, DisconnectElement, type DisconnectElementProps, MobileWalletAdapterConfig, SessionAccount, SkeletonShine, type Token, type TokenBalance, TokenListElement, type TokenListElementProps, type TokenListElementRenderProps, TransactionHistoryElement, type TransactionHistoryElementProps, type TransactionHistoryElementRenderProps, type TransactionInfo, type TransactionPrepareOptions, type TransactionsQueryKeyOptions, UnifiedProvider, type UnifiedProviderProps, type UseAccountReturn, type UseBalanceOptions, type UseBalanceReturn, type UseClusterReturn, type UseConnectWalletReturn, type UseDisconnectWalletReturn, type UseGillSolanaClientReturn, type UseGillTransactionSignerReturn, type UseKitTransactionSignerReturn, type UseSolanaClientReturn, type UseTokensOptions, type UseTokensReturn, type UseTransactionPreparerReturn, type UseTransactionSignerReturn, type UseTransactionsOptions, type UseTransactionsReturn, type UseWalletInfoReturn, type UseWalletReturn, type WalletConnectContextValue, WalletConnectProvider, WalletConnectorId, WalletConnectorMetadata, type WalletDisplayInfo, WalletListElement, type WalletListElementProps, type WalletListElementRenderProps, type WalletListElementWalletProps, WalletSession, WalletStatus, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useConnectWallet, useDisconnectWallet, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWallet, useWalletConnectUri, useWalletConnectors, useWalletInfo, withErrorBoundary };
package/dist/react.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { e as ConnectorConfig, M as MobileWalletAdapterConfig, j as ClusterType, A as AccountInfo, a5 as ClipboardResult, t as SolanaClient } from './standard-shim-LsQ97i9T.js';
2
- export { c as ConnectorErrorBoundary, C as ConnectorProvider, d as ConnectorSnapshot, f as ConnectorState, D as DefaultConfigOptions, E as ExtendedConnectorConfig, S as SimplifiedWalletConnectConfig, W as WalletInfo, i as WalletStandardAccount, h as WalletStandardWallet, g as getDefaultConfig, b as getDefaultMobileConfig, u as useConnector, a as useConnectorClient, w as withErrorBoundary } from './standard-shim-LsQ97i9T.js';
1
+ import { d as ConnectorConfig, M as MobileWalletAdapterConfig, Q as WalletError, l as WalletStatus, i as WalletConnectorId, m as SessionAccount, k as WalletSession, j as WalletConnectorMetadata, n as ConnectOptions, t as ClusterType, A as AccountInfo, at as ClipboardResult, Y as SolanaClient } from './standard-shim-tmnQelaJ.js';
2
+ export { C as ConnectorProvider, c as ConnectorSnapshot, e as ConnectorState, D as DefaultConfigOptions, E as ExtendedConnectorConfig, S as SimplifiedWalletConnectConfig, W as WalletInfo, h as WalletStandardAccount, f as WalletStandardWallet, o as createConnectorId, g as getDefaultConfig, b as getDefaultMobileConfig, q as isConnected, r as isConnecting, s as isDisconnected, p as isWalletConnectorId, u as useConnector, a as useConnectorClient } from './standard-shim-tmnQelaJ.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { ReactNode, ComponentType, PropsWithChildren } from 'react';
4
+ import React, { ReactNode, ComponentType, PropsWithChildren, Component, ErrorInfo } from 'react';
5
+ import { Address } from '@solana/addresses';
5
6
  import { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
6
7
  export { SolanaCluster, SolanaClusterId } from '@wallet-ui/core';
7
- import { a as TransactionSigner, v as TransactionSignerCapabilities } from './transaction-signer-T-KVQFi8.js';
8
+ import { a as TransactionSigner, v as TransactionSignerCapabilities } from './transaction-signer-7NaYmP5w.js';
8
9
  import { TransactionModifyingSigner } from '@solana/signers';
9
10
  import { TransactionMessage, TransactionMessageWithFeePayer, TransactionMessageWithBlockhashLifetime } from '@solana/kit';
10
11
  export { Wallet, WalletAccount } from '@wallet-standard/base';
11
- import '@solana/addresses';
12
12
  import '@solana/keys';
13
13
  import '@solana-mobile/wallet-standard-mobile';
14
14
  import '@solana/transaction-messages';
@@ -100,6 +100,217 @@ declare function WalletConnectProvider({ children }: {
100
100
  */
101
101
  declare function useWalletConnectUri(): WalletConnectContextValue;
102
102
 
103
+ interface ErrorBoundaryState {
104
+ hasError: boolean;
105
+ error: Error | null;
106
+ errorInfo: ErrorInfo | null;
107
+ errorId: string;
108
+ retryCount: number;
109
+ }
110
+ interface ErrorBoundaryProps {
111
+ children: ReactNode;
112
+ fallback?: (error: WalletError, retry: () => void) => ReactNode;
113
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
114
+ maxRetries?: number;
115
+ enableRecovery?: boolean;
116
+ }
117
+ declare class ConnectorErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
118
+ private retryTimeouts;
119
+ constructor(props: ErrorBoundaryProps);
120
+ static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState>;
121
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
122
+ componentWillUnmount(): void;
123
+ retry: () => void;
124
+ render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
125
+ }
126
+ declare function withErrorBoundary<P extends object>(Component: React.ComponentType<P>, errorBoundaryProps?: Omit<ErrorBoundaryProps, 'children'>): {
127
+ (props: P): react_jsx_runtime.JSX.Element;
128
+ displayName: string;
129
+ };
130
+
131
+ /**
132
+ * useWallet - vNext wallet status hook
133
+ *
134
+ * Provides access to the wallet status state machine and derived values.
135
+ * This is the primary hook for checking wallet connection state in vNext.
136
+ *
137
+ * @example
138
+ * ```tsx
139
+ * const { status, isConnected, isConnecting, account, accounts } = useWallet();
140
+ *
141
+ * if (status === 'connected') {
142
+ * console.log('Connected account:', account);
143
+ * }
144
+ * ```
145
+ */
146
+
147
+ /**
148
+ * Return type for useWallet hook
149
+ */
150
+ interface UseWalletReturn {
151
+ /**
152
+ * Current wallet status ('disconnected' | 'connecting' | 'connected' | 'error')
153
+ */
154
+ status: WalletStatus['status'];
155
+ /**
156
+ * Full wallet status object for advanced usage
157
+ */
158
+ walletStatus: WalletStatus;
159
+ /**
160
+ * Whether a wallet is connected
161
+ */
162
+ isConnected: boolean;
163
+ /**
164
+ * Whether a wallet connection is in progress
165
+ */
166
+ isConnecting: boolean;
167
+ /**
168
+ * Whether an error occurred
169
+ */
170
+ isError: boolean;
171
+ /**
172
+ * Error object if status is 'error'
173
+ */
174
+ error: Error | null;
175
+ /**
176
+ * Connected connector ID (null if not connected)
177
+ */
178
+ connectorId: WalletConnectorId | null;
179
+ /**
180
+ * Currently selected account address (null if not connected)
181
+ */
182
+ account: Address | null;
183
+ /**
184
+ * All available accounts (empty if not connected)
185
+ */
186
+ accounts: SessionAccount[];
187
+ /**
188
+ * Active session (null if not connected)
189
+ */
190
+ session: WalletSession | null;
191
+ }
192
+ /**
193
+ * Hook to access the current wallet status and connection state.
194
+ * This is the primary hook for checking wallet state in vNext.
195
+ */
196
+ declare function useWallet(): UseWalletReturn;
197
+
198
+ /**
199
+ * useWalletConnectors - vNext wallet connectors hook
200
+ *
201
+ * Provides access to available wallet connectors and their metadata.
202
+ *
203
+ * @example
204
+ * ```tsx
205
+ * const connectors = useWalletConnectors();
206
+ *
207
+ * return (
208
+ * <ul>
209
+ * {connectors.map(connector => (
210
+ * <li key={connector.id}>
211
+ * <img src={connector.icon} alt={connector.name} />
212
+ * {connector.name}
213
+ * </li>
214
+ * ))}
215
+ * </ul>
216
+ * );
217
+ * ```
218
+ */
219
+
220
+ /**
221
+ * Hook to access available wallet connectors.
222
+ * Returns an array of connector metadata (id, name, icon, ready state).
223
+ */
224
+ declare function useWalletConnectors(): WalletConnectorMetadata[];
225
+
226
+ /**
227
+ * useConnectWallet - vNext wallet connection hook
228
+ *
229
+ * Provides a function to connect to a wallet by connector ID.
230
+ *
231
+ * @example
232
+ * ```tsx
233
+ * const { connect, isConnecting, error } = useConnectWallet();
234
+ *
235
+ * return (
236
+ * <button
237
+ * onClick={() => connect('wallet-standard:phantom')}
238
+ * disabled={isConnecting}
239
+ * >
240
+ * {isConnecting ? 'Connecting...' : 'Connect Phantom'}
241
+ * </button>
242
+ * );
243
+ * ```
244
+ */
245
+
246
+ /**
247
+ * Return type for useConnectWallet hook
248
+ */
249
+ interface UseConnectWalletReturn {
250
+ /**
251
+ * Connect to a wallet by connector ID.
252
+ *
253
+ * @param connectorId - Stable connector identifier (e.g., 'wallet-standard:phantom')
254
+ * @param options - Connection options (silent mode, preferred account)
255
+ */
256
+ connect: (connectorId: WalletConnectorId, options?: ConnectOptions) => Promise<void>;
257
+ /**
258
+ * Whether a connection is currently in progress
259
+ */
260
+ isConnecting: boolean;
261
+ /**
262
+ * Error from the last connection attempt (null if none)
263
+ */
264
+ error: Error | null;
265
+ /**
266
+ * Reset the error state
267
+ */
268
+ resetError: () => void;
269
+ }
270
+ /**
271
+ * Hook to connect to a wallet by connector ID.
272
+ * Uses the vNext connectWallet API with silent-first support.
273
+ */
274
+ declare function useConnectWallet(): UseConnectWalletReturn;
275
+
276
+ /**
277
+ * useDisconnectWallet - vNext wallet disconnection hook
278
+ *
279
+ * Provides a function to disconnect the current wallet.
280
+ *
281
+ * @example
282
+ * ```tsx
283
+ * const { disconnect, isDisconnecting } = useDisconnectWallet();
284
+ *
285
+ * return (
286
+ * <button
287
+ * onClick={() => disconnect()}
288
+ * disabled={isDisconnecting}
289
+ * >
290
+ * {isDisconnecting ? 'Disconnecting...' : 'Disconnect'}
291
+ * </button>
292
+ * );
293
+ * ```
294
+ */
295
+ /**
296
+ * Return type for useDisconnectWallet hook
297
+ */
298
+ interface UseDisconnectWalletReturn {
299
+ /**
300
+ * Disconnect the current wallet session.
301
+ */
302
+ disconnect: () => Promise<void>;
303
+ /**
304
+ * Whether a disconnection is currently in progress
305
+ */
306
+ isDisconnecting: boolean;
307
+ }
308
+ /**
309
+ * Hook to disconnect the current wallet.
310
+ * Uses the vNext disconnectWallet API.
311
+ */
312
+ declare function useDisconnectWallet(): UseDisconnectWalletReturn;
313
+
103
314
  /**
104
315
  * @solana/connector - useCluster hook
105
316
  *
@@ -178,12 +389,15 @@ declare function useAccount(): UseAccountReturn;
178
389
  *
179
390
  * React hook for getting information about the connected wallet
180
391
  */
392
+
181
393
  /**
182
394
  * Simplified wallet information for display purposes
183
395
  */
184
396
  interface WalletDisplayInfo {
185
397
  /** Wallet name */
186
398
  name: string;
399
+ /** Stable connector ID for vNext API */
400
+ connectorId: WalletConnectorId;
187
401
  /** Wallet icon/logo URL if available */
188
402
  icon?: string;
189
403
  /** Whether the wallet extension is installed */
@@ -1198,12 +1412,18 @@ declare namespace ClusterElement {
1198
1412
  interface WalletListElementRenderProps {
1199
1413
  wallets: WalletDisplayInfo[];
1200
1414
  installedWallets: WalletDisplayInfo[];
1415
+ /** @deprecated Use `connectById` for vNext API */
1201
1416
  select: (walletName: string) => Promise<void>;
1417
+ /** Connect by connector ID (vNext API) */
1418
+ connectById: (connectorId: WalletConnectorId) => Promise<void>;
1202
1419
  connecting: boolean;
1203
1420
  }
1204
1421
  interface WalletListElementWalletProps {
1205
1422
  wallet: WalletDisplayInfo;
1423
+ /** @deprecated Use `connect` for clearer naming */
1206
1424
  select: () => Promise<void>;
1425
+ /** Connect to this wallet (vNext API) */
1426
+ connect: () => Promise<void>;
1207
1427
  connecting: boolean;
1208
1428
  }
1209
1429
  interface WalletListElementProps {
@@ -1215,8 +1435,10 @@ interface WalletListElementProps {
1215
1435
  variant?: 'list' | 'grid' | 'compact';
1216
1436
  /** Show wallet status badge */
1217
1437
  showStatus?: boolean;
1218
- /** Callback when a wallet is selected */
1438
+ /** @deprecated Use `onConnect` for vNext API */
1219
1439
  onSelect?: (walletName: string) => void;
1440
+ /** Callback when a wallet is connected (vNext API) */
1441
+ onConnect?: (connectorId: WalletConnectorId) => void;
1220
1442
  /** Custom render function for full control */
1221
1443
  render?: (props: WalletListElementRenderProps) => ReactNode;
1222
1444
  /** Custom render function for individual wallet items */
@@ -1268,7 +1490,7 @@ interface WalletListElementProps {
1268
1490
  * />
1269
1491
  * ```
1270
1492
  */
1271
- declare function WalletListElement({ installedOnly, className, variant, showStatus, onSelect, render, renderWallet, }: WalletListElementProps): react_jsx_runtime.JSX.Element;
1493
+ declare function WalletListElement({ installedOnly, className, variant, showStatus, onSelect, onConnect, render, renderWallet, }: WalletListElementProps): react_jsx_runtime.JSX.Element;
1272
1494
  declare namespace WalletListElement {
1273
1495
  var displayName: string;
1274
1496
  }
@@ -1468,4 +1690,4 @@ declare namespace SkeletonShine {
1468
1690
  var displayName: string;
1469
1691
  }
1470
1692
 
1471
- export { AccountElement, type AccountElementProps, type AccountElementRenderProps, AccountInfo, AppProvider, type AppProviderProps, BalanceElement, type BalanceElementProps, type BalanceElementRenderProps, ClusterElement, type ClusterElementProps, type ClusterElementRenderProps, ClusterType, ConnectorConfig, DisconnectElement, type DisconnectElementProps, MobileWalletAdapterConfig, SkeletonShine, type Token, type TokenBalance, TokenListElement, type TokenListElementProps, type TokenListElementRenderProps, TransactionHistoryElement, type TransactionHistoryElementProps, type TransactionHistoryElementRenderProps, type TransactionInfo, type TransactionPrepareOptions, type TransactionsQueryKeyOptions, UnifiedProvider, type UnifiedProviderProps, type UseAccountReturn, type UseBalanceOptions, type UseBalanceReturn, type UseClusterReturn, type UseGillSolanaClientReturn, type UseGillTransactionSignerReturn, type UseKitTransactionSignerReturn, type UseSolanaClientReturn, type UseTokensOptions, type UseTokensReturn, type UseTransactionPreparerReturn, type UseTransactionSignerReturn, type UseTransactionsOptions, type UseTransactionsReturn, type UseWalletInfoReturn, type WalletConnectContextValue, WalletConnectProvider, type WalletDisplayInfo, WalletListElement, type WalletListElementProps, type WalletListElementRenderProps, type WalletListElementWalletProps, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWalletConnectUri, useWalletInfo };
1693
+ export { AccountElement, type AccountElementProps, type AccountElementRenderProps, AccountInfo, AppProvider, type AppProviderProps, BalanceElement, type BalanceElementProps, type BalanceElementRenderProps, ClusterElement, type ClusterElementProps, type ClusterElementRenderProps, ClusterType, ConnectOptions, ConnectorConfig, ConnectorErrorBoundary, DisconnectElement, type DisconnectElementProps, MobileWalletAdapterConfig, SessionAccount, SkeletonShine, type Token, type TokenBalance, TokenListElement, type TokenListElementProps, type TokenListElementRenderProps, TransactionHistoryElement, type TransactionHistoryElementProps, type TransactionHistoryElementRenderProps, type TransactionInfo, type TransactionPrepareOptions, type TransactionsQueryKeyOptions, UnifiedProvider, type UnifiedProviderProps, type UseAccountReturn, type UseBalanceOptions, type UseBalanceReturn, type UseClusterReturn, type UseConnectWalletReturn, type UseDisconnectWalletReturn, type UseGillSolanaClientReturn, type UseGillTransactionSignerReturn, type UseKitTransactionSignerReturn, type UseSolanaClientReturn, type UseTokensOptions, type UseTokensReturn, type UseTransactionPreparerReturn, type UseTransactionSignerReturn, type UseTransactionsOptions, type UseTransactionsReturn, type UseWalletInfoReturn, type UseWalletReturn, type WalletConnectContextValue, WalletConnectProvider, WalletConnectorId, WalletConnectorMetadata, type WalletDisplayInfo, WalletListElement, type WalletListElementProps, type WalletListElementRenderProps, type WalletListElementWalletProps, WalletSession, WalletStatus, clearSharedQueryCache, clearTokenCaches, getBalanceQueryKey, getTokensQueryKey, getTransactionsQueryKey, getWalletAssetsQueryKey, invalidateSharedQuery, useAccount, useBalance, useCluster, useConnectWallet, useDisconnectWallet, useGillSolanaClient, useGillTransactionSigner, useKitTransactionSigner, useSolanaClient, useTokens, useTransactionPreparer, useTransactionSigner, useTransactions, useWallet, useWalletConnectUri, useWalletConnectors, useWalletInfo, withErrorBoundary };