@solana/react-hooks 0.2.5 → 0.5.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.
@@ -1,18 +1,9 @@
1
- import { createClient, toAddress, toAddressString, stableStringify, createSolTransferController, createSplTransferController, getWalletStandardConnectors, watchWalletStandardConnectors, createTransactionPoolController, createInitialAsyncState, createAsyncState, normalizeSignature, SIGNATURE_STATUS_TIMEOUT_MS, deriveConfirmationStatus, confirmationMeetsCommitment } from '@solana/client';
1
+ import { createClient, toAddress, toAddressString, stableStringify, createSolTransferController, createSplTransferController, createTransactionPoolController, createInitialAsyncState, createAsyncState, normalizeSignature, SIGNATURE_STATUS_TIMEOUT_MS, deriveConfirmationStatus, confirmationMeetsCommitment, deserializeSolanaState, subscribeSolanaState, serializeSolanaState } from '@solana/client';
2
2
  import { createContext, useMemo, useEffect, useContext, useCallback, useRef, useSyncExternalStore, useState } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import useSWR, { SWRConfig } from 'swr';
5
5
  import { useStore } from 'zustand';
6
6
  import { getBase64EncodedWireTransaction } from '@solana/kit';
7
- import { address } from '@solana/addresses';
8
- import { SolanaError, SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED } from '@solana/errors';
9
- import { getAbortablePromise } from '@solana/promises';
10
- import { getCompiledTransactionMessageDecoder } from '@solana/transaction-messages';
11
- import { getTransactionCodec, assertIsTransactionWithinSizeLimit, getTransactionLifetimeConstraintFromCompiledTransactionMessage, getTransactionEncoder } from '@solana/transactions';
12
- import { SolanaSignAndSendTransaction, SolanaSignIn, SolanaSignMessage, SolanaSignTransaction } from '@solana/wallet-standard-features';
13
- import { WalletStandardError, WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_CHAIN_UNSUPPORTED } from '@wallet-standard/errors';
14
- import { getWalletAccountFeature, getWalletFeature } from '@wallet-standard/ui';
15
- import { getWalletAccountForUiWalletAccount_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, getWalletForHandle_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, getOrCreateUiWalletAccountForStandardWalletAccount_DO_NOT_USE_OR_YOU_WILL_BE_FIRED } from '@wallet-standard/ui-registry';
16
7
 
17
8
  var __defProp = Object.defineProperty;
18
9
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
@@ -65,11 +56,11 @@ var QUERY_NAMESPACE = "@solana/react-hooks";
65
56
  function useSolanaRpcQuery(scope, args, fetcher, options = {}) {
66
57
  const client = useSolanaClient();
67
58
  const cluster = useClientStore((state) => state.cluster);
68
- const { disabled = false, ...restOptions } = options;
59
+ const { disabled = false, swr } = options;
69
60
  const providerSuspensePreference = useQuerySuspensePreference();
70
61
  const suspenseEnabled = !disabled && Boolean(providerSuspensePreference);
71
62
  const swrOptions = {
72
- ...restOptions,
63
+ ...swr ?? {},
73
64
  suspense: suspenseEnabled
74
65
  };
75
66
  const key = useMemo(() => {
@@ -78,59 +69,105 @@ function useSolanaRpcQuery(scope, args, fetcher, options = {}) {
78
69
  }
79
70
  return [QUERY_NAMESPACE, scope, cluster.endpoint, cluster.commitment, ...args];
80
71
  }, [cluster.commitment, cluster.endpoint, args, scope, disabled]);
81
- const swr = useSWR(key, () => fetcher(client), swrOptions);
72
+ const swrResponse = useSWR(key, () => fetcher(client), swrOptions);
82
73
  const [dataUpdatedAt, setDataUpdatedAt] = useState(
83
- () => swr.data !== void 0 ? Date.now() : void 0
74
+ () => swrResponse.data !== void 0 ? Date.now() : void 0
84
75
  );
85
76
  useEffect(() => {
86
- if (swr.data !== void 0) {
77
+ if (swrResponse.data !== void 0) {
87
78
  setDataUpdatedAt(Date.now());
88
79
  }
89
- }, [swr.data]);
90
- const status = swr.error ? "error" : swr.isLoading ? "loading" : swr.data !== void 0 ? "success" : "idle";
91
- const refresh = useCallback(() => swr.mutate(void 0, { revalidate: true }), [swr.mutate]);
80
+ }, [swrResponse.data]);
81
+ const status = swrResponse.error ? "error" : swrResponse.isLoading ? "loading" : swrResponse.data !== void 0 ? "success" : "idle";
82
+ const refresh = useCallback(() => swrResponse.mutate(void 0, { revalidate: true }), [swrResponse.mutate]);
92
83
  return {
93
- data: swr.data,
84
+ data: swrResponse.data,
94
85
  dataUpdatedAt,
95
- error: swr.error ?? null,
86
+ error: swrResponse.error ?? null,
96
87
  isError: status === "error",
97
- isLoading: swr.isLoading,
88
+ isLoading: swrResponse.isLoading,
98
89
  isSuccess: status === "success",
99
- isValidating: swr.isValidating,
100
- mutate: swr.mutate,
90
+ isValidating: swrResponse.isValidating,
91
+ mutate: swrResponse.mutate,
101
92
  refresh,
102
93
  status
103
94
  };
104
95
  }
105
96
  __name(useSolanaRpcQuery, "useSolanaRpcQuery");
