@vue-solana/vue 3.0.0 → 4.0.0-rc.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.
Files changed (110) hide show
  1. package/README.md +8 -4
  2. package/dist/index.d.ts +12 -0
  3. package/dist/index.mjs +81 -58
  4. package/dist/shared/{vue.CjSw0Hh1.mjs → vue.4ne5EBD9.mjs} +4 -4
  5. package/dist/shared/{vue.C9OOmvkD.mjs → vue.BBN9aU6D.mjs} +2 -2
  6. package/dist/shared/{vue.CsFY1mfz.mjs → vue.BXNjyJ2c.mjs} +1 -1
  7. package/dist/shared/{vue.DlihC5GG.mjs → vue.BiKE9Xuv.mjs} +6 -4
  8. package/dist/shared/{vue.CXB4NEMA.mjs → vue.Bu2cQ690.mjs} +47 -17
  9. package/dist/shared/{vue.CpkwC8Th.mjs → vue.C6OkOK2W.mjs} +1 -1
  10. package/dist/shared/{vue.B9uRpSDJ.mjs → vue.CAltY57B.mjs} +6 -3
  11. package/dist/shared/{vue.DDQxNX5q.mjs → vue.CELGI7de.mjs} +9 -9
  12. package/dist/shared/{vue.BxtOHzY_.mjs → vue.CLAqNcLp.mjs} +1 -1
  13. package/dist/shared/{vue.hG_FieA3.mjs → vue.CW-1AuSO.mjs} +2 -2
  14. package/dist/shared/{vue.Mxc8w6Qk.mjs → vue.CZApWQAY.mjs} +1 -1
  15. package/dist/shared/vue.CbmzveKF.mjs +44 -0
  16. package/dist/shared/{vue.CQh3AUE8.mjs → vue.CcOZ9858.mjs} +3 -5
  17. package/dist/shared/{vue.B-xtuLtD.mjs → vue.D2J7_NpQ.mjs} +2 -2
  18. package/dist/shared/{vue.BsGwt78R.mjs → vue.D8zNWw2t.mjs} +1 -1
  19. package/dist/shared/{vue.CaAgH2Xt.mjs → vue.DPwdqRO_.mjs} +3 -3
  20. package/dist/shared/{vue.DNKD6jqM.mjs → vue.DTpvqDyY.mjs} +3 -3
  21. package/dist/shared/{vue.D218Ow7t.mjs → vue.DY9VadLH.mjs} +1 -8
  22. package/dist/shared/vue.DZVdVfy1.mjs +7 -0
  23. package/dist/shared/{vue.CvenSbZZ.mjs → vue.DZhPXLZz.mjs} +4 -4
  24. package/dist/shared/{vue.o98pAmDg.mjs → vue.DbJG4-ku.mjs} +2 -2
  25. package/dist/shared/{vue.BFSboXMB.mjs → vue.DbJKnSrl.mjs} +3 -3
  26. package/dist/shared/{vue.1Qwco2kv.mjs → vue.DcZ_R_RH.mjs} +4 -4
  27. package/dist/shared/{vue.C_4qJDiF.mjs → vue.DyLgoSbX.mjs} +1 -1
  28. package/dist/shared/{vue.XlfH_nkc.mjs → vue.FehFeE3w.mjs} +3 -3
  29. package/dist/shared/{vue.C1JbUTpJ.mjs → vue.UrCjmf0T.mjs} +2 -2
  30. package/dist/swr.d.ts +7 -1
  31. package/dist/swr.mjs +16 -4
  32. package/dist/useAccountInfo.mjs +1 -10
  33. package/dist/useAction.mjs +0 -2
  34. package/dist/useAirdrop.mjs +1 -8
  35. package/dist/useBalance.mjs +1 -9
  36. package/dist/useClientCapability.d.ts +6 -1
  37. package/dist/useClientCapability.mjs +1 -5
  38. package/dist/useConnection.d.ts +8 -1
  39. package/dist/useConnection.mjs +1 -5
  40. package/dist/useIdentity.mjs +1 -6
  41. package/dist/usePayer.mjs +1 -6
  42. package/dist/usePlanTransaction.mjs +1 -8
  43. package/dist/usePlanTransactions.mjs +1 -8
  44. package/dist/useProgramAccounts.mjs +1 -10
  45. package/dist/useRequest.mjs +0 -4
  46. package/dist/useRpc.d.ts +6 -0
  47. package/dist/useRpc.mjs +1 -4
  48. package/dist/useSelectedWalletAccount.d.ts +3 -0
  49. package/dist/useSelectedWalletAccount.mjs +0 -2
  50. package/dist/useSendTransaction.mjs +1 -8
  51. package/dist/useSendTransactions.mjs +1 -8
  52. package/dist/useSignAndSendTransaction.mjs +1 -13
  53. package/dist/useSignAndSendTransactions.mjs +1 -9
  54. package/dist/useSignIn.mjs +1 -8
  55. package/dist/useSignMessage.mjs +1 -8
  56. package/dist/useSignTransactions.mjs +1 -8
  57. package/dist/useSignatureStatus.d.ts +0 -1
  58. package/dist/useSignatureStatus.mjs +1 -8
  59. package/dist/useSolana.mjs +1 -3
  60. package/dist/useSolanaClient.d.ts +6 -0
  61. package/dist/useSolanaClient.mjs +1 -4
  62. package/dist/useSubscription.mjs +0 -2
  63. package/dist/useTokenAccounts.mjs +1 -10
  64. package/dist/useTokenBalance.mjs +1 -10
  65. package/dist/useTrackedData.mjs +0 -3
  66. package/dist/useTransaction.mjs +0 -4
  67. package/dist/useTransactionConfirmation.mjs +1 -9
  68. package/dist/useWallet.mjs +1 -6
  69. package/dist/useWallets.mjs +1 -4
  70. package/package.json +8 -5
  71. package/dist/buffer-polyfill.d.mts +0 -2
  72. package/dist/index.d.mts +0 -64
  73. package/dist/kit.d.mts +0 -1
  74. package/dist/shared/vue.BGGixph-.d.mts +0 -5
  75. package/dist/shared/vue.Bfu1dCKe.mjs +0 -10
  76. package/dist/shared/vue.CGv0ip3w.mjs +0 -52
  77. package/dist/shared/vue.DL3z5PxP.d.mts +0 -21
  78. package/dist/swr.d.mts +0 -41
  79. package/dist/useAccountInfo.d.mts +0 -24
  80. package/dist/useAction.d.mts +0 -45
  81. package/dist/useAirdrop.d.mts +0 -27
  82. package/dist/useBalance.d.mts +0 -15
  83. package/dist/useClientCapability.d.mts +0 -39
  84. package/dist/useConnection.d.mts +0 -46
  85. package/dist/useIdentity.d.mts +0 -3
  86. package/dist/usePayer.d.mts +0 -18
  87. package/dist/usePlanTransaction.d.mts +0 -44
  88. package/dist/usePlanTransactions.d.mts +0 -5
  89. package/dist/useProgramAccounts.d.mts +0 -45
  90. package/dist/useRequest.d.mts +0 -73
  91. package/dist/useRpc.d.mts +0 -55
  92. package/dist/useSelectedWalletAccount.d.mts +0 -117
  93. package/dist/useSendTransaction.d.mts +0 -50
  94. package/dist/useSendTransactions.d.mts +0 -5
  95. package/dist/useSignAndSendTransaction.d.mts +0 -40
  96. package/dist/useSignAndSendTransactions.d.mts +0 -35
  97. package/dist/useSignIn.d.mts +0 -23
  98. package/dist/useSignMessage.d.mts +0 -236
  99. package/dist/useSignTransactions.d.mts +0 -24
  100. package/dist/useSignatureStatus.d.mts +0 -26
  101. package/dist/useSolana.d.mts +0 -9
  102. package/dist/useSolanaClient.d.mts +0 -45
  103. package/dist/useSubscription.d.mts +0 -70
  104. package/dist/useTokenAccounts.d.mts +0 -19
  105. package/dist/useTokenBalance.d.mts +0 -17
  106. package/dist/useTrackedData.d.mts +0 -98
  107. package/dist/useTransaction.d.mts +0 -27
  108. package/dist/useTransactionConfirmation.d.mts +0 -38
  109. package/dist/useWallet.d.mts +0 -31
  110. package/dist/useWallets.d.mts +0 -11
