@vue-solana/vue 2.0.0 → 2.2.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 +210 -21
- package/dist/index.cjs +60 -20
- package/dist/index.d.cts +26 -5
- package/dist/index.d.mts +26 -5
- package/dist/index.d.ts +26 -5
- package/dist/index.mjs +38 -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.B8VvC8d2.mjs +101 -0
- package/dist/shared/{vue.DP7qY8Rk.mjs → vue.BD6Gm1nl.mjs} +2 -2
- package/dist/shared/vue.BDNOyiGZ.mjs +109 -0
- 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.BSfiHqwj.mjs +34 -0
- package/dist/shared/{vue.CZwftA0L.cjs → vue.BVaMoz9y.cjs} +1 -1
- 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.CTqPbvz3.cjs +36 -0
- 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.CbJFnho-.mjs +171 -0
- package/dist/shared/vue.CoaIWGPT.cjs +38 -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.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.DxM45azl.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.ZuUCEEab.cjs +103 -0
- package/dist/shared/vue.g8fnm_ca.cjs +45 -0
- package/dist/shared/vue.l3UCdN7z.cjs +111 -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/useAirdrop.cjs +14 -0
- package/dist/useAirdrop.d.cts +25 -0
- package/dist/useAirdrop.d.mts +25 -0
- package/dist/useAirdrop.d.ts +25 -0
- package/dist/useAirdrop.mjs +8 -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.d.cts +3 -2
- package/dist/useConnection.d.mts +3 -2
- package/dist/useConnection.d.ts +3 -2
- 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 +73 -0
- package/dist/useRequest.d.mts +73 -0
- package/dist/useRequest.d.ts +73 -0
- package/dist/useRequest.mjs +5 -0
- package/dist/useRpc.cjs +3 -2
- package/dist/useRpc.d.cts +3 -2
- package/dist/useRpc.d.mts +3 -2
- package/dist/useRpc.d.ts +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.d.cts +3 -2
- package/dist/useSolanaClient.d.mts +3 -2
- package/dist/useSolanaClient.d.ts +3 -2
- package/dist/useSolanaClient.mjs +3 -2
- package/dist/useSubscription.cjs +9 -0
- package/dist/useSubscription.d.cts +70 -0
- package/dist/useSubscription.d.mts +70 -0
- package/dist/useSubscription.d.ts +70 -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 +98 -0
- package/dist/useTrackedData.d.mts +98 -0
- package/dist/useTrackedData.d.ts +98 -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 +78 -3
- package/dist/shared/vue.C4d2JA8U.mjs +0 -44
- package/dist/shared/vue.CE5i8KZZ.cjs +0 -46
package/README.md
CHANGED
|
@@ -24,10 +24,15 @@ New to Solana? Start with the official docs and the project concepts guide:
|
|
|
24
24
|
- Vue plugin for shared Solana RPC and wallet context.
|
|
25
25
|
- SSR-safe composables that return inert state when no client plugin context is available.
|
|
26
26
|
- RPC status and latest blockhash reads.
|
|
27
|
-
- Balance, account info, program account,
|
|
27
|
+
- Balance, account info, program account, signature status, token account, and token balance composables.
|
|
28
28
|
- Unified wallet discovery and selection for browser extensions, Android Mobile Wallet Adapter, and supported iOS browser wallets.
|
|
29
29
|
- Message signing helpers for wallet ownership and authentication challenges.
|
|
30
|
-
-
|
|
30
|
+
- Sign In With Solana (SIWS) authentication through `useSignIn()`.
|
|
31
|
+
- App-wide selected wallet account context with persistence.
|
|
32
|
+
- Transaction submission and confirmation state helpers, including batch signing and sign-and-send.
|
|
33
|
+
- Live data composables over Kit reactive stores (`useRequest`, `useSubscription`, `useTrackedData`) plus SWR cache adapters.
|
|
34
|
+
- A generic async action state machine (`useAction`) built on `@vue-solana/core/action`.
|
|
35
|
+
- Reactive Kit client signers (`usePayer`, `useIdentity`) and transaction planning (`usePlanTransaction`, `usePlanTransactions`) with fail-fast client capability assertions.
|
|
31
36
|
- Direct subpath exports for narrower imports.
|
|
32
37
|
|
|
33
38
|
## Compatibility
|
|
@@ -74,6 +79,8 @@ createApp(App)
|
|
|
74
79
|
|
|
75
80
|
Android Mobile Wallet Adapter registration is enabled by default on supported Android Chrome clients. Pass `mobileWallet` options to customize the MWA app identity, or pass `mobileWallet: false` to disable Android mobile wallet registration.
|
|
76
81
|
|
|
82
|
+
iOS browser wallet universal links for Phantom, Solflare, and Backpack are enabled by default on iOS browsers. Pass `iosWallet` options to customize the app identity and redirect URL, or pass `iosWallet: false` to disable iOS browser wallet entries.
|
|
83
|
+
|
|
77
84
|
You can also pass a custom RPC endpoint:
|
|
78
85
|
|
|
79
86
|
```ts
|
|
@@ -99,6 +106,7 @@ Supported clusters are `mainnet-beta`, `devnet`, `testnet`, and `localnet`. Use
|
|
|
99
106
|
| `autoConnect` | `boolean` | `false` | Reconnects only a previously selected discovered wallet identity when it is discovered again. |
|
|
100
107
|
| `wallet` | `SolanaWallet` | Disabled | Custom wallet adapter, useful for tests or custom integrations. |
|
|
101
108
|
| `mobileWallet` | `MobileWalletOptions \| false` | Enabled on supported Android clients | Configures or disables Android Mobile Wallet Adapter registration. |
|
|
109
|
+
| `iosWallet` | `iOSWalletOptions \| false` | Enabled on iOS browsers | Configures or disables iOS browser wallet universal links (Phantom, Solflare, Backpack). |
|
|
102
110
|
|
|
103
111
|
The root export remains supported. For composables, prefer direct subpath imports in new code so bundlers can avoid evaluating unrelated package entry code:
|
|
104
112
|
|
|
@@ -156,6 +164,22 @@ const { balance, loading, error, refresh } = useBalance(address);
|
|
|
156
164
|
</template>
|
|
157
165
|
```
|
|
158
166
|
|
|
167
|
+
### Airdrop on Test Networks
|
|
168
|
+
|
|
169
|
+
`useAirdrop()` sends SOL to an account on devnet, testnet, or a local validator. It requires an airdrop capability on the Kit client, installed with `createClient().use(solanaRpcConnection({ ... })).use(rpcAirdrop())` from `@solana/kit-plugin-rpc`.
|
|
170
|
+
|
|
171
|
+
```ts
|
|
172
|
+
import { lamports } from "@solana/kit";
|
|
173
|
+
import { useAirdrop } from "@vue-solana/vue/useAirdrop";
|
|
174
|
+
|
|
175
|
+
const { data, status, error, dispatch } = useAirdrop();
|
|
176
|
+
await dispatch(address, lamports(1_000_000_000)); // 1 SOL
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Each `dispatch(address, amount)` runs a fresh airdrop and aborts the previous in-flight call. `data` resolves to the transaction `Signature`, or to `undefined` when the network applies the airdrop without a transaction (some local validators, e.g. LiteSVM).
|
|
180
|
+
|
|
181
|
+
Airdrops to a single address are rate-limited (public devnets commonly return HTTP 429, and 1 SOL requires enough devnet balance); wait before dispatching again or use a fresh address. Errors surface through `error` / the `error` state.
|
|
182
|
+
|
|
159
183
|
## Read Account Data
|
|
160
184
|
|
|
161
185
|
```ts
|
|
@@ -174,6 +198,16 @@ const signatureStatus = useSignatureStatus(signature, {
|
|
|
174
198
|
});
|
|
175
199
|
```
|
|
176
200
|
|
|
201
|
+
Read SPL token accounts and balances through Kit RPC `jsonParsed`:
|
|
202
|
+
|
|
203
|
+
```ts
|
|
204
|
+
import { useTokenAccounts } from "@vue-solana/vue/useTokenAccounts";
|
|
205
|
+
import { useTokenBalance } from "@vue-solana/vue/useTokenBalance";
|
|
206
|
+
|
|
207
|
+
const tokenAccounts = useTokenAccounts(ownerAddress, { commitment: "confirmed" });
|
|
208
|
+
const tokenBalance = useTokenBalance(mintAddress, ownerAddress);
|
|
209
|
+
```
|
|
210
|
+
|
|
177
211
|
`useProgramAccounts()` can be expensive on public RPC nodes. Prefer narrow `filters`, use `dataSlice` when you only need part of account data, and avoid polling broad program scans.
|
|
178
212
|
|
|
179
213
|
## Wallet State
|
|
@@ -281,6 +315,124 @@ await confirmation.confirm(signature);
|
|
|
281
315
|
|
|
282
316
|
`useSignAndSendTransaction()` also clears `loading` if a wallet adapter never returns a result. In that stale case, `error` is set and the chain status may be unknown, so check the connected wallet or an explorer before retrying.
|
|
283
317
|
|
|
318
|
+
### Live Data
|
|
319
|
+
|
|
320
|
+
`useRequest()` fetches once per change and revalidates stale data in the background. Pass a request function, a pending Kit RPC request, or a ref/computed of either:
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
import { useSolanaClient } from "@vue-solana/vue/useSolanaClient";
|
|
324
|
+
import { useRequest } from "@vue-solana/vue/useRequest";
|
|
325
|
+
|
|
326
|
+
const { client } = useSolanaClient();
|
|
327
|
+
const { data, error, status, refresh } = useRequest(() => client.rpc.getSlot().send());
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
`useSubscription()` streams live slots from `rpcSubscriptions` reactive stores:
|
|
331
|
+
|
|
332
|
+
```ts
|
|
333
|
+
import { useSubscription } from "@vue-solana/vue/useSubscription";
|
|
334
|
+
|
|
335
|
+
const subscription = useSubscription(() => client.rpcSubscriptions.slotNotifications());
|
|
336
|
+
subscription.data; // { value: { slot: number } }
|
|
337
|
+
subscription.reconnect();
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
`useTrackedData()` pairs a slot-tracking request with a subscription, reusing a single subscription for concurrent mounts:
|
|
341
|
+
|
|
342
|
+
```ts
|
|
343
|
+
import { useTrackedData } from "@vue-solana/vue/useTrackedData";
|
|
344
|
+
|
|
345
|
+
const balance = useTrackedData({
|
|
346
|
+
rpcRequest: client.rpc.getBalance(address),
|
|
347
|
+
rpcSubscriptionRequest: client.rpcSubscriptions.balanceNotifications(address),
|
|
348
|
+
rpcValueMapper: (response) => response.value,
|
|
349
|
+
});
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
The `swr` adapters seed fresh mounts from the last-known value for the same cache key:
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
import { useRequestSwr } from "@vue-solana/vue/swr";
|
|
356
|
+
|
|
357
|
+
const balance = useRequestSwr(["balance", address], () => client.rpc.getBalance(address).send());
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Cancellation & Timeouts
|
|
361
|
+
|
|
362
|
+
`useRequest()`, `useSubscription()`, and `useTrackedData()` accept a `getAbortSignal` option — a factory called once per attempt (request) or connection (subscription/tracked data). It is the natural place for a timeout:
|
|
363
|
+
|
|
364
|
+
```ts
|
|
365
|
+
const { data, refresh } = useRequest(source, {
|
|
366
|
+
getAbortSignal: (attempt) => AbortSignal.timeout(10_000),
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
await refresh({ abortSignal: AbortSignal.timeout(2_000) });
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
The factory is read fresh from the latest render on every attempt, so inline closures work without `useCallback`-style wrapping. Each manual refresh or reconnect can instead pass a single `{ abortSignal }` override that replaces the factory for that attempt; pass `AbortSignal` explicitly as `undefined` to skip caller cancellation entirely. Aborting the composed signal fails only that attempt — previous `data` is kept and `status` drops back to `error`.
|
|
373
|
+
|
|
374
|
+
To kill the data hook entirely, set its source to `null` (status becomes `disabled` and in-flight work is cancelled) or unmount the component that owns it.
|
|
375
|
+
|
|
376
|
+
### Actions with `useAction`
|
|
377
|
+
|
|
378
|
+
`useAction()` and its derivatives (`useAirdrop()`, `useSignAndSendTransaction()` themes) manage one async action at a time:
|
|
379
|
+
|
|
380
|
+
```ts
|
|
381
|
+
const { data, status, error, dispatch } = useAction(async (signal, input) => {
|
|
382
|
+
/* ... */
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
dispatch(inputA); // runs
|
|
386
|
+
await dispatch(inputB); // aborts dispatch(inputA) before starting
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
- `useAction` keeps the handler in a ref — every `dispatch` runs the latest closure, so there is no deps array to keep in sync. In-flight calls keep running with the closure they started with.
|
|
390
|
+
- `dispatch` returns a `Promise<TResult>`. If a newer dispatch supersedes it, the older promise rejects with an abort error; awaiters should treat that as "superseded", not a failure, and fresh awaits win.
|
|
391
|
+
- Calling `dispatch` again aborts the prior in-flight call with a fresh `AbortSignal`, and resets state to `idle` before the new run starts.
|
|
392
|
+
|
|
393
|
+
### Sign In With Solana
|
|
394
|
+
|
|
395
|
+
`useSignIn()` triggers the SIWS flow when the connected wallet supports the `solana:signIn` feature:
|
|
396
|
+
|
|
397
|
+
```ts
|
|
398
|
+
import { useSignIn } from "@vue-solana/vue/useSignIn";
|
|
399
|
+
|
|
400
|
+
const { signInResult, status, loading, error, signIn } = useSignIn();
|
|
401
|
+
await signIn(); // { account, signedMessage, signature } — verify server-side
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Selected Wallet Account
|
|
405
|
+
|
|
406
|
+
`useSelectedWalletAccount()` requires a provider. Use the `SelectedWalletAccountProvider` component (or Nuxt's app-wide context) and read the shared selection anywhere in its subtree:
|
|
407
|
+
|
|
408
|
+
```vue
|
|
409
|
+
<script setup lang="ts">
|
|
410
|
+
import { SelectedWalletAccountProvider } from "@vue-solana/vue";
|
|
411
|
+
import { useSelectedWalletAccount } from "@vue-solana/vue/useSelectedWalletAccount";
|
|
412
|
+
|
|
413
|
+
const [selectedAccount, setSelectedAccount] = useSelectedWalletAccount();
|
|
414
|
+
</script>
|
|
415
|
+
|
|
416
|
+
<template>
|
|
417
|
+
<SelectedWalletAccountProvider>
|
|
418
|
+
<span>Active account: {{ selectedAccount?.address }}</span>
|
|
419
|
+
</SelectedWalletAccountProvider>
|
|
420
|
+
</template>
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
### Batch Transactions
|
|
424
|
+
|
|
425
|
+
`useSignTransactions()` and `useSignAndSendTransactions()` batch wallet requests and fall back to singular calls when the wallet only supports one at a time:
|
|
426
|
+
|
|
427
|
+
```ts
|
|
428
|
+
import { useSignAndSendTransactions } from "@vue-solana/vue/useSignAndSendTransactions";
|
|
429
|
+
|
|
430
|
+
const { signatures, status, loading, error, execute } = useSignAndSendTransactions();
|
|
431
|
+
await execute([transactionOne, transactionTwo]); // signatures: string[]
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
When a wallet falls back to sequential signing and a later send fails, `useSignAndSendTransactions()` throws a `PartialSignAndSendError` whose `signatures` field lists the sends that already landed.
|
|
435
|
+
|
|
284
436
|
## Example App
|
|
285
437
|
|
|
286
438
|
This README includes small snippets for quick reference. For a complete runnable Vue + Vite flow, see the example app:
|
|
@@ -305,31 +457,52 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
305
457
|
|
|
306
458
|
## API
|
|
307
459
|
|
|
308
|
-
| API
|
|
309
|
-
|
|
|
310
|
-
| `createSolanaPlugin(options?)`
|
|
311
|
-
| `VueSolana`
|
|
312
|
-
| `useSolana()`
|
|
313
|
-
| `useRpc()`
|
|
314
|
-
| `useSolanaClient()`
|
|
315
|
-
| `useConnection()`
|
|
316
|
-
| `useWallet()`
|
|
317
|
-
| `useWallets()`
|
|
318
|
-
| `useSignMessage()`
|
|
319
|
-
| `useBalance(address, commitment?)`
|
|
320
|
-
| `
|
|
321
|
-
| `
|
|
322
|
-
| `
|
|
323
|
-
| `
|
|
324
|
-
| `
|
|
325
|
-
| `
|
|
460
|
+
| API | Description |
|
|
461
|
+
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
|
|
462
|
+
| `createSolanaPlugin(options?)` | Installs the Vue Solana context. |
|
|
463
|
+
| `VueSolana` | Alias for `createSolanaPlugin`. |
|
|
464
|
+
| `useSolana()` | Returns the full injected Solana context. |
|
|
465
|
+
| `useRpc()` | Returns cluster, endpoint, connection status, latest blockhash, the Kit `client`, and `checkConnection()`. |
|
|
466
|
+
| `useSolanaClient()` | Returns the injected Kit client as `{ client, rpc }`. The recommended RPC path. |
|
|
467
|
+
| `useConnection()` | Returns the Kit `client`. Deprecated in favor of `useSolanaClient()`. |
|
|
468
|
+
| `useWallet()` | Returns wallet refs, computed connection state, and wallet actions. |
|
|
469
|
+
| `useWallets()` | Returns discovered browser extension wallets, Android MWA wallets, iOS browser wallet links, and wallet selection actions. |
|
|
470
|
+
| `useSignMessage()` | Signs arbitrary message bytes through the connected wallet when message signing is supported. |
|
|
471
|
+
| `useBalance(address, commitment?)` | Loads lamport balance for an address string. |
|
|
472
|
+
| `useAirdrop()` | Airdrops SOL on devnet/testnet/localnets; `data` is the `Signature`, or `undefined` when applied directly. |
|
|
473
|
+
| `useAccountInfo(address, options?)` | Loads normalized account info (executable, lamports, owner, space, data bytes). |
|
|
474
|
+
| `useProgramAccounts(programId, config?)` | Loads accounts owned by a program with optional filters, commitment, and `dataSlice`. |
|
|
475
|
+
| `useTransaction(handler, options?)` | Generic async transaction state helper with optional timeout settings. |
|
|
476
|
+
| `useTransactionConfirmation(options?)` | Confirms a submitted signature with reactive status and timeout/error state. |
|
|
477
|
+
| `useSignatureStatus(signature, options?)` | Reads a transaction signature status with optional polling. |
|
|
478
|
+
| `useSignAndSendTransaction()` | Signs and sends a transaction through the configured wallet, with optional confirmation waiting. |
|
|
479
|
+
| `useTokenAccounts(owner, options?)` | Reads SPL token accounts for an owner. |
|
|
480
|
+
| `useTokenBalance(mint, owner, commitment?)` | Reads the token balance for a mint/owner pair. |
|
|
481
|
+
| `useAction(handler, options?)` | Generic async action state machine; each dispatch aborts the prior in-flight call. |
|
|
482
|
+
| `useRequest(source, options?)` | One-shot Kit request that re-fires when its source changes, preserving the previous `data` while revalidating. |
|
|
483
|
+
| `useSubscription(source, options?)` | Live data over a Kit reactive stream store (e.g. RPC subscriptions), torn down on unmount. |
|
|
484
|
+
| `useTrackedData(source, options?)` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
|
|
485
|
+
| `useRequestSwr(key, ...)` / `useSubscriptionSwr(key, ...)` / `useTrackedDataSwr(key, ...)` | Cache-keyed SWR adapters seeding fresh mounts from the last-known result. |
|
|
486
|
+
| `clearSwrCache()` | Clears every cached SWR entry. |
|
|
487
|
+
| `useSignIn(input?)` | Sign In With Solana (SIWS) trigger returning `{ account, signedMessage, signature }` for server-side verification. |
|
|
488
|
+
| `useSelectedWalletAccount()` | App-wide selected wallet account context: `[selectedAccount, setSelectedAccount, filteredWallets]`. |
|
|
489
|
+
| `SelectedWalletAccountProvider` | Component that provides the selected wallet account context to its subtree. |
|
|
490
|
+
| `useSignTransactions()` | Batch-signs transactions through the wallet, preferring `signTransactions` and falling back to `signAllTransactions`. |
|
|
491
|
+
| `useSignAndSendTransactions()` | Signs and sends multiple transactions, returning one signature each, with a singular sequential fallback. |
|
|
492
|
+
| `useClientCapability(capability, options?)` | Fails fast with a clear error when the configured Solana client lacks a requested capability. |
|
|
493
|
+
| `usePayer()` | Reactive Kit client `payer` signer ref (requires a signer plugin on the client). |
|
|
494
|
+
| `useIdentity()` | Reactive Kit client `identity` signer ref (requires a signer plugin on the client). |
|
|
495
|
+
| `usePlanTransaction()` | Plans a single transaction message from instruction inputs without signing or sending. |
|
|
496
|
+
| `usePlanTransactions()` | Plans a batch of transaction messages from instruction inputs. |
|
|
326
497
|
|
|
327
498
|
Direct composable subpaths:
|
|
328
499
|
|
|
329
500
|
- `@vue-solana/vue/useSolana`
|
|
501
|
+
- `@vue-solana/vue/useSolanaClient`
|
|
330
502
|
- `@vue-solana/vue/useRpc`
|
|
331
503
|
- `@vue-solana/vue/useConnection`
|
|
332
504
|
- `@vue-solana/vue/useAccountInfo`
|
|
505
|
+
- `@vue-solana/vue/useAirdrop`
|
|
333
506
|
- `@vue-solana/vue/useBalance`
|
|
334
507
|
- `@vue-solana/vue/useProgramAccounts`
|
|
335
508
|
- `@vue-solana/vue/useWallet`
|
|
@@ -339,9 +512,25 @@ Direct composable subpaths:
|
|
|
339
512
|
- `@vue-solana/vue/useTransactionConfirmation`
|
|
340
513
|
- `@vue-solana/vue/useSignatureStatus`
|
|
341
514
|
- `@vue-solana/vue/useSignAndSendTransaction`
|
|
515
|
+
- `@vue-solana/vue/useTokenAccounts`
|
|
516
|
+
- `@vue-solana/vue/useTokenBalance`
|
|
517
|
+
- `@vue-solana/vue/useAction`
|
|
518
|
+
- `@vue-solana/vue/useRequest`
|
|
519
|
+
- `@vue-solana/vue/useSubscription`
|
|
520
|
+
- `@vue-solana/vue/useTrackedData`
|
|
521
|
+
- `@vue-solana/vue/useSignIn`
|
|
522
|
+
- `@vue-solana/vue/useSelectedWalletAccount`
|
|
523
|
+
- `@vue-solana/vue/useSignTransactions`
|
|
524
|
+
- `@vue-solana/vue/useSignAndSendTransactions`
|
|
525
|
+
- `@vue-solana/vue/useClientCapability`
|
|
526
|
+
- `@vue-solana/vue/usePayer`
|
|
527
|
+
- `@vue-solana/vue/useIdentity`
|
|
528
|
+
- `@vue-solana/vue/usePlanTransaction`
|
|
529
|
+
- `@vue-solana/vue/usePlanTransactions`
|
|
342
530
|
|
|
343
531
|
Other direct subpaths:
|
|
344
532
|
|
|
533
|
+
- `@vue-solana/vue/swr`
|
|
345
534
|
- `@vue-solana/vue/kit`
|
|
346
535
|
- `@vue-solana/vue/buffer-polyfill`
|
|
347
536
|
|
|
@@ -356,4 +545,4 @@ Other direct subpaths:
|
|
|
356
545
|
|
|
357
546
|
## Status
|
|
358
547
|
|
|
359
|
-
This package provides RPC, balance, browser extension wallet, Android mobile wallet, iOS browser wallet, message signing, and transaction composables.
|
|
548
|
+
This package provides RPC, balance, account, token, browser extension wallet, Android mobile wallet, iOS browser wallet, message signing, SIWS, live data, and transaction composables.
|
package/dist/index.cjs
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const useAccountInfo = require('./shared/vue.
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
3
|
+
const useAccountInfo = require('./shared/vue.D-qi8PSL.cjs');
|
|
4
|
+
const useAction = require('./shared/vue.CoaIWGPT.cjs');
|
|
5
|
+
const useAirdrop = require('./shared/vue.CTqPbvz3.cjs');
|
|
6
|
+
const useBalance = require('./shared/vue.E_npPFoV.cjs');
|
|
7
|
+
const useClientCapability = require('./shared/vue.BY0qpgYr.cjs');
|
|
8
|
+
const useConnection = require('./shared/vue.BVaMoz9y.cjs');
|
|
9
|
+
const usePlanTransaction = require('./shared/vue.B4-LEdSE.cjs');
|
|
10
|
+
const useProgramAccounts = require('./shared/vue.Di7yjJ-R.cjs');
|
|
11
|
+
const usePayer = require('./shared/vue.g8fnm_ca.cjs');
|
|
12
|
+
const useRequest = require('./shared/vue.ZuUCEEab.cjs');
|
|
13
|
+
const useRpc = require('./shared/vue.FiMmnMHr.cjs');
|
|
14
|
+
const SelectedWalletAccountProvider = require('./shared/vue.DDbVk0Zh.cjs');
|
|
15
|
+
const useSignMessage = require('./shared/vue.B6ainw2G.cjs');
|
|
16
|
+
const useSignAndSendTransaction = require('./shared/vue.CWZSMVnB.cjs');
|
|
17
|
+
const useSignTransactions = require('./shared/vue.DFaMJLAQ.cjs');
|
|
18
|
+
const useSignAndSendTransactions = require('./shared/vue.CrkK_T15.cjs');
|
|
19
|
+
const useSignatureStatus = require('./shared/vue.CIs8QhCw.cjs');
|
|
20
|
+
const useSignIn = require('./shared/vue.9TPxZPMf.cjs');
|
|
21
|
+
const useSolana = require('./shared/vue.DE3emjSF.cjs');
|
|
22
|
+
const useSolanaClient = require('./shared/vue.BIxphCAq.cjs');
|
|
23
|
+
const useSubscription = require('./shared/vue.l3UCdN7z.cjs');
|
|
24
|
+
const useTokenAccounts = require('./shared/vue.Bwd1sGAM.cjs');
|
|
25
|
+
const useTokenBalance = require('./shared/vue.DAg5wC1G.cjs');
|
|
26
|
+
const useTrackedData = require('./shared/vue.DxM45azl.cjs');
|
|
27
|
+
const useTransaction = require('./shared/vue.Bk5xjlUx.cjs');
|
|
28
|
+
const useTransactionConfirmation = require('./shared/vue.Sbbm9JSu.cjs');
|
|
29
|
+
const useWallet = require('./shared/vue.BGxz4dru.cjs');
|
|
30
|
+
const useWallets = require('./shared/vue.DKyQ7J67.cjs');
|
|
31
|
+
const injection = require('./shared/vue.DEHxNvUX.cjs');
|
|
19
32
|
const kit = require('@vue-solana/core/kit');
|
|
20
33
|
const errors = require('@vue-solana/core/errors');
|
|
21
34
|
const rpc = require('@vue-solana/core/rpc');
|
|
@@ -25,6 +38,7 @@ const vue = require('vue');
|
|
|
25
38
|
const iosWallet = require('@vue-solana/core/ios-wallet');
|
|
26
39
|
require('@vue-solana/core/address');
|
|
27
40
|
require('./shared/vue.DNxOpDXz.cjs');
|
|
41
|
+
require('@vue-solana/core/action');
|
|
28
42
|
require('@vue-solana/core/wallet');
|
|
29
43
|
require('@vue-solana/core/transaction');
|
|
30
44
|
require('bs58');
|
|
@@ -155,7 +169,10 @@ function createSolanaWalletRegistry(options) {
|
|
|
155
169
|
signMessage: adaptedWallet.signMessage?.bind(adaptedWallet),
|
|
156
170
|
signTransaction: adaptedWallet.signTransaction?.bind(adaptedWallet),
|
|
157
171
|
signAllTransactions: adaptedWallet.signAllTransactions?.bind(adaptedWallet),
|
|
158
|
-
signAndSendTransaction: adaptedWallet.signAndSendTransaction?.bind(adaptedWallet)
|
|
172
|
+
signAndSendTransaction: adaptedWallet.signAndSendTransaction?.bind(adaptedWallet),
|
|
173
|
+
signIn: adaptedWallet.signIn?.bind(adaptedWallet),
|
|
174
|
+
signTransactions: adaptedWallet.signTransactions?.bind(adaptedWallet),
|
|
175
|
+
signAndSendTransactions: adaptedWallet.signAndSendTransactions?.bind(adaptedWallet)
|
|
159
176
|
};
|
|
160
177
|
adaptedWallets.set(walletInfo.wallet, cachedAdapter);
|
|
161
178
|
return cachedAdapter;
|
|
@@ -199,7 +216,8 @@ function isObject(value) {
|
|
|
199
216
|
|
|
200
217
|
const RPC_CHECK_TIMEOUT_MS = 1e4;
|
|
201
218
|
function createSolanaPlugin(options = {}) {
|
|
202
|
-
|
|
219
|
+
const plugin = {
|
|
220
|
+
context: null,
|
|
203
221
|
install(app) {
|
|
204
222
|
const context = rpc.createSolanaContext(options);
|
|
205
223
|
const wallet = vue.shallowRef(options.wallet ?? null);
|
|
@@ -346,7 +364,8 @@ function createSolanaPlugin(options = {}) {
|
|
|
346
364
|
}
|
|
347
365
|
}
|
|
348
366
|
};
|
|
349
|
-
app.provide(
|
|
367
|
+
app.provide(injection.solanaInjectionKey, vueContext);
|
|
368
|
+
plugin.context = vueContext;
|
|
350
369
|
if (typeof window !== "undefined") {
|
|
351
370
|
window.setTimeout(() => {
|
|
352
371
|
try {
|
|
@@ -359,6 +378,7 @@ function createSolanaPlugin(options = {}) {
|
|
|
359
378
|
}
|
|
360
379
|
}
|
|
361
380
|
};
|
|
381
|
+
return plugin;
|
|
362
382
|
}
|
|
363
383
|
function isSameWallet(wallet, selectedWallet) {
|
|
364
384
|
return wallet.name === selectedWallet?.name && wallet.source === selectedWallet.source && wallet.platform === selectedWallet.platform;
|
|
@@ -366,24 +386,44 @@ function isSameWallet(wallet, selectedWallet) {
|
|
|
366
386
|
const VueSolana = createSolanaPlugin;
|
|
367
387
|
|
|
368
388
|
exports.useAccountInfo = useAccountInfo.useAccountInfo;
|
|
389
|
+
exports.useAction = useAction.useAction;
|
|
390
|
+
exports.useAirdrop = useAirdrop.useAirdrop;
|
|
369
391
|
exports.useBalance = useBalance.useBalance;
|
|
392
|
+
exports.MissingClientCapabilityError = useClientCapability.MissingClientCapabilityError;
|
|
393
|
+
exports.useClientCapability = useClientCapability.useClientCapability;
|
|
370
394
|
exports.useConnection = useConnection.useConnection;
|
|
395
|
+
exports.usePlanTransaction = usePlanTransaction.usePlanTransaction;
|
|
396
|
+
exports.usePlanTransactions = usePlanTransaction.usePlanTransactions;
|
|
371
397
|
exports.useProgramAccounts = useProgramAccounts.useProgramAccounts;
|
|
398
|
+
exports.useIdentity = usePayer.useIdentity;
|
|
399
|
+
exports.usePayer = usePayer.usePayer;
|
|
400
|
+
exports.useRequest = useRequest.useRequest;
|
|
372
401
|
exports.useRpc = useRpc.useRpc;
|
|
402
|
+
exports.SelectedWalletAccountProvider = SelectedWalletAccountProvider.SelectedWalletAccountProvider;
|
|
403
|
+
exports.createSelectedWalletAccountContext = SelectedWalletAccountProvider.createSelectedWalletAccountContext;
|
|
404
|
+
exports.provideSelectedWalletAccount = SelectedWalletAccountProvider.provideSelectedWalletAccount;
|
|
405
|
+
exports.selectedWalletAccountInjectionKey = SelectedWalletAccountProvider.selectedWalletAccountInjectionKey;
|
|
406
|
+
exports.useSelectedWalletAccount = SelectedWalletAccountProvider.useSelectedWalletAccount;
|
|
373
407
|
exports.useSignMessage = useSignMessage.useSignMessage;
|
|
374
408
|
exports.useSignAndSendTransaction = useSignAndSendTransaction.useSignAndSendTransaction;
|
|
409
|
+
exports.useSignTransactions = useSignTransactions.useSignTransactions;
|
|
410
|
+
exports.PartialSignAndSendError = useSignAndSendTransactions.PartialSignAndSendError;
|
|
411
|
+
exports.useSignAndSendTransactions = useSignAndSendTransactions.useSignAndSendTransactions;
|
|
375
412
|
exports.useSignatureStatus = useSignatureStatus.useSignatureStatus;
|
|
376
|
-
exports.
|
|
413
|
+
exports.useSignIn = useSignIn.useSignIn;
|
|
377
414
|
exports.tryUseSolana = useSolana.tryUseSolana;
|
|
378
415
|
exports.useSolana = useSolana.useSolana;
|
|
379
416
|
exports.useSolanaClient = useSolanaClient.useSolanaClient;
|
|
417
|
+
exports.useSubscription = useSubscription.useSubscription;
|
|
380
418
|
exports.useTokenAccounts = useTokenAccounts.useTokenAccounts;
|
|
381
419
|
exports.useTokenBalance = useTokenBalance.useTokenBalance;
|
|
420
|
+
exports.useTrackedData = useTrackedData.useTrackedData;
|
|
382
421
|
exports.useTransaction = useTransaction.useTransaction;
|
|
383
422
|
exports.getConfirmedTransactionStatus = useTransactionConfirmation.getConfirmedTransactionStatus;
|
|
384
423
|
exports.useTransactionConfirmation = useTransactionConfirmation.useTransactionConfirmation;
|
|
385
424
|
exports.useWallet = useWallet.useWallet;
|
|
386
425
|
exports.useWallets = useWallets.useWallets;
|
|
426
|
+
exports.solanaInjectionKey = injection.solanaInjectionKey;
|
|
387
427
|
exports.address = kit.address;
|
|
388
428
|
exports.createSolanaClient = kit.createSolanaClient;
|
|
389
429
|
exports.lamports = kit.lamports;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
export { AccountInfo, UseAccountInfoOptions, useAccountInfo } from './useAccountInfo.cjs';
|
|
2
|
+
export { UseActionOptions, UseActionReturn, UseActionStatus, useAction } from './useAction.cjs';
|
|
3
|
+
export { useAirdrop } from './useAirdrop.cjs';
|
|
2
4
|
export { BalanceInput, useBalance } from './useBalance.cjs';
|
|
5
|
+
export { MissingClientCapabilityError, UseClientCapabilityOptions, useClientCapability } from './useClientCapability.cjs';
|
|
3
6
|
export { useConnection } from './useConnection.cjs';
|
|
7
|
+
export { PlanTransactionConfig, PlanTransactionStatus, usePlanTransaction, usePlanTransactions } from './usePlanTransaction.cjs';
|
|
4
8
|
export { ProgramAccount, ProgramAccountDataSizeFilter, ProgramAccountDataSlice, ProgramAccountFilter, ProgramAccountMemcmpEncoding, ProgramAccountMemcmpFilter, UseProgramAccountsOptions, useProgramAccounts } from './useProgramAccounts.cjs';
|
|
9
|
+
export { useIdentity, usePayer } from './usePayer.cjs';
|
|
10
|
+
export { UseRequestOptions, UseRequestRefresherOptions, UseRequestReturn, UseRequestSource, UseRequestStatus, useRequest } from './useRequest.cjs';
|
|
5
11
|
export { useRpc } from './useRpc.cjs';
|
|
12
|
+
export { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, SelectedWalletAccountProvider, WalletAccountFilter, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount } from './useSelectedWalletAccount.cjs';
|
|
6
13
|
export { SignMessageStatus, useSignMessage } from './useSignMessage.cjs';
|
|
7
14
|
export { SignAndSendTransactionOptions, SignAndSendTransactionStatus, useSignAndSendTransaction } from './useSignAndSendTransaction.cjs';
|
|
15
|
+
export { SignTransactionsStatus, useSignTransactions } from './useSignTransactions.cjs';
|
|
16
|
+
export { PartialSignAndSendError, SignAndSendTransactionsStatus, useSignAndSendTransactions } from './useSignAndSendTransactions.cjs';
|
|
8
17
|
export { SignatureStatus, UseSignatureStatusOptions, useSignatureStatus } from './useSignatureStatus.cjs';
|
|
18
|
+
export { SignInStatus, useSignIn } from './useSignIn.cjs';
|
|
9
19
|
export { tryUseSolana, useSolana } from './useSolana.cjs';
|
|
10
20
|
export { useSolanaClient } from './useSolanaClient.cjs';
|
|
21
|
+
export { UseSubscriptionOptions, UseSubscriptionReconnectOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus, useSubscription } from './useSubscription.cjs';
|
|
11
22
|
export { UseTokenAccountsOptions, useTokenAccounts } from './useTokenAccounts.cjs';
|
|
12
23
|
export { useTokenBalance } from './useTokenBalance.cjs';
|
|
24
|
+
export { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataRefresherOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource, useTrackedData } from './useTrackedData.cjs';
|
|
13
25
|
export { UseTransactionOptions, useTransaction } from './useTransaction.cjs';
|
|
14
26
|
export { TransactionConfirmationStatus, getConfirmedTransactionStatus, useTransactionConfirmation } from './useTransactionConfirmation.cjs';
|
|
15
27
|
export { useWallet } from './useWallet.cjs';
|
|
16
28
|
export { useWallets } from './useWallets.cjs';
|
|
17
|
-
|
|
29
|
+
import { V as VueSolanaContext } from './shared/vue.DL3z5PxP.cjs';
|
|
30
|
+
export { S as SolanaConnectionStatus, s as solanaInjectionKey } from './shared/vue.DL3z5PxP.cjs';
|
|
18
31
|
export { Address, Commitment, Lamports, Rpc, Signature, SolanaClient, SolanaRpcApi, address, createSolanaClient, lamports } from '@vue-solana/core/kit';
|
|
19
32
|
import { GetSolanaIosWalletsOptions } from '@vue-solana/core/ios-wallet';
|
|
20
33
|
import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-wallet';
|
|
@@ -29,10 +42,18 @@ interface VueSolanaPluginOptions extends SolanaConfig {
|
|
|
29
42
|
mobileWallet?: false | RegisterSolanaMobileWalletOptions;
|
|
30
43
|
iosWallet?: false | GetSolanaIosWalletsOptions;
|
|
31
44
|
}
|
|
32
|
-
|
|
45
|
+
interface VueSolanaPlugin {
|
|
46
|
+
/** Installs the plugin on a Vue app (called synchronously by `app.use`). */
|
|
33
47
|
install(app: App): void;
|
|
34
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The app context built by `install`, available once `app.use(plugin)` has
|
|
50
|
+
* run. Lets framework integrations (e.g. the Nuxt module) hand the live
|
|
51
|
+
* context to consumers that run outside a component setup.
|
|
52
|
+
*/
|
|
53
|
+
context: VueSolanaContext | null;
|
|
54
|
+
}
|
|
55
|
+
declare function createSolanaPlugin(options?: VueSolanaPluginOptions): VueSolanaPlugin;
|
|
35
56
|
declare const VueSolana: typeof createSolanaPlugin;
|
|
36
57
|
|
|
37
|
-
export { VueSolana, createSolanaPlugin };
|
|
38
|
-
export type { VueSolanaPluginOptions };
|
|
58
|
+
export { VueSolana, VueSolanaContext, createSolanaPlugin };
|
|
59
|
+
export type { VueSolanaPlugin, VueSolanaPluginOptions };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
export { AccountInfo, UseAccountInfoOptions, useAccountInfo } from './useAccountInfo.mjs';
|
|
2
|
+
export { UseActionOptions, UseActionReturn, UseActionStatus, useAction } from './useAction.mjs';
|
|
3
|
+
export { useAirdrop } from './useAirdrop.mjs';
|
|
2
4
|
export { BalanceInput, useBalance } from './useBalance.mjs';
|
|
5
|
+
export { MissingClientCapabilityError, UseClientCapabilityOptions, useClientCapability } from './useClientCapability.mjs';
|
|
3
6
|
export { useConnection } from './useConnection.mjs';
|
|
7
|
+
export { PlanTransactionConfig, PlanTransactionStatus, usePlanTransaction, usePlanTransactions } from './usePlanTransaction.mjs';
|
|
4
8
|
export { ProgramAccount, ProgramAccountDataSizeFilter, ProgramAccountDataSlice, ProgramAccountFilter, ProgramAccountMemcmpEncoding, ProgramAccountMemcmpFilter, UseProgramAccountsOptions, useProgramAccounts } from './useProgramAccounts.mjs';
|
|
9
|
+
export { useIdentity, usePayer } from './usePayer.mjs';
|
|
10
|
+
export { UseRequestOptions, UseRequestRefresherOptions, UseRequestReturn, UseRequestSource, UseRequestStatus, useRequest } from './useRequest.mjs';
|
|
5
11
|
export { useRpc } from './useRpc.mjs';
|
|
12
|
+
export { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, SelectedWalletAccountProvider, WalletAccountFilter, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount } from './useSelectedWalletAccount.mjs';
|
|
6
13
|
export { SignMessageStatus, useSignMessage } from './useSignMessage.mjs';
|
|
7
14
|
export { SignAndSendTransactionOptions, SignAndSendTransactionStatus, useSignAndSendTransaction } from './useSignAndSendTransaction.mjs';
|
|
15
|
+
export { SignTransactionsStatus, useSignTransactions } from './useSignTransactions.mjs';
|
|
16
|
+
export { PartialSignAndSendError, SignAndSendTransactionsStatus, useSignAndSendTransactions } from './useSignAndSendTransactions.mjs';
|
|
8
17
|
export { SignatureStatus, UseSignatureStatusOptions, useSignatureStatus } from './useSignatureStatus.mjs';
|
|
18
|
+
export { SignInStatus, useSignIn } from './useSignIn.mjs';
|
|
9
19
|
export { tryUseSolana, useSolana } from './useSolana.mjs';
|
|
10
20
|
export { useSolanaClient } from './useSolanaClient.mjs';
|
|
21
|
+
export { UseSubscriptionOptions, UseSubscriptionReconnectOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus, useSubscription } from './useSubscription.mjs';
|
|
11
22
|
export { UseTokenAccountsOptions, useTokenAccounts } from './useTokenAccounts.mjs';
|
|
12
23
|
export { useTokenBalance } from './useTokenBalance.mjs';
|
|
24
|
+
export { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataRefresherOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource, useTrackedData } from './useTrackedData.mjs';
|
|
13
25
|
export { UseTransactionOptions, useTransaction } from './useTransaction.mjs';
|
|
14
26
|
export { TransactionConfirmationStatus, getConfirmedTransactionStatus, useTransactionConfirmation } from './useTransactionConfirmation.mjs';
|
|
15
27
|
export { useWallet } from './useWallet.mjs';
|
|
16
28
|
export { useWallets } from './useWallets.mjs';
|
|
17
|
-
|
|
29
|
+
import { V as VueSolanaContext } from './shared/vue.DL3z5PxP.mjs';
|
|
30
|
+
export { S as SolanaConnectionStatus, s as solanaInjectionKey } from './shared/vue.DL3z5PxP.mjs';
|
|
18
31
|
export { Address, Commitment, Lamports, Rpc, Signature, SolanaClient, SolanaRpcApi, address, createSolanaClient, lamports } from '@vue-solana/core/kit';
|
|
19
32
|
import { GetSolanaIosWalletsOptions } from '@vue-solana/core/ios-wallet';
|
|
20
33
|
import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-wallet';
|
|
@@ -29,10 +42,18 @@ interface VueSolanaPluginOptions extends SolanaConfig {
|
|
|
29
42
|
mobileWallet?: false | RegisterSolanaMobileWalletOptions;
|
|
30
43
|
iosWallet?: false | GetSolanaIosWalletsOptions;
|
|
31
44
|
}
|
|
32
|
-
|
|
45
|
+
interface VueSolanaPlugin {
|
|
46
|
+
/** Installs the plugin on a Vue app (called synchronously by `app.use`). */
|
|
33
47
|
install(app: App): void;
|
|
34
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The app context built by `install`, available once `app.use(plugin)` has
|
|
50
|
+
* run. Lets framework integrations (e.g. the Nuxt module) hand the live
|
|
51
|
+
* context to consumers that run outside a component setup.
|
|
52
|
+
*/
|
|
53
|
+
context: VueSolanaContext | null;
|
|
54
|
+
}
|
|
55
|
+
declare function createSolanaPlugin(options?: VueSolanaPluginOptions): VueSolanaPlugin;
|
|
35
56
|
declare const VueSolana: typeof createSolanaPlugin;
|
|
36
57
|
|
|
37
|
-
export { VueSolana, createSolanaPlugin };
|
|
38
|
-
export type { VueSolanaPluginOptions };
|
|
58
|
+
export { VueSolana, VueSolanaContext, createSolanaPlugin };
|
|
59
|
+
export type { VueSolanaPlugin, VueSolanaPluginOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
export { AccountInfo, UseAccountInfoOptions, useAccountInfo } from './useAccountInfo.js';
|
|
2
|
+
export { UseActionOptions, UseActionReturn, UseActionStatus, useAction } from './useAction.js';
|
|
3
|
+
export { useAirdrop } from './useAirdrop.js';
|
|
2
4
|
export { BalanceInput, useBalance } from './useBalance.js';
|
|
5
|
+
export { MissingClientCapabilityError, UseClientCapabilityOptions, useClientCapability } from './useClientCapability.js';
|
|
3
6
|
export { useConnection } from './useConnection.js';
|
|
7
|
+
export { PlanTransactionConfig, PlanTransactionStatus, usePlanTransaction, usePlanTransactions } from './usePlanTransaction.js';
|
|
4
8
|
export { ProgramAccount, ProgramAccountDataSizeFilter, ProgramAccountDataSlice, ProgramAccountFilter, ProgramAccountMemcmpEncoding, ProgramAccountMemcmpFilter, UseProgramAccountsOptions, useProgramAccounts } from './useProgramAccounts.js';
|
|
9
|
+
export { useIdentity, usePayer } from './usePayer.js';
|
|
10
|
+
export { UseRequestOptions, UseRequestRefresherOptions, UseRequestReturn, UseRequestSource, UseRequestStatus, useRequest } from './useRequest.js';
|
|
5
11
|
export { useRpc } from './useRpc.js';
|
|
12
|
+
export { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, SelectedWalletAccountProvider, WalletAccountFilter, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount } from './useSelectedWalletAccount.js';
|
|
6
13
|
export { SignMessageStatus, useSignMessage } from './useSignMessage.js';
|
|
7
14
|
export { SignAndSendTransactionOptions, SignAndSendTransactionStatus, useSignAndSendTransaction } from './useSignAndSendTransaction.js';
|
|
15
|
+
export { SignTransactionsStatus, useSignTransactions } from './useSignTransactions.js';
|
|
16
|
+
export { PartialSignAndSendError, SignAndSendTransactionsStatus, useSignAndSendTransactions } from './useSignAndSendTransactions.js';
|
|
8
17
|
export { SignatureStatus, UseSignatureStatusOptions, useSignatureStatus } from './useSignatureStatus.js';
|
|
18
|
+
export { SignInStatus, useSignIn } from './useSignIn.js';
|
|
9
19
|
export { tryUseSolana, useSolana } from './useSolana.js';
|
|
10
20
|
export { useSolanaClient } from './useSolanaClient.js';
|
|
21
|
+
export { UseSubscriptionOptions, UseSubscriptionReconnectOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus, useSubscription } from './useSubscription.js';
|
|
11
22
|
export { UseTokenAccountsOptions, useTokenAccounts } from './useTokenAccounts.js';
|
|
12
23
|
export { useTokenBalance } from './useTokenBalance.js';
|
|
24
|
+
export { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataRefresherOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource, useTrackedData } from './useTrackedData.js';
|
|
13
25
|
export { UseTransactionOptions, useTransaction } from './useTransaction.js';
|
|
14
26
|
export { TransactionConfirmationStatus, getConfirmedTransactionStatus, useTransactionConfirmation } from './useTransactionConfirmation.js';
|
|
15
27
|
export { useWallet } from './useWallet.js';
|
|
16
28
|
export { useWallets } from './useWallets.js';
|
|
17
|
-
|
|
29
|
+
import { V as VueSolanaContext } from './shared/vue.DL3z5PxP.js';
|
|
30
|
+
export { S as SolanaConnectionStatus, s as solanaInjectionKey } from './shared/vue.DL3z5PxP.js';
|
|
18
31
|
export { Address, Commitment, Lamports, Rpc, Signature, SolanaClient, SolanaRpcApi, address, createSolanaClient, lamports } from '@vue-solana/core/kit';
|
|
19
32
|
import { GetSolanaIosWalletsOptions } from '@vue-solana/core/ios-wallet';
|
|
20
33
|
import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-wallet';
|
|
@@ -29,10 +42,18 @@ interface VueSolanaPluginOptions extends SolanaConfig {
|
|
|
29
42
|
mobileWallet?: false | RegisterSolanaMobileWalletOptions;
|
|
30
43
|
iosWallet?: false | GetSolanaIosWalletsOptions;
|
|
31
44
|
}
|
|
32
|
-
|
|
45
|
+
interface VueSolanaPlugin {
|
|
46
|
+
/** Installs the plugin on a Vue app (called synchronously by `app.use`). */
|
|
33
47
|
install(app: App): void;
|
|
34
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The app context built by `install`, available once `app.use(plugin)` has
|
|
50
|
+
* run. Lets framework integrations (e.g. the Nuxt module) hand the live
|
|
51
|
+
* context to consumers that run outside a component setup.
|
|
52
|
+
*/
|
|
53
|
+
context: VueSolanaContext | null;
|
|
54
|
+
}
|
|
55
|
+
declare function createSolanaPlugin(options?: VueSolanaPluginOptions): VueSolanaPlugin;
|
|
35
56
|
declare const VueSolana: typeof createSolanaPlugin;
|
|
36
57
|
|
|
37
|
-
export { VueSolana, createSolanaPlugin };
|
|
38
|
-
export type { VueSolanaPluginOptions };
|
|
58
|
+
export { VueSolana, VueSolanaContext, createSolanaPlugin };
|
|
59
|
+
export type { VueSolanaPlugin, VueSolanaPluginOptions };
|