@vue-solana/vue 2.0.0 → 2.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 +159 -21
- package/dist/index.cjs +58 -20
- package/dist/index.d.cts +25 -5
- package/dist/index.d.mts +25 -5
- package/dist/index.d.ts +25 -5
- package/dist/index.mjs +37 -19
- package/dist/shared/vue.5euWd6-V.mjs +59 -0
- package/dist/shared/vue.9TPxZPMf.cjs +59 -0
- package/dist/shared/vue.B4-LEdSE.cjs +102 -0
- package/dist/shared/{vue.CP1DPDX9.cjs → vue.B6ainw2G.cjs} +1 -1
- package/dist/shared/vue.B8LptjZP.mjs +32 -0
- package/dist/shared/vue.B8pLQ8P4.cjs +105 -0
- package/dist/shared/vue.B8ub540p.mjs +109 -0
- package/dist/shared/{vue.DP7qY8Rk.mjs → vue.BD6Gm1nl.mjs} +2 -2
- package/dist/shared/{vue.BAlo-tIh.cjs → vue.BGxz4dru.cjs} +5 -1
- package/dist/shared/{vue.stUBDBI9.mjs → vue.BINkrA8h.mjs} +2 -2
- package/dist/shared/{vue.k9Q6aN-0.cjs → vue.BIxphCAq.cjs} +1 -1
- package/dist/shared/{vue.yQcL1yMv.mjs → vue.BOpgWr43.mjs} +2 -2
- package/dist/shared/{vue.dPRo2X5y.mjs → vue.BQRpjwKl.mjs} +2 -2
- package/dist/shared/{vue.CZwftA0L.cjs → vue.BVaMoz9y.cjs} +1 -1
- package/dist/shared/vue.BVj9lWBK.cjs +111 -0
- package/dist/shared/vue.BY0qpgYr.cjs +35 -0
- package/dist/shared/vue.Bk5xjlUx.cjs +61 -0
- package/dist/shared/{vue.3VLZmw05.mjs → vue.BsGwt78R.mjs} +1 -1
- package/dist/shared/{vue.B_LRH8SM.cjs → vue.Bwd1sGAM.cjs} +2 -2
- package/dist/shared/vue.ByxbBC3y.mjs +57 -0
- package/dist/shared/{vue.BbMPRDeO.mjs → vue.C13umiQi.mjs} +2 -2
- package/dist/shared/vue.C5FVoEZT.mjs +99 -0
- package/dist/shared/vue.CATOh_9G.mjs +42 -0
- package/dist/shared/{vue.XQFqlMId.cjs → vue.CIs8QhCw.cjs} +2 -2
- package/dist/shared/vue.CMohL_Cz.mjs +58 -0
- package/dist/shared/{vue.CnUlZSe8.mjs → vue.CQh3AUE8.mjs} +2 -5
- package/dist/shared/{vue.CSJSK0Nq.cjs → vue.CWZSMVnB.cjs} +3 -3
- package/dist/shared/{vue.DL-yMCNc.mjs → vue.CXB4NEMA.mjs} +2 -2
- package/dist/shared/{vue.D7xFeC2m.mjs → vue.C_4qJDiF.mjs} +1 -1
- package/dist/shared/vue.CoaIWGPT.cjs +38 -0
- package/dist/shared/vue.CogzzQXM.mjs +171 -0
- package/dist/shared/{vue.ChujsB0B.mjs → vue.CpkwC8Th.mjs} +1 -1
- package/dist/shared/vue.CrkK_T15.cjs +86 -0
- package/dist/shared/{vue.BMencBpI.cjs → vue.D-qi8PSL.cjs} +2 -2
- package/dist/shared/{vue.PJjEncbP.mjs → vue.D218Ow7t.mjs} +6 -2
- package/dist/shared/{vue.B2sFJ1xI.mjs → vue.D3Y0PWbF.mjs} +1 -1
- package/dist/shared/vue.D5U1yLG3.mjs +83 -0
- package/dist/shared/{vue.CXHYdyKZ.cjs → vue.DAg5wC1G.cjs} +2 -2
- package/dist/shared/vue.DDbVk0Zh.cjs +180 -0
- package/dist/shared/{vue.BaR1VPhl.cjs → vue.DE3emjSF.cjs} +2 -6
- package/dist/shared/vue.DEHxNvUX.cjs +7 -0
- package/dist/shared/vue.DFaMJLAQ.cjs +60 -0
- package/dist/shared/vue.DImwKTwJ.mjs +103 -0
- package/dist/shared/{vue.DgCmU1RR.cjs → vue.DKyQ7J67.cjs} +1 -1
- package/dist/shared/vue.DXQVIRZA.mjs +174 -0
- package/dist/shared/vue.DYk0Xfr3.mjs +36 -0
- package/dist/shared/vue.D_P5SqqD.mjs +5 -0
- package/dist/shared/{vue.C7yR7Cs0.cjs → vue.Di7yjJ-R.cjs} +2 -2
- package/dist/shared/vue.DtCbCcPd.cjs +173 -0
- package/dist/shared/{vue.WugzPOca.mjs → vue.Dyi1OCI1.mjs} +3 -3
- package/dist/shared/{vue.CEn2purG.cjs → vue.E_npPFoV.cjs} +2 -2
- package/dist/shared/{vue.__r7YYZE.cjs → vue.FiMmnMHr.cjs} +1 -1
- package/dist/shared/{vue.CZO8TwJP.mjs → vue.JUWqu6kD.mjs} +1 -1
- package/dist/shared/{vue.BaFrF2PF.mjs → vue.Mxc8w6Qk.mjs} +1 -1
- package/dist/shared/{vue.C32ozdA1.cjs → vue.Sbbm9JSu.cjs} +1 -1
- package/dist/shared/vue.g8fnm_ca.cjs +45 -0
- package/dist/swr.cjs +136 -0
- package/dist/swr.d.cts +41 -0
- package/dist/swr.d.mts +41 -0
- package/dist/swr.d.ts +41 -0
- package/dist/swr.mjs +131 -0
- package/dist/useAccountInfo.cjs +5 -4
- package/dist/useAccountInfo.mjs +5 -4
- package/dist/useAction.cjs +9 -0
- package/dist/useAction.d.cts +45 -0
- package/dist/useAction.d.mts +45 -0
- package/dist/useAction.d.ts +45 -0
- package/dist/useAction.mjs +3 -0
- package/dist/useBalance.cjs +5 -4
- package/dist/useBalance.mjs +5 -4
- package/dist/useClientCapability.cjs +12 -0
- package/dist/useClientCapability.d.cts +39 -0
- package/dist/useClientCapability.d.mts +39 -0
- package/dist/useClientCapability.d.ts +39 -0
- package/dist/useClientCapability.mjs +5 -0
- package/dist/useConnection.cjs +4 -3
- package/dist/useConnection.mjs +4 -3
- package/dist/useIdentity.cjs +12 -0
- package/dist/useIdentity.d.cts +3 -0
- package/dist/useIdentity.d.mts +3 -0
- package/dist/useIdentity.d.ts +3 -0
- package/dist/useIdentity.mjs +6 -0
- package/dist/usePayer.cjs +13 -0
- package/dist/usePayer.d.cts +18 -0
- package/dist/usePayer.d.mts +18 -0
- package/dist/usePayer.d.ts +18 -0
- package/dist/usePayer.mjs +6 -0
- package/dist/usePlanTransaction.cjs +14 -0
- package/dist/usePlanTransaction.d.cts +37 -0
- package/dist/usePlanTransaction.d.mts +37 -0
- package/dist/usePlanTransaction.d.ts +37 -0
- package/dist/usePlanTransaction.mjs +7 -0
- package/dist/usePlanTransactions.cjs +13 -0
- package/dist/usePlanTransactions.d.cts +4 -0
- package/dist/usePlanTransactions.d.mts +4 -0
- package/dist/usePlanTransactions.d.ts +4 -0
- package/dist/usePlanTransactions.mjs +7 -0
- package/dist/useProgramAccounts.cjs +5 -4
- package/dist/useProgramAccounts.mjs +5 -4
- package/dist/useRequest.cjs +11 -0
- package/dist/useRequest.d.cts +57 -0
- package/dist/useRequest.d.mts +57 -0
- package/dist/useRequest.d.ts +57 -0
- package/dist/useRequest.mjs +5 -0
- package/dist/useRpc.cjs +3 -2
- package/dist/useRpc.mjs +3 -2
- package/dist/useSelectedWalletAccount.cjs +13 -0
- package/dist/useSelectedWalletAccount.d.cts +117 -0
- package/dist/useSelectedWalletAccount.d.mts +117 -0
- package/dist/useSelectedWalletAccount.d.ts +117 -0
- package/dist/useSelectedWalletAccount.mjs +3 -0
- package/dist/useSignAndSendTransaction.cjs +7 -6
- package/dist/useSignAndSendTransaction.mjs +7 -6
- package/dist/useSignAndSendTransactions.cjs +15 -0
- package/dist/useSignAndSendTransactions.d.cts +35 -0
- package/dist/useSignAndSendTransactions.d.mts +35 -0
- package/dist/useSignAndSendTransactions.d.ts +35 -0
- package/dist/useSignAndSendTransactions.mjs +8 -0
- package/dist/useSignIn.cjs +13 -0
- package/dist/useSignIn.d.cts +23 -0
- package/dist/useSignIn.d.mts +23 -0
- package/dist/useSignIn.d.ts +23 -0
- package/dist/useSignIn.mjs +7 -0
- package/dist/useSignMessage.cjs +4 -3
- package/dist/useSignMessage.mjs +4 -3
- package/dist/useSignTransactions.cjs +13 -0
- package/dist/useSignTransactions.d.cts +24 -0
- package/dist/useSignTransactions.d.mts +24 -0
- package/dist/useSignTransactions.d.ts +24 -0
- package/dist/useSignTransactions.mjs +7 -0
- package/dist/useSignatureStatus.cjs +5 -4
- package/dist/useSignatureStatus.mjs +5 -4
- package/dist/useSolana.cjs +2 -1
- package/dist/useSolana.mjs +2 -1
- package/dist/useSolanaClient.cjs +3 -2
- package/dist/useSolanaClient.mjs +3 -2
- package/dist/useSubscription.cjs +9 -0
- package/dist/useSubscription.d.cts +58 -0
- package/dist/useSubscription.d.mts +58 -0
- package/dist/useSubscription.d.ts +58 -0
- package/dist/useSubscription.mjs +3 -0
- package/dist/useTokenAccounts.cjs +5 -4
- package/dist/useTokenAccounts.mjs +5 -4
- package/dist/useTokenBalance.cjs +5 -4
- package/dist/useTokenBalance.mjs +5 -4
- package/dist/useTrackedData.cjs +10 -0
- package/dist/useTrackedData.d.cts +86 -0
- package/dist/useTrackedData.d.mts +86 -0
- package/dist/useTrackedData.d.ts +86 -0
- package/dist/useTrackedData.mjs +4 -0
- package/dist/useTransaction.cjs +2 -1
- package/dist/useTransaction.d.cts +12 -1
- package/dist/useTransaction.d.mts +12 -1
- package/dist/useTransaction.d.ts +12 -1
- package/dist/useTransaction.mjs +2 -1
- package/dist/useTransactionConfirmation.cjs +5 -4
- package/dist/useTransactionConfirmation.mjs +5 -4
- package/dist/useWallet.cjs +3 -2
- package/dist/useWallet.mjs +3 -2
- package/dist/useWallets.cjs +3 -2
- package/dist/useWallets.mjs +3 -2
- package/package.json +73 -3
- package/dist/shared/vue.C4d2JA8U.mjs +0 -44
- package/dist/shared/vue.CE5i8KZZ.cjs +0 -46
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ReactiveActionSource, SolanaRpcResponse, ReactiveStreamSource, ReactiveStreamStore } from '@vue-solana/core/kit';
|
|
2
|
+
import { SolanaError } from '@vue-solana/core/errors';
|
|
3
|
+
import { ComputedRef, Ref } from 'vue';
|
|
4
|
+
|
|
5
|
+
type UseTrackedDataStatus = "loading" | "loaded" | "error" | "disabled";
|
|
6
|
+
type SendFn<TValue> = (options?: {
|
|
7
|
+
abortSignal?: AbortSignal;
|
|
8
|
+
}) => Promise<TValue>;
|
|
9
|
+
/**
|
|
10
|
+
* One-shot initial-value source (satisfied by `PendingRpcRequest`).
|
|
11
|
+
*/
|
|
12
|
+
type UseTrackedDataInitialSource<TInitialValue> = ReactiveActionSource<SolanaRpcResponse<TInitialValue>> | {
|
|
13
|
+
send: SendFn<SolanaRpcResponse<TInitialValue>>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Ongoing stream source (satisfied by `PendingRpcSubscriptionsRequest`).
|
|
17
|
+
*/
|
|
18
|
+
type UseTrackedDataStreamSource<TStreamValue> = ReactiveStreamSource<SolanaRpcResponse<TStreamValue>> | {
|
|
19
|
+
reactiveStore: () => ReactiveStreamStore<SolanaRpcResponse<TStreamValue>>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A `useTrackedData` source bundle. Every field accepts a plain source or a
|
|
23
|
+
* `ref`/`computed` of it; a `null`/`undefined` `rpcRequest` or
|
|
24
|
+
* `rpcSubscriptionRequest` disables the composable.
|
|
25
|
+
*/
|
|
26
|
+
interface UseTrackedDataSource<TInitialValue, TStreamValue, TItem> {
|
|
27
|
+
/**
|
|
28
|
+
* One-shot RPC request for the initial value, for example
|
|
29
|
+
* `rpc.getBalance(address)`.
|
|
30
|
+
*/
|
|
31
|
+
rpcRequest: UseTrackedDataInitialSource<TInitialValue> | Ref<UseTrackedDataInitialSource<TInitialValue> | null | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* RPC subscription request for live updates, for example
|
|
34
|
+
* `rpcSubscriptions.accountNotifications(address)`.
|
|
35
|
+
*/
|
|
36
|
+
rpcSubscriptionRequest: UseTrackedDataStreamSource<TStreamValue> | Ref<UseTrackedDataStreamSource<TStreamValue> | null | undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* Maps the initial fetch's response value to the stored item type.
|
|
39
|
+
*/
|
|
40
|
+
rpcValueMapper: (value: TInitialValue) => TItem;
|
|
41
|
+
/**
|
|
42
|
+
* Maps a stream notification's value to the stored item type.
|
|
43
|
+
*/
|
|
44
|
+
rpcSubscriptionValueMapper: (value: TStreamValue) => TItem;
|
|
45
|
+
}
|
|
46
|
+
interface UseTrackedDataOptions {
|
|
47
|
+
/**
|
|
48
|
+
* Returns a caller-provided `AbortSignal` per connection (for example
|
|
49
|
+
* `AbortSignal.timeout(60_000)`), composed with the per-connection signal
|
|
50
|
+
* by the underlying store. Aborting it fails the connection with the abort
|
|
51
|
+
* reason without touching other state.
|
|
52
|
+
*/
|
|
53
|
+
getAbortSignal?: (connection: number) => AbortSignal | null | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Called when the tracked data transitions into `error`.
|
|
56
|
+
*/
|
|
57
|
+
onError?: (error: unknown) => void;
|
|
58
|
+
}
|
|
59
|
+
interface UseTrackedDataReturn<TItem> {
|
|
60
|
+
/**
|
|
61
|
+
* The latest item, surface-mapped by `rpcValueMapper` /
|
|
62
|
+
* `rpcSubscriptionValueMapper`. The {@link SolanaRpcResponse} envelope is
|
|
63
|
+
* preserved so callers can read `data.value?.context.slot`.
|
|
64
|
+
*/
|
|
65
|
+
data: ComputedRef<SolanaRpcResponse<TItem> | undefined>;
|
|
66
|
+
error: ComputedRef<SolanaError | null>;
|
|
67
|
+
refresh: () => void;
|
|
68
|
+
status: ComputedRef<UseTrackedDataStatus>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Live RPC data seeded by a one-shot fetch, slot-deduplicated between the two
|
|
72
|
+
* sources so notifications and the initial response can arrive in any order
|
|
73
|
+
* without out-of-order regressions.
|
|
74
|
+
*
|
|
75
|
+
* - `refresh()` aborts the current connection and re-runs both the fetch and
|
|
76
|
+
* the subscription with stale-while-revalidate (last known `data` stays
|
|
77
|
+
* visible while loading).
|
|
78
|
+
* - A `null`/`undefined` source (or `ref` of one) disables the composable and
|
|
79
|
+
* clears state.
|
|
80
|
+
* - `getAbortSignal` attaches per-connection cancellation (timeouts, kill
|
|
81
|
+
* switches) on top of the internal per-connection signal.
|
|
82
|
+
*/
|
|
83
|
+
declare function useTrackedData<TInitialValue, TStreamValue, TItem>(source: UseTrackedDataSource<TInitialValue, TStreamValue, TItem>, options?: UseTrackedDataOptions): UseTrackedDataReturn<TItem>;
|
|
84
|
+
|
|
85
|
+
export { useTrackedData };
|
|
86
|
+
export type { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource };
|
package/dist/useTransaction.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const useTransaction = require('./shared/vue.
|
|
3
|
+
const useTransaction = require('./shared/vue.Bk5xjlUx.cjs');
|
|
4
|
+
require('@vue-solana/core/action');
|
|
4
5
|
require('@vue-solana/core/errors');
|
|
5
6
|
require('@vue-solana/core/timeout');
|
|
6
7
|
require('vue');
|
|
@@ -5,8 +5,19 @@ interface UseTransactionOptions {
|
|
|
5
5
|
timeoutMs?: number;
|
|
6
6
|
timeoutMessage?: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Execute a transaction-building workflow and track `{ signature, loading,
|
|
10
|
+
* error }` through Vue state.
|
|
11
|
+
*
|
|
12
|
+
* Built on the same action state machine as `useAction`
|
|
13
|
+
* (`createSolanaActionStore` from `@vue-solana/core/action`): starting a new
|
|
14
|
+
* execution while one is in flight supersedes it — the older call's outcome
|
|
15
|
+
* is dropped and its promise rejects without touching state, so newer
|
|
16
|
+
* executions always own `signature`/`loading`/`error`. Each execution is
|
|
17
|
+
* raced against `timeoutMs` (`TRANSACTION_TIMEOUT` when exceeded).
|
|
18
|
+
*/
|
|
8
19
|
declare function useTransaction<TArgs extends unknown[]>(handler: (...args: TArgs) => Promise<string>, options?: UseTransactionOptions): {
|
|
9
|
-
signature: vue.
|
|
20
|
+
signature: vue.ShallowRef<string | null, string | null>;
|
|
10
21
|
loading: vue.Ref<boolean, boolean>;
|
|
11
22
|
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
12
23
|
execute: (...args: TArgs) => Promise<string>;
|
|
@@ -5,8 +5,19 @@ interface UseTransactionOptions {
|
|
|
5
5
|
timeoutMs?: number;
|
|
6
6
|
timeoutMessage?: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Execute a transaction-building workflow and track `{ signature, loading,
|
|
10
|
+
* error }` through Vue state.
|
|
11
|
+
*
|
|
12
|
+
* Built on the same action state machine as `useAction`
|
|
13
|
+
* (`createSolanaActionStore` from `@vue-solana/core/action`): starting a new
|
|
14
|
+
* execution while one is in flight supersedes it — the older call's outcome
|
|
15
|
+
* is dropped and its promise rejects without touching state, so newer
|
|
16
|
+
* executions always own `signature`/`loading`/`error`. Each execution is
|
|
17
|
+
* raced against `timeoutMs` (`TRANSACTION_TIMEOUT` when exceeded).
|
|
18
|
+
*/
|
|
8
19
|
declare function useTransaction<TArgs extends unknown[]>(handler: (...args: TArgs) => Promise<string>, options?: UseTransactionOptions): {
|
|
9
|
-
signature: vue.
|
|
20
|
+
signature: vue.ShallowRef<string | null, string | null>;
|
|
10
21
|
loading: vue.Ref<boolean, boolean>;
|
|
11
22
|
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
12
23
|
execute: (...args: TArgs) => Promise<string>;
|
package/dist/useTransaction.d.ts
CHANGED
|
@@ -5,8 +5,19 @@ interface UseTransactionOptions {
|
|
|
5
5
|
timeoutMs?: number;
|
|
6
6
|
timeoutMessage?: string;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Execute a transaction-building workflow and track `{ signature, loading,
|
|
10
|
+
* error }` through Vue state.
|
|
11
|
+
*
|
|
12
|
+
* Built on the same action state machine as `useAction`
|
|
13
|
+
* (`createSolanaActionStore` from `@vue-solana/core/action`): starting a new
|
|
14
|
+
* execution while one is in flight supersedes it — the older call's outcome
|
|
15
|
+
* is dropped and its promise rejects without touching state, so newer
|
|
16
|
+
* executions always own `signature`/`loading`/`error`. Each execution is
|
|
17
|
+
* raced against `timeoutMs` (`TRANSACTION_TIMEOUT` when exceeded).
|
|
18
|
+
*/
|
|
8
19
|
declare function useTransaction<TArgs extends unknown[]>(handler: (...args: TArgs) => Promise<string>, options?: UseTransactionOptions): {
|
|
9
|
-
signature: vue.
|
|
20
|
+
signature: vue.ShallowRef<string | null, string | null>;
|
|
10
21
|
loading: vue.Ref<boolean, boolean>;
|
|
11
22
|
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
12
23
|
execute: (...args: TArgs) => Promise<string>;
|
package/dist/useTransaction.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const useTransactionConfirmation = require('./shared/vue.
|
|
3
|
+
const useTransactionConfirmation = require('./shared/vue.Sbbm9JSu.cjs');
|
|
4
4
|
require('@vue-solana/core/transaction');
|
|
5
5
|
require('@vue-solana/core/errors');
|
|
6
6
|
require('vue');
|
|
7
|
-
require('./shared/vue.
|
|
8
|
-
require('./shared/vue.
|
|
9
|
-
require('./shared/vue.
|
|
7
|
+
require('./shared/vue.BVaMoz9y.cjs');
|
|
8
|
+
require('./shared/vue.BIxphCAq.cjs');
|
|
9
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
10
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { g as getConfirmedTransactionStatus, u as useTransactionConfirmation } from './shared/vue.
|
|
1
|
+
export { g as getConfirmedTransactionStatus, u as useTransactionConfirmation } from './shared/vue.D3Y0PWbF.mjs';
|
|
2
2
|
import '@vue-solana/core/transaction';
|
|
3
3
|
import '@vue-solana/core/errors';
|
|
4
4
|
import 'vue';
|
|
5
|
-
import './shared/vue.
|
|
6
|
-
import './shared/vue.
|
|
7
|
-
import './shared/vue.
|
|
5
|
+
import './shared/vue.CpkwC8Th.mjs';
|
|
6
|
+
import './shared/vue.Mxc8w6Qk.mjs';
|
|
7
|
+
import './shared/vue.CQh3AUE8.mjs';
|
|
8
|
+
import './shared/vue.D_P5SqqD.mjs';
|
package/dist/useWallet.cjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const useWallet = require('./shared/vue.
|
|
3
|
+
const useWallet = require('./shared/vue.BGxz4dru.cjs');
|
|
4
4
|
require('@vue-solana/core/errors');
|
|
5
5
|
require('@vue-solana/core/wallet');
|
|
6
6
|
require('vue');
|
|
7
|
-
require('./shared/vue.
|
|
7
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
8
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
|
package/dist/useWallet.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { u as useWallet } from './shared/vue.
|
|
1
|
+
export { u as useWallet } from './shared/vue.D218Ow7t.mjs';
|
|
2
2
|
import '@vue-solana/core/errors';
|
|
3
3
|
import '@vue-solana/core/wallet';
|
|
4
4
|
import 'vue';
|
|
5
|
-
import './shared/vue.
|
|
5
|
+
import './shared/vue.CQh3AUE8.mjs';
|
|
6
|
+
import './shared/vue.D_P5SqqD.mjs';
|
package/dist/useWallets.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const useWallets = require('./shared/vue.
|
|
4
|
-
require('./shared/vue.
|
|
3
|
+
const useWallets = require('./shared/vue.DKyQ7J67.cjs');
|
|
4
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
5
5
|
require('vue');
|
|
6
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
package/dist/useWallets.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-solana/vue",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Vue plugin and composables for Solana applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -35,6 +35,76 @@
|
|
|
35
35
|
"import": "./dist/buffer-polyfill.mjs",
|
|
36
36
|
"require": "./dist/buffer-polyfill.cjs"
|
|
37
37
|
},
|
|
38
|
+
"./useAction": {
|
|
39
|
+
"types": "./dist/useAction.d.ts",
|
|
40
|
+
"import": "./dist/useAction.mjs",
|
|
41
|
+
"require": "./dist/useAction.cjs"
|
|
42
|
+
},
|
|
43
|
+
"./useRequest": {
|
|
44
|
+
"types": "./dist/useRequest.d.ts",
|
|
45
|
+
"import": "./dist/useRequest.mjs",
|
|
46
|
+
"require": "./dist/useRequest.cjs"
|
|
47
|
+
},
|
|
48
|
+
"./useSubscription": {
|
|
49
|
+
"types": "./dist/useSubscription.d.ts",
|
|
50
|
+
"import": "./dist/useSubscription.mjs",
|
|
51
|
+
"require": "./dist/useSubscription.cjs"
|
|
52
|
+
},
|
|
53
|
+
"./useTrackedData": {
|
|
54
|
+
"types": "./dist/useTrackedData.d.ts",
|
|
55
|
+
"import": "./dist/useTrackedData.mjs",
|
|
56
|
+
"require": "./dist/useTrackedData.cjs"
|
|
57
|
+
},
|
|
58
|
+
"./useSignIn": {
|
|
59
|
+
"types": "./dist/useSignIn.d.ts",
|
|
60
|
+
"import": "./dist/useSignIn.mjs",
|
|
61
|
+
"require": "./dist/useSignIn.cjs"
|
|
62
|
+
},
|
|
63
|
+
"./useSelectedWalletAccount": {
|
|
64
|
+
"types": "./dist/useSelectedWalletAccount.d.ts",
|
|
65
|
+
"import": "./dist/useSelectedWalletAccount.mjs",
|
|
66
|
+
"require": "./dist/useSelectedWalletAccount.cjs"
|
|
67
|
+
},
|
|
68
|
+
"./useSignTransactions": {
|
|
69
|
+
"types": "./dist/useSignTransactions.d.ts",
|
|
70
|
+
"import": "./dist/useSignTransactions.mjs",
|
|
71
|
+
"require": "./dist/useSignTransactions.cjs"
|
|
72
|
+
},
|
|
73
|
+
"./useSignAndSendTransactions": {
|
|
74
|
+
"types": "./dist/useSignAndSendTransactions.d.ts",
|
|
75
|
+
"import": "./dist/useSignAndSendTransactions.mjs",
|
|
76
|
+
"require": "./dist/useSignAndSendTransactions.cjs"
|
|
77
|
+
},
|
|
78
|
+
"./useClientCapability": {
|
|
79
|
+
"types": "./dist/useClientCapability.d.ts",
|
|
80
|
+
"import": "./dist/useClientCapability.mjs",
|
|
81
|
+
"require": "./dist/useClientCapability.cjs"
|
|
82
|
+
},
|
|
83
|
+
"./usePayer": {
|
|
84
|
+
"types": "./dist/usePayer.d.ts",
|
|
85
|
+
"import": "./dist/usePayer.mjs",
|
|
86
|
+
"require": "./dist/usePayer.cjs"
|
|
87
|
+
},
|
|
88
|
+
"./useIdentity": {
|
|
89
|
+
"types": "./dist/useIdentity.d.ts",
|
|
90
|
+
"import": "./dist/useIdentity.mjs",
|
|
91
|
+
"require": "./dist/useIdentity.cjs"
|
|
92
|
+
},
|
|
93
|
+
"./usePlanTransaction": {
|
|
94
|
+
"types": "./dist/usePlanTransaction.d.ts",
|
|
95
|
+
"import": "./dist/usePlanTransaction.mjs",
|
|
96
|
+
"require": "./dist/usePlanTransaction.cjs"
|
|
97
|
+
},
|
|
98
|
+
"./usePlanTransactions": {
|
|
99
|
+
"types": "./dist/usePlanTransactions.d.ts",
|
|
100
|
+
"import": "./dist/usePlanTransactions.mjs",
|
|
101
|
+
"require": "./dist/usePlanTransactions.cjs"
|
|
102
|
+
},
|
|
103
|
+
"./swr": {
|
|
104
|
+
"types": "./dist/swr.d.ts",
|
|
105
|
+
"import": "./dist/swr.mjs",
|
|
106
|
+
"require": "./dist/swr.cjs"
|
|
107
|
+
},
|
|
38
108
|
"./useSolana": {
|
|
39
109
|
"types": "./dist/useSolana.d.ts",
|
|
40
110
|
"import": "./dist/useSolana.mjs",
|
|
@@ -129,7 +199,7 @@
|
|
|
129
199
|
},
|
|
130
200
|
"dependencies": {
|
|
131
201
|
"bs58": "^6.0.0",
|
|
132
|
-
"@vue-solana/core": "2.
|
|
202
|
+
"@vue-solana/core": "2.1.0"
|
|
133
203
|
},
|
|
134
204
|
"peerDependencies": {
|
|
135
205
|
"vue": "^3.5.0"
|
|
@@ -140,7 +210,7 @@
|
|
|
140
210
|
"vue": "^3.5.16"
|
|
141
211
|
},
|
|
142
212
|
"scripts": {
|
|
143
|
-
"build": "unbuild",
|
|
213
|
+
"build": "NODE_OPTIONS=--max-old-space-size=8192 unbuild",
|
|
144
214
|
"dev": "unbuild --stub",
|
|
145
215
|
"typecheck": "tsc --noEmit",
|
|
146
216
|
"clean": "rm -rf dist"
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { normalizeSolanaError } from '@vue-solana/core/errors';
|
|
2
|
-
import { withSolanaTimeout } from '@vue-solana/core/timeout';
|
|
3
|
-
import { ref } from 'vue';
|
|
4
|
-
|
|
5
|
-
function useTransaction(handler, options = {}) {
|
|
6
|
-
const signature = ref(null);
|
|
7
|
-
const loading = ref(false);
|
|
8
|
-
const error = ref(null);
|
|
9
|
-
let executionId = 0;
|
|
10
|
-
async function execute(...args) {
|
|
11
|
-
const currentExecutionId = ++executionId;
|
|
12
|
-
loading.value = true;
|
|
13
|
-
error.value = null;
|
|
14
|
-
try {
|
|
15
|
-
const nextSignature = await withSolanaTimeout(
|
|
16
|
-
handler(...args),
|
|
17
|
-
options.timeoutMs,
|
|
18
|
-
options.timeoutMessage ?? "Transaction did not return a result before timing out."
|
|
19
|
-
);
|
|
20
|
-
if (currentExecutionId === executionId) {
|
|
21
|
-
signature.value = nextSignature;
|
|
22
|
-
}
|
|
23
|
-
return nextSignature;
|
|
24
|
-
} catch (cause) {
|
|
25
|
-
const normalizedError = normalizeSolanaError(cause, "RPC_FAILURE");
|
|
26
|
-
if (currentExecutionId === executionId) {
|
|
27
|
-
error.value = normalizedError;
|
|
28
|
-
}
|
|
29
|
-
throw normalizedError;
|
|
30
|
-
} finally {
|
|
31
|
-
if (currentExecutionId === executionId) {
|
|
32
|
-
loading.value = false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
signature,
|
|
38
|
-
loading,
|
|
39
|
-
error,
|
|
40
|
-
execute
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { useTransaction as u };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const errors = require('@vue-solana/core/errors');
|
|
4
|
-
const timeout = require('@vue-solana/core/timeout');
|
|
5
|
-
const vue = require('vue');
|
|
6
|
-
|
|
7
|
-
function useTransaction(handler, options = {}) {
|
|
8
|
-
const signature = vue.ref(null);
|
|
9
|
-
const loading = vue.ref(false);
|
|
10
|
-
const error = vue.ref(null);
|
|
11
|
-
let executionId = 0;
|
|
12
|
-
async function execute(...args) {
|
|
13
|
-
const currentExecutionId = ++executionId;
|
|
14
|
-
loading.value = true;
|
|
15
|
-
error.value = null;
|
|
16
|
-
try {
|
|
17
|
-
const nextSignature = await timeout.withSolanaTimeout(
|
|
18
|
-
handler(...args),
|
|
19
|
-
options.timeoutMs,
|
|
20
|
-
options.timeoutMessage ?? "Transaction did not return a result before timing out."
|
|
21
|
-
);
|
|
22
|
-
if (currentExecutionId === executionId) {
|
|
23
|
-
signature.value = nextSignature;
|
|
24
|
-
}
|
|
25
|
-
return nextSignature;
|
|
26
|
-
} catch (cause) {
|
|
27
|
-
const normalizedError = errors.normalizeSolanaError(cause, "RPC_FAILURE");
|
|
28
|
-
if (currentExecutionId === executionId) {
|
|
29
|
-
error.value = normalizedError;
|
|
30
|
-
}
|
|
31
|
-
throw normalizedError;
|
|
32
|
-
} finally {
|
|
33
|
-
if (currentExecutionId === executionId) {
|
|
34
|
-
loading.value = false;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
signature,
|
|
40
|
-
loading,
|
|
41
|
-
error,
|
|
42
|
-
execute
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
exports.useTransaction = useTransaction;
|