@vue-solana/vue 2.1.0 → 2.2.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 (46) hide show
  1. package/README.md +51 -0
  2. package/dist/index.cjs +5 -3
  3. package/dist/index.d.cts +4 -3
  4. package/dist/index.d.mts +4 -3
  5. package/dist/index.d.ts +4 -3
  6. package/dist/index.mjs +4 -3
  7. package/dist/shared/{vue.DImwKTwJ.mjs → vue.B8VvC8d2.mjs} +18 -20
  8. package/dist/shared/{vue.B8ub540p.mjs → vue.BDNOyiGZ.mjs} +7 -7
  9. package/dist/shared/vue.BSfiHqwj.mjs +34 -0
  10. package/dist/shared/vue.CTqPbvz3.cjs +36 -0
  11. package/dist/shared/{vue.CogzzQXM.mjs → vue.CbJFnho-.mjs} +4 -4
  12. package/dist/shared/{vue.DtCbCcPd.cjs → vue.DxM45azl.cjs} +4 -4
  13. package/dist/shared/{vue.B8pLQ8P4.cjs → vue.ZuUCEEab.cjs} +18 -20
  14. package/dist/shared/{vue.BVj9lWBK.cjs → vue.l3UCdN7z.cjs} +7 -7
  15. package/dist/swr.cjs +3 -3
  16. package/dist/swr.mjs +3 -3
  17. package/dist/useAirdrop.cjs +14 -0
  18. package/dist/useAirdrop.d.cts +25 -0
  19. package/dist/useAirdrop.d.mts +25 -0
  20. package/dist/useAirdrop.d.ts +25 -0
  21. package/dist/useAirdrop.mjs +8 -0
  22. package/dist/useConnection.d.cts +3 -2
  23. package/dist/useConnection.d.mts +3 -2
  24. package/dist/useConnection.d.ts +3 -2
  25. package/dist/useRequest.cjs +1 -1
  26. package/dist/useRequest.d.cts +22 -6
  27. package/dist/useRequest.d.mts +22 -6
  28. package/dist/useRequest.d.ts +22 -6
  29. package/dist/useRequest.mjs +1 -1
  30. package/dist/useRpc.d.cts +3 -2
  31. package/dist/useRpc.d.mts +3 -2
  32. package/dist/useRpc.d.ts +3 -2
  33. package/dist/useSolanaClient.d.cts +3 -2
  34. package/dist/useSolanaClient.d.mts +3 -2
  35. package/dist/useSolanaClient.d.ts +3 -2
  36. package/dist/useSubscription.cjs +1 -1
  37. package/dist/useSubscription.d.cts +15 -3
  38. package/dist/useSubscription.d.mts +15 -3
  39. package/dist/useSubscription.d.ts +15 -3
  40. package/dist/useSubscription.mjs +1 -1
  41. package/dist/useTrackedData.cjs +1 -1
  42. package/dist/useTrackedData.d.cts +15 -3
  43. package/dist/useTrackedData.d.mts +15 -3
  44. package/dist/useTrackedData.d.ts +15 -3
  45. package/dist/useTrackedData.mjs +1 -1
  46. package/package.json +7 -2
@@ -48,7 +48,8 @@ interface UseTrackedDataOptions {
48
48
  * Returns a caller-provided `AbortSignal` per connection (for example
49
49
  * `AbortSignal.timeout(60_000)`), composed with the per-connection signal
50
50
  * by the underlying store. Aborting it fails the connection with the abort
51
- * reason without touching other state.
51
+ * reason without touching other state. Read fresh from the latest render,
52
+ * so inline closures need no callback wrapping.
52
53
  */
53
54
  getAbortSignal?: (connection: number) => AbortSignal | null | undefined;
54
55
  /**
@@ -56,6 +57,16 @@ interface UseTrackedDataOptions {
56
57
  */
57
58
  onError?: (error: unknown) => void;
58
59
  }
60
+ /** Per-connection abort overrides for `refresh()`. */
61
+ type UseTrackedDataRefresherOptions = {
62
+ /**
63
+ * Applies only this signal to both connections, bypassing `getAbortSignal`.
64
+ * Passing `undefined` (or an empty options object) applies no caller signal
65
+ * for that refresh; call `refresh()` with no argument to keep the
66
+ * `getAbortSignal` factory behavior.
67
+ */
68
+ abortSignal?: AbortSignal;
69
+ };
59
70
  interface UseTrackedDataReturn<TItem> {
60
71
  /**
61
72
  * The latest item, surface-mapped by `rpcValueMapper` /
@@ -64,7 +75,8 @@ interface UseTrackedDataReturn<TItem> {
64
75
  */
65
76
  data: ComputedRef<SolanaRpcResponse<TItem> | undefined>;
66
77
  error: ComputedRef<SolanaError | null>;
67
- refresh: () => void;
78
+ /** Rebuilds both connections. `refresh({ abortSignal })` overrides `getAbortSignal`. */
79
+ refresh: (options?: UseTrackedDataRefresherOptions) => void;
68
80
  status: ComputedRef<UseTrackedDataStatus>;
69
81
  }
