Skip to content

fix: type issues#826

Open
rmeena840 wants to merge 2 commits intomasterfrom
825-fix-type-issues-in-byield
Open

fix: type issues#826
rmeena840 wants to merge 2 commits intomasterfrom
825-fix-type-issues-in-byield

Conversation

@rmeena840
Copy link
Contributor

@rmeena840 rmeena840 commented Feb 23, 2026

Description

Closes: #825


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues._

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • provided a link to the relevant issue or specification
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary

Summary by Sourcery

Align NBTC controller, tests, and UI with updated indexer and RPC types while adjusting redeem flow status messaging.

Bug Fixes:

  • Use the configured NBTC setup identifier when fetching deposits for a BTC address.
  • Update imports and mocked Sui indexer methods to match the latest shared RPC type definitions and API surface.

Enhancements:

  • Refine redeem status step labeling to reflect the new signing phase in the redeem flow UI.

Signed-off-by: rmeena840 <rmeena840@gmail.com>
@rmeena840 rmeena840 self-assigned this Feb 23, 2026
@rmeena840 rmeena840 requested a review from a team as a code owner February 23, 2026 11:44
@rmeena840 rmeena840 linked an issue Feb 23, 2026 that may be closed by this pull request
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Aligns nBTC controller, UI, and server types with updated indexer/rpc type definitions and API expectations, including a new setupId, updated BTC indexer call, expanded Sui indexer mock interface, and corrected Redeem type imports and status labels.

Class diagram for updated nBTC controller and indexer RPC types

classDiagram
class Controller {
  + BtcIndexerRpc btcindexer
  + SuiIndexerRpc suiIndexer
  + BitcoinNetworkType network
  + ParamsDB paramsDB
  + number setupId
}

class BtcIndexerRpc {
  + nbtcMintTxsBySuiAddr(suiAddr: string)
  + depositsBySender(btcAddr: string, setupId: number)
}

class SuiIndexerRpc {
  + finalizeRedeems()
  + putRedeemTx()
  + getBroadcastedRedeemTxIds()
  + confirmRedeem()
  + redeemsBySuiAddr()
  + getConfirmingRedeems()
  + updateRedeemStatus()
  + updateRedeemStatuses()
}

Controller --> BtcIndexerRpc : uses
Controller --> SuiIndexerRpc : uses
Loading

File-Level Changes

Change Details Files
Parameterize BTC indexer calls with a fixed setup identifier instead of network mapping.
  • Add setupId numeric property (default 1) to the nBTC Controller class with a TODO to update it later
  • Change depositsBySender call to use this.setupId rather than BitcoinNetworkTypeMap[network] when querying deposits
app/server/nbtc/controller.server.ts
Update Sui indexer mocks to match the expanded RPC/interface surface.
  • Rename mocked finalizeRedeem to finalizeRedeems to match new method name
  • Add mocks for getConfirmingRedeems, updateRedeemStatus, and updateRedeemStatuses on SuiIndexerRpc
app/server/nbtc/controller.server.test.ts
Align redeem-related types and UI copy with new redeem status model and shared rpc-types package.
  • Change RedeemRequestResp import source from @gonative-cc/sui-indexer/models to @gonative-cc/lib/rpc-types in both client and server code
  • Update the step label for the intermediate redeem status from 'Transaction solved' to 'Transaction signing' in the expandable details view
app/pages/nbtc-mint/ExpandableRedeemDetails.tsx
app/pages/nbtc-mint/RedeemBTCTable.tsx
app/server/nbtc/jsonrpc.ts

Assessment against linked issues

Issue Objective Addressed Explanation
#825 Fix all TypeScript type errors reported by bun tsc -b --noEmit -w related to the byield functionality/module.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • The new setupId: number = 1 field in Controller is a hard-coded magic value with a TODO; consider deriving it deterministically from network (e.g., via a mapping or config) or injecting it via the constructor so behavior is explicit and testable.
  • The change to depositsBySender(btcAddr, this.setupId) alters the second argument from a network enum to a numeric setup ID; if both are still needed, consider overloading or wrapping this call to avoid conflating concepts and to keep the caller API self-explanatory.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `setupId: number = 1` field in `Controller` is a hard-coded magic value with a TODO; consider deriving it deterministically from `network` (e.g., via a mapping or config) or injecting it via the constructor so behavior is explicit and testable.
- The change to `depositsBySender(btcAddr, this.setupId)` alters the second argument from a network enum to a numeric setup ID; if both are still needed, consider overloading or wrapping this call to avoid conflating concepts and to keep the caller API self-explanatory.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Signed-off-by: rmeena840 <rmeena840@gmail.com>
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.

Fix type issues in byield

1 participant