@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.
- package/README.md +56 -44
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# @vue-solana/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@vue-solana/core)
|
|
4
|
+
[](https://www.npmjs.com/package/@vue-solana/core)
|
|
5
|
+
[](https://github.com/vue-solana/vue-solana/blob/main/LICENSE)
|
|
6
|
+
[](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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
|
201
|
+
This package provides RPC helpers, browser extension wallet primitives, Android mobile wallet registration, message signing, and transaction helpers.
|