@vue-solana/vue 4.0.0-rc.1 → 4.1.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
@@ -7,6 +7,16 @@
7
7
 
8
8
  Solana wallet, RPC, account, message signing, and transaction composables for Vue 3.
9
9
 
10
+ ## Related packages
11
+
12
+ This package is part of the Vue Solana family. Choose based on your app framework:
13
+
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
+ - [`@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.)
16
+ - [`@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
+
18
+ This package builds on `@vue-solana/core`; install `@vue-solana/vue` for plain Vue apps and `@vue-solana/nuxt` for Nuxt apps.
19
+
10
20
  Use this package in Vue 3 apps that need Solana RPC access, balance reads, wallet state, message signing, and transaction helper state.
11
21
 
12
22
  New to Solana? Start with the official docs and the project concepts guide:
@@ -64,20 +74,22 @@ import { createApp } from "vue";
64
74
  import { createSolanaPlugin } from "@vue-solana/vue";
65
75
  import App from "./App.vue";
66
76
 
67
- createApp(App)
68
- .use(
69
- createSolanaPlugin({
70
- cluster: "devnet",
71
- mobileWallet: {
72
- appIdentity: {
73
- name: "My Vue Solana App",
74
- uri: "https://example.com",
75
- icon: "favicon.ico",
76
- },
77
- },
78
- }),
79
- )
80
- .mount("#app");
77
+ const solana = createSolanaPlugin({
78
+ cluster: "devnet",
79
+ mobileWallet: {
80
+ appIdentity: {
81
+ name: "My Vue Solana App",
82
+ uri: "https://example.com",
83
+ icon: "favicon.ico",
84
+ },
85
+ },
86
+ });
87
+
88
+ createApp(App).use(solana).mount("#app");
89
+
90
+ // On teardown:
91
+ // app.unmount();
92
+ // solana.dispose();
81
93
  ```
82
94
 
83
95
  Android Mobile Wallet Adapter registration is enabled by default on supported Android Chrome clients. Pass `mobileWallet` options to customize the MWA app identity, or pass `mobileWallet: false` to disable Android mobile wallet registration.
@@ -227,6 +239,8 @@ const signatureStatus = useSignatureStatus(signature, {
227
239
  });
228
240
  ```
229
241
 
242
+ There is no per-call `commitment` option for `useSignatureStatus()`; `getSignatureStatuses` takes no per-call commitment, so reads use the commitment baked into the endpoint. Polling uses chained timeouts and `stopPolling()` prevents further ticks until the watched signature changes (which restarts polling). Invalid `pollIntervalMs` values return an `RPC_FAILURE` `SolanaError`.
243
+
230
244
  Read SPL token accounts and balances through Kit RPC `jsonParsed`:
231
245
 
232
246
  ```ts
@@ -490,7 +504,7 @@ import { useRequestSwr } from "@vue-solana/vue/swr";
490
504
  const balance = useRequestSwr(["balance", address], () => client.rpc.getBalance(address).send());
491
505
  ```
492
506
 
493
- The SWR cache is module-level and shared across the whole app, including across SSR requests. Namespace cache keys per request (for example by including a request or session id) or call `clearSwrCache()` at the start of each server request to avoid leaking one request's cached data into another. On the client the cache is intentionally shared for stale-while-revalidate seeding.
507
+ The SWR cache is module-level and shared across the whole app, including across SSR requests. Namespace cache keys per request (for example by including a request or session id) or call `clearSwrCache()` at the start of each server request to avoid leaking one request's cached data into another. On the client the cache is intentionally shared for stale-while-revalidate seeding. It is capped at 1024 entries with oldest-first eviction. Use `deleteSwrKey(key)` to evict a single entry by its full cache key (including the adapter prefix like `request:`).
494
508
 
495
509
  ### Cancellation & Timeouts
496
510
 
@@ -594,9 +608,9 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
594
608
 
595
609
  | API | Description |
596
610
  | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
597
- | `createSolanaPlugin(options?)` | Installs the Vue Solana context. |
611
+ | `createSolanaPlugin(options?)` | Installs the Vue Solana context and returns `{ install, context, dispose }`. `dispose()` stops wallet discovery/subscriptions. |
598
612
  | `VueSolana` | Alias for `createSolanaPlugin`. |
599
- | `useSolana()` | Returns the full injected Solana context; throws when no plugin context is available. |
613
+ | `useSolana()` | Returns the full injected Solana context; throws when no plugin context is available (SSR fallback uses a fresh inert context per call). |
600
614
  | `tryUseSolana()` | Returns the injected Solana context or `null` when no plugin context is available (SSR-safe). |
601
615
  | `MissingClientCapabilityError` | Thrown by `useClientCapability()` (and client-sent composables) when the configured client lacks a required capability. |
602
616
  | `useRpc()` | Returns cluster, endpoint, connection status, latest blockhash, the Kit `client`, and `checkConnection()`. |
@@ -621,12 +635,18 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
621
635
  | `useTrackedData(source, options?)` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
622
636
  | `useRequestSwr(key, ...)` / `useSubscriptionSwr(key, ...)` / `useTrackedDataSwr(key, ...)` | Cache-keyed SWR adapters seeding fresh mounts from the last-known result. |
623
637
  | `clearSwrCache()` | Clears every cached SWR entry. |
638
+ | `deleteSwrKey(key)` | Removes a single cached SWR entry by full cache key (including adapter prefix). |
624
639
  | `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 tracks confirmation status by reference. |
641
+ | `useSolanaPayConfirmation()` | Polls payment status for a Solana Pay reference. |
642
+ | `useSolanaQrCode()` | Renders a Solana Pay URL as an SVG QR code. |
643
+ | `useSolanaQrScanner()` | Scans Solana Pay QR codes through the camera and `BarcodeDetector`. |
625
644
  | `useSelectedWalletAccount()` | App-wide selected wallet account context: `[selectedAccount, setSelectedAccount, filteredWallets]`. |
626
645
  | `SelectedWalletAccountProvider` | Component that provides the selected wallet account context to its subtree. |
627
646
  | `useSignTransactions()` | Batch-signs transactions through the wallet, preferring `signTransactions` and falling back to `signAllTransactions`. |
628
647
  | `useSignAndSendTransactions()` | Signs and sends multiple transactions, returning one signature each, with a singular sequential fallback. |
629
648
  | `useClientCapability(capability, options?)` | Fails fast with a clear error when the configured Solana client lacks a requested capability. |
649
+ | `tryUseSolana()` | Returns the injected Solana context or `null` when no plugin context is available (SSR-safe). |
630
650
  | `usePayer()` | Reactive Kit client `payer` signer ref. The default client exposes a configured payer when supplied. |
631
651
  | `useIdentity()` | Reactive Kit client `identity` signer ref (requires an identity signer on a custom client). |
632
652
  | `usePlanTransaction()` | Plans a single transaction message from instruction inputs without signing or sending; the default client includes the official planner. |
@@ -658,6 +678,10 @@ Direct composable subpaths:
658
678
  - `@vue-solana/vue/useSubscription`
659
679
  - `@vue-solana/vue/useTrackedData`
660
680
  - `@vue-solana/vue/useSignIn`
681
+ - `@vue-solana/vue/useSolanaPay`
682
+ - `@vue-solana/vue/useSolanaPayConfirmation`
683
+ - `@vue-solana/vue/useSolanaQrCode`
684
+ - `@vue-solana/vue/useSolanaQrScanner`
661
685
  - `@vue-solana/vue/useSelectedWalletAccount`
662
686
  - `@vue-solana/vue/useSignTransactions`
663
687
  - `@vue-solana/vue/useSignAndSendTransactions`
package/dist/index.d.ts CHANGED
@@ -18,6 +18,10 @@ export { PartialSignAndSendError, SignAndSendTransactionsStatus, useSignAndSendT
18
18
  export { SignatureStatus, UseSignatureStatusOptions, useSignatureStatus } from './useSignatureStatus.js';
19
19
  export { SignInStatus, useSignIn } from './useSignIn.js';
20
20
  export { tryUseSolana, useSolana } from './useSolana.js';
21
+ export { useSolanaQrScanner } from './useSolanaQrScanner.js';
22
+ export { useSolanaQrCode } from './useSolanaQrCode.js';
23
+ export { useSolanaPay } from './useSolanaPay.js';
24
+ export { useSolanaPayConfirmation } from './useSolanaPayConfirmation.js';
21
25
  export { useSolanaClient } from './useSolanaClient.js';
22
26
  export { UseSubscriptionOptions, UseSubscriptionReconnectOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus, useSubscription } from './useSubscription.js';
23
27
  export { UseTokenAccountsOptions, useTokenAccounts } from './useTokenAccounts.js';
@@ -37,6 +41,7 @@ export { TransactionStatus } from '@vue-solana/core/types';
37
41
  import { App } from 'vue';
38
42
  export { SolanaError, SolanaErrorCode, isSolanaError } from '@vue-solana/core/errors';
39
43
  export * from '@vue-solana/core/kit';
44
+ import '@vue-solana/core';
40
45
  import '@solana/kit-plugin-rpc';
41
46
  import '@solana/kit';
42
47
  import './shared/vue.BGGixph-.js';
package/dist/index.mjs CHANGED
@@ -18,6 +18,10 @@ export { P as PartialSignAndSendError, u as useSignAndSendTransactions } from '.
18
18
  export { u as useSignatureStatus } from './shared/vue.Bu2cQ690.mjs';
19
19
  export { u as useSignIn } from './shared/vue.SeuJipQ8.mjs';
20
20
  export { t as tryUseSolana, u as useSolana } from './shared/vue.CcOZ9858.mjs';
21
+ export { u as useSolanaQrScanner } from './shared/vue.Btxdm--M.mjs';
22
+ export { u as useSolanaQrCode } from './shared/vue.Bo4nAja_.mjs';
23
+ export { u as useSolanaPay } from './shared/vue.gvgOc5rc.mjs';
24
+ export { u as useSolanaPayConfirmation } from './shared/vue.MN-kcudq.mjs';
21
25
  export { u as useSolanaClient } from './shared/vue.CZApWQAY.mjs';
22
26
  export { u as useSubscription } from './shared/vue.D5pqR5Fa.mjs';
23
27
  export { u as useTokenAccounts } from './shared/vue.DTpvqDyY.mjs';
@@ -0,0 +1,35 @@
1
+ import { shallowRef, ref } from 'vue';
2
+ import { createQR } from '@vue-solana/core/solana-pay';
3
+
4
+ function useSolanaQrCode() {
5
+ const url = shallowRef(null);
6
+ const svg = ref(null);
7
+ const loading = ref(false);
8
+ const error = ref(null);
9
+ async function generate(input, options = {}) {
10
+ loading.value = true;
11
+ error.value = null;
12
+ try {
13
+ url.value = typeof input === "string" ? input : input.toString();
14
+ const result = await createQR(
15
+ input,
16
+ ...Object.values(options)
17
+ );
18
+ svg.value = result;
19
+ return result;
20
+ } catch (e) {
21
+ error.value = e;
22
+ throw e;
23
+ } finally {
24
+ loading.value = false;
25
+ }
26
+ }
27
+ function reset() {
28
+ url.value = null;
29
+ svg.value = null;
30
+ error.value = null;
31
+ }
32
+ return { url, svg, generate, reset, loading, error };
33
+ }
34
+
35
+ export { useSolanaQrCode as u };
@@ -0,0 +1,130 @@
1
+ import { ref, shallowRef, onUnmounted } from 'vue';
2
+ import { parseURL } from '@vue-solana/core/solana-pay';
3
+
4
+ function useSolanaQrScanner() {
5
+ const scanning = ref(false);
6
+ const result = shallowRef(null);
7
+ const parsed = shallowRef(null);
8
+ const error = ref(null);
9
+ let mediaStream = null;
10
+ let videoElement = null;
11
+ let scanInterval = null;
12
+ let barcodeDetector = null;
13
+ let stopped = false;
14
+ function stopTracks() {
15
+ if (mediaStream) {
16
+ for (const track of mediaStream.getTracks()) {
17
+ try {
18
+ track.stop();
19
+ } catch {
20
+ }
21
+ }
22
+ mediaStream = null;
23
+ }
24
+ }
25
+ function clearTimer() {
26
+ if (scanInterval) {
27
+ clearInterval(scanInterval);
28
+ scanInterval = null;
29
+ }
30
+ }
31
+ async function scanFromText(text) {
32
+ try {
33
+ result.value = text;
34
+ parsed.value = parseURL(text);
35
+ error.value = null;
36
+ return parsed.value;
37
+ } catch (e) {
38
+ error.value = e;
39
+ throw e;
40
+ }
41
+ }
42
+ async function start(options = {}) {
43
+ if (typeof window === "undefined") {
44
+ const err = new Error("Scanner can only run in the browser");
45
+ error.value = err;
46
+ throw err;
47
+ }
48
+ if (scanning.value) return;
49
+ stopped = false;
50
+ error.value = null;
51
+ videoElement = options.video ?? null;
52
+ const intervalMs = options.scanIntervalMs ?? 500;
53
+ try {
54
+ const BarcodeDetectorCtor = globalThis.BarcodeDetector;
55
+ if (BarcodeDetectorCtor) {
56
+ try {
57
+ barcodeDetector = new BarcodeDetectorCtor({
58
+ formats: ["qr_code"]
59
+ });
60
+ } catch {
61
+ barcodeDetector = null;
62
+ }
63
+ }
64
+ if (!navigator?.mediaDevices?.getUserMedia) {
65
+ throw new Error("Camera not available");
66
+ }
67
+ mediaStream = await navigator.mediaDevices.getUserMedia({
68
+ video: { facingMode: "environment" }
69
+ });
70
+ if (videoElement) {
71
+ videoElement.srcObject = mediaStream;
72
+ await videoElement.play().catch(() => {
73
+ });
74
+ }
75
+ scanning.value = true;
76
+ clearTimer();
77
+ scanInterval = setInterval(async () => {
78
+ if (stopped || !scanning.value) return;
79
+ try {
80
+ if (barcodeDetector && videoElement) {
81
+ const codes = await barcodeDetector.detect(videoElement);
82
+ if (codes && codes.length > 0) {
83
+ const text = codes[0]?.rawValue || codes[0]?.raw || codes[0]?.value;
84
+ if (text) {
85
+ try {
86
+ await scanFromText(text);
87
+ } catch {
88
+ }
89
+ }
90
+ }
91
+ }
92
+ } catch (e) {
93
+ error.value = e;
94
+ }
95
+ }, intervalMs);
96
+ } catch (e) {
97
+ error.value = e;
98
+ stopTracks();
99
+ clearTimer();
100
+ scanning.value = false;
101
+ throw e;
102
+ }
103
+ }
104
+ function stop() {
105
+ stopped = true;
106
+ scanning.value = false;
107
+ clearTimer();
108
+ stopTracks();
109
+ if (videoElement) {
110
+ try {
111
+ videoElement.srcObject = null;
112
+ } catch {
113
+ }
114
+ }
115
+ }
116
+ function reset() {
117
+ stop();
118
+ result.value = null;
119
+ parsed.value = null;
120
+ error.value = null;
121
+ barcodeDetector = null;
122
+ videoElement = null;
123
+ }
124
+ onUnmounted(() => {
125
+ stop();
126
+ });
127
+ return { scanning, result, parsed, error, scanFromText, start, stop, reset };
128
+ }
129
+
130
+ export { useSolanaQrScanner as u };
@@ -0,0 +1,42 @@
1
+ import { ref, onUnmounted } from 'vue';
2
+ import { getSolanaPayPaymentStatus } from '@vue-solana/core';
3
+
4
+ function useSolanaPayConfirmation() {
5
+ const status = ref("pending");
6
+ const error = ref(null);
7
+ let timer = null;
8
+ let stopped = false;
9
+ async function check(rpc, reference) {
10
+ if (stopped) return;
11
+ try {
12
+ status.value = await getSolanaPayPaymentStatus(rpc, reference);
13
+ } catch (e) {
14
+ error.value = e;
15
+ status.value = "error";
16
+ }
17
+ }
18
+ function startPolling(rpc, reference, interval = 2e3) {
19
+ stopPolling();
20
+ stopped = false;
21
+ const run = async () => {
22
+ if (stopped) return;
23
+ await check(rpc, reference);
24
+ if (stopped) return;
25
+ if (status.value === "pending" || status.value === "found") {
26
+ timer = setTimeout(run, interval);
27
+ }
28
+ };
29
+ void run();
30
+ }
31
+ function stopPolling() {
32
+ stopped = true;
33
+ if (timer) clearTimeout(timer);
34
+ timer = null;
35
+ }
36
+ onUnmounted(() => {
37
+ stopPolling();
38
+ });
39
+ return { status, error, check, startPolling, stopPolling };
40
+ }
41
+
42
+ export { useSolanaPayConfirmation as u };
@@ -0,0 +1,99 @@
1
+ import { computed, shallowRef } from 'vue';
2
+ import { parseURL, encodeURL } from '@vue-solana/core/solana-pay';
3
+ import { verifySolanaPayPayment, createSolanaPayReference } from '@vue-solana/core/solana-pay-confirmation';
4
+ import { u as useSolanaClient } from './vue.CZApWQAY.mjs';
5
+
6
+ function useSolanaPay() {
7
+ const { client } = useSolanaClient();
8
+ const rpc = computed(() => client.rpc);
9
+ const requestUrl = shallowRef(null);
10
+ const parsedRequest = shallowRef(null);
11
+ const reference = shallowRef(null);
12
+ const status = shallowRef("idle");
13
+ const loading = shallowRef(false);
14
+ const error = shallowRef(null);
15
+ async function createTransferRequest(input) {
16
+ loading.value = true;
17
+ error.value = null;
18
+ try {
19
+ const refAddr = await createSolanaPayReference();
20
+ reference.value = refAddr;
21
+ const url = encodeURL({ ...input, reference: refAddr });
22
+ requestUrl.value = url.toString();
23
+ parsedRequest.value = parseURL(url.toString());
24
+ status.value = "pending";
25
+ return url.toString();
26
+ } catch (e) {
27
+ error.value = e;
28
+ status.value = "error";
29
+ throw e;
30
+ } finally {
31
+ loading.value = false;
32
+ }
33
+ }
34
+ function parseRequest(value) {
35
+ try {
36
+ const parsed = parseURL(value);
37
+ parsedRequest.value = parsed;
38
+ error.value = null;
39
+ return parsed;
40
+ } catch (e) {
41
+ error.value = e;
42
+ throw e;
43
+ }
44
+ }
45
+ async function createReference() {
46
+ const refAddr = await createSolanaPayReference();
47
+ reference.value = refAddr;
48
+ return refAddr;
49
+ }
50
+ async function confirmTransfer(options = {}) {
51
+ if (!reference.value) throw new Error("No reference");
52
+ loading.value = true;
53
+ error.value = null;
54
+ try {
55
+ const parsed = parsedRequest.value;
56
+ const p = parsed;
57
+ const result = await verifySolanaPayPayment(rpc.value, {
58
+ reference: String(reference.value),
59
+ expectedRecipient: String(
60
+ options.expectedRecipient ?? p?.recipient ?? ""
61
+ ),
62
+ expectedAmount: options.expectedAmount ?? p?.amount,
63
+ expectedTokenMint: options.expectedTokenMint ?? p?.splToken,
64
+ ...options
65
+ });
66
+ status.value = result.status;
67
+ return result;
68
+ } catch (e) {
69
+ error.value = e;
70
+ status.value = "error";
71
+ throw e;
72
+ } finally {
73
+ loading.value = false;
74
+ }
75
+ }
76
+ function reset() {
77
+ requestUrl.value = null;
78
+ parsedRequest.value = null;
79
+ reference.value = null;
80
+ status.value = "idle";
81
+ loading.value = false;
82
+ error.value = null;
83
+ }
84
+ return {
85
+ requestUrl,
86
+ parsedRequest,
87
+ reference,
88
+ status,
89
+ loading,
90
+ error,
91
+ createTransferRequest,
92
+ parseRequest,
93
+ createReference,
94
+ confirmTransfer,
95
+ reset
96
+ };
97
+ }
98
+
99
+ export { useSolanaPay as u };
@@ -1,6 +1,6 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
3
+ import * as _vue_solana_core from '@vue-solana/core';
4
4
  import { Commitment } from '@vue-solana/core/kit';
5
5
 
6
6
  interface UseAccountInfoOptions {
@@ -14,7 +14,7 @@ interface AccountInfo {
14
14
  data: Uint8Array;
15
15
  }
16
16
  declare function useAccountInfo(address: MaybeRefOrGetter<string | null | undefined>, options?: UseAccountInfoOptions): {
17
- error: vue.ShallowRef<_vue_solana_core_errors.SolanaError | null>;
17
+ error: vue.ShallowRef<_vue_solana_core.SolanaError | null>;
18
18
  loading: vue.ShallowRef<boolean>;
19
19
  refresh: () => Promise<AccountInfo | null>;
20
20
  accountInfo: vue.ShallowRef<AccountInfo | null>;
@@ -1,11 +1,11 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
3
+ import * as _vue_solana_core from '@vue-solana/core';
4
4
  import { Commitment } from '@vue-solana/core/kit';
5
5
 
6
6
  type BalanceInput = string | null | undefined;
7
7
  declare function useBalance(address: MaybeRefOrGetter<BalanceInput>, commitment?: Commitment): {
8
- error: vue.ShallowRef<_vue_solana_core_errors.SolanaError | null>;
8
+ error: vue.ShallowRef<_vue_solana_core.SolanaError | null>;
9
9
  loading: vue.ShallowRef<boolean>;
10
10
  refresh: () => Promise<number | null>;
11
11
  balance: vue.ShallowRef<number | null>;
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
2
+ import * as _vue_solana_core from '@vue-solana/core';
3
3
  import { InstructionPlanInput, TransactionMessage, TransactionPlan } from '@vue-solana/core/kit';
4
4
  import { C as ClientActionConfig } from './shared/vue.BGGixph-.js';
5
5
 
@@ -18,7 +18,7 @@ type PlanTransactionConfig = ClientActionConfig;
18
18
  * from a real failure.
19
19
  */
20
20
  declare function usePlanTransaction(): {
21
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null>;
21
+ error: vue.Ref<_vue_solana_core.SolanaError | null>;
22
22
  execute: (input: InstructionPlanInput, config?: ClientActionConfig) => Promise<TransactionMessage>;
23
23
  loading: vue.ComputedRef<boolean>;
24
24
  status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
@@ -33,7 +33,7 @@ declare function usePlanTransaction(): {
33
33
  * includes a client without a `payer` signer.
34
34
  */
35
35
  declare function usePlanTransactions(): {
36
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null>;
36
+ error: vue.Ref<_vue_solana_core.SolanaError | null>;
37
37
  execute: (input: InstructionPlanInput, config?: ClientActionConfig) => Promise<TransactionPlan>;
38
38
  loading: vue.ComputedRef<boolean>;
39
39
  status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
@@ -1,5 +1,5 @@
1
1
  export { usePlanTransactions } from './usePlanTransaction.js';
2
2
  import 'vue';
3
- import '@vue-solana/core/errors';
3
+ import '@vue-solana/core';
4
4
  import '@vue-solana/core/kit';
5
5
  import './shared/vue.BGGixph-.js';
@@ -1,6 +1,6 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
3
+ import * as _vue_solana_core from '@vue-solana/core';
4
4
  import { Commitment } from '@vue-solana/core/kit';
5
5
 
6
6
  type ProgramAccountMemcmpEncoding = "base58" | "base64";
@@ -35,7 +35,7 @@ interface ProgramAccount {
35
35
  };
36
36
  }
37
37
  declare function useProgramAccounts(programId: MaybeRefOrGetter<string | null | undefined>, options?: UseProgramAccountsOptions): {
38
- error: vue.ShallowRef<_vue_solana_core_errors.SolanaError | null>;
38
+ error: vue.ShallowRef<_vue_solana_core.SolanaError | null>;
39
39
  loading: vue.ShallowRef<boolean>;
40
40
  refresh: () => Promise<ProgramAccount[] | null>;
41
41
  accounts: vue.ShallowRef<ProgramAccount[]>;
package/dist/useRpc.d.ts CHANGED
@@ -1,16 +1,17 @@
1
1
  import * as _solana_kit_plugin_rpc from '@solana/kit-plugin-rpc';
2
2
  import * as _solana_kit from '@solana/kit';
3
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
4
3
  import * as vue from 'vue';
5
- import * as _vue_solana_core_types from '@vue-solana/core/types';
4
+ import * as _vue_solana_core from '@vue-solana/core';
6
5
  import { S as SolanaConnectionStatus } from './shared/vue.DL3z5PxP.js';
6
+ import '@vue-solana/core/errors';
7
+ import '@vue-solana/core/types';
7
8
 
8
9
  declare function useRpc(): {
9
- cluster: vue.ComputedRef<_vue_solana_core_types.SolanaCluster>;
10
+ cluster: vue.ComputedRef<_vue_solana_core.SolanaCluster>;
10
11
  endpoint: vue.ComputedRef<string>;
11
12
  wsEndpoint: vue.ComputedRef<string>;
12
13
  status: vue.Ref<SolanaConnectionStatus, SolanaConnectionStatus>;
13
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null, _vue_solana_core_errors.SolanaError | null>;
14
+ error: vue.Ref<_vue_solana_core.SolanaError | null, _vue_solana_core.SolanaError | null>;
14
15
  latestBlockhash: vue.Ref<string | null, string | null>;
15
16
  checkConnection: () => Promise<void>;
16
17
  client: Omit<_solana_kit.Client<{
@@ -1,4 +1,4 @@
1
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
1
+ import * as _vue_solana_core from '@vue-solana/core';
2
2
  import * as vue from 'vue';
3
3
  import { InstructionPlanInput, SingleTransactionPlan, TransactionPlanInput, SuccessfulSingleTransactionPlanResult, TransactionPlanResult } from '@vue-solana/core/kit';
4
4
  import { C as ClientActionConfig } from './shared/vue.BGGixph-.js';
@@ -25,7 +25,7 @@ type SendTransactionsInput = InstructionPlanInput | TransactionPlanInput;
25
25
  */
26
26
  declare function useSendTransaction(): {
27
27
  data: vue.ShallowRef<SuccessfulSingleTransactionPlanResult | null>;
28
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null>;
28
+ error: vue.Ref<_vue_solana_core.SolanaError | null>;
29
29
  execute: (input: SendTransactionInput, config?: ClientActionConfig) => Promise<SuccessfulSingleTransactionPlanResult>;
30
30
  loading: vue.ComputedRef<boolean>;
31
31
  status: vue.Ref<SendTransactionStatus, SendTransactionStatus>;
@@ -40,7 +40,7 @@ declare function useSendTransaction(): {
40
40
  */
41
41
  declare function useSendTransactions(): {
42
42
  data: vue.ShallowRef<TransactionPlanResult | null>;
43
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null>;
43
+ error: vue.Ref<_vue_solana_core.SolanaError | null>;
44
44
  execute: (input: SendTransactionsInput, config?: ClientActionConfig) => Promise<TransactionPlanResult>;
45
45
  loading: vue.ComputedRef<boolean>;
46
46
  status: vue.Ref<SendTransactionStatus, SendTransactionStatus>;
@@ -1,5 +1,5 @@
1
1
  export { useSendTransactions } from './useSendTransaction.js';
2
- import '@vue-solana/core/errors';
2
+ import '@vue-solana/core';
3
3
  import 'vue';
4
4
  import '@vue-solana/core/kit';
5
5
  import './shared/vue.BGGixph-.js';
@@ -1,4 +1,4 @@
1
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
1
+ import * as _vue_solana_core from '@vue-solana/core';
2
2
  import * as vue from 'vue';
3
3
  import { SolanaSignInResult, SolanaSignInInput } from '@vue-solana/core/types';
4
4
 
@@ -15,7 +15,7 @@ declare function useSignIn(): {
15
15
  signInResult: vue.ShallowRef<SolanaSignInResult | null, SolanaSignInResult | null>;
16
16
  status: vue.ShallowRef<SignInStatus>;
17
17
  loading: vue.ComputedRef<boolean>;
18
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null, _vue_solana_core_errors.SolanaError | null>;
18
+ error: vue.Ref<_vue_solana_core.SolanaError | null, _vue_solana_core.SolanaError | null>;
19
19
  signIn: (input?: SolanaSignInInput) => Promise<SolanaSignInResult>;
20
20
  };
21
21
 
@@ -1,4 +1,4 @@
1
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
1
+ import * as _vue_solana_core from '@vue-solana/core';
2
2
  import * as vue from 'vue';
3
3
  import { SolanaSignMessageResult } from '@vue-solana/core/types';
4
4
 
@@ -228,7 +228,7 @@ declare function useSignMessage(): {
228
228
  } | null>;
229
229
  status: vue.ShallowRef<SignMessageStatus>;
230
230
  loading: vue.ComputedRef<boolean>;
231
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null, _vue_solana_core_errors.SolanaError | null>;
231
+ error: vue.Ref<_vue_solana_core.SolanaError | null, _vue_solana_core.SolanaError | null>;
232
232
  execute: (message: Uint8Array) => Promise<SolanaSignMessageResult>;
233
233
  };
234
234
 
@@ -1,4 +1,4 @@
1
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
1
+ import * as _vue_solana_core from '@vue-solana/core';
2
2
  import * as vue from 'vue';
3
3
  import { SolanaTransaction } from '@vue-solana/core/types';
4
4
 
@@ -16,7 +16,7 @@ declare function useSignTransactions(): {
16
16
  signedTransactions: vue.ShallowRef<SolanaTransaction[] | null, SolanaTransaction[] | null>;
17
17
  status: vue.ShallowRef<SignTransactionsStatus>;
18
18
  loading: vue.ComputedRef<boolean>;
19
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null, _vue_solana_core_errors.SolanaError | null>;
19
+ error: vue.Ref<_vue_solana_core.SolanaError | null, _vue_solana_core.SolanaError | null>;
20
20
  execute: (transactions: SolanaTransaction[]) => Promise<SolanaTransaction[]>;
21
21
  };
22
22
 
@@ -0,0 +1,19 @@
1
+ import * as _vue_solana_core from '@vue-solana/core';
2
+ import * as _solana_kit from '@solana/kit';
3
+ import * as vue from 'vue';
4
+
5
+ declare function useSolanaPay(): {
6
+ requestUrl: vue.ShallowRef<string | null, string | null>;
7
+ parsedRequest: vue.ShallowRef<unknown, unknown>;
8
+ reference: vue.ShallowRef<unknown, unknown>;
9
+ status: vue.ShallowRef<"confirmed" | "finalized" | "error" | "idle" | "pending" | "found" | "expired", "confirmed" | "finalized" | "error" | "idle" | "pending" | "found" | "expired">;
10
+ loading: vue.ShallowRef<boolean, boolean>;
11
+ error: vue.ShallowRef<unknown, unknown>;
12
+ createTransferRequest: (input: Record<string, unknown>) => Promise<string>;
13
+ parseRequest: (value: string) => unknown;
14
+ createReference: () => Promise<_solana_kit.Address>;
15
+ confirmTransfer: (options?: Record<string, unknown>) => Promise<_vue_solana_core.SolanaPayVerificationResult>;
16
+ reset: () => void;
17
+ };
18
+
19
+ export { useSolanaPay };
@@ -0,0 +1 @@
1
+ export { u as useSolanaPay } from './shared/vue.gvgOc5rc.mjs';
@@ -0,0 +1,11 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare function useSolanaPayConfirmation(): {
4
+ status: vue.Ref<string, string>;
5
+ error: vue.Ref<unknown, unknown>;
6
+ check: (rpc: unknown, reference: string) => Promise<void>;
7
+ startPolling: (rpc: unknown, reference: string, interval?: number) => void;
8
+ stopPolling: () => void;
9
+ };
10
+
11
+ export { useSolanaPayConfirmation };
@@ -0,0 +1 @@
1
+ export { u as useSolanaPayConfirmation } from './shared/vue.MN-kcudq.mjs';
@@ -0,0 +1,12 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare function useSolanaQrCode(): {
4
+ url: vue.ShallowRef<string | null, string | null>;
5
+ svg: vue.Ref<unknown, unknown>;
6
+ generate: (input: string | URL, options?: Record<string, unknown>) => Promise<string>;
7
+ reset: () => void;
8
+ loading: vue.Ref<boolean, boolean>;
9
+ error: vue.Ref<unknown, unknown>;
10
+ };
11
+
12
+ export { useSolanaQrCode };
@@ -0,0 +1 @@
1
+ export { u as useSolanaQrCode } from './shared/vue.Bo4nAja_.mjs';
@@ -0,0 +1,17 @@
1
+ import * as vue from 'vue';
2
+
3
+ declare function useSolanaQrScanner(): {
4
+ scanning: vue.Ref<boolean, boolean>;
5
+ result: vue.ShallowRef<string | null, string | null>;
6
+ parsed: vue.ShallowRef<unknown, unknown>;
7
+ error: vue.Ref<unknown, unknown>;
8
+ scanFromText: (text: string) => Promise<unknown>;
9
+ start: (options?: {
10
+ video?: HTMLVideoElement;
11
+ scanIntervalMs?: number;
12
+ }) => Promise<void>;
13
+ stop: () => void;
14
+ reset: () => void;
15
+ };
16
+
17
+ export { useSolanaQrScanner };
@@ -0,0 +1 @@
1
+ export { u as useSolanaQrScanner } from './shared/vue.Btxdm--M.mjs';
@@ -1,6 +1,6 @@
1
1
  import * as vue from 'vue';
2
2
  import { MaybeRefOrGetter } from 'vue';
3
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
3
+ import * as _vue_solana_core from '@vue-solana/core';
4
4
  import { Commitment, Address } from '@vue-solana/core/kit';
5
5
  import { TokenAccountInfo } from '@vue-solana/core/token-accounts';
6
6
 
@@ -9,7 +9,7 @@ interface UseTokenAccountsOptions {
9
9
  programId?: Address;
10
10
  }
11
11
  declare function useTokenAccounts(owner: MaybeRefOrGetter<Address | string | null | undefined>, options?: UseTokenAccountsOptions): {
12
- error: vue.ShallowRef<_vue_solana_core_errors.SolanaError | null>;
12
+ error: vue.ShallowRef<_vue_solana_core.SolanaError | null>;
13
13
  loading: vue.ShallowRef<boolean>;
14
14
  refresh: () => Promise<TokenAccountInfo[] | null>;
15
15
  tokenAccounts: vue.ShallowRef<TokenAccountInfo[]>;
@@ -1,4 +1,4 @@
1
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
1
+ import * as _vue_solana_core from '@vue-solana/core';
2
2
  import * as vue from 'vue';
3
3
  import { MaybeRefOrGetter } from 'vue';
4
4
  import { Commitment } from '@vue-solana/core/kit';
@@ -7,7 +7,7 @@ declare function useTokenBalance(mint: MaybeRefOrGetter<string | null | undefine
7
7
  balance: vue.ComputedRef<bigint | null>;
8
8
  decimals: vue.ComputedRef<number | null>;
9
9
  loading: vue.ShallowRef<boolean>;
10
- error: vue.ShallowRef<_vue_solana_core_errors.SolanaError | null>;
10
+ error: vue.ShallowRef<_vue_solana_core.SolanaError | null>;
11
11
  refresh: () => Promise<{
12
12
  balance: bigint | null;
13
13
  decimals: number | null;
@@ -1,4 +1,4 @@
1
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
1
+ import * as _vue_solana_core from '@vue-solana/core';
2
2
  import * as _solana_kit from '@solana/kit';
3
3
  import * as vue from 'vue';
4
4
  import { Signature } from '@vue-solana/core/kit';
@@ -29,7 +29,7 @@ declare function useTransactionConfirmation(defaultOptions?: ConfirmTransactionO
29
29
  } | null>;
30
30
  status: vue.ShallowRef<TransactionConfirmationStatus>;
31
31
  loading: vue.ComputedRef<boolean>;
32
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null, _vue_solana_core_errors.SolanaError | null>;
32
+ error: vue.Ref<_vue_solana_core.SolanaError | null, _vue_solana_core.SolanaError | null>;
33
33
  confirm: (nextSignature: Signature, options?: ConfirmTransactionOptions) => Promise<TransactionConfirmation>;
34
34
  reset: () => void;
35
35
  };
@@ -1,9 +1,9 @@
1
1
  import * as _solana_kit from '@solana/kit';
2
2
  import * as vue from 'vue';
3
- import * as _vue_solana_core_types from '@vue-solana/core/types';
3
+ import * as _vue_solana_core from '@vue-solana/core';
4
4
 
5
5
  declare function useWallet(): {
6
- wallet: vue.Ref<_vue_solana_core_types.SolanaWallet | null, _vue_solana_core_types.SolanaWallet | null>;
6
+ wallet: vue.Ref<_vue_solana_core.SolanaWallet | null, _vue_solana_core.SolanaWallet | null>;
7
7
  publicKey: vue.ComputedRef<_solana_kit.Address | null>;
8
8
  connected: vue.ComputedRef<boolean>;
9
9
  connecting: vue.ComputedRef<boolean>;
@@ -23,7 +23,7 @@ declare function useWallet(): {
23
23
  canSignTransaction: vue.ComputedRef<boolean>;
24
24
  canSignAllTransactions: vue.ComputedRef<boolean>;
25
25
  canSignAndSendTransaction: vue.ComputedRef<boolean>;
26
- setWallet: (wallet: _vue_solana_core_types.SolanaWallet | null) => void;
26
+ setWallet: (wallet: _vue_solana_core.SolanaWallet | null) => void;
27
27
  connect: () => Promise<void>;
28
28
  disconnect: () => Promise<void>;
29
29
  };
@@ -1,11 +1,11 @@
1
1
  import * as vue from 'vue';
2
- import * as _vue_solana_core_types from '@vue-solana/core/types';
2
+ import * as _vue_solana_core from '@vue-solana/core';
3
3
 
4
4
  declare function useWallets(): {
5
- wallets: vue.Ref<_vue_solana_core_types.SolanaWalletInfo[], _vue_solana_core_types.SolanaWalletInfo[]>;
6
- selectedWallet: vue.Ref<_vue_solana_core_types.SolanaWalletInfo | null, _vue_solana_core_types.SolanaWalletInfo | null>;
5
+ wallets: vue.Ref<_vue_solana_core.SolanaWalletInfo[], _vue_solana_core.SolanaWalletInfo[]>;
6
+ selectedWallet: vue.Ref<_vue_solana_core.SolanaWalletInfo | null, _vue_solana_core.SolanaWalletInfo | null>;
7
7
  refreshWallets: () => void;
8
- selectWallet: (wallet: _vue_solana_core_types.SolanaWalletInfo | null) => void;
8
+ selectWallet: (wallet: _vue_solana_core.SolanaWalletInfo | null) => void;
9
9
  };
10
10
 
11
11
  export { useWallets };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-solana/vue",
3
- "version": "4.0.0-rc.1",
3
+ "version": "4.1.0",
4
4
  "description": "Vue plugin and composables for Solana applications.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -109,6 +109,22 @@
109
109
  "types": "./dist/useSolanaClient.d.ts",
110
110
  "import": "./dist/useSolanaClient.mjs"
111
111
  },
112
+ "./useSolanaPay": {
113
+ "types": "./dist/useSolanaPay.d.ts",
114
+ "import": "./dist/useSolanaPay.mjs"
115
+ },
116
+ "./useSolanaPayConfirmation": {
117
+ "types": "./dist/useSolanaPayConfirmation.d.ts",
118
+ "import": "./dist/useSolanaPayConfirmation.mjs"
119
+ },
120
+ "./useSolanaQrCode": {
121
+ "types": "./dist/useSolanaQrCode.d.ts",
122
+ "import": "./dist/useSolanaQrCode.mjs"
123
+ },
124
+ "./useSolanaQrScanner": {
125
+ "types": "./dist/useSolanaQrScanner.d.ts",
126
+ "import": "./dist/useSolanaQrScanner.mjs"
127
+ },
112
128
  "./useRpc": {
113
129
  "types": "./dist/useRpc.d.ts",
114
130
  "import": "./dist/useRpc.mjs"
@@ -178,7 +194,7 @@
178
194
  "access": "public"
179
195
  },
180
196
  "dependencies": {
181
- "@vue-solana/core": "4.0.0-rc.1"
197
+ "@vue-solana/core": "4.1.0"
182
198
  },
183
199
  "peerDependencies": {
184
200
  "vue": "^3.5.0"