@vue-solana/nuxt 2.3.0 → 2.4.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
@@ -23,6 +23,7 @@ New to Solana? Start with the official docs and the project concepts guide:
23
23
 
24
24
  - Installs the Vue Solana plugin automatically.
25
25
  - Auto-imports Solana RPC, wallet, account, token, message signing, live data, and transaction composables.
26
+ - Builds the default client with the official Kit RPC planner and transaction-sending executor; payer secrets are never accepted through public runtime config.
26
27
  - Uses direct Vue package subpaths to avoid pulling unrelated runtime code into Nuxt bundles.
27
28
  - Client-only runtime plugin with SSR-safe inert composable state before hydration.
28
29
  - Unified wallet discovery for browser extensions, Android Mobile Wallet Adapter, and supported iOS browser wallets.
@@ -31,12 +32,12 @@ New to Solana? Start with the official docs and the project concepts guide:
31
32
 
32
33
  ## Compatibility
33
34
 
34
- | Requirement | Supported |
35
- | ------------- | ----------------------------------------------- |
36
- | Nuxt | `^3.0.0 \|\| ^4.0.0` |
37
- | TypeScript | TypeScript 5.x recommended |
38
- | Solana client | Provided through `@vue-solana/core` |
39
- | Clusters | `mainnet-beta`, `devnet`, `testnet`, `localnet` |
35
+ | Requirement | Supported |
36
+ | ------------- | ----------------------------------------------------------------- |
37
+ | Nuxt | `^3.0.0 \|\| ^4.0.0` |
38
+ | TypeScript | TypeScript 5.x recommended |
39
+ | Solana client | Provided through `@vue-solana/core` |
40
+ | Clusters | `mainnet` (alias `mainnet-beta`), `devnet`, `testnet`, `localnet` |
40
41
 
41
42
  ## Install
42
43
 
@@ -63,28 +64,31 @@ You can also configure a custom RPC endpoint:
63
64
  export default defineNuxtConfig({
64
65
  modules: ["@vue-solana/nuxt"],
65
66
  solana: {
66
- cluster: "mainnet-beta",
67
+ cluster: "mainnet",
67
68
  endpoint: "https://your-rpc.example.com",
68
69
  commitment: "confirmed",
69
70
  },
70
71
  });