97
+ function getLatestBlockhashKey(params = {}) {
98
+ const { commitment = null, minContextSlot = null } = params;
99
+ return ["latestBlockhash", commitment, normalizeBigint(minContextSlot)];
100
+ }
101
+ __name(getLatestBlockhashKey, "getLatestBlockhashKey");
102
+ function getProgramAccountsKey(params = {}) {
103
+ const { programAddress, config } = params;
104
+ const address = programAddress ? toAddress(programAddress) : void 0;
105
+ const addressKey = address ? toAddressString(address) : null;
106
+ const configKey = stableStringify(config ?? null);
107
+ return ["programAccounts", addressKey, configKey];
108
+ }
109
+ __name(getProgramAccountsKey, "getProgramAccountsKey");
110
+ function getSimulateTransactionKey(params = {}) {
111
+ const { transaction, config } = params;
112
+ const wire = transaction ? normalizeWire(transaction) : null;
113
+ const configKey = stableStringify(config ?? null);
114
+ return ["simulateTransaction", wire, configKey];
115
+ }
116
+ __name(getSimulateTransactionKey, "getSimulateTransactionKey");
117
+ function getSignatureStatusKey(params = {}) {
118
+ const { config, signature } = params;
119
+ const signatureKey = signature?.toString() ?? null;
120
+ const configKey = JSON.stringify(config ?? null);
121
+ return ["signatureStatus", signatureKey, configKey];
122
+ }
123
+ __name(getSignatureStatusKey, "getSignatureStatusKey");
124
+ function normalizeBigint(value) {
125
+ if (value === void 0 || value === null) return null;
126
+ return typeof value === "bigint" ? value : BigInt(Math.floor(value));
127
+ }
128
+ __name(normalizeBigint, "normalizeBigint");
129
+ function normalizeWire(input) {
130
+ if (!input) return null;
131
+ if (typeof input === "string") {
132
+ return input;
133
+ }
134
+ return getBase64EncodedWireTransaction(input);
135
+ }
136
+ __name(normalizeWire, "normalizeWire");
137
+
138
+ // src/queryHooks.ts
106
139
  var DEFAULT_BLOCKHASH_REFRESH_INTERVAL = 3e4;
