@vue-solana/vue 2.2.0 → 2.4.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 +190 -57
- package/dist/index.cjs +7 -4
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +5 -4
- package/dist/shared/{vue.BY0qpgYr.cjs → vue.4C5kX4fE.cjs} +2 -1
- package/dist/shared/{vue.CATOh_9G.mjs → vue.B-xtuLtD.mjs} +1 -1
- package/dist/shared/{vue.CTqPbvz3.cjs → vue.B4eMoJT2.cjs} +2 -2
- package/dist/shared/{vue.B8LptjZP.mjs → vue.B9uRpSDJ.mjs} +2 -1
- package/dist/shared/{vue.C5FVoEZT.mjs → vue.Co5rj-I6.mjs} +27 -8
- package/dist/shared/vue.DAthhH4D.mjs +118 -0
- package/dist/shared/{vue.BSfiHqwj.mjs → vue.DDQxNX5q.mjs} +2 -2
- package/dist/shared/vue.DKoM8jIV.cjs +121 -0
- package/dist/shared/{vue.B4-LEdSE.cjs → vue.Dn3KLJZH.cjs} +26 -7
- package/dist/shared/{vue.g8fnm_ca.cjs → vue.ldvmk9NM.cjs} +1 -1
- package/dist/useAirdrop.cjs +2 -2
- package/dist/useAirdrop.d.cts +4 -2
- package/dist/useAirdrop.d.mts +4 -2
- package/dist/useAirdrop.d.ts +4 -2
- package/dist/useAirdrop.mjs +2 -2
- package/dist/useClientCapability.cjs +1 -1
- package/dist/useClientCapability.mjs +1 -1
- package/dist/useConnection.d.cts +35 -2
- package/dist/useConnection.d.mts +35 -2
- package/dist/useConnection.d.ts +35 -2
- package/dist/useIdentity.cjs +2 -2
- package/dist/useIdentity.mjs +2 -2
- package/dist/usePayer.cjs +2 -2
- package/dist/usePayer.mjs +2 -2
- package/dist/usePlanTransaction.cjs +2 -2
- package/dist/usePlanTransaction.d.cts +9 -1
- package/dist/usePlanTransaction.d.mts +9 -1
- package/dist/usePlanTransaction.d.ts +9 -1
- package/dist/usePlanTransaction.mjs +2 -2
- package/dist/usePlanTransactions.cjs +2 -2
- package/dist/usePlanTransactions.mjs +2 -2
- package/dist/useRpc.d.cts +35 -2
- package/dist/useRpc.d.mts +35 -2
- package/dist/useRpc.d.ts +35 -2
- package/dist/useSendTransaction.cjs +14 -0
- package/dist/useSendTransaction.d.cts +51 -0
- package/dist/useSendTransaction.d.mts +51 -0
- package/dist/useSendTransaction.d.ts +51 -0
- package/dist/useSendTransaction.mjs +7 -0
- package/dist/useSendTransactions.cjs +13 -0
- package/dist/useSendTransactions.d.cts +4 -0
- package/dist/useSendTransactions.d.mts +4 -0
- package/dist/useSendTransactions.d.ts +4 -0
- package/dist/useSendTransactions.mjs +7 -0
- package/dist/useSolanaClient.d.cts +35 -2
- package/dist/useSolanaClient.d.mts +35 -2
- package/dist/useSolanaClient.d.ts +35 -2
- package/package.json +12 -2
package/README.md
CHANGED
|
@@ -33,16 +33,17 @@ New to Solana? Start with the official docs and the project concepts guide:
|
|
|
33
33
|
- Live data composables over Kit reactive stores (`useRequest`, `useSubscription`, `useTrackedData`) plus SWR cache adapters.
|
|
34
34
|
- A generic async action state machine (`useAction`) built on `@vue-solana/core/action`.
|
|
35
35
|
- Reactive Kit client signers (`usePayer`, `useIdentity`) and transaction planning (`usePlanTransaction`, `usePlanTransactions`) with fail-fast client capability assertions.
|
|
36
|
+
- Client-sent transactions through the official Kit planner and RPC plan-sending executor installed by the default client.
|
|
36
37
|
- Direct subpath exports for narrower imports.
|
|
37
38
|
|
|
38
39
|
## Compatibility
|
|
39
40
|
|
|
40
|
-
| Requirement | Supported
|
|
41
|
-
| ------------- |
|
|
42
|
-
| Vue | `^3.5.0`
|
|
43
|
-
| TypeScript | TypeScript 5.x recommended
|
|
44
|
-
| Solana client | Provided through `@vue-solana/core`
|
|
45
|
-
| Clusters | `mainnet-beta
|
|
41
|
+
| Requirement | Supported |
|
|
42
|
+
| ------------- | ----------------------------------------------------------------- |
|
|
43
|
+
| Vue | `^3.5.0` |
|
|
44
|
+
| TypeScript | TypeScript 5.x recommended |
|
|
45
|
+
| Solana client | Provided through `@vue-solana/core` |
|
|
46
|
+
| Clusters | `mainnet` (alias `mainnet-beta`), `devnet`, `testnet`, `localnet` |
|
|
46
47
|
|
|
47
48
|
## Install
|
|
48
49
|
|
|
@@ -86,27 +87,31 @@ You can also pass a custom RPC endpoint:
|
|
|
86
87
|
```ts
|
|
87
88
|
createApp(App).use(
|
|
88
89
|
createSolanaPlugin({
|
|
89
|
-
cluster: "mainnet
|
|
90
|
+
cluster: "mainnet",
|
|
90
91
|
endpoint: "https://your-rpc.example.com",
|
|
91
92
|
commitment: "confirmed",
|
|
92
93
|
}),
|
|
93
94
|
);
|
|
94
95
|
```
|
|
95
96
|
|
|
96
|
-
Supported clusters are `mainnet-beta
|
|
97
|
+
Supported clusters are `mainnet` (legacy alias `mainnet-beta`), `devnet`, `testnet`, and `localnet`. Use `mainnet` for Solana mainnet; this is Solana's official mainnet cluster name.
|
|
98
|
+
|
|
99
|
+
`payer` and `payerSecretKey` are supported by direct Vue/core clients. A client-sent transaction requires a payer. Never put a raw secret or `payerSecretKey` in Nuxt public runtime config, and never ship a funded signing key to an end-user browser. The default `createSolanaPlugin()` client composes the official `solanaRpc()`, `rpcTransactionPlanner()`, and `rpcTransactionPlanSendingExecutor()` stack; the old custom fallback sender is not used.
|
|
97
100
|
|
|
98
101
|
### Plugin Options
|
|
99
102
|
|
|
100
|
-
| Option
|
|
101
|
-
|
|
|
102
|
-
| `cluster`
|
|
103
|
-
| `endpoint`
|
|
104
|
-
| `wsEndpoint`
|
|
105
|
-
| `commitment`
|
|
106
|
-
| `autoConnect`
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
109
|
-
| `
|
|
103
|
+
| Option | Type | Default | Description |
|
|
104
|
+
| ---------------- | -------------------------------------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------- |
|
|
105
|
+
| `cluster` | `"mainnet" \| "mainnet-beta" \| "devnet" \| "testnet" \| "localnet"` | `"devnet"` | Solana cluster used when `endpoint` is omitted. |
|
|
106
|
+
| `endpoint` | `string` | Public endpoint for `cluster` | HTTP RPC endpoint. Use a dedicated RPC provider for production apps. |
|
|
107
|
+
| `wsEndpoint` | `string` | Derived from `endpoint` | WebSocket RPC endpoint. |
|
|
108
|
+
| `commitment` | Solana commitment | Solana client default | Default commitment for created connections. |
|
|
109
|
+
| `autoConnect` | `boolean` | `false` | Reconnects only a previously selected discovered wallet identity when it is discovered again. |
|
|
110
|
+
| `payer` | `TransactionSigner` | None | Client fee payer and signer for client-sent transactions. |
|
|
111
|
+
| `payerSecretKey` | `string` | None | Base64 64-byte Ed25519 keypair, secret key first, resolved at client creation. |
|
|
112
|
+
| `wallet` | `SolanaWallet` | Disabled | Custom wallet adapter, useful for tests or custom integrations. |
|
|
113
|
+
| `mobileWallet` | `MobileWalletOptions \| false` | Enabled on supported Android clients | Configures or disables Android Mobile Wallet Adapter registration. |
|
|
114
|
+
| `iosWallet` | `iOSWalletOptions \| false` | Enabled on iOS browsers | Configures or disables iOS browser wallet universal links (Phantom, Solflare, Backpack). |
|
|
110
115
|
|
|
111
116
|
The root export remains supported. For composables, prefer direct subpath imports in new code so bundlers can avoid evaluating unrelated package entry code:
|
|
112
117
|
|
|
@@ -116,6 +121,28 @@ import { useWallet } from "@vue-solana/vue/useWallet";
|
|
|
116
121
|
import { useSignMessage } from "@vue-solana/vue/useSignMessage";
|
|
117
122
|
```
|
|
118
123
|
|
|
124
|
+
### Client and Plugin Lifecycle
|
|
125
|
+
|
|
126
|
+
`createSolanaPlugin()` builds the Kit client once, during `install()`. Create the plugin at module scope and reuse the instance:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
// solana.ts
|
|
130
|
+
import { createSolanaPlugin } from "@vue-solana/vue";
|
|
131
|
+
|
|
132
|
+
export const solana = createSolanaPlugin({ cluster: "devnet" });
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Calling `createSolanaPlugin()` again builds a new client and context, discarding the existing wallet selection and RPC state. If your config is reactive — a cluster toggle, for example — memoize on the config so a new plugin (and client) is built only when the value actually changes, not on every render:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { computed, ref } from "vue";
|
|
139
|
+
|
|
140
|
+
const cluster = ref<SolanaCluster>("devnet");
|
|
141
|
+
const plugin = computed(() => createSolanaPlugin({ cluster: cluster.value }));
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
A Kit client runs its `createClient().use(...)` plugins during construction. When one of those plugins is async, the client — and any context built from it — only activates after that promise resolves. Defer real RPC and wallet work to client lifecycle hooks or user actions after hydration rather than running it during setup or SSR.
|
|
145
|
+
|
|
119
146
|
For development, use `devnet` and request free test SOL from the official faucet:
|
|
120
147
|
|
|
121
148
|
```txt
|
|
@@ -166,7 +193,7 @@ const { balance, loading, error, refresh } = useBalance(address);
|
|
|
166
193
|
|
|
167
194
|
### Airdrop on Test Networks
|
|
168
195
|
|
|
169
|
-
`useAirdrop()` sends SOL to an account on devnet, testnet, or a local validator.
|
|
196
|
+
`useAirdrop()` sends SOL to an account on devnet, testnet, or a local validator. The default Vue client includes the RPC and airdrop capabilities; a custom client can install them with `createClient().use(solanaRpc({ ... })).use(rpcAirdrop())` from `@solana/kit-plugin-rpc`.
|
|
170
197
|
|
|
171
198
|
```ts
|
|
172
199
|
import { lamports } from "@solana/kit";
|
|
@@ -315,6 +342,108 @@ await confirmation.confirm(signature);
|
|
|
315
342
|
|
|
316
343
|
`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.
|
|
317
344
|
|
|
345
|
+
### Wallet Request Inputs and Returns
|
|
346
|
+
|
|
347
|
+
Wallet signing flows accept transaction input as raw `Uint8Array` wire bytes that conform to the Solana transaction schema. Build them with `@solana/kit` (or decode them from a base64/base58 RPC response); base64 strings, transaction objects, and instruction lists are not accepted here.
|
|
348
|
+
|
|
349
|
+
```ts
|
|
350
|
+
import { compileTransaction, getTransactionEncoder } from "@solana/kit";
|
|
351
|
+
|
|
352
|
+
const transaction: Uint8Array = getTransactionEncoder().encode(compileTransaction(message));
|
|
353
|
+
await execute(transaction);
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
`useSignMessage()` takes the raw message bytes to sign. Every wallet send request also accepts the Kit `SendTransactionOptions`:
|
|
357
|
+
|
|
358
|
+
| Option | Description |
|
|
359
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
360
|
+
| `skipPreflight` | Skip preflight simulation before sending. |
|
|
361
|
+
| `maxRetries` | RPC node retry count (`bigint`). |
|
|
362
|
+
| `minContextSlot` | Slot at which any blockhash or nonce in the transaction is known to exist; sending before it can be rejected. |
|
|
363
|
+
| `preflightCommitment` | Commitment used for preflight simulation. |
|
|
364
|
+
|
|
365
|
+
Return shapes:
|
|
366
|
+
|
|
367
|
+
- `useSignMessage().execute(bytes)` resolves to `{ signedMessage, signature }`, both `Uint8Array`.
|
|
368
|
+
- `useSignTransactions().execute(transactions)` resolves to the signed `Uint8Array[]` (also exposed as `signedTransactions`); pass a single-element array for one transaction.
|
|
369
|
+
- `useSignAndSendTransaction().execute(transaction)` resolves to the submitted `signature` string; with `confirm: true` it also fills `confirmation`.
|
|
370
|
+
- `useSignAndSendTransactions().execute(transactions)` resolves to a `string[]` of signatures (also exposed as `signatures`).
|
|
371
|
+
|
|
372
|
+
A wallet may modify the message or transaction before signing — for example to add its own instruction or change the fee payer — and the Wallet Standard explicitly allows it. Re-read the returned `signedMessage` or signed transaction bytes instead of assuming they match your input byte-for-byte.
|
|
373
|
+
|
|
374
|
+
### Sending with the Client (no wallet popup)
|
|
375
|
+
|
|
376
|
+
`useSendTransaction()` and `useSendTransactions()` send through the Kit client's transaction-sending capability (`ClientWithTransactionSending`) instead of the connected wallet. The client plans the transaction from your input, signs it with its own signers — typically the client identity or `payer` keypair, e.g. a relayer — submits it, and returns the result. There is no wallet extension and no approval popup. The official executor waits for `confirmed` commitment before resolving.
|
|
377
|
+
|
|
378
|
+
Configure a direct client with `payer` or `payerSecretKey`. `payerSecretKey` is a base64 64-byte Ed25519 keypair and must stay in a trusted server or development context. Never put it in Nuxt public runtime config or ship a funded key to an end-user browser.
|
|
379
|
+
|
|
380
|
+
**Which to use:**
|
|
381
|
+
|
|
382
|
+
| Flow | `useSendTransaction(s)` (client) | `useSignAndSendTransaction(s)` (wallet) |
|
|
383
|
+
| --------------------- | ------------------------------------------------------------ | ----------------------------------------- |
|
|
384
|
+
| Who authorizes | The client's fee payer / signer keypairs | The connected wallet (user approves) |
|
|
385
|
+
| Environment | Server-side, relayer, or automated flows (no browser wallet) | Browser dapps where the user must approve |
|
|
386
|
+
| Popup | None | Wallet approval popup / mobile handoff |
|
|
387
|
+
| Input | Instructions, instruction plans, transaction messages, plans | Raw transaction bytes (`Uint8Array`) |
|
|
388
|
+
| Multiple transactions | Yes, as a batch in one call | Yes, one or more wallet requests |
|
|
389
|
+
|
|
390
|
+
Use the client flow for automated or server-backed signing (airdrop faucet, cron jobs, relayer fees paid by your keypair), and the wallet flow when the end user must own and approve each transaction.
|
|
391
|
+
|
|
392
|
+
**Default client composition.** `createSolanaPlugin()` and `createSolanaClient()` install the official `solanaRpc()`, `rpcTransactionPlanner()`, and `rpcTransactionPlanSendingExecutor()` plugins by default. The old custom fallback sender is not used, so `useSendTransaction()` and `useSendTransactions()` do not need a second manual plugin installation. The official executor waits for `confirmed` commitment before `execute()` resolves and the composable reports `sent`. A custom client must still provide the planner and sending executor and a `payer`.
|
|
393
|
+
|
|
394
|
+
```ts
|
|
395
|
+
import { useSendTransaction } from "@vue-solana/vue/useSendTransaction";
|
|
396
|
+
import { useSendTransactions } from "@vue-solana/vue/useSendTransactions";
|
|
397
|
+
|
|
398
|
+
const single = useSendTransaction();
|
|
399
|
+
const batch = useSendTransactions();
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
`useSendTransaction().execute()` accepts flexible input and resolves to the successful transaction result:
|
|
403
|
+
|
|
404
|
+
```ts
|
|
405
|
+
const { data, status, error, execute } = useSendTransaction();
|
|
406
|
+
|
|
407
|
+
// A raw list of instructions
|
|
408
|
+
await execute(instructions);
|
|
409
|
+
|
|
410
|
+
// A planned instruction plan or a single transaction plan
|
|
411
|
+
await execute(plan);
|
|
412
|
+
|
|
413
|
+
// A single transaction message
|
|
414
|
+
await execute(transactionMessage);
|
|
415
|
+
|
|
416
|
+
// data.context.signature is the submitted Signature
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
`useSendTransactions().execute()` plans, signs, and sends one or more messages at once — parallel where possible, sequential where dependencies require it — and resolves to the full plan result tree:
|
|
420
|
+
|
|
421
|
+
```ts
|
|
422
|
+
const { data, status, error, execute } = useSendTransactions();
|
|
423
|
+
|
|
424
|
+
// A batch of transaction messages
|
|
425
|
+
await execute([messageA, messageB]);
|
|
426
|
+
|
|
427
|
+
// A message, a plan, or a nested batch of messages/plans
|
|
428
|
+
await execute(nestedBatch);
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
Both composables surface `status` (`idle`, `sending`, `sent`, `error`), `loading`, `error`, and `data`. Starting a new `execute()` while one is in flight aborts the previous call; the stale attempt rejects and its state is discarded. Pass an `{ abortSignal }` to additionally cancel from outside (unmounting the owning component also aborts in-flight work).
|
|
432
|
+
|
|
433
|
+
Because signing keypairs live on the client, reserve `useSendTransaction(s)` for trusted contexts (your relayer, automated flows). Do not register app-signing keypairs on a client exposed to end-user browsers, where a compromised page could spend funds.
|
|
434
|
+
|
|
435
|
+
Superseded or aborted attempts reject with a wrapped error. To tell "superseded or cancelled" apart from a real failure, inspect the rejection's `cause`:
|
|
436
|
+
|
|
437
|
+
```ts
|
|
438
|
+
try {
|
|
439
|
+
await execute(instructions);
|
|
440
|
+
} catch (cause) {
|
|
441
|
+
if (cause?.cause instanceof DOMException && cause.cause.name === "AbortError") {
|
|
442
|
+
// superseded by a newer call or cancelled via abortSignal / unmount
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
```
|
|
446
|
+
|
|
318
447
|
### Live Data
|
|
319
448
|
|
|
320
449
|
`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:
|
|
@@ -457,43 +586,45 @@ Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
|
|
|
457
586
|
|
|
458
587
|
## API
|
|
459
588
|
|
|
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
|
|
494
|
-
| `useIdentity()` | Reactive Kit client `identity` signer ref (requires
|
|
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.
|
|
589
|
+
| API | Description |
|
|
590
|
+
| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
591
|
+
| `createSolanaPlugin(options?)` | Installs the Vue Solana context. |
|
|
592
|
+
| `VueSolana` | Alias for `createSolanaPlugin`. |
|
|
593
|
+
| `useSolana()` | Returns the full injected Solana context. |
|
|
594
|
+
| `useRpc()` | Returns cluster, endpoint, connection status, latest blockhash, the Kit `client`, and `checkConnection()`. |
|
|
595
|
+
| `useSolanaClient()` | Returns the injected Kit client as `{ client, rpc }`. The recommended RPC path. |
|
|
596
|
+
| `useConnection()` | Returns the Kit `client`. Deprecated in favor of `useSolanaClient()`. |
|
|
597
|
+
| `useWallet()` | Returns wallet refs, computed connection state, and wallet actions. |
|
|
598
|
+
| `useWallets()` | Returns discovered browser extension wallets, Android MWA wallets, iOS browser wallet links, and wallet selection actions. |
|
|
599
|
+
| `useSignMessage()` | Signs arbitrary message bytes through the connected wallet when message signing is supported. |
|
|
600
|
+
| `useBalance(address, commitment?)` | Loads lamport balance for an address string. |
|
|
601
|
+
| `useAirdrop()` | Airdrops SOL on devnet/testnet/localnets; `data` is the `Signature`, or `undefined` when applied directly. |
|
|
602
|
+
| `useAccountInfo(address, options?)` | Loads normalized account info (executable, lamports, owner, space, data bytes). |
|
|
603
|
+
| `useProgramAccounts(programId, config?)` | Loads accounts owned by a program with optional filters, commitment, and `dataSlice`. |
|
|
604
|
+
| `useTransaction(handler, options?)` | Generic async transaction state helper with optional timeout settings. |
|
|
605
|
+
| `useTransactionConfirmation(options?)` | Confirms a submitted signature with reactive status and timeout/error state. |
|
|
606
|
+
| `useSignatureStatus(signature, options?)` | Reads a transaction signature status with optional polling. |
|
|
607
|
+
| `useSignAndSendTransaction()` | Signs and sends a transaction through the configured wallet, with optional confirmation waiting. |
|
|
608
|
+
| `useTokenAccounts(owner, options?)` | Reads SPL token accounts for an owner. |
|
|
609
|
+
| `useTokenBalance(mint, owner, commitment?)` | Reads the token balance for a mint/owner pair. |
|
|
610
|
+
| `useAction(handler, options?)` | Generic async action state machine; each dispatch aborts the prior in-flight call. |
|
|
611
|
+
| `useRequest(source, options?)` | One-shot Kit request that re-fires when its source changes, preserving the previous `data` while revalidating. |
|
|
612
|
+
| `useSubscription(source, options?)` | Live data over a Kit reactive stream store (e.g. RPC subscriptions), torn down on unmount. |
|
|
613
|
+
| `useTrackedData(source, options?)` | Slot-deduplicated fetch plus subscription over Kit's slot-tracking store. |
|
|
614
|
+
| `useRequestSwr(key, ...)` / `useSubscriptionSwr(key, ...)` / `useTrackedDataSwr(key, ...)` | Cache-keyed SWR adapters seeding fresh mounts from the last-known result. |
|
|
615
|
+
| `clearSwrCache()` | Clears every cached SWR entry. |
|
|
616
|
+
| `useSignIn(input?)` | Sign In With Solana (SIWS) trigger returning `{ account, signedMessage, signature }` for server-side verification. |
|
|
617
|
+
| `useSelectedWalletAccount()` | App-wide selected wallet account context: `[selectedAccount, setSelectedAccount, filteredWallets]`. |
|
|
618
|
+
| `SelectedWalletAccountProvider` | Component that provides the selected wallet account context to its subtree. |
|
|
619
|
+
| `useSignTransactions()` | Batch-signs transactions through the wallet, preferring `signTransactions` and falling back to `signAllTransactions`. |
|
|
620
|
+
| `useSignAndSendTransactions()` | Signs and sends multiple transactions, returning one signature each, with a singular sequential fallback. |
|
|
621
|
+
| `useClientCapability(capability, options?)` | Fails fast with a clear error when the configured Solana client lacks a requested capability. |
|
|
622
|
+
| `usePayer()` | Reactive Kit client `payer` signer ref. The default client exposes a configured payer when supplied. |
|
|
623
|
+
| `useIdentity()` | Reactive Kit client `identity` signer ref (requires an identity signer on a custom client). |
|
|
624
|
+
| `usePlanTransaction()` | Plans a single transaction message from instruction inputs without signing or sending; the default client includes the official planner. |
|
|
625
|
+
| `usePlanTransactions()` | Plans a batch of transaction messages from instruction inputs. |
|
|
626
|
+
| `useSendTransaction()` | Uses the official client transaction-sending capability to plan, sign, submit, and wait for `confirmed` commitment (no wallet). |
|
|
627
|
+
| `useSendTransactions()` | Sends a batch through the same official capability, waiting for `confirmed` commitment. |
|
|
497
628
|
|
|
498
629
|
Direct composable subpaths:
|
|
499
630
|
|
|
@@ -527,6 +658,8 @@ Direct composable subpaths:
|
|
|
527
658
|
- `@vue-solana/vue/useIdentity`
|
|
528
659
|
- `@vue-solana/vue/usePlanTransaction`
|
|
529
660
|
- `@vue-solana/vue/usePlanTransactions`
|
|
661
|
+
- `@vue-solana/vue/useSendTransaction`
|
|
662
|
+
- `@vue-solana/vue/useSendTransactions`
|
|
530
663
|
|
|
531
664
|
Other direct subpaths:
|
|
532
665
|
|
|
@@ -539,7 +672,7 @@ Other direct subpaths:
|
|
|
539
672
|
- Wallet and RPC operations require the plugin-provided client context. Composables are SSR-safe, but real wallet work should run after hydration or in user actions.
|
|
540
673
|
- Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
|
|
541
674
|
- Broad `useProgramAccounts()` scans can be expensive or blocked on public RPC nodes. Prefer narrow filters and `dataSlice`.
|
|
542
|
-
- Use `mainnet
|
|
675
|
+
- Use `mainnet` for Solana mainnet. This is Solana's official mainnet cluster name; the legacy `mainnet-beta` spelling is still accepted and redirects to the same endpoint.
|
|
543
676
|
- 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.
|
|
544
677
|
- Desktop native app wallets are planned but not implemented yet.
|
|
545
678
|
|
package/dist/index.cjs
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
const useAccountInfo = require('./shared/vue.D-qi8PSL.cjs');
|
|
4
4
|
const useAction = require('./shared/vue.CoaIWGPT.cjs');
|
|
5
|
-
const useAirdrop = require('./shared/vue.
|
|
5
|
+
const useAirdrop = require('./shared/vue.B4eMoJT2.cjs');
|
|
6
6
|
const useBalance = require('./shared/vue.E_npPFoV.cjs');
|
|
7
|
-
const useClientCapability = require('./shared/vue.
|
|
7
|
+
const useClientCapability = require('./shared/vue.4C5kX4fE.cjs');
|
|
8
8
|
const useConnection = require('./shared/vue.BVaMoz9y.cjs');
|
|
9
|
-
const usePlanTransaction = require('./shared/vue.
|
|
9
|
+
const usePlanTransaction = require('./shared/vue.Dn3KLJZH.cjs');
|
|
10
10
|
const useProgramAccounts = require('./shared/vue.Di7yjJ-R.cjs');
|
|
11
|
-
const usePayer = require('./shared/vue.
|
|
11
|
+
const usePayer = require('./shared/vue.ldvmk9NM.cjs');
|
|
12
12
|
const useRequest = require('./shared/vue.ZuUCEEab.cjs');
|
|
13
13
|
const useRpc = require('./shared/vue.FiMmnMHr.cjs');
|
|
14
14
|
const SelectedWalletAccountProvider = require('./shared/vue.DDbVk0Zh.cjs');
|
|
15
|
+
const useSendTransaction = require('./shared/vue.DKoM8jIV.cjs');
|
|
15
16
|
const useSignMessage = require('./shared/vue.B6ainw2G.cjs');
|
|
16
17
|
const useSignAndSendTransaction = require('./shared/vue.CWZSMVnB.cjs');
|
|
17
18
|
const useSignTransactions = require('./shared/vue.DFaMJLAQ.cjs');
|
|
@@ -404,6 +405,8 @@ exports.createSelectedWalletAccountContext = SelectedWalletAccountProvider.creat
|
|
|
404
405
|
exports.provideSelectedWalletAccount = SelectedWalletAccountProvider.provideSelectedWalletAccount;
|
|
405
406
|
exports.selectedWalletAccountInjectionKey = SelectedWalletAccountProvider.selectedWalletAccountInjectionKey;
|
|
406
407
|
exports.useSelectedWalletAccount = SelectedWalletAccountProvider.useSelectedWalletAccount;
|
|
408
|
+
exports.useSendTransaction = useSendTransaction.useSendTransaction;
|
|
409
|
+
exports.useSendTransactions = useSendTransaction.useSendTransactions;
|
|
407
410
|
exports.useSignMessage = useSignMessage.useSignMessage;
|
|
408
411
|
exports.useSignAndSendTransaction = useSignAndSendTransaction.useSignAndSendTransaction;
|
|
409
412
|
exports.useSignTransactions = useSignTransactions.useSignTransactions;
|
package/dist/index.d.cts
CHANGED
|
@@ -10,6 +10,7 @@ export { useIdentity, usePayer } from './usePayer.cjs';
|
|
|
10
10
|
export { UseRequestOptions, UseRequestRefresherOptions, UseRequestReturn, UseRequestSource, UseRequestStatus, useRequest } from './useRequest.cjs';
|
|
11
11
|
export { useRpc } from './useRpc.cjs';
|
|
12
12
|
export { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, SelectedWalletAccountProvider, WalletAccountFilter, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount } from './useSelectedWalletAccount.cjs';
|
|
13
|
+
export { SendTransactionConfig, SendTransactionInput, SendTransactionStatus, SendTransactionsInput, useSendTransaction, useSendTransactions } from './useSendTransaction.cjs';
|
|
13
14
|
export { SignMessageStatus, useSignMessage } from './useSignMessage.cjs';
|
|
14
15
|
export { SignAndSendTransactionOptions, SignAndSendTransactionStatus, useSignAndSendTransaction } from './useSignAndSendTransaction.cjs';
|
|
15
16
|
export { SignTransactionsStatus, useSignTransactions } from './useSignTransactions.cjs';
|
|
@@ -34,6 +35,7 @@ import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-walle
|
|
|
34
35
|
import { SolanaConfig, SolanaWallet } from '@vue-solana/core/types';
|
|
35
36
|
import { App } from 'vue';
|
|
36
37
|
import '@vue-solana/core/errors';
|
|
38
|
+
import '@solana/kit-plugin-rpc';
|
|
37
39
|
import '@solana/kit';
|
|
38
40
|
import '@vue-solana/core/token-accounts';
|
|
39
41
|
|
package/dist/index.d.mts
CHANGED
|
@@ -10,6 +10,7 @@ export { useIdentity, usePayer } from './usePayer.mjs';
|
|
|
10
10
|
export { UseRequestOptions, UseRequestRefresherOptions, UseRequestReturn, UseRequestSource, UseRequestStatus, useRequest } from './useRequest.mjs';
|
|
11
11
|
export { useRpc } from './useRpc.mjs';
|
|
12
12
|
export { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, SelectedWalletAccountProvider, WalletAccountFilter, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount } from './useSelectedWalletAccount.mjs';
|
|
13
|
+
export { SendTransactionConfig, SendTransactionInput, SendTransactionStatus, SendTransactionsInput, useSendTransaction, useSendTransactions } from './useSendTransaction.mjs';
|
|
13
14
|
export { SignMessageStatus, useSignMessage } from './useSignMessage.mjs';
|
|
14
15
|
export { SignAndSendTransactionOptions, SignAndSendTransactionStatus, useSignAndSendTransaction } from './useSignAndSendTransaction.mjs';
|
|
15
16
|
export { SignTransactionsStatus, useSignTransactions } from './useSignTransactions.mjs';
|
|
@@ -34,6 +35,7 @@ import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-walle
|
|
|
34
35
|
import { SolanaConfig, SolanaWallet } from '@vue-solana/core/types';
|
|
35
36
|
import { App } from 'vue';
|
|
36
37
|
import '@vue-solana/core/errors';
|
|
38
|
+
import '@solana/kit-plugin-rpc';
|
|
37
39
|
import '@solana/kit';
|
|
38
40
|
import '@vue-solana/core/token-accounts';
|
|
39
41
|
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { useIdentity, usePayer } from './usePayer.js';
|
|
|
10
10
|
export { UseRequestOptions, UseRequestRefresherOptions, UseRequestReturn, UseRequestSource, UseRequestStatus, useRequest } from './useRequest.js';
|
|
11
11
|
export { useRpc } from './useRpc.js';
|
|
12
12
|
export { SelectedWalletAccount, SelectedWalletAccountContext, SelectedWalletAccountOptions, SelectedWalletAccountProvider, WalletAccountFilter, createSelectedWalletAccountContext, provideSelectedWalletAccount, selectedWalletAccountInjectionKey, useSelectedWalletAccount } from './useSelectedWalletAccount.js';
|
|
13
|
+
export { SendTransactionConfig, SendTransactionInput, SendTransactionStatus, SendTransactionsInput, useSendTransaction, useSendTransactions } from './useSendTransaction.js';
|
|
13
14
|
export { SignMessageStatus, useSignMessage } from './useSignMessage.js';
|
|
14
15
|
export { SignAndSendTransactionOptions, SignAndSendTransactionStatus, useSignAndSendTransaction } from './useSignAndSendTransaction.js';
|
|
15
16
|
export { SignTransactionsStatus, useSignTransactions } from './useSignTransactions.js';
|
|
@@ -34,6 +35,7 @@ import { RegisterSolanaMobileWalletOptions } from '@vue-solana/core/mobile-walle
|
|
|
34
35
|
import { SolanaConfig, SolanaWallet } from '@vue-solana/core/types';
|
|
35
36
|
import { App } from 'vue';
|
|
36
37
|
import '@vue-solana/core/errors';
|
|
38
|
+
import '@solana/kit-plugin-rpc';
|
|
37
39
|
import '@solana/kit';
|
|
38
40
|
import '@vue-solana/core/token-accounts';
|
|
39
41
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
export { u as useAccountInfo } from './shared/vue.BQRpjwKl.mjs';
|
|
2
2
|
export { u as useAction } from './shared/vue.DYk0Xfr3.mjs';
|
|
3
|
-
export { u as useAirdrop } from './shared/vue.
|
|
3
|
+
export { u as useAirdrop } from './shared/vue.DDQxNX5q.mjs';
|
|
4
4
|
export { u as useBalance } from './shared/vue.BINkrA8h.mjs';
|
|
5
|
-
export { M as MissingClientCapabilityError, u as useClientCapability } from './shared/vue.
|
|
5
|
+
export { M as MissingClientCapabilityError, u as useClientCapability } from './shared/vue.B9uRpSDJ.mjs';
|
|
6
6
|
export { u as useConnection } from './shared/vue.CpkwC8Th.mjs';
|
|
7
|
-
export { u as usePlanTransaction, a as usePlanTransactions } from './shared/vue.
|
|
7
|
+
export { u as usePlanTransaction, a as usePlanTransactions } from './shared/vue.Co5rj-I6.mjs';
|
|
8
8
|
export { u as useProgramAccounts } from './shared/vue.C13umiQi.mjs';
|
|
9
|
-
export { u as useIdentity, a as usePayer } from './shared/vue.
|
|
9
|
+
export { u as useIdentity, a as usePayer } from './shared/vue.B-xtuLtD.mjs';
|
|
10
10
|
export { u as useRequest } from './shared/vue.B8VvC8d2.mjs';
|
|
11
11
|
export { u as useRpc } from './shared/vue.BsGwt78R.mjs';
|
|
12
12
|
export { S as SelectedWalletAccountProvider, c as createSelectedWalletAccountContext, p as provideSelectedWalletAccount, s as selectedWalletAccountInjectionKey, u as useSelectedWalletAccount } from './shared/vue.DXQVIRZA.mjs';
|
|
13
|
+
export { u as useSendTransaction, a as useSendTransactions } from './shared/vue.DAthhH4D.mjs';
|
|
13
14
|
export { u as useSignMessage } from './shared/vue.JUWqu6kD.mjs';
|
|
14
15
|
export { u as useSignAndSendTransaction } from './shared/vue.Dyi1OCI1.mjs';
|
|
15
16
|
export { u as useSignTransactions } from './shared/vue.CMohL_Cz.mjs';
|
|
@@ -25,7 +25,8 @@ function useClientCapability(capability, options = {}) {
|
|
|
25
25
|
const providerHint = options.providerHint ?? "Install it by adding the corresponding @solana/kit plugin with `createClient().use(...)`.";
|
|
26
26
|
const { client } = useSolanaClient.useSolanaClient();
|
|
27
27
|
for (const name of capabilities) {
|
|
28
|
-
|
|
28
|
+
const value = client[name];
|
|
29
|
+
if (value === null || typeof value !== "function" && typeof value !== "object") {
|
|
29
30
|
throw new MissingClientCapabilityError(hookName, [name], providerHint);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const useAction = require('./vue.CoaIWGPT.cjs');
|
|
4
|
-
const useClientCapability = require('./vue.
|
|
4
|
+
const useClientCapability = require('./vue.4C5kX4fE.cjs');
|
|
5
5
|
const useSolanaClient = require('./vue.BIxphCAq.cjs');
|
|
6
6
|
|
|
7
7
|
function toReadableAirdropError(error) {
|
|
@@ -21,7 +21,7 @@ function toReadableAirdropError(error) {
|
|
|
21
21
|
function useAirdrop() {
|
|
22
22
|
useClientCapability.useClientCapability("airdrop", {
|
|
23
23
|
hookName: "useAirdrop",
|
|
24
|
-
providerHint: "Install it by adding the airdrop capability with `createClient().use(
|
|
24
|
+
providerHint: "Install it by adding the airdrop capability with `createClient().use(solanaRpc({ ... })).use(rpcAirdrop())` from `@solana/kit-plugin-rpc`, on a client that has a `payer` signer to sign the request."
|
|
25
25
|
});
|
|
26
26
|
const { client } = useSolanaClient.useSolanaClient();
|
|
27
27
|
return useAction.useAction((abortSignal, address, amount) => {
|
|
@@ -23,7 +23,8 @@ function useClientCapability(capability, options = {}) {
|
|
|
23
23
|
const providerHint = options.providerHint ?? "Install it by adding the corresponding @solana/kit plugin with `createClient().use(...)`.";
|
|
24
24
|
const { client } = useSolanaClient();
|
|
25
25
|
for (const name of capabilities) {
|
|
26
|
-
|
|
26
|
+
const value = client[name];
|
|
27
|
+
if (value === null || typeof value !== "function" && typeof value !== "object") {
|
|
27
28
|
throw new MissingClientCapabilityError(hookName, [name], providerHint);
|
|
28
29
|
}
|
|
29
30
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { normalizeSolanaError } from '@vue-solana/core/errors';
|
|
2
|
-
import { shallowRef, ref } from 'vue';
|
|
3
|
-
import { u as useClientCapability } from './vue.
|
|
2
|
+
import { shallowRef, ref, onScopeDispose } from 'vue';
|
|
3
|
+
import { u as useClientCapability } from './vue.B9uRpSDJ.mjs';
|
|
4
4
|
import { u as useSolanaClient } from './vue.Mxc8w6Qk.mjs';
|
|
5
5
|
|
|
6
|
+
const PLANNING_PROVIDER_HINT = "Install a planner plugin, e.g. `createClient().use(rpcTransactionPlanner())` from `@solana/kit-plugin-rpc`, and plan with a client that has a `payer` signer \u2014 Kit reads `client.payer` to set the fee payer.";
|
|
6
7
|
function usePlanTransaction() {
|
|
7
|
-
useClientCapability(["planTransaction"], {
|
|
8
|
+
useClientCapability(["planTransaction", "payer"], {
|
|
8
9
|
hookName: "usePlanTransaction",
|
|
9
|
-
providerHint:
|
|
10
|
+
providerHint: PLANNING_PROVIDER_HINT
|
|
10
11
|
});
|
|
11
12
|
const { client } = useSolanaClient();
|
|
12
13
|
const transactionMessage = shallowRef(null);
|
|
@@ -14,7 +15,15 @@ function usePlanTransaction() {
|
|
|
14
15
|
const loading = ref(false);
|
|
15
16
|
const error = ref(null);
|
|
16
17
|
let executionId = 0;
|
|
18
|
+
let abortController;
|
|
19
|
+
onScopeDispose(() => {
|
|
20
|
+
abortController?.abort();
|
|
21
|
+
executionId++;
|
|
22
|
+
});
|
|
17
23
|
async function execute(input, config) {
|
|
24
|
+
abortController?.abort();
|
|
25
|
+
const controller = new AbortController();
|
|
26
|
+
abortController = controller;
|
|
18
27
|
const currentExecutionId = ++executionId;
|
|
19
28
|
const planner = client;
|
|
20
29
|
status.value = "planning";
|
|
@@ -22,7 +31,8 @@ function usePlanTransaction() {
|
|
|
22
31
|
error.value = null;
|
|
23
32
|
transactionMessage.value = null;
|
|
24
33
|
try {
|
|
25
|
-
const
|
|
34
|
+
const abortSignal = config?.abortSignal ? AbortSignal.any([controller.signal, config.abortSignal]) : controller.signal;
|
|
35
|
+
const message = await planner.planTransaction(input, { abortSignal });
|
|
26
36
|
if (currentExecutionId === executionId) {
|
|
27
37
|
transactionMessage.value = message;
|
|
28
38
|
status.value = "planned";
|
|
@@ -50,9 +60,9 @@ function usePlanTransaction() {
|
|
|
50
60
|
};
|
|
51
61
|
}
|
|
52
62
|
function usePlanTransactions() {
|
|
53
|
-
useClientCapability(["planTransactions"], {
|
|
63
|
+
useClientCapability(["planTransactions", "payer"], {
|
|
54
64
|
hookName: "usePlanTransactions",
|
|
55
|
-
providerHint:
|
|
65
|
+
providerHint: PLANNING_PROVIDER_HINT
|
|
56
66
|
});
|
|
57
67
|
const { client } = useSolanaClient();
|
|
58
68
|
const transactionPlan = shallowRef(null);
|
|
@@ -60,7 +70,15 @@ function usePlanTransactions() {
|
|
|
60
70
|
const loading = ref(false);
|
|
61
71
|
const error = ref(null);
|
|
62
72
|
let executionId = 0;
|
|
73
|
+
let abortController;
|
|
74
|
+
onScopeDispose(() => {
|
|
75
|
+
abortController?.abort();
|
|
76
|
+
executionId++;
|
|
77
|
+
});
|
|
63
78
|
async function execute(input, config) {
|
|
79
|
+
abortController?.abort();
|
|
80
|
+
const controller = new AbortController();
|
|
81
|
+
abortController = controller;
|
|
64
82
|
const currentExecutionId = ++executionId;
|
|
65
83
|
const planner = client;
|
|
66
84
|
status.value = "planning";
|
|
@@ -68,7 +86,8 @@ function usePlanTransactions() {
|
|
|
68
86
|
error.value = null;
|
|
69
87
|
transactionPlan.value = null;
|
|
70
88
|
try {
|
|
71
|
-
const
|
|
89
|
+
const abortSignal = config?.abortSignal ? AbortSignal.any([controller.signal, config.abortSignal]) : controller.signal;
|
|
90
|
+
const plan = await planner.planTransactions(input, { abortSignal });
|
|
72
91
|
if (currentExecutionId === executionId) {
|
|
73
92
|
transactionPlan.value = plan;
|
|
74
93
|
status.value = "planned";
|