@vue-solana/vue 0.7.0 → 0.8.1

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 (91) hide show
  1. package/dist/index.cjs +74 -39
  2. package/dist/index.d.cts +2 -1
  3. package/dist/index.d.mts +2 -1
  4. package/dist/index.d.ts +2 -1
  5. package/dist/index.mjs +74 -40
  6. package/dist/shared/{vue.CGVdFmYI.mjs → vue.B7w1CC4R.mjs} +10 -6
  7. package/dist/shared/{vue.CM6qb_s8.mjs → vue.BBNHeOeb.mjs} +16 -29
  8. package/dist/shared/{vue.CUTLu1Gf.mjs → vue.BTN0h5Il.mjs} +6 -4
  9. package/dist/shared/{vue.CwhEmATP.cjs → vue.Bii4W61L.cjs} +1 -1
  10. package/dist/shared/{vue.dmuispJ3.cjs → vue.BleajB0B.cjs} +6 -4
  11. package/dist/shared/{vue.gLqkzJY4.mjs → vue.C4d2JA8U.mjs} +7 -23
  12. package/dist/shared/{vue.COyyrsQU.cjs → vue.C5C3l0RQ.cjs} +1 -1
  13. package/dist/shared/{vue.DQi38JeF.cjs → vue.CE5i8KZZ.cjs} +6 -23
  14. package/dist/shared/{vue.BPnK_lsh.cjs → vue.CKXhlRu-.cjs} +8 -6
  15. package/dist/shared/{vue.DlEAL2G8.mjs → vue.CKx4lRew.mjs} +1 -1
  16. package/dist/shared/{vue.DWiQYhb8.cjs → vue.CMJANJ4a.cjs} +18 -31
  17. package/dist/shared/{vue.DUufwq8y.cjs → vue.CXNFQf3l.cjs} +10 -8
  18. package/dist/shared/{vue.DHVYJk8P.cjs → vue.CZohWxBN.cjs} +5 -3
  19. package/dist/shared/{vue.BqDzSepb.mjs → vue.ChnRkpDR.mjs} +1 -1
  20. package/dist/shared/{vue.h-uS8MXN.mjs → vue.Cvg6TEXE.mjs} +1 -1
  21. package/dist/shared/{vue.P9tgeC5S.cjs → vue.D5Kmwcx3.cjs} +1 -1
  22. package/dist/shared/{vue.D_AM1Nl8.cjs → vue.D6U1RFZ0.cjs} +15 -9
  23. package/dist/shared/{vue.1M_c5FWA.mjs → vue.DCDTsSjf.mjs} +3 -1
  24. package/dist/shared/{vue.DGhodYJh.d.mts → vue.DL3z5PxP.d.cts} +2 -1
  25. package/dist/shared/{vue.DGhodYJh.d.ts → vue.DL3z5PxP.d.mts} +2 -1
  26. package/dist/shared/{vue.DGhodYJh.d.cts → vue.DL3z5PxP.d.ts} +2 -1
  27. package/dist/shared/{vue.DQhHHVu6.mjs → vue.DOpWV4b3.mjs} +12 -6
  28. package/dist/shared/{vue.JC5FdU2O.mjs → vue.DZWyk9E_.mjs} +10 -8
  29. package/dist/shared/{vue.jOsz34kz.mjs → vue.DaoqgzJC.mjs} +5 -3
  30. package/dist/shared/{vue.7TzeDJZX.mjs → vue.DgPfVZnU.mjs} +8 -6
  31. package/dist/shared/{vue.D1knFN3X.cjs → vue.Dp894nYb.cjs} +6 -8
  32. package/dist/shared/{vue.C4tLiG3R.cjs → vue.eNXmiI3a.cjs} +3 -1
  33. package/dist/shared/{vue.BwipRa1w.cjs → vue.o-mWY2Yg.cjs} +29 -25
  34. package/dist/shared/{vue.BeuIPLGM.mjs → vue.vn--SX8d.mjs} +7 -9
  35. package/dist/useAccountInfo.cjs +5 -4
  36. package/dist/useAccountInfo.d.cts +2 -1
  37. package/dist/useAccountInfo.d.mts +2 -1
  38. package/dist/useAccountInfo.d.ts +2 -1
  39. package/dist/useAccountInfo.mjs +5 -4
  40. package/dist/useBalance.cjs +6 -5
  41. package/dist/useBalance.d.cts +2 -1
  42. package/dist/useBalance.d.mts +2 -1
  43. package/dist/useBalance.d.ts +2 -1
  44. package/dist/useBalance.mjs +6 -5
  45. package/dist/useConnection.cjs +3 -3
  46. package/dist/useConnection.mjs +3 -3
  47. package/dist/useProgramAccounts.cjs +5 -4
  48. package/dist/useProgramAccounts.d.cts +2 -1
  49. package/dist/useProgramAccounts.d.mts +2 -1
  50. package/dist/useProgramAccounts.d.ts +2 -1
  51. package/dist/useProgramAccounts.mjs +5 -4
  52. package/dist/useRpc.cjs +2 -2
  53. package/dist/useRpc.d.cts +3 -2
  54. package/dist/useRpc.d.mts +3 -2
  55. package/dist/useRpc.d.ts +3 -2
  56. package/dist/useRpc.mjs +2 -2
  57. package/dist/useSignAndSendTransaction.cjs +9 -6
  58. package/dist/useSignAndSendTransaction.d.cts +2 -1
  59. package/dist/useSignAndSendTransaction.d.mts +2 -1
  60. package/dist/useSignAndSendTransaction.d.ts +2 -1
  61. package/dist/useSignAndSendTransaction.mjs +9 -6
  62. package/dist/useSignMessage.cjs +4 -3
  63. package/dist/useSignMessage.d.cts +2 -1
  64. package/dist/useSignMessage.d.mts +2 -1
  65. package/dist/useSignMessage.d.ts +2 -1
  66. package/dist/useSignMessage.mjs +4 -3
  67. package/dist/useSignatureStatus.cjs +5 -4
  68. package/dist/useSignatureStatus.d.cts +2 -1
  69. package/dist/useSignatureStatus.d.mts +2 -1
  70. package/dist/useSignatureStatus.d.ts +2 -1
  71. package/dist/useSignatureStatus.mjs +5 -4
  72. package/dist/useSolana.cjs +1 -1
  73. package/dist/useSolana.d.cts +2 -1
  74. package/dist/useSolana.d.mts +2 -1
  75. package/dist/useSolana.d.ts +2 -1
  76. package/dist/useSolana.mjs +1 -1
  77. package/dist/useTransaction.cjs +3 -1
  78. package/dist/useTransaction.d.cts +2 -1
  79. package/dist/useTransaction.d.mts +2 -1
  80. package/dist/useTransaction.d.ts +2 -1
  81. package/dist/useTransaction.mjs +3 -1
  82. package/dist/useTransactionConfirmation.cjs +5 -4
  83. package/dist/useTransactionConfirmation.d.cts +2 -1
  84. package/dist/useTransactionConfirmation.d.mts +2 -1
  85. package/dist/useTransactionConfirmation.d.ts +2 -1
  86. package/dist/useTransactionConfirmation.mjs +5 -4
  87. package/dist/useWallet.cjs +4 -2
  88. package/dist/useWallet.mjs +4 -2
  89. package/dist/useWallets.cjs +2 -2
  90. package/dist/useWallets.mjs +2 -2
  91. package/package.json +2 -2