107
- function useLatestBlockhash(options) {
108
- const { commitment, minContextSlot, refreshInterval = DEFAULT_BLOCKHASH_REFRESH_INTERVAL, ...rest } = options ?? {};
109
- const normalizedMinContextSlot = useMemo(() => {
110
- if (minContextSlot === void 0) {
111
- return void 0;
112
- }
113
- return typeof minContextSlot === "bigint" ? minContextSlot : BigInt(Math.floor(minContextSlot));
114
- }, [minContextSlot]);
115
- const keyArgs = useMemo(
116
- () => [commitment ?? null, normalizedMinContextSlot ?? null],
117
- [commitment, normalizedMinContextSlot]
118
- );
140
+ function useLatestBlockhash(options = {}) {
141
+ const {
142
+ commitment,
143
+ minContextSlot,
144
+ refreshInterval = DEFAULT_BLOCKHASH_REFRESH_INTERVAL,
145
+ disabled = false,
146
+ swr
147
+ } = options;
119
148
  const fetcher = useCallback(
120
149
  async (client) => {
121
150
  const fallbackCommitment = commitment ?? client.store.getState().cluster.commitment;
122
151
  const plan = client.runtime.rpc.getLatestBlockhash({
123
152
  commitment: fallbackCommitment,
124
- minContextSlot: normalizedMinContextSlot
153
+ minContextSlot: normalizeMinContextSlot(minContextSlot)
125
154
  });
126
155
  return plan.send({ abortSignal: AbortSignal.timeout(15e3) });
127
156
  },
128
- [commitment, normalizedMinContextSlot]
157
+ [commitment, minContextSlot]
158
+ );
159
+ const query = useSolanaRpcQuery(
160
+ "latestBlockhash",
161
+ getLatestBlockhashKey(options),
162
+ fetcher,
163
+ {
164
+ disabled,
165
+ swr: {
166
+ refreshInterval,
167
+ ...swr
168
+ }
169
+ }
129
170
  );
130
- const query = useSolanaRpcQuery("latestBlockhash", keyArgs, fetcher, {
131
- refreshInterval,
132
- ...rest
133
- });
134
171
  return {
135
172
  ...query,
136
173
  blockhash: query.data?.value.blockhash ?? null,
@@ -140,14 +177,11 @@ function useLatestBlockhash(options) {
140
177
  }
141
178
  __name(useLatestBlockhash, "useLatestBlockhash");
142
179
  function useProgramAccounts(programAddress, options) {
143
- const { commitment, config, ...queryOptions } = options ?? {};
144
- const { disabled: disabledOption, ...restQueryOptions } = queryOptions;
145
- const address2 = useMemo(() => programAddress ? toAddress(programAddress) : void 0, [programAddress]);
146
- const addressKey = useMemo(() => address2 ? toAddressString(address2) : null, [address2]);
147
- const configKey = useMemo(() => stableStringify(config ?? null), [config]);
180
+ const { commitment, config, swr, disabled: disabledOption } = options ?? {};
148
181
  const fetcher = useCallback(
149
182
  async (client) => {
150
- if (!address2) {
183
+ const address = programAddress ? toAddress(programAddress) : void 0;
184
+ if (!address) {
151
185
  throw new Error("Provide a program address before querying program accounts.");
152
186
  }
153
187
  const fallbackCommitment = commitment ?? config?.commitment ?? client.store.getState().cluster.commitment;
@@ -155,16 +189,21 @@ function useProgramAccounts(programAddress, options) {
155
189
  ...config ?? {},
156
190
  commitment: fallbackCommitment
157
191
  };
158
- const plan = client.runtime.rpc.getProgramAccounts(address2, mergedConfig);
192
+ const plan = client.runtime.rpc.getProgramAccounts(address, mergedConfig);
159
193
  return plan.send({ abortSignal: AbortSignal.timeout(2e4) });
160
194
  },
161
- [address2, commitment, config]
195
+ [commitment, config, programAddress]
196
+ );
197
+ const disabled = disabledOption ?? !programAddress;
198
+ const query = useSolanaRpcQuery(
199
+ "programAccounts",
200
+ getProgramAccountsKey({ programAddress, config }),
201
+ fetcher,
202
+ {
203
+ disabled,
204
+ swr
205
+ }
162
206
  );
163
- const disabled = disabledOption ?? !address2;
164
- const query = useSolanaRpcQuery("programAccounts", [addressKey, configKey], fetcher, {
165
- ...restQueryOptions,
166
- disabled
167
- });
168
207
  return {
169
208
  ...query,
170
209
  accounts: query.data ?? []
@@ -172,8 +211,7 @@ function useProgramAccounts(programAddress, options) {
172
211
  }
173
212
  __name(useProgramAccounts, "useProgramAccounts");
174
213
  function useSimulateTransaction(transaction, options) {
175
- const { commitment, config, refreshInterval, ...rest } = options ?? {};
176
- const { disabled: disabledOption, revalidateIfStale, revalidateOnFocus, ...queryOptions } = rest;
214
+ const { commitment, config, refreshInterval, disabled: disabledOption, swr } = options ?? {};
177
215
  const wire = useMemo(() => {
178
216
  if (!transaction) {
179
217
  return null;
@@ -183,7 +221,6 @@ function useSimulateTransaction(transaction, options) {
183
221
  }
184
222
  return getBase64EncodedWireTransaction(transaction);
185
223
  }, [transaction]);
186
- const configKey = useMemo(() => stableStringify(config ?? null), [config]);
187
224
  const fetcher = useCallback(
188
225
  async (client) => {
189
226
  if (!wire) {
@@ -199,19 +236,31 @@ function useSimulateTransaction(transaction, options) {
199
236
  [commitment, config, wire]
200
237
  );
201
238
  const disabled = disabledOption ?? !wire;
202
- const query = useSolanaRpcQuery("simulateTransaction", [wire, configKey], fetcher, {
203
- ...queryOptions,
204
- refreshInterval,
205
- disabled,
206
- revalidateIfStale: revalidateIfStale ?? false,
207
- revalidateOnFocus: revalidateOnFocus ?? false
208
- });
239
+ const query = useSolanaRpcQuery(
240
+ "simulateTransaction",
241
+ getSimulateTransactionKey({ transaction, config }),
242
+ fetcher,
243
+ {
244
+ disabled,
245
+ swr: {
246
+ refreshInterval,
247
+ revalidateIfStale: false,
248
+ revalidateOnFocus: false,
249
+ ...swr
250
+ }
251
+ }
252
+ );
209
253
  return {
210
254
  ...query,
211
255
  logs: query.data?.value.logs ?? []
212
256
  };
213
257
  }
214
258
  __name(useSimulateTransaction, "useSimulateTransaction");
259
+ function normalizeMinContextSlot(minContextSlot) {
260
+ if (minContextSlot === void 0) return void 0;
261
+ return typeof minContextSlot === "bigint" ? minContextSlot : BigInt(Math.floor(minContextSlot));
262
+ }
263
+ __name(normalizeMinContextSlot, "normalizeMinContextSlot");
215
264
 
216
265
  // src/hooks.ts
217
266
  function createClusterSelector() {
@@ -361,10 +410,19 @@ function useSplToken(mint, options = {}) {
361
410
  }
362
411
  return helper.fetchBalance(owner, options.commitment);
363
412
  }, [helper, owner, options.commitment]);
364
- const { data, error, isLoading, isValidating, mutate } = useSWR(balanceKey, fetchBalance, {
365
- revalidateOnFocus: options.revalidateOnFocus ?? false,
366
- suspense
367
- });
413
+ const swrOptions = useMemo(
414
+ () => ({
415
+ revalidateOnFocus: options.revalidateOnFocus ?? false,
416
+ suspense,
417
+ ...options.swr ?? {}
418
+ }),
419
+ [options.revalidateOnFocus, options.swr, suspense]
420
+ );
421
+ const { data, error, isLoading, isValidating, mutate } = useSWR(
422
+ balanceKey,
423
+ fetchBalance,
424
+ swrOptions
425
+ );
368
426
  const sessionRef = useRef(session);
369
427
  useEffect(() => {
370
428
  sessionRef.current = session;
@@ -427,42 +485,42 @@ __name(useSplToken, "useSplToken");
427
485
  function useAccount(addressLike, options = {}) {
428
486
  const client = useSolanaClient();
429
487
  const shouldSkip = options.skip ?? !addressLike;
430
- const address2 = useMemo(() => {
488
+ const address = useMemo(() => {
431
489
  if (shouldSkip || !addressLike) {
432
490
  return void 0;
433
491
  }
434
492
  return toAddress(addressLike);
435
493
  }, [addressLike, shouldSkip]);
436
- const accountKey = useMemo(() => address2?.toString(), [address2]);
494
+ const accountKey = useMemo(() => address?.toString(), [address]);
437
495
  const selector = useMemo(() => createAccountSelector(accountKey), [accountKey]);
438
496
  const account = useClientStore(selector);
439
497
  useSuspenseFetcher({
440
- enabled: options.fetch !== false && !shouldSkip && Boolean(address2),
498
+ enabled: options.fetch !== false && !shouldSkip && Boolean(address),
441
499
  fetcher: /* @__PURE__ */ __name(() => {
442
- if (!address2) {
500
+ if (!address) {
443
501
  throw new Error("Provide an address before fetching account data.");
444
502
  }
445
- return client.actions.fetchAccount(address2, options.commitment);
503
+ return client.actions.fetchAccount(address, options.commitment);
446
504
  }, "fetcher"),
447
505
  key: accountKey ?? null,
448
506
  ready: account !== void 0
449
507
  });
450
508
  useEffect(() => {
451
- if (!address2) {
509
+ if (!address) {
452
510
  return;
453
511
  }
454
512
  const commitment = options.commitment;
455
513
  if (options.fetch !== false && account === void 0) {
456
- void client.actions.fetchAccount(address2, commitment).catch(() => void 0);
514
+ void client.actions.fetchAccount(address, commitment).catch(() => void 0);
457
515
  }
458
516
  if (options.watch) {
459
- const subscription = client.watchers.watchAccount({ address: address2, commitment }, () => void 0);
517
+ const subscription = client.watchers.watchAccount({ address, commitment }, () => void 0);
460
518
  return () => {
461
519
  subscription.abort();
462
520
  };
463
521
  }
464
522
  return void 0;
465
- }, [account, address2, client, options.commitment, options.fetch, options.watch]);
523
+ }, [account, address, client, options.commitment, options.fetch, options.watch]);
466
524
  return account;
467
525
  }
468
526
  __name(useAccount, "useAccount");
@@ -478,42 +536,42 @@ function useBalance(addressLike, options = {}) {
478
536
  );
479
537
  const client = useSolanaClient();
480
538
  const shouldSkip = mergedOptions.skip ?? !addressLike;
481
- const address2 = useMemo(() => {
539
+ const address = useMemo(() => {
482
540
  if (shouldSkip || !addressLike) {
483
541
  return void 0;
484
542
  }
485
543
  return toAddress(addressLike);
486
544
  }, [addressLike, shouldSkip]);
487
- const accountKey = useMemo(() => address2?.toString(), [address2]);
545
+ const accountKey = useMemo(() => address?.toString(), [address]);
488
546
  const selector = useMemo(() => createAccountSelector(accountKey), [accountKey]);
489
547
  const account = useClientStore(selector);
490
548
  useSuspenseFetcher({
491
- enabled: mergedOptions.fetch !== false && !shouldSkip && Boolean(address2),
549
+ enabled: mergedOptions.fetch !== false && !shouldSkip && Boolean(address),
492
550
  fetcher: /* @__PURE__ */ __name(() => {
493
- if (!address2) {
551
+ if (!address) {
494
552
  throw new Error("Provide an address before fetching balance.");
495
553
  }
496
- return client.actions.fetchBalance(address2, mergedOptions.commitment);
554
+ return client.actions.fetchBalance(address, mergedOptions.commitment);
497
555
  }, "fetcher"),
498
556
  key: accountKey ?? null,
499
557
  ready: account !== void 0
500
558
  });
501
559
  useEffect(() => {
502
- if (!address2) {
560
+ if (!address) {
503
561
  return;
504
562
  }
505
563
  const commitment = mergedOptions.commitment;
506
564
  if (mergedOptions.fetch !== false && account === void 0) {
507
- void client.actions.fetchBalance(address2, commitment).catch(() => void 0);
565
+ void client.actions.fetchBalance(address, commitment).catch(() => void 0);
508
566
  }
509
567
  if (mergedOptions.watch) {
510
- const watcher = client.watchers.watchBalance({ address: address2, commitment }, () => void 0);
568
+ const watcher = client.watchers.watchBalance({ address, commitment }, () => void 0);
511
569
  return () => {
512
570
  watcher.abort();
513
571
  };
514
572
  }
515
573
  return void 0;
516
- }, [account, address2, client, mergedOptions.commitment, mergedOptions.fetch, mergedOptions.watch]);
574
+ }, [account, address, client, mergedOptions.commitment, mergedOptions.fetch, mergedOptions.watch]);
517
575
  const lamports = account?.lamports ?? null;
518
576
  const fetching = account?.fetching ?? false;
519
577
  const slot = account?.slot;
@@ -530,22 +588,6 @@ function useBalance(addressLike, options = {}) {
530
588
  );
531
589
  }
532
590
  __name(useBalance, "useBalance");
533
- function useWalletStandardConnectors(options) {
534
- const overrides = options?.overrides;
535
- const memoisedOptions = useMemo(() => overrides ? { overrides } : void 0, [overrides]);
536
- const [connectors, setConnectors] = useState(
537
- () => getWalletStandardConnectors(memoisedOptions ?? {})
538
- );
539
- useEffect(() => {
540
- setConnectors(getWalletStandardConnectors(memoisedOptions ?? {}));
541
- const unwatch = watchWalletStandardConnectors(setConnectors, memoisedOptions ?? {});
542
- return () => {
543
- unwatch();
544
- };
545
- }, [memoisedOptions]);
546
- return connectors;
547
- }
548
- __name(useWalletStandardConnectors, "useWalletStandardConnectors");
549
591
  function useTransactionPool(config = {}) {
550
592
  const initialInstructions = useMemo(
551
593
  () => config.instructions ?? [],
@@ -679,10 +721,9 @@ function useSendTransaction() {
679
721
  }
680
722
  __name(useSendTransaction, "useSendTransaction");
681
723
  function useSignatureStatus(signatureInput, options = {}) {
682
- const { config, ...queryOptions } = options;
724
+ const { config, disabled: disabledOption, swr } = options;
683
725
  const signature = useMemo(() => normalizeSignature(signatureInput), [signatureInput]);
684
726
  const signatureKey = signature?.toString() ?? null;
685
- const configKey = useMemo(() => JSON.stringify(config ?? null), [config]);
686
727
  const fetcher = useCallback(
687
728
  async (client) => {
688
729
  if (!signatureKey) {
@@ -697,14 +738,14 @@ function useSignatureStatus(signatureInput, options = {}) {
697
738
  },
698
739
  [config, signature, signatureKey]
699
740
  );
700
- const disabled = queryOptions.disabled ?? !signatureKey;
741
+ const disabled = disabledOption ?? !signatureKey;
701
742
  const query = useSolanaRpcQuery(
702
743
  "signatureStatus",
703
- [signatureKey, configKey],
744
+ getSignatureStatusKey({ signature: signatureInput, config }),
704
745
  fetcher,
705
746
  {
706
- ...queryOptions,
707
- disabled
747
+ disabled,
748
+ swr
708
749
  }
709
750
  );
710
751
  const confirmationStatus = deriveConfirmationStatus(query.data ?? null);
@@ -723,14 +764,17 @@ function useWaitForSignature(signatureInput, options = {}) {
723
764
  watchCommitment,
724
765
  ...signatureStatusOptions
725
766
  } = options;
726
- const { refreshInterval, ...restStatusOptions } = signatureStatusOptions;
767
+ const { swr, ...restStatusOptions } = signatureStatusOptions;
727
768
  const subscribeCommitment = watchCommitment ?? commitment;
728
769
  const client = useSolanaClient();
729
770
  const normalizedSignature = useMemo(() => normalizeSignature(signatureInput), [signatureInput]);
730
771
  const disabled = disabledOption ?? !normalizedSignature;
731
772
  const statusQuery = useSignatureStatus(signatureInput, {
732
773
  ...restStatusOptions,
733
- refreshInterval: refreshInterval ?? 2e3,
774
+ swr: {
775
+ refreshInterval: 2e3,
776
+ ...swr
777
+ },
734
778
  disabled
735
779
  });
736
780
  const [subscriptionSettled, setSubscriptionSettled] = useState(false);
@@ -786,10 +830,11 @@ function useWaitForSignature(signatureInput, options = {}) {
786
830
  __name(useWaitForSignature, "useWaitForSignature");
787
831
  var createCache = /* @__PURE__ */ __name(() => /* @__PURE__ */ new Map(), "createCache");
788
832
  var DEFAULT_QUERY_CONFIG = Object.freeze({
789
- dedupingInterval: 1e3,
790
- focusThrottleInterval: 1e3,
833
+ dedupingInterval: 2e3,
834
+ focusThrottleInterval: 5e3,
791
835
  provider: /* @__PURE__ */ __name(() => createCache(), "provider"),
792
- revalidateOnFocus: false,
836
+ revalidateIfStale: true,
837
+ revalidateOnFocus: true,
793
838
  revalidateOnReconnect: true
794
839
  });
795
840
  function SolanaQueryProvider({
@@ -836,6 +881,10 @@ function SolanaProvider({ children, client, config, query, walletPersistence })
836
881
  const shouldIncludeQueryLayer = query !== false && query?.disabled !== true;
837
882
  const queryProps = shouldIncludeQueryLayer && query ? query : {};
838
883
  const persistenceConfig = walletPersistence === false ? void 0 : walletPersistence ?? {};
884
+ const storage = persistenceConfig ? persistenceConfig.storage ?? getDefaultStorage() : null;
885
+ const storageKey = persistenceConfig?.storageKey ?? DEFAULT_STORAGE_KEY;
886
+ const persistedState = persistenceConfig ? readPersistedState(storage, storageKey) : { legacyConnectorId: null, state: null };
887
+ const clientConfig = config && persistenceConfig ? { ...config, initialState: config.initialState ?? persistedState.state ?? void 0 } : config;
839
888
  const content = shouldIncludeQueryLayer ? /* @__PURE__ */ jsx(
840
889
  SolanaQueryProvider,
841
890
  {
@@ -845,21 +894,52 @@ function SolanaProvider({ children, client, config, query, walletPersistence })
845
894
  children
846
895
  }
847
896
  ) : children;
848
- return /* @__PURE__ */ jsxs(SolanaClientProvider, { client, config, children: [
849
- persistenceConfig ? /* @__PURE__ */ jsx(WalletPersistence, { ...persistenceConfig }) : null,
897
+ return /* @__PURE__ */ jsxs(SolanaClientProvider, { client, config: clientConfig, children: [
898
+ persistenceConfig ? /* @__PURE__ */ jsx(
899
+ WalletPersistence,
900
+ {
901
+ autoConnect: persistenceConfig.autoConnect,
902
+ initialState: clientConfig?.initialState ?? persistedState.state,
903
+ legacyConnectorId: persistedState.legacyConnectorId,
904
+ storage,
905
+ storageKey
906
+ }
907
+ ) : null,
850
908
  content
851
909
  ] });
852
910
  }
853
911
  __name(SolanaProvider, "SolanaProvider");
854
912
  var DEFAULT_STORAGE_KEY = "solana:last-connector";
855
- function WalletPersistence({ autoConnect = true, storage, storageKey = DEFAULT_STORAGE_KEY }) {
913
+ function readPersistedState(storage, storageKey) {
914
+ if (!storage) {
915
+ return { legacyConnectorId: null, state: null };
916
+ }
917
+ const raw = safelyRead(() => storage.getItem(storageKey));
918
+ if (!raw) {
919
+ return { legacyConnectorId: null, state: null };
920
+ }
921
+ const parsed = deserializeSolanaState(raw);
922
+ if (parsed) {
923
+ return { legacyConnectorId: null, state: parsed };
924
+ }
925
+ return { legacyConnectorId: raw, state: null };
926
+ }
927
+ __name(readPersistedState, "readPersistedState");
928
+ function WalletPersistence({
929
+ autoConnect = true,
930
+ initialState = null,
931
+ legacyConnectorId = null,
932
+ storage,
933
+ storageKey = DEFAULT_STORAGE_KEY
934
+ }) {
856
935
  const wallet = useWallet();
857
936
  const connectWallet = useConnectWallet();
858
937
  const client = useSolanaClient();
859
938
  const storageRef = useRef(storage ?? getDefaultStorage());
860
939
  const [hasAttemptedAutoConnect, setHasAttemptedAutoConnect] = useState(false);
861
- const hasPersistedConnectorRef = useRef(false);
862
940
  const clientRef = useRef(null);
941
+ const persistedStateRef = useRef(initialState);
942
+ const legacyConnectorIdRef = useRef(legacyConnectorId);
863
943
  useEffect(() => {
864
944
  storageRef.current = storage ?? getDefaultStorage();
865
945
  }, [storage]);
@@ -872,19 +952,19 @@ function WalletPersistence({ autoConnect = true, storage, storageKey = DEFAULT_S
872
952
  useEffect(() => {
873
953
  const activeStorage = storageRef.current;
874
954
  if (!activeStorage) return;
875
- if ("connectorId" in wallet && wallet.connectorId) {
876
- const connectorId = wallet.connectorId;
877
- if (connectorId) {
878
- safelyWrite(() => activeStorage.setItem(storageKey, connectorId));
879
- hasPersistedConnectorRef.current = true;
880
- return;
881
- }
882
- }
883
- if (wallet.status === "disconnected" && hasPersistedConnectorRef.current) {
884
- safelyWrite(() => activeStorage.removeItem(storageKey));
885
- hasPersistedConnectorRef.current = false;
886
- }
887
- }, [storageKey, wallet]);
955
+ const unsubscribe = subscribeSolanaState(client, (state) => {
956
+ persistedStateRef.current = state;
957
+ legacyConnectorIdRef.current = null;
958
+ safelyWrite(() => activeStorage.setItem(storageKey, serializeSolanaState(state)));
959
+ });
960
+ return () => {
961
+ unsubscribe();
962
+ };
963
+ }, [client, storageKey]);
964
+ useEffect(() => {
965
+ persistedStateRef.current = initialState ?? persistedStateRef.current;
966
+ legacyConnectorIdRef.current = legacyConnectorId;
967
+ }, [initialState, legacyConnectorId]);
888
968
  useEffect(() => {
889
969
  if (!autoConnect || hasAttemptedAutoConnect) {
890
970
  return;
@@ -893,35 +973,21 @@ function WalletPersistence({ autoConnect = true, storage, storageKey = DEFAULT_S
893
973
  setHasAttemptedAutoConnect(true);
894
974
  return;
895
975
  }
896
- const activeStorage = storageRef.current;
897
- if (!activeStorage) {
898
- setHasAttemptedAutoConnect(true);
899
- return;
900
- }
901
- let cancelled = false;
902
- const connectorId = safelyRead(() => activeStorage.getItem(storageKey));
903
- if (!connectorId) {
904
- setHasAttemptedAutoConnect(true);
905
- return;
906
- }
976
+ const state = persistedStateRef.current ?? initialState;
977
+ const connectorId = state?.lastConnectorId ?? legacyConnectorIdRef.current;
978
+ const shouldAutoConnect = (state?.autoconnect ?? autoConnect) && connectorId;
979
+ if (!shouldAutoConnect || !connectorId) return;
907
980
  const connector = client.connectors.get(connectorId);
908
- if (!connector) {
909
- return;
910
- }
981
+ if (!connector) return;
911
982
  void (async () => {
912
983
  try {
913
984
  await connectWallet(connectorId, { autoConnect: true });
914
985
  } catch {
915
986
  } finally {
916
- if (!cancelled) {
917
- setHasAttemptedAutoConnect(true);
918
- }
987
+ setHasAttemptedAutoConnect(true);
919
988
  }
920
989
  })();
921
- return () => {
922
- cancelled = true;
923
- };
924
- }, [autoConnect, client, connectWallet, hasAttemptedAutoConnect, storageKey, wallet.status]);
990
+ }, [autoConnect, client, connectWallet, hasAttemptedAutoConnect, initialState, wallet.status]);
925
991
  return null;
926
992
  }
927
993
  __name(WalletPersistence, "WalletPersistence");
@@ -955,8 +1021,8 @@ function useWalletConnection(options = {}) {
955
1021
  const wallet = useWallet();
956
1022
  const connectWallet = useConnectWallet();
957
1023
  const disconnectWallet = useDisconnectWallet();
958
- const discovered = useWalletStandardConnectors(options.discoveryOptions);
959
- const connectors = options.connectors ?? discovered;
1024
+ const client = useSolanaClient();
1025
+ const connectors = options.connectors ?? client.connectors.all;
960
1026
  const connect = useCallback(
961
1027
  (connectorId, connectOptions) => connectWallet(connectorId, connectOptions),
962
1028
  [connectWallet]
@@ -964,6 +1030,7 @@ function useWalletConnection(options = {}) {
964
1030
  const disconnect = useCallback(() => disconnectWallet(), [disconnectWallet]);
965
1031
  const state = useMemo(() => {
966
1032
  const connectorId = "connectorId" in wallet ? wallet.connectorId : void 0;
1033
+ const currentConnector = connectorId ? connectors.find((connector) => connector.id === connectorId) : void 0;
967
1034
  const session = wallet.status === "connected" ? wallet.session : void 0;
968
1035
  const error = wallet.status === "error" ? wallet.error ?? null : null;
969
1036
  return {
@@ -972,6 +1039,7 @@ function useWalletConnection(options = {}) {
972
1039
  connecting: wallet.status === "connecting",
973
1040
  connectors,
974
1041
  connectorId,
1042
+ currentConnector,
975
1043
  disconnect,
976
1044
  error,
977
1045
  status: wallet.status,
@@ -981,8 +1049,8 @@ function useWalletConnection(options = {}) {
981
1049
  return state;
982
1050
  }
983
1051
  __name(useWalletConnection, "useWalletConnection");
984
- function WalletConnectionManager({ children, connectors, discoveryOptions }) {
985
- const state = useWalletConnection({ connectors, discoveryOptions });
1052
+ function WalletConnectionManager({ children, connectors }) {
1053
+ const state = useWalletConnection({ connectors });
986
1054
  return /* @__PURE__ */ jsx(Fragment, { children: children(state) });
987
1055
  }
988
1056
  __name(WalletConnectionManager, "WalletConnectionManager");
@@ -1017,334 +1085,7 @@ function useWalletModalState(options = {}) {
1017
1085
  };
1018
1086
  }
1019
1087
  __name(useWalletModalState, "useWalletModalState");
1020
- function useSignAndSendTransaction(uiWalletAccount, chain) {
1021
- const signAndSendTransactions = useSignAndSendTransactions(uiWalletAccount, chain);
1022
- return useCallback(
1023
- async (input) => {
1024
- const [result] = await signAndSendTransactions(input);
1025
- return result;
1026
- },
1027
- [signAndSendTransactions]
1028
- );
1029
- }
1030
- __name(useSignAndSendTransaction, "useSignAndSendTransaction");
1031
- function useSignAndSendTransactions(uiWalletAccount, chain) {
1032
- if (!uiWalletAccount.chains.includes(chain)) {
1033
- throw new WalletStandardError(WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_CHAIN_UNSUPPORTED, {
1034
- address: uiWalletAccount.address,
1035
- chain,
1036
- featureName: SolanaSignAndSendTransaction,
1037
- supportedChains: [...uiWalletAccount.chains],
1038
- supportedFeatures: [...uiWalletAccount.features]
1039
- });
1040
- }
1041
- const signAndSendTransactionFeature = getWalletAccountFeature(
1042
- uiWalletAccount,
1043
- SolanaSignAndSendTransaction
1044
- );
1045
- const account = getWalletAccountForUiWalletAccount_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(uiWalletAccount);
1046
- return useCallback(
1047
- async (...inputs) => {
1048
- const inputsWithChainAndAccount = inputs.map(({ options, ...rest }) => {
1049
- const minContextSlot = options?.minContextSlot;
1050
- return {
1051
- ...rest,
1052
- account,
1053
- chain,
1054
- ...minContextSlot != null ? {
1055
- options: {
1056
- minContextSlot: Number(minContextSlot)
1057
- }
1058
- } : null
1059
- };
1060
- });
1061
- const results = await signAndSendTransactionFeature.signAndSendTransaction(...inputsWithChainAndAccount);
1062
- return results;
1063
- },
1064
- [account, chain, signAndSendTransactionFeature]
1065
- );
1066
- }
1067
- __name(useSignAndSendTransactions, "useSignAndSendTransactions");
1068
- function useSignIn(uiWalletHandle) {
1069
- const signIns = useSignIns(uiWalletHandle);
1070
- return useCallback(
1071
- async (input) => {
1072
- const [result] = await signIns(input);
1073
- return result;
1074
- },
1075
- [signIns]
1076
- );
1077
- }
1078
- __name(useSignIn, "useSignIn");
1079
- function useSignIns(uiWalletHandle) {
1080
- let signMessageFeature;
1081
- if ("address" in uiWalletHandle && typeof uiWalletHandle.address === "string") {
1082
- getWalletAccountForUiWalletAccount_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(uiWalletHandle);
1083
- signMessageFeature = getWalletAccountFeature(
1084
- uiWalletHandle,
1085
- SolanaSignIn
1086
- );
1087
- } else {
1088
- signMessageFeature = getWalletFeature(uiWalletHandle, SolanaSignIn);
1089
- }
1090
- const wallet = getWalletForHandle_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(uiWalletHandle);
1091
- return useCallback(
1092
- async (...inputs) => {
1093
- const inputsWithAddressAndChainId = inputs.map((input) => ({
1094
- ...input,
1095
- // Prioritize the `UiWalletAccount` address if it exists.
1096
- ..."address" in uiWalletHandle ? { address: uiWalletHandle.address } : null
1097
- }));
1098
- const results = await signMessageFeature.signIn(...inputsWithAddressAndChainId);
1099
- const resultsWithoutSignatureType = results.map(
1100
- ({
1101
- account,
1102
- signatureType: _signatureType,
1103
- // Solana signatures are always of type `ed25519` so drop this property.
1104
- ...rest
1105
- }) => ({
1106
- ...rest,
1107
- account: getOrCreateUiWalletAccountForStandardWalletAccount_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(
1108
- wallet,
1109
- account
1110
- )
1111
- })
1112
- );
1113
- return resultsWithoutSignatureType;
1114
- },
1115
- [signMessageFeature, uiWalletHandle, wallet]
1116
- );
1117
- }
1118
- __name(useSignIns, "useSignIns");
1119
- function useSignMessage(...config) {
1120
- const signMessages = useSignMessages(...config);
1121
- return useCallback(
1122
- async (input) => {
1123
- const [result] = await signMessages(input);
1124
- return result;
1125
- },
1126
- [signMessages]
1127
- );
1128
- }
1129
- __name(useSignMessage, "useSignMessage");
1130
- function useSignMessages(uiWalletAccount) {
1131
- const signMessageFeature = getWalletAccountFeature(
1132
- uiWalletAccount,
1133
- SolanaSignMessage
1134
- );
1135
- const account = getWalletAccountForUiWalletAccount_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(uiWalletAccount);
1136
- return useCallback(
1137
- async (...inputs) => {
1138
- const inputsWithAccount = inputs.map((input) => ({ ...input, account }));
1139
- const results = await signMessageFeature.signMessage(...inputsWithAccount);
1140
- const resultsWithoutSignatureType = results.map(
1141
- ({
1142
- signatureType: _signatureType,
1143
- // Solana signatures are always of type `ed25519` so drop this property.
1144
- ...rest
1145
- }) => rest
1146
- );
1147
- return resultsWithoutSignatureType;
1148
- },
1149
- [signMessageFeature, account]
1150
- );
1151
- }
1152
- __name(useSignMessages, "useSignMessages");
1153
- function useSignTransaction(uiWalletAccount, chain) {
1154
- const signTransactions = useSignTransactions(uiWalletAccount, chain);
1155
- return useCallback(
1156
- async (input) => {
1157
- const [result] = await signTransactions(input);
1158
- return result;
1159
- },
1160
- [signTransactions]
1161
- );
1162
- }
1163
- __name(useSignTransaction, "useSignTransaction");
1164
- function useSignTransactions(uiWalletAccount, chain) {
1165
- if (!uiWalletAccount.chains.includes(chain)) {
1166
- throw new WalletStandardError(WALLET_STANDARD_ERROR__FEATURES__WALLET_ACCOUNT_CHAIN_UNSUPPORTED, {
1167
- address: uiWalletAccount.address,
1168
- chain,
1169
- featureName: SolanaSignAndSendTransaction,
1170
- supportedChains: [...uiWalletAccount.chains],
1171
- supportedFeatures: [...uiWalletAccount.features]
1172
- });
1173
- }
1174
- const signTransactionFeature = getWalletAccountFeature(
1175
- uiWalletAccount,
1176
- SolanaSignTransaction
1177
- );
1178
- const account = getWalletAccountForUiWalletAccount_DO_NOT_USE_OR_YOU_WILL_BE_FIRED(uiWalletAccount);
1179
- return useCallback(
1180
- async (...inputs) => {
1181
- const inputsWithAccountAndChain = inputs.map(({ options, ...rest }) => {
1182
- const minContextSlot = options?.minContextSlot;
1183
- return {
1184
- ...rest,
1185
- account,
1186
- chain,
1187
- ...minContextSlot != null ? {
1188
- options: {
1189
- minContextSlot: Number(minContextSlot)
1190
- }
1191
- } : null
1192
- };
1193
- });
1194
- const results = await signTransactionFeature.signTransaction(...inputsWithAccountAndChain);
1195
- return results;
1196
- },
1197
- [signTransactionFeature, account, chain]
1198
- );
1199
- }
1200
- __name(useSignTransactions, "useSignTransactions");
1201
- function useWalletAccountMessageSigner(uiWalletAccount) {
1202
- const signMessage = useSignMessage(uiWalletAccount);
1203
- return useMemo(
1204
- () => ({
1205
- address: address(uiWalletAccount.address),
1206
- async modifyAndSignMessages(messages, config) {
1207
- config?.abortSignal?.throwIfAborted();
1208
- if (messages.length > 1) {
1209
- throw new SolanaError(SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED);
1210
- }
1211
- if (messages.length === 0) {
1212
- return messages;
1213
- }
1214
- const { content: originalMessage, signatures: originalSignatureMap } = messages[0];
1215
- const input = {
1216
- message: originalMessage
1217
- };
1218
- const { signedMessage, signature } = await getAbortablePromise(signMessage(input), config?.abortSignal);
1219
- const messageWasModified = originalMessage.length !== signedMessage.length || originalMessage.some((originalByte, ii) => originalByte !== signedMessage[ii]);
1220
- const originalSignature = originalSignatureMap[uiWalletAccount.address];
1221
- const signatureIsNew = !originalSignature?.every((originalByte, ii) => originalByte === signature[ii]);
1222
- if (!signatureIsNew && !messageWasModified) {
1223
- return messages;
1224
- }
1225
- const nextSignatureMap = messageWasModified ? { [uiWalletAccount.address]: signature } : { ...originalSignatureMap, [uiWalletAccount.address]: signature };
1226
- const outputMessages = Object.freeze([
1227
- Object.freeze({
1228
- content: signedMessage,
1229
- signatures: Object.freeze(nextSignatureMap)
1230
- })
1231
- ]);
1232
- return outputMessages;
1233
- }
1234
- }),
1235
- [uiWalletAccount, signMessage]
1236
- );
1237
- }
1238
- __name(useWalletAccountMessageSigner, "useWalletAccountMessageSigner");
1239
- function useWalletAccountTransactionSigner(uiWalletAccount, chain) {
1240
- const encoderRef = useRef(null);
1241
- const signTransaction = useSignTransaction(uiWalletAccount, chain);
1242
- return useMemo(
1243
- () => ({
1244
- address: address(uiWalletAccount.address),
1245
- async modifyAndSignTransactions(transactions, config = {}) {
1246
- const { abortSignal, ...options } = config;
1247
- abortSignal?.throwIfAborted();
1248
- let transactionCodec = encoderRef.current;
1249
- if (!transactionCodec) {
1250
- transactionCodec = getTransactionCodec();
1251
- encoderRef.current = transactionCodec;
1252
- }
1253
- if (transactions.length > 1) {
1254
- throw new SolanaError(SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED);
1255
- }
1256
- if (transactions.length === 0) {
1257
- return transactions;
1258
- }
1259
- const [transaction] = transactions;
1260
- const wireTransactionBytes = transactionCodec.encode(transaction);
1261
- const inputWithOptions = {
1262
- ...options,
1263
- transaction: wireTransactionBytes
1264
- };
1265
- const { signedTransaction } = await getAbortablePromise(signTransaction(inputWithOptions), abortSignal);
1266
- const decodedSignedTransaction = transactionCodec.decode(
1267
- signedTransaction
1268
- );
1269
- assertIsTransactionWithinSizeLimit(decodedSignedTransaction);
1270
- const existingLifetime = "lifetimeConstraint" in transaction ? transaction.lifetimeConstraint : void 0;
1271
- if (existingLifetime) {
1272
- if (uint8ArraysEqual(decodedSignedTransaction.messageBytes, transaction.messageBytes)) {
1273
- return Object.freeze([
1274
- {
1275
- ...decodedSignedTransaction,
1276
- lifetimeConstraint: existingLifetime
1277
- }
1278
- ]);
1279
- }
1280
- const compiledTransactionMessage2 = getCompiledTransactionMessageDecoder().decode(
1281
- decodedSignedTransaction.messageBytes
1282
- );
1283
- const currentToken = "blockhash" in existingLifetime ? existingLifetime.blockhash : existingLifetime.nonce;
1284
- if (compiledTransactionMessage2.lifetimeToken === currentToken) {
1285
- return Object.freeze([
1286
- {
1287
- ...decodedSignedTransaction,
1288
- lifetimeConstraint: existingLifetime
1289
- }
1290
- ]);
1291
- }
1292
- }
1293
- const compiledTransactionMessage = getCompiledTransactionMessageDecoder().decode(
1294
- decodedSignedTransaction.messageBytes
1295
- );
1296
- const lifetimeConstraint = await getTransactionLifetimeConstraintFromCompiledTransactionMessage(compiledTransactionMessage);
1297
- return Object.freeze([
1298
- {
1299
- ...decodedSignedTransaction,
1300
- lifetimeConstraint
1301
- }
1302
- ]);
1303
- }
1304
- }),
1305
- [uiWalletAccount.address, signTransaction]
1306
- );
1307
- }
1308
- __name(useWalletAccountTransactionSigner, "useWalletAccountTransactionSigner");
1309
- function uint8ArraysEqual(arr1, arr2) {
1310
- return arr1.length === arr2.length && arr1.every((value, index) => value === arr2[index]);
1311
- }
1312
- __name(uint8ArraysEqual, "uint8ArraysEqual");
1313
- function useWalletAccountTransactionSendingSigner(uiWalletAccount, chain) {
1314
- const encoderRef = useRef(null);
1315
- const signAndSendTransaction = useSignAndSendTransaction(uiWalletAccount, chain);
1316
- return useMemo(
1317
- () => ({
1318
- address: address(uiWalletAccount.address),
1319
- async signAndSendTransactions(transactions, config = {}) {
1320
- const { abortSignal, ...options } = config;
1321
- abortSignal?.throwIfAborted();
1322
- let transactionEncoder = encoderRef.current;
1323
- if (!transactionEncoder) {
1324
- transactionEncoder = getTransactionEncoder();
1325
- encoderRef.current = transactionEncoder;
1326
- }
1327
- if (transactions.length > 1) {
1328
- throw new SolanaError(SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED);
1329
- }
1330
- if (transactions.length === 0) {
1331
- return [];
1332
- }
1333
- const [transaction] = transactions;
1334
- const wireTransactionBytes = transactionEncoder.encode(transaction);
1335
- const inputWithOptions = {
1336
- ...options,
1337
- transaction: wireTransactionBytes
1338
- };
1339
- const { signature } = await getAbortablePromise(signAndSendTransaction(inputWithOptions), abortSignal);
1340
- return Object.freeze([signature]);
1341
- }
1342
- }),
1343
- [signAndSendTransaction, uiWalletAccount.address]
1344
- );
1345
- }
1346
- __name(useWalletAccountTransactionSendingSigner, "useWalletAccountTransactionSendingSigner");
1347
1088
 
1348
- export { SolanaClientProvider, SolanaProvider, SolanaQueryProvider, WalletConnectionManager, useAccount, useBalance, useClientStore, useClusterState, useClusterStatus, useConnectWallet, useDisconnectWallet, useLatestBlockhash, useProgramAccounts, useSendTransaction, useSignAndSendTransaction, useSignIn, useSignMessage, useSignTransaction, useSignatureStatus, useSimulateTransaction, useSolTransfer, useSolanaClient, useSplToken, useTransactionPool, useWaitForSignature, useWallet, useWalletAccountMessageSigner, useWalletAccountTransactionSendingSigner, useWalletAccountTransactionSigner, useWalletActions, useWalletConnection, useWalletModalState, useWalletSession, useWalletStandardConnectors };
1089
+ export { SolanaClientProvider, SolanaProvider, SolanaQueryProvider, WalletConnectionManager, getLatestBlockhashKey, getProgramAccountsKey, getSignatureStatusKey, getSimulateTransactionKey, useAccount, useBalance, useClientStore, useClusterState, useClusterStatus, useConnectWallet, useDisconnectWallet, useLatestBlockhash, useProgramAccounts, useSendTransaction, useSignatureStatus, useSimulateTransaction, useSolTransfer, useSolanaClient, useSplToken, useTransactionPool, useWaitForSignature, useWallet, useWalletActions, useWalletConnection, useWalletModalState, useWalletSession };
1349
1090
  //# sourceMappingURL=index.node.mjs.map
1350
1091
  //# sourceMappingURL=index.node.mjs.map