@vue-solana/vue 4.1.0 → 4.1.2
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 +81 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,7 +12,9 @@ Solana wallet, RPC, account, message signing, and transaction composables for Vu
|
|
|
12
12
|
This package is part of the Vue Solana family. Choose based on your app framework:
|
|
13
13
|
|
|
14
14
|
- [`@vue-solana/core`](https://www.npmjs.com/package/@vue-solana/core) — framework-agnostic Solana primitives: Kit RPC client helpers, wallet types, Android MWA registration, iOS browser wallet helpers, message signing, token account reads, and transaction helpers. **Use this directly** when you want shared RPC/wallet/transaction helpers without installing a Vue plugin (non-Vue apps, server/relayer code, or your own framework integration).
|
|
15
|
+
|
|
15
16
|
- [`@vue-solana/vue`](https://www.npmjs.com/package/@vue-solana/vue) — Vue 3 plugin plus composables for RPC, account, balance, wallet, message signing, live data, and transactions. **Use this** in plain Vue 3 apps (Vite, etc.). (This package.)
|
|
17
|
+
|
|
16
18
|
- [`@vue-solana/nuxt`](https://www.npmjs.com/package/@vue-solana/nuxt) — Nuxt module that installs the Vue plugin and auto-imports the composables. **Use this** in Nuxt 3/4 apps.
|
|
17
19
|
|
|
18
20
|
This package builds on `@vue-solana/core`; install `@vue-solana/vue` for plain Vue apps and `@vue-solana/nuxt` for Nuxt apps.
|
|
@@ -22,28 +24,49 @@ Use this package in Vue 3 apps that need Solana RPC access, balance reads, walle
|
|
|
22
24
|
New to Solana? Start with the official docs and the project concepts guide:
|
|
23
25
|
|
|
24
26
|
- [Solana Documentation](https://solana.com/docs)
|
|
27
|
+
|
|
25
28
|
- [Solana RPC Methods](https://solana.com/docs/rpc)
|
|
29
|
+
|
|
26
30
|
- [Solana Clusters](https://solana.com/docs/references/clusters)
|
|
31
|
+
|
|
27
32
|
- [Vue Solana Concepts Guide](https://vue-solana-docs.vercel.app/concepts/solana-for-vue-developers)
|
|
33
|
+
|
|
28
34
|
- [`@vue-solana/vue` docs](https://vue-solana-docs.vercel.app/packages/vue)
|
|
35
|
+
|
|
29
36
|
- [Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
37
|
+
|
|
30
38
|
- [Live demo](https://vue-solana-docs.vercel.app/demo)
|
|
31
39
|
|
|
32
40
|
## Features
|
|
33
41
|
|
|
34
42
|
- Vue plugin for shared Solana RPC and wallet context.
|
|
43
|
+
|
|
35
44
|
- SSR-safe composables that return inert state when no client plugin context is available.
|
|
45
|
+
|
|
36
46
|
- RPC status and latest blockhash reads.
|
|
47
|
+
|
|
37
48
|
- Balance, account info, program account, signature status, token account, and token balance composables.
|
|
49
|
+
|
|
38
50
|
- Unified wallet discovery and selection for browser extensions, Android Mobile Wallet Adapter, and supported iOS browser wallets.
|
|
51
|
+
|
|
39
52
|
- Message signing helpers for wallet ownership and authentication challenges.
|
|
53
|
+
|
|
40
54
|
- Sign In With Solana (SIWS) authentication through `useSignIn()`.
|
|
55
|
+
|
|
41
56
|
- App-wide selected wallet account context with persistence.
|
|
57
|
+
|
|
42
58
|
- Transaction submission and confirmation state helpers, including batch signing and sign-and-send.
|
|
59
|
+
|
|
60
|
+
- Solana Pay request building, QR rendering and scanning, and reference-based settlement confirmation (`useSolanaPay`, `useSolanaPayConfirmation`, `useSolanaQrCode`, `useSolanaQrScanner`).
|
|
61
|
+
|
|
43
62
|
- Live data composables over Kit reactive stores (`useRequest`, `useSubscription`, `useTrackedData`) plus SWR cache adapters.
|
|
63
|
+
|
|
44
64
|
- A generic async action state machine (`useAction`) built on `@vue-solana/core/action`.
|
|
65
|
+
|
|
45
66
|
- Reactive Kit client signers (`usePayer`, `useIdentity`) and transaction planning (`usePlanTransaction`, `usePlanTransactions`) with fail-fast client capability assertions.
|
|
67
|
+
|
|
46
68
|
- Client-sent transactions through the official Kit planner and RPC plan-sending executor installed by the default client.
|
|
69
|
+
|
|
47
70
|
- Direct subpath exports for narrower imports.
|
|
48
71
|
|
|
49
72
|
## Compatibility
|
|
@@ -55,6 +78,8 @@ New to Solana? Start with the official docs and the project concepts guide:
|
|
|
55
78
|
| Solana client | Provided through `@vue-solana/core` |
|
|
56
79
|
| Clusters | `mainnet` (alias `mainnet-beta`), `devnet`, `testnet`, `localnet` |
|
|
57
80
|
|
|
81
|
+
<br>
|
|
82
|
+
|
|
58
83
|
## Install
|
|
59
84
|
|
|
60
85
|
```sh
|
|
@@ -127,6 +152,8 @@ Supported clusters are `mainnet` (legacy alias `mainnet-beta`), `devnet`, `testn
|
|
|
127
152
|
| `mobileWallet` | `MobileWalletOptions \| false` | Enabled on supported Android clients | Configures or disables Android Mobile Wallet Adapter registration. |
|
|
128
153
|
| `iosWallet` | `iOSWalletOptions \| false` | Enabled on iOS browsers | Configures or disables iOS browser wallet universal links (Phantom, Solflare, Backpack). |
|
|
129
154
|
|
|
155
|
+
<br>
|
|
156
|
+
|
|
130
157
|
The root export remains supported. For composables, prefer direct subpath imports in new code so bundlers can avoid evaluating unrelated package entry code:
|
|
131
158
|
|
|
132
159
|
```ts
|
|
@@ -380,11 +407,16 @@ await execute(transaction);
|
|
|
380
407
|
| `minContextSlot` | Slot at which any blockhash or nonce in the transaction is known to exist; sending before it can be rejected. |
|
|
381
408
|
| `preflightCommitment` | Commitment used for preflight simulation. |
|
|
382
409
|
|
|
410
|
+
<br>
|
|
411
|
+
|
|
383
412
|
Return shapes:
|
|
384
413
|
|
|
385
414
|
- `useSignMessage().execute(bytes)` resolves to `{ signedMessage, signature }`, both `Uint8Array`.
|
|
415
|
+
|
|
386
416
|
- `useSignTransactions().execute(transactions)` resolves to the signed `Uint8Array[]` (also exposed as `signedTransactions`); pass a single-element array for one transaction.
|
|
417
|
+
|
|
387
418
|
- `useSignAndSendTransaction().execute(transaction)` resolves to the submitted `signature` string; with `confirm: true` it also fills `confirmation`.
|
|
419
|
+
|
|
388
420
|
- `useSignAndSendTransactions().execute(transactions)` resolves to a `string[]` of signatures (also exposed as `signatures`).
|
|
389
421
|
|
|
390
422
|
A wallet may modify the message or transaction before signing — for example to add its own instruction or change the fee payer — and the Wallet Standard explicitly allows it. Re-read the returned `signedMessage` or signed transaction bytes instead of assuming they match your input byte-for-byte.
|
|
@@ -405,6 +437,8 @@ Configure a direct client with `payer` or `payerSecretKey`. `payerSecretKey` is
|
|
|
405
437
|
| Input | Instructions, instruction plans, transaction messages, plans | Raw transaction bytes (`Uint8Array`) |
|
|
406
438
|
| Multiple transactions | Yes, as a batch in one call | Yes, one or more wallet requests |
|
|
407
439
|
|
|
440
|
+
<br>
|
|
441
|
+
|
|
408
442
|
Use the client flow for automated or server-backed signing (airdrop faucet, cron jobs, relayer fees paid by your keypair), and the wallet flow when the end user must own and approve each transaction.
|
|
409
443
|
|
|
410
444
|
**Default client composition.** `createSolanaPlugin()` and `createSolanaClient()` compose `solanaRpc()` followed by `rpcAirdrop()` by default; `solanaRpc()` installs `rpcTransactionPlanner()`, `rpcTransactionPlanSigningExecutor()`, and `rpcTransactionPlanSendingExecutor()` itself. The old custom fallback sender is not used, so `useSendTransaction()` and `useSendTransactions()` do not need a second manual plugin installation. The official executor waits for `confirmed` commitment before `execute()` resolves and the composable reports `sent`. A custom client must still provide the planner and sending executor and a `payer`.
|
|
@@ -536,7 +570,9 @@ await dispatch(inputB); // aborts dispatch(inputA) before starting
|
|
|
536
570
|
```
|
|
537
571
|
|
|
538
572
|
- `useAction` keeps the handler in a ref — every `dispatch` runs the latest closure, so there is no deps array to keep in sync. In-flight calls keep running with the closure they started with.
|
|
573
|
+
|
|
539
574
|
- `dispatch` returns a `Promise<TResult>`. If a newer dispatch supersedes it, the older promise rejects with an abort error; awaiters should treat that as "superseded", not a failure, and fresh awaits win.
|
|
575
|
+
|
|
540
576
|
- Calling `dispatch` again aborts the prior in-flight call with a fresh `AbortSignal`, and resets state to `idle` before the new run starts.
|
|
541
577
|
|
|
542
578
|
### Sign In With Solana
|
|
@@ -637,7 +673,7 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
637
673
|
| `clearSwrCache()` | Clears every cached SWR entry. |
|
|
638
674
|
| `deleteSwrKey(key)` | Removes a single cached SWR entry by full cache key (including adapter prefix). |
|
|
639
675
|
| `useSignIn(input?)` | Sign In With Solana (SIWS) trigger returning `{ account, signedMessage, signature }` for server-side verification. |
|
|
640
|
-
| `useSolanaPay()` | Builds/parses Solana Pay transfer request URLs and
|
|
676
|
+
| `useSolanaPay()` | Builds/parses Solana Pay transfer request URLs, generates a reference, and verifies settlement against it. |
|
|
641
677
|
| `useSolanaPayConfirmation()` | Polls payment status for a Solana Pay reference. |
|
|
642
678
|
| `useSolanaQrCode()` | Renders a Solana Pay URL as an SVG QR code. |
|
|
643
679
|
| `useSolanaQrScanner()` | Scans Solana Pay QR codes through the camera and `BarcodeDetector`. |
|
|
@@ -654,58 +690,102 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
654
690
|
| `useSendTransaction()` | Uses the official client transaction-sending capability to plan, sign, submit, and wait for `confirmed` commitment (no wallet). |
|
|
655
691
|
| `useSendTransactions()` | Sends a batch through the same official capability, waiting for `confirmed` commitment. |
|
|
656
692
|
|
|
693
|
+
<br>
|
|
694
|
+
|
|
657
695
|
Direct composable subpaths:
|
|
658
696
|
|
|
659
697
|
- `@vue-solana/vue/useSolana`
|
|
698
|
+
|
|
660
699
|
- `@vue-solana/vue/useSolanaClient`
|
|
700
|
+
|
|
661
701
|
- `@vue-solana/vue/useRpc`
|
|
702
|
+
|
|
662
703
|
- `@vue-solana/vue/useConnection`
|
|
704
|
+
|
|
663
705
|
- `@vue-solana/vue/useAccountInfo`
|
|
706
|
+
|
|
664
707
|
- `@vue-solana/vue/useAirdrop`
|
|
708
|
+
|
|
665
709
|
- `@vue-solana/vue/useBalance`
|
|
710
|
+
|
|
666
711
|
- `@vue-solana/vue/useProgramAccounts`
|
|
712
|
+
|
|
667
713
|
- `@vue-solana/vue/useWallet`
|
|
714
|
+
|
|
668
715
|
- `@vue-solana/vue/useWallets`
|
|
716
|
+
|
|
669
717
|
- `@vue-solana/vue/useSignMessage`
|
|
718
|
+
|
|
670
719
|
- `@vue-solana/vue/useTransaction`
|
|
720
|
+
|
|
671
721
|
- `@vue-solana/vue/useTransactionConfirmation`
|
|
722
|
+
|
|
672
723
|
- `@vue-solana/vue/useSignatureStatus`
|
|
724
|
+
|
|
673
725
|
- `@vue-solana/vue/useSignAndSendTransaction`
|
|
726
|
+
|
|
674
727
|
- `@vue-solana/vue/useTokenAccounts`
|
|
728
|
+
|
|
675
729
|
- `@vue-solana/vue/useTokenBalance`
|
|
730
|
+
|
|
676
731
|
- `@vue-solana/vue/useAction`
|
|
732
|
+
|
|
677
733
|
- `@vue-solana/vue/useRequest`
|
|
734
|
+
|
|
678
735
|
- `@vue-solana/vue/useSubscription`
|
|
736
|
+
|
|
679
737
|
- `@vue-solana/vue/useTrackedData`
|
|
738
|
+
|
|
680
739
|
- `@vue-solana/vue/useSignIn`
|
|
740
|
+
|
|
681
741
|
- `@vue-solana/vue/useSolanaPay`
|
|
742
|
+
|
|
682
743
|
- `@vue-solana/vue/useSolanaPayConfirmation`
|
|
744
|
+
|
|
683
745
|
- `@vue-solana/vue/useSolanaQrCode`
|
|
746
|
+
|
|
684
747
|
- `@vue-solana/vue/useSolanaQrScanner`
|
|
748
|
+
|
|
685
749
|
- `@vue-solana/vue/useSelectedWalletAccount`
|
|
750
|
+
|
|
686
751
|
- `@vue-solana/vue/useSignTransactions`
|
|
752
|
+
|
|
687
753
|
- `@vue-solana/vue/useSignAndSendTransactions`
|
|
754
|
+
|
|
688
755
|
- `@vue-solana/vue/useClientCapability`
|
|
756
|
+
|
|
689
757
|
- `@vue-solana/vue/usePayer`
|
|
758
|
+
|
|
690
759
|
- `@vue-solana/vue/useIdentity`
|
|
760
|
+
|
|
691
761
|
- `@vue-solana/vue/usePlanTransaction`
|
|
762
|
+
|
|
692
763
|
- `@vue-solana/vue/usePlanTransactions`
|
|
764
|
+
|
|
693
765
|
- `@vue-solana/vue/useSendTransaction`
|
|
766
|
+
|
|
694
767
|
- `@vue-solana/vue/useSendTransactions`
|
|
695
768
|
|
|
696
769
|
Other direct subpaths:
|
|
697
770
|
|
|
698
771
|
- `@vue-solana/vue/swr`
|
|
772
|
+
|
|
699
773
|
- `@vue-solana/vue/kit`
|
|
774
|
+
|
|
700
775
|
- `@vue-solana/vue/buffer-polyfill`
|
|
701
776
|
|
|
702
777
|
## Caveats
|
|
703
778
|
|
|
704
779
|
- Wallet and RPC operations require the plugin-provided client context. Composables are SSR-safe, but real wallet work should run after hydration or in user actions.
|
|
780
|
+
|
|
705
781
|
- Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
|
|
782
|
+
|
|
706
783
|
- Broad `useProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
|
|
784
|
+
|
|
707
785
|
- 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.
|
|
786
|
+
|
|
708
787
|
- v2.0.0 removed `@solana/web3-compat` and the `web3` subpaths. Build transaction messages with `@vue-solana/vue/kit` and pass raw `Uint8Array` wire bytes to wallet flows. See the [Kit Migration guide](https://vue-solana-docs.vercel.app/guides/kit-migration) for migrating from v1.
|
|
788
|
+
|
|
709
789
|
- Desktop native app wallets are planned but not implemented yet.
|
|
710
790
|
|
|
711
791
|
## Status
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-solana/vue",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.2",
|
|
4
4
|
"description": "Vue plugin and composables for Solana applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"access": "public"
|
|
195
195
|
},
|
|
196
196
|
"dependencies": {
|
|
197
|
-
"@vue-solana/core": "4.1.
|
|
197
|
+
"@vue-solana/core": "4.1.2"
|
|
198
198
|
},
|
|
199
199
|
"peerDependencies": {
|
|
200
200
|
"vue": "^3.5.0"
|