refactor: use the SDK blockchain client - #1241
Draft
TaprootFreak wants to merge 1 commit into
Draft
Conversation
🤖 PR Review Bot❌ TypeScript: 4 errorsThis is an automated review. Please address the issues above. |
6 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.
Consumer side of step 5 of DFXswiss/packages#198: use the blockchain client from
@dfx.swiss/reactinstead of a local
useApi()wrapper.Depends on DFXswiss/packages#203.
Changes
Both local hooks stay — what changes is what they call. The HTTP layer and the request/response types
now come from the package; the chain-specific parts stay here, which is exactly the split the package
side was built for:
blockchain-balance.hook.tskeeps the join against the asset list (the API answers with asset ids)and drops its local
BalanceDto/GetBalancesResponse.blockchain-transaction.hook.tskeeps the Solana base64 deserialization and the Tron JSON parsingand drops its local
UnsignedTransactionDto/BroadcastResultDto.No call site of either hook changes.
Before this can go green
The package pin in
package.jsonstill points at the published@dfx.swiss/react, which does notexport
useBlockchainyet. CI stays red until DFXswiss/packages#203 is merged and published andthe pin is raised here. Verified locally against a build of that branch:
tscclean,npm run lintclean, full suite at 673 passing with no new failures (the two suites failing ondeveloptoday still fail, unchanged).