Add ClientWithIdentity plugin interface#1530
Conversation
This PR adds a new `ClientWithIdentity` interface to `@solana/plugin-interfaces` alongside the existing `ClientWithPayer`, exposing `client.identity` as a `TransactionSigner` representing the wallet that owns things in the application — such as the authority over accounts, tokens, or other on-chain assets owned by the current user. Whereas `ClientWithPayer` describes the signer responsible for paying transaction fees and storage costs, `ClientWithIdentity` describes the signer whose assets the app is acting upon. In many apps these refer to the same wallet, but they can differ — for instance, when a service funds transactions on behalf of a user.
🦋 Changeset detectedLatest commit: 7d0b65b The changes in this PR will be included in the next version bump. This PR includes changesets to release 46 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
BundleMonUnchanged files (142)
No change in files bundle size Final result: ✅ View report in BundleMon website ➡️ |
trevor-cortex
left a comment
There was a problem hiding this comment.
Summary
Adds a new ClientWithIdentity plugin interface to @solana/plugin-interfaces that exposes client.identity as a TransactionSigner representing the wallet that owns things in the application (authority over accounts, tokens, on-chain assets). This complements the existing ClientWithPayer, which describes the fee/storage payer. The distinction matters for apps where a service funds transactions on behalf of a user.
The PR includes:
- New
identity.tstype definition with thorough JSDoc and a cross-reference toClientWithPayer. - Type tests mirroring the existing
payer-typetest.ts(identity is aTransactionSigner, combinable via intersection). - README section with a realistic NFT plugin example.
- Updated
payer.tsJSDoc to cross-referenceClientWithIdentityand clarify the payer covers fees and storage costs. - Alphabetically correct export placement in
index.ts. - Minor changeset.
Overall this looks clean and well-documented — it mirrors the existing ClientWithPayer conventions precisely. LGTM from my side.
Things to watch out for
- Type-only change, no runtime behavior. The type tests cover the basic shape but there's not much else to verify functionally.
identity.tsimportsTransactionSigneras a value (import { TransactionSigner }) rather thanimport type, matching the existingpayer.tsstyle — consistent, but both files would ideally useimport typesince it's used only as a type. Not a blocker and out of scope for this PR.- The JSDoc
@exampleinidentity.tsreferencesAddresswithout importing it, same aspayer.tsdoes withAddressandLamports. Consistent with the existing convention for inline examples.
Notes for subsequent reviewers
- Verify the semantic distinction between
payerandidentitymatches how downstream plugins (wallet adapters, NFT plugins, etc.) are expected to consume these. The docs are clear but worth confirming with whoever owns the plugin ecosystem direction. - Consider whether a future follow-up should introduce a combined convenience type (e.g.
ClientWithPayerAndIdentity) or whether intersection at the call site is preferred — the type test already demonstrates the intersection pattern works fine.
|
Documentation Preview: https://kit-docs-8hol7apci-anza-tech.vercel.app |
|
Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up. |

This PR adds a new
ClientWithIdentityinterface to@solana/plugin-interfacesalongside the existingClientWithPayer, exposingclient.identityas aTransactionSignerrepresenting the wallet that owns things in the application — such as the authority over accounts, tokens, or other on-chain assets owned by the current user. WhereasClientWithPayerdescribes the signer responsible for paying transaction fees and storage costs,ClientWithIdentitydescribes the signer whose assets the app is acting upon. In many apps these refer to the same wallet, but they can differ — for instance, when a service funds transactions on behalf of a user.