feat: add signer capability architecture - #326
Merged
El-swaggerito merged 1 commit intoJul 27, 2026
Merged
Conversation
Contributor
| \nThis PR is currently blocked by merge conflicts.\n\nPlease update the branch with the latest main branch and resolve the conflicts before it can be merged. |
AndreyDelgado
force-pushed
the
feat--add-signer-capability-architecture
branch
from
July 27, 2026 23:17
d0a1377 to
268349c
Compare
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #269
feat: add signer capability architecture
Separate read-only accounts, local secret-bearing wallets, signing
capability, and transaction submission, and check that capability
before signing instead of discovering it via try/catch.
src/account/:
ReadOnlyAccount | SigningAccount, on the literal
canSignfield, socanSignTransaction(account)narrowssignerfromSigner | undefinedto exactly
Signerat compile time.mobile/browser signers (contract only, no adapter implemented).
Reuses the SDK's existing capability standard (assertCapability,
SDK_CAPABILITIES['signer.remote']) for "not supported yet" instead
of a new error code.
(TX_SIGNER_MISSING) instead of a generic Error.
src/transactions/offline-preparation.ts:
point that verifies canSignTransaction(account) and that the signer
matches the transaction's source account BEFORE calling sign().
Delegates to the existing signTransactionWithSigner(), which is
otherwise unchanged; signTransaction() and the raw-secret flow
(sendXLM/sendAsset) are untouched.
src/errors/codes.ts:
signer). Deliberately does not add a third "unsupported capability"
code — that case is covered by the already-merged
UnsupportedFeatureError/assertCapability standard (Implement SDK unsupported feature and capability error standard #284/feat: implement SDK unsupported feature and capability error standard (#284) #299).
Security fix (src/account/signer.ts):
via JSON.stringify() or Node's console.log()/util.inspect() — both
now surface only { publicKey }. Found while verifying the secret
boundary for this change; predates it.
Tests (tests/signer-capability.test.ts, 20 tests):
any signer is touched.
signTransaction()/signTransactionWithSigner() paths (compatibility
regression).
through signWithAccount() unchanged.
properties or serialization.
Docs:
capability is checked before signing, what the model does and does
NOT guarantee.
alternatives considered, and reconciliation with the concurrently
merged capability error standard.
docs/adr/README.md, CHANGELOG.md.
No breaking changes: full existing test suite (706 tests) passes
unchanged on top of this change, rebased onto origin/main @ ebd75d1.