@solana/react-hooks 1.3.0 → 1.4.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 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`.
@@ -68,7 +68,7 @@ export declare function useWalletSession(): WalletSession | undefined;
68
68
  * @example
69
69
  * ```ts
70
70
  * const actions = useWalletActions();
71
- * await actions.connectWallet('phantom');
71
+ * await actions.connectWallet('wallet-standard:phantom');
72
72
  * ```
73
73
  */
74
74
  export declare function useWalletActions(): Readonly<{
@@ -89,7 +89,7 @@ export declare function useWalletActions(): Readonly<{
89
89
  * @example
90
90
  * ```ts
91
91
  * const connect = useConnectWallet();
92
- * await connect('phantom', { autoConnect: true });
92
+ * await connect('wallet-standard:phantom', { autoConnect: true });
93
93
  * ```
94
94
  */
95
95
  export declare function useConnectWallet(): (connectorId: string, options?: Readonly<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/react-hooks",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "React hooks for the @solana/client Solana client",
5
5
  "exports": {
6
6
  "browser": "./dist/index.browser.mjs",
@@ -44,11 +44,12 @@
44
44
  "@solana/kit": "^5.0.0",
45
45
  "swr": "^2.3.6",
46
46
  "zustand": "^5.0.0",
47
- "@solana/client": "1.5.0"
47
+ "@solana/client": "1.7.0"
48
48
  },
49
49
  "devDependencies": {
50
+ "@solana/connector": "^0.2.3",
50
51
  "@types/react": "^19.0.0",
51
- "react": "^19.0.0"
52
+ "react": "^19.2.3"
52
53
  },
53
54
  "peerDependencies": {
54
55
  "react": ">=18"