Skip to content

refactor: use the SDK blockchain client - #1241

Draft
TaprootFreak wants to merge 1 commit into
developfrom
feat/use-packages-blockchain
Draft

refactor: use the SDK blockchain client#1241
TaprootFreak wants to merge 1 commit into
developfrom
feat/use-packages-blockchain

Conversation

@TaprootFreak

Copy link
Copy Markdown
Contributor

Consumer side of step 5 of DFXswiss/packages#198: use the blockchain client from @dfx.swiss/react
instead 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.ts keeps the join against the asset list (the API answers with asset ids)
    and drops its local BalanceDto / GetBalancesResponse.
  • blockchain-transaction.hook.ts keeps the Solana base64 deserialization and the Tron JSON parsing
    and drops its local UnsignedTransactionDto / BroadcastResultDto.

No call site of either hook changes.

Before this can go green

The package pin in package.json still points at the published @dfx.swiss/react, which does not
export useBlockchain yet. CI stays red until DFXswiss/packages#203 is merged and published and
the pin is raised here.
Verified locally against a build of that branch: tsc clean,
npm run lint clean, full suite at 673 passing with no new failures (the two suites failing on
develop today still fail, unchanged).

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

🤖 PR Review Bot

❌ TypeScript: 4 errors


This is an automated review. Please address the issues above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant