@solana/connector 0.1.8 → 0.1.10
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/README.md +97 -0
- package/dist/chunk-4JT24DIX.js +466 -0
- package/dist/chunk-4JT24DIX.js.map +1 -0
- package/dist/chunk-4KD6HQQG.js +69 -0
- package/dist/chunk-4KD6HQQG.js.map +1 -0
- package/dist/{chunk-DSUCH44G.js → chunk-64LV76OK.js} +2 -67
- package/dist/chunk-64LV76OK.js.map +1 -0
- package/dist/{chunk-FTXIXM43.js → chunk-6AJJJG5B.js} +614 -138
- package/dist/chunk-6AJJJG5B.js.map +1 -0
- package/dist/chunk-7XHVZW2L.mjs +460 -0
- package/dist/chunk-7XHVZW2L.mjs.map +1 -0
- package/dist/{chunk-K3BNIGPX.js → chunk-ATYK5OKR.js} +81 -33
- package/dist/chunk-ATYK5OKR.js.map +1 -0
- package/dist/{chunk-J7DHGLW6.mjs → chunk-DKCZA2QI.mjs} +3 -61
- package/dist/chunk-DKCZA2QI.mjs.map +1 -0
- package/dist/chunk-FVA4TUI4.mjs +178 -0
- package/dist/chunk-FVA4TUI4.mjs.map +1 -0
- package/dist/chunk-HO6QNKFM.mjs +61 -0
- package/dist/chunk-HO6QNKFM.mjs.map +1 -0
- package/dist/chunk-MN7XNCYI.js +230 -0
- package/dist/chunk-MN7XNCYI.js.map +1 -0
- package/dist/{chunk-6F6M6L7R.mjs → chunk-QOIQBWMP.mjs} +524 -56
- package/dist/chunk-QOIQBWMP.mjs.map +1 -0
- package/dist/{chunk-TTOKQAPX.mjs → chunk-WGZYKDXF.mjs} +57 -11
- package/dist/chunk-WGZYKDXF.mjs.map +1 -0
- package/dist/compat.js +10 -9
- package/dist/compat.js.map +1 -1
- package/dist/compat.mjs +2 -1
- package/dist/compat.mjs.map +1 -1
- package/dist/headless.d.mts +217 -100
- package/dist/headless.d.ts +217 -100
- package/dist/headless.js +190 -168
- package/dist/headless.mjs +5 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +233 -203
- package/dist/index.mjs +6 -4
- package/dist/react.d.mts +72 -4
- package/dist/react.d.ts +72 -4
- package/dist/react.js +52 -36
- package/dist/react.mjs +2 -2
- package/dist/{standard-shim-CT49DM5l.d.mts → standard-shim-BTUm7cur.d.mts} +280 -1
- package/dist/{standard-shim-D9guL5fz.d.ts → standard-shim-LsQ97i9T.d.ts} +280 -1
- package/dist/walletconnect-D4JN6H2O.js +28 -0
- package/dist/walletconnect-D4JN6H2O.js.map +1 -0
- package/dist/walletconnect-I3PZUBTA.mjs +3 -0
- package/dist/walletconnect-I3PZUBTA.mjs.map +1 -0
- package/package.json +6 -2
- package/dist/chunk-6F6M6L7R.mjs.map +0 -1
- package/dist/chunk-AOIXHVRH.js +0 -535
- package/dist/chunk-AOIXHVRH.js.map +0 -1
- package/dist/chunk-DSUCH44G.js.map +0 -1
- package/dist/chunk-FTXIXM43.js.map +0 -1
- package/dist/chunk-G575OAT4.mjs +0 -476
- package/dist/chunk-G575OAT4.mjs.map +0 -1
- package/dist/chunk-J7DHGLW6.mjs.map +0 -1
- package/dist/chunk-K3BNIGPX.js.map +0 -1
- package/dist/chunk-TTOKQAPX.mjs.map +0 -1
package/dist/headless.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { j as ClusterType, R as StorageOptions, Q as StorageAdapter, T as EnhancedStorageAccountOptions, U as EnhancedStorageClusterOptions, V as EnhancedStorageWalletOptions, x as WalletConnectConfig, z as WalletConnectTransport } from './standard-shim-LsQ97i9T.js';
|
|
2
|
+
export { F as AccountAddress, A as AccountInfo, a4 as ClipboardErrorType, a5 as ClipboardResult, I as CoinGeckoConfig, k as ConnectorClient, e as ConnectorConfig, K as ConnectorDebugMetrics, L as ConnectorDebugState, O as ConnectorEvent, P as ConnectorEventListener, J as ConnectorHealth, f as ConnectorState, a6 as CopyOptions, v as CreateSolanaClientArgs, D as DefaultConfigOptions, E as ExtendedConnectorConfig, N as Listener, M as MobileWalletAdapterConfig, s as ModifiedClusterUrl, t as SolanaClient, q as SolanaClusterMoniker, y as WalletConnectMetadata, a0 as WalletConnectSignAllTransactionsParams, a1 as WalletConnectSignAllTransactionsResult, a2 as WalletConnectSignAndSendTransactionParams, a3 as WalletConnectSignAndSendTransactionResult, Y as WalletConnectSignMessageParams, Z as WalletConnectSignMessageResult, _ as WalletConnectSignTransactionParams, $ as WalletConnectSignTransactionResult, X as WalletConnectSolanaAccount, n as WalletError, m as WalletErrorType, W as WalletInfo, B as WalletName, i as WalletStandardAccount, h as WalletStandardWallet, a9 as copyAddressToClipboard, aa as copySignatureToClipboard, a8 as copyToClipboard, p as createSolanaClient, ae as getAddressUrl, ag as getBlockUrl, ao as getChainIdForWalletStandard, an as getClusterChainId, ac as getClusterExplorerUrl, al as getClusterName, ab as getClusterRpcUrl, am as getClusterType, g as getDefaultConfig, b as getDefaultMobileConfig, o as getPublicSolanaRpcUrl, af as getTokenUrl, ad as getTransactionUrl, l as getWalletsRegistry, H as isAccountAddress, a7 as isClipboardAvailable, ai as isDevnetCluster, ak as isLocalCluster, ah as isMainnetCluster, aj as isTestnetCluster, G as isWalletName, r as ready } from './standard-shim-LsQ97i9T.js';
|
|
3
3
|
import { z } from 'zod/v4';
|
|
4
4
|
import { a as TransactionSigner } from './transaction-signer-T-KVQFi8.js';
|
|
5
5
|
export { d as ConfigurationError, p as ConfigurationErrorCode, b as ConnectionError, n as ConnectionErrorCode, C as ConnectorError, E as Errors, N as NetworkError, q as NetworkErrorCode, u as SignedTransaction, S as SolanaTransaction, w as TransactionActivity, x as TransactionActivityStatus, e as TransactionError, r as TransactionErrorCode, z as TransactionMetadata, y as TransactionMethod, v as TransactionSignerCapabilities, s as TransactionSignerConfig, T as TransactionSignerError, V as ValidationError, o as ValidationErrorCode, c as createTransactionSigner, m as getUserFriendlyMessage, j as isConfigurationError, g as isConnectionError, f as isConnectorError, k as isNetworkError, l as isTransactionError, i as isTransactionSignerError, h as isValidationError, t as toConnectorError } from './transaction-signer-T-KVQFi8.js';
|
|
@@ -22,6 +22,122 @@ import 'react';
|
|
|
22
22
|
import '@solana-mobile/wallet-standard-mobile';
|
|
23
23
|
import '@solana/transaction-messages';
|
|
24
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @solana/connector - Configuration Schemas
|
|
27
|
+
*
|
|
28
|
+
* Zod schemas for runtime validation of configuration options.
|
|
29
|
+
* These schemas provide type-safe validation with helpful error messages.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
declare const defaultConfigOptionsSchema: z.ZodObject<{
|
|
33
|
+
appName: z.ZodString;
|
|
34
|
+
appUrl: z.ZodOptional<z.ZodString>;
|
|
35
|
+
imageProxy: z.ZodOptional<z.ZodString>;
|
|
36
|
+
clusterStorageKey: z.ZodOptional<z.ZodString>;
|
|
37
|
+
autoConnect: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
debug: z.ZodOptional<z.ZodBoolean>;
|
|
39
|
+
enableMobile: z.ZodOptional<z.ZodBoolean>;
|
|
40
|
+
persistClusterSelection: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
enableErrorBoundary: z.ZodOptional<z.ZodBoolean>;
|
|
42
|
+
network: z.ZodOptional<z.ZodEnum<{
|
|
43
|
+
devnet: "devnet";
|
|
44
|
+
localnet: "localnet";
|
|
45
|
+
mainnet: "mainnet";
|
|
46
|
+
testnet: "testnet";
|
|
47
|
+
"mainnet-beta": "mainnet-beta";
|
|
48
|
+
}>>;
|
|
49
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
storage: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
account: z.ZodObject<{
|
|
52
|
+
get: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
53
|
+
set: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
54
|
+
}, z.core.$loose>;
|
|
55
|
+
cluster: z.ZodObject<{
|
|
56
|
+
get: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
57
|
+
set: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
58
|
+
}, z.core.$loose>;
|
|
59
|
+
wallet: z.ZodObject<{
|
|
60
|
+
get: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
61
|
+
set: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
62
|
+
}, z.core.$loose>;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
clusters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
label: z.ZodString;
|
|
67
|
+
url: z.ZodString;
|
|
68
|
+
urlWs: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>>>;
|
|
70
|
+
customClusters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
label: z.ZodString;
|
|
73
|
+
url: z.ZodString;
|
|
74
|
+
urlWs: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$strip>>>;
|
|
76
|
+
programLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
77
|
+
coingecko: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
79
|
+
isPro: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
+
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
baseDelay: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
maxTimeout: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
walletConnect: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
|
|
85
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
projectId: z.ZodString;
|
|
87
|
+
metadata: z.ZodObject<{
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
description: z.ZodString;
|
|
90
|
+
url: z.ZodString;
|
|
91
|
+
icons: z.ZodArray<z.ZodString>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
defaultChain: z.ZodOptional<z.ZodEnum<{
|
|
94
|
+
"solana:mainnet": "solana:mainnet";
|
|
95
|
+
"solana:devnet": "solana:devnet";
|
|
96
|
+
"solana:testnet": "solana:testnet";
|
|
97
|
+
}>>;
|
|
98
|
+
onDisplayUri: z.ZodOptional<z.ZodCustom<(uri: string) => void, (uri: string) => void>>;
|
|
99
|
+
onSessionEstablished: z.ZodOptional<z.ZodCustom<() => void, () => void>>;
|
|
100
|
+
onSessionDisconnected: z.ZodOptional<z.ZodCustom<() => void, () => void>>;
|
|
101
|
+
relayUrl: z.ZodOptional<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>]>>;
|
|
103
|
+
onError: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
type DefaultConfigOptionsInput = z.input<typeof defaultConfigOptionsSchema>;
|
|
106
|
+
/**
|
|
107
|
+
* Validate configuration options and return a result with helpful errors
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* const result = validateConfigOptions({
|
|
112
|
+
* appName: 'My App',
|
|
113
|
+
* network: 'mainnet',
|
|
114
|
+
* });
|
|
115
|
+
*
|
|
116
|
+
* if (!result.success) {
|
|
117
|
+
* console.error('Config validation failed:', result.error.format());
|
|
118
|
+
* }
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
declare function validateConfigOptions(options: unknown): z.ZodSafeParseResult<DefaultConfigOptionsInput>;
|
|
122
|
+
/**
|
|
123
|
+
* Parse and validate config options, throwing on error with formatted message
|
|
124
|
+
*
|
|
125
|
+
* @throws {z.ZodError} If validation fails
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* try {
|
|
130
|
+
* const validOptions = parseConfigOptions(userInput);
|
|
131
|
+
* // validOptions is typed and validated
|
|
132
|
+
* } catch (error) {
|
|
133
|
+
* if (error instanceof z.ZodError) {
|
|
134
|
+
* console.error(error.format());
|
|
135
|
+
* }
|
|
136
|
+
* }
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
declare function parseConfigOptions(options: unknown): DefaultConfigOptionsInput;
|
|
140
|
+
|
|
25
141
|
/**
|
|
26
142
|
* @solana/connector - Formatting utilities
|
|
27
143
|
*
|
|
@@ -548,103 +664,6 @@ declare function freezeSigner<T extends object>(signer: T): Readonly<T>;
|
|
|
548
664
|
declare function base58ToSignatureBytes(signature: string): SignatureBytes;
|
|
549
665
|
declare function signatureBytesToBase58(bytes: SignatureBytes): string;
|
|
550
666
|
|
|
551
|
-
/**
|
|
552
|
-
* @solana/connector - Configuration Schemas
|
|
553
|
-
*
|
|
554
|
-
* Zod schemas for runtime validation of configuration options.
|
|
555
|
-
* These schemas provide type-safe validation with helpful error messages.
|
|
556
|
-
*/
|
|
557
|
-
|
|
558
|
-
declare const defaultConfigOptionsSchema: z.ZodObject<{
|
|
559
|
-
appName: z.ZodString;
|
|
560
|
-
appUrl: z.ZodOptional<z.ZodString>;
|
|
561
|
-
imageProxy: z.ZodOptional<z.ZodString>;
|
|
562
|
-
clusterStorageKey: z.ZodOptional<z.ZodString>;
|
|
563
|
-
autoConnect: z.ZodOptional<z.ZodBoolean>;
|
|
564
|
-
debug: z.ZodOptional<z.ZodBoolean>;
|
|
565
|
-
enableMobile: z.ZodOptional<z.ZodBoolean>;
|
|
566
|
-
persistClusterSelection: z.ZodOptional<z.ZodBoolean>;
|
|
567
|
-
enableErrorBoundary: z.ZodOptional<z.ZodBoolean>;
|
|
568
|
-
network: z.ZodOptional<z.ZodEnum<{
|
|
569
|
-
devnet: "devnet";
|
|
570
|
-
localnet: "localnet";
|
|
571
|
-
mainnet: "mainnet";
|
|
572
|
-
testnet: "testnet";
|
|
573
|
-
"mainnet-beta": "mainnet-beta";
|
|
574
|
-
}>>;
|
|
575
|
-
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
576
|
-
storage: z.ZodOptional<z.ZodObject<{
|
|
577
|
-
account: z.ZodObject<{
|
|
578
|
-
get: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
579
|
-
set: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
580
|
-
}, z.core.$loose>;
|
|
581
|
-
cluster: z.ZodObject<{
|
|
582
|
-
get: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
583
|
-
set: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
584
|
-
}, z.core.$loose>;
|
|
585
|
-
wallet: z.ZodObject<{
|
|
586
|
-
get: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
587
|
-
set: z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>;
|
|
588
|
-
}, z.core.$loose>;
|
|
589
|
-
}, z.core.$strip>>;
|
|
590
|
-
clusters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
591
|
-
id: z.ZodString;
|
|
592
|
-
label: z.ZodString;
|
|
593
|
-
url: z.ZodString;
|
|
594
|
-
urlWs: z.ZodOptional<z.ZodString>;
|
|
595
|
-
}, z.core.$strip>>>;
|
|
596
|
-
customClusters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
597
|
-
id: z.ZodString;
|
|
598
|
-
label: z.ZodString;
|
|
599
|
-
url: z.ZodString;
|
|
600
|
-
urlWs: z.ZodOptional<z.ZodString>;
|
|
601
|
-
}, z.core.$strip>>>;
|
|
602
|
-
programLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
603
|
-
coingecko: z.ZodOptional<z.ZodObject<{
|
|
604
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
605
|
-
isPro: z.ZodOptional<z.ZodBoolean>;
|
|
606
|
-
maxRetries: z.ZodOptional<z.ZodNumber>;
|
|
607
|
-
baseDelay: z.ZodOptional<z.ZodNumber>;
|
|
608
|
-
maxTimeout: z.ZodOptional<z.ZodNumber>;
|
|
609
|
-
}, z.core.$strict>>;
|
|
610
|
-
onError: z.ZodOptional<z.ZodCustom<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown>>;
|
|
611
|
-
}, z.core.$strip>;
|
|
612
|
-
type DefaultConfigOptionsInput = z.input<typeof defaultConfigOptionsSchema>;
|
|
613
|
-
/**
|
|
614
|
-
* Validate configuration options and return a result with helpful errors
|
|
615
|
-
*
|
|
616
|
-
* @example
|
|
617
|
-
* ```ts
|
|
618
|
-
* const result = validateConfigOptions({
|
|
619
|
-
* appName: 'My App',
|
|
620
|
-
* network: 'mainnet',
|
|
621
|
-
* });
|
|
622
|
-
*
|
|
623
|
-
* if (!result.success) {
|
|
624
|
-
* console.error('Config validation failed:', result.error.format());
|
|
625
|
-
* }
|
|
626
|
-
* ```
|
|
627
|
-
*/
|
|
628
|
-
declare function validateConfigOptions(options: unknown): z.ZodSafeParseResult<DefaultConfigOptionsInput>;
|
|
629
|
-
/**
|
|
630
|
-
* Parse and validate config options, throwing on error with formatted message
|
|
631
|
-
*
|
|
632
|
-
* @throws {z.ZodError} If validation fails
|
|
633
|
-
*
|
|
634
|
-
* @example
|
|
635
|
-
* ```ts
|
|
636
|
-
* try {
|
|
637
|
-
* const validOptions = parseConfigOptions(userInput);
|
|
638
|
-
* // validOptions is typed and validated
|
|
639
|
-
* } catch (error) {
|
|
640
|
-
* if (error instanceof z.ZodError) {
|
|
641
|
-
* console.error(error.format());
|
|
642
|
-
* }
|
|
643
|
-
* }
|
|
644
|
-
* ```
|
|
645
|
-
*/
|
|
646
|
-
declare function parseConfigOptions(options: unknown): DefaultConfigOptionsInput;
|
|
647
|
-
|
|
648
667
|
/**
|
|
649
668
|
* Enhanced Storage
|
|
650
669
|
*/
|
|
@@ -689,6 +708,104 @@ declare class EnhancedStorageAdapter<T> implements StorageAdapter<T> {
|
|
|
689
708
|
onError(handler: (error: Error) => void): this;
|
|
690
709
|
}
|
|
691
710
|
|
|
711
|
+
/**
|
|
712
|
+
* WalletConnect Wallet Standard Shim
|
|
713
|
+
*
|
|
714
|
+
* Creates a Wallet Standard-compatible wallet that proxies all operations
|
|
715
|
+
* to WalletConnect Solana JSON-RPC methods.
|
|
716
|
+
*
|
|
717
|
+
* @see https://docs.walletconnect.network/wallet-sdk/chain-support/solana
|
|
718
|
+
*/
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* Create a Wallet Standard-compatible wallet that uses WalletConnect
|
|
722
|
+
*/
|
|
723
|
+
declare function createWalletConnectWallet(config: WalletConnectConfig, transport: WalletConnectTransport): Wallet;
|
|
724
|
+
|
|
725
|
+
/**
|
|
726
|
+
* WalletConnect Universal Provider Adapter
|
|
727
|
+
*
|
|
728
|
+
* Provides a thin adapter around @walletconnect/universal-provider that:
|
|
729
|
+
* - Lazily imports the provider (optional dependency)
|
|
730
|
+
* - Handles display_uri events and forwards to onDisplayUri callback
|
|
731
|
+
* - Implements the WalletConnectTransport interface
|
|
732
|
+
*
|
|
733
|
+
* @see https://docs.walletconnect.network/wallet-sdk/chain-support/solana
|
|
734
|
+
*/
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* Create a WalletConnect transport adapter
|
|
738
|
+
*
|
|
739
|
+
* This adapter lazily loads @walletconnect/universal-provider and implements
|
|
740
|
+
* the WalletConnectTransport interface for use with the WalletConnect wallet shim.
|
|
741
|
+
*/
|
|
742
|
+
declare function createWalletConnectTransport(config: WalletConnectConfig): Promise<WalletConnectTransport>;
|
|
743
|
+
/**
|
|
744
|
+
* Create a mock transport for testing purposes
|
|
745
|
+
*
|
|
746
|
+
* This allows testing the WalletConnect wallet shim without actual WalletConnect
|
|
747
|
+
* network dependencies.
|
|
748
|
+
*/
|
|
749
|
+
declare function createMockWalletConnectTransport(mockImplementation?: Partial<WalletConnectTransport>): WalletConnectTransport;
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* WalletConnect Registration Helper
|
|
753
|
+
*
|
|
754
|
+
* Registers the WalletConnect wallet shim into the Wallet Standard registry,
|
|
755
|
+
* making it available to ConnectorKit's wallet detection system.
|
|
756
|
+
*/
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* Result of registering the WalletConnect wallet
|
|
760
|
+
*/
|
|
761
|
+
interface WalletConnectRegistration {
|
|
762
|
+
/** The registered wallet instance */
|
|
763
|
+
wallet: Wallet;
|
|
764
|
+
/** Function to unregister the wallet from the registry */
|
|
765
|
+
unregister: () => void;
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Register a WalletConnect wallet into the Wallet Standard registry
|
|
769
|
+
*
|
|
770
|
+
* This function:
|
|
771
|
+
* 1. Creates a WalletConnect transport adapter
|
|
772
|
+
* 2. Creates a Wallet Standard-compatible wallet shim
|
|
773
|
+
* 3. Registers the wallet with the Wallet Standard registry
|
|
774
|
+
*
|
|
775
|
+
* The wallet will appear in ConnectorKit's wallet list as "WalletConnect"
|
|
776
|
+
* and can be selected like any other wallet.
|
|
777
|
+
*
|
|
778
|
+
* @param config - WalletConnect configuration
|
|
779
|
+
* @returns Registration result with wallet and unregister function
|
|
780
|
+
*
|
|
781
|
+
* @example
|
|
782
|
+
* ```typescript
|
|
783
|
+
* const { wallet, unregister } = await registerWalletConnectWallet({
|
|
784
|
+
* projectId: 'your-project-id',
|
|
785
|
+
* metadata: {
|
|
786
|
+
* name: 'My App',
|
|
787
|
+
* description: 'My Solana App',
|
|
788
|
+
* url: 'https://myapp.com',
|
|
789
|
+
* icons: ['https://myapp.com/icon.png'],
|
|
790
|
+
* },
|
|
791
|
+
* onDisplayUri: (uri) => {
|
|
792
|
+
* // Show QR code with this URI
|
|
793
|
+
* },
|
|
794
|
+
* });
|
|
795
|
+
*
|
|
796
|
+
* // Later, to remove from registry:
|
|
797
|
+
* unregister();
|
|
798
|
+
* ```
|
|
799
|
+
*/
|
|
800
|
+
declare function registerWalletConnectWallet(config: WalletConnectConfig): Promise<WalletConnectRegistration>;
|
|
801
|
+
/**
|
|
802
|
+
* Check if WalletConnect dependencies are available
|
|
803
|
+
*
|
|
804
|
+
* This function checks if @walletconnect/universal-provider can be imported.
|
|
805
|
+
* Useful for conditionally showing WalletConnect options in UI.
|
|
806
|
+
*/
|
|
807
|
+
declare function isWalletConnectAvailable(): Promise<boolean>;
|
|
808
|
+
|
|
692
809
|
/**
|
|
693
810
|
* @solana/connector - Kit Transaction Signer Adapter
|
|
694
811
|
*
|
|
@@ -1028,4 +1145,4 @@ declare function formatSignature(signature: string, chars?: number): string;
|
|
|
1028
1145
|
*/
|
|
1029
1146
|
declare function copySignature(signature: string): Promise<boolean>;
|
|
1030
1147
|
|
|
1031
|
-
export { ClusterType, type Commitment, type DualConnection, EnhancedStorage, EnhancedStorageAccountOptions, EnhancedStorageAdapter, EnhancedStorageClusterOptions, EnhancedStorageWalletOptions, type ExplorerOptions, type ExplorerType, type Failure, type GetExplorerLinkArgs, type KitSignersFromWallet, LAMPORTS_PER_SOL, PUBLIC_RPC_ENDPOINTS, type PrepareTransactionConfig, type Result, SOLANA_CHAIN_IDS, type SolanaNetwork, StorageAdapter, StorageOptions, type Success, TransactionSigner, base58ToSignatureBytes, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, createKitSignersFromWallet, createKitTransactionSigner, createMessageSignerFromWallet, createTransactionSendingSignerFromWallet, detectMessageModification, formatAddress, formatBigIntBalance, formatBigIntUsd, formatLamportsToSolSafe, formatNumber, formatSOL, formatSignature, formatTokenAmount, formatTokenBalanceSafe, freezeSigner, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getDefaultRpcUrl, getExplorerLink, getLatestBlockhash, getNetworkDisplayName, getPolyfillStatus, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, installPolyfills, isCryptoAvailable, isDevnet, isFailure, isKitConnection, isKnownSolanaChain, isLegacyConnection, isLocalnet, isMainnet, isPolyfillInstalled, isSolanaChain, isSuccess, isTestnet, lamportsToSol, normalizeNetwork, parseConfigOptions, prepareTransaction, sendRawTransaction, signatureBytesToBase58, solToLamports, toClusterId, truncate, tryCatch, tryCatchSync, updateSignatureDictionary, validateConfigOptions, validateKnownSolanaChain };
|
|
1148
|
+
export { ClusterType, type Commitment, type DualConnection, EnhancedStorage, EnhancedStorageAccountOptions, EnhancedStorageAdapter, EnhancedStorageClusterOptions, EnhancedStorageWalletOptions, type ExplorerOptions, type ExplorerType, type Failure, type GetExplorerLinkArgs, type KitSignersFromWallet, LAMPORTS_PER_SOL, PUBLIC_RPC_ENDPOINTS, type PrepareTransactionConfig, type Result, SOLANA_CHAIN_IDS, type SolanaNetwork, StorageAdapter, StorageOptions, type Success, TransactionSigner, WalletConnectConfig, type WalletConnectRegistration, WalletConnectTransport, base58ToSignatureBytes, chainIdToClusterId, chainIdToClusterType, clusterToChainId, copySignature, createEnhancedStorageAccount, createEnhancedStorageCluster, createEnhancedStorageWallet, createGillTransactionSigner, createKitSignersFromWallet, createKitTransactionSigner, createMessageSignerFromWallet, createMockWalletConnectTransport, createTransactionSendingSignerFromWallet, createWalletConnectTransport, createWalletConnectWallet, detectMessageModification, formatAddress, formatBigIntBalance, formatBigIntUsd, formatLamportsToSolSafe, formatNumber, formatSOL, formatSignature, formatTokenAmount, formatTokenBalanceSafe, freezeSigner, getAllExplorerUrls, getChainIdFromCluster, getChainIdFromClusterId, getChainIdFromClusterType, getChainIdFromConnection, getClusterIdFromChainId, getClusterTypeFromChainId, getClusterTypeFromConnection, getDefaultRpcUrl, getExplorerLink, getLatestBlockhash, getNetworkDisplayName, getPolyfillStatus, getSolanaExplorerUrl, getSolanaFmUrl, getSolscanUrl, getXrayUrl, installPolyfills, isCryptoAvailable, isDevnet, isFailure, isKitConnection, isKnownSolanaChain, isLegacyConnection, isLocalnet, isMainnet, isPolyfillInstalled, isSolanaChain, isSuccess, isTestnet, isWalletConnectAvailable, lamportsToSol, normalizeNetwork, parseConfigOptions, prepareTransaction, registerWalletConnectWallet, sendRawTransaction, signatureBytesToBase58, solToLamports, toClusterId, truncate, tryCatch, tryCatchSync, updateSignatureDictionary, validateConfigOptions, validateKnownSolanaChain };
|