refactor: use the SDK custody client - #1243
Draft
TaprootFreak wants to merge 2 commits into
Draft
Conversation
🤖 PR Review Bot❌ TypeScript: 40 errorsThis is an automated review. Please address the issues above. |
This was referenced Aug 3, 2026
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.
Consumer side of step 4 of DFXswiss/packages#198: use the custody client from
@dfx.swiss/reactand drop the local copies.
Depends on DFXswiss/packages#202.
Changes
src/dto/safe.dto.tsandsrc/dto/order.dto.tskeep only what is local: the screen's operationenums (
SafeOperationType,TransactionMode,TransactionType,FiatCurrency), the staffCustodyOrderListEntry, andExchangeRate. Every wire type now comes from the package;OrderPaymentDataandOrderPaymentInfoareCustodyOrderPaymentInfoandCustodyOrderthere.useSafecallsuseCustody()instead of building URLs by hand. The screen state — loading flags,request generations, account selection, asset pairing, the PDF download to disk — stays here.
accountPath()is gone:toCustodyAccountId(account)from the package resolves the legacyaccount's null id.
What the corrected types surfaced
Three requests that the API would have rejected are now impossible to build:
custody token, so
custodyToken()fails here instead of the request failing there.number | undefined. The API prices from oneside or the other and rejects a request carrying both or neither.
orderAmount()decides which onegoes out and refuses when there is none.
data.bankAccount?.iban, which the API requires. It is now checked beforethe request.
isOwnAccountreadsaccount.isOwnerinstead of inferring ownership from the presence of an ownerrelation — the comment there asked for exactly that once the API exposed the flag. It does.
Before this can go green
The package pin in
package.jsonstill points at the published@dfx.swiss/react. CI stays reduntil DFXswiss/packages#202 is merged and published and the pin is raised here. Verified locally
against a build of that branch:
tscclean,npm run lintclean, full suite at 673 passing with nonew failures (the two suites failing on
developtoday still fail, unchanged).