Skip to content

feat: add Firo network support#16

Open
reubenyap wants to merge 10 commits intorosen-bridge:devfrom
reubenyap:cursor/-bc-2b025ca2-9368-47a2-ac62-6845cce1b479-2154
Open

feat: add Firo network support#16
reubenyap wants to merge 10 commits intorosen-bridge:devfrom
reubenyap:cursor/-bc-2b025ca2-9368-47a2-ac62-6845cce1b479-2154

Conversation

@reubenyap
Copy link
Copy Markdown

Summary

This PR adds complete Firo chain integration to the Rosen Bridge UI, following the established UTXO chain pattern used by Doge and Bitcoin.

Note: This PR supersedes #15 and incorporates all of its changes along with fixes for the review feedback raised there.

Commits

The PR is structured as two commits for easy review:

  1. feat: add Firo network support — The full Firo integration (equivalent to the changes in add firo support #15)
  2. fix: address review feedback on Firo integration — Fixes for the issues identified in the add firo support #15 review

Changes

Firo Integration (commit 1)

  • networks/firo/: Network package with client class, constants, types, UTXO selection, transaction generation, and BlockCypher API utilities
  • wallets/firo-wallet/: Wallet package with browser extension integration (connect, sign, broadcast)
  • apps/rosen/: App wiring with server actions, lock address config, and wallet registration
  • packages/constants: Add Firo to NETWORKS (index 7, native token: firo)
  • packages/icons: Add Firo network SVG icon
  • packages/utils: Add Firo explorer URLs (address, token, tx)
  • apps/rosen-service: Gracefully skip unconfigured chains in commitment extractor registration
  • apps/rosen/.env.example: Add FIRO_BLOCKCYPHER_API variable

Review Fixes (commit 2)

Addresses the feedback from #15:

  • build.sh: Add networks/firo and wallets/firo-wallet workspaces to the build script (per BEK documentation requirement, as noted by @abdolian)
  • firo.svg: Remove XML declaration and unnecessary attributes; keep only viewBox and xmlns consistent with other network SVGs (as noted by @abdolian)
  • getMaxTransfer.ts: Fix typo opRetrunDataLengthopReturnDataLength
  • utils.ts: Fix incorrect JSDoc @param references

cursoragent and others added 2 commits April 4, 2026 16:23
Add complete Firo chain integration following the established UTXO chain
pattern (Doge/Bitcoin):

- networks/firo: Network package with client, constants, types, UTXO
  selection, transaction generation, and BlockCypher API utilities
- wallets/firo-wallet: Wallet package with browser extension integration
  (connect, sign, broadcast)
- apps/rosen: App wiring with server actions, lock address config, and
  wallet registration
- packages/constants: Add Firo to NETWORKS (index 7, native token: firo)
- packages/icons: Add Firo network SVG icon
- packages/utils: Add Firo explorer URLs (address, token, tx)
- apps/rosen-service: Gracefully skip unconfigured chains in commitment
  extractor registration

Co-authored-by: Reuben Yap <[email protected]>
- Add networks/firo and wallets/firo-wallet to build.sh (BEK requirement)
- Clean up firo.svg: remove XML declaration and unnecessary attributes,
  keep only viewBox and xmlns (consistent with other network SVGs)
- Fix typo: opRetrunDataLength -> opReturnDataLength in getMaxTransfer.ts
- Fix incorrect JSDoc @param references in utils.ts

Co-authored-by: Reuben Yap <[email protected]>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 4, 2026

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

A member of the Team first needs to authorize it.

@reubenyap reubenyap mentioned this pull request Apr 4, 2026
vorujack
vorujack previously approved these changes Apr 16, 2026
RaaCT0R
RaaCT0R previously approved these changes Apr 16, 2026
@cursor cursor Bot dismissed stale reviews from RaaCT0R and vorujack via ed5812b April 16, 2026 07:13
vorujack
vorujack previously approved these changes Apr 16, 2026
ChainChoices (derived from NETWORKS_KEYS) includes chains like firo
that have no entry in the Chains config type nor a data adapter. Using
the broader ChainChoices type to index configs.chains / drive the adapter
switch made the switch non-exhaustive and caused type-check failures.

Narrow the index cast in assetAggregator and the parameter of
createChainSpecificDataAdapter to keyof Chains so indexing is valid and
the switch is exhaustive, eliminating the inferred undefined in the
return type.

https://claude.ai/code/session_01MJPsWRuNaJm3GSREcoMDJ5
reubenyap and others added 2 commits April 17, 2026 18:02
- Align FiroWallet.performConnect with MyDogeWallet and other sibling
  wallets by calling this.isConnected() (base-class wrapper that
  asserts availability and swallows connection-check errors) instead
  of the raw hasConnection() vendor probe.
- Add a changeset covering the full Firo integration plus the
  rosen-service2 type-narrowing fix so the changeset CI check passes.

https://claude.ai/code/session_01MJPsWRuNaJm3GSREcoMDJ5
vorujack
vorujack previously approved these changes Apr 18, 2026
RaaCT0R
RaaCT0R previously approved these changes Apr 18, 2026
Comment thread apps/rosen-service2/src/services/assetAggregator.ts
Comment thread .changeset/firo-network-support.md Outdated
@reubenyap reubenyap dismissed stale reviews from RaaCT0R and vorujack via 5c28730 April 19, 2026 10:38
vorujack
vorujack previously approved these changes Apr 19, 2026
`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`).
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.
export const getAddressUtxos = async (
address: string,
): Promise<Array<FiroUtxo>> => {
const blockcypherUrl = `${process.env.FIRO_BLOCKCYPHER_API}`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know the reason

Do we have a Blockcypher API for Firo? If not, these functions should be implemented with suitable API, such as node RPC, which is used in guard-service and watcher.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of changing to another API, don't forget to remove the FIRO_BLOCKCYPHER_API env var in apps/rosen/.env.example and add new variables for the new API.

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.

6 participants