@vue-solana/vue 1.2.0 → 2.1.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 (220) hide show
  1. package/README.md +162 -23
  2. package/dist/buffer-polyfill.d.cts +0 -1
  3. package/dist/buffer-polyfill.d.mts +0 -1
  4. package/dist/buffer-polyfill.d.ts +0 -1
  5. package/dist/index.cjs +62 -22
  6. package/dist/index.d.cts +29 -13
  7. package/dist/index.d.mts +29 -13
  8. package/dist/index.d.ts +29 -13
  9. package/dist/index.mjs +41 -21
  10. package/dist/kit.d.cts +1 -1
  11. package/dist/kit.d.mts +1 -1
  12. package/dist/kit.d.ts +1 -1
  13. package/dist/shared/vue.5euWd6-V.mjs +59 -0
  14. package/dist/shared/vue.9TPxZPMf.cjs +59 -0
  15. package/dist/shared/vue.B4-LEdSE.cjs +102 -0
  16. package/dist/shared/{vue.C0uCLjJ6.cjs → vue.B6ainw2G.cjs} +1 -1
  17. package/dist/shared/vue.B8LptjZP.mjs +32 -0
  18. package/dist/shared/vue.B8pLQ8P4.cjs +105 -0
  19. package/dist/shared/vue.B8ub540p.mjs +109 -0
  20. package/dist/shared/{vue.D0ycWj82.mjs → vue.BD6Gm1nl.mjs} +9 -9
  21. package/dist/shared/{vue.BEesxsrA.cjs → vue.BGxz4dru.cjs} +7 -3
  22. package/dist/shared/{vue.DDxhSi72.mjs → vue.BINkrA8h.mjs} +9 -9
  23. package/dist/shared/{vue.COPnX5fq.cjs → vue.BIxphCAq.cjs} +1 -1
  24. package/dist/shared/{vue.CKTUFwSI.mjs → vue.BOpgWr43.mjs} +9 -10
  25. package/dist/shared/vue.BQRpjwKl.mjs +80 -0
  26. package/dist/shared/vue.BVaMoz9y.cjs +9 -0
  27. package/dist/shared/vue.BVj9lWBK.cjs +111 -0
  28. package/dist/shared/vue.BY0qpgYr.cjs +35 -0
  29. package/dist/shared/vue.Bfu1dCKe.mjs +10 -0
  30. package/dist/shared/vue.Bk5xjlUx.cjs +61 -0
  31. package/dist/shared/{vue.BtUKvuQw.mjs → vue.BsGwt78R.mjs} +2 -2
  32. package/dist/shared/{vue.BbX3ePDY.cjs → vue.Bwd1sGAM.cjs} +9 -10
  33. package/dist/shared/vue.ByxbBC3y.mjs +57 -0
  34. package/dist/shared/{vue.CPjEwHSg.mjs → vue.C13umiQi.mjs} +20 -8
  35. package/dist/shared/vue.C5FVoEZT.mjs +99 -0
  36. package/dist/shared/vue.CATOh_9G.mjs +42 -0
  37. package/dist/shared/{vue.Bhdhmz8d.cjs → vue.CIs8QhCw.cjs} +18 -74
  38. package/dist/shared/vue.CMohL_Cz.mjs +58 -0
  39. package/dist/shared/{vue.CYKT65tB.mjs → vue.CQh3AUE8.mjs} +2 -6
  40. package/dist/shared/{vue.DzKfcfpX.cjs → vue.CWZSMVnB.cjs} +6 -6
  41. package/dist/shared/{vue.B12Pt1PQ.mjs → vue.CXB4NEMA.mjs} +18 -74
  42. package/dist/shared/{vue.DFbay4mm.mjs → vue.C_4qJDiF.mjs} +1 -1
  43. package/dist/shared/vue.CoaIWGPT.cjs +38 -0
  44. package/dist/shared/vue.CogzzQXM.mjs +171 -0
  45. package/dist/shared/vue.CpkwC8Th.mjs +7 -0
  46. package/dist/shared/vue.CrkK_T15.cjs +86 -0
  47. package/dist/shared/vue.D-qi8PSL.cjs +82 -0
  48. package/dist/shared/{vue.B2AQR2bE.mjs → vue.D218Ow7t.mjs} +8 -4
  49. package/dist/shared/{vue.QHAHFnw8.mjs → vue.D3Y0PWbF.mjs} +3 -3
  50. package/dist/shared/vue.D5U1yLG3.mjs +83 -0
  51. package/dist/shared/{vue.j1vB3h1n.cjs → vue.DAg5wC1G.cjs} +9 -9
  52. package/dist/shared/vue.DDbVk0Zh.cjs +180 -0
  53. package/dist/shared/{vue.BE4KHksm.cjs → vue.DE3emjSF.cjs} +2 -7
  54. package/dist/shared/vue.DEHxNvUX.cjs +7 -0
  55. package/dist/shared/vue.DFaMJLAQ.cjs +60 -0
  56. package/dist/shared/vue.DImwKTwJ.mjs +103 -0
  57. package/dist/shared/{vue.G9t8pE0J.cjs → vue.DKyQ7J67.cjs} +1 -1
  58. package/dist/shared/vue.DNxOpDXz.cjs +12 -0
  59. package/dist/shared/vue.DXQVIRZA.mjs +174 -0
  60. package/dist/shared/vue.DYk0Xfr3.mjs +36 -0
  61. package/dist/shared/vue.D_P5SqqD.mjs +5 -0
  62. package/dist/shared/{vue.B14U1xmP.cjs → vue.Di7yjJ-R.cjs} +20 -8
  63. package/dist/shared/vue.DtCbCcPd.cjs +173 -0
  64. package/dist/shared/{vue.CM_uqVc0.mjs → vue.Dyi1OCI1.mjs} +6 -6
  65. package/dist/shared/{vue.BsD6AAmO.cjs → vue.E_npPFoV.cjs} +8 -8
  66. package/dist/shared/{vue.LNhX07HB.cjs → vue.FiMmnMHr.cjs} +2 -2
  67. package/dist/shared/{vue.CSzg70vB.mjs → vue.JUWqu6kD.mjs} +1 -1
  68. package/dist/shared/{vue.By1CUlOU.mjs → vue.Mxc8w6Qk.mjs} +1 -1
  69. package/dist/shared/{vue.ByUemLSf.cjs → vue.Sbbm9JSu.cjs} +3 -3
  70. package/dist/shared/vue.g8fnm_ca.cjs +45 -0
  71. package/dist/swr.cjs +136 -0
  72. package/dist/swr.d.cts +41 -0
  73. package/dist/swr.d.mts +41 -0
  74. package/dist/swr.d.ts +41 -0
  75. package/dist/swr.mjs +131 -0
  76. package/dist/useAccountInfo.cjs +7 -5
  77. package/dist/useAccountInfo.d.cts +12 -8
  78. package/dist/useAccountInfo.d.mts +12 -8
  79. package/dist/useAccountInfo.d.ts +12 -8
  80. package/dist/useAccountInfo.mjs +7 -5
  81. package/dist/useAction.cjs +9 -0
  82. package/dist/useAction.d.cts +45 -0
  83. package/dist/useAction.d.mts +45 -0
  84. package/dist/useAction.d.ts +45 -0
  85. package/dist/useAction.mjs +3 -0
  86. package/dist/useBalance.cjs +5 -4
  87. package/dist/useBalance.d.cts +4 -2
  88. package/dist/useBalance.d.mts +4 -2
  89. package/dist/useBalance.d.ts +4 -2
  90. package/dist/useBalance.mjs +5 -4
  91. package/dist/useClientCapability.cjs +12 -0
  92. package/dist/useClientCapability.d.cts +39 -0
  93. package/dist/useClientCapability.d.mts +39 -0
  94. package/dist/useClientCapability.d.ts +39 -0
  95. package/dist/useClientCapability.mjs +5 -0
  96. package/dist/useConnection.cjs +4 -3
  97. package/dist/useConnection.d.cts +9 -2
  98. package/dist/useConnection.d.mts +9 -2
  99. package/dist/useConnection.d.ts +9 -2
  100. package/dist/useConnection.mjs +4 -3
  101. package/dist/useIdentity.cjs +12 -0
  102. package/dist/useIdentity.d.cts +3 -0
  103. package/dist/useIdentity.d.mts +3 -0
  104. package/dist/useIdentity.d.ts +3 -0
  105. package/dist/useIdentity.mjs +6 -0
  106. package/dist/usePayer.cjs +13 -0
  107. package/dist/usePayer.d.cts +18 -0
  108. package/dist/usePayer.d.mts +18 -0
  109. package/dist/usePayer.d.ts +18 -0
  110. package/dist/usePayer.mjs +6 -0
  111. package/dist/usePlanTransaction.cjs +14 -0
  112. package/dist/usePlanTransaction.d.cts +37 -0
  113. package/dist/usePlanTransaction.d.mts +37 -0
  114. package/dist/usePlanTransaction.d.ts +37 -0
  115. package/dist/usePlanTransaction.mjs +7 -0
  116. package/dist/usePlanTransactions.cjs +13 -0
  117. package/dist/usePlanTransactions.d.cts +4 -0
  118. package/dist/usePlanTransactions.d.mts +4 -0
  119. package/dist/usePlanTransactions.d.ts +4 -0
  120. package/dist/usePlanTransactions.mjs +7 -0
  121. package/dist/useProgramAccounts.cjs +7 -5
  122. package/dist/useProgramAccounts.d.cts +24 -9
  123. package/dist/useProgramAccounts.d.mts +24 -9
  124. package/dist/useProgramAccounts.d.ts +24 -9
  125. package/dist/useProgramAccounts.mjs +7 -5
  126. package/dist/useRequest.cjs +11 -0
  127. package/dist/useRequest.d.cts +57 -0
  128. package/dist/useRequest.d.mts +57 -0
  129. package/dist/useRequest.d.ts +57 -0
  130. package/dist/useRequest.mjs +5 -0
  131. package/dist/useRpc.cjs +3 -2
  132. package/dist/useRpc.d.cts +5 -2
  133. package/dist/useRpc.d.mts +5 -2
  134. package/dist/useRpc.d.ts +5 -2
  135. package/dist/useRpc.mjs +3 -2
  136. package/dist/useSelectedWalletAccount.cjs +13 -0
  137. package/dist/useSelectedWalletAccount.d.cts +117 -0
  138. package/dist/useSelectedWalletAccount.d.mts +117 -0
  139. package/dist/useSelectedWalletAccount.d.ts +117 -0
  140. package/dist/useSelectedWalletAccount.mjs +3 -0
  141. package/dist/useSignAndSendTransaction.cjs +7 -6
  142. package/dist/useSignAndSendTransaction.d.cts +18 -24
  143. package/dist/useSignAndSendTransaction.d.mts +18 -24
  144. package/dist/useSignAndSendTransaction.d.ts +18 -24
  145. package/dist/useSignAndSendTransaction.mjs +7 -6
  146. package/dist/useSignAndSendTransactions.cjs +15 -0
  147. package/dist/useSignAndSendTransactions.d.cts +35 -0
  148. package/dist/useSignAndSendTransactions.d.mts +35 -0
  149. package/dist/useSignAndSendTransactions.d.ts +35 -0
  150. package/dist/useSignAndSendTransactions.mjs +8 -0
  151. package/dist/useSignIn.cjs +13 -0
  152. package/dist/useSignIn.d.cts +23 -0
  153. package/dist/useSignIn.d.mts +23 -0
  154. package/dist/useSignIn.d.ts +23 -0
  155. package/dist/useSignIn.mjs +7 -0
  156. package/dist/useSignMessage.cjs +4 -3
  157. package/dist/useSignMessage.mjs +4 -3
  158. package/dist/useSignTransactions.cjs +13 -0
  159. package/dist/useSignTransactions.d.cts +24 -0
  160. package/dist/useSignTransactions.d.mts +24 -0
  161. package/dist/useSignTransactions.d.ts +24 -0
  162. package/dist/useSignTransactions.mjs +7 -0
  163. package/dist/useSignatureStatus.cjs +5 -4
  164. package/dist/useSignatureStatus.d.cts +9 -5
  165. package/dist/useSignatureStatus.d.mts +9 -5
  166. package/dist/useSignatureStatus.d.ts +9 -5
  167. package/dist/useSignatureStatus.mjs +5 -4
  168. package/dist/useSolana.cjs +2 -1
  169. package/dist/useSolana.mjs +2 -1
  170. package/dist/useSolanaClient.cjs +3 -2
  171. package/dist/useSolanaClient.mjs +3 -2
  172. package/dist/useSubscription.cjs +9 -0
  173. package/dist/useSubscription.d.cts +58 -0
  174. package/dist/useSubscription.d.mts +58 -0
  175. package/dist/useSubscription.d.ts +58 -0
  176. package/dist/useSubscription.mjs +3 -0
  177. package/dist/useTokenAccounts.cjs +7 -6
  178. package/dist/useTokenAccounts.d.cts +6 -6
  179. package/dist/useTokenAccounts.d.mts +6 -6
  180. package/dist/useTokenAccounts.d.ts +6 -6
  181. package/dist/useTokenAccounts.mjs +7 -6
  182. package/dist/useTokenBalance.cjs +7 -6
  183. package/dist/useTokenBalance.d.cts +2 -2
  184. package/dist/useTokenBalance.d.mts +2 -2
  185. package/dist/useTokenBalance.d.ts +2 -2
  186. package/dist/useTokenBalance.mjs +7 -6
  187. package/dist/useTrackedData.cjs +10 -0
  188. package/dist/useTrackedData.d.cts +86 -0
  189. package/dist/useTrackedData.d.mts +86 -0
  190. package/dist/useTrackedData.d.ts +86 -0
  191. package/dist/useTrackedData.mjs +4 -0
  192. package/dist/useTransaction.cjs +2 -1
  193. package/dist/useTransaction.d.cts +13 -3
  194. package/dist/useTransaction.d.mts +13 -3
  195. package/dist/useTransaction.d.ts +13 -3
  196. package/dist/useTransaction.mjs +2 -1
  197. package/dist/useTransactionConfirmation.cjs +5 -4
  198. package/dist/useTransactionConfirmation.d.cts +18 -24
  199. package/dist/useTransactionConfirmation.d.mts +18 -24
  200. package/dist/useTransactionConfirmation.d.ts +18 -24
  201. package/dist/useTransactionConfirmation.mjs +5 -4
  202. package/dist/useWallet.cjs +3 -2
  203. package/dist/useWallet.d.cts +2 -2
  204. package/dist/useWallet.d.mts +2 -2
  205. package/dist/useWallet.d.ts +2 -2
  206. package/dist/useWallet.mjs +3 -2
  207. package/dist/useWallets.cjs +3 -2
  208. package/dist/useWallets.mjs +3 -2
  209. package/package.json +73 -9
  210. package/dist/shared/vue.C4d2JA8U.mjs +0 -44
  211. package/dist/shared/vue.CE5i8KZZ.cjs +0 -46
  212. package/dist/shared/vue.CfrVAzEf.mjs +0 -129
  213. package/dist/shared/vue.DCgByzxg.cjs +0 -9
  214. package/dist/shared/vue.DiNn3XHm.mjs +0 -7
  215. package/dist/shared/vue._CAClzAz.cjs +0 -131
  216. package/dist/web3.cjs +0 -13
  217. package/dist/web3.d.cts +0 -1
  218. package/dist/web3.d.mts +0 -1
  219. package/dist/web3.d.ts +0 -1
  220. package/dist/web3.mjs +0 -1
