@vue-solana/vue 4.0.0 → 4.1.1
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 +78 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +4 -0
- package/dist/shared/vue.Bo4nAja_.mjs +35 -0
- package/dist/shared/vue.Btxdm--M.mjs +130 -0
- package/dist/shared/vue.MN-kcudq.mjs +42 -0
- package/dist/shared/vue.gvgOc5rc.mjs +99 -0
- package/dist/useAccountInfo.d.ts +2 -2
- package/dist/useBalance.d.ts +2 -2
- package/dist/usePlanTransaction.d.ts +3 -3
- package/dist/usePlanTransactions.d.ts +1 -1
- package/dist/useProgramAccounts.d.ts +2 -2
- package/dist/useRpc.d.ts +5 -4
- package/dist/useSendTransaction.d.ts +3 -3
- package/dist/useSendTransactions.d.ts +1 -1
- package/dist/useSignIn.d.ts +2 -2
- package/dist/useSignMessage.d.ts +2 -2
- package/dist/useSignTransactions.d.ts +2 -2
- package/dist/useSolanaPay.d.ts +19 -0
- package/dist/useSolanaPay.mjs +1 -0
- package/dist/useSolanaPayConfirmation.d.ts +11 -0
- package/dist/useSolanaPayConfirmation.mjs +1 -0
- package/dist/useSolanaQrCode.d.ts +12 -0
- package/dist/useSolanaQrCode.mjs +1 -0
- package/dist/useSolanaQrScanner.d.ts +17 -0
- package/dist/useSolanaQrScanner.mjs +1 -0
- package/dist/useTokenAccounts.d.ts +2 -2
- package/dist/useTokenBalance.d.ts +2 -2
- package/dist/useTransactionConfirmation.d.ts +2 -2
- package/dist/useWallet.d.ts +3 -3
- package/dist/useWallets.d.ts +4 -4
- package/package.json +18 -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
|
|
@@ -383,8 +406,11 @@ await execute(transaction);
|
|
|
383
406
|
Return shapes:
|
|
384
407
|
|
|
385
408
|
- `useSignMessage().execute(bytes)` resolves to `{ signedMessage, signature }`, both `Uint8Array`.
|
|
409
|
+
|
|
386
410
|
- `useSignTransactions().execute(transactions)` resolves to the signed `Uint8Array[]` (also exposed as `signedTransactions`); pass a single-element array for one transaction.
|
|
411
|
+
|
|
387
412
|
- `useSignAndSendTransaction().execute(transaction)` resolves to the submitted `signature` string; with `confirm: true` it also fills `confirmation`.
|
|
413
|
+
|
|
388
414
|
- `useSignAndSendTransactions().execute(transactions)` resolves to a `string[]` of signatures (also exposed as `signatures`).
|
|
389
415
|
|
|
390
416
|
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.
|
|
@@ -536,7 +562,9 @@ await dispatch(inputB); // aborts dispatch(inputA) before starting
|
|
|
536
562
|
```
|
|
537
563
|
|
|
538
564
|
- `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.
|
|
565
|
+
|
|
539
566
|
- `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.
|
|
567
|
+
|
|
540
568
|
- Calling `dispatch` again aborts the prior in-flight call with a fresh `AbortSignal`, and resets state to `idle` before the new run starts.
|
|
541
569
|
|
|
542
570
|
### Sign In With Solana
|
|
@@ -637,6 +665,10 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
637
665
|
| `clearSwrCache()` | Clears every cached SWR entry. |
|
|
638
666
|
| `deleteSwrKey(key)` | Removes a single cached SWR entry by full cache key (including adapter prefix). |
|
|
639
667
|
| `useSignIn(input?)` | Sign In With Solana (SIWS) trigger returning `{ account, signedMessage, signature }` for server-side verification. |
|
|
668
|
+
| `useSolanaPay()` | Builds/parses Solana Pay transfer request URLs, generates a reference, and verifies settlement against it. |
|
|
669
|
+
| `useSolanaPayConfirmation()` | Polls payment status for a Solana Pay reference. |
|
|
670
|
+
| `useSolanaQrCode()` | Renders a Solana Pay URL as an SVG QR code. |
|
|
671
|
+
| `useSolanaQrScanner()` | Scans Solana Pay QR codes through the camera and `BarcodeDetector`. |
|
|
640
672
|
| `useSelectedWalletAccount()` | App-wide selected wallet account context: `[selectedAccount, setSelectedAccount, filteredWallets]`. |
|
|
641
673
|
| `SelectedWalletAccountProvider` | Component that provides the selected wallet account context to its subtree. |
|
|
642
674
|
| `useSignTransactions()` | Batch-signs transactions through the wallet, preferring `signTransactions` and falling back to `signAllTransactions`. |
|
|
@@ -653,51 +685,97 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
653
685
|
Direct composable subpaths:
|
|
654
686
|
|
|
655
687
|
- `@vue-solana/vue/useSolana`
|
|
688
|
+
|
|
656
689
|
- `@vue-solana/vue/useSolanaClient`
|
|
690
|
+
|
|
657
691
|
- `@vue-solana/vue/useRpc`
|
|
692
|
+
|
|
658
693
|
- `@vue-solana/vue/useConnection`
|
|
694
|
+
|
|
659
695
|
- `@vue-solana/vue/useAccountInfo`
|
|
696
|
+
|
|
660
697
|
- `@vue-solana/vue/useAirdrop`
|
|
698
|
+
|
|
661
699
|
- `@vue-solana/vue/useBalance`
|
|
700
|
+
|
|
662
701
|
- `@vue-solana/vue/useProgramAccounts`
|
|
702
|
+
|
|
663
703
|
- `@vue-solana/vue/useWallet`
|
|
704
|
+
|
|
664
705
|
- `@vue-solana/vue/useWallets`
|
|
706
|
+
|
|
665
707
|
- `@vue-solana/vue/useSignMessage`
|
|
708
|
+
|
|
666
709
|
- `@vue-solana/vue/useTransaction`
|
|
710
|
+
|
|
667
711
|
- `@vue-solana/vue/useTransactionConfirmation`
|
|
712
|
+
|
|
668
713
|
- `@vue-solana/vue/useSignatureStatus`
|
|
714
|
+
|
|
669
715
|
- `@vue-solana/vue/useSignAndSendTransaction`
|
|
716
|
+
|
|
670
717
|
- `@vue-solana/vue/useTokenAccounts`
|
|
718
|
+
|
|
671
719
|
- `@vue-solana/vue/useTokenBalance`
|
|
720
|
+
|
|
672
721
|
- `@vue-solana/vue/useAction`
|
|
722
|
+
|
|
673
723
|
- `@vue-solana/vue/useRequest`
|
|
724
|
+
|
|
674
725
|
- `@vue-solana/vue/useSubscription`
|
|
726
|
+
|
|
675
727
|
- `@vue-solana/vue/useTrackedData`
|
|
728
|
+
|
|
676
729
|
- `@vue-solana/vue/useSignIn`
|
|
730
|
+
|
|
731
|
+
- `@vue-solana/vue/useSolanaPay`
|
|
732
|
+
|
|
733
|
+
- `@vue-solana/vue/useSolanaPayConfirmation`
|
|
734
|
+
|
|
735
|
+
- `@vue-solana/vue/useSolanaQrCode`
|
|
736
|
+
|
|
737
|
+
- `@vue-solana/vue/useSolanaQrScanner`
|
|
738
|
+
|
|
677
739
|
- `@vue-solana/vue/useSelectedWalletAccount`
|
|
740
|
+
|
|
678
741
|
- `@vue-solana/vue/useSignTransactions`
|
|
742
|
+
|
|
679
743
|
- `@vue-solana/vue/useSignAndSendTransactions`
|
|
744
|
+
|
|
680
745
|
- `@vue-solana/vue/useClientCapability`
|
|
746
|
+
|
|
681
747
|
- `@vue-solana/vue/usePayer`
|
|
748
|
+
|
|
682
749
|
- `@vue-solana/vue/useIdentity`
|
|
750
|
+
|
|
683
751
|
- `@vue-solana/vue/usePlanTransaction`
|
|
752
|
+
|
|
684
753
|
- `@vue-solana/vue/usePlanTransactions`
|
|
754
|
+
|
|
685
755
|
- `@vue-solana/vue/useSendTransaction`
|
|
756
|
+
|
|
686
757
|
- `@vue-solana/vue/useSendTransactions`
|
|
687
758
|
|
|
688
759
|
Other direct subpaths:
|
|
689
760
|
|
|
690
761
|
- `@vue-solana/vue/swr`
|
|
762
|
+
|
|
691
763
|
- `@vue-solana/vue/kit`
|
|
764
|
+
|
|
692
765
|
- `@vue-solana/vue/buffer-polyfill`
|
|
693
766
|
|
|
694
767
|
## Caveats
|
|
695
768
|
|
|
696
769
|
- 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.
|
|
770
|
+
|
|
697
771
|
- Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
|
|
772
|
+
|
|
698
773
|
- Broad `useProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
|
|
774
|
+
|
|
699
775
|
- 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.
|
|
776
|
+
|
|
700
777
|
- 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.
|
|
778
|
+
|
|
701
779
|
- Desktop native app wallets are planned but not implemented yet.
|
|
702
780
|
|
|
703
781
|
## Status
|
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 };
|
package/dist/useAccountInfo.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
-
import * as
|
|
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<
|
|
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>;
|
package/dist/useBalance.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
-
import * as
|
|
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<
|
|
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
|
|
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<
|
|
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<
|
|
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,6 +1,6 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
-
import * as
|
|
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<
|
|
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
|
|
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<
|
|
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<
|
|
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
|
|
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<
|
|
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<
|
|
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>;
|
package/dist/useSignIn.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
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<
|
|
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
|
|
package/dist/useSignMessage.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
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<
|
|
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
|
|
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<
|
|
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<"idle" | "confirmed" | "finalized" | "error" | "pending" | "found" | "expired", "idle" | "confirmed" | "finalized" | "error" | "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
|
|
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<
|
|
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
|
|
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<
|
|
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
|
|
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<
|
|
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
|
};
|
package/dist/useWallet.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _solana_kit from '@solana/kit';
|
|
2
2
|
import * as vue from 'vue';
|
|
3
|
-
import * as
|
|
3
|
+
import * as _vue_solana_core from '@vue-solana/core';
|
|
4
4
|
|
|
5
5
|
declare function useWallet(): {
|
|
6
|
-
wallet: vue.Ref<
|
|
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:
|
|
26
|
+
setWallet: (wallet: _vue_solana_core.SolanaWallet | null) => void;
|
|
27
27
|
connect: () => Promise<void>;
|
|
28
28
|
disconnect: () => Promise<void>;
|
|
29
29
|
};
|
package/dist/useWallets.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
|
-
import * as
|
|
2
|
+
import * as _vue_solana_core from '@vue-solana/core';
|
|
3
3
|
|
|
4
4
|
declare function useWallets(): {
|
|
5
|
-
wallets: vue.Ref<
|
|
6
|
-
selectedWallet: vue.Ref<
|
|
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:
|
|
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.
|
|
3
|
+
"version": "4.1.1",
|
|
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.
|
|
197
|
+
"@vue-solana/core": "4.1.1"
|
|
182
198
|
},
|
|
183
199
|
"peerDependencies": {
|
|
184
200
|
"vue": "^3.5.0"
|