@vue-solana/vue 3.0.0 → 4.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/README.md +8 -4
  2. package/dist/index.d.ts +12 -0
  3. package/dist/index.mjs +81 -58
  4. package/dist/shared/{vue.CjSw0Hh1.mjs → vue.4ne5EBD9.mjs} +4 -4
  5. package/dist/shared/{vue.C9OOmvkD.mjs → vue.BBN9aU6D.mjs} +2 -2
  6. package/dist/shared/{vue.CsFY1mfz.mjs → vue.BXNjyJ2c.mjs} +1 -1
  7. package/dist/shared/{vue.DlihC5GG.mjs → vue.BiKE9Xuv.mjs} +6 -4
  8. package/dist/shared/{vue.CXB4NEMA.mjs → vue.Bu2cQ690.mjs} +47 -17
  9. package/dist/shared/{vue.CpkwC8Th.mjs → vue.C6OkOK2W.mjs} +1 -1
  10. package/dist/shared/{vue.B9uRpSDJ.mjs → vue.CAltY57B.mjs} +6 -3
  11. package/dist/shared/{vue.DDQxNX5q.mjs → vue.CELGI7de.mjs} +9 -9
  12. package/dist/shared/{vue.BxtOHzY_.mjs → vue.CLAqNcLp.mjs} +1 -1
  13. package/dist/shared/{vue.hG_FieA3.mjs → vue.CW-1AuSO.mjs} +2 -2
  14. package/dist/shared/{vue.Mxc8w6Qk.mjs → vue.CZApWQAY.mjs} +1 -1
  15. package/dist/shared/vue.CbmzveKF.mjs +44 -0
  16. package/dist/shared/{vue.CQh3AUE8.mjs → vue.CcOZ9858.mjs} +3 -5
  17. package/dist/shared/{vue.B-xtuLtD.mjs → vue.D2J7_NpQ.mjs} +2 -2
  18. package/dist/shared/{vue.BsGwt78R.mjs → vue.D8zNWw2t.mjs} +1 -1
  19. package/dist/shared/{vue.CaAgH2Xt.mjs → vue.DPwdqRO_.mjs} +3 -3
  20. package/dist/shared/{vue.DNKD6jqM.mjs → vue.DTpvqDyY.mjs} +3 -3
  21. package/dist/shared/{vue.D218Ow7t.mjs → vue.DY9VadLH.mjs} +1 -8
  22. package/dist/shared/vue.DZVdVfy1.mjs +7 -0
  23. package/dist/shared/{vue.CvenSbZZ.mjs → vue.DZhPXLZz.mjs} +4 -4
  24. package/dist/shared/{vue.o98pAmDg.mjs → vue.DbJG4-ku.mjs} +2 -2
  25. package/dist/shared/{vue.BFSboXMB.mjs → vue.DbJKnSrl.mjs} +3 -3
  26. package/dist/shared/{vue.1Qwco2kv.mjs → vue.DcZ_R_RH.mjs} +4 -4
  27. package/dist/shared/{vue.C_4qJDiF.mjs → vue.DyLgoSbX.mjs} +1 -1
  28. package/dist/shared/{vue.XlfH_nkc.mjs → vue.FehFeE3w.mjs} +3 -3
  29. package/dist/shared/{vue.C1JbUTpJ.mjs → vue.UrCjmf0T.mjs} +2 -2
  30. package/dist/swr.d.ts +7 -1
  31. package/dist/swr.mjs +16 -4
  32. package/dist/useAccountInfo.mjs +1 -10
  33. package/dist/useAction.mjs +0 -2
  34. package/dist/useAirdrop.mjs +1 -8
  35. package/dist/useBalance.mjs +1 -9
  36. package/dist/useClientCapability.d.ts +6 -1
  37. package/dist/useClientCapability.mjs +1 -5
  38. package/dist/useConnection.d.ts +8 -1
  39. package/dist/useConnection.mjs +1 -5
  40. package/dist/useIdentity.mjs +1 -6
  41. package/dist/usePayer.mjs +1 -6
  42. package/dist/usePlanTransaction.mjs +1 -8
  43. package/dist/usePlanTransactions.mjs +1 -8
  44. package/dist/useProgramAccounts.mjs +1 -10
  45. package/dist/useRequest.mjs +0 -4
  46. package/dist/useRpc.d.ts +6 -0
  47. package/dist/useRpc.mjs +1 -4
  48. package/dist/useSelectedWalletAccount.d.ts +3 -0
  49. package/dist/useSelectedWalletAccount.mjs +0 -2
  50. package/dist/useSendTransaction.mjs +1 -8
  51. package/dist/useSendTransactions.mjs +1 -8
  52. package/dist/useSignAndSendTransaction.mjs +1 -13
  53. package/dist/useSignAndSendTransactions.mjs +1 -9
  54. package/dist/useSignIn.mjs +1 -8
  55. package/dist/useSignMessage.mjs +1 -8
  56. package/dist/useSignTransactions.mjs +1 -8
  57. package/dist/useSignatureStatus.d.ts +0 -1
  58. package/dist/useSignatureStatus.mjs +1 -8
  59. package/dist/useSolana.mjs +1 -3
  60. package/dist/useSolanaClient.d.ts +6 -0
  61. package/dist/useSolanaClient.mjs +1 -4
  62. package/dist/useSubscription.mjs +0 -2
  63. package/dist/useTokenAccounts.mjs +1 -10
  64. package/dist/useTokenBalance.mjs +1 -10
  65. package/dist/useTrackedData.mjs +0 -3
  66. package/dist/useTransaction.mjs +0 -4
  67. package/dist/useTransactionConfirmation.mjs +1 -9
  68. package/dist/useWallet.mjs +1 -6
  69. package/dist/useWallets.mjs +1 -4
  70. package/package.json +8 -5
  71. package/dist/buffer-polyfill.d.mts +0 -2
  72. package/dist/index.d.mts +0 -64
  73. package/dist/kit.d.mts +0 -1
  74. package/dist/shared/vue.BGGixph-.d.mts +0 -5
  75. package/dist/shared/vue.Bfu1dCKe.mjs +0 -10
  76. package/dist/shared/vue.CGv0ip3w.mjs +0 -52
  77. package/dist/shared/vue.DL3z5PxP.d.mts +0 -21
  78. package/dist/swr.d.mts +0 -41
  79. package/dist/useAccountInfo.d.mts +0 -24
  80. package/dist/useAction.d.mts +0 -45
  81. package/dist/useAirdrop.d.mts +0 -27
  82. package/dist/useBalance.d.mts +0 -15
  83. package/dist/useClientCapability.d.mts +0 -39
  84. package/dist/useConnection.d.mts +0 -46
  85. package/dist/useIdentity.d.mts +0 -3
  86. package/dist/usePayer.d.mts +0 -18
  87. package/dist/usePlanTransaction.d.mts +0 -44
  88. package/dist/usePlanTransactions.d.mts +0 -5
  89. package/dist/useProgramAccounts.d.mts +0 -45
  90. package/dist/useRequest.d.mts +0 -73
  91. package/dist/useRpc.d.mts +0 -55
  92. package/dist/useSelectedWalletAccount.d.mts +0 -117
  93. package/dist/useSendTransaction.d.mts +0 -50
  94. package/dist/useSendTransactions.d.mts +0 -5
  95. package/dist/useSignAndSendTransaction.d.mts +0 -40
  96. package/dist/useSignAndSendTransactions.d.mts +0 -35
  97. package/dist/useSignIn.d.mts +0 -23
  98. package/dist/useSignMessage.d.mts +0 -236
  99. package/dist/useSignTransactions.d.mts +0 -24
  100. package/dist/useSignatureStatus.d.mts +0 -26
  101. package/dist/useSolana.d.mts +0 -9
  102. package/dist/useSolanaClient.d.mts +0 -45
  103. package/dist/useSubscription.d.mts +0 -70
  104. package/dist/useTokenAccounts.d.mts +0 -19
  105. package/dist/useTokenBalance.d.mts +0 -17
  106. package/dist/useTrackedData.d.mts +0 -98
  107. package/dist/useTransaction.d.mts +0 -27
  108. package/dist/useTransactionConfirmation.d.mts +0 -38
  109. package/dist/useWallet.d.mts +0 -31
  110. package/dist/useWallets.d.mts +0 -11
