@vue-solana/nuxt 2.0.0 → 2.2.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 +52 -17
- package/dist/module.cjs +13 -0
- package/dist/module.mjs +13 -0
- package/dist/runtime/plugin.cjs +13 -11
- package/dist/runtime/plugin.mjs +14 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](https://github.com/vue-solana/vue-solana/blob/main/LICENSE)
|
|
6
6
|
[](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,
|
|
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,74 @@ 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
|
-
- `
|
|
102
|
-
- `useSolanaWallets()`
|
|
104
|
+
- `useSolanaAirdrop()`
|
|
103
105
|
- `useSolanaBalance()`
|
|
104
106
|
- `useSolanaProgramAccounts()`
|
|
105
|
-
- `
|
|
106
|
-
- `
|
|
107
|
+
- `useSolanaTokenAccounts()`
|
|
108
|
+
- `useSolanaTokenBalance()`
|
|
109
|
+
- `useSolanaWallet()`
|
|
110
|
+
- `useSolanaWallets()`
|
|
107
111
|
- `useSolanaSignMessage()`
|
|
112
|
+
- `useSolanaSignIn()`
|
|
108
113
|
- `useSolanaSignAndSendTransaction()`
|
|
114
|
+
- `useSolanaSignTransactions()`
|
|
115
|
+
- `useSolanaSignAndSendTransactions()`
|
|
116
|
+
- `useSolanaTransactionConfirmation()`
|
|
117
|
+
- `useSolanaSignatureStatus()`
|
|
118
|
+
- `useSolanaAction()`
|
|
119
|
+
- `useSolanaRequest()`
|
|
120
|
+
- `useSolanaSubscription()`
|
|
121
|
+
- `useSolanaTrackedData()`
|
|
122
|
+
- `useSolanaSelectedWalletAccount()`
|
|
123
|
+
- `useSolanaPayer()`
|
|
124
|
+
- `useSolanaIdentity()`
|
|
125
|
+
- `useSolanaPlanTransaction()`
|
|
126
|
+
- `useSolanaPlanTransactions()`
|
|
109
127
|
|
|
110
128
|
| Composable | Purpose |
|
|
111
129
|
| ------------------------------------ | -------------------------------------------------------------------------------- |
|
|
112
130
|
| `useSolana()` | Full Solana context. |
|
|
131
|
+
| `useSolanaClient()` | Reactive Kit RPC client and its compositions. |
|
|
113
132
|
| `useSolanaRpc()` | Cluster, endpoint, connection status, latest blockhash, and `checkConnection()`. |
|
|
114
|
-
| `useSolanaConnection()` |
|
|
133
|
+
| `useSolanaConnection()` | Deprecated alias for the Kit client returned by `useSolanaClient()`. |
|
|
115
134
|
| `useSolanaAccountInfo()` | Account info reads and optional subscriptions. |
|
|
116
|
-
| `
|
|
117
|
-
| `useSolanaWallets()` | Wallet discovery, selected wallet state, and selection actions. |
|
|
135
|
+
| `useSolanaAirdrop()` | Airdrops SOL into an account on test networks and local validators. |
|
|
118
136
|
| `useSolanaBalance()` | Lamport balance reads. |
|
|
119
137
|
| `useSolanaProgramAccounts()` | Program account scans with filters and `dataSlice`. |
|
|
120
|
-
| `
|
|
121
|
-
| `
|
|
138
|
+
| `useSolanaTokenAccounts()` | SPL token account reads for an owner. |
|
|
139
|
+
| `useSolanaTokenBalance()` | SPL token balance reads for a mint/owner pair. |
|
|
140
|
+
| `useSolanaWallet()` | Active wallet state and connect/disconnect actions. |
|
|
141
|
+
| `useSolanaWallets()` | Wallet discovery, selected wallet state, and selection actions. |
|
|
122
142
|
| `useSolanaSignMessage()` | Wallet message signing. |
|
|
143
|
+
| `useSolanaSignIn()` | Sign In With Solana (SIWS) trigger returning a server-verifiable result. |
|
|
123
144
|
| `useSolanaSignAndSendTransaction()` | Wallet transaction signing, sending, and optional confirmation. |
|
|
145
|
+
| `useSolanaSignTransactions()` | Batch transaction signing (falls back to `signAllTransactions`). |
|
|
146
|
+
| `useSolanaSignAndSendTransactions()` | Batch sign-and-send returning one signature per transaction. |
|
|
147
|
+
| `useSolanaTransactionConfirmation()` | Confirmation state for an already submitted signature. |
|
|
148
|
+
| `useSolanaSignatureStatus()` | Signature status reads with optional polling or websocket subscription. |
|
|
149
|
+
| `useSolanaAction()` | Generic async action state machine; each dispatch aborts the prior attempt. |
|
|
150
|
+
| `useSolanaRequest()` | One-shot Kit request with stale-while-revalidate as its source changes. |
|
|
151
|
+
| `useSolanaSubscription()` | Live data over a Kit reactive stream store (e.g. RPC subscriptions). |
|
|
152
|
+
| `useSolanaTrackedData()` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
|
|
153
|
+
| `useSolanaSelectedWalletAccount()` | App-wide selected wallet account context provided by the runtime plugin. |
|
|
154
|
+
| `useSolanaPayer()` | Reactive Kit client `payer` signer ref. |
|
|
155
|
+
| `useSolanaIdentity()` | Reactive Kit client `identity` signer ref. |
|
|
156
|
+
| `useSolanaPlanTransaction()` | Plans a single transaction message from instruction inputs without signing. |
|
|
157
|
+
| `useSolanaPlanTransactions()` | Plans a batch of transaction messages from instruction inputs. |
|
|
124
158
|
|
|
125
159
|
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
160
|
|
|
127
161
|
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
162
|
|
|
129
|
-
The
|
|
163
|
+
The module also installs the app-wide selected wallet account context, so `useSolanaSelectedWalletAccount()` works in any component without an explicit provider.
|
|
164
|
+
|
|
165
|
+
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
166
|
|
|
131
|
-
- `@vue-solana/nuxt/
|
|
167
|
+
- `@vue-solana/nuxt/kit`
|
|
132
168
|
- `@vue-solana/nuxt/buffer-polyfill`
|
|
133
169
|
|
|
134
170
|
## Read RPC State
|
|
@@ -207,7 +243,7 @@ const { publicKey, connected, canSignMessage, connect, disconnect } = useSolanaW
|
|
|
207
243
|
</button>
|
|
208
244
|
<p>Selected: {{ selectedWallet?.name ?? "None" }}</p>
|
|
209
245
|
<p>Connected: {{ connected }}</p>
|
|
210
|
-
<p>Public key: {{ publicKey
|
|
246
|
+
<p>Public key: {{ publicKey }}</p>
|
|
211
247
|
<p>Can sign messages: {{ canSignMessage }}</p>
|
|
212
248
|
<button type="button" :disabled="!selectedWallet || connected" @click="connect">Connect</button>
|
|
213
249
|
<button type="button" :disabled="!connected" @click="disconnect">Disconnect</button>
|
|
@@ -275,9 +311,8 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
275
311
|
- Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
|
|
276
312
|
- Broad `useSolanaProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
|
|
277
313
|
- 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
314
|
- Desktop native app wallets are planned but not implemented yet.
|
|
280
315
|
|
|
281
316
|
## Status
|
|
282
317
|
|
|
283
|
-
This package provides RPC, balance, browser extension wallet, Android mobile wallet, iOS browser wallet, message signing, and transaction composables for Nuxt apps.
|
|
318
|
+
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,30 @@ 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"],
|
|
9
|
+
["useAirdrop", "useSolanaAirdrop"],
|
|
8
10
|
["useBalance", "useSolanaBalance"],
|
|
9
11
|
["useConnection", "useSolanaConnection"],
|
|
12
|
+
["useIdentity", "useSolanaIdentity"],
|
|
13
|
+
["usePlanTransaction", "useSolanaPlanTransaction"],
|
|
14
|
+
["usePlanTransactions", "useSolanaPlanTransactions"],
|
|
10
15
|
["useProgramAccounts", "useSolanaProgramAccounts"],
|
|
16
|
+
["usePayer", "useSolanaPayer"],
|
|
17
|
+
["useRequest", "useSolanaRequest"],
|
|
11
18
|
["useRpc", "useSolanaRpc"],
|
|
19
|
+
["useSelectedWalletAccount", "useSolanaSelectedWalletAccount"],
|
|
20
|
+
["useSignIn", "useSolanaSignIn"],
|
|
12
21
|
["useSignMessage", "useSolanaSignMessage"],
|
|
13
22
|
["useSignAndSendTransaction", "useSolanaSignAndSendTransaction"],
|
|
23
|
+
["useSignTransactions", "useSolanaSignTransactions"],
|
|
24
|
+
["useSignAndSendTransactions", "useSolanaSignAndSendTransactions"],
|
|
14
25
|
["useSignatureStatus", "useSolanaSignatureStatus"],
|
|
15
26
|
["useSolana", "useSolana"],
|
|
16
27
|
["useSolanaClient", "useSolanaClient"],
|
|
28
|
+
["useSubscription", "useSolanaSubscription"],
|
|
17
29
|
["useTokenAccounts", "useSolanaTokenAccounts"],
|
|
18
30
|
["useTokenBalance", "useSolanaTokenBalance"],
|
|
31
|
+
["useTrackedData", "useSolanaTrackedData"],
|
|
19
32
|
["useTransactionConfirmation", "useSolanaTransactionConfirmation"],
|
|
20
33
|
["useWallet", "useSolanaWallet"],
|
|
21
34
|
["useWallets", "useSolanaWallets"]
|
package/dist/module.mjs
CHANGED
|
@@ -2,17 +2,30 @@ import { defineNuxtModule, createResolver, addPlugin, addImports } from '@nuxt/k
|
|
|
2
2
|
|
|
3
3
|
const SOLANA_COMPOSABLE_IMPORTS = [
|
|
4
4
|
["useAccountInfo", "useSolanaAccountInfo"],
|
|
5
|
+
["useAction", "useSolanaAction"],
|
|
6
|
+
["useAirdrop", "useSolanaAirdrop"],
|
|
5
7
|
["useBalance", "useSolanaBalance"],
|
|
6
8
|
["useConnection", "useSolanaConnection"],
|
|
9
|
+
["useIdentity", "useSolanaIdentity"],
|
|
10
|
+
["usePlanTransaction", "useSolanaPlanTransaction"],
|
|
11
|
+
["usePlanTransactions", "useSolanaPlanTransactions"],
|
|
7
12
|
["useProgramAccounts", "useSolanaProgramAccounts"],
|
|
13
|
+
["usePayer", "useSolanaPayer"],
|
|
14
|
+
["useRequest", "useSolanaRequest"],
|
|
8
15
|
["useRpc", "useSolanaRpc"],
|
|
16
|
+
["useSelectedWalletAccount", "useSolanaSelectedWalletAccount"],
|
|
17
|
+
["useSignIn", "useSolanaSignIn"],
|
|
9
18
|
["useSignMessage", "useSolanaSignMessage"],
|
|
10
19
|
["useSignAndSendTransaction", "useSolanaSignAndSendTransaction"],
|
|
20
|
+
["useSignTransactions", "useSolanaSignTransactions"],
|
|
21
|
+
["useSignAndSendTransactions", "useSolanaSignAndSendTransactions"],
|
|
11
22
|
["useSignatureStatus", "useSolanaSignatureStatus"],
|
|
12
23
|
["useSolana", "useSolana"],
|
|
13
24
|
["useSolanaClient", "useSolanaClient"],
|
|
25
|
+
["useSubscription", "useSolanaSubscription"],
|
|
14
26
|
["useTokenAccounts", "useSolanaTokenAccounts"],
|
|
15
27
|
["useTokenBalance", "useSolanaTokenBalance"],
|
|
28
|
+
["useTrackedData", "useSolanaTrackedData"],
|
|
16
29
|
["useTransactionConfirmation", "useSolanaTransactionConfirmation"],
|
|
17
30
|
["useWallet", "useSolanaWallet"],
|
|
18
31
|
["useWallets", "useSolanaWallets"]
|
package/dist/runtime/plugin.cjs
CHANGED
|
@@ -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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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;
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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.
|
|
3
|
+
"version": "2.2.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.
|
|
50
|
+
"@vue-solana/vue": "2.2.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"nuxt": "^3.0.0 || ^4.0.0"
|