@vue-solana/nuxt 0.6.3 → 0.6.5
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 +15 -12
- package/dist/module.cjs +24 -12
- package/dist/module.mjs +24 -12
- 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
|
@@ -30,22 +30,20 @@ New to Solana? Start with the official docs and the project concepts guide:
|
|
|
30
30
|
|
|
31
31
|
## Compatibility
|
|
32
32
|
|
|
33
|
-
| Requirement
|
|
34
|
-
|
|
|
35
|
-
| Nuxt
|
|
36
|
-
| TypeScript
|
|
37
|
-
| Solana client
|
|
38
|
-
| Clusters
|
|
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
39
|
|
|
40
40
|
## Install
|
|
41
41
|
|
|
42
42
|
```sh
|
|
43
|
-
|
|
43
|
+
npx nuxt module add @vue-solana/nuxt
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
npm install @vue-solana/nuxt @vue-solana/vue @vue-solana/core @solana/web3-compat buffer
|
|
48
|
-
```
|
|
46
|
+
This installs the package and adds `@vue-solana/nuxt` to the `modules` array in `nuxt.config.ts`.
|
|
49
47
|
|
|
50
48
|
## Module Setup
|
|
51
49
|
|
|
@@ -128,6 +126,11 @@ The runtime plugin is client-only. Auto-imported composables can be called durin
|
|
|
128
126
|
|
|
129
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.
|
|
130
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
|
+
|
|
131
134
|
## Read RPC State
|
|
132
135
|
|
|
133
136
|
```vue
|
|
@@ -212,7 +215,7 @@ const { publicKey, connected, canSignMessage, connect, disconnect } = useSolanaW
|
|
|
212
215
|
</template>
|
|
213
216
|
```
|
|
214
217
|
|
|
215
|
-
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`.
|
|
216
219
|
|
|
217
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.
|
|
218
221
|
|
|
@@ -272,7 +275,7 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
272
275
|
- Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
|
|
273
276
|
- Broad `useSolanaProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
|
|
274
277
|
- Use `mainnet-beta` for Solana mainnet. `mainnet` is intentionally not accepted as a cluster alias.
|
|
275
|
-
- `@solana/web3-compat@0.0.21` currently has broken TypeScript package metadata. Runtime imports still use the real package,
|
|
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.
|
|
276
279
|
- Desktop native app wallets are planned but not implemented yet.
|
|
277
280
|
|
|
278
281
|
## Status
|
package/dist/module.cjs
CHANGED
|
@@ -39,10 +39,14 @@ const VITE_OPTIMIZE_DEPS = [
|
|
|
39
39
|
"tweetnacl",
|
|
40
40
|
"tweetnacl/nacl-fast.js"
|
|
41
41
|
];
|
|
42
|
+
const VITE_NEEDS_INTEROP = ["eventemitter3", "tweetnacl", "tweetnacl/nacl-fast.js"];
|
|
42
43
|
const module$1 = kit.defineNuxtModule({
|
|
43
44
|
meta: {
|
|
44
45
|
name: "@vue-solana/nuxt",
|
|
45
|
-
configKey: "solana"
|
|
46
|
+
configKey: "solana",
|
|
47
|
+
compatibility: {
|
|
48
|
+
nuxt: "^3.0.0 || ^4.0.0"
|
|
49
|
+
}
|
|
46
50
|
},
|
|
47
51
|
defaults: {
|
|
48
52
|
cluster: "devnet",
|
|
@@ -55,17 +59,16 @@ const module$1 = kit.defineNuxtModule({
|
|
|
55
59
|
...typeof publicConfig.solana === "object" && publicConfig.solana !== null ? publicConfig.solana : {},
|
|
56
60
|
...toPublicSolanaConfig(options)
|
|
57
61
|
};
|
|
58
|
-
nuxt.options.vite
|
|
59
|
-
nuxt.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
);
|
|
62
|
+
mergeViteOptimizeDeps(nuxt.options.vite);
|
|
63
|
+
nuxt.hook("vite:extendConfig", (config, { isClient }) => {
|
|
64
|
+
if (!isClient) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
mergeViteOptimizeDeps(config);
|
|
68
|
+
if (config.environments?.client) {
|
|
69
|
+
mergeViteOptimizeDeps(config.environments.client);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
69
72
|
kit.addPlugin({
|
|
70
73
|
src: resolver.resolve("./runtime/plugin"),
|
|
71
74
|
mode: "client"
|
|
@@ -78,5 +81,14 @@ function toPublicSolanaConfig(options) {
|
|
|
78
81
|
delete runtimeOptions.wallet;
|
|
79
82
|
return runtimeOptions;
|
|
80
83
|
}
|
|
84
|
+
function mergeViteOptimizeDeps(target) {
|
|
85
|
+
target.optimizeDeps ??= {};
|
|
86
|
+
target.optimizeDeps.include = Array.from(
|
|
87
|
+
/* @__PURE__ */ new Set([...target.optimizeDeps.include ?? [], ...VITE_OPTIMIZE_DEPS])
|
|
88
|
+
);
|
|
89
|
+
target.optimizeDeps.needsInterop = Array.from(
|
|
90
|
+
/* @__PURE__ */ new Set([...target.optimizeDeps.needsInterop ?? [], ...VITE_NEEDS_INTEROP])
|
|
91
|
+
);
|
|
92
|
+
}
|
|
81
93
|
|
|
82
94
|
module.exports = module$1;
|
package/dist/module.mjs
CHANGED
|
@@ -36,10 +36,14 @@ const VITE_OPTIMIZE_DEPS = [
|
|
|
36
36
|
"tweetnacl",
|
|
37
37
|
"tweetnacl/nacl-fast.js"
|
|
38
38
|
];
|
|
39
|
+
const VITE_NEEDS_INTEROP = ["eventemitter3", "tweetnacl", "tweetnacl/nacl-fast.js"];
|
|
39
40
|
const module$1 = defineNuxtModule({
|
|
40
41
|
meta: {
|
|
41
42
|
name: "@vue-solana/nuxt",
|
|
42
|
-
configKey: "solana"
|
|
43
|
+
configKey: "solana",
|
|
44
|
+
compatibility: {
|
|
45
|
+
nuxt: "^3.0.0 || ^4.0.0"
|
|
46
|
+
}
|
|
43
47
|
},
|
|
44
48
|
defaults: {
|
|
45
49
|
cluster: "devnet",
|
|
@@ -52,17 +56,16 @@ const module$1 = defineNuxtModule({
|
|
|
52
56
|
...typeof publicConfig.solana === "object" && publicConfig.solana !== null ? publicConfig.solana : {},
|
|
53
57
|
...toPublicSolanaConfig(options)
|
|
54
58
|
};
|
|
55
|
-
nuxt.options.vite
|
|
56
|
-
nuxt.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
);
|
|
59
|
+
mergeViteOptimizeDeps(nuxt.options.vite);
|
|
60
|
+
nuxt.hook("vite:extendConfig", (config, { isClient }) => {
|
|
61
|
+
if (!isClient) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
mergeViteOptimizeDeps(config);
|
|
65
|
+
if (config.environments?.client) {
|
|
66
|
+
mergeViteOptimizeDeps(config.environments.client);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
66
69
|
addPlugin({
|
|
67
70
|
src: resolver.resolve("./runtime/plugin"),
|
|
68
71
|
mode: "client"
|
|
@@ -75,5 +78,14 @@ function toPublicSolanaConfig(options) {
|
|
|
75
78
|
delete runtimeOptions.wallet;
|
|
76
79
|
return runtimeOptions;
|
|
77
80
|
}
|
|
81
|
+
function mergeViteOptimizeDeps(target) {
|
|
82
|
+
target.optimizeDeps ??= {};
|
|
83
|
+
target.optimizeDeps.include = Array.from(
|
|
84
|
+
/* @__PURE__ */ new Set([...target.optimizeDeps.include ?? [], ...VITE_OPTIMIZE_DEPS])
|
|
85
|
+
);
|
|
86
|
+
target.optimizeDeps.needsInterop = Array.from(
|
|
87
|
+
/* @__PURE__ */ new Set([...target.optimizeDeps.needsInterop ?? [], ...VITE_NEEDS_INTEROP])
|
|
88
|
+
);
|
|
89
|
+
}
|
|
78
90
|
|
|
79
91
|
export { module$1 as default };
|
|
@@ -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.5",
|
|
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",
|