@solana/connector 0.1.0 → 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-52WUWW5R.mjs → chunk-4K6QY4HR.mjs} +60 -174
- package/dist/chunk-4K6QY4HR.mjs.map +1 -0
- package/dist/{chunk-7TADXRFD.mjs → chunk-F2QJH5ED.mjs} +3 -3
- package/dist/chunk-F2QJH5ED.mjs.map +1 -0
- package/dist/chunk-JS4KJ2KK.js +706 -0
- package/dist/chunk-JS4KJ2KK.js.map +1 -0
- package/dist/{chunk-ZLPQUOFK.js → chunk-RIBOPAOD.js} +61 -173
- package/dist/chunk-RIBOPAOD.js.map +1 -0
- package/dist/{chunk-SGAIPK7Q.js → chunk-SJEZHNYF.js} +11 -11
- package/dist/chunk-SJEZHNYF.js.map +1 -0
- package/dist/chunk-WXYUUCSD.mjs +635 -0
- package/dist/chunk-WXYUUCSD.mjs.map +1 -0
- package/dist/compat.d.mts +1 -60
- package/dist/compat.d.ts +1 -60
- package/dist/compat.js.map +1 -1
- package/dist/compat.mjs.map +1 -1
- package/dist/headless.d.mts +222 -107
- package/dist/headless.d.ts +222 -107
- package/dist/headless.js +201 -81
- package/dist/headless.mjs +2 -2
- package/dist/index.d.mts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +216 -96
- package/dist/index.mjs +3 -3
- package/dist/react.d.mts +5 -154
- package/dist/react.d.ts +5 -154
- package/dist/react.js +16 -16
- package/dist/react.mjs +2 -2
- package/dist/{transaction-signer-BtJPGXIg.d.ts → transaction-signer-D3csM_Mf.d.mts} +1 -175
- package/dist/{transaction-signer-BtJPGXIg.d.mts → transaction-signer-D3csM_Mf.d.ts} +1 -175
- package/dist/{wallet-standard-shim-BGlvGRbB.d.ts → wallet-standard-shim-C1tisl9S.d.ts} +5 -169
- package/dist/{wallet-standard-shim-Af7ejSld.d.mts → wallet-standard-shim-Cg0GVGwu.d.mts} +5 -169
- package/package.json +7 -1
- package/dist/chunk-52WUWW5R.mjs.map +0 -1
- package/dist/chunk-5NSUFMCB.js +0 -393
- package/dist/chunk-5NSUFMCB.js.map +0 -1
- package/dist/chunk-7TADXRFD.mjs.map +0 -1
- package/dist/chunk-ACFSCMUI.mjs +0 -359
- package/dist/chunk-ACFSCMUI.mjs.map +0 -1
- package/dist/chunk-SGAIPK7Q.js.map +0 -1
- package/dist/chunk-ZLPQUOFK.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as TransactionActivity, d as TransactionActivityStatus } from './transaction-signer-
|
|
1
|
+
import { c as TransactionActivity, d as TransactionActivityStatus } from './transaction-signer-D3csM_Mf.js';
|
|
2
2
|
import { SolanaClusterId, SolanaCluster } from '@wallet-ui/core';
|
|
3
3
|
import { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
4
4
|
import { Address, Signature } from 'gill';
|
|
@@ -288,12 +288,6 @@ type ConnectorEvent = {
|
|
|
288
288
|
*/
|
|
289
289
|
type ConnectorEventListener = (event: ConnectorEvent) => void;
|
|
290
290
|
|
|
291
|
-
/**
|
|
292
|
-
* ConnectorClient - Lean coordinator that delegates to specialized collaborators
|
|
293
|
-
*
|
|
294
|
-
* Orchestrates wallet connection, state management, and event handling by wiring
|
|
295
|
-
* together focused collaborators, each with a single responsibility.
|
|
296
|
-
*/
|
|
297
291
|
declare class ConnectorClient {
|
|
298
292
|
private stateManager;
|
|
299
293
|
private eventEmitter;
|
|
@@ -307,115 +301,28 @@ declare class ConnectorClient {
|
|
|
307
301
|
private initialized;
|
|
308
302
|
private config;
|
|
309
303
|
constructor(config?: ConnectorConfig);
|
|
310
|
-
/**
|
|
311
|
-
* Initialize the connector
|
|
312
|
-
*/
|
|
313
304
|
private initialize;
|
|
314
|
-
/**
|
|
315
|
-
* Connect to a wallet by name
|
|
316
|
-
*/
|
|
317
305
|
select(walletName: string): Promise<void>;
|
|
318
|
-
/**
|
|
319
|
-
* Disconnect from the current wallet
|
|
320
|
-
*/
|
|
321
306
|
disconnect(): Promise<void>;
|
|
322
|
-
/**
|
|
323
|
-
* Select a different account
|
|
324
|
-
*/
|
|
325
307
|
selectAccount(address: string): Promise<void>;
|
|
326
|
-
/**
|
|
327
|
-
* Set the active cluster (network)
|
|
328
|
-
*/
|
|
329
308
|
setCluster(clusterId: SolanaClusterId): Promise<void>;
|
|
330
|
-
/**
|
|
331
|
-
* Get the currently active cluster
|
|
332
|
-
*/
|
|
333
309
|
getCluster(): SolanaCluster | null;
|
|
334
|
-
/**
|
|
335
|
-
* Get all available clusters
|
|
336
|
-
*/
|
|
337
310
|
getClusters(): SolanaCluster[];
|
|
338
|
-
/**
|
|
339
|
-
* Get the RPC URL for the current cluster
|
|
340
|
-
* @returns RPC URL or null if no cluster is selected
|
|
341
|
-
*/
|
|
342
311
|
getRpcUrl(): string | null;
|
|
343
|
-
/**
|
|
344
|
-
* Subscribe to state changes
|
|
345
|
-
*/
|
|
346
312
|
subscribe(listener: Listener): () => void;
|
|
347
|
-
/**
|
|
348
|
-
* Get current state snapshot
|
|
349
|
-
*/
|
|
350
313
|
getSnapshot(): ConnectorState;
|
|
351
|
-
/**
|
|
352
|
-
* Reset all storage to initial values
|
|
353
|
-
* Useful for "logout", "forget this device", or clearing user data
|
|
354
|
-
*
|
|
355
|
-
* This will:
|
|
356
|
-
* - Clear saved wallet name
|
|
357
|
-
* - Clear saved account address
|
|
358
|
-
* - Reset cluster to initial value (does not clear)
|
|
359
|
-
*
|
|
360
|
-
* Note: This does NOT disconnect the wallet. Call disconnect() separately if needed.
|
|
361
|
-
*
|
|
362
|
-
* @example
|
|
363
|
-
* ```ts
|
|
364
|
-
* // Complete logout flow
|
|
365
|
-
* await client.disconnect();
|
|
366
|
-
* client.resetStorage();
|
|
367
|
-
* ```
|
|
368
|
-
*/
|
|
369
314
|
resetStorage(): void;
|
|
370
|
-
/**
|
|
371
|
-
* Subscribe to connector events
|
|
372
|
-
*/
|
|
373
315
|
on(listener: ConnectorEventListener): () => void;
|
|
374
|
-
/**
|
|
375
|
-
* Remove a specific event listener
|
|
376
|
-
*/
|
|
377
316
|
off(listener: ConnectorEventListener): void;
|
|
378
|
-
/**
|
|
379
|
-
* Remove all event listeners
|
|
380
|
-
*/
|
|
381
317
|
offAll(): void;
|
|
382
|
-
/**
|
|
383
|
-
* Emit a connector event
|
|
384
|
-
* Internal method used by transaction signer and other components
|
|
385
|
-
* @internal
|
|
386
|
-
*/
|
|
387
318
|
emitEvent(event: ConnectorEvent): void;
|
|
388
|
-
/**
|
|
389
|
-
* Track a transaction for debugging and monitoring
|
|
390
|
-
*/
|
|
391
319
|
trackTransaction(activity: Omit<TransactionActivity, 'timestamp' | 'cluster'>): void;
|
|
392
|
-
/**
|
|
393
|
-
* Update transaction status
|
|
394
|
-
*/
|
|
395
320
|
updateTransactionStatus(signature: string, status: TransactionActivity['status'], error?: string): void;
|
|
396
|
-
/**
|
|
397
|
-
* Clear transaction history
|
|
398
|
-
*/
|
|
399
321
|
clearTransactionHistory(): void;
|
|
400
|
-
/**
|
|
401
|
-
* Get connector health and diagnostics
|
|
402
|
-
*/
|
|
403
322
|
getHealth(): ConnectorHealth;
|
|
404
|
-
/**
|
|
405
|
-
* Get performance and debug metrics
|
|
406
|
-
*/
|
|
407
323
|
getDebugMetrics(): ConnectorDebugMetrics;
|
|
408
|
-
/**
|
|
409
|
-
* Get debug state including transactions
|
|
410
|
-
*/
|
|
411
324
|
getDebugState(): ConnectorDebugState;
|
|
412
|
-
/**
|
|
413
|
-
* Reset debug metrics
|
|
414
|
-
*/
|
|
415
325
|
resetDebugMetrics(): void;
|
|
416
|
-
/**
|
|
417
|
-
* Cleanup resources
|
|
418
|
-
*/
|
|
419
326
|
destroy(): void;
|
|
420
327
|
}
|
|
421
328
|
|
|
@@ -519,24 +426,6 @@ declare function ConnectorProvider({ children, config, mobile, }: {
|
|
|
519
426
|
mobile?: MobileWalletAdapterConfig;
|
|
520
427
|
}): react_jsx_runtime.JSX.Element;
|
|
521
428
|
declare function useConnector(): ConnectorSnapshot;
|
|
522
|
-
/**
|
|
523
|
-
* Get the connector client instance
|
|
524
|
-
* Returns null if not within ConnectorProvider or if initialization failed
|
|
525
|
-
*
|
|
526
|
-
* @example
|
|
527
|
-
* ```tsx
|
|
528
|
-
* function MyComponent() {
|
|
529
|
-
* const client = useConnectorClient()
|
|
530
|
-
*
|
|
531
|
-
* if (!client) {
|
|
532
|
-
* return <div>Connector not available</div>
|
|
533
|
-
* }
|
|
534
|
-
*
|
|
535
|
-
* // Use client methods directly
|
|
536
|
-
* const health = client.getHealth()
|
|
537
|
-
* }
|
|
538
|
-
* ```
|
|
539
|
-
*/
|
|
540
429
|
declare function useConnectorClient(): ConnectorClient | null;
|
|
541
430
|
|
|
542
431
|
/**
|
|
@@ -835,73 +724,20 @@ declare function withErrorBoundary<P extends object>(Component: React.ComponentT
|
|
|
835
724
|
* Cluster type enum for all supported Solana cluster types
|
|
836
725
|
*/
|
|
837
726
|
type ClusterType = 'mainnet' | 'devnet' | 'testnet' | 'localnet' | 'custom';
|
|
838
|
-
|
|
839
|
-
* Get the RPC endpoint URL for a cluster
|
|
840
|
-
* Handles both string cluster names and full URLs
|
|
841
|
-
*
|
|
842
|
-
* @example
|
|
843
|
-
* getClusterRpcUrl(devnetCluster) // Returns: 'https://api.devnet.solana.com'
|
|
844
|
-
*/
|
|
845
|
-
declare function getClusterRpcUrl(cluster: SolanaCluster): string;
|
|
846
|
-
/**
|
|
847
|
-
* Get the base Solana Explorer URL for a cluster
|
|
848
|
-
*
|
|
849
|
-
* @example
|
|
850
|
-
* getClusterExplorerUrl(mainnetCluster) // Returns: 'https://explorer.solana.com'
|
|
851
|
-
*/
|
|
727
|
+
declare function getClusterRpcUrl(cluster: SolanaCluster | string): string;
|
|
852
728
|
declare function getClusterExplorerUrl(cluster: SolanaCluster, path?: string): string;
|
|
853
|
-
/**
|
|
854
|
-
* Get the Solana Explorer URL for a transaction signature
|
|
855
|
-
*
|
|
856
|
-
* @example
|
|
857
|
-
* getTransactionUrl('5VERv8...', devnetCluster)
|
|
858
|
-
* // Returns: 'https://explorer.solana.com/tx/5VERv8...?cluster=devnet'
|
|
859
|
-
*/
|
|
860
729
|
declare function getTransactionUrl(signature: string, cluster: SolanaCluster): string;
|
|
861
|
-
/**
|
|
862
|
-
* Get the Solana Explorer URL for an address
|
|
863
|
-
* Works for wallet addresses, token accounts, and programs
|
|
864
|
-
*
|
|
865
|
-
* @example
|
|
866
|
-
* getAddressUrl('7xKXtg2C...', mainnetCluster)
|
|
867
|
-
* // Returns: 'https://explorer.solana.com/address/7xKXtg2C...'
|
|
868
|
-
*/
|
|
869
730
|
declare function getAddressUrl(address: string, cluster: SolanaCluster): string;
|
|
870
|
-
/**
|
|
871
|
-
* Get the Solana Explorer URL for a token
|
|
872
|
-
*
|
|
873
|
-
* @example
|
|
874
|
-
* getTokenUrl('EPjFWdd5...', mainnetCluster)
|
|
875
|
-
*/
|
|
876
731
|
declare function getTokenUrl(tokenAddress: string, cluster: SolanaCluster): string;
|
|
877
|
-
/**
|
|
878
|
-
* Get the Solana Explorer URL for a block
|
|
879
|
-
*/
|
|
880
732
|
declare function getBlockUrl(slot: number, cluster: SolanaCluster): string;
|
|
881
|
-
/**
|
|
882
|
-
* Check if a cluster is production (mainnet)
|
|
883
|
-
*/
|
|
884
733
|
declare function isMainnetCluster(cluster: SolanaCluster): boolean;
|
|
885
|
-
/**
|
|
886
|
-
* Check if a cluster is devnet
|
|
887
|
-
*/
|
|
888
734
|
declare function isDevnetCluster(cluster: SolanaCluster): boolean;
|
|
889
|
-
/**
|
|
890
|
-
* Check if a cluster is testnet
|
|
891
|
-
*/
|
|
892
735
|
declare function isTestnetCluster(cluster: SolanaCluster): boolean;
|
|
893
|
-
/**
|
|
894
|
-
* Check if a cluster is running locally
|
|
895
|
-
*/
|
|
896
736
|
declare function isLocalCluster(cluster: SolanaCluster): boolean;
|
|
897
|
-
/**
|
|
898
|
-
* Get a user-friendly name for the cluster
|
|
899
|
-
*/
|
|
900
737
|
declare function getClusterName(cluster: SolanaCluster): string;
|
|
901
|
-
/**
|
|
902
|
-
* Get the cluster type (mainnet, devnet, testnet, localnet, custom)
|
|
903
|
-
*/
|
|
904
738
|
declare function getClusterType(cluster: SolanaCluster): ClusterType;
|
|
739
|
+
declare function getClusterChainId(cluster: SolanaCluster): `solana:${string}` | null;
|
|
740
|
+
declare function getChainIdForWalletStandard(cluster: SolanaCluster): `solana:${string}` | null;
|
|
905
741
|
|
|
906
742
|
/**
|
|
907
743
|
* @solana/connector - Enhanced Clipboard Utilities
|
|
@@ -1087,4 +923,4 @@ type WalletStandardAccount = WalletAccount;
|
|
|
1087
923
|
*/
|
|
1088
924
|
declare function getWalletsRegistry(): WalletsRegistry;
|
|
1089
925
|
|
|
1090
|
-
export { getBlockUrl as $, type AccountInfo as A, type StorageOptions as B, ConnectorProvider as C, type DefaultConfigOptions as D, type ExtendedConnectorConfig as E, type EnhancedStorageAccountOptions as F, type EnhancedStorageClusterOptions as G, type EnhancedStorageWalletOptions as H, WalletErrorType as I, type WalletError as J, ClipboardErrorType as K, type Listener as L, type MobileWalletAdapterConfig as M, type ClipboardResult as N, type CopyOptions as O, isClipboardAvailable as P, copyToClipboard as Q, copyAddressToClipboard as R, type StorageAdapter as S, copySignatureToClipboard as T, type UnifiedConfigOptions as U, getClusterRpcUrl as V, type WalletInfo as W, getClusterExplorerUrl as X, getTransactionUrl as Y, getAddressUrl as Z, getTokenUrl as _, useConnectorClient as a, isMainnetCluster as a0, isDevnetCluster as a1, isTestnetCluster as a2, isLocalCluster as a3, getClusterName as a4, getClusterType as a5, type SolanaNetwork as
|
|
926
|
+
export { getBlockUrl as $, type AccountInfo as A, type StorageOptions as B, ConnectorProvider as C, type DefaultConfigOptions as D, type ExtendedConnectorConfig as E, type EnhancedStorageAccountOptions as F, type EnhancedStorageClusterOptions as G, type EnhancedStorageWalletOptions as H, WalletErrorType as I, type WalletError as J, ClipboardErrorType as K, type Listener as L, type MobileWalletAdapterConfig as M, type ClipboardResult as N, type CopyOptions as O, isClipboardAvailable as P, copyToClipboard as Q, copyAddressToClipboard as R, type StorageAdapter as S, copySignatureToClipboard as T, type UnifiedConfigOptions as U, getClusterRpcUrl as V, type WalletInfo as W, getClusterExplorerUrl as X, getTransactionUrl as Y, getAddressUrl as Z, getTokenUrl as _, useConnectorClient as a, isMainnetCluster as a0, isDevnetCluster as a1, isTestnetCluster as a2, isLocalCluster as a3, getClusterName as a4, getClusterType as a5, getClusterChainId as a6, getChainIdForWalletStandard as a7, type SolanaNetwork as a8, PUBLIC_RPC_ENDPOINTS as a9, normalizeNetwork as aa, toClusterId as ab, getDefaultRpcUrl as ac, isMainnet as ad, isDevnet as ae, isTestnet as af, isLocalnet as ag, getNetworkDisplayName as ah, ConnectorErrorBoundary as b, type ConnectorSnapshot as c, type ConnectorConfig as d, type ConnectorState as e, type WalletStandardWallet as f, type WalletStandardAccount as g, type UnifiedConfig as h, type ClusterType as i, ConnectorClient as j, getWalletsRegistry as k, getDefaultConfig as l, getDefaultMobileConfig as m, createConfig as n, isUnifiedConfig as o, type WalletName as p, type AccountAddress as q, isWalletName as r, isAccountAddress as s, type ConnectorHealth as t, useConnector as u, type ConnectorDebugMetrics as v, withErrorBoundary as w, type ConnectorDebugState as x, type ConnectorEvent as y, type ConnectorEventListener as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as TransactionActivity, d as TransactionActivityStatus } from './transaction-signer-
|
|
1
|
+
import { c as TransactionActivity, d as TransactionActivityStatus } from './transaction-signer-D3csM_Mf.mjs';
|
|
2
2
|
import { SolanaClusterId, SolanaCluster } from '@wallet-ui/core';
|
|
3
3
|
import { Wallet, WalletAccount } from '@wallet-standard/base';
|
|
4
4
|
import { Address, Signature } from 'gill';
|
|
@@ -288,12 +288,6 @@ type ConnectorEvent = {
|
|
|
288
288
|
*/
|
|
289
289
|
type ConnectorEventListener = (event: ConnectorEvent) => void;
|
|
290
290
|
|
|
291
|
-
/**
|
|
292
|
-
* ConnectorClient - Lean coordinator that delegates to specialized collaborators
|
|
293
|
-
*
|
|
294
|
-
* Orchestrates wallet connection, state management, and event handling by wiring
|
|
295
|
-
* together focused collaborators, each with a single responsibility.
|
|
296
|
-
*/
|
|
297
291
|
declare class ConnectorClient {
|
|
298
292
|
private stateManager;
|
|
299
293
|
private eventEmitter;
|
|
@@ -307,115 +301,28 @@ declare class ConnectorClient {
|
|
|
307
301
|
private initialized;
|
|
308
302
|
private config;
|
|
309
303
|
constructor(config?: ConnectorConfig);
|
|
310
|
-
/**
|
|
311
|
-
* Initialize the connector
|
|
312
|
-
*/
|
|
313
304
|
private initialize;
|
|
314
|
-
/**
|
|
315
|
-
* Connect to a wallet by name
|
|
316
|
-
*/
|
|
317
305
|
select(walletName: string): Promise<void>;
|
|
318
|
-
/**
|
|
319
|
-
* Disconnect from the current wallet
|
|
320
|
-
*/
|
|
321
306
|
disconnect(): Promise<void>;
|
|
322
|
-
/**
|
|
323
|
-
* Select a different account
|
|
324
|
-
*/
|
|
325
307
|
selectAccount(address: string): Promise<void>;
|
|
326
|
-
/**
|
|
327
|
-
* Set the active cluster (network)
|
|
328
|
-
*/
|
|
329
308
|
setCluster(clusterId: SolanaClusterId): Promise<void>;
|
|
330
|
-
/**
|
|
331
|
-
* Get the currently active cluster
|
|
332
|
-
*/
|
|
333
309
|
getCluster(): SolanaCluster | null;
|
|
334
|
-
/**
|
|
335
|
-
* Get all available clusters
|
|
336
|
-
*/
|
|
337
310
|
getClusters(): SolanaCluster[];
|
|
338
|
-
/**
|
|
339
|
-
* Get the RPC URL for the current cluster
|
|
340
|
-
* @returns RPC URL or null if no cluster is selected
|
|
341
|
-
*/
|
|
342
311
|
getRpcUrl(): string | null;
|
|
343
|
-
/**
|
|
344
|
-
* Subscribe to state changes
|
|
345
|
-
*/
|
|
346
312
|
subscribe(listener: Listener): () => void;
|
|
347
|
-
/**
|
|
348
|
-
* Get current state snapshot
|
|
349
|
-
*/
|
|
350
313
|
getSnapshot(): ConnectorState;
|
|
351
|
-
/**
|
|
352
|
-
* Reset all storage to initial values
|
|
353
|
-
* Useful for "logout", "forget this device", or clearing user data
|
|
354
|
-
*
|
|
355
|
-
* This will:
|
|
356
|
-
* - Clear saved wallet name
|
|
357
|
-
* - Clear saved account address
|
|
358
|
-
* - Reset cluster to initial value (does not clear)
|
|
359
|
-
*
|
|
360
|
-
* Note: This does NOT disconnect the wallet. Call disconnect() separately if needed.
|
|
361
|
-
*
|
|
362
|
-
* @example
|
|
363
|
-
* ```ts
|
|
364
|
-
* // Complete logout flow
|
|
365
|
-
* await client.disconnect();
|
|
366
|
-
* client.resetStorage();
|
|
367
|
-
* ```
|
|
368
|
-
*/
|
|
369
314
|
resetStorage(): void;
|
|
370
|
-
/**
|
|
371
|
-
* Subscribe to connector events
|
|
372
|
-
*/
|
|
373
315
|
on(listener: ConnectorEventListener): () => void;
|
|
374
|
-
/**
|
|
375
|
-
* Remove a specific event listener
|
|
376
|
-
*/
|
|
377
316
|
off(listener: ConnectorEventListener): void;
|
|
378
|
-
/**
|
|
379
|
-
* Remove all event listeners
|
|
380
|
-
*/
|
|
381
317
|
offAll(): void;
|
|
382
|
-
/**
|
|
383
|
-
* Emit a connector event
|
|
384
|
-
* Internal method used by transaction signer and other components
|
|
385
|
-
* @internal
|
|
386
|
-
*/
|
|
387
318
|
emitEvent(event: ConnectorEvent): void;
|
|
388
|
-
/**
|
|
389
|
-
* Track a transaction for debugging and monitoring
|
|
390
|
-
*/
|
|
391
319
|
trackTransaction(activity: Omit<TransactionActivity, 'timestamp' | 'cluster'>): void;
|
|
392
|
-
/**
|
|
393
|
-
* Update transaction status
|
|
394
|
-
*/
|
|
395
320
|
updateTransactionStatus(signature: string, status: TransactionActivity['status'], error?: string): void;
|
|
396
|
-
/**
|
|
397
|
-
* Clear transaction history
|
|
398
|
-
*/
|
|
399
321
|
clearTransactionHistory(): void;
|
|
400
|
-
/**
|
|
401
|
-
* Get connector health and diagnostics
|
|
402
|
-
*/
|
|
403
322
|
getHealth(): ConnectorHealth;
|
|
404
|
-
/**
|
|
405
|
-
* Get performance and debug metrics
|
|
406
|
-
*/
|
|
407
323
|
getDebugMetrics(): ConnectorDebugMetrics;
|
|
408
|
-
/**
|
|
409
|
-
* Get debug state including transactions
|
|
410
|
-
*/
|
|
411
324
|
getDebugState(): ConnectorDebugState;
|
|
412
|
-
/**
|
|
413
|
-
* Reset debug metrics
|
|
414
|
-
*/
|
|
415
325
|
resetDebugMetrics(): void;
|
|
416
|
-
/**
|
|
417
|
-
* Cleanup resources
|
|
418
|
-
*/
|
|
419
326
|
destroy(): void;
|
|
420
327
|
}
|
|
421
328
|
|
|
@@ -519,24 +426,6 @@ declare function ConnectorProvider({ children, config, mobile, }: {
|
|
|
519
426
|
mobile?: MobileWalletAdapterConfig;
|
|
520
427
|
}): react_jsx_runtime.JSX.Element;
|
|
521
428
|
declare function useConnector(): ConnectorSnapshot;
|
|
522
|
-
/**
|
|
523
|
-
* Get the connector client instance
|
|
524
|
-
* Returns null if not within ConnectorProvider or if initialization failed
|
|
525
|
-
*
|
|
526
|
-
* @example
|
|
527
|
-
* ```tsx
|
|
528
|
-
* function MyComponent() {
|
|
529
|
-
* const client = useConnectorClient()
|
|
530
|
-
*
|
|
531
|
-
* if (!client) {
|
|
532
|
-
* return <div>Connector not available</div>
|
|
533
|
-
* }
|
|
534
|
-
*
|
|
535
|
-
* // Use client methods directly
|
|
536
|
-
* const health = client.getHealth()
|
|
537
|
-
* }
|
|
538
|
-
* ```
|
|
539
|
-
*/
|
|
540
429
|
declare function useConnectorClient(): ConnectorClient | null;
|
|
541
430
|
|
|
542
431
|
/**
|
|
@@ -835,73 +724,20 @@ declare function withErrorBoundary<P extends object>(Component: React.ComponentT
|
|
|
835
724
|
* Cluster type enum for all supported Solana cluster types
|
|
836
725
|
*/
|
|
837
726
|
type ClusterType = 'mainnet' | 'devnet' | 'testnet' | 'localnet' | 'custom';
|
|
838
|
-
|
|
839
|
-
* Get the RPC endpoint URL for a cluster
|
|
840
|
-
* Handles both string cluster names and full URLs
|
|
841
|
-
*
|
|
842
|
-
* @example
|
|
843
|
-
* getClusterRpcUrl(devnetCluster) // Returns: 'https://api.devnet.solana.com'
|
|
844
|
-
*/
|
|
845
|
-
declare function getClusterRpcUrl(cluster: SolanaCluster): string;
|
|
846
|
-
/**
|
|
847
|
-
* Get the base Solana Explorer URL for a cluster
|
|
848
|
-
*
|
|
849
|
-
* @example
|
|
850
|
-
* getClusterExplorerUrl(mainnetCluster) // Returns: 'https://explorer.solana.com'
|
|
851
|
-
*/
|
|
727
|
+
declare function getClusterRpcUrl(cluster: SolanaCluster | string): string;
|
|
852
728
|
declare function getClusterExplorerUrl(cluster: SolanaCluster, path?: string): string;
|
|
853
|
-
/**
|
|
854
|
-
* Get the Solana Explorer URL for a transaction signature
|
|
855
|
-
*
|
|
856
|
-
* @example
|
|
857
|
-
* getTransactionUrl('5VERv8...', devnetCluster)
|
|
858
|
-
* // Returns: 'https://explorer.solana.com/tx/5VERv8...?cluster=devnet'
|
|
859
|
-
*/
|
|
860
729
|
declare function getTransactionUrl(signature: string, cluster: SolanaCluster): string;
|
|
861
|
-
/**
|
|
862
|
-
* Get the Solana Explorer URL for an address
|
|
863
|
-
* Works for wallet addresses, token accounts, and programs
|
|
864
|
-
*
|
|
865
|
-
* @example
|
|
866
|
-
* getAddressUrl('7xKXtg2C...', mainnetCluster)
|
|
867
|
-
* // Returns: 'https://explorer.solana.com/address/7xKXtg2C...'
|
|
868
|
-
*/
|
|
869
730
|
declare function getAddressUrl(address: string, cluster: SolanaCluster): string;
|
|
870
|
-
/**
|
|
871
|
-
* Get the Solana Explorer URL for a token
|
|
872
|
-
*
|
|
873
|
-
* @example
|
|
874
|
-
* getTokenUrl('EPjFWdd5...', mainnetCluster)
|
|
875
|
-
*/
|
|
876
731
|
declare function getTokenUrl(tokenAddress: string, cluster: SolanaCluster): string;
|
|
877
|
-
/**
|
|
878
|
-
* Get the Solana Explorer URL for a block
|
|
879
|
-
*/
|
|
880
732
|
declare function getBlockUrl(slot: number, cluster: SolanaCluster): string;
|
|
881
|
-
/**
|
|
882
|
-
* Check if a cluster is production (mainnet)
|
|
883
|
-
*/
|
|
884
733
|
declare function isMainnetCluster(cluster: SolanaCluster): boolean;
|
|
885
|
-
/**
|
|
886
|
-
* Check if a cluster is devnet
|
|
887
|
-
*/
|
|
888
734
|
declare function isDevnetCluster(cluster: SolanaCluster): boolean;
|
|
889
|
-
/**
|
|
890
|
-
* Check if a cluster is testnet
|
|
891
|
-
*/
|
|
892
735
|
declare function isTestnetCluster(cluster: SolanaCluster): boolean;
|
|
893
|
-
/**
|
|
894
|
-
* Check if a cluster is running locally
|
|
895
|
-
*/
|
|
896
736
|
declare function isLocalCluster(cluster: SolanaCluster): boolean;
|
|
897
|
-
/**
|
|
898
|
-
* Get a user-friendly name for the cluster
|
|
899
|
-
*/
|
|
900
737
|
declare function getClusterName(cluster: SolanaCluster): string;
|
|
901
|
-
/**
|
|
902
|
-
* Get the cluster type (mainnet, devnet, testnet, localnet, custom)
|
|
903
|
-
*/
|
|
904
738
|
declare function getClusterType(cluster: SolanaCluster): ClusterType;
|
|
739
|
+
declare function getClusterChainId(cluster: SolanaCluster): `solana:${string}` | null;
|
|
740
|
+
declare function getChainIdForWalletStandard(cluster: SolanaCluster): `solana:${string}` | null;
|
|
905
741
|
|
|
906
742
|
/**
|
|
907
743
|
* @solana/connector - Enhanced Clipboard Utilities
|
|
@@ -1087,4 +923,4 @@ type WalletStandardAccount = WalletAccount;
|
|
|
1087
923
|
*/
|
|
1088
924
|
declare function getWalletsRegistry(): WalletsRegistry;
|
|
1089
925
|
|
|
1090
|
-
export { getBlockUrl as $, type AccountInfo as A, type StorageOptions as B, ConnectorProvider as C, type DefaultConfigOptions as D, type ExtendedConnectorConfig as E, type EnhancedStorageAccountOptions as F, type EnhancedStorageClusterOptions as G, type EnhancedStorageWalletOptions as H, WalletErrorType as I, type WalletError as J, ClipboardErrorType as K, type Listener as L, type MobileWalletAdapterConfig as M, type ClipboardResult as N, type CopyOptions as O, isClipboardAvailable as P, copyToClipboard as Q, copyAddressToClipboard as R, type StorageAdapter as S, copySignatureToClipboard as T, type UnifiedConfigOptions as U, getClusterRpcUrl as V, type WalletInfo as W, getClusterExplorerUrl as X, getTransactionUrl as Y, getAddressUrl as Z, getTokenUrl as _, useConnectorClient as a, isMainnetCluster as a0, isDevnetCluster as a1, isTestnetCluster as a2, isLocalCluster as a3, getClusterName as a4, getClusterType as a5, type SolanaNetwork as
|
|
926
|
+
export { getBlockUrl as $, type AccountInfo as A, type StorageOptions as B, ConnectorProvider as C, type DefaultConfigOptions as D, type ExtendedConnectorConfig as E, type EnhancedStorageAccountOptions as F, type EnhancedStorageClusterOptions as G, type EnhancedStorageWalletOptions as H, WalletErrorType as I, type WalletError as J, ClipboardErrorType as K, type Listener as L, type MobileWalletAdapterConfig as M, type ClipboardResult as N, type CopyOptions as O, isClipboardAvailable as P, copyToClipboard as Q, copyAddressToClipboard as R, type StorageAdapter as S, copySignatureToClipboard as T, type UnifiedConfigOptions as U, getClusterRpcUrl as V, type WalletInfo as W, getClusterExplorerUrl as X, getTransactionUrl as Y, getAddressUrl as Z, getTokenUrl as _, useConnectorClient as a, isMainnetCluster as a0, isDevnetCluster as a1, isTestnetCluster as a2, isLocalCluster as a3, getClusterName as a4, getClusterType as a5, getClusterChainId as a6, getChainIdForWalletStandard as a7, type SolanaNetwork as a8, PUBLIC_RPC_ENDPOINTS as a9, normalizeNetwork as aa, toClusterId as ab, getDefaultRpcUrl as ac, isMainnet as ad, isDevnet as ae, isTestnet as af, isLocalnet as ag, getNetworkDisplayName as ah, ConnectorErrorBoundary as b, type ConnectorSnapshot as c, type ConnectorConfig as d, type ConnectorState as e, type WalletStandardWallet as f, type WalletStandardAccount as g, type UnifiedConfig as h, type ClusterType as i, ConnectorClient as j, getWalletsRegistry as k, getDefaultConfig as l, getDefaultMobileConfig as m, createConfig as n, isUnifiedConfig as o, type WalletName as p, type AccountAddress as q, isWalletName as r, isAccountAddress as s, type ConnectorHealth as t, useConnector as u, type ConnectorDebugMetrics as v, withErrorBoundary as w, type ConnectorDebugState as x, type ConnectorEvent as y, type ConnectorEventListener as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/connector",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Headless wallet connector client and React provider built on Wallet Standard",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -65,10 +65,16 @@
|
|
|
65
65
|
"@nanostores/persistent": "^1.1.0",
|
|
66
66
|
"@solana-mobile/wallet-standard-mobile": "^0.4.3",
|
|
67
67
|
"@solana/webcrypto-ed25519-polyfill": "^4.0.0",
|
|
68
|
+
"@solana/addresses": "^3.0.0",
|
|
69
|
+
"@solana/keys": "^3.0.0",
|
|
70
|
+
"@solana/kit": "^3.0.0",
|
|
71
|
+
"@solana/signers": "^3.0.0",
|
|
72
|
+
"@solana/transactions": "^3.0.0",
|
|
68
73
|
"@wallet-standard/app": "^1.1.0",
|
|
69
74
|
"@wallet-standard/base": "^1.1.0",
|
|
70
75
|
"@wallet-standard/features": "^1.1.0",
|
|
71
76
|
"@wallet-ui/core": "^2.0.0",
|
|
77
|
+
"bs58": "^6.0.0",
|
|
72
78
|
"gill": "^0.12.0"
|
|
73
79
|
},
|
|
74
80
|
"devDependencies": {
|