@vue-solana/vue 1.2.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 +162 -23
- package/dist/buffer-polyfill.d.cts +0 -1
- package/dist/buffer-polyfill.d.mts +0 -1
- package/dist/buffer-polyfill.d.ts +0 -1
- package/dist/index.cjs +62 -22
- package/dist/index.d.cts +29 -13
- package/dist/index.d.mts +29 -13
- package/dist/index.d.ts +29 -13
- package/dist/index.mjs +41 -21
- package/dist/kit.d.cts +1 -1
- package/dist/kit.d.mts +1 -1
- package/dist/kit.d.ts +1 -1
- 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.C0uCLjJ6.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.D0ycWj82.mjs → vue.BD6Gm1nl.mjs} +9 -9
- package/dist/shared/{vue.BEesxsrA.cjs → vue.BGxz4dru.cjs} +7 -3
- package/dist/shared/{vue.DDxhSi72.mjs → vue.BINkrA8h.mjs} +9 -9
- package/dist/shared/{vue.COPnX5fq.cjs → vue.BIxphCAq.cjs} +1 -1
- package/dist/shared/{vue.CKTUFwSI.mjs → vue.BOpgWr43.mjs} +9 -10
- package/dist/shared/vue.BQRpjwKl.mjs +80 -0
- package/dist/shared/vue.BVaMoz9y.cjs +9 -0
- package/dist/shared/vue.BVj9lWBK.cjs +111 -0
- package/dist/shared/vue.BY0qpgYr.cjs +35 -0
- package/dist/shared/vue.Bfu1dCKe.mjs +10 -0
- package/dist/shared/vue.Bk5xjlUx.cjs +61 -0
- package/dist/shared/{vue.BtUKvuQw.mjs → vue.BsGwt78R.mjs} +2 -2
- package/dist/shared/{vue.BbX3ePDY.cjs → vue.Bwd1sGAM.cjs} +9 -10
- package/dist/shared/vue.ByxbBC3y.mjs +57 -0
- package/dist/shared/{vue.CPjEwHSg.mjs → vue.C13umiQi.mjs} +20 -8
- package/dist/shared/vue.C5FVoEZT.mjs +99 -0
- package/dist/shared/vue.CATOh_9G.mjs +42 -0
- package/dist/shared/{vue.Bhdhmz8d.cjs → vue.CIs8QhCw.cjs} +18 -74
- package/dist/shared/vue.CMohL_Cz.mjs +58 -0
- package/dist/shared/{vue.CYKT65tB.mjs → vue.CQh3AUE8.mjs} +2 -6
- package/dist/shared/{vue.DzKfcfpX.cjs → vue.CWZSMVnB.cjs} +6 -6
- package/dist/shared/{vue.B12Pt1PQ.mjs → vue.CXB4NEMA.mjs} +18 -74
- package/dist/shared/{vue.DFbay4mm.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.CpkwC8Th.mjs +7 -0
- package/dist/shared/vue.CrkK_T15.cjs +86 -0
- package/dist/shared/vue.D-qi8PSL.cjs +82 -0
- package/dist/shared/{vue.B2AQR2bE.mjs → vue.D218Ow7t.mjs} +8 -4
- package/dist/shared/{vue.QHAHFnw8.mjs → vue.D3Y0PWbF.mjs} +3 -3
- package/dist/shared/vue.D5U1yLG3.mjs +83 -0
- package/dist/shared/{vue.j1vB3h1n.cjs → vue.DAg5wC1G.cjs} +9 -9
- package/dist/shared/vue.DDbVk0Zh.cjs +180 -0
- package/dist/shared/{vue.BE4KHksm.cjs → vue.DE3emjSF.cjs} +2 -7
- 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.G9t8pE0J.cjs → vue.DKyQ7J67.cjs} +1 -1
- package/dist/shared/vue.DNxOpDXz.cjs +12 -0
- 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.B14U1xmP.cjs → vue.Di7yjJ-R.cjs} +20 -8
- package/dist/shared/vue.DtCbCcPd.cjs +173 -0
- package/dist/shared/{vue.CM_uqVc0.mjs → vue.Dyi1OCI1.mjs} +6 -6
- package/dist/shared/{vue.BsD6AAmO.cjs → vue.E_npPFoV.cjs} +8 -8
- package/dist/shared/{vue.LNhX07HB.cjs → vue.FiMmnMHr.cjs} +2 -2
- package/dist/shared/{vue.CSzg70vB.mjs → vue.JUWqu6kD.mjs} +1 -1
- package/dist/shared/{vue.By1CUlOU.mjs → vue.Mxc8w6Qk.mjs} +1 -1
- package/dist/shared/{vue.ByUemLSf.cjs → vue.Sbbm9JSu.cjs} +3 -3
- 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 +7 -5
- package/dist/useAccountInfo.d.cts +12 -8
- package/dist/useAccountInfo.d.mts +12 -8
- package/dist/useAccountInfo.d.ts +12 -8
- package/dist/useAccountInfo.mjs +7 -5
- 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.d.cts +4 -2
- package/dist/useBalance.d.mts +4 -2
- package/dist/useBalance.d.ts +4 -2
- 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 +9 -2
- package/dist/useConnection.d.mts +9 -2
- package/dist/useConnection.d.ts +9 -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 +7 -5
- package/dist/useProgramAccounts.d.cts +24 -9
- package/dist/useProgramAccounts.d.mts +24 -9
- package/dist/useProgramAccounts.d.ts +24 -9
- package/dist/useProgramAccounts.mjs +7 -5
- 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.d.cts +5 -2
- package/dist/useRpc.d.mts +5 -2
- package/dist/useRpc.d.ts +5 -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.d.cts +18 -24
- package/dist/useSignAndSendTransaction.d.mts +18 -24
- package/dist/useSignAndSendTransaction.d.ts +18 -24
- 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.d.cts +9 -5
- package/dist/useSignatureStatus.d.mts +9 -5
- package/dist/useSignatureStatus.d.ts +9 -5
- 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 +7 -6
- package/dist/useTokenAccounts.d.cts +6 -6
- package/dist/useTokenAccounts.d.mts +6 -6
- package/dist/useTokenAccounts.d.ts +6 -6
- package/dist/useTokenAccounts.mjs +7 -6
- package/dist/useTokenBalance.cjs +7 -6
- package/dist/useTokenBalance.d.cts +2 -2
- package/dist/useTokenBalance.d.mts +2 -2
- package/dist/useTokenBalance.d.ts +2 -2
- package/dist/useTokenBalance.mjs +7 -6
- 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 +13 -3
- package/dist/useTransaction.d.mts +13 -3
- package/dist/useTransaction.d.ts +13 -3
- package/dist/useTransaction.mjs +2 -1
- package/dist/useTransactionConfirmation.cjs +5 -4
- package/dist/useTransactionConfirmation.d.cts +18 -24
- package/dist/useTransactionConfirmation.d.mts +18 -24
- package/dist/useTransactionConfirmation.d.ts +18 -24
- package/dist/useTransactionConfirmation.mjs +5 -4
- package/dist/useWallet.cjs +3 -2
- package/dist/useWallet.d.cts +2 -2
- package/dist/useWallet.d.mts +2 -2
- package/dist/useWallet.d.ts +2 -2
- package/dist/useWallet.mjs +3 -2
- package/dist/useWallets.cjs +3 -2
- package/dist/useWallets.mjs +3 -2
- package/package.json +73 -9
- package/dist/shared/vue.C4d2JA8U.mjs +0 -44
- package/dist/shared/vue.CE5i8KZZ.cjs +0 -46
- package/dist/shared/vue.CfrVAzEf.mjs +0 -129
- package/dist/shared/vue.DCgByzxg.cjs +0 -9
- package/dist/shared/vue.DiNn3XHm.mjs +0 -7
- package/dist/shared/vue._CAClzAz.cjs +0 -131
- package/dist/web3.cjs +0 -13
- package/dist/web3.d.cts +0 -1
- package/dist/web3.d.mts +0 -1
- package/dist/web3.d.ts +0 -1
- package/dist/web3.mjs +0 -1
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
|
|
|
@@ -174,6 +182,16 @@ const signatureStatus = useSignatureStatus(signature, {
|
|
|
174
182
|
});
|
|
175
183
|
```
|
|
176
184
|
|
|
185
|
+
Read SPL token accounts and balances through Kit RPC `jsonParsed`:
|
|
186
|
+
|
|
187
|
+
```ts
|
|
188
|
+
import { useTokenAccounts } from "@vue-solana/vue/useTokenAccounts";
|
|
189
|
+
import { useTokenBalance } from "@vue-solana/vue/useTokenBalance";
|
|
190
|
+
|
|
191
|
+
const tokenAccounts = useTokenAccounts(ownerAddress, { commitment: "confirmed" });
|
|
192
|
+
const tokenBalance = useTokenBalance(mintAddress, ownerAddress);
|
|
193
|
+
```
|
|
194
|
+
|
|
177
195
|
`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
196
|
|
|
179
197
|
## Wallet State
|
|
@@ -200,7 +218,7 @@ const { publicKey, connected, connecting, canSignMessage, connect, disconnect }
|
|
|
200
218
|
</button>
|
|
201
219
|
<p>Selected: {{ selectedWallet?.name ?? "None" }}</p>
|
|
202
220
|
<p>Connected: {{ connected }}</p>
|
|
203
|
-
<p>Public key: {{ publicKey
|
|
221
|
+
<p>Public key: {{ publicKey }}</p>
|
|
204
222
|
<p>Can sign messages: {{ canSignMessage }}</p>
|
|
205
223
|
<p v-if="connecting">Connecting...</p>
|
|
206
224
|
<button type="button" :disabled="!selectedWallet || connected || connecting" @click="connect">
|
|
@@ -281,6 +299,91 @@ await confirmation.confirm(signature);
|
|
|
281
299
|
|
|
282
300
|
`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
301
|
|
|
302
|
+
### Live Data
|
|
303
|
+
|
|
304
|
+
`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:
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
import { useSolanaClient } from "@vue-solana/vue/useSolanaClient";
|
|
308
|
+
import { useRequest } from "@vue-solana/vue/useRequest";
|
|
309
|
+
|
|
310
|
+
const { client } = useSolanaClient();
|
|
311
|
+
const { data, error, status, refresh } = useRequest(() => client.rpc.getSlot().send());
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
`useSubscription()` streams live slots from `rpcSubscriptions` reactive stores:
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
import { useSubscription } from "@vue-solana/vue/useSubscription";
|
|
318
|
+
|
|
319
|
+
const subscription = useSubscription(() => client.rpcSubscriptions.slotNotifications());
|
|
320
|
+
subscription.data; // { value: { slot: number } }
|
|
321
|
+
subscription.reconnect();
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
`useTrackedData()` pairs a slot-tracking request with a subscription, reusing a single subscription for concurrent mounts:
|
|
325
|
+
|
|
326
|
+
```ts
|
|
327
|
+
import { useTrackedData } from "@vue-solana/vue/useTrackedData";
|
|
328
|
+
|
|
329
|
+
const balance = useTrackedData({
|
|
330
|
+
rpcRequest: client.rpc.getBalance(address),
|
|
331
|
+
rpcSubscriptionRequest: client.rpcSubscriptions.balanceNotifications(address),
|
|
332
|
+
rpcValueMapper: (response) => response.value,
|
|
333
|
+
});
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
The `swr` adapters seed fresh mounts from the last-known value for the same cache key:
|
|
337
|
+
|
|
338
|
+
```ts
|
|
339
|
+
import { useRequestSwr } from "@vue-solana/vue/swr";
|
|
340
|
+
|
|
341
|
+
const balance = useRequestSwr(["balance", address], () => client.rpc.getBalance(address).send());
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### Sign In With Solana
|
|
345
|
+
|
|
346
|
+
`useSignIn()` triggers the SIWS flow when the connected wallet supports the `solana:signIn` feature:
|
|
347
|
+
|
|
348
|
+
```ts
|
|
349
|
+
import { useSignIn } from "@vue-solana/vue/useSignIn";
|
|
350
|
+
|
|
351
|
+
const { signInResult, status, loading, error, signIn } = useSignIn();
|
|
352
|
+
await signIn(); // { account, signedMessage, signature } — verify server-side
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Selected Wallet Account
|
|
356
|
+
|
|
357
|
+
`useSelectedWalletAccount()` requires a provider. Use the `SelectedWalletAccountProvider` component (or Nuxt's app-wide context) and read the shared selection anywhere in its subtree:
|
|
358
|
+
|
|
359
|
+
```vue
|
|
360
|
+
<script setup lang="ts">
|
|
361
|
+
import { SelectedWalletAccountProvider } from "@vue-solana/vue";
|
|
362
|
+
import { useSelectedWalletAccount } from "@vue-solana/vue/useSelectedWalletAccount";
|
|
363
|
+
|
|
364
|
+
const [selectedAccount, setSelectedAccount] = useSelectedWalletAccount();
|
|
365
|
+
</script>
|
|
366
|
+
|
|
367
|
+
<template>
|
|
368
|
+
<SelectedWalletAccountProvider>
|
|
369
|
+
<span>Active account: {{ selectedAccount?.address }}</span>
|
|
370
|
+
</SelectedWalletAccountProvider>
|
|
371
|
+
</template>
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Batch Transactions
|
|
375
|
+
|
|
376
|
+
`useSignTransactions()` and `useSignAndSendTransactions()` batch wallet requests and fall back to singular calls when the wallet only supports one at a time:
|
|
377
|
+
|
|
378
|
+
```ts
|
|
379
|
+
import { useSignAndSendTransactions } from "@vue-solana/vue/useSignAndSendTransactions";
|
|
380
|
+
|
|
381
|
+
const { signatures, status, loading, error, execute } = useSignAndSendTransactions();
|
|
382
|
+
await execute([transactionOne, transactionTwo]); // signatures: string[]
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
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.
|
|
386
|
+
|
|
284
387
|
## Example App
|
|
285
388
|
|
|
286
389
|
This README includes small snippets for quick reference. For a complete runnable Vue + Vite flow, see the example app:
|
|
@@ -305,27 +408,47 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
305
408
|
|
|
306
409
|
## API
|
|
307
410
|
|
|
308
|
-
| API
|
|
309
|
-
|
|
|
310
|
-
| `createSolanaPlugin(options?)`
|
|
311
|
-
| `VueSolana`
|
|
312
|
-
| `useSolana()`
|
|
313
|
-
| `useRpc()`
|
|
314
|
-
| `
|
|
315
|
-
| `
|
|
316
|
-
| `
|
|
317
|
-
| `
|
|
318
|
-
| `
|
|
319
|
-
| `
|
|
320
|
-
| `
|
|
321
|
-
| `
|
|
322
|
-
| `
|
|
323
|
-
| `
|
|
324
|
-
| `
|
|
411
|
+
| API | Description |
|
|
412
|
+
| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
|
|
413
|
+
| `createSolanaPlugin(options?)` | Installs the Vue Solana context. |
|
|
414
|
+
| `VueSolana` | Alias for `createSolanaPlugin`. |
|
|
415
|
+
| `useSolana()` | Returns the full injected Solana context. |
|
|
416
|
+
| `useRpc()` | Returns cluster, endpoint, connection status, latest blockhash, the Kit `client`, and `checkConnection()`. |
|
|
417
|
+
| `useSolanaClient()` | Returns the injected Kit client as `{ client, rpc }`. The recommended RPC path. |
|
|
418
|
+
| `useConnection()` | Returns the Kit `client`. Deprecated in favor of `useSolanaClient()`. |
|
|
419
|
+
| `useWallet()` | Returns wallet refs, computed connection state, and wallet actions. |
|
|
420
|
+
| `useWallets()` | Returns discovered browser extension wallets, Android MWA wallets, iOS browser wallet links, and wallet selection actions. |
|
|
421
|
+
| `useSignMessage()` | Signs arbitrary message bytes through the connected wallet when message signing is supported. |
|
|
422
|
+
| `useBalance(address, commitment?)` | Loads lamport balance for an address string. |
|
|
423
|
+
| `useAccountInfo(address, options?)` | Loads normalized account info (executable, lamports, owner, space, data bytes). |
|
|
424
|
+
| `useProgramAccounts(programId, config?)` | Loads accounts owned by a program with optional filters, commitment, and `dataSlice`. |
|
|
425
|
+
| `useTransaction(handler, options?)` | Generic async transaction state helper with optional timeout settings. |
|
|
426
|
+
| `useTransactionConfirmation(options?)` | Confirms a submitted signature with reactive status and timeout/error state. |
|
|
427
|
+
| `useSignatureStatus(signature, options?)` | Reads a transaction signature status with optional polling. |
|
|
428
|
+
| `useSignAndSendTransaction()` | Signs and sends a transaction through the configured wallet, with optional confirmation waiting. |
|
|
429
|
+
| `useTokenAccounts(owner, options?)` | Reads SPL token accounts for an owner. |
|
|
430
|
+
| `useTokenBalance(mint, owner, commitment?)` | Reads the token balance for a mint/owner pair. |
|
|
431
|
+
| `useAction(handler, options?)` | Generic async action state machine; each dispatch aborts the prior in-flight call. |
|
|
432
|
+
| `useRequest(source, options?)` | One-shot Kit request that re-fires when its source changes, preserving the previous `data` while revalidating. |
|
|
433
|
+
| `useSubscription(source, options?)` | Live data over a Kit reactive stream store (e.g. RPC subscriptions), torn down on unmount. |
|
|
434
|
+
| `useTrackedData(source, options?)` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
|
|
435
|
+
| `useRequestSwr(key, ...)` / `useSubscriptionSwr(key, ...)` / `useTrackedDataSwr(key, ...)` | Cache-keyed SWR adapters seeding fresh mounts from the last-known result. |
|
|
436
|
+
| `clearSwrCache()` | Clears every cached SWR entry. |
|
|
437
|
+
| `useSignIn(input?)` | Sign In With Solana (SIWS) trigger returning `{ account, signedMessage, signature }` for server-side verification. |
|
|
438
|
+
| `useSelectedWalletAccount()` | App-wide selected wallet account context: `[selectedAccount, setSelectedAccount, filteredWallets]`. |
|
|
439
|
+
| `SelectedWalletAccountProvider` | Component that provides the selected wallet account context to its subtree. |
|
|
440
|
+
| `useSignTransactions()` | Batch-signs transactions through the wallet, preferring `signTransactions` and falling back to `signAllTransactions`. |
|
|
441
|
+
| `useSignAndSendTransactions()` | Signs and sends multiple transactions, returning one signature each, with a singular sequential fallback. |
|
|
442
|
+
| `useClientCapability(capability, options?)` | Fails fast with a clear error when the configured Solana client lacks a requested capability. |
|
|
443
|
+
| `usePayer()` | Reactive Kit client `payer` signer ref (requires a signer plugin on the client). |
|
|
444
|
+
| `useIdentity()` | Reactive Kit client `identity` signer ref (requires a signer plugin on the client). |
|
|
445
|
+
| `usePlanTransaction()` | Plans a single transaction message from instruction inputs without signing or sending. |
|
|
446
|
+
| `usePlanTransactions()` | Plans a batch of transaction messages from instruction inputs. |
|
|
325
447
|
|
|
326
448
|
Direct composable subpaths:
|
|
327
449
|
|
|
328
450
|
- `@vue-solana/vue/useSolana`
|
|
451
|
+
- `@vue-solana/vue/useSolanaClient`
|
|
329
452
|
- `@vue-solana/vue/useRpc`
|
|
330
453
|
- `@vue-solana/vue/useConnection`
|
|
331
454
|
- `@vue-solana/vue/useAccountInfo`
|
|
@@ -338,10 +461,26 @@ Direct composable subpaths:
|
|
|
338
461
|
- `@vue-solana/vue/useTransactionConfirmation`
|
|
339
462
|
- `@vue-solana/vue/useSignatureStatus`
|
|
340
463
|
- `@vue-solana/vue/useSignAndSendTransaction`
|
|
464
|
+
- `@vue-solana/vue/useTokenAccounts`
|
|
465
|
+
- `@vue-solana/vue/useTokenBalance`
|
|
466
|
+
- `@vue-solana/vue/useAction`
|
|
467
|
+
- `@vue-solana/vue/useRequest`
|
|
468
|
+
- `@vue-solana/vue/useSubscription`
|
|
469
|
+
- `@vue-solana/vue/useTrackedData`
|
|
470
|
+
- `@vue-solana/vue/useSignIn`
|
|
471
|
+
- `@vue-solana/vue/useSelectedWalletAccount`
|
|
472
|
+
- `@vue-solana/vue/useSignTransactions`
|
|
473
|
+
- `@vue-solana/vue/useSignAndSendTransactions`
|
|
474
|
+
- `@vue-solana/vue/useClientCapability`
|
|
475
|
+
- `@vue-solana/vue/usePayer`
|
|
476
|
+
- `@vue-solana/vue/useIdentity`
|
|
477
|
+
- `@vue-solana/vue/usePlanTransaction`
|
|
478
|
+
- `@vue-solana/vue/usePlanTransactions`
|
|
341
479
|
|
|
342
480
|
Other direct subpaths:
|
|
343
481
|
|
|
344
|
-
- `@vue-solana/vue/
|
|
482
|
+
- `@vue-solana/vue/swr`
|
|
483
|
+
- `@vue-solana/vue/kit`
|
|
345
484
|
- `@vue-solana/vue/buffer-polyfill`
|
|
346
485
|
|
|
347
486
|
## Caveats
|
|
@@ -350,9 +489,9 @@ Other direct subpaths:
|
|
|
350
489
|
- Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
|
|
351
490
|
- Broad `useProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
|
|
352
491
|
- Use `mainnet-beta` for Solana mainnet. `mainnet` is intentionally not accepted as a cluster alias.
|
|
353
|
-
- `@solana/web3-compat
|
|
492
|
+
- v2.0.0 removed `@solana/web3-compat` and the `web3` subpaths. Build transaction messages with `@solana/kit` and pass raw `Uint8Array` wire bytes to wallet flows. See the [Kit Migration guide](https://vue-solana-docs.vercel.app/guides/kit-migration) for migrating from v1.
|
|
354
493
|
- Desktop native app wallets are planned but not implemented yet.
|
|
355
494
|
|
|
356
495
|
## Status
|
|
357
496
|
|
|
358
|
-
This package provides RPC, balance, browser extension wallet, Android mobile wallet, iOS browser wallet, message signing, and transaction composables.
|
|
497
|
+
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,33 @@
|
|
|
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 useBalance = require('./shared/vue.E_npPFoV.cjs');
|
|
6
|
+
const useClientCapability = require('./shared/vue.BY0qpgYr.cjs');
|
|
7
|
+
const useConnection = require('./shared/vue.BVaMoz9y.cjs');
|
|
8
|
+
const usePlanTransaction = require('./shared/vue.B4-LEdSE.cjs');
|
|
9
|
+
const useProgramAccounts = require('./shared/vue.Di7yjJ-R.cjs');
|
|
10
|
+
const usePayer = require('./shared/vue.g8fnm_ca.cjs');
|
|
11
|
+
const useRequest = require('./shared/vue.B8pLQ8P4.cjs');
|
|
12
|
+
const useRpc = require('./shared/vue.FiMmnMHr.cjs');
|
|
13
|
+
const SelectedWalletAccountProvider = require('./shared/vue.DDbVk0Zh.cjs');
|
|
14
|
+
const useSignMessage = require('./shared/vue.B6ainw2G.cjs');
|
|
15
|
+
const useSignAndSendTransaction = require('./shared/vue.CWZSMVnB.cjs');
|
|
16
|
+
const useSignTransactions = require('./shared/vue.DFaMJLAQ.cjs');
|
|
17
|
+
const useSignAndSendTransactions = require('./shared/vue.CrkK_T15.cjs');
|
|
18
|
+
const useSignatureStatus = require('./shared/vue.CIs8QhCw.cjs');
|
|
19
|
+
const useSignIn = require('./shared/vue.9TPxZPMf.cjs');
|
|
20
|
+
const useSolana = require('./shared/vue.DE3emjSF.cjs');
|
|
21
|
+
const useSolanaClient = require('./shared/vue.BIxphCAq.cjs');
|
|
22
|
+
const useSubscription = require('./shared/vue.BVj9lWBK.cjs');
|
|
23
|
+
const useTokenAccounts = require('./shared/vue.Bwd1sGAM.cjs');
|
|
24
|
+
const useTokenBalance = require('./shared/vue.DAg5wC1G.cjs');
|
|
25
|
+
const useTrackedData = require('./shared/vue.DtCbCcPd.cjs');
|
|
26
|
+
const useTransaction = require('./shared/vue.Bk5xjlUx.cjs');
|
|
27
|
+
const useTransactionConfirmation = require('./shared/vue.Sbbm9JSu.cjs');
|
|
28
|
+
const useWallet = require('./shared/vue.BGxz4dru.cjs');
|
|
29
|
+
const useWallets = require('./shared/vue.DKyQ7J67.cjs');
|
|
30
|
+
const injection = require('./shared/vue.DEHxNvUX.cjs');
|
|
19
31
|
const kit = require('@vue-solana/core/kit');
|
|
20
32
|
const errors = require('@vue-solana/core/errors');
|
|
21
33
|
const rpc = require('@vue-solana/core/rpc');
|
|
@@ -24,6 +36,8 @@ const walletStandard = require('@vue-solana/core/wallet-standard');
|
|
|
24
36
|
const vue = require('vue');
|
|
25
37
|
const iosWallet = require('@vue-solana/core/ios-wallet');
|
|
26
38
|
require('@vue-solana/core/address');
|
|
39
|
+
require('./shared/vue.DNxOpDXz.cjs');
|
|
40
|
+
require('@vue-solana/core/action');
|
|
27
41
|
require('@vue-solana/core/wallet');
|
|
28
42
|
require('@vue-solana/core/transaction');
|
|
29
43
|
require('bs58');
|
|
@@ -154,7 +168,10 @@ function createSolanaWalletRegistry(options) {
|
|
|
154
168
|
signMessage: adaptedWallet.signMessage?.bind(adaptedWallet),
|
|
155
169
|
signTransaction: adaptedWallet.signTransaction?.bind(adaptedWallet),
|
|
156
170
|
signAllTransactions: adaptedWallet.signAllTransactions?.bind(adaptedWallet),
|
|
157
|
-
signAndSendTransaction: adaptedWallet.signAndSendTransaction?.bind(adaptedWallet)
|
|
171
|
+
signAndSendTransaction: adaptedWallet.signAndSendTransaction?.bind(adaptedWallet),
|
|
172
|
+
signIn: adaptedWallet.signIn?.bind(adaptedWallet),
|
|
173
|
+
signTransactions: adaptedWallet.signTransactions?.bind(adaptedWallet),
|
|
174
|
+
signAndSendTransactions: adaptedWallet.signAndSendTransactions?.bind(adaptedWallet)
|
|
158
175
|
};
|
|
159
176
|
adaptedWallets.set(walletInfo.wallet, cachedAdapter);
|
|
160
177
|
return cachedAdapter;
|
|
@@ -198,7 +215,8 @@ function isObject(value) {
|
|
|
198
215
|
|
|
199
216
|
const RPC_CHECK_TIMEOUT_MS = 1e4;
|
|
200
217
|
function createSolanaPlugin(options = {}) {
|
|
201
|
-
|
|
218
|
+
const plugin = {
|
|
219
|
+
context: null,
|
|
202
220
|
install(app) {
|
|
203
221
|
const context = rpc.createSolanaContext(options);
|
|
204
222
|
const wallet = vue.shallowRef(options.wallet ?? null);
|
|
@@ -227,13 +245,14 @@ function createSolanaPlugin(options = {}) {
|
|
|
227
245
|
wsEndpoint: context.wsEndpoint
|
|
228
246
|
});
|
|
229
247
|
try {
|
|
230
|
-
const
|
|
231
|
-
context.
|
|
248
|
+
const response = await timeout.withTimeout(
|
|
249
|
+
context.client.rpc.getLatestBlockhash().send(),
|
|
232
250
|
RPC_CHECK_TIMEOUT_MS,
|
|
233
251
|
() => new Error(
|
|
234
252
|
`RPC connection check timed out after ${RPC_CHECK_TIMEOUT_MS / 1e3} seconds.`
|
|
235
253
|
)
|
|
236
254
|
);
|
|
255
|
+
const blockhash = response.value;
|
|
237
256
|
if (checkId !== rpcCheckId) {
|
|
238
257
|
return;
|
|
239
258
|
}
|
|
@@ -344,7 +363,8 @@ function createSolanaPlugin(options = {}) {
|
|
|
344
363
|
}
|
|
345
364
|
}
|
|
346
365
|
};
|
|
347
|
-
app.provide(
|
|
366
|
+
app.provide(injection.solanaInjectionKey, vueContext);
|
|
367
|
+
plugin.context = vueContext;
|
|
348
368
|
if (typeof window !== "undefined") {
|
|
349
369
|
window.setTimeout(() => {
|
|
350
370
|
try {
|
|
@@ -357,6 +377,7 @@ function createSolanaPlugin(options = {}) {
|
|
|
357
377
|
}
|
|
358
378
|
}
|
|
359
379
|
};
|
|
380
|
+
return plugin;
|
|
360
381
|
}
|
|
361
382
|
function isSameWallet(wallet, selectedWallet) {
|
|
362
383
|
return wallet.name === selectedWallet?.name && wallet.source === selectedWallet.source && wallet.platform === selectedWallet.platform;
|
|
@@ -364,24 +385,43 @@ function isSameWallet(wallet, selectedWallet) {
|
|
|
364
385
|
const VueSolana = createSolanaPlugin;
|
|
365
386
|
|
|
366
387
|
exports.useAccountInfo = useAccountInfo.useAccountInfo;
|
|
388
|
+
exports.useAction = useAction.useAction;
|
|
367
389
|
exports.useBalance = useBalance.useBalance;
|
|
390
|
+
exports.MissingClientCapabilityError = useClientCapability.MissingClientCapabilityError;
|
|
391
|
+
exports.useClientCapability = useClientCapability.useClientCapability;
|
|
368
392
|
exports.useConnection = useConnection.useConnection;
|
|
393
|
+
exports.usePlanTransaction = usePlanTransaction.usePlanTransaction;
|
|
394
|
+
exports.usePlanTransactions = usePlanTransaction.usePlanTransactions;
|
|
369
395
|
exports.useProgramAccounts = useProgramAccounts.useProgramAccounts;
|
|
396
|
+
exports.useIdentity = usePayer.useIdentity;
|
|
397
|
+
exports.usePayer = usePayer.usePayer;
|
|
398
|
+
exports.useRequest = useRequest.useRequest;
|
|
370
399
|
exports.useRpc = useRpc.useRpc;
|
|
400
|
+
exports.SelectedWalletAccountProvider = SelectedWalletAccountProvider.SelectedWalletAccountProvider;
|
|
401
|
+
exports.createSelectedWalletAccountContext = SelectedWalletAccountProvider.createSelectedWalletAccountContext;
|
|
402
|
+
exports.provideSelectedWalletAccount = SelectedWalletAccountProvider.provideSelectedWalletAccount;
|
|
403
|
+
exports.selectedWalletAccountInjectionKey = SelectedWalletAccountProvider.selectedWalletAccountInjectionKey;
|
|
404
|
+
exports.useSelectedWalletAccount = SelectedWalletAccountProvider.useSelectedWalletAccount;
|
|
371
405
|
exports.useSignMessage = useSignMessage.useSignMessage;
|
|
372
406
|
exports.useSignAndSendTransaction = useSignAndSendTransaction.useSignAndSendTransaction;
|
|
407
|
+
exports.useSignTransactions = useSignTransactions.useSignTransactions;
|
|
408
|
+
exports.PartialSignAndSendError = useSignAndSendTransactions.PartialSignAndSendError;
|
|
409
|
+
exports.useSignAndSendTransactions = useSignAndSendTransactions.useSignAndSendTransactions;
|
|
373
410
|
exports.useSignatureStatus = useSignatureStatus.useSignatureStatus;
|
|
374
|
-
exports.
|
|
411
|
+
exports.useSignIn = useSignIn.useSignIn;
|
|
375
412
|
exports.tryUseSolana = useSolana.tryUseSolana;
|
|
376
413
|
exports.useSolana = useSolana.useSolana;
|
|
377
414
|
exports.useSolanaClient = useSolanaClient.useSolanaClient;
|
|
415
|
+
exports.useSubscription = useSubscription.useSubscription;
|
|
378
416
|
exports.useTokenAccounts = useTokenAccounts.useTokenAccounts;
|
|
379
417
|
exports.useTokenBalance = useTokenBalance.useTokenBalance;
|
|
418
|
+
exports.useTrackedData = useTrackedData.useTrackedData;
|
|
380
419
|
exports.useTransaction = useTransaction.useTransaction;
|
|
381
420
|
exports.getConfirmedTransactionStatus = useTransactionConfirmation.getConfirmedTransactionStatus;
|
|
382
421
|
exports.useTransactionConfirmation = useTransactionConfirmation.useTransactionConfirmation;
|
|
383
422
|
exports.useWallet = useWallet.useWallet;
|
|
384
423
|
exports.useWallets = useWallets.useWallets;
|
|
424
|
+
exports.solanaInjectionKey = injection.solanaInjectionKey;
|
|
385
425
|
exports.address = kit.address;
|
|
386
426
|
exports.createSolanaClient = kit.createSolanaClient;
|
|
387
427
|
exports.lamports = kit.lamports;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,31 +1,39 @@
|
|
|
1
|
-
export { UseAccountInfoOptions, useAccountInfo } from './useAccountInfo.cjs';
|
|
2
|
-
export {
|
|
1
|
+
export { AccountInfo, UseAccountInfoOptions, useAccountInfo } from './useAccountInfo.cjs';
|
|
2
|
+
export { UseActionOptions, UseActionReturn, UseActionStatus, useAction } from './useAction.cjs';
|
|
3
|
+
export { BalanceInput, useBalance } from './useBalance.cjs';
|
|
4
|
+
export { MissingClientCapabilityError, UseClientCapabilityOptions, useClientCapability } from './useClientCapability.cjs';
|
|
3
5
|
export { useConnection } from './useConnection.cjs';
|
|
6
|
+
export { PlanTransactionConfig, PlanTransactionStatus, usePlanTransaction, usePlanTransactions } from './usePlanTransaction.cjs';
|
|
4
7
|
export { ProgramAccount, ProgramAccountDataSizeFilter, ProgramAccountDataSlice, ProgramAccountFilter, ProgramAccountMemcmpEncoding, ProgramAccountMemcmpFilter, UseProgramAccountsOptions, useProgramAccounts } from './useProgramAccounts.cjs';
|
|
8
|
+
export { useIdentity, usePayer } from './usePayer.cjs';
|
|
9
|
+
export { UseRequestOptions, UseRequestReturn, UseRequestSource, UseRequestStatus, useRequest } from './useRequest.cjs';
|
|
5
10
|
export { useRpc } from './useRpc.cjs';
|
|
11
|
+
export { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, SelectedWalletAccountProvider, WalletAccountFilter, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount } from './useSelectedWalletAccount.cjs';
|
|
6
12
|
export { SignMessageStatus, useSignMessage } from './useSignMessage.cjs';
|
|
7
13
|
export { SignAndSendTransactionOptions, SignAndSendTransactionStatus, useSignAndSendTransaction } from './useSignAndSendTransaction.cjs';
|
|
8
|
-
export {
|
|
14
|
+
export { SignTransactionsStatus, useSignTransactions } from './useSignTransactions.cjs';
|
|
15
|
+
export { PartialSignAndSendError, SignAndSendTransactionsStatus, useSignAndSendTransactions } from './useSignAndSendTransactions.cjs';
|
|
16
|
+
export { SignatureStatus, UseSignatureStatusOptions, useSignatureStatus } from './useSignatureStatus.cjs';
|
|
17
|
+
export { SignInStatus, useSignIn } from './useSignIn.cjs';
|
|
9
18
|
export { tryUseSolana, useSolana } from './useSolana.cjs';
|
|
10
19
|
export { useSolanaClient } from './useSolanaClient.cjs';
|
|
20
|
+
export { UseSubscriptionOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus, useSubscription } from './useSubscription.cjs';
|
|
11
21
|
export { UseTokenAccountsOptions, useTokenAccounts } from './useTokenAccounts.cjs';
|
|
12
22
|
export { useTokenBalance } from './useTokenBalance.cjs';
|
|
23
|
+
export { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource, useTrackedData } from './useTrackedData.cjs';
|
|
13
24
|
export { UseTransactionOptions, useTransaction } from './useTransaction.cjs';
|
|
14
25
|
export { TransactionConfirmationStatus, getConfirmedTransactionStatus, useTransactionConfirmation } from './useTransactionConfirmation.cjs';
|
|
15
26
|
export { useWallet } from './useWallet.cjs';
|
|
16
27
|
export { useWallets } from './useWallets.cjs';
|
|
17
|
-
|
|
18
|
-
export {
|
|
28
|
+
import { V as VueSolanaContext } from './shared/vue.DL3z5PxP.cjs';
|
|
29
|
+
export { S as SolanaConnectionStatus, s as solanaInjectionKey } from './shared/vue.DL3z5PxP.cjs';
|
|
30
|
+
export { Address, Commitment, Lamports, Rpc, Signature, SolanaClient, SolanaRpcApi, address, createSolanaClient, lamports } from '@vue-solana/core/kit';
|
|
19
31
|
import { GetSolanaIosWalletsOptions } from '@vue-solana/core/ios-wallet';
|
|
20
32
|
import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-wallet';
|
|
21
33
|
import { SolanaConfig, SolanaWallet } from '@vue-solana/core/types';
|
|
22
34
|
import { App } from 'vue';
|
|
23
|
-
import '@vue-solana/core/address';
|
|
24
35
|
import '@vue-solana/core/errors';
|
|
25
|
-
import '@vue-solana/core/web3';
|
|
26
|
-
import '@solana/web3-compat';
|
|
27
36
|
import '@solana/kit';
|
|
28
|
-
import '@vue-solana/core/spl-token';
|
|
29
37
|
import '@vue-solana/core/token-accounts';
|
|
30
38
|
|
|
31
39
|
interface VueSolanaPluginOptions extends SolanaConfig {
|
|
@@ -33,10 +41,18 @@ interface VueSolanaPluginOptions extends SolanaConfig {
|
|
|
33
41
|
mobileWallet?: false | RegisterSolanaMobileWalletOptions;
|
|
34
42
|
iosWallet?: false | GetSolanaIosWalletsOptions;
|
|
35
43
|
}
|
|
36
|
-
|
|
44
|
+
interface VueSolanaPlugin {
|
|
45
|
+
/** Installs the plugin on a Vue app (called synchronously by `app.use`). */
|
|
37
46
|
install(app: App): void;
|
|
38
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The app context built by `install`, available once `app.use(plugin)` has
|
|
49
|
+
* run. Lets framework integrations (e.g. the Nuxt module) hand the live
|
|
50
|
+
* context to consumers that run outside a component setup.
|
|
51
|
+
*/
|
|
52
|
+
context: VueSolanaContext | null;
|
|
53
|
+
}
|
|
54
|
+
declare function createSolanaPlugin(options?: VueSolanaPluginOptions): VueSolanaPlugin;
|
|
39
55
|
declare const VueSolana: typeof createSolanaPlugin;
|
|
40
56
|
|
|
41
|
-
export { VueSolana, createSolanaPlugin };
|
|
42
|
-
export type { VueSolanaPluginOptions };
|
|
57
|
+
export { VueSolana, VueSolanaContext, createSolanaPlugin };
|
|
58
|
+
export type { VueSolanaPlugin, VueSolanaPluginOptions };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,31 +1,39 @@
|
|
|
1
|
-
export { UseAccountInfoOptions, useAccountInfo } from './useAccountInfo.mjs';
|
|
2
|
-
export {
|
|
1
|
+
export { AccountInfo, UseAccountInfoOptions, useAccountInfo } from './useAccountInfo.mjs';
|
|
2
|
+
export { UseActionOptions, UseActionReturn, UseActionStatus, useAction } from './useAction.mjs';
|
|
3
|
+
export { BalanceInput, useBalance } from './useBalance.mjs';
|
|
4
|
+
export { MissingClientCapabilityError, UseClientCapabilityOptions, useClientCapability } from './useClientCapability.mjs';
|
|
3
5
|
export { useConnection } from './useConnection.mjs';
|
|
6
|
+
export { PlanTransactionConfig, PlanTransactionStatus, usePlanTransaction, usePlanTransactions } from './usePlanTransaction.mjs';
|
|
4
7
|
export { ProgramAccount, ProgramAccountDataSizeFilter, ProgramAccountDataSlice, ProgramAccountFilter, ProgramAccountMemcmpEncoding, ProgramAccountMemcmpFilter, UseProgramAccountsOptions, useProgramAccounts } from './useProgramAccounts.mjs';
|
|
8
|
+
export { useIdentity, usePayer } from './usePayer.mjs';
|
|
9
|
+
export { UseRequestOptions, UseRequestReturn, UseRequestSource, UseRequestStatus, useRequest } from './useRequest.mjs';
|
|
5
10
|
export { useRpc } from './useRpc.mjs';
|
|
11
|
+
export { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, SelectedWalletAccountProvider, WalletAccountFilter, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount } from './useSelectedWalletAccount.mjs';
|
|
6
12
|
export { SignMessageStatus, useSignMessage } from './useSignMessage.mjs';
|
|
7
13
|
export { SignAndSendTransactionOptions, SignAndSendTransactionStatus, useSignAndSendTransaction } from './useSignAndSendTransaction.mjs';
|
|
8
|
-
export {
|
|
14
|
+
export { SignTransactionsStatus, useSignTransactions } from './useSignTransactions.mjs';
|
|
15
|
+
export { PartialSignAndSendError, SignAndSendTransactionsStatus, useSignAndSendTransactions } from './useSignAndSendTransactions.mjs';
|
|
16
|
+
export { SignatureStatus, UseSignatureStatusOptions, useSignatureStatus } from './useSignatureStatus.mjs';
|
|
17
|
+
export { SignInStatus, useSignIn } from './useSignIn.mjs';
|
|
9
18
|
export { tryUseSolana, useSolana } from './useSolana.mjs';
|
|
10
19
|
export { useSolanaClient } from './useSolanaClient.mjs';
|
|
20
|
+
export { UseSubscriptionOptions, UseSubscriptionReturn, UseSubscriptionSource, UseSubscriptionStatus, useSubscription } from './useSubscription.mjs';
|
|
11
21
|
export { UseTokenAccountsOptions, useTokenAccounts } from './useTokenAccounts.mjs';
|
|
12
22
|
export { useTokenBalance } from './useTokenBalance.mjs';
|
|
23
|
+
export { UseTrackedDataInitialSource, UseTrackedDataOptions, UseTrackedDataReturn, UseTrackedDataSource, UseTrackedDataStatus, UseTrackedDataStreamSource, useTrackedData } from './useTrackedData.mjs';
|
|
13
24
|
export { UseTransactionOptions, useTransaction } from './useTransaction.mjs';
|
|
14
25
|
export { TransactionConfirmationStatus, getConfirmedTransactionStatus, useTransactionConfirmation } from './useTransactionConfirmation.mjs';
|
|
15
26
|
export { useWallet } from './useWallet.mjs';
|
|
16
27
|
export { useWallets } from './useWallets.mjs';
|
|
17
|
-
|
|
18
|
-
export {
|
|
28
|
+
import { V as VueSolanaContext } from './shared/vue.DL3z5PxP.mjs';
|
|
29
|
+
export { S as SolanaConnectionStatus, s as solanaInjectionKey } from './shared/vue.DL3z5PxP.mjs';
|
|
30
|
+
export { Address, Commitment, Lamports, Rpc, Signature, SolanaClient, SolanaRpcApi, address, createSolanaClient, lamports } from '@vue-solana/core/kit';
|
|
19
31
|
import { GetSolanaIosWalletsOptions } from '@vue-solana/core/ios-wallet';
|
|
20
32
|
import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-wallet';
|
|
21
33
|
import { SolanaConfig, SolanaWallet } from '@vue-solana/core/types';
|
|
22
34
|
import { App } from 'vue';
|
|
23
|
-
import '@vue-solana/core/address';
|
|
24
35
|
import '@vue-solana/core/errors';
|
|
25
|
-
import '@vue-solana/core/web3';
|
|
26
|
-
import '@solana/web3-compat';
|
|
27
36
|
import '@solana/kit';
|
|
28
|
-
import '@vue-solana/core/spl-token';
|
|
29
37
|
import '@vue-solana/core/token-accounts';
|
|
30
38
|
|
|
31
39
|
interface VueSolanaPluginOptions extends SolanaConfig {
|
|
@@ -33,10 +41,18 @@ interface VueSolanaPluginOptions extends SolanaConfig {
|
|
|
33
41
|
mobileWallet?: false | RegisterSolanaMobileWalletOptions;
|
|
34
42
|
iosWallet?: false | GetSolanaIosWalletsOptions;
|
|
35
43
|
}
|
|
36
|
-
|
|
44
|
+
interface VueSolanaPlugin {
|
|
45
|
+
/** Installs the plugin on a Vue app (called synchronously by `app.use`). */
|
|
37
46
|
install(app: App): void;
|
|
38
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The app context built by `install`, available once `app.use(plugin)` has
|
|
49
|
+
* run. Lets framework integrations (e.g. the Nuxt module) hand the live
|
|
50
|
+
* context to consumers that run outside a component setup.
|
|
51
|
+
*/
|
|
52
|
+
context: VueSolanaContext | null;
|
|
53
|
+
}
|
|
54
|
+
declare function createSolanaPlugin(options?: VueSolanaPluginOptions): VueSolanaPlugin;
|
|
39
55
|
declare const VueSolana: typeof createSolanaPlugin;
|
|
40
56
|
|
|
41
|
-
export { VueSolana, createSolanaPlugin };
|
|
42
|
-
export type { VueSolanaPluginOptions };
|
|
57
|
+
export { VueSolana, VueSolanaContext, createSolanaPlugin };
|
|
58
|
+
export type { VueSolanaPlugin, VueSolanaPluginOptions };
|