@vue-solana/core 0.1.0 → 0.1.2

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -0
  3. package/package.json +26 -17
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 vue-solana
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # @vue-solana/core
2
+
3
+ Framework-agnostic Solana primitives used by the Vue Solana packages.
4
+
5
+ Use this package directly when you want connection helpers, shared wallet types, and transaction helpers without installing the Vue plugin.
6
+
7
+ `@vue-solana/core` does not replace `@solana/web3-compat`. Use `@solana/web3-compat` for raw Solana primitives like `Connection`, `PublicKey`, and transactions. Use `@vue-solana/core` for Vue Solana shared configuration, cluster endpoint defaults, wallet interfaces, and transaction helpers.
8
+
9
+ Official Solana docs:
10
+
11
+ - [Solana Documentation](https://solana.com/docs)
12
+ - [Solana RPC Methods](https://solana.com/docs/rpc)
13
+ - [Solana Clusters](https://solana.com/docs/references/clusters)
14
+
15
+ Full Vue Solana docs:
16
+
17
+ - [`@vue-solana/core`](https://github.com/vue-solana/vue-solana/tree/main/apps/docs/content/packages/core.md)
18
+ - [Getting Started](https://github.com/vue-solana/vue-solana/tree/main/apps/docs/content/getting-started.md)
19
+ - [Troubleshooting](https://github.com/vue-solana/vue-solana/tree/main/apps/docs/content/troubleshooting.md)
20
+
21
+ ## Install
22
+
23
+ ```sh
24
+ pnpm add @vue-solana/core @solana/web3-compat
25
+ ```
26
+
27
+ ```sh
28
+ npm install @vue-solana/core @solana/web3-compat
29
+ ```
30
+
31
+ ## Quick Start
32
+
33
+ ```ts
34
+ import { createSolanaContext } from '@vue-solana/core'
35
+
36
+ const solana = createSolanaContext({
37
+ cluster: 'devnet'
38
+ })
39
+
40
+ const { blockhash } = await solana.connection.getLatestBlockhash()
41
+
42
+ console.log(solana.endpoint, blockhash)
43
+ ```
44
+
45
+ ## Configuration
46
+
47
+ ```ts
48
+ import type { SolanaConfig } from '@vue-solana/core'
49
+
50
+ const config: SolanaConfig = {
51
+ cluster: 'devnet',
52
+ endpoint: 'https://api.devnet.solana.com',
53
+ wsEndpoint: 'wss://api.devnet.solana.com',
54
+ commitment: 'confirmed',
55
+ autoConnect: false
56
+ }
57
+ ```
58
+
59
+ 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.
60
+
61
+ Use `mainnet-beta` for Solana mainnet. This is Solana's official cluster name; the package intentionally does not use `mainnet` as an alias.
62
+
63
+ For development, use `devnet` and request free test SOL from the official faucet:
64
+
65
+ ```txt
66
+ https://faucet.solana.com
67
+ ```
68
+
69
+ ## API
70
+
71
+ - `DEFAULT_CLUSTER`: default cluster, currently `devnet`.
72
+ - `createSolanaConnection(config?)`: creates a `Connection`.
73
+ - `createSolanaContext(config?)`: creates `{ cluster, endpoint, wsEndpoint, connection }`.
74
+ - `getClusterEndpoint(cluster?)`: returns the HTTP RPC endpoint for a cluster.
75
+ - `getClusterWebSocketEndpoint(cluster?)`: returns the WebSocket endpoint for a cluster.
76
+ - `getWebSocketEndpoint(endpoint)`: converts `http`/`https` RPC URLs to `ws`/`wss` URLs.
77
+ - `isWalletConnected(wallet)`: checks whether a wallet is connected and has a public key.
78
+ - `assertWalletConnected(wallet)`: throws if the wallet is not connected.
79
+ - `assertWalletCanSign(wallet)`: throws if the wallet cannot sign transactions.
80
+ - `signAndSendTransaction(connection, wallet, transaction, options?)`: signs and sends a transaction using a configured wallet.
81
+
82
+ ## Wallet Interface
83
+
84
+ ```ts
85
+ import type { SolanaWallet } from '@vue-solana/core'
86
+
87
+ const wallet: SolanaWallet = {
88
+ publicKey: null,
89
+ connected: false,
90
+ connect: async () => {},
91
+ disconnect: async () => {},
92
+ signTransaction: async transaction => transaction
93
+ }
94
+ ```
95
+
96
+ Browser wallet discovery is not included yet. If you need wallet connection or transaction signing today, provide an object that implements `SolanaWallet`.
97
+
98
+ ## Examples
99
+
100
+ For complete runnable Vue and Nuxt examples that use this package through the framework integrations, see:
101
+
102
+ - [`examples/vue-vite`](https://github.com/vue-solana/vue-solana/tree/main/examples/vue-vite)
103
+ - [`examples/nuxt`](https://github.com/vue-solana/vue-solana/tree/main/examples/nuxt)
104
+
105
+ ## Known TypeScript Issue
106
+
107
+ `@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.
108
+
109
+ If TypeScript cannot resolve `@solana/web3-compat`, add `types/web3-compat.d.ts` to your app:
110
+
111
+ ```ts
112
+ declare module '@solana/web3-compat' {
113
+ export type {
114
+ Commitment,
115
+ SendOptions,
116
+ TransactionSignature
117
+ } from '@solana/web3.js'
118
+ export {
119
+ Connection,
120
+ Keypair,
121
+ PublicKey,
122
+ SystemProgram,
123
+ Transaction,
124
+ TransactionInstruction,
125
+ VersionedTransaction
126
+ } from '@solana/web3.js'
127
+ }
128
+ ```
129
+
130
+ Make sure your `tsconfig.json` includes `types/**/*.d.ts` or another pattern that includes the shim.
131
+
132
+ ## Status
133
+
134
+ This package is early-stage. RPC helpers and transaction primitives are usable; first-class browser wallet adapter support is planned.
package/package.json CHANGED
@@ -1,22 +1,26 @@
1
1
  {
2
2
  "name": "@vue-solana/core",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Framework-agnostic primitives for Vue Solana libraries.",
5
5
  "license": "MIT",
6
- "type": "module",
7
- "homepage": "https://github.com/vue-solana/vue-solana#readme",
6
+ "keywords": [
7
+ "solana",
8
+ "vue",
9
+ "nuxt",
10
+ "web3",
11
+ "wallet",
12
+ "rpc"
13
+ ],
14
+ "homepage": "https://vue-solana-docs.vercel.app/packages/core",
15
+ "bugs": {
16
+ "url": "https://github.com/vue-solana/vue-solana/issues"
17
+ },
8
18
  "repository": {
9
19
  "type": "git",
10
20
  "url": "git+https://github.com/vue-solana/vue-solana.git",
11
21
  "directory": "packages/core"
12
22
  },
13
- "bugs": {
14
- "url": "https://github.com/vue-solana/vue-solana/issues"
15
- },
16
- "keywords": ["solana", "vue", "wallet", "rpc", "web3"],
17
- "publishConfig": {
18
- "access": "public"
19
- },
23
+ "type": "module",
20
24
  "main": "./dist/index.cjs",
21
25
  "module": "./dist/index.mjs",
22
26
  "types": "./dist/index.d.ts",
@@ -27,12 +31,11 @@
27
31
  "require": "./dist/index.cjs"
28
32
  }
29
33
  },
30
- "files": ["dist"],
31
- "scripts": {
32
- "build": "unbuild",
33
- "dev": "unbuild --stub",
34
- "typecheck": "tsc --noEmit",
35
- "clean": "rm -rf dist"
34
+ "files": [
35
+ "dist"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public"
36
39
  },
37
40
  "dependencies": {
38
41
  "@solana/web3-compat": "^0.0.21"
@@ -40,5 +43,11 @@
40
43
  "devDependencies": {
41
44
  "typescript": "^5.8.3",
42
45
  "unbuild": "^3.5.0"
46
+ },
47
+ "scripts": {
48
+ "build": "unbuild",
49
+ "dev": "unbuild --stub",
50
+ "typecheck": "tsc --noEmit",
51
+ "clean": "rm -rf dist"
43
52
  }
44
- }
53
+ }