package/dist/index.cjs CHANGED
@@ -1,53 +1,62 @@
1
1
  'use strict';
2
2
 
3
- const useAccountInfo = require('./shared/vue.BPnK_lsh.cjs');
4
- const useBalance = require('./shared/vue.D_AM1Nl8.cjs');
5
- const useConnection = require('./shared/vue.CwhEmATP.cjs');
6
- const useProgramAccounts = require('./shared/vue.dmuispJ3.cjs');
7
- const useRpc = require('./shared/vue.COyyrsQU.cjs');
8
- const useSignMessage = require('./shared/vue.D1knFN3X.cjs');
9
- const useSignAndSendTransaction = require('./shared/vue.DWiQYhb8.cjs');
10
- const useSignatureStatus = require('./shared/vue.DUufwq8y.cjs');
11
- const useSolana = require('./shared/vue.C4tLiG3R.cjs');
12
- const useTransaction = require('./shared/vue.DQi38JeF.cjs');
13
- const useTransactionConfirmation = require('./shared/vue.DHVYJk8P.cjs');
14
- const useWallet = require('./shared/vue.BwipRa1w.cjs');
15
- const useWallets = require('./shared/vue.P9tgeC5S.cjs');
3
+ const useAccountInfo = require('./shared/vue.CKXhlRu-.cjs');
4
+ const useBalance = require('./shared/vue.D6U1RFZ0.cjs');
5
+ const useConnection = require('./shared/vue.Bii4W61L.cjs');
6
+ const useProgramAccounts = require('./shared/vue.BleajB0B.cjs');
7
+ const useRpc = require('./shared/vue.C5C3l0RQ.cjs');
8
+ const useSignMessage = require('./shared/vue.Dp894nYb.cjs');
9
+ const useSignAndSendTransaction = require('./shared/vue.CMJANJ4a.cjs');
10
+ const useSignatureStatus = require('./shared/vue.CXNFQf3l.cjs');
11
+ const useSolana = require('./shared/vue.eNXmiI3a.cjs');
12
+ const useTransaction = require('./shared/vue.CE5i8KZZ.cjs');
13
+ const useTransactionConfirmation = require('./shared/vue.CZohWxBN.cjs');
14
+ const useWallet = require('./shared/vue.o-mWY2Yg.cjs');
15
+ const useWallets = require('./shared/vue.D5Kmwcx3.cjs');
16
+ const errors = require('@vue-solana/core/errors');
16
17
  const rpc = require('@vue-solana/core/rpc');
18
+ const timeout = require('@vue-solana/core/timeout');
17
19
  const walletStandard = require('@vue-solana/core/wallet-standard');
