@vue-solana/vue 4.0.0-rc.1 → 4.0.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 (2) hide show
  1. package/README.md +33 -17
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -7,6 +7,16 @@
7
7
 
8
8
  Solana wallet, RPC, account, message signing, and transaction composables for Vue 3.
9
9
 
10
+ ## Related packages
11
+
12
+ This package is part of the Vue Solana family. Choose based on your app framework:
13
+
14
+ - [`@vue-solana/core`](https://www.npmjs.com/package/@vue-solana/core) — framework-agnostic Solana primitives: Kit RPC client helpers, wallet types, Android MWA registration, iOS browser wallet helpers, message signing, token account reads, and transaction helpers. **Use this directly** when you want shared RPC/wallet/transaction helpers without installing a Vue plugin (non-Vue apps, server/relayer code, or your own framework integration).
15
+ - [`@vue-solana/vue`](https://www.npmjs.com/package/@vue-solana/vue) — Vue 3 plugin plus composables for RPC, account, balance, wallet, message signing, live data, and transactions. **Use this** in plain Vue 3 apps (Vite, etc.). (This package.)
16
+ - [`@vue-solana/nuxt`](https://www.npmjs.com/package/@vue-solana/nuxt) — Nuxt module that installs the Vue plugin and auto-imports the composables. **Use this** in Nuxt 3/4 apps.
17
+
18
+ This package builds on `@vue-solana/core`; install `@vue-solana/vue` for plain Vue apps and `@vue-solana/nuxt` for Nuxt apps.
19
+
10
20
  Use this package in Vue 3 apps that need Solana RPC access, balance reads, wallet state, message signing, and transaction helper state.
11
21
 
12
22
  New to Solana? Start with the official docs and the project concepts guide:
@@ -64,20 +74,22 @@ import { createApp } from "vue";
64
74
  import { createSolanaPlugin } from "@vue-solana/vue";
65
75
  import App from "./App.vue";
66
76
 
67
- createApp(App)
68
- .use(
69
- createSolanaPlugin({
70
- cluster: "devnet",
71
- mobileWallet: {
72
- appIdentity: {
73
- name: "My Vue Solana App",
74
- uri: "https://example.com",
75
- icon: "favicon.ico",
76
- },
77
- },
78
- }),
79
- )
80
- .mount("#app");
77
+ const solana = createSolanaPlugin({
78
+ cluster: "devnet",
79
+ mobileWallet: {
80
+ appIdentity: {
81
+ name: "My Vue Solana App",
82
+ uri: "https://example.com",
83
+ icon: "favicon.ico",
84
+ },
85
+ },
86
+ });
87
+
88
+ createApp(App).use(solana).mount("#app");
89
+
90
+ // On teardown:
91
+ // app.unmount();
92
+ // solana.dispose();
81
93
  ```
82
94
 
83
95
  Android Mobile Wallet Adapter registration is enabled by default on supported Android Chrome clients. Pass `mobileWallet` options to customize the MWA app identity, or pass `mobileWallet: false` to disable Android mobile wallet registration.
@@ -227,6 +239,8 @@ const signatureStatus = useSignatureStatus(signature, {
227
239
  });
228
240
  ```
229
241
 
242
+ There is no per-call `commitment` option for `useSignatureStatus()`; `getSignatureStatuses` takes no per-call commitment, so reads use the commitment baked into the endpoint. Polling uses chained timeouts and `stopPolling()` prevents further ticks until the watched signature changes (which restarts polling). Invalid `pollIntervalMs` values return an `RPC_FAILURE` `SolanaError`.
243
+
230
244
  Read SPL token accounts and balances through Kit RPC `jsonParsed`:
231
245
 
232
246
  ```ts
@@ -490,7 +504,7 @@ import { useRequestSwr } from "@vue-solana/vue/swr";
490
504
  const balance = useRequestSwr(["balance", address], () => client.rpc.getBalance(address).send());
491
505
  ```
492
506
 
493
- The SWR cache is module-level and shared across the whole app, including across SSR requests. Namespace cache keys per request (for example by including a request or session id) or call `clearSwrCache()` at the start of each server request to avoid leaking one request's cached data into another. On the client the cache is intentionally shared for stale-while-revalidate seeding.
507
+ The SWR cache is module-level and shared across the whole app, including across SSR requests. Namespace cache keys per request (for example by including a request or session id) or call `clearSwrCache()` at the start of each server request to avoid leaking one request's cached data into another. On the client the cache is intentionally shared for stale-while-revalidate seeding. It is capped at 1024 entries with oldest-first eviction. Use `deleteSwrKey(key)` to evict a single entry by its full cache key (including the adapter prefix like `request:`).
494
508
 
495
509
  ### Cancellation & Timeouts
496
510
 
@@ -594,9 +608,9 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
594
608
 
595
609
  | API | Description |
596
610
  | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
597
- | `createSolanaPlugin(options?)` | Installs the Vue Solana context. |
611
+ | `createSolanaPlugin(options?)` | Installs the Vue Solana context and returns `{ install, context, dispose }`. `dispose()` stops wallet discovery/subscriptions. |
598
612
  | `VueSolana` | Alias for `createSolanaPlugin`. |
599
- | `useSolana()` | Returns the full injected Solana context; throws when no plugin context is available. |
613
+ | `useSolana()` | Returns the full injected Solana context; throws when no plugin context is available (SSR fallback uses a fresh inert context per call). |
600
614
  | `tryUseSolana()` | Returns the injected Solana context or `null` when no plugin context is available (SSR-safe). |
601
615
  | `MissingClientCapabilityError` | Thrown by `useClientCapability()` (and client-sent composables) when the configured client lacks a required capability. |
602
616
  | `useRpc()` | Returns cluster, endpoint, connection status, latest blockhash, the Kit `client`, and `checkConnection()`. |
@@ -621,12 +635,14 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
621
635
  | `useTrackedData(source, options?)` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
622
636
  | `useRequestSwr(key, ...)` / `useSubscriptionSwr(key, ...)` / `useTrackedDataSwr(key, ...)` | Cache-keyed SWR adapters seeding fresh mounts from the last-known result. |
623
637
  | `clearSwrCache()` | Clears every cached SWR entry. |
638
+ | `deleteSwrKey(key)` | Removes a single cached SWR entry by full cache key (including adapter prefix). |
624
639
  | `useSignIn(input?)` | Sign In With Solana (SIWS) trigger returning `{ account, signedMessage, signature }` for server-side verification. |
625
640
  | `useSelectedWalletAccount()` | App-wide selected wallet account context: `[selectedAccount, setSelectedAccount, filteredWallets]`. |
626
641
  | `SelectedWalletAccountProvider` | Component that provides the selected wallet account context to its subtree. |
627
642
  | `useSignTransactions()` | Batch-signs transactions through the wallet, preferring `signTransactions` and falling back to `signAllTransactions`. |
628
643
  | `useSignAndSendTransactions()` | Signs and sends multiple transactions, returning one signature each, with a singular sequential fallback. |
629
644
  | `useClientCapability(capability, options?)` | Fails fast with a clear error when the configured Solana client lacks a requested capability. |
645
+ | `tryUseSolana()` | Returns the injected Solana context or `null` when no plugin context is available (SSR-safe). |
630
646
  | `usePayer()` | Reactive Kit client `payer` signer ref. The default client exposes a configured payer when supplied. |
631
647
  | `useIdentity()` | Reactive Kit client `identity` signer ref (requires an identity signer on a custom client). |
632
648
  | `usePlanTransaction()` | Plans a single transaction message from instruction inputs without signing or sending; the default client includes the official planner. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-solana/vue",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.0.0",
4
4
  "description": "Vue plugin and composables for Solana applications.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -178,7 +178,7 @@
178
178
  "access": "public"
179
179
  },
180
180
  "dependencies": {
181
- "@vue-solana/core": "4.0.0-rc.1"
181
+ "@vue-solana/core": "4.0.0"
182
182
  },
183
183
  "peerDependencies": {
184
184
  "vue": "^3.5.0"