@vue-solana/nuxt 0.5.0 → 0.5.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 +24 -0
- package/dist/module.cjs +15 -0
- package/dist/module.mjs +15 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -65,10 +65,13 @@ The module auto-imports these composables from direct `@vue-solana/vue/*` subpat
|
|
|
65
65
|
- `useSolana()`
|
|
66
66
|
- `useSolanaRpc()`
|
|
67
67
|
- `useSolanaConnection()`
|
|
68
|
+
- `useSolanaAccountInfo()`
|
|
68
69
|
- `useSolanaWallet()`
|
|
69
70
|
- `useSolanaWallets()`
|
|
70
71
|
- `useSolanaBalance()`
|
|
72
|
+
- `useSolanaProgramAccounts()`
|
|
71
73
|
- `useSolanaTransactionConfirmation()`
|
|
74
|
+
- `useSolanaSignatureStatus()`
|
|
72
75
|
- `useSolanaSignAndSendTransaction()`
|
|
73
76
|
|
|
74
77
|
The runtime plugin is client-only. Auto-imported composables can be called during SSR and return inert state until hydration provides the real client context. Trigger RPC and wallet work from client lifecycle hooks or user actions.
|
|
@@ -111,6 +114,25 @@ const { balance, loading, error, refresh } = useSolanaBalance(address);
|
|
|
111
114
|
</template>
|
|
112
115
|
```
|
|
113
116
|
|
|
117
|
+
## Read Account Data
|
|
118
|
+
|
|
119
|
+
```vue
|
|
120
|
+
<script setup lang="ts">
|
|
121
|
+
const address = ref("PASTE_A_SOLANA_ADDRESS");
|
|
122
|
+
const programId = ref("PASTE_A_SOLANA_PROGRAM_ID");
|
|
123
|
+
const signature = ref("PASTE_A_TRANSACTION_SIGNATURE");
|
|
124
|
+
|
|
125
|
+
const account = useSolanaAccountInfo(address, { watch: true });
|
|
126
|
+
const programAccounts = useSolanaProgramAccounts(programId, {
|
|
127
|
+
dataSlice: { offset: 0, length: 32 },
|
|
128
|
+
filters: [{ dataSize: 165 }],
|
|
129
|
+
});
|
|
130
|
+
const signatureStatus = useSolanaSignatureStatus(signature, { pollIntervalMs: 2_000 });
|
|
131
|
+
</script>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Use `useSolanaProgramAccounts()` carefully on public RPC nodes. Prefer narrow filters, use `dataSlice` for partial reads, and avoid polling broad scans.
|
|
135
|
+
|
|
114
136
|
## Wallet State
|
|
115
137
|
|
|
116
138
|
```vue
|
|
@@ -174,10 +196,12 @@ If TypeScript cannot resolve `@solana/web3-compat`, add `types/web3-compat.d.ts`
|
|
|
174
196
|
```ts
|
|
175
197
|
declare module "@solana/web3-compat" {
|
|
176
198
|
export type {
|
|
199
|
+
AccountInfo,
|
|
177
200
|
Commitment,
|
|
178
201
|
RpcResponseAndContext,
|
|
179
202
|
SendOptions,
|
|
180
203
|
SignatureResult,
|
|
204
|
+
SignatureStatus,
|
|
181
205
|
TransactionSignature,
|
|
182
206
|
} from "@solana/web3.js";
|
|
183
207
|
export {
|
package/dist/module.cjs
CHANGED
|
@@ -51,14 +51,29 @@ const module$1 = kit.defineNuxtModule({
|
|
|
51
51
|
mode: "client"
|
|
52
52
|
});
|
|
53
53
|
kit.addImports([
|
|
54
|
+
{
|
|
55
|
+
name: "useAccountInfo",
|
|
56
|
+
as: "useSolanaAccountInfo",
|
|
57
|
+
from: "@vue-solana/vue/useAccountInfo"
|
|
58
|
+
},
|
|
54
59
|
{ name: "useBalance", as: "useSolanaBalance", from: "@vue-solana/vue/useBalance" },
|
|
55
60
|
{ name: "useConnection", as: "useSolanaConnection", from: "@vue-solana/vue/useConnection" },
|
|
61
|
+
{
|
|
62
|
+
name: "useProgramAccounts",
|
|
63
|
+
as: "useSolanaProgramAccounts",
|
|
64
|
+
from: "@vue-solana/vue/useProgramAccounts"
|
|
65
|
+
},
|
|
56
66
|
{ name: "useRpc", as: "useSolanaRpc", from: "@vue-solana/vue/useRpc" },
|
|
57
67
|
{
|
|
58
68
|
name: "useSignAndSendTransaction",
|
|
59
69
|
as: "useSolanaSignAndSendTransaction",
|
|
60
70
|
from: "@vue-solana/vue/useSignAndSendTransaction"
|
|
61
71
|
},
|
|
72
|
+
{
|
|
73
|
+
name: "useSignatureStatus",
|
|
74
|
+
as: "useSolanaSignatureStatus",
|
|
75
|
+
from: "@vue-solana/vue/useSignatureStatus"
|
|
76
|
+
},
|
|
62
77
|
{ name: "useSolana", as: "useSolana", from: "@vue-solana/vue/useSolana" },
|
|
63
78
|
{
|
|
64
79
|
name: "useTransactionConfirmation",
|
package/dist/module.mjs
CHANGED
|
@@ -48,14 +48,29 @@ const module$1 = defineNuxtModule({
|
|
|
48
48
|
mode: "client"
|
|
49
49
|
});
|
|
50
50
|
addImports([
|
|
51
|
+
{
|
|
52
|
+
name: "useAccountInfo",
|
|
53
|
+
as: "useSolanaAccountInfo",
|
|
54
|
+
from: "@vue-solana/vue/useAccountInfo"
|
|
55
|
+
},
|
|
51
56
|
{ name: "useBalance", as: "useSolanaBalance", from: "@vue-solana/vue/useBalance" },
|
|
52
57
|
{ name: "useConnection", as: "useSolanaConnection", from: "@vue-solana/vue/useConnection" },
|
|
58
|
+
{
|
|
59
|
+
name: "useProgramAccounts",
|
|
60
|
+
as: "useSolanaProgramAccounts",
|
|
61
|
+
from: "@vue-solana/vue/useProgramAccounts"
|
|
62
|
+
},
|
|
53
63
|
{ name: "useRpc", as: "useSolanaRpc", from: "@vue-solana/vue/useRpc" },
|
|
54
64
|
{
|
|
55
65
|
name: "useSignAndSendTransaction",
|
|
56
66
|
as: "useSolanaSignAndSendTransaction",
|
|
57
67
|
from: "@vue-solana/vue/useSignAndSendTransaction"
|
|
58
68
|
},
|
|
69
|
+
{
|
|
70
|
+
name: "useSignatureStatus",
|
|
71
|
+
as: "useSolanaSignatureStatus",
|
|
72
|
+
from: "@vue-solana/vue/useSignatureStatus"
|
|
73
|
+
},
|
|
59
74
|
{ name: "useSolana", as: "useSolana", from: "@vue-solana/vue/useSolana" },
|
|
60
75
|
{
|
|
61
76
|
name: "useTransactionConfirmation",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-solana/nuxt",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Nuxt module for Solana applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@vue-solana/core": "0.5.
|
|
42
|
-
"@vue-solana/vue": "0.6.
|
|
41
|
+
"@vue-solana/core": "0.5.1",
|
|
42
|
+
"@vue-solana/vue": "0.6.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@solana/web3-compat": "^0.0.21",
|