18
20
  const vue = require('vue');
19
21
  const iosWallet = require('@vue-solana/core/ios-wallet');
20
22
  require('@vue-solana/core/address');
21
- require('@solana/web3-compat');
22
23
  require('@vue-solana/core/wallet');
23
24
  require('@vue-solana/core/transaction');
24
25
  require('bs58');
25
26
 
26
27
  const SELECTED_WALLET_STORAGE_KEY = "vue-solana:selected-wallet";
27
28
  function readSelectedWallet() {
28
- const storage = getLocalStorage();
29
- if (!storage) {
30
- return null;
29
+ const { storage, error } = getLocalStorage();
30
+ if (error || !storage) {
31
+ return { wallet: null, error };
31
32
  }
32
33
  try {
33
34
  const value = storage.getItem(SELECTED_WALLET_STORAGE_KEY);
34
35
  if (!value) {
35
- return null;
36
+ return { wallet: null, error: null };
36
37
  }
37
38
  const wallet = JSON.parse(value);
38
- return typeof wallet.name === "string" ? {
39
- name: wallet.name,
40
- platform: wallet.platform,
41
- source: wallet.source
42
- } : null;
43
- } catch {
44
- return null;
39
+ return {
40
+ wallet: typeof wallet.name === "string" ? {
41
+ name: wallet.name,
42
+ platform: wallet.platform,
43
+ source: wallet.source
44
+ } : null,
45
+ error: null
46
+ };
47
+ } catch (cause) {
48
+ return {
49
+ wallet: null,
50
+ error: errors.createSolanaError("STORAGE_FAILURE", "Unable to read the selected Solana wallet", {
51
+ cause
52
+ })
53
+ };
45
54
  }
46
55
  }
47
56
  function writeSelectedWallet(wallet) {
48
- const storage = getLocalStorage();
49
- if (!storage) {
50
- return;
57
+ const { storage, error } = getLocalStorage();
58
+ if (error || !storage) {
59
+ return error;
51
60
  }
52
61
  try {
53
62
  if (wallet) {
@@ -55,7 +64,11 @@ function writeSelectedWallet(wallet) {
55
64
  } else {
56
65
  storage.removeItem(SELECTED_WALLET_STORAGE_KEY);
57
66
  }
58
- } catch {
67
+ return null;
68
+ } catch (cause) {
69
+ return errors.createSolanaError("STORAGE_FAILURE", "Unable to persist the selected Solana wallet", {
70
+ cause
71
+ });
59
72
  }
60
73
  }
61
74
  function stringifySelectedWallet(wallet) {
@@ -70,12 +83,17 @@ function stringifySelectedWallet(wallet) {
70
83
  }
71
84
  function getLocalStorage() {
72
85
  if (typeof window === "undefined") {
73
- return null;
86
+ return { storage: null, error: null };
74
87
  }
75
88
  try {
76
- return window.localStorage;
77
- } catch {
78
- return null;
89
+ return { storage: window.localStorage, error: null };
90
+ } catch (cause) {
91
+ return {
92
+ storage: null,
93
+ error: errors.createSolanaError("STORAGE_FAILURE", "Unable to read the selected Solana wallet", {
94
+ cause
95
+ })
96
+ };
79
97
  }
80
98
  }
81
99
 
@@ -128,6 +146,7 @@ function createSolanaWalletRegistry(options) {
128
146
  );
129
147
  },
130
148
  disconnect: () => adaptedWallet.disconnect(),
149
+ signMessage: adaptedWallet.signMessage?.bind(adaptedWallet),
131
150
  signTransaction: adaptedWallet.signTransaction?.bind(adaptedWallet),
132
151
  signAllTransactions: adaptedWallet.signAllTransactions?.bind(adaptedWallet),
133
152
  signAndSendTransaction: adaptedWallet.signAndSendTransaction?.bind(adaptedWallet)
@@ -203,10 +222,12 @@ function createSolanaPlugin(options = {}) {
203
222
  wsEndpoint: context.wsEndpoint
204
223
  });
205
224
  try {
206
- const blockhash = await useTransaction.withTimeout(
225
+ const blockhash = await timeout.withTimeout(
207
226
  context.connection.getLatestBlockhash(),
208
227
  RPC_CHECK_TIMEOUT_MS,
209
- `RPC connection check timed out after ${RPC_CHECK_TIMEOUT_MS / 1e3} seconds.`
228
+ () => new Error(
229
+ `RPC connection check timed out after ${RPC_CHECK_TIMEOUT_MS / 1e3} seconds.`
230
+ )
210
231
  );
211
232
  if (checkId !== rpcCheckId) {
212
233
  return;
@@ -224,7 +245,7 @@ function createSolanaPlugin(options = {}) {
224
245
  return;
225
246
  }
226
247
  status.value = "error";
227
- error.value = cause instanceof Error ? cause.message : String(cause);
248
+ error.value = errors.normalizeSolanaError(cause, "RPC_FAILURE");
228
249
  console.error("[Vue Solana] Connection failed", cause);
229
250
  }
230
251
  }
@@ -240,7 +261,13 @@ function createSolanaPlugin(options = {}) {
240
261
  }
241
262
  } else if (!options.wallet) {
242
263
  const persistedWallet = readSelectedWallet();
243
- restoredWallet = persistedWallet ? wallets.value.find((nextWallet) => isSameWallet(nextWallet, persistedWallet)) ?? null : null;
264
+ if (persistedWallet.error) {
265
+ error.value = persistedWallet.error;
266
+ console.error("[Vue Solana] Selected wallet restoration failed", persistedWallet.error);
267
+ }
268
+ restoredWallet = persistedWallet.wallet ? wallets.value.find(
269
+ (nextWallet) => isSameWallet(nextWallet, persistedWallet.wallet)
270
+ ) ?? null : null;
244
271
  if (restoredWallet) {
245
272
  selectedWallet.value = restoredWallet;
246
273
  wallet.value = walletRegistry.getAdaptedWallet(restoredWallet);
@@ -269,7 +296,11 @@ function createSolanaPlugin(options = {}) {
269
296
  function selectWallet(nextWallet) {
270
297
  selectedWallet.value = nextWallet;
271
298
  wallet.value = nextWallet ? walletRegistry.getAdaptedWallet(nextWallet) : options.wallet ?? null;
272
- writeSelectedWallet(nextWallet);
299
+ const storageError = writeSelectedWallet(nextWallet);
300
+ if (storageError) {
301
+ error.value = storageError;
302
+ console.error("[Vue Solana] Selected wallet persistence failed", storageError);
303
+ }
273
304
  }
274
305
  function autoConnectWallet(walletInfo) {
275
306
  if (!options.autoConnect) {
@@ -301,7 +332,11 @@ function createSolanaPlugin(options = {}) {
301
332
  setWallet(nextWallet) {
302
333
  selectedWallet.value = null;
303
334
  wallet.value = nextWallet;
304
- writeSelectedWallet(null);
335
+ const storageError = writeSelectedWallet(null);
336
+ if (storageError) {
337
+ error.value = storageError;
338
+ console.error("[Vue Solana] Selected wallet persistence failed", storageError);
339
+ }
305
340
  }
306
341
  };
307
342
  app.provide(useSolana.solanaInjectionKey, vueContext);
package/dist/index.d.cts CHANGED
@@ -11,12 +11,13 @@ export { UseTransactionOptions, useTransaction } from './useTransaction.cjs';
11
11
  export { TransactionConfirmationStatus, getConfirmedTransactionStatus, useTransactionConfirmation } from './useTransactionConfirmation.cjs';
12
12
  export { useWallet } from './useWallet.cjs';
13
13
  export { useWallets } from './useWallets.cjs';
14
- export { S as SolanaConnectionStatus, V as VueSolanaContext, s as solanaInjectionKey } from './shared/vue.DGhodYJh.cjs';
14
+ export { S as SolanaConnectionStatus, V as VueSolanaContext, s as solanaInjectionKey } from './shared/vue.DL3z5PxP.cjs';
15
15
  import { GetSolanaIosWalletsOptions } from '@vue-solana/core/ios-wallet';
16
16
  import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-wallet';
17
17
  import { SolanaConfig, SolanaWallet } from '@vue-solana/core/types';
18
18
  import { App } from 'vue';
19
19
  import '@vue-solana/core/address';
20
+ import '@vue-solana/core/errors';
20
21
  import '@solana/web3-compat';
21
22
 
22
23
  interface VueSolanaPluginOptions extends SolanaConfig {
package/dist/index.d.mts CHANGED
@@ -11,12 +11,13 @@ export { UseTransactionOptions, useTransaction } from './useTransaction.mjs';
11
11
  export { TransactionConfirmationStatus, getConfirmedTransactionStatus, useTransactionConfirmation } from './useTransactionConfirmation.mjs';
12
12
  export { useWallet } from './useWallet.mjs';
13
13
  export { useWallets } from './useWallets.mjs';
14
- export { S as SolanaConnectionStatus, V as VueSolanaContext, s as solanaInjectionKey } from './shared/vue.DGhodYJh.mjs';
14
+ export { S as SolanaConnectionStatus, V as VueSolanaContext, s as solanaInjectionKey } from './shared/vue.DL3z5PxP.mjs';
15
15
  import { GetSolanaIosWalletsOptions } from '@vue-solana/core/ios-wallet';
16
16
  import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-wallet';
17
17
  import { SolanaConfig, SolanaWallet } from '@vue-solana/core/types';
18
18
  import { App } from 'vue';
19
19
  import '@vue-solana/core/address';
20
+ import '@vue-solana/core/errors';
20
21
  import '@solana/web3-compat';
21
22
 
22
23
  interface VueSolanaPluginOptions extends SolanaConfig {
package/dist/index.d.ts CHANGED
@@ -11,12 +11,13 @@ export { UseTransactionOptions, useTransaction } from './useTransaction.js';
11
11
  export { TransactionConfirmationStatus, getConfirmedTransactionStatus, useTransactionConfirmation } from './useTransactionConfirmation.js';
12
12
  export { useWallet } from './useWallet.js';
13
13
  export { useWallets } from './useWallets.js';
14
- export { S as SolanaConnectionStatus, V as VueSolanaContext, s as solanaInjectionKey } from './shared/vue.DGhodYJh.js';
14
+ export { S as SolanaConnectionStatus, V as VueSolanaContext, s as solanaInjectionKey } from './shared/vue.DL3z5PxP.js';
15
15
  import { GetSolanaIosWalletsOptions } from '@vue-solana/core/ios-wallet';
16
16
  import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-wallet';
17
17
  import { SolanaConfig, SolanaWallet } from '@vue-solana/core/types';
18
18
  import { App } from 'vue';
19
19
  import '@vue-solana/core/address';
20
+ import '@vue-solana/core/errors';
20
21
  import '@solana/web3-compat';
21
22
 
22
23
  interface VueSolanaPluginOptions extends SolanaConfig {
package/dist/index.mjs CHANGED
@@ -1,53 +1,61 @@
1
- export { u as useAccountInfo } from './shared/vue.7TzeDJZX.mjs';
2
- export { u as useBalance } from './shared/vue.DQhHHVu6.mjs';
3
- export { u as useConnection } from './shared/vue.DlEAL2G8.mjs';
4
- export { u as useProgramAccounts } from './shared/vue.CUTLu1Gf.mjs';
5
- export { u as useRpc } from './shared/vue.BqDzSepb.mjs';
6
- export { u as useSignMessage } from './shared/vue.BeuIPLGM.mjs';
7
- export { u as useSignAndSendTransaction } from './shared/vue.CM6qb_s8.mjs';
8
- export { u as useSignatureStatus } from './shared/vue.JC5FdU2O.mjs';
9
- import { s as solanaInjectionKey } from './shared/vue.1M_c5FWA.mjs';
10
- export { t as tryUseSolana, u as useSolana } from './shared/vue.1M_c5FWA.mjs';
11
- import { w as withTimeout } from './shared/vue.gLqkzJY4.mjs';
12
- export { u as useTransaction } from './shared/vue.gLqkzJY4.mjs';
13
- export { g as getConfirmedTransactionStatus, u as useTransactionConfirmation } from './shared/vue.jOsz34kz.mjs';
14
- export { u as useWallet } from './shared/vue.CGVdFmYI.mjs';
15
- export { u as useWallets } from './shared/vue.h-uS8MXN.mjs';
1
+ export { u as useAccountInfo } from './shared/vue.DgPfVZnU.mjs';
2
+ export { u as useBalance } from './shared/vue.DOpWV4b3.mjs';
3
+ export { u as useConnection } from './shared/vue.CKx4lRew.mjs';
4
+ export { u as useProgramAccounts } from './shared/vue.BTN0h5Il.mjs';
5
+ export { u as useRpc } from './shared/vue.ChnRkpDR.mjs';
6
+ export { u as useSignMessage } from './shared/vue.vn--SX8d.mjs';
7
+ export { u as useSignAndSendTransaction } from './shared/vue.BBNHeOeb.mjs';
8
+ export { u as useSignatureStatus } from './shared/vue.DZWyk9E_.mjs';
9
+ import { s as solanaInjectionKey } from './shared/vue.DCDTsSjf.mjs';
10
+ export { t as tryUseSolana, u as useSolana } from './shared/vue.DCDTsSjf.mjs';
11
+ export { u as useTransaction } from './shared/vue.C4d2JA8U.mjs';
12
+ export { g as getConfirmedTransactionStatus, u as useTransactionConfirmation } from './shared/vue.DaoqgzJC.mjs';
13
+ export { u as useWallet } from './shared/vue.B7w1CC4R.mjs';
14
+ export { u as useWallets } from './shared/vue.Cvg6TEXE.mjs';
15
+ import { createSolanaError, normalizeSolanaError } from '@vue-solana/core/errors';
16
16
  import { createSolanaContext } from '@vue-solana/core/rpc';
17
+ import { withTimeout } from '@vue-solana/core/timeout';
17
18
  import { getRegisteredSolanaWallets, getSolanaChain, adaptSolanaStandardWallet, subscribeSolanaWallets } from '@vue-solana/core/wallet-standard';
18
19
  import { shallowRef, ref, triggerRef } from 'vue';
19
20
  import { handleSolanaIosWalletCallback, getSolanaIosWallets, isSolanaIosWalletInfo, adaptSolanaIosWallet } from '@vue-solana/core/ios-wallet';
20
21
  import '@vue-solana/core/address';
21
- import '@solana/web3-compat';
22
22
  import '@vue-solana/core/wallet';
23
23
  import '@vue-solana/core/transaction';
24
24
  import 'bs58';
25
25
 
26
26
  const SELECTED_WALLET_STORAGE_KEY = "vue-solana:selected-wallet";
27
27
  function readSelectedWallet() {
28
- const storage = getLocalStorage();
29
- if (!storage) {
30
- return null;
28
+ const { storage, error } = getLocalStorage();
29
+ if (error || !storage) {
30
+ return { wallet: null, error };
31
31
  }
32
32
  try {
33
33
  const value = storage.getItem(SELECTED_WALLET_STORAGE_KEY);
34
34
  if (!value) {
35
- return null;
35
+ return { wallet: null, error: null };
36
36
  }
37
37
  const wallet = JSON.parse(value);
38
- return typeof wallet.name === "string" ? {
39
- name: wallet.name,
40
- platform: wallet.platform,
41
- source: wallet.source
42
- } : null;
43
- } catch {
44
- return null;
38
+ return {
39
+ wallet: typeof wallet.name === "string" ? {
40
+ name: wallet.name,
41
+ platform: wallet.platform,
42
+ source: wallet.source
43
+ } : null,
44
+ error: null
45
+ };
46
+ } catch (cause) {
47
+ return {
48
+ wallet: null,
49
+ error: createSolanaError("STORAGE_FAILURE", "Unable to read the selected Solana wallet", {
50
+ cause
51
+ })
52
+ };
45
53
  }
46
54
  }
47
55
  function writeSelectedWallet(wallet) {
48
- const storage = getLocalStorage();
49
- if (!storage) {
50
- return;
56
+ const { storage, error } = getLocalStorage();
57
+ if (error || !storage) {
58
+ return error;
51
59
  }
52
60
  try {
53
61
  if (wallet) {
@@ -55,7 +63,11 @@ function writeSelectedWallet(wallet) {
55
63
  } else {
56
64
  storage.removeItem(SELECTED_WALLET_STORAGE_KEY);
57
65
  }
58
- } catch {
66
+ return null;
67
+ } catch (cause) {
68
+ return createSolanaError("STORAGE_FAILURE", "Unable to persist the selected Solana wallet", {
69
+ cause
70
+ });
59
71
  }
60
72
  }
61
73
  function stringifySelectedWallet(wallet) {
@@ -70,12 +82,17 @@ function stringifySelectedWallet(wallet) {
70
82
  }
71
83
  function getLocalStorage() {
72
84
  if (typeof window === "undefined") {
73
- return null;
85
+ return { storage: null, error: null };
74
86
  }
75
87
  try {
76
- return window.localStorage;
77
- } catch {
78
- return null;
88
+ return { storage: window.localStorage, error: null };
89
+ } catch (cause) {
90
+ return {
91
+ storage: null,
92
+ error: createSolanaError("STORAGE_FAILURE", "Unable to read the selected Solana wallet", {
93
+ cause
94
+ })
95
+ };
79
96
  }
80
97
  }
81
98
 
@@ -128,6 +145,7 @@ function createSolanaWalletRegistry(options) {
128
145
  );
129
146
  },
130
147
  disconnect: () => adaptedWallet.disconnect(),
148
+ signMessage: adaptedWallet.signMessage?.bind(adaptedWallet),
131
149
  signTransaction: adaptedWallet.signTransaction?.bind(adaptedWallet),
132
150
  signAllTransactions: adaptedWallet.signAllTransactions?.bind(adaptedWallet),
133
151
  signAndSendTransaction: adaptedWallet.signAndSendTransaction?.bind(adaptedWallet)
@@ -206,7 +224,9 @@ function createSolanaPlugin(options = {}) {
206
224
  const blockhash = await withTimeout(
207
225
  context.connection.getLatestBlockhash(),
208
226
  RPC_CHECK_TIMEOUT_MS,
209
- `RPC connection check timed out after ${RPC_CHECK_TIMEOUT_MS / 1e3} seconds.`
227
+ () => new Error(
228
+ `RPC connection check timed out after ${RPC_CHECK_TIMEOUT_MS / 1e3} seconds.`
229
+ )
210
230
  );
211
231
  if (checkId !== rpcCheckId) {
212
232
  return;
@@ -224,7 +244,7 @@ function createSolanaPlugin(options = {}) {
224
244
  return;
225
245
  }
226
246
  status.value = "error";
227
- error.value = cause instanceof Error ? cause.message : String(cause);
247
+ error.value = normalizeSolanaError(cause, "RPC_FAILURE");
228
248
  console.error("[Vue Solana] Connection failed", cause);
229
249
  }
230
250
  }
@@ -240,7 +260,13 @@ function createSolanaPlugin(options = {}) {
240
260
  }
241
261
  } else if (!options.wallet) {
242
262
  const persistedWallet = readSelectedWallet();
243
- restoredWallet = persistedWallet ? wallets.value.find((nextWallet) => isSameWallet(nextWallet, persistedWallet)) ?? null : null;
263
+ if (persistedWallet.error) {
264
+ error.value = persistedWallet.error;
265
+ console.error("[Vue Solana] Selected wallet restoration failed", persistedWallet.error);
266
+ }
267
+ restoredWallet = persistedWallet.wallet ? wallets.value.find(
268
+ (nextWallet) => isSameWallet(nextWallet, persistedWallet.wallet)
269
+ ) ?? null : null;
244
270
  if (restoredWallet) {
245
271
  selectedWallet.value = restoredWallet;
246
272
  wallet.value = walletRegistry.getAdaptedWallet(restoredWallet);
@@ -269,7 +295,11 @@ function createSolanaPlugin(options = {}) {
269
295
  function selectWallet(nextWallet) {
270
296
  selectedWallet.value = nextWallet;
271
297
  wallet.value = nextWallet ? walletRegistry.getAdaptedWallet(nextWallet) : options.wallet ?? null;
272
- writeSelectedWallet(nextWallet);
298
+ const storageError = writeSelectedWallet(nextWallet);
299
+ if (storageError) {
300
+ error.value = storageError;
301
+ console.error("[Vue Solana] Selected wallet persistence failed", storageError);
302
+ }
273
303
  }
274
304
  function autoConnectWallet(walletInfo) {
275
305
  if (!options.autoConnect) {
@@ -301,7 +331,11 @@ function createSolanaPlugin(options = {}) {
301
331
  setWallet(nextWallet) {
302
332
  selectedWallet.value = null;
303
333
  wallet.value = nextWallet;
304
- writeSelectedWallet(null);
334
+ const storageError = writeSelectedWallet(null);
335
+ if (storageError) {
336
+ error.value = storageError;
337
+ console.error("[Vue Solana] Selected wallet persistence failed", storageError);
338
+ }
305
339
  }
306
340
  };
307
341
  app.provide(solanaInjectionKey, vueContext);
@@ -1,5 +1,7 @@
1
+ import { normalizeSolanaError } from '@vue-solana/core/errors';
2
+ import { createNoWalletSelectedError } from '@vue-solana/core/wallet';
1
3
  import { ref, computed, triggerRef } from 'vue';
2
- import { u as useSolana } from './vue.1M_c5FWA.mjs';
4
+ import { u as useSolana } from './vue.DCDTsSjf.mjs';
3
5
 
4
6
  function useWallet() {
5
7
  const solana = useSolana();
@@ -9,7 +11,7 @@ function useWallet() {
9
11
  async function connect() {
10
12
  const activeWallet = wallet.value;
11
13
  if (!activeWallet) {
12
- throw new Error("No Solana wallet is configured");
14
+ throw createNoWalletSelectedError();
13
15
  }
14
16
  connecting.value = true;
15
17
  try {
@@ -21,9 +23,10 @@ function useWallet() {
21
23
  publicKey: activeWallet.publicKey?.toBase58() ?? null
22
24
  });
23
25
  } catch (error) {
26
+ const normalizedError = normalizeSolanaError(error, "RPC_FAILURE");
24
27
  triggerRef(wallet);
25
- console.error("[Vue Solana] Wallet connection failed", error);
26
- throw error;
28
+ console.error("[Vue Solana] Wallet connection failed", normalizedError);
29
+ throw normalizedError;
27
30
  } finally {
28
31
  connecting.value = false;
29
32
  }
@@ -40,9 +43,10 @@ function useWallet() {
40
43
  triggerRef(wallet);
41
44
  console.info("[Vue Solana] Wallet disconnected", { publicKey });
42
45
  } catch (error) {
46
+ const normalizedError = normalizeSolanaError(error, "RPC_FAILURE");
43
47
  triggerRef(wallet);
44
- console.error("[Vue Solana] Wallet disconnection failed", error);
45
- throw error;
48
+ console.error("[Vue Solana] Wallet disconnection failed", normalizedError);
49
+ throw normalizedError;
46
50
  } finally {
47
51
  disconnecting.value = false;
48
52
  }
@@ -1,8 +1,11 @@
1
+ import { normalizeSolanaError } from '@vue-solana/core/errors';
2
+ import { withSolanaTimeout } from '@vue-solana/core/timeout';
1
3
  import { signAndSendTransaction, confirmTransactionSignature } from '@vue-solana/core/transaction';
4
+ import { createNoWalletSelectedError } from '@vue-solana/core/wallet';
2
5
  import { ref } from 'vue';
3
- import { u as useConnection } from './vue.DlEAL2G8.mjs';
4
- import { u as useWallet } from './vue.CGVdFmYI.mjs';
5
- import { g as getConfirmedTransactionStatus } from './vue.jOsz34kz.mjs';
6
+ import { u as useConnection } from './vue.CKx4lRew.mjs';
7
+ import { u as useWallet } from './vue.B7w1CC4R.mjs';
8
+ import { g as getConfirmedTransactionStatus } from './vue.DaoqgzJC.mjs';
6
9
 
7
10
  const SIGN_AND_SEND_TIMEOUT_MS = 12e4;
8
11
  function useSignAndSendTransaction() {
@@ -24,15 +27,17 @@ function useSignAndSendTransaction() {
24
27
  confirmation.value = null;
25
28
  const activeWallet = wallet.value;
26
29
  if (!activeWallet) {
27
- const cause = new Error("No Solana wallet is configured");
28
- error.value = cause;
30
+ const normalizedError = createNoWalletSelectedError();
31
+ error.value = normalizedError;
29
32
  status.value = "error";
30
33
  loading.value = false;
31
- throw cause;
34
+ throw normalizedError;
32
35
  }
33
36
  try {
34
- const nextSignature = await withWalletTransactionTimeout(
35
- signAndSendTransaction(connection, activeWallet, transaction, transactionOptions)
37
+ const nextSignature = await withSolanaTimeout(
38
+ signAndSendTransaction(connection, activeWallet, transaction, transactionOptions),
39
+ SIGN_AND_SEND_TIMEOUT_MS,
40
+ "Wallet transaction did not return a result. Check your wallet or explorer for the final status."
36
41
  );
37
42
  if (currentExecutionId === executionId) {
38
43
  signature.value = nextSignature;
@@ -52,11 +57,12 @@ function useSignAndSendTransaction() {
52
57
  }
53
58
  return nextSignature;
54
59
  } catch (cause) {
60
+ const normalizedError = normalizeSolanaError(cause, "RPC_FAILURE");
55
61
  if (currentExecutionId === executionId) {
56
- error.value = cause;
62
+ error.value = normalizedError;
57
63
  status.value = "error";
58
64
  }
59
- throw cause;
65
+ throw normalizedError;
60
66
  } finally {
61
67
  if (currentExecutionId === executionId) {
62
68
  loading.value = false;
@@ -72,24 +78,5 @@ function useSignAndSendTransaction() {
72
78
  execute
73
79
  };
74
80
  }
75
- async function withWalletTransactionTimeout(promise) {
76
- let timeoutId;
77
- try {
78
- const timeout = new Promise((_, reject) => {
79
- timeoutId = setTimeout(() => {
80
- reject(
81
- new Error(
82
- "Wallet transaction did not return a result. Check your wallet or explorer for the final status."
83
- )
84
- );
85
- }, SIGN_AND_SEND_TIMEOUT_MS);
86
- });
87
- return await Promise.race([promise, timeout]);
88
- } finally {
89
- if (timeoutId) {
90
- clearTimeout(timeoutId);
91
- }
92
- }
93
- }
94
81
 
95
82
  export { useSignAndSendTransaction as u };
@@ -1,7 +1,8 @@
1
1
  import { parsePublicKey } from '@vue-solana/core/address';
2
+ import { normalizeSolanaError } from '@vue-solana/core/errors';
2
3
  import { shallowRef, onMounted, onUnmounted, watch, toValue } from 'vue';
3
- import { u as useConnection } from './vue.DlEAL2G8.mjs';
4
- import { t as tryUseSolana } from './vue.1M_c5FWA.mjs';
4
+ import { u as useConnection } from './vue.CKx4lRew.mjs';
5
+ import { t as tryUseSolana } from './vue.DCDTsSjf.mjs';
5
6
 
6
7
  function useProgramAccounts(programId, options = {}) {
7
8
  const solana = tryUseSolana();
@@ -37,11 +38,12 @@ function useProgramAccounts(programId, options = {}) {
37
38
  }
38
39
  return nextAccounts;
39
40
  } catch (cause) {
41
+ const normalizedError = normalizeSolanaError(cause, "RPC_FAILURE");
40
42
  if (requestId === refreshId) {
41
43
  accounts.value = [];
42
- error.value = cause;
44
+ error.value = normalizedError;
43
45
  }
44
- throw cause;
46
+ throw normalizedError;
45
47
  } finally {
46
48
  if (requestId === refreshId) {
47
49
  loading.value = false;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const useRpc = require('./vue.COyyrsQU.cjs');
3
+ const useRpc = require('./vue.C5C3l0RQ.cjs');
4
4
 
5
5
  function useConnection() {
6
6
  return useRpc.useRpc().connection;
@@ -1,9 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  const address = require('@vue-solana/core/address');
4
+ const errors = require('@vue-solana/core/errors');
4
5
  const vue = require('vue');
5
- const useConnection = require('./vue.CwhEmATP.cjs');
6
- const useSolana = require('./vue.C4tLiG3R.cjs');
6
+ const useConnection = require('./vue.Bii4W61L.cjs');
7
+ const useSolana = require('./vue.eNXmiI3a.cjs');
7
8
 
8
9
  function useProgramAccounts(programId, options = {}) {
9
10
  const solana = useSolana.tryUseSolana();
@@ -39,11 +40,12 @@ function useProgramAccounts(programId, options = {}) {
39
40
  }
40
41
  return nextAccounts;
41
42
  } catch (cause) {
43
+ const normalizedError = errors.normalizeSolanaError(cause, "RPC_FAILURE");
42
44
  if (requestId === refreshId) {
43
45
  accounts.value = [];
44
- error.value = cause;
46
+ error.value = normalizedError;
45
47
  }
46
- throw cause;
48
+ throw normalizedError;
47
49
  } finally {
48
50
  if (requestId === refreshId) {
49
51
  loading.value = false;