Repository navigation
Conversation
Add a reactiveSigner() kit plugin that installs a mutable signer as the client's payer and identity (with subscribeToPayer/subscribeToIdentity), and read it with @solana/react's usePayer via a new useWalletSigner hook. Remove WalletProvider, WalletContext and useKitWallet.
…client WalletAdapterCompatProvider now calls client.setSigner() from grill's reactiveSigner() plugin instead of rendering grill's WalletProvider, so it must be rendered inside @solana/react's ClientProvider.
Install reactiveSigner() on the app's client, move WalletAdapterCompatProvider inside ClientProvider, and switch the examples to useWalletSigner. The wallet page now demonstrates the client-held signer (usePayer/useIdentity, nested ClientProvider) instead of WalletProvider.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideThis PR replaces grill's wallet-specific React context with a reactive signer held on the @solana/kit client as both Sequence diagram for wallet signer synchronizationsequenceDiagram
participant Wallet as WalletAdapter
participant Compat as WalletAdapterCompatProvider
participant Client as KitClient
participant React as useWalletSigner
participant Grill as GrillTransactionPath
Wallet->>Compat: wallet state changes
Compat->>Compat: createWalletTransactionSendingSigner
Compat->>Client: setSigner(signer)
Client-->>React: subscribeToPayer notification
React->>Client: usePayer(client)
Client-->>React: payer or no connected signer
React-->>Grill: GrillSigner or null
Grill->>Grill: useSendTX or useSignTX
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
grill-example-dapp | aa9a403 | Commit Preview URL Branch Preview URL |
Oct 30 2026, 06:59 AM |
…ddress> The Partial<signTransactions> half of GrillSigner was never read in grill; useSignTX detects partial/modifying signers at runtime with kit's guards. Use kit's TransactionSendingSigner<Address> directly instead.
…gner-on-client # Conflicts: # bun.lock # packages/grill/src/hooks/use-connected-wallet.ts # packages/grill/src/providers/grill-headless-provider.tsx # packages/grill/src/types.ts # packages/grill/src/utils/internal/create-sign-tx.test.ts # packages/grill/src/utils/internal/create-sign-tx.ts # packages/react-quarry/src/hooks/use-quarry-claim-mm.ts # packages/react-quarry/src/hooks/use-quarry-deposit-mm.ts # packages/react-quarry/src/hooks/use-quarry-withdraw-mm.ts # packages/wallet-adapter-compat/package.json
- use-send-tx (new on master) reads the signer with useWalletSigner instead of the removed useKitWallet - use-send-tx.test drops the removed WalletProvider wrapper - convert this branch's new grill files (reactive-signer, use-wallet-signer and tests) to granular @solana/* imports - wallet-adapter-compat keeps @solana/kit as a peer since it now depends on @solana/react - changeset: point at @solana/signers and note the kit peer on wallet-adapter-compat
What / why
Grill kept its own wallet plumbing (
WalletProvider+WalletContext+useKitWallet) next to the kit client. With @solana/kit 8 the client can carry the signer itself through thepayer/identitycapabilities from@solana/plugin-interfaces, and@solana/reactalready hasusePayer(client)/useIdentity(client)to read them. This PR moves the wallet signer onto the client and deletes grill's wallet context.Follows #250, which moved grill onto
@solana/react'sClientProvider. As agreed,@solana/wallet-adapterand@macalinao/wallet-adapter-compatstay. This does not migrate to wallet-standard /SelectedWalletAccountContextProvider.Changes
reactiveSigner(initial?)kit plugin. It installspayerandidentity(the sameTransactionSendingSigner<Address>),subscribeToPayer/subscribeToIdentity, and asetSigner(signer | null)method. It also exports theClientWithReactiveSignertype.useWalletSigner(): TransactionSendingSigner<Address> | null. It readsclient.payerthroughusePayerfrom@solana/react.useConnectedWallet()now usesuseWalletSigner(). It still throws"Wallet is not connected".GrillHeadlessProvider(theuseSendTXpath) anduseSignTXread the signer fromuseWalletSigner().WalletProvider,WalletProviderProps,WalletContext,WalletContextStateanduseKitWallet.WalletAdapterCompatProviderstill builds theTransactionSendingSignerfrom wallet-adapter. It now callsclient.setSigner(...)in a layout effect instead of rendering grill'sWalletProvider. It gets the client throughuseClientCapability({ capability: "setSigner" }), so a missing plugin fails with a clear error.@solana/reactis now a peer dependency.useKitWallet().signerbecomesuseWalletSigner().reactiveSigner(), andWalletAdapterCompatProvidermoves insideClientProvider.useWalletSigner.usePayer/useIdentityagree withuseWalletSigner, and a nestedClientProviderwith an emptyreactiveSigner()stands in for the old nestedWalletProvider signer={null}.docs/grill/*.react-dom/server) foruseWalletSigner/useConnectedWallet: connected, empty, no payer capability, a payer that is not a sending signer, and the throw.Design decisions
Is there a kit plugin for this already?
@solana/kit-plugin-signeronly installs a staticpayer/identity.@solana/kit-plugin-walletinstalls a reactive one, but it is built on wallet-standard, which is out of scope. So grill adds a small plugin,reactiveSigner, about 50 lines of logic. It follows kit-plugin-wallet's conventions:SOLANA_ERROR__WALLET__NO_SIGNER_CONNECTEDwhile no signer is set, soObject.entriesand spreading the client don't throw;subscribeTo*functions from@solana/plugin-interfacesfor reactivity.usePayercatches the throw and returnsundefined, and it re-renders throughsubscribeToPayer(useSyncExternalStore).payer vs identity: the plugin sets both to the same signer, like kit-plugin-wallet's
walletSigner(), so kit-native code that reads either one works. Grill itself readspayeronly. Grill's send and sign paths use the signer as the transaction fee payer, sopayeris the capability that matches. Reading one capability everywhere also means grill can't end up with two different signers. A side effect:walletSigner()from@solana/kit-plugin-walletcan replacereactiveSigner()+WalletAdapterCompatProviderwith no grill changes.Narrowing:
usePayerreturns aTransactionSigner, but grill's send path needs aTransactionSendingSigner.useWalletSignerreturns the payer only whenisTransactionSendingSigner(payer), andnullotherwise. A client with no payer capability at all also givesnull, so read-only apps don't need the plugin.No deprecated aliases: the
useKitWallet/WalletProvidersemantics (context-scoped, needed a provider) no longer apply. Keeping them would leave behind the code this PR is meant to delete. This is a breakingminor, since all packages are pre-1.0.Migration
Caveats / follow-ups
@solana/kit-plugin-signer, counts as "no wallet" for grill. Follow-up: send throughrpcwhen the payer is only a partial signer.ClientProvider(the example page shows this).WalletAdapterCompatProvidersets the signer in a layout effect, so on the very first render the children seenulluntil the effect runs. WithautoConnectthis matches the old behaviour, because the wallet connects asynchronously anyway.signer.signMessagesnippet indocs/grill/04-transactions.mdwas not changed.signMessageis not on a transaction signer..changeset/wallet-signer-on-client.md(grill, react-quarry and wallet-adapter-compat, all minor).bun run build,bun run lintandbun run testpass locally.Summary by Sourcery
Move wallet signer state from Grill React context onto the Solana Kit client and update integrations to consume the reactive client capabilities.
New Features:
reactiveSignerkit plugin anduseWalletSignerhook for reactive client-based wallet signer access.payerandidentitycapabilities for use by Grill transaction flows and Solana React hooks.Enhancements:
GrillSignertype in favor of standard Solana Kit signer types.Documentation:
Tests:
Chores:
Update the example dapp and package metadata for the new provider hierarchy and peer dependencies.
Removed the
GrillSignertype. UseTransactionSendingSigner<Address>from@solana/kitinstead.