70
82
  /**
@@ -83,4 +95,4 @@ interface UseTrackedDataReturn<TItem> {
83
95
  declare function useTrackedData<TInitialValue, TStreamValue, TItem>(source: UseTrackedDataSource<TInitialValue, TStreamValue, TItem>, options?: UseTrackedDataOptions): UseTrackedDataReturn<TItem>;
84
96
 
85
97
  export { useTrackedData };
86
- export type { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource };
98
+ export type { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataRefresherOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource };
@@ -48,7 +48,8 @@ interface UseTrackedDataOptions {
48
48
  * Returns a caller-provided `AbortSignal` per connection (for example
49
49
  * `AbortSignal.timeout(60_000)`), composed with the per-connection signal
50
50
  * by the underlying store. Aborting it fails the connection with the abort
51
- * reason without touching other state.
51
+ * reason without touching other state. Read fresh from the latest render,
52
+ * so inline closures need no callback wrapping.
52
53
  */
53
54
  getAbortSignal?: (connection: number) => AbortSignal | null | undefined;
54
55
  /**
@@ -56,6 +57,16 @@ interface UseTrackedDataOptions {
56
57
  */
57
58
  onError?: (error: unknown) => void;
58
59
  }
60
+ /** Per-connection abort overrides for `refresh()`. */
61
+ type UseTrackedDataRefresherOptions = {
62
+ /**
63
+ * Applies only this signal to both connections, bypassing `getAbortSignal`.
64
+ * Passing `undefined` (or an empty options object) applies no caller signal
65
+ * for that refresh; call `refresh()` with no argument to keep the
66
+ * `getAbortSignal` factory behavior.
67
+ */
68
+ abortSignal?: AbortSignal;
69
+ };
59
70
  interface UseTrackedDataReturn<TItem> {
60
71
  /**
61
72
  * The latest item, surface-mapped by `rpcValueMapper` /
@@ -64,7 +75,8 @@ interface UseTrackedDataReturn<TItem> {
64
75
  */
65
76
  data: ComputedRef<SolanaRpcResponse<TItem> | undefined>;
66
77
  error: ComputedRef<SolanaError | null>;
67
- refresh: () => void;
78
+ /** Rebuilds both connections. `refresh({ abortSignal })` overrides `getAbortSignal`. */
79
+ refresh: (options?: UseTrackedDataRefresherOptions) => void;
68
80
  status: ComputedRef<UseTrackedDataStatus>;
69
81
  }
70
82
  /**
@@ -83,4 +95,4 @@ interface UseTrackedDataReturn<TItem> {
83
95
  declare function useTrackedData<TInitialValue, TStreamValue, TItem>(source: UseTrackedDataSource<TInitialValue, TStreamValue, TItem>, options?: UseTrackedDataOptions): UseTrackedDataReturn<TItem>;
84
96
 
85
97
  export { useTrackedData };
86
- export type { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource };
98
+ export type { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataRefresherOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource };
@@ -1,4 +1,4 @@
1
- export { u as useTrackedData } from './shared/vue.CogzzQXM.mjs';
1
+ export { u as useTrackedData } from './shared/vue.CbJFnho-.mjs';
2
2
  import '@vue-solana/core/kit';
3
3
  import '@vue-solana/core/errors';
4
4
  import 'vue';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-solana/vue",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Vue plugin and composables for Solana applications.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -40,6 +40,11 @@
40
40
  "import": "./dist/useAction.mjs",
41
41
  "require": "./dist/useAction.cjs"
42
42
  },
43
+ "./useAirdrop": {
44
+ "types": "./dist/useAirdrop.d.ts",
45
+ "import": "./dist/useAirdrop.mjs",
46
+ "require": "./dist/useAirdrop.cjs"
47
+ },
43
48
  "./useRequest": {
44
49
  "types": "./dist/useRequest.d.ts",
45
50
  "import": "./dist/useRequest.mjs",
@@ -199,7 +204,7 @@
199
204
  },
200
205
  "dependencies": {
201
206
  "bs58": "^6.0.0",
202
- "@vue-solana/core": "2.1.0"
207
+ "@vue-solana/core": "2.2.0"
203
208
  },
204
209
  "peerDependencies": {
205
210
  "vue": "^3.5.0"