@vue-solana/vue 4.0.0 → 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 +8 -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
|
@@ -637,6 +637,10 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
637
637
|
| `clearSwrCache()` | Clears every cached SWR entry. |
|
|
638
638
|
| `deleteSwrKey(key)` | Removes a single cached SWR entry by full cache key (including adapter prefix). |
|
|
639
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`. |
|
|
640
644
|
| `useSelectedWalletAccount()` | App-wide selected wallet account context: `[selectedAccount, setSelectedAccount, filteredWallets]`. |
|
|
641
645
|
| `SelectedWalletAccountProvider` | Component that provides the selected wallet account context to its subtree. |
|
|
642
646
|
| `useSignTransactions()` | Batch-signs transactions through the wallet, preferring `signTransactions` and falling back to `signAllTransactions`. |
|
|
@@ -674,6 +678,10 @@ Direct composable subpaths:
|
|
|
674
678
|
- `@vue-solana/vue/useSubscription`
|
|
675
679
|
- `@vue-solana/vue/useTrackedData`
|
|
676
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`
|
|
677
685
|
- `@vue-solana/vue/useSelectedWalletAccount`
|
|
678
686
|
- `@vue-solana/vue/useSignTransactions`
|
|
679
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 };
|
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<"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
|
|
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.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.
|
|
197
|
+
"@vue-solana/core": "4.1.0"
|
|
182
198
|
},
|
|
183
199
|
"peerDependencies": {
|
|
184
200
|
"vue": "^3.5.0"
|