71
72
  ```
72
73
 
73
- Supported clusters are `mainnet-beta`, `devnet`, `testnet`, and `localnet`. Use `mainnet-beta` for Solana mainnet; this is Solana's official cluster name.
74
+ Supported clusters are `mainnet` (legacy alias `mainnet-beta`), `devnet`, `testnet`, and `localnet`. Use `mainnet` for Solana mainnet; this is Solana's official mainnet cluster name.
74
75
 
75
76
  Nuxt module options are stored in public runtime config, so they must be JSON-serializable. Custom `wallet` adapter objects are intentionally excluded from Nuxt config; use the Vue plugin directly in client-only Vue code if you need to inject a custom wallet object.
76
77
 
78
+ `ModuleOptions` also intentionally omits `payer` and `payerSecretKey`. Direct core/Vue clients support both, but the Nuxt module does not forward either field and strips it from public runtime config. Never put a raw secret, seed phrase, or `payerSecretKey` in `nuxt.config.ts` or `runtimeConfig.public`: those values are visible in the browser. For a client-owned signer, install a `payer` in a client-only plugin and set `clientPlugin: false` so the module does not install a second plugin; a client-sent transaction always needs one.
79
+
77
80
  ### Module Options
78
81
 
79
- | Option | Type | Default | Description |
80
- | -------------- | ------------------------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
81
- | `cluster` | `"mainnet-beta" \| "devnet" \| "testnet" \| "localnet"` | `"devnet"` | Solana cluster used when `endpoint` is omitted. |
82
- | `endpoint` | `string` | Public endpoint for `cluster` | HTTP RPC endpoint. Use a dedicated RPC provider for production apps. |
83
- | `wsEndpoint` | `string` | Derived from `endpoint` | WebSocket RPC endpoint. |
84
- | `commitment` | Solana commitment | Solana client default | Default commitment for created connections. |
85
- | `autoConnect` | `boolean` | `false` | Reconnects only a previously selected discovered wallet identity when it is discovered again. |
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). |
82
+ | Option | Type | Default | Description |
83
+ | -------------- | -------------------------------------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
84
+ | `cluster` | `"mainnet" \| "mainnet-beta" \| "devnet" \| "testnet" \| "localnet"` | `"devnet"` | Solana cluster used when `endpoint` is omitted. |
85
+ | `endpoint` | `string` | Public endpoint for `cluster` | HTTP RPC endpoint. Use a dedicated RPC provider for production apps. |
86
+ | `wsEndpoint` | `string` | Derived from `endpoint` | WebSocket RPC endpoint. |
87
+ | `commitment` | Solana commitment | Solana client default | Default commitment for created connections. |
88
+ | `autoConnect` | `boolean` | `false` | Reconnects only a previously selected discovered wallet identity when it is discovered again. |
89
+ | `mobileWallet` | JSON-serializable mobile wallet options or `false` | Enabled on supported Android clients | Configures or disables Android Mobile Wallet Adapter registration. |
90
+ | `iosWallet` | JSON-serializable iOS wallet options or `false` | Enabled on iOS browsers | Configures or disables iOS browser wallet universal links (Phantom, Solflare, Backpack). |
91
+ | `clientPlugin` | `boolean` | `true` | Set to `false` to skip the module's runtime plugin and install `createSolanaPlugin` yourself. |
88
92
 
89
93
  For development, use `devnet` and request free test SOL from the official faucet:
90
94
 
@@ -127,38 +131,40 @@ The module auto-imports these composables from direct `@vue-solana/vue/*` subpat
127
131
  - `useSolanaSendTransaction()`
128
132
  - `useSolanaSendTransactions()`
129
133
 
130
- | Composable | Purpose |
131
- | ------------------------------------ | -------------------------------------------------------------------------------- |
132
- | `useSolana()` | Full Solana context. |
133
- | `useSolanaClient()` | Reactive Kit RPC client and its compositions. |
134
- | `useSolanaRpc()` | Cluster, endpoint, connection status, latest blockhash, and `checkConnection()`. |
135
- | `useSolanaConnection()` | Deprecated alias for the Kit client returned by `useSolanaClient()`. |
136
- | `useSolanaAccountInfo()` | Account info reads and optional subscriptions. |
137
- | `useSolanaAirdrop()` | Airdrops SOL into an account on test networks and local validators. |
138
- | `useSolanaBalance()` | Lamport balance reads. |
139
- | `useSolanaProgramAccounts()` | Program account scans with filters and `dataSlice`. |
140
- | `useSolanaTokenAccounts()` | SPL token account reads for an owner. |
141
- | `useSolanaTokenBalance()` | SPL token balance reads for a mint/owner pair. |
142
- | `useSolanaWallet()` | Active wallet state and connect/disconnect actions. |
143
- | `useSolanaWallets()` | Wallet discovery, selected wallet state, and selection actions. |
144
- | `useSolanaSignMessage()` | Wallet message signing. |
145
- | `useSolanaSignIn()` | Sign In With Solana (SIWS) trigger returning a server-verifiable result. |
146
- | `useSolanaSignAndSendTransaction()` | Wallet transaction signing, sending, and optional confirmation. |
147
- | `useSolanaSignTransactions()` | Batch transaction signing (falls back to `signAllTransactions`). |
148
- | `useSolanaSignAndSendTransactions()` | Batch sign-and-send returning one signature per transaction. |
149
- | `useSolanaTransactionConfirmation()` | Confirmation state for an already submitted signature. |
150
- | `useSolanaSignatureStatus()` | Signature status reads with optional polling or websocket subscription. |
151
- | `useSolanaAction()` | Generic async action state machine; each dispatch aborts the prior attempt. |
152
- | `useSolanaRequest()` | One-shot Kit request with stale-while-revalidate as its source changes. |
153
- | `useSolanaSubscription()` | Live data over a Kit reactive stream store (e.g. RPC subscriptions). |
154
- | `useSolanaTrackedData()` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
155
- | `useSolanaSelectedWalletAccount()` | App-wide selected wallet account context provided by the runtime plugin. |
156
- | `useSolanaPayer()` | Reactive Kit client `payer` signer ref. |
157
- | `useSolanaIdentity()` | Reactive Kit client `identity` signer ref. |
158
- | `useSolanaPlanTransaction()` | Plans a single transaction message from instruction inputs without signing. |
159
- | `useSolanaPlanTransactions()` | Plans a batch of transaction messages from instruction inputs. |
160
- | `useSolanaSendTransaction()` | Plans, signs, submits, and confirms one transaction through the client. |
161
- | `useSolanaSendTransactions()` | Sends a batch of transactions (parallel or sequential) through the client. |
134
+ | Composable | Purpose |
135
+ | ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- |
136
+ | `useSolana()` | Full Solana context. |
137
+ | `useSolanaClient()` | Reactive Kit RPC client and its compositions. |
138
+ | `useSolanaRpc()` | Cluster, endpoint, connection status, latest blockhash, and `checkConnection()`. |
139
+ | `useSolanaConnection()` | Deprecated alias for the Kit client returned by `useSolanaClient()`. |
140
+ | `useSolanaAccountInfo()` | Account info reads and optional subscriptions. |
141
+ | `useSolanaAirdrop()` | Airdrops SOL into an account on test networks and local validators. |
142
+ | `useSolanaBalance()` | Lamport balance reads. |
143
+ | `useSolanaProgramAccounts()` | Program account scans with filters and `dataSlice`. |
144
+ | `useSolanaTokenAccounts()` | SPL token account reads for an owner. |
145
+ | `useSolanaTokenBalance()` | SPL token balance reads for a mint/owner pair. |
146
+ | `useSolanaWallet()` | Active wallet state and connect/disconnect actions. |
147
+ | `useSolanaWallets()` | Wallet discovery, selected wallet state, and selection actions. |
148
+ | `useSolanaSignMessage()` | Wallet message signing. |
149
+ | `useSolanaSignIn()` | Sign In With Solana (SIWS) trigger returning a server-verifiable result. |
150
+ | `useSolanaSignAndSendTransaction()` | Wallet transaction signing, sending, and optional confirmation. |
151
+ | `useSolanaSignTransactions()` | Batch transaction signing (falls back to `signAllTransactions`). |
152
+ | `useSolanaSignAndSendTransactions()` | Batch sign-and-send returning one signature per transaction. |
153
+ | `useSolanaTransactionConfirmation()` | Confirmation state for an already submitted signature. |
154
+ | `useSolanaSignatureStatus()` | Signature status reads with optional polling or websocket subscription. |
155
+ | `useSolanaAction()` | Generic async action state machine; each dispatch aborts the prior attempt. |
156
+ | `useSolanaRequest()` | One-shot Kit request with stale-while-revalidate as its source changes. |
157
+ | `useSolanaSubscription()` | Live data over a Kit reactive stream store (e.g. RPC subscriptions). |
158
+ | `useSolanaTrackedData()` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
159
+ | `useSolanaSelectedWalletAccount()` | App-wide selected wallet account context provided by the runtime plugin. |
160
+ | `useSolanaPayer()` | Reactive Kit client `payer` signer ref. Nuxt config intentionally does not provide one; use a client-only plugin with `clientPlugin: false`. |
161
+ | `useSolanaIdentity()` | Reactive Kit client `identity` signer ref. |
162
+ | `useSolanaPlanTransaction()` | Plans a single transaction message from instruction inputs without signing. |
163
+ | `useSolanaPlanTransactions()` | Plans a batch of transaction messages from instruction inputs. |
164
+ | `useSolanaSendTransaction()` | Plans, signs, submits, and confirms one transaction through the client. |
165
+ | `useSolanaSendTransactions()` | Sends a batch of transactions (parallel or sequential) through the client. |
166
+
167
+ The default client built by the module composes the official `solanaRpc()`, `rpcTransactionPlanner()`, and `rpcTransactionPlanSendingExecutor()` plugins. The old custom fallback sender is not used. `useSolanaSendTransaction()` and `useSolanaSendTransactions()` therefore use the official client-sending capability, but the module does not configure a payer because `payer` and `payerSecretKey` are omitted from `ModuleOptions`. Their `sent` status is reached after the official executor completes its send-and-confirm operation at `confirmed` commitment.
162
168
 
163
169
  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.
164
170
 
@@ -286,6 +292,12 @@ async function signIn() {
286
292
 
287
293
  Message signing is for wallet ownership or authentication challenges. It is separate from transaction signing and does not authorize on-chain activity. For auth flows, use a server-issued nonce and verify the returned signature server-side.
288
294
 
295
+ ## Client-Sent Transactions
296
+
297
+ `useSolanaSendTransaction()` and `useSolanaSendTransactions()` use the official Kit transaction-sending capability installed by the default module client. The RPC executor plans, signs, submits, and waits for `confirmed` commitment without a wallet popup, so the composable reports `sent` only after send-and-confirm completes. Install a client-owned `payer` in a client-only Vue plugin with `clientPlugin: false`; do not put `payerSecretKey` or any raw secret in public runtime config.
298
+
299
+ The wallet flow remains separate: `useSolanaSignAndSendTransaction()` can return after RPC submission by default, or wait for a selected commitment when `confirm: true` is passed. Keep that flow when the connected user must approve each transaction.
300
+
289
301
  ## Example App
290
302
 
291
303
  This README includes small snippets for quick reference. For a complete runnable Nuxt flow, see the example app:
@@ -314,7 +326,7 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
314
326
  - Nuxt module options are stored in public runtime config, so they must be JSON-serializable.
315
327
  - Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
316
328
  - Broad `useSolanaProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
317
- - Use `mainnet-beta` for Solana mainnet. `mainnet` is intentionally not accepted as a cluster alias.
329
+ - Use `mainnet` for Solana mainnet. This is Solana's official mainnet cluster name; the legacy `mainnet-beta` spelling is still accepted and redirects to the same endpoint.
318
330
  - Desktop native app wallets are planned but not implemented yet.
319
331
 
320
332
  ## Status
package/dist/module.cjs CHANGED
@@ -68,10 +68,10 @@ const module$1 = kit.defineNuxtModule({
68
68
  setup(options, nuxt) {
69
69
  const resolver = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs', document.baseURI).href)));
70
70
  const publicConfig = nuxt.options.runtimeConfig.public;
71
- publicConfig.solana = {
71
+ publicConfig.solana = toPublicSolanaConfig({
72
72
  ...typeof publicConfig.solana === "object" && publicConfig.solana !== null ? publicConfig.solana : {},
73
- ...toPublicSolanaConfig(options)
74
- };
73
+ ...options
74
+ });
75
75
  mergeViteOptimizeDeps(nuxt.options.vite);
76
76
  nuxt.hook("vite:extendConfig", (config, { isClient }) => {
77
77
  if (!isClient) {
@@ -82,16 +82,21 @@ const module$1 = kit.defineNuxtModule({
82
82
  mergeViteOptimizeDeps(config.environments.client);
83
83
  }
84
84
  });
85
- kit.addPlugin({
86
- src: resolver.resolve("./runtime/plugin"),
87
- mode: "client"
88
- });
85
+ if (options.clientPlugin !== false) {
86
+ kit.addPlugin({
87
+ src: resolver.resolve("./runtime/plugin"),
88
+ mode: "client"
89
+ });
90
+ }
89
91
  kit.addImports(SOLANA_IMPORTS);
90
92
  }
91
93
  });
92
94
  function toPublicSolanaConfig(options) {
93
95
  const runtimeOptions = { ...options };
94
96
  delete runtimeOptions.wallet;
97
+ delete runtimeOptions.payer;
98
+ delete runtimeOptions.payerSecretKey;
99
+ delete runtimeOptions.clientPlugin;
95
100
  return runtimeOptions;
96
101
  }
97
102
  function mergeViteOptimizeDeps(target) {
package/dist/module.d.cts CHANGED
@@ -1,7 +1,14 @@
1
1
  import { defineNuxtModule } from '@nuxt/kit';
2
2
  import { VueSolanaPluginOptions } from '@vue-solana/vue';
3
3
 
4
- type ModuleOptions = Omit<VueSolanaPluginOptions, "wallet">;
4
+ type ModuleOptions = Omit<VueSolanaPluginOptions, "wallet" | "payer" | "payerSecretKey"> & {
5
+ /**
6
+ * Set to `false` to auto-import the composables without installing the Solana
7
+ * runtime plugin. Use it when the app installs `createSolanaPlugin` itself,
8
+ * e.g. to attach a client-only `payer` that module options cannot carry.
9
+ */
10
+ clientPlugin?: boolean;
11
+ };
5
12
  type DefinedNuxtModule = ReturnType<ReturnType<typeof defineNuxtModule<ModuleOptions>>["with"]>;
6
13
  declare const module$1: DefinedNuxtModule;
7
14
 
package/dist/module.d.mts CHANGED
@@ -1,7 +1,14 @@
1
1
  import { defineNuxtModule } from '@nuxt/kit';
2
2
  import { VueSolanaPluginOptions } from '@vue-solana/vue';
3
3
 
4
- type ModuleOptions = Omit<VueSolanaPluginOptions, "wallet">;
4
+ type ModuleOptions = Omit<VueSolanaPluginOptions, "wallet" | "payer" | "payerSecretKey"> & {
5
+ /**
6
+ * Set to `false` to auto-import the composables without installing the Solana
7
+ * runtime plugin. Use it when the app installs `createSolanaPlugin` itself,
8
+ * e.g. to attach a client-only `payer` that module options cannot carry.
9
+ */
10
+ clientPlugin?: boolean;
11
+ };
5
12
  type DefinedNuxtModule = ReturnType<ReturnType<typeof defineNuxtModule<ModuleOptions>>["with"]>;
6
13
  declare const module$1: DefinedNuxtModule;
7
14
 
package/dist/module.d.ts CHANGED
@@ -1,7 +1,14 @@
1
1
  import { defineNuxtModule } from '@nuxt/kit';
2
2
  import { VueSolanaPluginOptions } from '@vue-solana/vue';
