@vue-solana/nuxt 2.0.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.
package/README.md CHANGED
@@ -5,9 +5,9 @@
5
5
  [![license](https://img.shields.io/npm/l/@vue-solana/nuxt.svg)](https://github.com/vue-solana/vue-solana/blob/main/LICENSE)
6
6
  [![docs](https://img.shields.io/badge/docs-vue--solana-blue)](https://vue-solana-docs.vercel.app/packages/nuxt)
7
7
 
8
- Nuxt module for Solana wallet, RPC, account, message signing, and transaction composables with auto-imports.
8
+ Nuxt module for Solana wallet, RPC, account, token, message signing, live data, and transaction composables with auto-imports.
9
9
 
10
- Use this package in Nuxt apps that need the Vue Solana plugin installed automatically plus auto-imported composables for RPC, wallet state, message signing, and transactions.
10
+ Use this package in Nuxt apps that need the Vue Solana plugin installed automatically plus auto-imported composables for RPC, wallet state, message signing, live data, and transactions.
11
11
 
12
12
  New to Solana? Start with the official docs and the project concepts guide:
13
13
 
@@ -22,10 +22,11 @@ New to Solana? Start with the official docs and the project concepts guide:
22
22
  ## Features
23
23
 
24
24
  - Installs the Vue Solana plugin automatically.
25
- - Auto-imports Solana RPC, wallet, account, balance, message signing, and transaction composables.
25
+ - Auto-imports Solana RPC, wallet, account, token, message signing, live data, and transaction composables.
26
26
  - Uses direct Vue package subpaths to avoid pulling unrelated runtime code into Nuxt bundles.
27
27
  - Client-only runtime plugin with SSR-safe inert composable state before hydration.
28
28
  - Unified wallet discovery for browser extensions, Android Mobile Wallet Adapter, and supported iOS browser wallets.
29
+ - App-wide selected wallet account context installed by the runtime plugin.
29
30
  - Nuxt 3 and Nuxt 4 support.
30
31
 
31
32
  ## Compatibility
@@ -83,6 +84,7 @@ Nuxt module options are stored in public runtime config, so they must be JSON-se
83
84
  | `commitment` | Solana commitment | Solana client default | Default commitment for created connections. |
84
85
  | `autoConnect` | `boolean` | `false` | Reconnects only a previously selected discovered wallet identity when it is discovered again. |
85
86
  | `mobileWallet` | JSON-serializable mobile wallet options or `false` | Enabled on supported Android clients | Configures or disables Android Mobile Wallet Adapter registration. |
87
+ | `iosWallet` | JSON-serializable iOS wallet options or `false` | Enabled on iOS browsers | Configures or disables iOS browser wallet universal links (Phantom, Solflare, Backpack). |
86
88
 
87
89
  For development, use `devnet` and request free test SOL from the official faucet:
88
90
 
@@ -95,40 +97,72 @@ https://faucet.solana.com
95
97
  The module auto-imports these composables from direct `@vue-solana/vue/*` subpaths rather than the root Vue package barrel. This keeps Nuxt SSR bundles from pulling in unrelated Solana runtime code just because a page uses one composable.
96
98
 
97
99
  - `useSolana()`
100
+ - `useSolanaClient()`
98
101
  - `useSolanaRpc()`
99
102
  - `useSolanaConnection()`
100
103
  - `useSolanaAccountInfo()`
101
- - `useSolanaWallet()`
102
- - `useSolanaWallets()`
103
104
  - `useSolanaBalance()`
104
105
  - `useSolanaProgramAccounts()`
105
- - `useSolanaTransactionConfirmation()`
106
- - `useSolanaSignatureStatus()`
106
+ - `useSolanaTokenAccounts()`
107
+ - `useSolanaTokenBalance()`
108
+ - `useSolanaWallet()`
109
+ - `useSolanaWallets()`
107
110
  - `useSolanaSignMessage()`
111
+ - `useSolanaSignIn()`
108
112
  - `useSolanaSignAndSendTransaction()`
113
+ - `useSolanaSignTransactions()`
114
+ - `useSolanaSignAndSendTransactions()`
115
+ - `useSolanaTransactionConfirmation()`
116
+ - `useSolanaSignatureStatus()`
117
+ - `useSolanaAction()`
118
+ - `useSolanaRequest()`
119
+ - `useSolanaSubscription()`
120
+ - `useSolanaTrackedData()`
121
+ - `useSolanaSelectedWalletAccount()`
122
+ - `useSolanaPayer()`
123
+ - `useSolanaIdentity()`
124
+ - `useSolanaPlanTransaction()`
125
+ - `useSolanaPlanTransactions()`
109
126
 
110
127
  | Composable | Purpose |
111
128
  | ------------------------------------ | -------------------------------------------------------------------------------- |
112
129
  | `useSolana()` | Full Solana context. |
130
+ | `useSolanaClient()` | Reactive Kit RPC client and its compositions. |
113
131
  | `useSolanaRpc()` | Cluster, endpoint, connection status, latest blockhash, and `checkConnection()`. |
114
- | `useSolanaConnection()` | Raw Solana `Connection`. |
132
+ | `useSolanaConnection()` | Deprecated alias for the Kit client returned by `useSolanaClient()`. |
115
133
  | `useSolanaAccountInfo()` | Account info reads and optional subscriptions. |
116
- | `useSolanaWallet()` | Active wallet state and connect/disconnect actions. |
117
- | `useSolanaWallets()` | Wallet discovery, selected wallet state, and selection actions. |
118
134
  | `useSolanaBalance()` | Lamport balance reads. |
119
135
  | `useSolanaProgramAccounts()` | Program account scans with filters and `dataSlice`. |
120
- | `useSolanaTransactionConfirmation()` | Confirmation state for an already submitted signature. |
121
- | `useSolanaSignatureStatus()` | Signature status reads with optional polling or websocket subscription. |
136
+ | `useSolanaTokenAccounts()` | SPL token account reads for an owner. |
137
+ | `useSolanaTokenBalance()` | SPL token balance reads for a mint/owner pair. |
138
+ | `useSolanaWallet()` | Active wallet state and connect/disconnect actions. |
139
+ | `useSolanaWallets()` | Wallet discovery, selected wallet state, and selection actions. |
122
140
  | `useSolanaSignMessage()` | Wallet message signing. |
141
+ | `useSolanaSignIn()` | Sign In With Solana (SIWS) trigger returning a server-verifiable result. |
123
142
  | `useSolanaSignAndSendTransaction()` | Wallet transaction signing, sending, and optional confirmation. |
143
+ | `useSolanaSignTransactions()` | Batch transaction signing (falls back to `signAllTransactions`). |
144
+ | `useSolanaSignAndSendTransactions()` | Batch sign-and-send returning one signature per transaction. |
145
+ | `useSolanaTransactionConfirmation()` | Confirmation state for an already submitted signature. |
146
+ | `useSolanaSignatureStatus()` | Signature status reads with optional polling or websocket subscription. |
147
+ | `useSolanaAction()` | Generic async action state machine; each dispatch aborts the prior attempt. |
148
+ | `useSolanaRequest()` | One-shot Kit request with stale-while-revalidate as its source changes. |
149
+ | `useSolanaSubscription()` | Live data over a Kit reactive stream store (e.g. RPC subscriptions). |
150
+ | `useSolanaTrackedData()` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
151
+ | `useSolanaSelectedWalletAccount()` | App-wide selected wallet account context provided by the runtime plugin. |
152
+ | `useSolanaPayer()` | Reactive Kit client `payer` signer ref. |
153
+ | `useSolanaIdentity()` | Reactive Kit client `identity` signer ref. |
154
+ | `useSolanaPlanTransaction()` | Plans a single transaction message from instruction inputs without signing. |
155
+ | `useSolanaPlanTransactions()` | Plans a batch of transaction messages from instruction inputs. |
124
156
 
125
157
  The runtime plugin is client-only. Auto-imported composables can be called during SSR and return inert state until hydration provides the real client context. Trigger RPC and wallet work from client lifecycle hooks or user actions.
126
158
 
127
159
  Android Mobile Wallet Adapter registration also runs only on the client. On Android Chrome and Chrome PWAs, `Mobile Wallet Adapter` can appear in the same `useSolanaWallets()` list as browser extension wallets. On iOS browsers, Phantom, Solflare, and Backpack can appear in the same list through wallet-specific universal links. Desktop native app wallet adapters are planned but not implemented yet.
128
160
 
129
- The package also exposes Solana helper subpaths for Nuxt apps that need transaction primitives or the browser Buffer polyfill without importing lower-level packages directly:
161
+ The module also installs the app-wide selected wallet account context, so `useSolanaSelectedWalletAccount()` works in any component without an explicit provider.
162
+
163
+ The package also exposes Solana helper subpaths for Nuxt apps that need Kit re-exports or the browser Buffer polyfill without importing lower-level packages directly:
130
164
 
131
- - `@vue-solana/nuxt/web3`
165
+ - `@vue-solana/nuxt/kit`
132
166
  - `@vue-solana/nuxt/buffer-polyfill`
133
167
 
134
168
  ## Read RPC State
@@ -207,7 +241,7 @@ const { publicKey, connected, canSignMessage, connect, disconnect } = useSolanaW
207
241
  </button>
208
242
  <p>Selected: {{ selectedWallet?.name ?? "None" }}</p>
209
243
  <p>Connected: {{ connected }}</p>
210
- <p>Public key: {{ publicKey?.toBase58() }}</p>
244
+ <p>Public key: {{ publicKey }}</p>
211
245
  <p>Can sign messages: {{ canSignMessage }}</p>
212
246
  <button type="button" :disabled="!selectedWallet || connected" @click="connect">Connect</button>
213
247
  <button type="button" :disabled="!connected" @click="disconnect">Disconnect</button>
@@ -275,9 +309,8 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
275
309
  - Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
276
310
  - Broad `useSolanaProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
277
311
  - Use `mainnet-beta` for Solana mainnet. `mainnet` is intentionally not accepted as a cluster alias.
278
- - `@solana/web3-compat@0.0.21` currently has broken TypeScript package metadata. Runtime imports still use the real package, and current Vue Solana packages publish temporary declaration shims for documented imports. See [Troubleshooting](https://vue-solana-docs.vercel.app/troubleshooting) for details.
279
312
  - Desktop native app wallets are planned but not implemented yet.
280
313
 
281
314
  ## Status
282
315
 
283
- This package provides RPC, balance, browser extension wallet, Android mobile wallet, iOS browser wallet, message signing, and transaction composables for Nuxt apps.
316
+ This package provides RPC, balance, account, token, browser extension wallet, Android mobile wallet, iOS browser wallet, message signing, SIWS, live data, and transaction composables for Nuxt apps.
package/dist/module.cjs CHANGED
@@ -5,17 +5,29 @@ const kit = require('@nuxt/kit');
5
5
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
6
6
  const SOLANA_COMPOSABLE_IMPORTS = [
7
7
  ["useAccountInfo", "useSolanaAccountInfo"],
8
+ ["useAction", "useSolanaAction"],
8
9
  ["useBalance", "useSolanaBalance"],
9
10
  ["useConnection", "useSolanaConnection"],
11
+ ["useIdentity", "useSolanaIdentity"],
12
+ ["usePlanTransaction", "useSolanaPlanTransaction"],
13
+ ["usePlanTransactions", "useSolanaPlanTransactions"],
10
14
  ["useProgramAccounts", "useSolanaProgramAccounts"],
15
+ ["usePayer", "useSolanaPayer"],
16
+ ["useRequest", "useSolanaRequest"],
11
17
  ["useRpc", "useSolanaRpc"],
18
+ ["useSelectedWalletAccount", "useSolanaSelectedWalletAccount"],
19
+ ["useSignIn", "useSolanaSignIn"],
12
20
  ["useSignMessage", "useSolanaSignMessage"],
13
21
  ["useSignAndSendTransaction", "useSolanaSignAndSendTransaction"],
22
+ ["useSignTransactions", "useSolanaSignTransactions"],
23
+ ["useSignAndSendTransactions", "useSolanaSignAndSendTransactions"],
14
24
  ["useSignatureStatus", "useSolanaSignatureStatus"],
15
25
  ["useSolana", "useSolana"],
16
26
  ["useSolanaClient", "useSolanaClient"],
27
+ ["useSubscription", "useSolanaSubscription"],
17
28
  ["useTokenAccounts", "useSolanaTokenAccounts"],
18
29
  ["useTokenBalance", "useSolanaTokenBalance"],
30
+ ["useTrackedData", "useSolanaTrackedData"],
19
31
  ["useTransactionConfirmation", "useSolanaTransactionConfirmation"],
20
32
  ["useWallet", "useSolanaWallet"],
21
33
  ["useWallets", "useSolanaWallets"]
package/dist/module.mjs CHANGED
@@ -2,17 +2,29 @@ import { defineNuxtModule, createResolver, addPlugin, addImports } from '@nuxt/k
2
2
 
3
3
  const SOLANA_COMPOSABLE_IMPORTS = [
4
4
  ["useAccountInfo", "useSolanaAccountInfo"],
5
+ ["useAction", "useSolanaAction"],
5
6
  ["useBalance", "useSolanaBalance"],
6
7
  ["useConnection", "useSolanaConnection"],
8
+ ["useIdentity", "useSolanaIdentity"],
9
+ ["usePlanTransaction", "useSolanaPlanTransaction"],
10
+ ["usePlanTransactions", "useSolanaPlanTransactions"],
7
11
  ["useProgramAccounts", "useSolanaProgramAccounts"],
12
+ ["usePayer", "useSolanaPayer"],
13
+ ["useRequest", "useSolanaRequest"],
8
14
  ["useRpc", "useSolanaRpc"],
15
+ ["useSelectedWalletAccount", "useSolanaSelectedWalletAccount"],
16
+ ["useSignIn", "useSolanaSignIn"],
9
17
  ["useSignMessage", "useSolanaSignMessage"],
10
18
  ["useSignAndSendTransaction", "useSolanaSignAndSendTransaction"],
19
+ ["useSignTransactions", "useSolanaSignTransactions"],
20
+ ["useSignAndSendTransactions", "useSolanaSignAndSendTransactions"],
11
21
  ["useSignatureStatus", "useSolanaSignatureStatus"],
12
22
  ["useSolana", "useSolana"],
13
23
  ["useSolanaClient", "useSolanaClient"],
24
+ ["useSubscription", "useSolanaSubscription"],
14
25
  ["useTokenAccounts", "useSolanaTokenAccounts"],
15
26
  ["useTokenBalance", "useSolanaTokenBalance"],
27
+ ["useTrackedData", "useSolanaTrackedData"],
16
28
  ["useTransactionConfirmation", "useSolanaTransactionConfirmation"],
17
29
  ["useWallet", "useSolanaWallet"],
18
30
  ["useWallets", "useSolanaWallets"]
@@ -5,17 +5,19 @@ const _app = require('#app');
5
5
 
6
6
  const plugin = _app.defineNuxtPlugin((nuxtApp) => {
7
7
  const config = _app.useRuntimeConfig().public.solana;
8
- nuxtApp.vueApp.use(
9
- vue.createSolanaPlugin({
10
- cluster: config.cluster,
11
- endpoint: config.endpoint,
12
- wsEndpoint: config.wsEndpoint,
13
- commitment: config.commitment,
14
- autoConnect: config.autoConnect,
15
- mobileWallet: config.mobileWallet,
16
- iosWallet: config.iosWallet
17
- })
18
- );
8
+ const solanaPlugin = vue.createSolanaPlugin({
9
+ cluster: config.cluster,
10
+ endpoint: config.endpoint,
11
+ wsEndpoint: config.wsEndpoint,
12
+ commitment: config.commitment,
13
+ autoConnect: config.autoConnect,
14
+ mobileWallet: config.mobileWallet,
15
+ iosWallet: config.iosWallet
16
+ });
17
+ nuxtApp.vueApp.use(solanaPlugin);
18
+ const vueApp = nuxtApp.vueApp;
19
+ const context = vue.createSelectedWalletAccountContext({}, solanaPlugin.context);
20
+ vueApp.provide(vue.selectedWalletAccountInjectionKey, context);
19
21
  });
20
22
 
21
23
  module.exports = plugin;
@@ -1,19 +1,21 @@
1
- import { createSolanaPlugin } from '@vue-solana/vue';
1
+ import { createSolanaPlugin, createSelectedWalletAccountContext, selectedWalletAccountInjectionKey } from '@vue-solana/vue';
2
2
  import { defineNuxtPlugin, useRuntimeConfig } from '#app';
3
3
 
4
4
  const plugin = defineNuxtPlugin((nuxtApp) => {
5
5
  const config = useRuntimeConfig().public.solana;
6
- nuxtApp.vueApp.use(
7
- createSolanaPlugin({
8
- cluster: config.cluster,
9
- endpoint: config.endpoint,
10
- wsEndpoint: config.wsEndpoint,
11
- commitment: config.commitment,
12
- autoConnect: config.autoConnect,
13
- mobileWallet: config.mobileWallet,
14
- iosWallet: config.iosWallet
15
- })
16
- );
6
+ const solanaPlugin = createSolanaPlugin({
7
+ cluster: config.cluster,
8
+ endpoint: config.endpoint,
9
+ wsEndpoint: config.wsEndpoint,
10
+ commitment: config.commitment,
11
+ autoConnect: config.autoConnect,
12
+ mobileWallet: config.mobileWallet,
13
+ iosWallet: config.iosWallet
14
+ });
15
+ nuxtApp.vueApp.use(solanaPlugin);
16
+ const vueApp = nuxtApp.vueApp;
17
+ const context = createSelectedWalletAccountContext({}, solanaPlugin.context);
18
+ vueApp.provide(selectedWalletAccountInjectionKey, context);
17
19
  });
18
20
 
19
21
  export { plugin as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-solana/nuxt",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Nuxt module for Solana applications.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -47,7 +47,7 @@
47
47
  "access": "public"
48
48
  },
49
49
  "dependencies": {
50
- "@vue-solana/vue": "2.0.0"
50
+ "@vue-solana/vue": "2.1.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "nuxt": "^3.0.0 || ^4.0.0"