@@ -0,0 +1,44 @@
1
+ import { shallowRef, onScopeDispose } from 'vue';
2
+ import { u as useExecution } from './vue.BiKE9Xuv.mjs';
3
+ import { u as useClientCapability, M as MissingClientCapabilityError } from './vue.CAltY57B.mjs';
4
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
5
+
6
+ function useClientAction(config) {
7
+ const { capability, hookName, providerHint, statuses } = config;
8
+ useClientCapability([capability, "payer"], { hookName, providerHint });
9
+ const { client } = useSolanaClient();
10
+ const data = shallowRef(null);
11
+ let abortController;
12
+ onScopeDispose(() => abortController?.abort());
13
+ const execution = useExecution(statuses.working, {
14
+ error: statuses.error,
15
+ idle: statuses.idle
16
+ });
17
+ async function execute(input, options = {}) {
18
+ const method = client?.[capability];
19
+ if (typeof method !== "function") {
20
+ throw new MissingClientCapabilityError(hookName, [capability], providerHint);
21
+ }
22
+ abortController?.abort();
23
+ const controller = new AbortController();
24
+ abortController = controller;
25
+ data.value = null;
26
+ const abortSignal = options.abortSignal ? AbortSignal.any([controller.signal, options.abortSignal]) : controller.signal;
27
+ return execution.execute(
28
+ () => method(input, { abortSignal }),
29
+ (result) => {
30
+ data.value = result;
31
+ return statuses.success;
32
+ }
33
+ );
34
+ }
35
+ return {
36
+ data,
37
+ status: execution.status,
38
+ loading: execution.loading,
39
+ error: execution.error,
40
+ execute
41
+ };
42
+ }
43
+
44
+ export { useClientAction as u };
@@ -1,15 +1,14 @@
1
1
  import { inject, shallowRef, ref } from 'vue';
2
2
  import { s as solanaInjectionKey } from './vue.D_P5SqqD.mjs';
3
3
 
4
- let ssrContext;
5
4
  function tryUseSolana() {
6
5
  return inject(solanaInjectionKey, null);
7
6
  }
