@vue-solana/core 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +56 -44
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # @vue-solana/core
2
2
 
3
- Framework-agnostic Solana primitives used by the Vue Solana packages.
3
+ [![npm version](https://img.shields.io/npm/v/@vue-solana/core.svg)](https://www.npmjs.com/package/@vue-solana/core)
4
+ [![npm downloads](https://img.shields.io/npm/dt/@vue-solana/core.svg)](https://www.npmjs.com/package/@vue-solana/core)
5
+ [![license](https://img.shields.io/npm/l/@vue-solana/core.svg)](https://github.com/vue-solana/vue-solana/blob/main/LICENSE)
6
+ [![docs](https://img.shields.io/badge/docs-vue--solana-blue)](https://vue-solana-docs.vercel.app/packages/core)
7
+
8
+ Framework-agnostic Solana primitives for Vue Solana libraries and apps that want shared RPC, wallet, and transaction helpers without installing a Vue plugin.
4
9
 
5
10
  Use this package directly when you want connection helpers, shared wallet types, Android Mobile Wallet Adapter registration helpers, message signing support, and transaction helpers without installing the Vue plugin.
6
11
 
@@ -20,6 +25,27 @@ Full Vue Solana docs:
20
25
  - [Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
21
26
  - [Troubleshooting](https://vue-solana-docs.vercel.app/troubleshooting)
22
27
 
28
+ ## Features
29
+
30
+ - Cluster-aware RPC connection helpers with HTTP and WebSocket endpoint defaults.
31
+ - Shared `SolanaConfig`, `SolanaContext`, and `SolanaWallet` types for framework integrations.
32
+ - Wallet capability assertions for connection, message signing, and transaction signing flows.
33
+ - Browser Wallet Standard adaptation primitives.
34
+ - Android Mobile Wallet Adapter registration helpers.
35
+ - iOS browser wallet link helpers for supported wallets.
36
+ - Transaction submission and confirmation helpers.
37
+
38
+ ## Compatibility
39
+
40
+ | Requirement | Supported |
41
+ | ------------- | ----------------------------------------------- |
42
+ | Runtime | Modern ESM or CommonJS bundlers |
43
+ | TypeScript | TypeScript 5.x recommended |
44
+ | Solana client | `@solana/web3-compat@^0.0.21` |
45
+ | Clusters | `mainnet-beta`, `devnet`, `testnet`, `localnet` |
46
+
47
+ This package intentionally keeps raw Solana primitives in `@solana/web3-compat`. Import `Connection`, `PublicKey`, `Transaction`, and `VersionedTransaction` from Solana packages; import Vue Solana configuration, wallet interfaces, and helpers from `@vue-solana/core`.
48
+
23
49
  ## Install
24
50
 
25
51
  ```sh
@@ -66,6 +92,14 @@ const config: SolanaConfig = {
66
92
  };
67
93
  ```
68
94
 
95
+ | Option | Type | Default | Description |
96
+ | ------------- | ------------------------------------------------------- | ----------------------------- | --------------------------------------------------------------------------------------- |
97
+ | `cluster` | `"mainnet-beta" \| "devnet" \| "testnet" \| "localnet"` | `"devnet"` | Solana cluster used when `endpoint` is omitted. |
98
+ | `endpoint` | `string` | Public endpoint for `cluster` | HTTP RPC endpoint. Use a dedicated RPC provider for production apps. |
99
+ | `wsEndpoint` | `string` | Derived from `endpoint` | WebSocket RPC endpoint. |
100
+ | `commitment` | Solana commitment | Solana client default | Default commitment for created connections. |
101
+ | `autoConnect` | `boolean` | `false` | Consumed by Vue/Nuxt integrations to reconnect a previously selected discovered wallet. |
102
+
69
103
  Supported clusters are `mainnet-beta`, `testnet`, `devnet`, and `localnet`. If `endpoint` is omitted, the package uses the public Solana RPC endpoint for the selected cluster. If `wsEndpoint` is omitted, it is derived from the RPC endpoint.
70
104
 
71
105
  `autoConnect` is consumed by the Vue plugin and Nuxt module. It defaults to `false`; when set to `true`, Vue Solana reconnects only a previously selected wallet identity that is discovered again on the client.
@@ -92,19 +126,21 @@ Direct subpaths:
92
126
  - `@vue-solana/core/wallet`
93
127
  - `@vue-solana/core/wallet-standard`
94
128
 
95
- - `DEFAULT_CLUSTER`: default cluster, currently `devnet`.
96
- - `parsePublicKey(value)`: parses a `PublicKey`, address string, ref-like `{ value }`, getter, `null`, or `undefined` into a `PublicKey | null`.
97
- - `createSolanaConnection(config?)`: creates a `Connection`.
98
- - `createSolanaContext(config?)`: creates `{ cluster, endpoint, wsEndpoint, connection }`.
99
- - `getClusterEndpoint(cluster?)`: returns the HTTP RPC endpoint for a cluster.
100
- - `getClusterWebSocketEndpoint(cluster?)`: returns the WebSocket endpoint for a cluster.
101
- - `getWebSocketEndpoint(endpoint)`: converts `http`/`https` RPC URLs to `ws`/`wss` URLs.
102
- - `isWalletConnected(wallet)`: checks whether a wallet is connected and has a public key.
103
- - `assertWalletConnected(wallet)`: throws if the wallet is not connected.
104
- - `assertWalletCanSignMessage(wallet)`: throws if the wallet is disconnected or cannot sign messages.
105
- - `assertWalletCanSign(wallet)`: throws if the wallet cannot sign transactions.
106
- - `signAndSendTransaction(connection, wallet, transaction, options?)`: signs and sends a transaction using a configured wallet. Android Mobile Wallet Adapter wallets prefer `signTransaction` plus app-side RPC submission when available so the app can reliably return the submitted signature.
107
- - `confirmTransactionSignature(connection, signature, options?)`: waits for a submitted signature to reach a requested commitment. Defaults to `confirmed` commitment and a 60 second timeout.
129
+ | API | Description |
130
+ | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
131
+ | `DEFAULT_CLUSTER` | Default cluster, currently `devnet`. |
132
+ | `parsePublicKey(value)` | Parses a `PublicKey`, address string, ref-like `{ value }`, getter, `null`, or `undefined` into a `PublicKey \| null`. |
133
+ | `createSolanaConnection(config?)` | Creates a Solana `Connection`. |
134
+ | `createSolanaContext(config?)` | Creates `{ cluster, endpoint, wsEndpoint, connection }`. |
135
+ | `getClusterEndpoint(cluster?)` | Returns the HTTP RPC endpoint for a cluster. |
136
+ | `getClusterWebSocketEndpoint(cluster?)` | Returns the WebSocket endpoint for a cluster. |
137
+ | `getWebSocketEndpoint(endpoint)` | Converts `http`/`https` RPC URLs to `ws`/`wss` URLs. |
138
+ | `isWalletConnected(wallet)` | Checks whether a wallet is connected and has a public key. |
139
+ | `assertWalletConnected(wallet)` | Throws if the wallet is not connected. |
140
+ | `assertWalletCanSignMessage(wallet)` | Throws if the wallet is disconnected or cannot sign messages. |
141
+ | `assertWalletCanSign(wallet)` | Throws if the wallet cannot sign transactions. |
142
+ | `signAndSendTransaction(connection, wallet, transaction, options?)` | Signs and sends a transaction using a configured wallet. Android MWA wallets prefer `signTransaction` plus app-side RPC submission when available. |
143
+ | `confirmTransactionSignature(connection, signature, options?)` | Waits for a submitted signature to reach a requested commitment. Defaults to `confirmed` and a 60 second timeout. |
108
144
 
109
145
  ## Wallet Interface
110
146
 
@@ -153,37 +189,13 @@ npx skills add vue-solana/vue-solana --skill vue-solana
153
189
 
154
190
  Docs: [Vue Solana Agent Skill](https://vue-solana-docs.vercel.app/agent-skill)
155
191
 
156
- ## Known TypeScript Issue
157
-
158
- `@solana/web3-compat@0.0.21` currently has broken TypeScript metadata. Runtime imports still use the real package, but TypeScript consumers may need a local declaration shim.
159
-
160
- If TypeScript cannot resolve `@solana/web3-compat`, add `types/web3-compat.d.ts` to your app:
161
-
162
- ```ts
163
- declare module "@solana/web3-compat" {
164
- export type {
165
- AccountInfo,
166
- Commitment,
167
- RpcResponseAndContext,
168
- SendOptions,
169
- SignatureResult,
170
- SignatureStatus,
171
- TransactionSignature,
172
- } from "@solana/web3.js";
173
- export {
174
- Connection,
175
- Keypair,
176
- PublicKey,
177
- SystemProgram,
178
- Transaction,
179
- TransactionInstruction,
180
- VersionedTransaction,
181
- } from "@solana/web3.js";
182
- }
183
- ```
192
+ ## Caveats
184
193
 
185
- Make sure your `tsconfig.json` includes `types/**/*.d.ts` or another pattern that includes the shim.
194
+ - Public Solana RPC endpoints are useful for development, but production apps should use dedicated RPC infrastructure.
195
+ - Use `mainnet-beta` for Solana mainnet. `mainnet` is intentionally not accepted as a cluster alias.
196
+ - `@solana/web3-compat@0.0.21` currently has broken TypeScript package metadata. Runtime imports still use the real package, but TypeScript consumers may need a local declaration shim. See [Troubleshooting](https://vue-solana-docs.vercel.app/troubleshooting) for the workaround.
197
+ - Desktop native app wallets are planned but not implemented yet.
186
198
 
187
199
  ## Status
188
200
 
189
- This package is early-stage. RPC helpers, browser extension wallet primitives, Android mobile wallet registration, message signing, and transaction helpers are usable.
201
+ This package provides RPC helpers, browser extension wallet primitives, Android mobile wallet registration, message signing, and transaction helpers.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-solana/core",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Framework-agnostic primitives for Vue Solana libraries.",
5
5
  "license": "MIT",
6
6
  "keywords": [