@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,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown by {@link useClientCapability} when the installed Solana client does
|
|
3
|
+
* not expose a requested capability.
|
|
4
|
+
*/
|
|
5
|
+
declare class MissingClientCapabilityError extends Error {
|
|
6
|
+
/** Name of the hook that requested the capability, e.g. `usePayer`. */
|
|
7
|
+
readonly hookName: string;
|
|
8
|
+
/** Human guidance for installing the capability on the client. */
|
|
9
|
+
readonly providerHint: string;
|
|
10
|
+
/** The missing capability name(s). */
|
|
11
|
+
readonly capabilities: readonly string[];
|
|
12
|
+
constructor(hookName: string, capabilities: readonly string[], providerHint: string);
|
|
13
|
+
}
|
|
14
|
+
interface UseClientCapabilityOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Name of the calling hook for error messages (defaults to
|
|
17
|
+
* `useClientCapability`).
|
|
18
|
+
*/
|
|
19
|
+
hookName?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Guidance appended to the error when a capability is missing, e.g. which
|
|
22
|
+
* `@solana/kit` plugin to `.use()`.
|
|
23
|
+
*/
|
|
24
|
+
providerHint?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Runtime assertion that a capability is installed on the (loosely-typed)
|
|
28
|
+
* Solana client. Throws a {@link MissingClientCapabilityError} — naming the
|
|
29
|
+
* calling hook and how to install the capability — if any requested
|
|
30
|
+
* capability is missing. Accepts one capability name or an array.
|
|
31
|
+
*
|
|
32
|
+
* The assertion runs synchronously during setup (the first step of mount),
|
|
33
|
+
* so a misconfigured client fails fast with a clear error instead of a
|
|
34
|
+
* cryptic `undefined is not a function` later on.
|
|
35
|
+
*/
|
|
36
|
+
declare function useClientCapability(capability: string | readonly string[], options?: UseClientCapabilityOptions): void;
|
|
37
|
+
|
|
38
|
+
export { MissingClientCapabilityError, useClientCapability };
|
|
39
|
+
export type { UseClientCapabilityOptions };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thrown by {@link useClientCapability} when the installed Solana client does
|
|
3
|
+
* not expose a requested capability.
|
|
4
|
+
*/
|
|
5
|
+
declare class MissingClientCapabilityError extends Error {
|
|
6
|
+
/** Name of the hook that requested the capability, e.g. `usePayer`. */
|
|
7
|
+
readonly hookName: string;
|
|
8
|
+
/** Human guidance for installing the capability on the client. */
|
|
9
|
+
readonly providerHint: string;
|
|
10
|
+
/** The missing capability name(s). */
|
|
11
|
+
readonly capabilities: readonly string[];
|
|
12
|
+
constructor(hookName: string, capabilities: readonly string[], providerHint: string);
|
|
13
|
+
}
|
|
14
|
+
interface UseClientCapabilityOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Name of the calling hook for error messages (defaults to
|
|
17
|
+
* `useClientCapability`).
|
|
18
|
+
*/
|
|
19
|
+
hookName?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Guidance appended to the error when a capability is missing, e.g. which
|
|
22
|
+
* `@solana/kit` plugin to `.use()`.
|
|
23
|
+
*/
|
|
24
|
+
providerHint?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Runtime assertion that a capability is installed on the (loosely-typed)
|
|
28
|
+
* Solana client. Throws a {@link MissingClientCapabilityError} — naming the
|
|
29
|
+
* calling hook and how to install the capability — if any requested
|
|
30
|
+
* capability is missing. Accepts one capability name or an array.
|
|
31
|
+
*
|
|
32
|
+
* The assertion runs synchronously during setup (the first step of mount),
|
|
33
|
+
* so a misconfigured client fails fast with a clear error instead of a
|
|
34
|
+
* cryptic `undefined is not a function` later on.
|
|
35
|
+
*/
|
|
36
|
+
declare function useClientCapability(capability: string | readonly string[], options?: UseClientCapabilityOptions): void;
|
|
37
|
+
|
|
38
|
+
export { MissingClientCapabilityError, useClientCapability };
|
|
39
|
+
export type { UseClientCapabilityOptions };
|
package/dist/useConnection.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const useConnection = require('./shared/vue.
|
|
4
|
-
require('./shared/vue.
|
|
5
|
-
require('./shared/vue.
|
|
3
|
+
const useConnection = require('./shared/vue.BVaMoz9y.cjs');
|
|
4
|
+
require('./shared/vue.BIxphCAq.cjs');
|
|
5
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
6
6
|
require('vue');
|
|
7
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
|
package/dist/useConnection.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { u as useConnection } from './shared/vue.
|
|
2
|
-
import './shared/vue.
|
|
3
|
-
import './shared/vue.
|
|
1
|
+
export { u as useConnection } from './shared/vue.CpkwC8Th.mjs';
|
|
2
|
+
import './shared/vue.Mxc8w6Qk.mjs';
|
|
3
|
+
import './shared/vue.CQh3AUE8.mjs';
|
|
4
4
|
import 'vue';
|
|
5
|
+
import './shared/vue.D_P5SqqD.mjs';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const usePayer = require('./shared/vue.g8fnm_ca.cjs');
|
|
4
|
+
require('vue');
|
|
5
|
+
require('./shared/vue.BY0qpgYr.cjs');
|
|
6
|
+
require('./shared/vue.BIxphCAq.cjs');
|
|
7
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
8
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.useIdentity = usePayer.useIdentity;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const usePayer = require('./shared/vue.g8fnm_ca.cjs');
|
|
4
|
+
require('vue');
|
|
5
|
+
require('./shared/vue.BY0qpgYr.cjs');
|
|
6
|
+
require('./shared/vue.BIxphCAq.cjs');
|
|
7
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
8
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.useIdentity = usePayer.useIdentity;
|
|
13
|
+
exports.usePayer = usePayer.usePayer;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TransactionSigner } from '@vue-solana/core/kit';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The acting identity signer — the wallet whose assets the application is
|
|
6
|
+
* acting upon. Requires the client to expose `identity` (e.g. via a Kit
|
|
7
|
+
* signer plugin). Re-reads on change when the client advertises
|
|
8
|
+
* `subscribeToIdentity`.
|
|
9
|
+
*/
|
|
10
|
+
declare function useIdentity(): Ref<TransactionSigner>;
|
|
11
|
+
/**
|
|
12
|
+
* The signer that pays transaction fees and storage costs. Requires the
|
|
13
|
+
* client to expose `payer` (e.g. via a Kit signer plugin). Re-reads on change
|
|
14
|
+
* when the client advertises `subscribeToPayer`.
|
|
15
|
+
*/
|
|
16
|
+
declare function usePayer(): Ref<TransactionSigner>;
|
|
17
|
+
|
|
18
|
+
export { useIdentity, usePayer };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TransactionSigner } from '@vue-solana/core/kit';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The acting identity signer — the wallet whose assets the application is
|
|
6
|
+
* acting upon. Requires the client to expose `identity` (e.g. via a Kit
|
|
7
|
+
* signer plugin). Re-reads on change when the client advertises
|
|
8
|
+
* `subscribeToIdentity`.
|
|
9
|
+
*/
|
|
10
|
+
declare function useIdentity(): Ref<TransactionSigner>;
|
|
11
|
+
/**
|
|
12
|
+
* The signer that pays transaction fees and storage costs. Requires the
|
|
13
|
+
* client to expose `payer` (e.g. via a Kit signer plugin). Re-reads on change
|
|
14
|
+
* when the client advertises `subscribeToPayer`.
|
|
15
|
+
*/
|
|
16
|
+
declare function usePayer(): Ref<TransactionSigner>;
|
|
17
|
+
|
|
18
|
+
export { useIdentity, usePayer };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TransactionSigner } from '@vue-solana/core/kit';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The acting identity signer — the wallet whose assets the application is
|
|
6
|
+
* acting upon. Requires the client to expose `identity` (e.g. via a Kit
|
|
7
|
+
* signer plugin). Re-reads on change when the client advertises
|
|
8
|
+
* `subscribeToIdentity`.
|
|
9
|
+
*/
|
|
10
|
+
declare function useIdentity(): Ref<TransactionSigner>;
|
|
11
|
+
/**
|
|
12
|
+
* The signer that pays transaction fees and storage costs. Requires the
|
|
13
|
+
* client to expose `payer` (e.g. via a Kit signer plugin). Re-reads on change
|
|
14
|
+
* when the client advertises `subscribeToPayer`.
|
|
15
|
+
*/
|
|
16
|
+
declare function usePayer(): Ref<TransactionSigner>;
|
|
17
|
+
|
|
18
|
+
export { useIdentity, usePayer };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const usePlanTransaction = require('./shared/vue.B4-LEdSE.cjs');
|
|
4
|
+
require('@vue-solana/core/errors');
|
|
5
|
+
require('vue');
|
|
6
|
+
require('./shared/vue.BY0qpgYr.cjs');
|
|
7
|
+
require('./shared/vue.BIxphCAq.cjs');
|
|
8
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
9
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.usePlanTransaction = usePlanTransaction.usePlanTransaction;
|
|
14
|
+
exports.usePlanTransactions = usePlanTransaction.usePlanTransactions;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { TransactionMessage, InstructionPlanInput, TransactionPlan } from '@vue-solana/core/kit';
|
|
3
|
+
import { SolanaError } from '@vue-solana/core/errors';
|
|
4
|
+
|
|
5
|
+
type PlanTransactionStatus = "idle" | "planning" | "planned" | "error";
|
|
6
|
+
interface PlanTransactionConfig {
|
|
7
|
+
abortSignal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Plan a single transaction message from instruction inputs — without
|
|
11
|
+
* signing or sending — using the client's transaction planning capability
|
|
12
|
+
* (e.g. `rpcTransactionPlanner` from `@solana/kit-plugin-rpc`).
|
|
13
|
+
*
|
|
14
|
+
* Rejects with a clear capability error when the client does not plan.
|
|
15
|
+
*/
|
|
16
|
+
declare function usePlanTransaction(): {
|
|
17
|
+
transactionMessage: vue.ShallowRef<TransactionMessage | null, TransactionMessage | null>;
|
|
18
|
+
status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
|
|
19
|
+
loading: vue.Ref<boolean, boolean>;
|
|
20
|
+
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
21
|
+
execute: (input: InstructionPlanInput, config?: PlanTransactionConfig) => Promise<TransactionMessage>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Plan a full transaction plan — possibly multiple transaction messages —
|
|
25
|
+
* from instruction inputs, using the client's transaction planning
|
|
26
|
+
* capability.
|
|
27
|
+
*/
|
|
28
|
+
declare function usePlanTransactions(): {
|
|
29
|
+
transactionPlan: vue.ShallowRef<TransactionPlan | null, TransactionPlan | null>;
|
|
30
|
+
status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
|
|
31
|
+
loading: vue.Ref<boolean, boolean>;
|
|
32
|
+
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
33
|
+
execute: (input: InstructionPlanInput, config?: PlanTransactionConfig) => Promise<TransactionPlan>;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { usePlanTransaction, usePlanTransactions };
|
|
37
|
+
export type { PlanTransactionConfig, PlanTransactionStatus };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { TransactionMessage, InstructionPlanInput, TransactionPlan } from '@vue-solana/core/kit';
|
|
3
|
+
import { SolanaError } from '@vue-solana/core/errors';
|
|
4
|
+
|
|
5
|
+
type PlanTransactionStatus = "idle" | "planning" | "planned" | "error";
|
|
6
|
+
interface PlanTransactionConfig {
|
|
7
|
+
abortSignal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Plan a single transaction message from instruction inputs — without
|
|
11
|
+
* signing or sending — using the client's transaction planning capability
|
|
12
|
+
* (e.g. `rpcTransactionPlanner` from `@solana/kit-plugin-rpc`).
|
|
13
|
+
*
|
|
14
|
+
* Rejects with a clear capability error when the client does not plan.
|
|
15
|
+
*/
|
|
16
|
+
declare function usePlanTransaction(): {
|
|
17
|
+
transactionMessage: vue.ShallowRef<TransactionMessage | null, TransactionMessage | null>;
|
|
18
|
+
status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
|
|
19
|
+
loading: vue.Ref<boolean, boolean>;
|
|
20
|
+
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
21
|
+
execute: (input: InstructionPlanInput, config?: PlanTransactionConfig) => Promise<TransactionMessage>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Plan a full transaction plan — possibly multiple transaction messages —
|
|
25
|
+
* from instruction inputs, using the client's transaction planning
|
|
26
|
+
* capability.
|
|
27
|
+
*/
|
|
28
|
+
declare function usePlanTransactions(): {
|
|
29
|
+
transactionPlan: vue.ShallowRef<TransactionPlan | null, TransactionPlan | null>;
|
|
30
|
+
status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
|
|
31
|
+
loading: vue.Ref<boolean, boolean>;
|
|
32
|
+
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
33
|
+
execute: (input: InstructionPlanInput, config?: PlanTransactionConfig) => Promise<TransactionPlan>;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { usePlanTransaction, usePlanTransactions };
|
|
37
|
+
export type { PlanTransactionConfig, PlanTransactionStatus };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { TransactionMessage, InstructionPlanInput, TransactionPlan } from '@vue-solana/core/kit';
|
|
3
|
+
import { SolanaError } from '@vue-solana/core/errors';
|
|
4
|
+
|
|
5
|
+
type PlanTransactionStatus = "idle" | "planning" | "planned" | "error";
|
|
6
|
+
interface PlanTransactionConfig {
|
|
7
|
+
abortSignal?: AbortSignal;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Plan a single transaction message from instruction inputs — without
|
|
11
|
+
* signing or sending — using the client's transaction planning capability
|
|
12
|
+
* (e.g. `rpcTransactionPlanner` from `@solana/kit-plugin-rpc`).
|
|
13
|
+
*
|
|
14
|
+
* Rejects with a clear capability error when the client does not plan.
|
|
15
|
+
*/
|
|
16
|
+
declare function usePlanTransaction(): {
|
|
17
|
+
transactionMessage: vue.ShallowRef<TransactionMessage | null, TransactionMessage | null>;
|
|
18
|
+
status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
|
|
19
|
+
loading: vue.Ref<boolean, boolean>;
|
|
20
|
+
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
21
|
+
execute: (input: InstructionPlanInput, config?: PlanTransactionConfig) => Promise<TransactionMessage>;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Plan a full transaction plan — possibly multiple transaction messages —
|
|
25
|
+
* from instruction inputs, using the client's transaction planning
|
|
26
|
+
* capability.
|
|
27
|
+
*/
|
|
28
|
+
declare function usePlanTransactions(): {
|
|
29
|
+
transactionPlan: vue.ShallowRef<TransactionPlan | null, TransactionPlan | null>;
|
|
30
|
+
status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
|
|
31
|
+
loading: vue.Ref<boolean, boolean>;
|
|
32
|
+
error: vue.Ref<SolanaError | null, SolanaError | null>;
|
|
33
|
+
execute: (input: InstructionPlanInput, config?: PlanTransactionConfig) => Promise<TransactionPlan>;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export { usePlanTransaction, usePlanTransactions };
|
|
37
|
+
export type { PlanTransactionConfig, PlanTransactionStatus };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { u as usePlanTransaction, a as usePlanTransactions } from './shared/vue.C5FVoEZT.mjs';
|
|
2
|
+
import '@vue-solana/core/errors';
|
|
3
|
+
import 'vue';
|
|
4
|
+
import './shared/vue.B8LptjZP.mjs';
|
|
5
|
+
import './shared/vue.Mxc8w6Qk.mjs';
|
|
6
|
+
import './shared/vue.CQh3AUE8.mjs';
|
|
7
|
+
import './shared/vue.D_P5SqqD.mjs';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const usePlanTransaction = require('./shared/vue.B4-LEdSE.cjs');
|
|
4
|
+
require('@vue-solana/core/errors');
|
|
5
|
+
require('vue');
|
|
6
|
+
require('./shared/vue.BY0qpgYr.cjs');
|
|
7
|
+
require('./shared/vue.BIxphCAq.cjs');
|
|
8
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
9
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.usePlanTransactions = usePlanTransaction.usePlanTransactions;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { a as usePlanTransactions } from './shared/vue.C5FVoEZT.mjs';
|
|
2
|
+
import '@vue-solana/core/errors';
|
|
3
|
+
import 'vue';
|
|
4
|
+
import './shared/vue.B8LptjZP.mjs';
|
|
5
|
+
import './shared/vue.Mxc8w6Qk.mjs';
|
|
6
|
+
import './shared/vue.CQh3AUE8.mjs';
|
|
7
|
+
import './shared/vue.D_P5SqqD.mjs';
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const useProgramAccounts = require('./shared/vue.
|
|
3
|
+
const useProgramAccounts = require('./shared/vue.Di7yjJ-R.cjs');
|
|
4
4
|
require('@vue-solana/core/errors');
|
|
5
5
|
require('vue');
|
|
6
6
|
require('@vue-solana/core/address');
|
|
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
|
require('./shared/vue.DNxOpDXz.cjs');
|
|
11
12
|
|
|
12
13
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { u as useProgramAccounts } from './shared/vue.
|
|
1
|
+
export { u as useProgramAccounts } from './shared/vue.C13umiQi.mjs';
|
|
2
2
|
import '@vue-solana/core/errors';
|
|
3
3
|
import 'vue';
|
|
4
4
|
import '@vue-solana/core/address';
|
|
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';
|
|
8
9
|
import './shared/vue.Bfu1dCKe.mjs';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SolanaError } from '@vue-solana/core/errors';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
type UseRequestStatus = "fetching" | "success" | "error" | "disabled";
|
|
5
|
+
type SendFn<TResult> = (options?: {
|
|
6
|
+
abortSignal?: AbortSignal;
|
|
7
|
+
}) => Promise<TResult>;
|
|
8
|
+
type ResolvedSource<TResult> = ((signal: AbortSignal) => Promise<TResult> | {
|
|
9
|
+
send: SendFn<TResult>;
|
|
10
|
+
}) | {
|
|
11
|
+
send: SendFn<TResult>;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* A request source accepted by `useRequest`:
|
|
15
|
+
*
|
|
16
|
+
* - a request function `(signal) => Promise<T>`, called with a fresh composed
|
|
17
|
+
* `AbortSignal` per attempt (it may return a Kit request object, which is
|
|
18
|
+
* sent with the signal automatically),
|
|
19
|
+
* - a Kit reactive store source such as `PendingRpcRequest` (for example
|
|
20
|
+
* `rpc.getBalance(address)`),
|
|
21
|
+
* - a `ref`/`computed` of any of the above, or of `null` to disable, or
|
|
22
|
+
* - `null` to disable outright.
|
|
23
|
+
*/
|
|
24
|
+
type UseRequestSource<TResult> = ResolvedSource<TResult> | Ref<ResolvedSource<TResult>>;
|
|
25
|
+
interface UseRequestOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Returns a caller-provided `AbortSignal` per attempt (for example
|
|
28
|
+
* `AbortSignal.timeout(5_000)`), composed with the internal per-attempt
|
|
29
|
+
* signal. Aborting it fails the attempt without touching other state.
|
|
30
|
+
*/
|
|
31
|
+
getAbortSignal?: (attempt: number) => AbortSignal | null | undefined;
|
|
32
|
+
}
|
|
33
|
+
interface UseRequestReturn<TResult> {
|
|
34
|
+
data: ComputedRef<TResult | undefined>;
|
|
35
|
+
error: ComputedRef<SolanaError | null>;
|
|
36
|
+
refresh: () => Promise<TResult | undefined>;
|
|
37
|
+
status: ComputedRef<UseRequestStatus>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One-shot async request that re-fires when its source changes identity, with
|
|
41
|
+
* stale-while-revalidate: while a new attempt runs, the previous `data` and
|
|
42
|
+
* `error` stay populated so the UI keeps rendering.
|
|
43
|
+
*
|
|
44
|
+
* Status set: `fetching` | `success` | `error` | `disabled`.
|
|
45
|
+
*
|
|
46
|
+
* - The first attempt fires on mount inside a component (or immediately when
|
|
47
|
+
* called outside one).
|
|
48
|
+
* - Passing a ref/computed source re-fires whenever the source identity
|
|
49
|
+
* changes; a `null` source clears state and reports `disabled`.
|
|
50
|
+
* - `refresh()` re-fires manually and resolves with the attempt result.
|
|
51
|
+
* - `getAbortSignal` attaches per-attempt cancellation (timeouts, kill
|
|
52
|
+
* switches) on top of the internal per-attempt signal.
|
|
53
|
+
*/
|
|
54
|
+
declare function useRequest<TResult>(source: UseRequestSource<TResult>, options?: UseRequestOptions): UseRequestReturn<TResult>;
|
|
55
|
+
|
|
56
|
+
export { useRequest };
|
|
57
|
+
export type { UseRequestOptions, UseRequestReturn, UseRequestSource, UseRequestStatus };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SolanaError } from '@vue-solana/core/errors';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
type UseRequestStatus = "fetching" | "success" | "error" | "disabled";
|
|
5
|
+
type SendFn<TResult> = (options?: {
|
|
6
|
+
abortSignal?: AbortSignal;
|
|
7
|
+
}) => Promise<TResult>;
|
|
8
|
+
type ResolvedSource<TResult> = ((signal: AbortSignal) => Promise<TResult> | {
|
|
9
|
+
send: SendFn<TResult>;
|
|
10
|
+
}) | {
|
|
11
|
+
send: SendFn<TResult>;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* A request source accepted by `useRequest`:
|
|
15
|
+
*
|
|
16
|
+
* - a request function `(signal) => Promise<T>`, called with a fresh composed
|
|
17
|
+
* `AbortSignal` per attempt (it may return a Kit request object, which is
|
|
18
|
+
* sent with the signal automatically),
|
|
19
|
+
* - a Kit reactive store source such as `PendingRpcRequest` (for example
|
|
20
|
+
* `rpc.getBalance(address)`),
|
|
21
|
+
* - a `ref`/`computed` of any of the above, or of `null` to disable, or
|
|
22
|
+
* - `null` to disable outright.
|
|
23
|
+
*/
|
|
24
|
+
type UseRequestSource<TResult> = ResolvedSource<TResult> | Ref<ResolvedSource<TResult>>;
|
|
25
|
+
interface UseRequestOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Returns a caller-provided `AbortSignal` per attempt (for example
|
|
28
|
+
* `AbortSignal.timeout(5_000)`), composed with the internal per-attempt
|
|
29
|
+
* signal. Aborting it fails the attempt without touching other state.
|
|
30
|
+
*/
|
|
31
|
+
getAbortSignal?: (attempt: number) => AbortSignal | null | undefined;
|
|
32
|
+
}
|
|
33
|
+
interface UseRequestReturn<TResult> {
|
|
34
|
+
data: ComputedRef<TResult | undefined>;
|
|
35
|
+
error: ComputedRef<SolanaError | null>;
|
|
36
|
+
refresh: () => Promise<TResult | undefined>;
|
|
37
|
+
status: ComputedRef<UseRequestStatus>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One-shot async request that re-fires when its source changes identity, with
|
|
41
|
+
* stale-while-revalidate: while a new attempt runs, the previous `data` and
|
|
42
|
+
* `error` stay populated so the UI keeps rendering.
|
|
43
|
+
*
|
|
44
|
+
* Status set: `fetching` | `success` | `error` | `disabled`.
|
|
45
|
+
*
|
|
46
|
+
* - The first attempt fires on mount inside a component (or immediately when
|
|
47
|
+
* called outside one).
|
|
48
|
+
* - Passing a ref/computed source re-fires whenever the source identity
|
|
49
|
+
* changes; a `null` source clears state and reports `disabled`.
|
|
50
|
+
* - `refresh()` re-fires manually and resolves with the attempt result.
|
|
51
|
+
* - `getAbortSignal` attaches per-attempt cancellation (timeouts, kill
|
|
52
|
+
* switches) on top of the internal per-attempt signal.
|
|
53
|
+
*/
|
|
54
|
+
declare function useRequest<TResult>(source: UseRequestSource<TResult>, options?: UseRequestOptions): UseRequestReturn<TResult>;
|
|
55
|
+
|
|
56
|
+
export { useRequest };
|
|
57
|
+
export type { UseRequestOptions, UseRequestReturn, UseRequestSource, UseRequestStatus };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { SolanaError } from '@vue-solana/core/errors';
|
|
2
|
+
import { ComputedRef, Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
type UseRequestStatus = "fetching" | "success" | "error" | "disabled";
|
|
5
|
+
type SendFn<TResult> = (options?: {
|
|
6
|
+
abortSignal?: AbortSignal;
|
|
7
|
+
}) => Promise<TResult>;
|
|
8
|
+
type ResolvedSource<TResult> = ((signal: AbortSignal) => Promise<TResult> | {
|
|
9
|
+
send: SendFn<TResult>;
|
|
10
|
+
}) | {
|
|
11
|
+
send: SendFn<TResult>;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* A request source accepted by `useRequest`:
|
|
15
|
+
*
|
|
16
|
+
* - a request function `(signal) => Promise<T>`, called with a fresh composed
|
|
17
|
+
* `AbortSignal` per attempt (it may return a Kit request object, which is
|
|
18
|
+
* sent with the signal automatically),
|
|
19
|
+
* - a Kit reactive store source such as `PendingRpcRequest` (for example
|
|
20
|
+
* `rpc.getBalance(address)`),
|
|
21
|
+
* - a `ref`/`computed` of any of the above, or of `null` to disable, or
|
|
22
|
+
* - `null` to disable outright.
|
|
23
|
+
*/
|
|
24
|
+
type UseRequestSource<TResult> = ResolvedSource<TResult> | Ref<ResolvedSource<TResult>>;
|
|
25
|
+
interface UseRequestOptions {
|
|
26
|
+
/**
|
|
27
|
+
* Returns a caller-provided `AbortSignal` per attempt (for example
|
|
28
|
+
* `AbortSignal.timeout(5_000)`), composed with the internal per-attempt
|
|
29
|
+
* signal. Aborting it fails the attempt without touching other state.
|
|
30
|
+
*/
|
|
31
|
+
getAbortSignal?: (attempt: number) => AbortSignal | null | undefined;
|
|
32
|
+
}
|
|
33
|
+
interface UseRequestReturn<TResult> {
|
|
34
|
+
data: ComputedRef<TResult | undefined>;
|
|
35
|
+
error: ComputedRef<SolanaError | null>;
|
|
36
|
+
refresh: () => Promise<TResult | undefined>;
|
|
37
|
+
status: ComputedRef<UseRequestStatus>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One-shot async request that re-fires when its source changes identity, with
|
|
41
|
+
* stale-while-revalidate: while a new attempt runs, the previous `data` and
|
|
42
|
+
* `error` stay populated so the UI keeps rendering.
|
|
43
|
+
*
|
|
44
|
+
* Status set: `fetching` | `success` | `error` | `disabled`.
|
|
45
|
+
*
|
|
46
|
+
* - The first attempt fires on mount inside a component (or immediately when
|
|
47
|
+
* called outside one).
|
|
48
|
+
* - Passing a ref/computed source re-fires whenever the source identity
|
|
49
|
+
* changes; a `null` source clears state and reports `disabled`.
|
|
50
|
+
* - `refresh()` re-fires manually and resolves with the attempt result.
|
|
51
|
+
* - `getAbortSignal` attaches per-attempt cancellation (timeouts, kill
|
|
52
|
+
* switches) on top of the internal per-attempt signal.
|
|
53
|
+
*/
|
|
54
|
+
declare function useRequest<TResult>(source: UseRequestSource<TResult>, options?: UseRequestOptions): UseRequestReturn<TResult>;
|
|
55
|
+
|
|
56
|
+
export { useRequest };
|
|
57
|
+
export type { UseRequestOptions, UseRequestReturn, UseRequestSource, UseRequestStatus };
|
package/dist/useRpc.cjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const useRpc = require('./shared/vue.
|
|
3
|
+
const useRpc = require('./shared/vue.FiMmnMHr.cjs');
|
|
4
4
|
require('vue');
|
|
5
|
-
require('./shared/vue.
|
|
5
|
+
require('./shared/vue.DE3emjSF.cjs');
|
|
6
|
+
require('./shared/vue.DEHxNvUX.cjs');
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|