@@ -1,22 +1,26 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import { Commitment, TransactionSignature, SignatureStatus } from '@vue-solana/core/web3';
3
+ import { Commitment } from '@vue-solana/core/kit';
4
4
  import { SolanaError } from '@vue-solana/core/errors';
5
5
 
6
6
  interface UseSignatureStatusOptions {
7
7
  commitment?: Commitment;
8
8
  pollIntervalMs?: number;
9
9
  searchTransactionHistory?: boolean;
10
- subscribe?: boolean;
11
10
  }
12
- declare function useSignatureStatus(signature: MaybeRefOrGetter<TransactionSignature | null | undefined>, options?: UseSignatureStatusOptions): {
11
+ interface SignatureStatus {
12
+ slot: number;
13
+ confirmations: number | null;
14
+ err: unknown | null;
15
+ confirmationStatus: Commitment | null;
16
+ }
17
+ declare function useSignatureStatus(signature: MaybeRefOrGetter<string | null | undefined>, options?: UseSignatureStatusOptions): {
13
18
  status: vue.ShallowRef<SignatureStatus | null, SignatureStatus | null>;
14
19
  loading: vue.ShallowRef<boolean, boolean>;
15
20
  error: vue.ShallowRef<SolanaError | null, SolanaError | null>;
16
21
  refresh: () => Promise<SignatureStatus | null>;
17
22
  stopPolling: () => void;
18
- stopSubscription: () => Promise<void>;
19
23
  };
20
24
 
21
25
  export { useSignatureStatus };
22
- export type { UseSignatureStatusOptions };
26
+ export type { SignatureStatus, UseSignatureStatusOptions };
@@ -1,22 +1,26 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import { Commitment, TransactionSignature, SignatureStatus } from '@vue-solana/core/web3';
3
+ import { Commitment } from '@vue-solana/core/kit';
4
4
  import { SolanaError } from '@vue-solana/core/errors';
5
5
 
6
6
  interface UseSignatureStatusOptions {
7
7
  commitment?: Commitment;
8
8
  pollIntervalMs?: number;
9
9
  searchTransactionHistory?: boolean;
10
- subscribe?: boolean;
11
10
  }
12
- declare function useSignatureStatus(signature: MaybeRefOrGetter<TransactionSignature | null | undefined>, options?: UseSignatureStatusOptions): {
11
+ interface SignatureStatus {
12
+ slot: number;
13
+ confirmations: number | null;
14
+ err: unknown | null;
15
+ confirmationStatus: Commitment | null;
16
+ }
17
+ declare function useSignatureStatus(signature: MaybeRefOrGetter<string | null | undefined>, options?: UseSignatureStatusOptions): {
13
18
  status: vue.ShallowRef<SignatureStatus | null, SignatureStatus | null>;
14
19
  loading: vue.ShallowRef<boolean, boolean>;
15
20
  error: vue.ShallowRef<SolanaError | null, SolanaError | null>;
16
21
  refresh: () => Promise<SignatureStatus | null>;
17
22
  stopPolling: () => void;
18
- stopSubscription: () => Promise<void>;
19
23
  };
20
24
 
21
25
  export { useSignatureStatus };
22
- export type { UseSignatureStatusOptions };
26
+ export type { SignatureStatus, UseSignatureStatusOptions };
@@ -1,7 +1,8 @@
1
- export { u as useSignatureStatus } from './shared/vue.B12Pt1PQ.mjs';
1
+ export { u as useSignatureStatus } from './shared/vue.CXB4NEMA.mjs';
2
2
  import '@vue-solana/core/errors';
3
3
  import 'bs58';
4
4
  import 'vue';
5
- import './shared/vue.DiNn3XHm.mjs';
6
- import './shared/vue.BtUKvuQw.mjs';
7
- import './shared/vue.CYKT65tB.mjs';
5
+ import './shared/vue.CpkwC8Th.mjs';
6
+ import './shared/vue.Mxc8w6Qk.mjs';
7
+ import './shared/vue.CQh3AUE8.mjs';
8
+ import './shared/vue.D_P5SqqD.mjs';
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const useSolana = require('./shared/vue.BE4KHksm.cjs');
3
+ const useSolana = require('./shared/vue.DE3emjSF.cjs');
4
4
  require('vue');
5
+ require('./shared/vue.DEHxNvUX.cjs');
5
6
 
6
7
 
7
8
 
@@ -1,2 +1,3 @@
1
- export { t as tryUseSolana, u as useSolana } from './shared/vue.CYKT65tB.mjs';
1
+ export { t as tryUseSolana, u as useSolana } from './shared/vue.CQh3AUE8.mjs';
2
2
  import 'vue';
3
+ import './shared/vue.D_P5SqqD.mjs';
@@ -1,8 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const useSolanaClient = require('./shared/vue.COPnX5fq.cjs');
4
- require('./shared/vue.BE4KHksm.cjs');
3
+ const useSolanaClient = require('./shared/vue.BIxphCAq.cjs');
4
+ require('./shared/vue.DE3emjSF.cjs');
5
5
  require('vue');
6
+ require('./shared/vue.DEHxNvUX.cjs');
6
7
 
7
8
 
8
9
 
@@ -1,3 +1,4 @@
1
- export { u as useSolanaClient } from './shared/vue.By1CUlOU.mjs';
2
- import './shared/vue.CYKT65tB.mjs';
1
+ export { u as useSolanaClient } from './shared/vue.Mxc8w6Qk.mjs';
2
+ import './shared/vue.CQh3AUE8.mjs';
3
3
  import 'vue';
4
+ import './shared/vue.D_P5SqqD.mjs';
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+
3
+ const useSubscription = require('./shared/vue.BVj9lWBK.cjs');
4
+ require('@vue-solana/core/errors');
5
+ require('vue');
6
+
7
+
8
+
9
+ exports.useSubscription = useSubscription.useSubscription;
@@ -0,0 +1,58 @@
1
+ import { SolanaError } from '@vue-solana/core/errors';
2
+ import { ReactiveStreamStore } from '@vue-solana/core/kit';
3
+ import { ComputedRef, Ref } from 'vue';
4
+
5
+ type UseSubscriptionStatus = "loading" | "loaded" | "error" | "disabled";
6
+ /**
7
+ * A subscription source accepted by `useSubscription`:
8
+ *
9
+ * - a Kit reactive stream source such as `PendingRpcSubscriptionsRequest`
10
+ * (for example `rpcSubscriptions.accountNotifications(address)`),
11
+ * - a `ref`/`computed` of a source or `null` to disable, or
12
+ * - `null` to disable outright.
13
+ */
14
+ type UseSubscriptionSource<TResult> = {
15
+ reactiveStore: () => ReactiveStreamStore<TResult>;
16
+ } | Ref<{
17
+ reactiveStore: () => ReactiveStreamStore<TResult>;
18
+ } | null | undefined> | null | undefined;
19
+ interface UseSubscriptionOptions {
20
+ /**
21
+ * Returns a caller-provided `AbortSignal` per connection (for example
22
+ * `AbortSignal.timeout(30_000)`), composed with the per-connection signal by
23
+ * the underlying store. Aborting it fails the connection with the abort
24
+ * reason without touching other state.
25
+ */
26
+ getAbortSignal?: (connection: number) => AbortSignal | null | undefined;
27
+ /**
28
+ * Called when the subscription transitions into `error`.
29
+ */
30
+ onError?: (error: unknown) => void;
31
+ }
32
+ interface UseSubscriptionReturn<TResult> {
33
+ data: ComputedRef<TResult | undefined>;
34
+ error: ComputedRef<SolanaError | null>;
35
+ reconnect: () => void;
36
+ status: ComputedRef<UseSubscriptionStatus>;
37
+ }
38
+ /**
39
+ * Live data from RPC subscriptions and other reactive stream sources.
40
+ *
41
+ * Accepts a Kit reactive stream source (duck-typed on `reactiveStore()`),
42
+ * bridges its `{ subscribe, getState }` contract into Vue reactive state, and
43
+ * tears the connection down when the component unmounts.
44
+ *
45
+ * Status set: `loading` | `loaded` | `error` | `disabled`.
46
+ *
47
+ * - A `null` source disables the subscription and clears state.
48
+ * - `reconnect()` re-opens the connection with stale-while-revalidate: the
49
+ * last known `data` stays visible until fresh data arrives.
50
+ * - Errors preserve the last known `data`; only the first error per connection
51
+ * window is captured (matching the underlying store's contract).
52
+ * - Changing a ref/computed source tears down the previous subscription and
53
+ * connects to the new one.
54
+ */
55
+ declare function useSubscription<TResult>(source: UseSubscriptionSource<TResult>, options?: UseSubscriptionOptions): UseSubscriptionReturn<TResult>;
56
+
57
+ export { useSubscription };
58
+ export type { UseSubscriptionOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus };
@@ -0,0 +1,58 @@
1
+ import { SolanaError } from '@vue-solana/core/errors';
2
+ import { ReactiveStreamStore } from '@vue-solana/core/kit';
3
+ import { ComputedRef, Ref } from 'vue';
4
+
5
+ type UseSubscriptionStatus = "loading" | "loaded" | "error" | "disabled";
6
+ /**
7
+ * A subscription source accepted by `useSubscription`:
8
+ *
9
+ * - a Kit reactive stream source such as `PendingRpcSubscriptionsRequest`
10
+ * (for example `rpcSubscriptions.accountNotifications(address)`),
11
+ * - a `ref`/`computed` of a source or `null` to disable, or
12
+ * - `null` to disable outright.
13
+ */
14
+ type UseSubscriptionSource<TResult> = {
15
+ reactiveStore: () => ReactiveStreamStore<TResult>;
16
+ } | Ref<{
17
+ reactiveStore: () => ReactiveStreamStore<TResult>;
18
+ } | null | undefined> | null | undefined;
19
+ interface UseSubscriptionOptions {
20
+ /**
21
+ * Returns a caller-provided `AbortSignal` per connection (for example
22
+ * `AbortSignal.timeout(30_000)`), composed with the per-connection signal by
23
+ * the underlying store. Aborting it fails the connection with the abort
24
+ * reason without touching other state.
25
+ */
26
+ getAbortSignal?: (connection: number) => AbortSignal | null | undefined;
27
+ /**
28
+ * Called when the subscription transitions into `error`.
29
+ */
30
+ onError?: (error: unknown) => void;
31
+ }
32
+ interface UseSubscriptionReturn<TResult> {
33
+ data: ComputedRef<TResult | undefined>;
34
+ error: ComputedRef<SolanaError | null>;
35
+ reconnect: () => void;
36
+ status: ComputedRef<UseSubscriptionStatus>;
37
+ }
38
+ /**
39
+ * Live data from RPC subscriptions and other reactive stream sources.
40
+ *
41
+ * Accepts a Kit reactive stream source (duck-typed on `reactiveStore()`),
42
+ * bridges its `{ subscribe, getState }` contract into Vue reactive state, and
43
+ * tears the connection down when the component unmounts.
44
+ *
45
+ * Status set: `loading` | `loaded` | `error` | `disabled`.
46
+ *
47
+ * - A `null` source disables the subscription and clears state.
48
+ * - `reconnect()` re-opens the connection with stale-while-revalidate: the
49
+ * last known `data` stays visible until fresh data arrives.
50
+ * - Errors preserve the last known `data`; only the first error per connection
51
+ * window is captured (matching the underlying store's contract).
52
+ * - Changing a ref/computed source tears down the previous subscription and
53
+ * connects to the new one.
54
+ */
55
+ declare function useSubscription<TResult>(source: UseSubscriptionSource<TResult>, options?: UseSubscriptionOptions): UseSubscriptionReturn<TResult>;
56
+
57
+ export { useSubscription };
58
+ export type { UseSubscriptionOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus };
@@ -0,0 +1,58 @@
1
+ import { SolanaError } from '@vue-solana/core/errors';
2
+ import { ReactiveStreamStore } from '@vue-solana/core/kit';
3
+ import { ComputedRef, Ref } from 'vue';
4
+
5
+ type UseSubscriptionStatus = "loading" | "loaded" | "error" | "disabled";
6
+ /**
7
+ * A subscription source accepted by `useSubscription`:
8
+ *
9
+ * - a Kit reactive stream source such as `PendingRpcSubscriptionsRequest`
10
+ * (for example `rpcSubscriptions.accountNotifications(address)`),
11
+ * - a `ref`/`computed` of a source or `null` to disable, or
12
+ * - `null` to disable outright.
13
+ */
14
+ type UseSubscriptionSource<TResult> = {
15
+ reactiveStore: () => ReactiveStreamStore<TResult>;
16
+ } | Ref<{
17
+ reactiveStore: () => ReactiveStreamStore<TResult>;
18
+ } | null | undefined> | null | undefined;
19
+ interface UseSubscriptionOptions {
20
+ /**
21
+ * Returns a caller-provided `AbortSignal` per connection (for example
22
+ * `AbortSignal.timeout(30_000)`), composed with the per-connection signal by
23
+ * the underlying store. Aborting it fails the connection with the abort
24
+ * reason without touching other state.
25
+ */
26
+ getAbortSignal?: (connection: number) => AbortSignal | null | undefined;
27
+ /**
28
+ * Called when the subscription transitions into `error`.
29
+ */
30
+ onError?: (error: unknown) => void;
31
+ }
32
+ interface UseSubscriptionReturn<TResult> {
33
+ data: ComputedRef<TResult | undefined>;
34
+ error: ComputedRef<SolanaError | null>;
35
+ reconnect: () => void;
36
+ status: ComputedRef<UseSubscriptionStatus>;
37
+ }
38
+ /**
39
+ * Live data from RPC subscriptions and other reactive stream sources.
40
+ *
41
+ * Accepts a Kit reactive stream source (duck-typed on `reactiveStore()`),
42
+ * bridges its `{ subscribe, getState }` contract into Vue reactive state, and
43
+ * tears the connection down when the component unmounts.
44
+ *
45
+ * Status set: `loading` | `loaded` | `error` | `disabled`.
46
+ *
47
+ * - A `null` source disables the subscription and clears state.
48
+ * - `reconnect()` re-opens the connection with stale-while-revalidate: the
49
+ * last known `data` stays visible until fresh data arrives.
50
+ * - Errors preserve the last known `data`; only the first error per connection
51
+ * window is captured (matching the underlying store's contract).
52
+ * - Changing a ref/computed source tears down the previous subscription and
53
+ * connects to the new one.
54
+ */
55
+ declare function useSubscription<TResult>(source: UseSubscriptionSource<TResult>, options?: UseSubscriptionOptions): UseSubscriptionReturn<TResult>;
56
+
57
+ export { useSubscription };
58
+ export type { UseSubscriptionOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus };
@@ -0,0 +1,3 @@
1
+ export { u as useSubscription } from './shared/vue.B8ub540p.mjs';
2
+ import '@vue-solana/core/errors';
3
+ import 'vue';
@@ -1,13 +1,14 @@
1
1
  'use strict';
2
2
 
3
- const useTokenAccounts = require('./shared/vue.BbX3ePDY.cjs');
4
- require('@vue-solana/core/address');
5
- require('@vue-solana/core/errors');
3
+ const useTokenAccounts = require('./shared/vue.Bwd1sGAM.cjs');
6
4
  require('@vue-solana/core/token-accounts');
5
+ require('@vue-solana/core/errors');
6
+ require('@vue-solana/core/address');
7
7
  require('vue');
8
- require('./shared/vue.DCgByzxg.cjs');
9
- require('./shared/vue.LNhX07HB.cjs');
10
- require('./shared/vue.BE4KHksm.cjs');
8
+ require('./shared/vue.BVaMoz9y.cjs');
9
+ require('./shared/vue.BIxphCAq.cjs');
10
+ require('./shared/vue.DE3emjSF.cjs');
11
+ require('./shared/vue.DEHxNvUX.cjs');
11
12
 
12
13
 
13
14
 
@@ -1,18 +1,18 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import { Commitment, PublicKey } from '@vue-solana/core/web3';
4
- import { TokenAccount } from '@vue-solana/core/spl-token';
3
+ import { Commitment, Address } from '@vue-solana/core/kit';
4
+ import { TokenAccountInfo } from '@vue-solana/core/token-accounts';
5
5
  import { SolanaError } from '@vue-solana/core/errors';
6
6
 
7
7
  interface UseTokenAccountsOptions {
8
8
  commitment?: Commitment;
9
- programId?: PublicKey;
9
+ programId?: Address;
10
10
  }
11
- declare function useTokenAccounts(owner: MaybeRefOrGetter<PublicKey | string | null | undefined>, options?: UseTokenAccountsOptions): {
12
- tokenAccounts: vue.ShallowRef<TokenAccount[], TokenAccount[]>;
11
+ declare function useTokenAccounts(owner: MaybeRefOrGetter<Address | string | null | undefined>, options?: UseTokenAccountsOptions): {
12
+ tokenAccounts: vue.ShallowRef<TokenAccountInfo[], TokenAccountInfo[]>;
13
13
  loading: vue.ShallowRef<boolean, boolean>;
14
14
  error: vue.ShallowRef<SolanaError | null, SolanaError | null>;
15
- refresh: () => Promise<TokenAccount[] | null>;
15
+ refresh: () => Promise<TokenAccountInfo[] | null>;
16
16
  };
17
17
 
18
18
  export { useTokenAccounts };
@@ -1,18 +1,18 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import { Commitment, PublicKey } from '@vue-solana/core/web3';
4
- import { TokenAccount } from '@vue-solana/core/spl-token';
3
+ import { Commitment, Address } from '@vue-solana/core/kit';
4
+ import { TokenAccountInfo } from '@vue-solana/core/token-accounts';
5
5
  import { SolanaError } from '@vue-solana/core/errors';
6
6
 
7
7
  interface UseTokenAccountsOptions {
8
8
  commitment?: Commitment;
9
- programId?: PublicKey;
9
+ programId?: Address;
10
10
  }
11
- declare function useTokenAccounts(owner: MaybeRefOrGetter<PublicKey | string | null | undefined>, options?: UseTokenAccountsOptions): {
12
- tokenAccounts: vue.ShallowRef<TokenAccount[], TokenAccount[]>;
11
+ declare function useTokenAccounts(owner: MaybeRefOrGetter<Address | string | null | undefined>, options?: UseTokenAccountsOptions): {
12
+ tokenAccounts: vue.ShallowRef<TokenAccountInfo[], TokenAccountInfo[]>;
13
13
  loading: vue.ShallowRef<boolean, boolean>;
14
14
  error: vue.ShallowRef<SolanaError | null, SolanaError | null>;
15
- refresh: () => Promise<TokenAccount[] | null>;
15
+ refresh: () => Promise<TokenAccountInfo[] | null>;
16
16
  };
17
17
 
18
18
  export { useTokenAccounts };
@@ -1,18 +1,18 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import { Commitment, PublicKey } from '@vue-solana/core/web3';
4
- import { TokenAccount } from '@vue-solana/core/spl-token';
3
+ import { Commitment, Address } from '@vue-solana/core/kit';
4
+ import { TokenAccountInfo } from '@vue-solana/core/token-accounts';
5
5
  import { SolanaError } from '@vue-solana/core/errors';
6
6
 
7
7
  interface UseTokenAccountsOptions {
8
8
  commitment?: Commitment;
9
- programId?: PublicKey;
9
+ programId?: Address;
10
10
  }
11
- declare function useTokenAccounts(owner: MaybeRefOrGetter<PublicKey | string | null | undefined>, options?: UseTokenAccountsOptions): {
12
- tokenAccounts: vue.ShallowRef<TokenAccount[], TokenAccount[]>;
11
+ declare function useTokenAccounts(owner: MaybeRefOrGetter<Address | string | null | undefined>, options?: UseTokenAccountsOptions): {
12
+ tokenAccounts: vue.ShallowRef<TokenAccountInfo[], TokenAccountInfo[]>;
13
13
  loading: vue.ShallowRef<boolean, boolean>;
14
14
  error: vue.ShallowRef<SolanaError | null, SolanaError | null>;
15
- refresh: () => Promise<TokenAccount[] | null>;
15
+ refresh: () => Promise<TokenAccountInfo[] | null>;
16
16
  };
17
17
 
18
18
  export { useTokenAccounts };
@@ -1,8 +1,9 @@
1
- export { u as useTokenAccounts } from './shared/vue.CKTUFwSI.mjs';
2
- import '@vue-solana/core/address';
3
- import '@vue-solana/core/errors';
1
+ export { u as useTokenAccounts } from './shared/vue.BOpgWr43.mjs';
4
2
  import '@vue-solana/core/token-accounts';
3
+ import '@vue-solana/core/errors';
4
+ import '@vue-solana/core/address';
5
5
  import 'vue';
6
- import './shared/vue.DiNn3XHm.mjs';
7
- import './shared/vue.BtUKvuQw.mjs';
8
- import './shared/vue.CYKT65tB.mjs';
6
+ import './shared/vue.CpkwC8Th.mjs';
7
+ import './shared/vue.Mxc8w6Qk.mjs';
8
+ import './shared/vue.CQh3AUE8.mjs';
9
+ import './shared/vue.D_P5SqqD.mjs';
@@ -1,13 +1,14 @@
1
1
  'use strict';
2
2
 
3
- const useTokenBalance = require('./shared/vue.j1vB3h1n.cjs');
4
- require('@vue-solana/core/address');
5
- require('@vue-solana/core/errors');
3
+ const useTokenBalance = require('./shared/vue.DAg5wC1G.cjs');
6
4
  require('@vue-solana/core/token-accounts');
5
+ require('@vue-solana/core/errors');
6
+ require('@vue-solana/core/address');
7
7
  require('vue');
8
- require('./shared/vue.DCgByzxg.cjs');
9
- require('./shared/vue.LNhX07HB.cjs');
10
- require('./shared/vue.BE4KHksm.cjs');
8
+ require('./shared/vue.BVaMoz9y.cjs');
9
+ require('./shared/vue.BIxphCAq.cjs');
10
+ require('./shared/vue.DE3emjSF.cjs');
11
+ require('./shared/vue.DEHxNvUX.cjs');
11
12
 
12
13
 
13
14
 
@@ -1,10 +1,10 @@
1
1
  import * as _vue_solana_core_token_accounts from '@vue-solana/core/token-accounts';
2
2
  import * as vue from 'vue';
3
3
  import { MaybeRefOrGetter } from 'vue';
4
- import { PublicKey } from '@vue-solana/core/web3';
4
+ import { Commitment } from '@vue-solana/core/kit';
5
5
  import { SolanaError } from '@vue-solana/core/errors';
6
6
 
7
- declare function useTokenBalance(mint: MaybeRefOrGetter<PublicKey | string | null | undefined>, owner: MaybeRefOrGetter<PublicKey | string | null | undefined>): {
7
+ declare function useTokenBalance(mint: MaybeRefOrGetter<string | null | undefined>, owner: MaybeRefOrGetter<string | null | undefined>, commitment?: Commitment): {
8
8
  balance: vue.ShallowRef<bigint | null, bigint | null>;
9
9
  decimals: vue.ShallowRef<number | null, number | null>;
10
10
  loading: vue.ShallowRef<boolean, boolean>;
@@ -1,10 +1,10 @@
1
1
  import * as _vue_solana_core_token_accounts from '@vue-solana/core/token-accounts';
2
2
  import * as vue from 'vue';
3
3
  import { MaybeRefOrGetter } from 'vue';
4
- import { PublicKey } from '@vue-solana/core/web3';
4
+ import { Commitment } from '@vue-solana/core/kit';
5
5
  import { SolanaError } from '@vue-solana/core/errors';
6
6
 
7
- declare function useTokenBalance(mint: MaybeRefOrGetter<PublicKey | string | null | undefined>, owner: MaybeRefOrGetter<PublicKey | string | null | undefined>): {
7
+ declare function useTokenBalance(mint: MaybeRefOrGetter<string | null | undefined>, owner: MaybeRefOrGetter<string | null | undefined>, commitment?: Commitment): {
8
8
  balance: vue.ShallowRef<bigint | null, bigint | null>;
9
9
  decimals: vue.ShallowRef<number | null, number | null>;
10
10
  loading: vue.ShallowRef<boolean, boolean>;
@@ -1,10 +1,10 @@
1
1
  import * as _vue_solana_core_token_accounts from '@vue-solana/core/token-accounts';
2
2
  import * as vue from 'vue';
3
3
  import { MaybeRefOrGetter } from 'vue';
4
- import { PublicKey } from '@vue-solana/core/web3';
4
+ import { Commitment } from '@vue-solana/core/kit';
5
5
  import { SolanaError } from '@vue-solana/core/errors';
6
6
 
7
- declare function useTokenBalance(mint: MaybeRefOrGetter<PublicKey | string | null | undefined>, owner: MaybeRefOrGetter<PublicKey | string | null | undefined>): {
7
+ declare function useTokenBalance(mint: MaybeRefOrGetter<string | null | undefined>, owner: MaybeRefOrGetter<string | null | undefined>, commitment?: Commitment): {
8
8
  balance: vue.ShallowRef<bigint | null, bigint | null>;
9
9
  decimals: vue.ShallowRef<number | null, number | null>;
10
10
  loading: vue.ShallowRef<boolean, boolean>;
@@ -1,8 +1,9 @@
1
- export { u as useTokenBalance } from './shared/vue.D0ycWj82.mjs';
2
- import '@vue-solana/core/address';
3
- import '@vue-solana/core/errors';
1
+ export { u as useTokenBalance } from './shared/vue.BD6Gm1nl.mjs';
4
2
  import '@vue-solana/core/token-accounts';
3
+ import '@vue-solana/core/errors';
4
+ import '@vue-solana/core/address';
5
5
  import 'vue';
6
- import './shared/vue.DiNn3XHm.mjs';
7
- import './shared/vue.BtUKvuQw.mjs';
8
- import './shared/vue.CYKT65tB.mjs';
6
+ import './shared/vue.CpkwC8Th.mjs';
7
+ import './shared/vue.Mxc8w6Qk.mjs';
8
+ import './shared/vue.CQh3AUE8.mjs';
9
+ import './shared/vue.D_P5SqqD.mjs';
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ const useTrackedData = require('./shared/vue.DtCbCcPd.cjs');
4
+ require('@vue-solana/core/kit');
5
+ require('@vue-solana/core/errors');
6
+ require('vue');
7
+
8
+
9
+
10
+ exports.useTrackedData = useTrackedData.useTrackedData;
@@ -0,0 +1,86 @@
1
+ import { ReactiveActionSource, SolanaRpcResponse, ReactiveStreamSource, ReactiveStreamStore } from '@vue-solana/core/kit';
2
+ import { SolanaError } from '@vue-solana/core/errors';
3
+ import { ComputedRef, Ref } from 'vue';
4
+
5
+ type UseTrackedDataStatus = "loading" | "loaded" | "error" | "disabled";
6
+ type SendFn<TValue> = (options?: {
7
+ abortSignal?: AbortSignal;
8
+ }) => Promise<TValue>;
9
+ /**
10
+ * One-shot initial-value source (satisfied by `PendingRpcRequest`).
11
+ */
12
+ type UseTrackedDataInitialSource<TInitialValue> = ReactiveActionSource<SolanaRpcResponse<TInitialValue>> | {
13
+ send: SendFn<SolanaRpcResponse<TInitialValue>>;
14
+ };
15
+ /**
16
+ * Ongoing stream source (satisfied by `PendingRpcSubscriptionsRequest`).
17
+ */
18
+ type UseTrackedDataStreamSource<TStreamValue> = ReactiveStreamSource<SolanaRpcResponse<TStreamValue>> | {
19
+ reactiveStore: () => ReactiveStreamStore<SolanaRpcResponse<TStreamValue>>;
20
+ };
21
+ /**
22
+ * A `useTrackedData` source bundle. Every field accepts a plain source or a
23
+ * `ref`/`computed` of it; a `null`/`undefined` `rpcRequest` or
24
+ * `rpcSubscriptionRequest` disables the composable.
25
+ */
26
+ interface UseTrackedDataSource<TInitialValue, TStreamValue, TItem> {
27
+ /**
28
+ * One-shot RPC request for the initial value, for example
29
+ * `rpc.getBalance(address)`.
30
+ */
31
+ rpcRequest: UseTrackedDataInitialSource<TInitialValue> | Ref<UseTrackedDataInitialSource<TInitialValue> | null | undefined>;
32
+ /**
33
+ * RPC subscription request for live updates, for example
34
+ * `rpcSubscriptions.accountNotifications(address)`.
35
+ */
36
+ rpcSubscriptionRequest: UseTrackedDataStreamSource<TStreamValue> | Ref<UseTrackedDataStreamSource<TStreamValue> | null | undefined>;
37
+ /**
38
+ * Maps the initial fetch's response value to the stored item type.
39
+ */
40
+ rpcValueMapper: (value: TInitialValue) => TItem;
41
+ /**
42
+ * Maps a stream notification's value to the stored item type.
43
+ */
44
+ rpcSubscriptionValueMapper: (value: TStreamValue) => TItem;
45
+ }
46
+ interface UseTrackedDataOptions {
47
+ /**
48
+ * Returns a caller-provided `AbortSignal` per connection (for example
49
+ * `AbortSignal.timeout(60_000)`), composed with the per-connection signal
50
+ * by the underlying store. Aborting it fails the connection with the abort
51
+ * reason without touching other state.
52
+ */
53
+ getAbortSignal?: (connection: number) => AbortSignal | null | undefined;
54
+ /**
55
+ * Called when the tracked data transitions into `error`.
56
+ */
57
+ onError?: (error: unknown) => void;
58
+ }
59
+ interface UseTrackedDataReturn<TItem> {
60
+ /**
61
+ * The latest item, surface-mapped by `rpcValueMapper` /
62
+ * `rpcSubscriptionValueMapper`. The {@link SolanaRpcResponse} envelope is
63
+ * preserved so callers can read `data.value?.context.slot`.
64
+ */
65
+ data: ComputedRef<SolanaRpcResponse<TItem> | undefined>;
66
+ error: ComputedRef<SolanaError | null>;
67
+ refresh: () => void;
68
+ status: ComputedRef<UseTrackedDataStatus>;
69
+ }
70
+ /**
71
+ * Live RPC data seeded by a one-shot fetch, slot-deduplicated between the two
72
+ * sources so notifications and the initial response can arrive in any order
73
+ * without out-of-order regressions.
74
+ *
75
+ * - `refresh()` aborts the current connection and re-runs both the fetch and
76
+ * the subscription with stale-while-revalidate (last known `data` stays
77
+ * visible while loading).
78
+ * - A `null`/`undefined` source (or `ref` of one) disables the composable and
79
+ * clears state.
80
+ * - `getAbortSignal` attaches per-connection cancellation (timeouts, kill
81
+ * switches) on top of the internal per-connection signal.
82
+ */
83
+ declare function useTrackedData<TInitialValue, TStreamValue, TItem>(source: UseTrackedDataSource<TInitialValue, TStreamValue, TItem>, options?: UseTrackedDataOptions): UseTrackedDataReturn<TItem>;
84
+
85
+ export { useTrackedData };
86
+ export type { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource };