@vue-solana/nuxt 0.6.2 → 0.6.4
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 +67 -36
- package/dist/module.cjs +4 -1
- package/dist/module.mjs +4 -1
- package/dist/runtime/buffer-polyfill.cjs +8 -0
- package/dist/runtime/buffer-polyfill.d.cts +2 -0
- package/dist/runtime/buffer-polyfill.d.mts +2 -0
- package/dist/runtime/buffer-polyfill.d.ts +2 -0
- package/dist/runtime/buffer-polyfill.mjs +1 -0
- package/dist/runtime/web3.cjs +13 -0
- package/dist/runtime/web3.d.cts +1 -0
- package/dist/runtime/web3.d.mts +1 -0
- package/dist/runtime/web3.d.ts +1 -0
- package/dist/runtime/web3.mjs +1 -0
- package/package.json +15 -7
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# @vue-solana/nuxt
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@vue-solana/nuxt)
|
|
4
|
+
[](https://www.npmjs.com/package/@vue-solana/nuxt)
|
|
5
|
+
[](https://github.com/vue-solana/vue-solana/blob/main/LICENSE)
|
|
6
|
+
[](https://vue-solana-docs.vercel.app/packages/nuxt)
|
|
7
|
+
|
|
8
|
+
Nuxt module for Solana wallet, RPC, account, message signing, and transaction composables with auto-imports.
|
|
4
9
|
|
|
5
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.
|
|
6
11
|
|
|
@@ -14,15 +19,31 @@ New to Solana? Start with the official docs and the project concepts guide:
|
|
|
14
19
|
- [Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
15
20
|
- [Live demo](https://vue-solana-docs.vercel.app/demo)
|
|
16
21
|
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- Installs the Vue Solana plugin automatically.
|
|
25
|
+
- Auto-imports Solana RPC, wallet, account, balance, message signing, and transaction composables.
|
|
26
|
+
- Uses direct Vue package subpaths to avoid pulling unrelated runtime code into Nuxt bundles.
|
|
27
|
+
- Client-only runtime plugin with SSR-safe inert composable state before hydration.
|
|
28
|
+
- Unified wallet discovery for browser extensions, Android Mobile Wallet Adapter, and supported iOS browser wallets.
|
|
29
|
+
- Nuxt 3 and Nuxt 4 support.
|
|
30
|
+
|
|
31
|
+
## Compatibility
|
|
32
|
+
|
|
33
|
+
| Requirement | Supported |
|
|
34
|
+
| ------------- | ----------------------------------------------- |
|
|
35
|
+
| Nuxt | `^3.0.0 \|\| ^4.0.0` |
|
|
36
|
+
| TypeScript | TypeScript 5.x recommended |
|
|
37
|
+
| Solana client | Provided through `@vue-solana/core` |
|
|
38
|
+
| Clusters | `mainnet-beta`, `devnet`, `testnet`, `localnet` |
|
|
39
|
+
|
|
17
40
|
## Install
|
|
18
41
|
|
|
19
42
|
```sh
|
|
20
|
-
|
|
43
|
+
npx nuxt module add @vue-solana/nuxt
|
|
21
44
|
```
|
|
22
45
|
|
|
23
|
-
|
|
24
|
-
npm install @vue-solana/nuxt @vue-solana/vue @vue-solana/core @solana/web3-compat buffer
|
|
25
|
-
```
|
|
46
|
+
This installs the package and adds `@vue-solana/nuxt` to the `modules` array in `nuxt.config.ts`.
|
|
26
47
|
|
|
27
48
|
## Module Setup
|
|
28
49
|
|
|
@@ -52,6 +73,17 @@ Supported clusters are `mainnet-beta`, `devnet`, `testnet`, and `localnet`. Use
|
|
|
52
73
|
|
|
53
74
|
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.
|
|
54
75
|
|
|
76
|
+
### Module Options
|
|
77
|
+
|
|
78
|
+
| Option | Type | Default | Description |
|
|
79
|
+
| -------------- | ------------------------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
|
|
80
|
+
| `cluster` | `"mainnet-beta" \| "devnet" \| "testnet" \| "localnet"` | `"devnet"` | Solana cluster used when `endpoint` is omitted. |
|
|
81
|
+
| `endpoint` | `string` | Public endpoint for `cluster` | HTTP RPC endpoint. Use a dedicated RPC provider for production apps. |
|
|
82
|
+
| `wsEndpoint` | `string` | Derived from `endpoint` | WebSocket RPC endpoint. |
|
|
83
|
+
| `commitment` | Solana commitment | Solana client default | Default commitment for created connections. |
|
|
84
|
+
| `autoConnect` | `boolean` | `false` | Reconnects only a previously selected discovered wallet identity when it is discovered again. |
|
|
85
|
+
| `mobileWallet` | JSON-serializable mobile wallet options or `false` | Enabled on supported Android clients | Configures or disables Android Mobile Wallet Adapter registration. |
|
|
86
|
+
|
|
55
87
|
For development, use `devnet` and request free test SOL from the official faucet:
|
|
56
88
|
|
|
57
89
|
```txt
|
|
@@ -75,10 +107,30 @@ The module auto-imports these composables from direct `@vue-solana/vue/*` subpat
|
|
|
75
107
|
- `useSolanaSignMessage()`
|
|
76
108
|
- `useSolanaSignAndSendTransaction()`
|
|
77
109
|
|
|
110
|
+
| Composable | Purpose |
|
|
111
|
+
| ------------------------------------ | -------------------------------------------------------------------------------- |
|
|
112
|
+
| `useSolana()` | Full Solana context. |
|
|
113
|
+
| `useSolanaRpc()` | Cluster, endpoint, connection status, latest blockhash, and `checkConnection()`. |
|
|
114
|
+
| `useSolanaConnection()` | Raw Solana `Connection`. |
|
|
115
|
+
| `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
|
+
| `useSolanaBalance()` | Lamport balance reads. |
|
|
119
|
+
| `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. |
|
|
122
|
+
| `useSolanaSignMessage()` | Wallet message signing. |
|
|
123
|
+
| `useSolanaSignAndSendTransaction()` | Wallet transaction signing, sending, and optional confirmation. |
|
|
124
|
+
|
|
78
125
|
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.
|
|
79
126
|
|
|
80
127
|
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.
|
|
81
128
|
|
|
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:
|
|
130
|
+
|
|
131
|
+
- `@vue-solana/nuxt/web3`
|
|
132
|
+
- `@vue-solana/nuxt/buffer-polyfill`
|
|
133
|
+
|
|
82
134
|
## Read RPC State
|
|
83
135
|
|
|
84
136
|
```vue
|
|
@@ -163,7 +215,7 @@ const { publicKey, connected, canSignMessage, connect, disconnect } = useSolanaW
|
|
|
163
215
|
</template>
|
|
164
216
|
```
|
|
165
217
|
|
|
166
|
-
Browser extension wallets are discovered through the Solana Wallet Standard. Android Mobile Wallet Adapter wallets are registered through `@solana-mobile/wallet-standard-mobile` on supported Android Chrome clients and exposed through the same wallet list. Wallet actions work after selecting a discovered wallet or configuring a custom `SolanaWallet`.
|
|
218
|
+
Browser extension wallets are discovered through the Solana Wallet Standard. Android Mobile Wallet Adapter wallets are registered through `@solana-mobile/wallet-standard-mobile` on supported Android Chrome clients and exposed through the same wallet list. iOS Phantom, Solflare, and Backpack entries are exposed through wallet-specific universal links on iOS browsers. Wallet actions work after selecting a discovered wallet or configuring a custom `SolanaWallet`.
|
|
167
219
|
|
|
168
220
|
Selected discovered wallets are persisted under `localStorage["vue-solana:selected-wallet"]` as non-sensitive identity metadata: `name`, and `platform`/`source` when available. On reload, Vue Solana restores the selected wallet if the same wallet is discovered again. Set `solana.autoConnect: true` to opt into calling `connect()` for that restored wallet; arbitrary installed wallets are never auto-connected. Calling `selectWallet(null)` or `setWallet(customWallet)` clears the stored selection.
|
|
169
221
|
|
|
@@ -216,37 +268,16 @@ npx skills add vue-solana/vue-solana --skill vue-solana
|
|
|
216
268
|
|
|
217
269
|
Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
218
270
|
|
|
219
|
-
##
|
|
220
|
-
|
|
221
|
-
`@solana/web3-compat@0.0.21` currently has broken TypeScript metadata. Runtime imports still use the real package, but TypeScript consumers may need a local declaration shim.
|
|
222
|
-
|
|
223
|
-
If TypeScript cannot resolve `@solana/web3-compat`, add `types/web3-compat.d.ts` to your app:
|
|
224
|
-
|
|
225
|
-
```ts
|
|
226
|
-
declare module "@solana/web3-compat" {
|
|
227
|
-
export type {
|
|
228
|
-
AccountInfo,
|
|
229
|
-
Commitment,
|
|
230
|
-
RpcResponseAndContext,
|
|
231
|
-
SendOptions,
|
|
232
|
-
SignatureResult,
|
|
233
|
-
SignatureStatus,
|
|
234
|
-
TransactionSignature,
|
|
235
|
-
} from "@solana/web3.js";
|
|
236
|
-
export {
|
|
237
|
-
Connection,
|
|
238
|
-
Keypair,
|
|
239
|
-
PublicKey,
|
|
240
|
-
SystemProgram,
|
|
241
|
-
Transaction,
|
|
242
|
-
TransactionInstruction,
|
|
243
|
-
VersionedTransaction,
|
|
244
|
-
} from "@solana/web3.js";
|
|
245
|
-
}
|
|
246
|
-
```
|
|
271
|
+
## Caveats
|
|
247
272
|
|
|
248
|
-
|
|
273
|
+
- The runtime plugin is client-only. Auto-imported composables are SSR-safe, but real RPC and wallet work should run after hydration or in user actions.
|
|
274
|
+
- Nuxt module options are stored in public runtime config, so they must be JSON-serializable.
|
|
275
|
+
- Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
|
|
276
|
+
- Broad `useSolanaProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
|
|
277
|
+
- 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
|
+
- Desktop native app wallets are planned but not implemented yet.
|
|
249
280
|
|
|
250
281
|
## Status
|
|
251
282
|
|
|
252
|
-
This package
|
|
283
|
+
This package provides RPC, balance, browser extension wallet, Android mobile wallet, iOS browser wallet, message signing, and transaction composables for Nuxt apps.
|
package/dist/module.cjs
CHANGED
|
@@ -42,7 +42,10 @@ const VITE_OPTIMIZE_DEPS = [
|
|
|
42
42
|
const module$1 = kit.defineNuxtModule({
|
|
43
43
|
meta: {
|
|
44
44
|
name: "@vue-solana/nuxt",
|
|
45
|
-
configKey: "solana"
|
|
45
|
+
configKey: "solana",
|
|
46
|
+
compatibility: {
|
|
47
|
+
nuxt: "^3.0.0 || ^4.0.0"
|
|
48
|
+
}
|
|
46
49
|
},
|
|
47
50
|
defaults: {
|
|
48
51
|
cluster: "devnet",
|
package/dist/module.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Buffer, installSolanaBufferPolyfill } from '@vue-solana/vue/buffer-polyfill';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const web3 = require('@vue-solana/vue/web3');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
exports.Connection = web3.Connection;
|
|
8
|
+
exports.Keypair = web3.Keypair;
|
|
9
|
+
exports.PublicKey = web3.PublicKey;
|
|
10
|
+
exports.SystemProgram = web3.SystemProgram;
|
|
11
|
+
exports.Transaction = web3.Transaction;
|
|
12
|
+
exports.TransactionInstruction = web3.TransactionInstruction;
|
|
13
|
+
exports.VersionedTransaction = web3.VersionedTransaction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AccountInfo, Commitment, Connection, Keypair, PublicKey, RpcResponseAndContext, SendOptions, SignatureResult, SignatureStatus, SystemProgram, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from '@vue-solana/vue/web3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AccountInfo, Commitment, Connection, Keypair, PublicKey, RpcResponseAndContext, SendOptions, SignatureResult, SignatureStatus, SystemProgram, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from '@vue-solana/vue/web3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AccountInfo, Commitment, Connection, Keypair, PublicKey, RpcResponseAndContext, SendOptions, SignatureResult, SignatureStatus, SystemProgram, Transaction, TransactionInstruction, TransactionSignature, VersionedTransaction } from '@vue-solana/vue/web3';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Connection, Keypair, PublicKey, SystemProgram, Transaction, TransactionInstruction, VersionedTransaction } from '@vue-solana/vue/web3';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-solana/nuxt",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Nuxt module for Solana applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -23,12 +23,22 @@
|
|
|
23
23
|
"type": "module",
|
|
24
24
|
"main": "./dist/module.cjs",
|
|
25
25
|
"module": "./dist/module.mjs",
|
|
26
|
-
"types": "./dist/module.d.
|
|
26
|
+
"types": "./dist/module.d.mts",
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
|
-
"types": "./dist/module.d.
|
|
29
|
+
"types": "./dist/module.d.mts",
|
|
30
30
|
"import": "./dist/module.mjs",
|
|
31
31
|
"require": "./dist/module.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./buffer-polyfill": {
|
|
34
|
+
"types": "./dist/runtime/buffer-polyfill.d.ts",
|
|
35
|
+
"import": "./dist/runtime/buffer-polyfill.mjs",
|
|
36
|
+
"require": "./dist/runtime/buffer-polyfill.cjs"
|
|
37
|
+
},
|
|
38
|
+
"./web3": {
|
|
39
|
+
"types": "./dist/runtime/web3.d.ts",
|
|
40
|
+
"import": "./dist/runtime/web3.mjs",
|
|
41
|
+
"require": "./dist/runtime/web3.cjs"
|
|
32
42
|
}
|
|
33
43
|
},
|
|
34
44
|
"files": [
|
|
@@ -38,16 +48,14 @@
|
|
|
38
48
|
"access": "public"
|
|
39
49
|
},
|
|
40
50
|
"dependencies": {
|
|
41
|
-
"@
|
|
42
|
-
"@vue-solana/vue": "0.8.
|
|
51
|
+
"@solana/web3-compat": "^0.0.21",
|
|
52
|
+
"@vue-solana/vue": "0.8.3"
|
|
43
53
|
},
|
|
44
54
|
"peerDependencies": {
|
|
45
|
-
"@solana/web3-compat": "^0.0.21",
|
|
46
55
|
"nuxt": "^3.0.0 || ^4.0.0"
|
|
47
56
|
},
|
|
48
57
|
"devDependencies": {
|
|
49
58
|
"@nuxt/kit": "^4.4.6",
|
|
50
|
-
"@solana/web3-compat": "^0.0.21",
|
|
51
59
|
"nuxt": "^4.4.6",
|
|
52
60
|
"typescript": "^5.8.3",
|
|
53
61
|
"unbuild": "^3.5.0",
|