fix(types): default TSignedTransaction generic to unknown#49
Merged
Conversation
IWalletAccount<TSignedTransaction> was made generic in 1.0.0-beta.12 with no default type argument. Every bare `IWalletAccount` reference — inside this module's own `.d.ts` files, in `@tetherto/wdk-wallet-evm`, and in `@tetherto/wdk-core` — now fails to compile with "requires 1 type argument(s)" under any TypeScript project that consumes those `.d.ts` files. Defaulting the parameter to `unknown` restores compatibility with every existing bare reference (they resolve to `IWalletAccount<unknown>`) without changing behavior for call sites that already supply an explicit type argument. No runtime change; JSDoc only. Committed types diff is kept minimal — the rest of the `types/` folder is left alone so this PR does not include unrelated regeneration drift.
claudiovb
marked this pull request as ready for review
July 2, 2026 12:49
claudiovb
approved these changes
Jul 2, 2026
1 task
Merged
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.
Summary
IWalletAccount<TSignedTransaction>was made generic in1.0.0-beta.12(via #45) with no default type argument. Every bareIWalletAccountreference — inside this module's own.d.tsfiles, in@tetherto/wdk-wallet-evm, and in@tetherto/wdk-core— now fails to compile under any consumer's TypeScript project:This blocks anything that consumes those
.d.tsfiles, including the WDK docs TypeScript snippets we're preparing for the policy engine documentation.Fix
Add a default
unknownto the template parameter insrc/wallet-account.js:Which emits as
IWalletAccount<TSignedTransaction = unknown>in the.d.ts. Bare references (IWalletAccountwithout<...>) automatically resolve toIWalletAccount<unknown>, restoring compatibility with every existing call site.Scope
src/wallet-account.jstypes/src/wallet-account.d.ts(surgically edited to avoid unrelated regeneration drift — the rest oftypes/is left as-is)Non-goals
The rest of
types/shows drift when regenerated fresh under the pinned tsc 5.8.3 (interfaces emitted as classes, typedef imports rearranged, ~500 lines of noise). That's real but orthogonal to this fix — worth its own PR to runbuild:typesonmainand commit the clean baseline.Test plan
npm run lint— cleannpm test— 19/19 passing.d.tsemitsIWalletAccount<TSignedTransaction = unknown>wdk-core/node_modulesand re-ran the docs snippet TS check — the "requires 1 type argument(s)" errors are goneMarked as draft
Opening as draft since this crosses module boundaries. Happy to iterate before it's marked ready for review.