feat: add SDA protocol support (getSdaProtocol) - #73
Merged
Conversation
This was referenced Jun 24, 2026
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Wire the new `SdaProtocol` category into the WDK so SDA providers can be registered and retrieved alongside swap/bridge/lending/fiat/swidge. - `getSdaProtocol(label)` on `IWalletAccountWithProtocols`. - `registerProtocol` dispatch and per-account getter in `wdk.js` (an `sda` bucket in both protocol registries, plus the `instanceof SdaProtocol` branch). - `getSdaProtocol` -> `sda` mapping in the policy account proxy. Part 2 of 3. Depends on the `SdaProtocol` interface in tetherto/wdk-wallet. Generated `.d.ts` are produced by `npm run build:types`.
AlonzoRicardo
force-pushed
the
feat/sda-protocol
branch
from
July 21, 2026 12:22
70d0d46 to
af7325a
Compare
…te types The SDA interface (wdk-wallet#46) shipped in v1.0.0-beta.15, so depend on the released version instead of the git branch. Regenerate the .d.ts (getSdaProtocol / SdaProtocolCtor / registerProtocol overload), which the original SDA commit omitted.
…orted-op, missing-label)
AlonzoRicardo
force-pushed
the
feat/sda-protocol
branch
from
July 22, 2026 17:47
af7325a to
61cd087
Compare
Replace the standalone wdk-sda.smoke.test.js with getSdaProtocol describe blocks under getAccount and getAccountByPath, mirroring the getSwapProtocol / getSwidgeProtocol siblings (registration, dispatch, missing-label) for coverage parity.
…ned accounts PROTOCOL_GETTERS listed 'sda' but PROTOCOL_METHODS had no matching entry, so getSdaProtocol (and simulate.getSdaProtocol) on a policy-governed account threw 'opsToWrap is not iterable'. Add the SDA state-changing methods (createDepositAddress, renewDepositAddress, recoverDepositAddress, disableDepositAddress) to OPERATIONS and PROTOCOL_METHODS.sda so policies can target and enforce them, extend the PolicyOperation typedef, sync the hand-maintained .d.ts, and add regression tests for the wrapped-DENY and simulate paths.
AlonzoRicardo
marked this pull request as ready for review
July 27, 2026 14:26
Davi0kProgramsThings
requested changes
Jul 28, 2026
…constraint
Address review feedback: the *ProtocolCtor aliases were part of the public type
surface but never exported. Rather than export them, revert to a typeof-based
constraint (the original approach). Inline the qualified
typeof import('@tetherto/wdk-wallet/protocols').X form in the registerProtocol
@template so it still resolves for strict-mode consumers without a value import
of the protocol classes — a bare 'typeof SwapProtocol' re-triggers TS2304 in
this interface file, which is what the ctor typedefs originally worked around.
wdk.js keeps its short 'typeof X' (it imports the classes for instanceof), so
both are now typeof-based with no ad-hoc ctor types.
Davi0kProgramsThings
requested changes
Jul 29, 2026
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
Wires the new
SdaProtocolcategory into the WDK so SDA (Smart Deposit Address) providers can be registered and retrieved alongside swap / bridge / lending / fiat / swidge, and makes SDA operations governable by the policy engine. Part 2 of 3.Depends on the published
@tetherto/wdk-wallet@^1.0.0-beta.15, which ships theSdaProtocolinterface from tetherto/wdk-wallet#46 (merged and released). No branch pin remains.What's in it
Protocol wiring (mirrors the existing swidge wiring exactly)
getSdaProtocol(label)onIWalletAccountWithProtocols, andtypeof SdaProtocoladded to theregisterProtocoltemplate union.wdk.js: ansdabucket in both protocol registries, theinstanceof SdaProtocoldispatch branch inregisterProtocol/_registerProtocols, and the per-accountaccount.getSdaProtocolgetter.getSdaProtocol → 'sda'mapping in the policy account proxy.Policy governance
PROTOCOL_METHODS.sdaand the SDA operation names toOPERATIONS(the policy-rule allow-list) so SDA write methods can be targeted and enforced. Without this,getSdaProtocolon a policy-governed account threwTypeError: opsToWrap is not iterable(the proxy referenced ansdabucket that did not exist inPROTOCOL_METHODS).createDepositAddress,renewDepositAddress,recoverDepositAddress,disableDepositAddress. Read methods (getSupportedRoutes,quoteDeposit, ...) stay unwrapped. Also reflected in thePolicyOperationtype.Tests
getSdaProtocolcoverage undergetAccount/getAccountByPathinwdk.test.js, mirroring the sibling protocol suites.simulate.getSdaProtocol(...)DENY path.Validation
standardlint clean,tsc --noEmitclean.PROTOCOL_METHODS.sdareproduces theopsToWrap is not iterablecrash.Notes
SdaProtocol/ISdaProtocolfrom@tetherto/wdk-wallet/protocols..d.tsdeclarations, kept in sync with the source.Related PRs
Part of a 3-PR set:
SdaProtocolinterface: feat(protocols): add SDA (Smart Deposit Address) protocol interface wdk-wallet#46 (merged, released as v1.0.0-beta.15)getSdaProtocolsupport (this PR)sdamodule type + template: feat: add sda module type and template create-wdk-module#14