3
3
 
4
- type ModuleOptions = Omit<VueSolanaPluginOptions, "wallet">;
4
+ type ModuleOptions = Omit<VueSolanaPluginOptions, "wallet" | "payer" | "payerSecretKey"> & {
5
+ /**
6
+ * Set to `false` to auto-import the composables without installing the Solana
7
+ * runtime plugin. Use it when the app installs `createSolanaPlugin` itself,
8
+ * e.g. to attach a client-only `payer` that module options cannot carry.
9
+ */
10
+ clientPlugin?: boolean;
11
+ };
5
12
  type DefinedNuxtModule = ReturnType<ReturnType<typeof defineNuxtModule<ModuleOptions>>["with"]>;
6
13
  declare const module$1: DefinedNuxtModule;
7
14
 
package/dist/module.mjs CHANGED
@@ -65,10 +65,10 @@ const module$1 = defineNuxtModule({
65
65
  setup(options, nuxt) {
66
66
  const resolver = createResolver(import.meta.url);
67
67
  const publicConfig = nuxt.options.runtimeConfig.public;
68
- publicConfig.solana = {
68
+ publicConfig.solana = toPublicSolanaConfig({
69
69
  ...typeof publicConfig.solana === "object" && publicConfig.solana !== null ? publicConfig.solana : {},
70
- ...toPublicSolanaConfig(options)
71
- };
70
+ ...options
71
+ });
72
72
  mergeViteOptimizeDeps(nuxt.options.vite);
73
73
  nuxt.hook("vite:extendConfig", (config, { isClient }) => {
74
74
  if (!isClient) {
@@ -79,16 +79,21 @@ const module$1 = defineNuxtModule({
79
79
  mergeViteOptimizeDeps(config.environments.client);
80
80
  }
81
81
  });
82
- addPlugin({
83
- src: resolver.resolve("./runtime/plugin"),
84
- mode: "client"
85
- });
82
+ if (options.clientPlugin !== false) {
83
+ addPlugin({
84
+ src: resolver.resolve("./runtime/plugin"),
85
+ mode: "client"
86
+ });
87
+ }
86
88
  addImports(SOLANA_IMPORTS);
87
89
  }
88
90
  });
89
91
  function toPublicSolanaConfig(options) {
90
92
  const runtimeOptions = { ...options };
91
93
  delete runtimeOptions.wallet;
94
+ delete runtimeOptions.payer;
95
+ delete runtimeOptions.payerSecretKey;
96
+ delete runtimeOptions.clientPlugin;
92
97
  return runtimeOptions;
93
98
  }
94
99
  function mergeViteOptimizeDeps(target) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-solana/nuxt",
3
- "version": "2.3.0",
3
+ "version": "2.4.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.3.0"
50
+ "@vue-solana/vue": "2.4.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "nuxt": "^3.0.0 || ^4.0.0"