8
7
  function useSolana() {
9
- return tryUseSolana() ?? getSsrContext();
8
+ return tryUseSolana() ?? createSsrContext();
10
9
  }
11
- function getSsrContext() {
12
- ssrContext ??= {
10
+ function createSsrContext() {
11
+ return {
13
12
  cluster: "devnet",
14
13
  endpoint: "",
15
14
  wsEndpoint: "",
@@ -29,7 +28,6 @@ function getSsrContext() {
29
28
  selectWallet() {
30
29
  }
31
30
  };
32
- return ssrContext;
33
31
  }
34
32
  function createUnavailableProxy() {
35
33
  return new Proxy(
@@ -1,6 +1,6 @@
1
1
  import { shallowRef, onScopeDispose } from 'vue';
2
- import { u as useClientCapability } from './vue.B9uRpSDJ.mjs';
3
- import { u as useSolanaClient } from './vue.Mxc8w6Qk.mjs';
2
+ import { u as useClientCapability } from './vue.CAltY57B.mjs';
3
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
4
4
 
5
5
  function useIdentity() {
6
6
  useClientCapability(["identity"], {
@@ -1,5 +1,5 @@
1
1
  import { computed } from 'vue';
2
- import { u as useSolana } from './vue.CQh3AUE8.mjs';
2
+ import { u as useSolana } from './vue.CcOZ9858.mjs';
3
3
 
4
4
  function useRpc() {
5
5
  const solana = useSolana();
@@ -1,7 +1,7 @@
1
1
  import { confirmTransactionSignature } from '@vue-solana/core/transaction';
2
2
  import { ref } from 'vue';
3
- import { u as useExecution } from './vue.DlihC5GG.mjs';
4
- import { u as useConnection } from './vue.CpkwC8Th.mjs';
3
+ import { u as useExecution } from './vue.BiKE9Xuv.mjs';
4
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
5
5
 
6
6
  function getConfirmedTransactionStatus(confirmation) {
7
7
  if (confirmation.commitment === "finalized") {
@@ -10,7 +10,7 @@ function getConfirmedTransactionStatus(confirmation) {
10
10
  return confirmation.commitment === "processed" ? "processed" : "confirmed";
11
11
  }
12
12
  function useTransactionConfirmation(defaultOptions = {}) {
13
- const client = useConnection();
13
+ const client = useSolanaClient().client;
14
14
  const signature = ref(null);
15
15
  const confirmation = ref(null);
16
16
  const {
@@ -1,12 +1,12 @@
1
1
  import { getTokenAccountsByOwner } from '@vue-solana/core/token-accounts';
2
- import { u as useConnection } from './vue.CpkwC8Th.mjs';
2
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
3
3
  import { u as useAddressRead } from './vue.BwBqla_n.mjs';
4
- import { t as tryUseSolana } from './vue.CQh3AUE8.mjs';
4
+ import { t as tryUseSolana } from './vue.CcOZ9858.mjs';
5
5
 
6
6
  function useTokenAccounts(owner, options) {
7
7
  const empty = [];
8
8
  const solana = tryUseSolana();
9
- const client = solana?.client ?? useConnection();
9
+ const client = solana?.client ?? useSolanaClient().client;
10
10
  const { data: tokenAccounts, ...rest } = useAddressRead(
11
11
  [owner],
12
12
  (key) => getTokenAccountsByOwner(client, key, {
@@ -1,7 +1,7 @@
1
1
  import { normalizeSolanaError } from '@vue-solana/core/errors';
2
2
  import { createNoWalletSelectedError, assertWalletConnected } from '@vue-solana/core/wallet';
3
3
  import { ref, computed, triggerRef } from 'vue';
4
- import { u as useSolana } from './vue.CQh3AUE8.mjs';
4
+ import { u as useSolana } from './vue.CcOZ9858.mjs';
5
5
 
6
6
  function useWallet() {
7
7
  const solana = useSolana();
@@ -23,13 +23,9 @@ function useWallet() {
23
23
  await connection;
24
24
  assertWalletConnected(activeWallet);
25
25
  triggerRef(wallet);
26
- console.info("[Vue Solana] Wallet connected", {
27
- publicKey: activeWallet.publicKey ?? null
28
- });
29
26
  } catch (error) {
30
27
  const normalizedError = normalizeSolanaError(error, "RPC_FAILURE");
31
28
  triggerRef(wallet);
32
- console.error("[Vue Solana] Wallet connection failed", normalizedError);
33
29
  throw normalizedError;
34
30
  } finally {
35
31
  connecting.value = false;
@@ -40,16 +36,13 @@ function useWallet() {
40
36
  if (!activeWallet) {
41
37
  return;
42
38
  }
43
- const publicKey = activeWallet.publicKey ?? null;
44
39
  disconnecting.value = true;
45
40
  try {
46
41
  await activeWallet.disconnect();
47
42
  triggerRef(wallet);
48
- console.info("[Vue Solana] Wallet disconnected", { publicKey });
49
43
  } catch (error) {
50
44
  const normalizedError = normalizeSolanaError(error, "RPC_FAILURE");
51
45
  triggerRef(wallet);
52
- console.error("[Vue Solana] Wallet disconnection failed", normalizedError);
53
46
  throw normalizedError;
54
47
  } finally {
55
48
  disconnecting.value = false;
@@ -0,0 +1,7 @@
1
+ import { getBase64Encoder } from '@vue-solana/core/kit';
2
+
3
+ function decodeBase64(value) {
4
+ return getBase64Encoder().encode(value);
5
+ }
6
+
7
+ export { decodeBase64 as d };
@@ -1,11 +1,11 @@
1
- import { u as useConnection } from './vue.CpkwC8Th.mjs';
1
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
2
2
  import { u as useAddressRead } from './vue.BwBqla_n.mjs';
3
- import { t as tryUseSolana } from './vue.CQh3AUE8.mjs';
4
- import { d as decodeBase64 } from './vue.Bfu1dCKe.mjs';
3
+ import { t as tryUseSolana } from './vue.CcOZ9858.mjs';
4
+ import { d as decodeBase64 } from './vue.DZVdVfy1.mjs';
5
5
 
6
6
  function useAccountInfo(address, options = {}) {
7
7
  const solana = tryUseSolana();
8
- const client = solana?.client ?? useConnection();
8
+ const client = solana?.client ?? useSolanaClient().client;
9
9
  const { data: accountInfo, ...rest } = useAddressRead(
10
10
  [address],
11
11
  async (key) => (await client.rpc.getAccountInfo(key, { encoding: "base64", commitment: options.commitment }).send()).value,
@@ -1,7 +1,7 @@
1
1
  import { createNoWalletSelectedError, assertWalletCanSignMessage } from '@vue-solana/core/wallet';
2
2
  import { ref } from 'vue';
3
- import { u as useExecution } from './vue.DlihC5GG.mjs';
4
- import { u as useWallet } from './vue.D218Ow7t.mjs';
3
+ import { u as useExecution } from './vue.BiKE9Xuv.mjs';
4
+ import { u as useWallet } from './vue.DY9VadLH.mjs';
5
5
 
6
6
  function useSignMessage() {
7
7
  const { wallet } = useWallet();
@@ -1,10 +1,10 @@
1
- import { u as useConnection } from './vue.CpkwC8Th.mjs';
1
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
2
2
  import { u as useAddressRead } from './vue.BwBqla_n.mjs';
3
- import { t as tryUseSolana } from './vue.CQh3AUE8.mjs';
3
+ import { t as tryUseSolana } from './vue.CcOZ9858.mjs';
4
4
 
5
5
  function useBalance(address, commitment) {
6
6
  const solana = tryUseSolana();
7
- const client = solana?.client ?? useConnection();
7
+ const client = solana?.client ?? useSolanaClient().client;
8
8
  const { data: balance, ...rest } = useAddressRead(
9
9
  [address],
10
10
  async (key) => (await client.rpc.getBalance(key, commitment ? { commitment } : void 0).send()).value,
@@ -1,12 +1,12 @@
1
- import { u as useConnection } from './vue.CpkwC8Th.mjs';
1
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
2
2
  import { u as useAddressRead } from './vue.BwBqla_n.mjs';
3
- import { t as tryUseSolana } from './vue.CQh3AUE8.mjs';
4
- import { d as decodeBase64 } from './vue.Bfu1dCKe.mjs';
3
+ import { t as tryUseSolana } from './vue.CcOZ9858.mjs';
4
+ import { d as decodeBase64 } from './vue.DZVdVfy1.mjs';
5
5
 
6
6
  function useProgramAccounts(programId, options = {}) {
7
7
  const empty = [];
8
8
  const solana = tryUseSolana();
9
- const client = solana?.client ?? useConnection();
9
+ const client = solana?.client ?? useSolanaClient().client;
10
10
  const { data: accounts, ...rest } = useAddressRead(
11
11
  [programId],
12
12
  async (key) => (await client.rpc.getProgramAccounts(key, {
@@ -1,4 +1,4 @@
1
- import { u as useSolana } from './vue.CQh3AUE8.mjs';
1
+ import { u as useSolana } from './vue.CcOZ9858.mjs';
2
2
 
3
3
  function useWallets() {
4
4
  const solana = useSolana();
@@ -1,8 +1,8 @@
1
1
  import { getTokenBalance } from '@vue-solana/core/token-accounts';
2
2
  import { computed } from 'vue';
3
- import { u as useConnection } from './vue.CpkwC8Th.mjs';
3
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
4
4
  import { u as useAddressRead } from './vue.BwBqla_n.mjs';
5
- import { t as tryUseSolana } from './vue.CQh3AUE8.mjs';
5
+ import { t as tryUseSolana } from './vue.CcOZ9858.mjs';
6
6
 
7
7
  function useTokenBalance(mint, owner, commitment) {
8
8
  const empty = {
@@ -10,7 +10,7 @@ function useTokenBalance(mint, owner, commitment) {
10
10
  decimals: null
11
11
  };
12
12
  const solana = tryUseSolana();
13
- const client = solana?.client ?? useConnection();
13
+ const client = solana?.client ?? useSolanaClient().client;
14
14
  const read = useAddressRead(
15
15
  [mint, owner],
16
16
  (mintKey, ownerKey) => getTokenBalance(client, mintKey, ownerKey, commitment),
@@ -2,8 +2,8 @@ import { SolanaError, normalizeSolanaError } from '@vue-solana/core/errors';
2
2
  import { withSolanaTimeout } from '@vue-solana/core/timeout';
3
3
  import { createNoWalletSelectedError, assertWalletCanSignAndSendTransactions } from '@vue-solana/core/wallet';
4
4
  import { shallowRef } from 'vue';
5
- import { u as useExecution } from './vue.DlihC5GG.mjs';
6
- import { u as useWallet } from './vue.D218Ow7t.mjs';
5
+ import { u as useExecution } from './vue.BiKE9Xuv.mjs';
6
+ import { u as useWallet } from './vue.DY9VadLH.mjs';
7
7
 
8
8
  const SIGN_AND_SEND_TIMEOUT_MS = 12e4;
9
9
  class PartialSignAndSendError extends SolanaError {
package/dist/swr.d.ts CHANGED
@@ -10,6 +10,12 @@ import '@vue-solana/core/kit';
10
10
  * and to reset server-side caches per request.
11
11
  */
12
12
  declare function clearSwrCache(): void;
13
+ /**
14
+ * Remove a single cached SWR entry by its full cache key (including the
15
+ * adapter prefix, e.g. `request:balance`). Prefer this over
16
+ * {@link clearSwrCache} when only one key's stale value needs to be discarded.
17
+ */
18
+ declare function deleteSwrKey(key: string): void;
13
19
  /**
14
20
  * `useRequest` with cache keying. A component mounting with a key that
15
21
  * already holds data shows it immediately (stale) while its own request
@@ -38,4 +44,4 @@ declare function useSubscriptionSwr<TResult>(key: string, source: UseSubscriptio
38
44
  */
39
45
  declare function useTrackedDataSwr<TInitialValue, TStreamValue, TItem>(key: string, source: UseTrackedDataSource<TInitialValue, TStreamValue, TItem>, options?: UseTrackedDataOptions): UseTrackedDataReturn<TItem>;
40
46
 
41
- export { clearSwrCache, useRequestSwr, useSubscriptionSwr, useTrackedDataSwr };
47
+ export { clearSwrCache, deleteSwrKey, useRequestSwr, useSubscriptionSwr, useTrackedDataSwr };
package/dist/swr.mjs CHANGED
@@ -2,17 +2,27 @@ import { watch, computed } from 'vue';
2
2
  import { u as useRequest } from './shared/vue.B8VvC8d2.mjs';
3
3
  import { u as useSubscription } from './shared/vue.D5pqR5Fa.mjs';
4
4
  import { u as useTrackedData } from './shared/vue.BNJTXSnQ.mjs';
5
- import '@vue-solana/core/action';
6
- import '@vue-solana/core/kit';
7
- import '@vue-solana/core/errors';
8
5
 
9
6
  const PREFIX_REQUEST = "request:";
10
7
  const PREFIX_SUBSCRIPTION = "subscription:";
11
8
  const PREFIX_TRACKED = "tracked:";
9
+ const SWR_CACHE_MAX_ENTRIES = 1024;
12
10
  const swrCache = /* @__PURE__ */ new Map();
13
11
  function clearSwrCache() {
14
12
  swrCache.clear();
15
13
  }
14
+ function deleteSwrKey(key) {
15
+ swrCache.delete(key);
16
+ }
17
+ function evictSwrCacheIfNeeded() {
18
+ while (swrCache.size > SWR_CACHE_MAX_ENTRIES) {
19
+ const oldestKey = swrCache.keys().next().value;
20
+ if (oldestKey === void 0) {
21
+ break;
22
+ }
23
+ swrCache.delete(oldestKey);
24
+ }
25
+ }
16
26
  function isPendingStatus(status) {
17
27
  return status === "fetching" || status === "loading";
18
28
  }
@@ -22,11 +32,13 @@ function writeSwrResult(key, data, error, status) {
22
32
  return;
23
33
  }
24
34
  const previous = swrCache.get(key);
35
+ swrCache.delete(key);
25
36
  swrCache.set(key, {
26
37
  data: data !== void 0 ? data : previous?.data,
27
38
  error,
28
39
  status
29
40
  });
41
+ evictSwrCacheIfNeeded();
30
42
  }
31
43
  function swrError(error, status, seed) {
32
44
  if (status === "disabled") {
@@ -74,4 +86,4 @@ function useTrackedDataSwr(key, source, options = {}) {
74
86
  return { ...swr, refresh: result.refresh, status: result.status };
75
87
  }
76
88
 
77
- export { clearSwrCache, useRequestSwr, useSubscriptionSwr, useTrackedDataSwr };
89
+ export { clearSwrCache, deleteSwrKey, useRequestSwr, useSubscriptionSwr, useTrackedDataSwr };
@@ -1,10 +1 @@
1
- export { u as useAccountInfo } from './shared/vue.CvenSbZZ.mjs';
2
- import './shared/vue.CpkwC8Th.mjs';
3
- import './shared/vue.Mxc8w6Qk.mjs';
4
- import './shared/vue.CQh3AUE8.mjs';
5
- import 'vue';
6
- import './shared/vue.D_P5SqqD.mjs';
7
- import './shared/vue.BwBqla_n.mjs';
8
- import '@vue-solana/core/address';
9
- import '@vue-solana/core/errors';
10
- import './shared/vue.Bfu1dCKe.mjs';
1
+ export { u as useAccountInfo } from './shared/vue.DZhPXLZz.mjs';
@@ -1,3 +1 @@
1
1
  export { u as useAction } from './shared/vue.DYk0Xfr3.mjs';
2
- import '@vue-solana/core/action';
3
- import 'vue';
@@ -1,8 +1 @@
1
- export { u as useAirdrop } from './shared/vue.DDQxNX5q.mjs';
2
- import './shared/vue.DYk0Xfr3.mjs';
3
- import '@vue-solana/core/action';
4
- import 'vue';
5
- import './shared/vue.B9uRpSDJ.mjs';
6
- import './shared/vue.Mxc8w6Qk.mjs';
7
- import './shared/vue.CQh3AUE8.mjs';
8
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { u as useAirdrop } from './shared/vue.CELGI7de.mjs';
@@ -1,9 +1 @@
1
- export { u as useBalance } from './shared/vue.BFSboXMB.mjs';
2
- import './shared/vue.CpkwC8Th.mjs';
3
- import './shared/vue.Mxc8w6Qk.mjs';
4
- import './shared/vue.CQh3AUE8.mjs';
5
- import 'vue';
6
- import './shared/vue.D_P5SqqD.mjs';
7
- import './shared/vue.BwBqla_n.mjs';
8
- import '@vue-solana/core/address';
9
- import '@vue-solana/core/errors';
1
+ export { u as useBalance } from './shared/vue.DbJKnSrl.mjs';
@@ -1,8 +1,13 @@
1
+ import { SolanaError } from '@vue-solana/core/errors';
2
+
1
3
  /**
2
4
  * Thrown by {@link useClientCapability} when the installed Solana client does
3
5
  * not expose a requested capability.
6
+ *
7
+ * Subclasses core's {@link SolanaError} (code `MISSING_CLIENT_CAPABILITY`) so
8
+ * capability failures answer `isSolanaError()` the same way runtime failures do.
4
9
  */
5
- declare class MissingClientCapabilityError extends Error {
10
+ declare class MissingClientCapabilityError extends SolanaError {
6
11
  /** Name of the hook that requested the capability, e.g. `usePayer`. */
7
12
  readonly hookName: string;
8
13
  /** Human guidance for installing the capability on the client. */
@@ -1,5 +1 @@
1
- export { M as MissingClientCapabilityError, u as useClientCapability } from './shared/vue.B9uRpSDJ.mjs';
2
- import './shared/vue.Mxc8w6Qk.mjs';
3
- import './shared/vue.CQh3AUE8.mjs';
4
- import 'vue';
5
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { M as MissingClientCapabilityError, u as useClientCapability } from './shared/vue.CAltY57B.mjs';
@@ -3,11 +3,13 @@ import * as _solana_kit from '@solana/kit';
3
3
 
4
4
  /**
5
5
  * @deprecated Use `useSolanaClient()` which returns the Kit client instead of
6
- * the legacy web3-compat Connection.
6
+ * the legacy web3-compat Connection. Kept through 4.x; scheduled for removal
7
+ * in 5.0.0.
7
8
  */
8
9
  declare function useConnection(): Omit<_solana_kit.Client<{
9
10
  signTransactions: (input: _solana_kit.InstructionPlanInput | _solana_kit.TransactionPlanInput, config?: {
10
11
  abortSignal?: AbortSignal;
12
+ maxInstructionsPerTransaction?: number;
11
13
  }) => Promise<_solana_kit.TransactionPlanResult<_solana_kit_plugin_rpc.RpcSignContext>>;
12
14
  payer: _solana_kit.TransactionSigner;
13
15
  rpc: _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetAgGenesisCertApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetTransactionsForAddressApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
@@ -16,9 +18,11 @@ declare function useConnection(): Omit<_solana_kit.Client<{
16
18
  transactionPlanner: _solana_kit.TransactionPlanner;
17
19
  planTransaction: (input: _solana_kit.InstructionPlanInput, config?: {
18
20
  abortSignal?: AbortSignal;
21
+ maxInstructionsPerTransaction?: number;
19
22
  }) => Promise<_solana_kit.SingleTransactionPlan["message"]>;
20
23
  planTransactions: (input: _solana_kit.InstructionPlanInput, config?: {
21
24
  abortSignal?: AbortSignal;
25
+ maxInstructionsPerTransaction?: number;
22
26
  }) => Promise<_solana_kit.TransactionPlan>;
23
27
  signTransaction: (input: _solana_kit.InstructionPlanInput | (_solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>) | Readonly<{
24
28
  kind: "single";
@@ -26,6 +30,7 @@ declare function useConnection(): Omit<_solana_kit.Client<{
26
30
  planType: "transactionPlan";
27
31
  }>, config?: {
28
32
  abortSignal?: AbortSignal;
33
+ maxInstructionsPerTransaction?: number;
29
34
  }) => Promise<_solana_kit.SuccessfulSingleTransactionPlanResult<_solana_kit_plugin_rpc.RpcSignContext>>;
30
35
  transactionPlanExecutor: _solana_kit.TransactionPlanExecutor<_solana_kit_plugin_rpc.RpcSendContext>;
31
36
  sendTransaction: (input: _solana_kit.InstructionPlanInput | (_solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>) | Readonly<{
@@ -34,9 +39,11 @@ declare function useConnection(): Omit<_solana_kit.Client<{
34
39
  planType: "transactionPlan";
35
40
  }>, config?: {
36
41
  abortSignal?: AbortSignal;
42
+ maxInstructionsPerTransaction?: number;
37
43
  }) => Promise<_solana_kit.SuccessfulSingleTransactionPlanResult<_solana_kit_plugin_rpc.RpcSendContext>>;
38
44
  sendTransactions: (input: _solana_kit.InstructionPlanInput | _solana_kit.TransactionPlanInput, config?: {
39
45
  abortSignal?: AbortSignal;
46
+ maxInstructionsPerTransaction?: number;
40
47
  }) => Promise<_solana_kit.TransactionPlanResult<_solana_kit_plugin_rpc.RpcSendContext>>;
41
48
  airdrop: (address: _solana_kit.Address, amount: _solana_kit.Lamports, abortSignal?: AbortSignal) => Promise<_solana_kit.Signature | undefined>;
42
49
  }>, "payer"> & {
@@ -1,5 +1 @@
1
- export { u as useConnection } from './shared/vue.CpkwC8Th.mjs';
2
- import './shared/vue.Mxc8w6Qk.mjs';
3
- import './shared/vue.CQh3AUE8.mjs';
4
- import 'vue';
5
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { u as useConnection } from './shared/vue.C6OkOK2W.mjs';
@@ -1,6 +1 @@
1
- export { u as useIdentity } from './shared/vue.B-xtuLtD.mjs';
2
- import 'vue';
3
- import './shared/vue.B9uRpSDJ.mjs';
4
- import './shared/vue.Mxc8w6Qk.mjs';
5
- import './shared/vue.CQh3AUE8.mjs';
6
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { u as useIdentity } from './shared/vue.D2J7_NpQ.mjs';
package/dist/usePayer.mjs CHANGED
@@ -1,6 +1 @@
1
- export { u as useIdentity, a as usePayer } from './shared/vue.B-xtuLtD.mjs';
2
- import 'vue';
3
- import './shared/vue.B9uRpSDJ.mjs';
4
- import './shared/vue.Mxc8w6Qk.mjs';
5
- import './shared/vue.CQh3AUE8.mjs';
6
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { u as useIdentity, a as usePayer } from './shared/vue.D2J7_NpQ.mjs';
@@ -1,8 +1 @@
1
- export { u as usePlanTransaction, a as usePlanTransactions } from './shared/vue.CsFY1mfz.mjs';
2
- import './shared/vue.CGv0ip3w.mjs';
3
- import '@vue-solana/core/errors';
4
- import 'vue';
5
- import './shared/vue.B9uRpSDJ.mjs';
6
- import './shared/vue.Mxc8w6Qk.mjs';
7
- import './shared/vue.CQh3AUE8.mjs';
8
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { u as usePlanTransaction, a as usePlanTransactions } from './shared/vue.BXNjyJ2c.mjs';
@@ -1,8 +1 @@
1
- export { a as usePlanTransactions } from './shared/vue.CsFY1mfz.mjs';
2
- import './shared/vue.CGv0ip3w.mjs';
3
- import '@vue-solana/core/errors';
4
- import 'vue';
5
- import './shared/vue.B9uRpSDJ.mjs';
6
- import './shared/vue.Mxc8w6Qk.mjs';
7
- import './shared/vue.CQh3AUE8.mjs';
8
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { a as usePlanTransactions } from './shared/vue.BXNjyJ2c.mjs';
@@ -1,10 +1 @@
1
- export { u as useProgramAccounts } from './shared/vue.1Qwco2kv.mjs';
2
- import './shared/vue.CpkwC8Th.mjs';
3
- import './shared/vue.Mxc8w6Qk.mjs';
4
- import './shared/vue.CQh3AUE8.mjs';
5
- import 'vue';
6
- import './shared/vue.D_P5SqqD.mjs';
7
- import './shared/vue.BwBqla_n.mjs';
8
- import '@vue-solana/core/address';
9
- import '@vue-solana/core/errors';
10
- import './shared/vue.Bfu1dCKe.mjs';
1
+ export { u as useProgramAccounts } from './shared/vue.DcZ_R_RH.mjs';
@@ -1,5 +1 @@
1
1
  export { u as useRequest } from './shared/vue.B8VvC8d2.mjs';
2
- import '@vue-solana/core/action';
3
- import '@vue-solana/core/kit';
4
- import '@vue-solana/core/errors';
5
- import 'vue';
package/dist/useRpc.d.ts CHANGED
@@ -16,6 +16,7 @@ declare function useRpc(): {
16
16
  client: Omit<_solana_kit.Client<{
17
17
  signTransactions: (input: _solana_kit.InstructionPlanInput | _solana_kit.TransactionPlanInput, config?: {
18
18
  abortSignal?: AbortSignal;
19
+ maxInstructionsPerTransaction?: number;
19
20
  }) => Promise<_solana_kit.TransactionPlanResult<_solana_kit_plugin_rpc.RpcSignContext>>;
20
21
  payer: _solana_kit.TransactionSigner;
21
22
  rpc: _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetAgGenesisCertApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetTransactionsForAddressApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
@@ -24,9 +25,11 @@ declare function useRpc(): {
24
25
  transactionPlanner: _solana_kit.TransactionPlanner;
25
26
  planTransaction: (input: _solana_kit.InstructionPlanInput, config?: {
26
27
  abortSignal?: AbortSignal;
28
+ maxInstructionsPerTransaction?: number;
27
29
  }) => Promise<_solana_kit.SingleTransactionPlan["message"]>;
28
30
  planTransactions: (input: _solana_kit.InstructionPlanInput, config?: {
29
31
  abortSignal?: AbortSignal;
32
+ maxInstructionsPerTransaction?: number;
30
33
  }) => Promise<_solana_kit.TransactionPlan>;
31
34
  signTransaction: (input: _solana_kit.InstructionPlanInput | (_solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>) | Readonly<{
32
35
  kind: "single";
@@ -34,6 +37,7 @@ declare function useRpc(): {
34
37
  planType: "transactionPlan";
35
38
  }>, config?: {
36
39
  abortSignal?: AbortSignal;
40
+ maxInstructionsPerTransaction?: number;
37
41
  }) => Promise<_solana_kit.SuccessfulSingleTransactionPlanResult<_solana_kit_plugin_rpc.RpcSignContext>>;
38
42
  transactionPlanExecutor: _solana_kit.TransactionPlanExecutor<_solana_kit_plugin_rpc.RpcSendContext>;
39
43
  sendTransaction: (input: _solana_kit.InstructionPlanInput | (_solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>) | Readonly<{
@@ -42,9 +46,11 @@ declare function useRpc(): {
42
46
  planType: "transactionPlan";
43
47
  }>, config?: {
44
48
  abortSignal?: AbortSignal;
49
+ maxInstructionsPerTransaction?: number;
45
50
  }) => Promise<_solana_kit.SuccessfulSingleTransactionPlanResult<_solana_kit_plugin_rpc.RpcSendContext>>;
46
51
  sendTransactions: (input: _solana_kit.InstructionPlanInput | _solana_kit.TransactionPlanInput, config?: {
47
52
  abortSignal?: AbortSignal;
53
+ maxInstructionsPerTransaction?: number;
48
54
  }) => Promise<_solana_kit.TransactionPlanResult<_solana_kit_plugin_rpc.RpcSendContext>>;
49
55
  airdrop: (address: _solana_kit.Address, amount: _solana_kit.Lamports, abortSignal?: AbortSignal) => Promise<_solana_kit.Signature | undefined>;
50
56
  }>, "payer"> & {
package/dist/useRpc.mjs CHANGED
@@ -1,4 +1 @@
1
- export { u as useRpc } from './shared/vue.BsGwt78R.mjs';
2
- import 'vue';
3
- import './shared/vue.CQh3AUE8.mjs';
4
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { u as useRpc } from './shared/vue.D8zNWw2t.mjs';
@@ -87,6 +87,9 @@ interface SolanaContextLike {
87
87
  *
88
88
  * Wraps `provideSelectedWalletAccount`; children read state via
89
89
  * `useSelectedWalletAccount()`.
90
+ *
91
+ * `filterWallet` and `stateSync` are read once during setup (init-only);
92
+ * changing them after mount requires remounting the provider.
90
93
  */
91
94
  declare const SelectedWalletAccountProvider: vue.DefineComponent<vue.ExtractPropTypes<{
92
95
  filterWallet: {
@@ -1,3 +1 @@
1
1
  export { S as SelectedWalletAccountProvider, c as createSelectedWalletAccountContext, p as provideSelectedWalletAccount, s as selectedWalletAccountInjectionKey, u as useSelectedWalletAccount } from './shared/vue.BngCaeXJ.mjs';
2
- import 'vue';
3
- import './shared/vue.D_P5SqqD.mjs';
@@ -1,8 +1 @@
1
- export { u as useSendTransaction, a as useSendTransactions } from './shared/vue.BxtOHzY_.mjs';
2
- import './shared/vue.CGv0ip3w.mjs';
3
- import '@vue-solana/core/errors';
4
- import 'vue';
5
- import './shared/vue.B9uRpSDJ.mjs';
6
- import './shared/vue.Mxc8w6Qk.mjs';
7
- import './shared/vue.CQh3AUE8.mjs';
8
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { u as useSendTransaction, a as useSendTransactions } from './shared/vue.CLAqNcLp.mjs';
@@ -1,8 +1 @@
1
- export { a as useSendTransactions } from './shared/vue.BxtOHzY_.mjs';
2
- import './shared/vue.CGv0ip3w.mjs';
3
- import '@vue-solana/core/errors';
4
- import 'vue';
5
- import './shared/vue.B9uRpSDJ.mjs';
6
- import './shared/vue.Mxc8w6Qk.mjs';
7
- import './shared/vue.CQh3AUE8.mjs';
8
- import './shared/vue.D_P5SqqD.mjs';
1
+ export { a as useSendTransactions } from './shared/vue.CLAqNcLp.mjs';