@naculus/connect-appkit-react 0.2.3 → 0.2.4

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
@@ -1,7 +1,7 @@
1
1
  # @naculus/connect-appkit-react
2
2
 
3
3
  **React bindings for Naculus Connect** — 54 hooks plus auto-generated React
4
- wrappers for all 24 Stencil components.
4
+ wrappers for all 28 Stencil components.
5
5
 
6
6
  The components are the smaller half. Two files in this package contain JSX; the
7
7
  rest is connection state, capability negotiation, session keys, simulation and
@@ -69,7 +69,8 @@ function App() {
69
69
 
70
70
  **Routing** — `useRouteQuote`, `useExecuteRoute`, `useCompareCosts`
71
71
 
72
- **Solana** — `useSolanaAccount`, `useSolanaBalance`, `useSolanaTransaction`
72
+ **Solana** — `useSolanaAccount`, `useSolanaBalance`, `useSolanaTransaction`,
73
+ `useSolanaRoles`
73
74
 
74
75
  **Embedded wallet** — `useEmbeddedWallet`, `usePassphraseGate`
75
76
 
@@ -92,6 +93,23 @@ implement `wallet_getCapabilities` has not said no — EIP-5792 is explicit that
92
93
  absence is not a denial, and `"unknown"` also covers a query that failed or is
93
94
  still in flight.
94
95
 
96
+ ### Ask a Solana wallet which role it can fill
97
+
98
+ ```tsx
99
+ const { signer, payer, absence } = useSolanaRoles();
100
+
101
+ if (absence === null && signer === null) {
102
+ // The wallet said so: it signs and sends, but will not hand back a signed
103
+ // transaction. Offer another wallet before the co-signing flow starts.
104
+ }
105
+ ```
106
+
107
+ `signer` and `payer` are `null` when the wallet declared it cannot fill that
108
+ role. `absence` says why there is no answer at all — `"no_session"`,
109
+ `"not_solana"`, or `"unreported"` for a `@naculus/connector-solana` older
110
+ than the roles API — so a wallet that has not been asked is never shown as one
111
+ that cannot sign. Reading roles never prompts.
112
+
95
113
  ## License
96
114
 
97
115
  MIT