@solana/react-hooks 1.3.0 → 1.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 +16 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -196,6 +196,21 @@ function TokenPanel({
|
|
|
196
196
|
- `owner` — override balance owner (defaults to connected wallet)
|
|
197
197
|
- `revalidateOnFocus` — refresh when window regains focus
|
|
198
198
|
- `swr` — additional SWR options
|
|
199
|
+
- `config.tokenProgram` — token program: `'auto'` for detection, or explicit address
|
|
200
|
+
|
|
201
|
+
### Token 2022 support
|
|
202
|
+
|
|
203
|
+
Token 2022 mints are supported via the `tokenProgram` config option:
|
|
204
|
+
|
|
205
|
+
```tsx
|
|
206
|
+
// Auto-detect Token or Token 2022
|
|
207
|
+
const { balance, send } = useSplToken(mint, {
|
|
208
|
+
config: { tokenProgram: "auto" },
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// Balance and transfers work the same way
|
|
212
|
+
<p>Balance: {balance?.uiAmount ?? "0"}</p>
|
|
213
|
+
```
|
|
199
214
|
|
|
200
215
|
### Fetch address lookup tables
|
|
201
216
|
|
|
@@ -459,6 +474,7 @@ This approach follows Wallet Standard's wallet-agnostic discovery pattern while
|
|
|
459
474
|
|
|
460
475
|
## More resources
|
|
461
476
|
|
|
477
|
+
- [Documentation](https://www.framework-kit.com/) — full guides and API reference
|
|
462
478
|
- Playground: `examples/vite-react` (run with `pnpm install && pnpm dev`).
|
|
463
479
|
- Next.js reference app: `examples/nextjs`.
|
|
464
480
|
- Hook JSDoc lives in `src/hooks.ts`, `src/queryHooks.ts`, `src/ui.tsx`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/react-hooks",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "React hooks for the @solana/client Solana client",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": "./dist/index.browser.mjs",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@solana/kit": "^5.0.0",
|
|
45
45
|
"swr": "^2.3.6",
|
|
46
46
|
"zustand": "^5.0.0",
|
|
47
|
-
"@solana/client": "1.
|
|
47
|
+
"@solana/client": "1.6.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/react": "^19.0.0",
|
|
51
|
-
"react": "^19.
|
|
51
|
+
"react": "^19.2.3"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"react": ">=18"
|