@@ -1,46 +0,0 @@
1
- import * as _solana_kit_plugin_rpc from '@solana/kit-plugin-rpc';
2
- import * as _solana_kit from '@solana/kit';
3
-
4
- /**
5
- * @deprecated Use `useSolanaClient()` which returns the Kit client instead of
6
- * the legacy web3-compat Connection.
7
- */
8
- declare function useConnection(): Omit<_solana_kit.Client<{
9
- signTransactions: (input: _solana_kit.InstructionPlanInput | _solana_kit.TransactionPlanInput, config?: {
10
- abortSignal?: AbortSignal;
11
- }) => Promise<_solana_kit.TransactionPlanResult<_solana_kit_plugin_rpc.RpcSignContext>>;
12
- payer: _solana_kit.TransactionSigner;
13
- rpc: _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetAgGenesisCertApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetTransactionsForAddressApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
14
- rpcSubscriptions: _solana_kit.RpcSubscriptions<_solana_kit.SolanaRpcSubscriptionsApi>;
15
- getMinimumBalance: (space: number, config?: _solana_kit.GetMinimumBalanceConfig) => Promise<_solana_kit.Lamports>;
16
- transactionPlanner: _solana_kit.TransactionPlanner;
17
- planTransaction: (input: _solana_kit.InstructionPlanInput, config?: {
18
- abortSignal?: AbortSignal;
19
- }) => Promise<_solana_kit.SingleTransactionPlan["message"]>;
20
- planTransactions: (input: _solana_kit.InstructionPlanInput, config?: {
21
- abortSignal?: AbortSignal;
22
- }) => Promise<_solana_kit.TransactionPlan>;
23
- signTransaction: (input: _solana_kit.InstructionPlanInput | (_solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>) | Readonly<{
24
- kind: "single";
25
- message: _solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>;
26
- planType: "transactionPlan";
27
- }>, config?: {
28
- abortSignal?: AbortSignal;
29
- }) => Promise<_solana_kit.SuccessfulSingleTransactionPlanResult<_solana_kit_plugin_rpc.RpcSignContext>>;
30
- transactionPlanExecutor: _solana_kit.TransactionPlanExecutor<_solana_kit_plugin_rpc.RpcSendContext>;
31
- sendTransaction: (input: _solana_kit.InstructionPlanInput | (_solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>) | Readonly<{
32
- kind: "single";
33
- message: _solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>;
34
- planType: "transactionPlan";
35
- }>, config?: {
36
- abortSignal?: AbortSignal;
37
- }) => Promise<_solana_kit.SuccessfulSingleTransactionPlanResult<_solana_kit_plugin_rpc.RpcSendContext>>;
38
- sendTransactions: (input: _solana_kit.InstructionPlanInput | _solana_kit.TransactionPlanInput, config?: {
39
- abortSignal?: AbortSignal;
40
- }) => Promise<_solana_kit.TransactionPlanResult<_solana_kit_plugin_rpc.RpcSendContext>>;
41
- airdrop: (address: _solana_kit.Address, amount: _solana_kit.Lamports, abortSignal?: AbortSignal) => Promise<_solana_kit.Signature | undefined>;
42
- }>, "payer"> & {
43
- payer?: _solana_kit.TransactionSigner;
44
- };
45
-
46
- export { useConnection };
@@ -1,3 +0,0 @@
1
- export { useIdentity } from './usePayer.mjs';
2
- import '@vue-solana/core/kit';
3
- import 'vue';
@@ -1,18 +0,0 @@
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 };
@@ -1,44 +0,0 @@
1
- import * as vue from 'vue';
2
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
3
- import { InstructionPlanInput, TransactionMessage, TransactionPlan } from '@vue-solana/core/kit';
4
- import { C as ClientActionConfig } from './shared/vue.BGGixph-.mjs';
5
-
6
- type PlanTransactionStatus = "idle" | "planning" | "planned" | "error";
7
- type PlanTransactionConfig = ClientActionConfig;
8
- /**
9
- * Plan a single transaction message from instruction inputs — without
10
- * signing or sending — using the client's transaction planning capability
11
- * (e.g. `rpcTransactionPlanner` from `@solana/kit-plugin-rpc`).
12
- *
13
- * Throws with a clear capability error when the client does not plan, which
14
- * includes a client without a `payer` signer.
15
- *
16
- * Calling `execute` while a prior execution is in flight aborts the prior call;
17
- * the superseded attempt rejects, so check its `error.cause` to tell it apart
18
- * from a real failure.
19
- */
20
- declare function usePlanTransaction(): {
21
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null>;
22
- execute: (input: InstructionPlanInput, config?: ClientActionConfig) => Promise<TransactionMessage>;
23
- loading: vue.ComputedRef<boolean>;
24
- status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
25
- transactionMessage: vue.ShallowRef<TransactionMessage | null>;
26
- };
27
- /**
28
- * Plan a full transaction plan — possibly multiple transaction messages —
29
- * from instruction inputs, using the client's transaction planning
30
- * capability.
31
- *
32
- * Throws with a clear capability error when the client does not plan, which
33
- * includes a client without a `payer` signer.
34
- */
35
- declare function usePlanTransactions(): {
36
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null>;
37
- execute: (input: InstructionPlanInput, config?: ClientActionConfig) => Promise<TransactionPlan>;
38
- loading: vue.ComputedRef<boolean>;
39
- status: vue.Ref<PlanTransactionStatus, PlanTransactionStatus>;
40
- transactionPlan: vue.ShallowRef<TransactionPlan | null>;
41
- };
42
-
43
- export { usePlanTransaction, usePlanTransactions };
44
- export type { PlanTransactionConfig, PlanTransactionStatus };
@@ -1,5 +0,0 @@
1
- export { usePlanTransactions } from './usePlanTransaction.mjs';
2
- import 'vue';
3
- import '@vue-solana/core/errors';
4
- import '@vue-solana/core/kit';
5
- import './shared/vue.BGGixph-.mjs';
@@ -1,45 +0,0 @@
1
- import * as vue from 'vue';
2
- import { MaybeRefOrGetter } from 'vue';
3
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
4
- import { Commitment } from '@vue-solana/core/kit';
5
-
6
- type ProgramAccountMemcmpEncoding = "base58" | "base64";
7
- type ProgramAccountMemcmpFilter = {
8
- memcmp: {
9
- offset: number;
10
- bytes: string;
11
- encoding?: ProgramAccountMemcmpEncoding;
12
- };
13
- };
14
- type ProgramAccountDataSizeFilter = {
15
- dataSize: number;
16
- };
17
- type ProgramAccountFilter = ProgramAccountMemcmpFilter | ProgramAccountDataSizeFilter;
18
- interface ProgramAccountDataSlice {
19
- offset: number;
20
- length: number;
21
- }
22
- interface UseProgramAccountsOptions {
23
- commitment?: Commitment;
24
- dataSlice?: ProgramAccountDataSlice;
25
- filters?: ProgramAccountFilter[];
26
- }
27
- interface ProgramAccount {
28
- pubkey: string;
29
- account: {
30
- executable: boolean;
31
- lamports: number;
32
- owner: string;
33
- space: number;
34
- data: Uint8Array;
35
- };
36
- }
37
- declare function useProgramAccounts(programId: MaybeRefOrGetter<string | null | undefined>, options?: UseProgramAccountsOptions): {
38
- error: vue.ShallowRef<_vue_solana_core_errors.SolanaError | null>;
39
- loading: vue.ShallowRef<boolean>;
40
- refresh: () => Promise<ProgramAccount[] | null>;
41
- accounts: vue.ShallowRef<ProgramAccount[]>;
42
- };
43
-
44
- export { useProgramAccounts };
45
- export type { ProgramAccount, ProgramAccountDataSizeFilter, ProgramAccountDataSlice, ProgramAccountFilter, ProgramAccountMemcmpEncoding, ProgramAccountMemcmpFilter, UseProgramAccountsOptions };
@@ -1,73 +0,0 @@
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. Read
30
- * fresh from the latest render, so inline closures need no `useCallback`.
31
- */
32
- getAbortSignal?: (attempt: number) => AbortSignal | null | undefined;
33
- }
34
- /** Per-call abort overrides for `refresh()`. */
35
- type UseRequestRefresherOptions = {
36
- /**
37
- * Applies only this signal to the attempt, bypassing `getAbortSignal`.
38
- * Passing `undefined` (or an empty options object) applies no caller signal
39
- * for that attempt; call `refresh()` with no argument to keep the
40
- * `getAbortSignal` factory behavior.
41
- */
42
- abortSignal?: AbortSignal;
43
- };
44
- interface UseRequestReturn<TResult> {
45
- data: ComputedRef<TResult | undefined>;
46
- error: ComputedRef<SolanaError | null>;
47
- /** Re-fires manually. `refresh({ abortSignal })` overrides `getAbortSignal` for that attempt. */
48
- refresh: (options?: UseRequestRefresherOptions) => Promise<TResult | undefined>;
49
- status: ComputedRef<UseRequestStatus>;
50
- }
51
- /**
52
- * One-shot async request that re-fires when its source changes identity, with
53
- * stale-while-revalidate: while a new attempt runs, the previous `data` and
54
- * `error` stay populated so the UI keeps rendering.
55
- *
56
- * Status set: `fetching` | `success` | `error` | `disabled`.
57
- *
58
- * - The first attempt fires on mount inside a component (or immediately when
59
- * called outside one).
60
- * - Passing a ref/computed source re-fires whenever the source identity
61
- * changes; a `null` source clears state and reports `disabled`.
62
- * - `refresh()` re-fires manually and resolves with the attempt result;
63
- * `refresh({ abortSignal })` overrides the caller signal for that attempt.
64
- * - `getAbortSignal` (read fresh per render, so inline closures are fine)
65
- * attaches per-attempt cancellation on top of the internal per-attempt
66
- * signal.
67
- * - Passing `null` as the source, or unmounting, cancels in-flight work and
68
- * reports `disabled`.
69
- */
70
- declare function useRequest<TResult>(source: UseRequestSource<TResult>, options?: UseRequestOptions): UseRequestReturn<TResult>;
71
-
72
- export { useRequest };
73
- export type { UseRequestOptions, UseRequestRefresherOptions, UseRequestReturn, UseRequestSource, UseRequestStatus };
package/dist/useRpc.d.mts DELETED
@@ -1,55 +0,0 @@
1
- import * as _solana_kit_plugin_rpc from '@solana/kit-plugin-rpc';
2
- import * as _solana_kit from '@solana/kit';
3
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
4
- import * as vue from 'vue';
5
- import * as _vue_solana_core_types from '@vue-solana/core/types';
6
- import { S as SolanaConnectionStatus } from './shared/vue.DL3z5PxP.mjs';
7
-
8
- declare function useRpc(): {
9
- cluster: vue.ComputedRef<_vue_solana_core_types.SolanaCluster>;
10
- endpoint: vue.ComputedRef<string>;
11
- wsEndpoint: vue.ComputedRef<string>;
12
- status: vue.Ref<SolanaConnectionStatus, SolanaConnectionStatus>;
13
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null, _vue_solana_core_errors.SolanaError | null>;
14
- latestBlockhash: vue.Ref<string | null, string | null>;
15
- checkConnection: () => Promise<void>;
16
- client: Omit<_solana_kit.Client<{
17
- signTransactions: (input: _solana_kit.InstructionPlanInput | _solana_kit.TransactionPlanInput, config?: {
18
- abortSignal?: AbortSignal;
19
- }) => Promise<_solana_kit.TransactionPlanResult<_solana_kit_plugin_rpc.RpcSignContext>>;
20
- payer: _solana_kit.TransactionSigner;
21
- rpc: _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetAgGenesisCertApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetTransactionsForAddressApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
22
- rpcSubscriptions: _solana_kit.RpcSubscriptions<_solana_kit.SolanaRpcSubscriptionsApi>;
23
- getMinimumBalance: (space: number, config?: _solana_kit.GetMinimumBalanceConfig) => Promise<_solana_kit.Lamports>;
24
- transactionPlanner: _solana_kit.TransactionPlanner;
25
- planTransaction: (input: _solana_kit.InstructionPlanInput, config?: {
26
- abortSignal?: AbortSignal;
27
- }) => Promise<_solana_kit.SingleTransactionPlan["message"]>;
28
- planTransactions: (input: _solana_kit.InstructionPlanInput, config?: {
29
- abortSignal?: AbortSignal;
30
- }) => Promise<_solana_kit.TransactionPlan>;
31
- signTransaction: (input: _solana_kit.InstructionPlanInput | (_solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>) | Readonly<{
32
- kind: "single";
33
- message: _solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>;
34
- planType: "transactionPlan";
35
- }>, config?: {
36
- abortSignal?: AbortSignal;
37
- }) => Promise<_solana_kit.SuccessfulSingleTransactionPlanResult<_solana_kit_plugin_rpc.RpcSignContext>>;
38
- transactionPlanExecutor: _solana_kit.TransactionPlanExecutor<_solana_kit_plugin_rpc.RpcSendContext>;
39
- sendTransaction: (input: _solana_kit.InstructionPlanInput | (_solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>) | Readonly<{
40
- kind: "single";
41
- message: _solana_kit.TransactionMessage & _solana_kit.TransactionMessageWithFeePayer<string>;
42
- planType: "transactionPlan";
43
- }>, config?: {
44
- abortSignal?: AbortSignal;
45
- }) => Promise<_solana_kit.SuccessfulSingleTransactionPlanResult<_solana_kit_plugin_rpc.RpcSendContext>>;
46
- sendTransactions: (input: _solana_kit.InstructionPlanInput | _solana_kit.TransactionPlanInput, config?: {
47
- abortSignal?: AbortSignal;
48
- }) => Promise<_solana_kit.TransactionPlanResult<_solana_kit_plugin_rpc.RpcSendContext>>;
49
- airdrop: (address: _solana_kit.Address, amount: _solana_kit.Lamports, abortSignal?: AbortSignal) => Promise<_solana_kit.Signature | undefined>;
50
- }>, "payer"> & {
51
- payer?: _solana_kit.TransactionSigner;
52
- };
53
- };
54
-
55
- export { useRpc };
@@ -1,117 +0,0 @@
1
- import { SolanaWalletInfo } from '@vue-solana/core/types';
2
- import * as vue from 'vue';
3
- import { Ref, ComputedRef, InjectionKey, PropType } from 'vue';
4
-
5
- /**
6
- * Storage adapter used by `SelectedWalletAccountProvider`'s `stateSync`
7
- * option. The persisted value is the selected wallet's
8
- * `${walletName}:${accountAddress}` key.
9
- */
10
- interface SelectedWalletAccountStorage {
11
- storeSelectedWallet(key: string): void | Promise<void>;
12
- getSelectedWallet(): string | null | Promise<string | null>;
13
- deleteSelectedWallet(): void | Promise<void>;
14
- }
15
-
16
- type SelectedWalletAccount = SolanaWalletInfo["accounts"][number] & {
17
- /** The wallet that owns this account. */
18
- walletName: string;
19
- };
20
- type WalletAccountFilter = (walletName: string, account: SolanaWalletInfo["accounts"][number]) => boolean;
21
- interface SelectedWalletAccountContext {
22
- selectedWalletAccount: Ref<SelectedWalletAccount | null>;
23
- setSelectedWalletAccount: (account: SelectedWalletAccount | null) => void;
24
- filteredWallets: ComputedRef<SolanaWalletInfo[]>;
25
- }
26
- declare const selectedWalletAccountInjectionKey: InjectionKey<SelectedWalletAccountContext>;
27
- interface SelectedWalletAccountOptions {
28
- /**
29
- * Restricts the wallets exposed through `filteredWallets` and the accounts
30
- * that can be selected. Receives the wallet name and each of its accounts;
31
- * return `false` to hide the account (a wallet with no remaining accounts
32
- * is hidden entirely).
33
- */
34
- filterWallet?: WalletAccountFilter;
35
- /**
36
- * Persists the selection as `${walletName}:${accountAddress}`. Defaults to
37
- * `localStorage`; pass `null` to disable persistence.
38
- */
39
- stateSync?: SelectedWalletAccountStorage | null;
40
- }
41
- /**
42
- * App-wide selected wallet account state, mirroring `@solana/react`'s
43
- * `SelectedWalletAccountContextProvider`.
44
- *
45
- * Call once near the root of your app, then read state anywhere with
46
- * {@link useSelectedWalletAccount}. The selection persists as
47
- * `${walletName}:${accountAddress}` through `stateSync` and is restored on
48
- * the next mount when the wallet and account are available again.
49
- */
50
- declare function provideSelectedWalletAccount(options?: SelectedWalletAccountOptions): SelectedWalletAccountContext;
51
- /**
52
- * Build the selected wallet account context without providing it. Used by
53
- * the Nuxt runtime plugin, which installs the context app-wide via
54
- * `app.provide` rather than inside a component setup.
55
- *
56
- * When called outside a component setup (as the Nuxt plugin does), `inject`
57
- * cannot resolve the Solana context, so pass it explicitly through
58
- * {@link solanaContextOverride}.
59
- */
60
- declare function createSelectedWalletAccountContext(options?: SelectedWalletAccountOptions, solanaContextOverride?: SolanaContextLike | null): SelectedWalletAccountContext;
61
- /**
62
- * Read the app-wide selected wallet account provided by
63
- * {@link provideSelectedWalletAccount}.
64
- *
65
- * Returns `[selectedAccount, setSelectedAccount, filteredWallets]`. The
66
- * setter accepts `null` to clear the selection. Throws when called outside a
67
- * provider — mount `SelectedWalletAccountProvider` (or call
68
- * `provideSelectedWalletAccount`) first.
69
- */
70
- declare function useSelectedWalletAccount(): [
71
- Ref<SelectedWalletAccount | null>,
72
- (account: SelectedWalletAccount | null) => void,
73
- ComputedRef<SolanaWalletInfo[]>
74
- ];
75
- /**
76
- * The minimal Solana context surface this composable reads. Structural so the
77
- * full `VueSolanaContext` (or the raw RPC context) satisfies it without an
78
- * import cycle from the plugin to its composables.
79
- */
80
- interface SolanaContextLike {
81
- wallets: Ref<SolanaWalletInfo[]>;
82
- }
83
-
84
- /**
85
- * App-wide selected wallet account provider, mirroring `@solana/react`'s
86
- * `SelectedWalletAccountContextProvider`.
87
- *
88
- * Wraps `provideSelectedWalletAccount`; children read state via
89
- * `useSelectedWalletAccount()`.
90
- */
91
- declare const SelectedWalletAccountProvider: vue.DefineComponent<vue.ExtractPropTypes<{
92
- filterWallet: {
93
- type: PropType<SelectedWalletAccountOptions["filterWallet"]>;
94
- default: undefined;
95
- };
96
- stateSync: {
97
- type: PropType<SelectedWalletAccountOptions["stateSync"]>;
98
- default: undefined;
99
- };
100
- }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
101
- [key: string]: any;
102
- }>[] | undefined, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
103
- filterWallet: {
104
- type: PropType<SelectedWalletAccountOptions["filterWallet"]>;
105
- default: undefined;
106
- };
107
- stateSync: {
108
- type: PropType<SelectedWalletAccountOptions["stateSync"]>;
109
- default: undefined;
110
- };
111
- }>> & Readonly<{}>, {
112
- filterWallet: WalletAccountFilter | undefined;
113
- stateSync: SelectedWalletAccountStorage | null | undefined;
114
- }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
115
-
116
- export { SelectedWalletAccountProvider, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount };
117
- export type { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, WalletAccountFilter };
@@ -1,50 +0,0 @@
1
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
2
- import * as vue from 'vue';
3
- import { InstructionPlanInput, SingleTransactionPlan, TransactionPlanInput, SuccessfulSingleTransactionPlanResult, TransactionPlanResult } from '@vue-solana/core/kit';
4
- import { C as ClientActionConfig } from './shared/vue.BGGixph-.mjs';
5
-
6
- type SendTransactionStatus = "idle" | "sending" | "sent" | "error";
7
- type SendTransactionConfig = ClientActionConfig;
8
- type SendTransactionInput = InstructionPlanInput | SingleTransactionPlan | SingleTransactionPlan["message"];
9
- type SendTransactionsInput = InstructionPlanInput | TransactionPlanInput;
10
- /**
11
- * Plan, sign with the client's signers (payer/identity), submit, and confirm
12
- * a single transaction — all through the client's transaction-sending
13
- * capability (`ClientWithTransactionSending`), with no wallet popup.
14
- *
15
- * Accepts flexible input: instructions, an instruction plan, a transaction
16
- * message, or a single transaction plan.
17
- *
18
- * Throws with a clear capability error when the client cannot send, which
19
- * includes a client without a `payer` signer — Kit reads `client.payer` when it
20
- * plans a transaction, so one is always required.
21
- *
22
- * Calling `execute` while a prior execution is in flight aborts the prior call;
23
- * the superseded attempt rejects, so check its `error.cause` to tell it apart
24
- * from a real failure.
25
- */
26
- declare function useSendTransaction(): {
27
- data: vue.ShallowRef<SuccessfulSingleTransactionPlanResult | null>;
28
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null>;
29
- execute: (input: SendTransactionInput, config?: ClientActionConfig) => Promise<SuccessfulSingleTransactionPlanResult>;
30
- loading: vue.ComputedRef<boolean>;
31
- status: vue.Ref<SendTransactionStatus, SendTransactionStatus>;
32
- };
33
- /**
34
- * Plan, sign, submit, and confirm one or more transactions — possibly a batch
35
- * of messages, executed in parallel or sequentially as the plan dictates —
36
- * through the client's transaction-sending capability.
37
- *
38
- * Throws with a clear capability error when the client cannot send, which
39
- * includes a client without a `payer` signer.
40
- */
41
- declare function useSendTransactions(): {
42
- data: vue.ShallowRef<TransactionPlanResult | null>;
43
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null>;
44
- execute: (input: SendTransactionsInput, config?: ClientActionConfig) => Promise<TransactionPlanResult>;
45
- loading: vue.ComputedRef<boolean>;
46
- status: vue.Ref<SendTransactionStatus, SendTransactionStatus>;
47
- };
48
-
49
- export { useSendTransaction, useSendTransactions };
50
- export type { SendTransactionConfig, SendTransactionInput, SendTransactionStatus, SendTransactionsInput };
@@ -1,5 +0,0 @@
1
- export { useSendTransactions } from './useSendTransaction.mjs';
2
- import '@vue-solana/core/errors';
3
- import 'vue';
4
- import '@vue-solana/core/kit';
5
- import './shared/vue.BGGixph-.mjs';
@@ -1,40 +0,0 @@
1
- import * as _solana_kit from '@solana/kit';
2
- import * as vue from 'vue';
3
- import { Signature } from '@vue-solana/core/kit';
4
- import { SolanaError } from '@vue-solana/core/errors';
5
- import { SendTransactionOptions, ConfirmTransactionOptions, TransactionConfirmation, SolanaTransaction } from '@vue-solana/core/types';
6
-
7
- type SignAndSendTransactionStatus = "idle" | "sending" | "sent" | "confirming" | "processed" | "confirmed" | "finalized" | "error";
8
- interface SignAndSendTransactionOptions extends SendTransactionOptions {
9
- confirm?: boolean;
10
- confirmation?: ConfirmTransactionOptions;
11
- }
12
- declare function useSignAndSendTransaction(): {
13
- signature: vue.Ref<Signature | null, Signature | null>;
14
- confirmation: vue.Ref<{
15
- signature: Signature;
16
- commitment: _solana_kit.Commitment;
17
- status: {
18
- slot: _solana_kit.Slot;
19
- confirmations: bigint | null;
20
- err: unknown | null;
21
- confirmationStatus: _solana_kit.Commitment | null;
22
- };
23
- } | null, TransactionConfirmation | {
24
- signature: Signature;
25
- commitment: _solana_kit.Commitment;
26
- status: {
27
- slot: _solana_kit.Slot;
28
- confirmations: bigint | null;
29
- err: unknown | null;
30
- confirmationStatus: _solana_kit.Commitment | null;
31
- };
32
- } | null>;
33
- status: vue.Ref<SignAndSendTransactionStatus, SignAndSendTransactionStatus>;
34
- loading: vue.ComputedRef<boolean>;
35
- error: vue.Ref<SolanaError | null, SolanaError | null>;
36
- execute: (transaction: SolanaTransaction, options?: SignAndSendTransactionOptions) => Promise<Signature>;
37
- };
38
-
39
- export { useSignAndSendTransaction };
40
- export type { SignAndSendTransactionOptions, SignAndSendTransactionStatus };
@@ -1,35 +0,0 @@
1
- import * as vue from 'vue';
2
- import { Signature } from '@vue-solana/core/kit';
3
- import { SolanaTransaction, SendTransactionOptions } from '@vue-solana/core/types';
4
- import { SolanaError } from '@vue-solana/core/errors';
5
-
6
- type SignAndSendTransactionsStatus = "idle" | "sending" | "sent" | "error";
7
- /**
8
- * Thrown when the singular fallback path fails partway through: the earlier
9
- * transactions in the batch have already been sent, and their signatures are
10
- * exposed here so callers can avoid resubmitting them.
11
- */
12
- declare class PartialSignAndSendError extends SolanaError {
13
- readonly signatures: Signature[];
14
- constructor(cause: SolanaError, signatures: Signature[]);
15
- }
16
- /**
17
- * Sign and send multiple serialized transactions in a single wallet request,
18
- * returning one signature per transaction.
19
- *
20
- * Prefers the wallet's batch `signAndSendTransactions` capability and falls
21
- * back to sending the singular `signAndSendTransaction` requests in sequence.
22
- * When that fallback fails partway through, it rejects with a
23
- * {@link PartialSignAndSendError} carrying the signatures already sent, so a
24
- * retry can skip them (the wallet has no batch rollback).
25
- */
26
- declare function useSignAndSendTransactions(): {
27
- signatures: vue.ShallowRef<Signature[] | null, Signature[] | null>;
28
- status: vue.ShallowRef<SignAndSendTransactionsStatus>;
29
- loading: vue.ComputedRef<boolean>;
30
- error: vue.Ref<SolanaError | null, SolanaError | null>;
31
- execute: (transactions: SolanaTransaction[], options?: SendTransactionOptions) => Promise<Signature[]>;
32
- };
33
-
34
- export { PartialSignAndSendError, useSignAndSendTransactions };
35
- export type { SignAndSendTransactionsStatus };
@@ -1,23 +0,0 @@
1
- import * as _vue_solana_core_errors from '@vue-solana/core/errors';
2
- import * as vue from 'vue';
3
- import { SolanaSignInResult, SolanaSignInInput } from '@vue-solana/core/types';
4
-
5
- type SignInStatus = "idle" | "signing-in" | "signed-in" | "error";
6
- /**
7
- * Trigger a wallet's Sign In With Solana (SIWS) feature.
8
- *
9
- * Resolves `{ account, signedMessage, signature }` for **server-side
10
- * verification** — the signature is over `signedMessage` and must be verified
11
- * against `account.publicKey` on your backend before trusting the identity
12
- * (see the message-signing guide). The wallet UI drives domain/nonce consent.
13
- */
14
- declare function useSignIn(): {
15
- signInResult: vue.ShallowRef<SolanaSignInResult | null, SolanaSignInResult | null>;
16
- status: vue.ShallowRef<SignInStatus>;
17
- loading: vue.ComputedRef<boolean>;
18
- error: vue.Ref<_vue_solana_core_errors.SolanaError | null, _vue_solana_core_errors.SolanaError | null>;
19
- signIn: (input?: SolanaSignInInput) => Promise<SolanaSignInResult>;
20
- };
21
-
22
- export { useSignIn };
23
- export type { SignInStatus };