Skip to content

feat: add Firo chain support to asset-calculator#18

Closed
reubenyap wants to merge 3 commits intorosen-bridge:devfrom
reubenyap:feature/firo-asset-calculator
Closed

feat: add Firo chain support to asset-calculator#18
reubenyap wants to merge 3 commits intorosen-bridge:devfrom
reubenyap:feature/firo-asset-calculator

Conversation

@reubenyap
Copy link
Copy Markdown

  • Register firo in the NETWORKS constant (no token support, native token firo).
  • Add FiroCalculator that reads locked amounts from the Firo insight-api (/insight-api-zcoin/addr/{address}/balance).
  • Add FiroCalculatorInterface and register FiroCalculator in AssetCalculator.

Part of the RCS-003 Bridge Expansion Kit for Firo.

- Register `firo` in the `NETWORKS` constant (no token support, native
  token `firo`).
- Add `FiroCalculator` that reads locked amounts from the Firo
  insight-api (`/insight-api-zcoin/addr/{address}/balance`).
- Add `FiroCalculatorInterface` and register `FiroCalculator` in
  `AssetCalculator`.

Part of the RCS-003 Bridge Expansion Kit for Firo.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 20, 2026

@reubenyap is attempting to deploy a commit to the rosen-bridge Team on Vercel.

A member of the Team first needs to authorize it.

With firo in NETWORKS_KEYS but not yet in configs.chains, ChainChoices
is wider than keyof typeof configs.chains. Adjust the two spots that
index configs.chains[chain] so tsc stays green until the backend Firo
config lands:

- assetAggregator: cast chain to keyof typeof configs.chains at the
  index site.
- assetDataAdapters: narrow createChainSpecificDataAdapter's chain
  parameter from ChainChoices to keyof typeof configs.chains (the
  switch never handled firo anyway), removing the now-unused
  ChainChoices import.
`path.posix.relative` cannot produce a correct relative path from two
Windows-absolute paths, so `getKnipCommand` was emitting garbage like
`knip --dependencies --workspace ../E:\Github\rosen-ui\packages\X`,
which knip rejects as "Workspace is not a directory". This blocked
pre-commit hooks on Windows for any commit touching package sources.

Use the cross-platform `path.relative` and normalize separators to
forward slashes (matching the existing type-check line that already
uses `path.relative`).
@reubenyap
Copy link
Copy Markdown
Author

Superseded by #19.

#19 now contains the full Firo asset-calculator change set (the three commits from this PR, minus the Windows lint-staged fix) plus the rosen-service wiring that was missing here. Reviewer-friendly commit layout:

  1. feat: add Firo chain support to asset-calculator
  2. fix(rosen-service2): narrow chain types so firo doesn't break tsc (kept per maintainer guidance on feat: add Firo network support #16)
  3. feat: add Firo chain support to rosen-service

The Windows-only .lintstagedrc.mjs knip-path fix is split out to #20.

Closing in favour of #19.

@reubenyap reubenyap closed this Apr 22, 2026
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