Skip to content

feat(explorer): enable rail settlements in console#98

Open
silent-cipher wants to merge 9 commits intomainfrom
feat/explorer/enable-rail-settlements
Open

feat(explorer): enable rail settlements in console#98
silent-cipher wants to merge 9 commits intomainfrom
feat/explorer/enable-rail-settlements

Conversation

@silent-cipher
Copy link
Collaborator

This Pr includes -

  • Enables rail participants to settle rail in console

closes #83

@vercel
Copy link

vercel bot commented Jan 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
filecoin-pay-explorer Ready Ready Preview, Comment Feb 2, 2026 5:32pm

Request Review

@silent-cipher silent-cipher self-assigned this Jan 30, 2026
@FilOzzy FilOzzy added this to FOC Jan 30, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Jan 30, 2026
@rjan90 rjan90 moved this from 📌 Triage to ⌨️ In Progress in FOC Jan 30, 2026
@silent-cipher silent-cipher marked this pull request as ready for review February 2, 2026 10:00
Copilot AI review requested due to automatic review settings February 2, 2026 10:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables both payers and payees (e.g., Storacha SPs) to settle rails from the console, addressing a critical need where some service provider software doesn't automatically settle. The implementation refactors settlement logic into reusable hooks and removes the payer-only restriction.

Changes:

  • Removed the payer-only restriction from settlement functionality to enable payees to settle rails
  • Refactored settlement logic into reusable useRailSettlements and useRailSettlementCalculations hooks
  • Enhanced UI with improved settlement dialog, inline loading indicators, and new settlement action buttons

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/explorer/src/hooks/useRailSettlements.tsx New hook implementing settlement transaction management with toast notifications
apps/explorer/src/hooks/useRailSettlementCalculations.ts New hook for calculating settlement amounts and epochs
apps/explorer/src/components/shared/InlineTextLoader.tsx New component for inline loading state with spinner
apps/explorer/src/components/UserConsole/SettleRailDialog.tsx Refactored to remove payer-only restriction and improve UI
apps/explorer/src/components/UserConsole/RailsSection/index.tsx Integrated settlement hooks and added settle action handlers
apps/explorer/src/components/UserConsole/RailsSection/components/RailActions.tsx New component providing settlement action button in table rows
apps/explorer/src/components/UserConsole/RailsSection/data/columnDefinitions.tsx Added actions column and refactored to use extended rail type
apps/explorer/src/components/UserConsole/RailsSection/types/index.ts New type definition for extended rail with settlement state
apps/explorer/src/components/shared/Providers.tsx Added custom toast styling (with invalid CSS class)
apps/explorer/src/utils/toast.ts Updated settlement success message to include rail ID
apps/explorer/src/utils/constants.ts Removed SETTLEMENT_FEE constant (settlement fee no longer required)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rjan90 rjan90 moved this from ⌨️ In Progress to 🔎 Awaiting review in FOC Feb 2, 2026
onSettle: (rail: RailExtended) => void;
};

const RailActions = ({ rail, onSettle }: RailActionsProps) => {
Copy link

Choose a reason for hiding this comment

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

instead of prop drilling onSettle all the way through, can this be a react hook instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This feel like over-engineering for a simple callback (only 2 levels of prop passing). I went ahead and implemented it for now in 7e3a571

settledUpto: bigint;
}

export const useRailSettlements = (options: UseRailSettlementsOptions) => {
Copy link

Choose a reason for hiding this comment

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

this hook could use some tests

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The explorer doesn’t have a testing framework configured yet. I’ll raise an issue for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created an issue #102

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ⌨️ In Progress in FOC Feb 2, 2026
@rjan90 rjan90 requested a review from SgtPooki February 3, 2026 07:50
@rjan90 rjan90 moved this from ⌨️ In Progress to 🔎 Awaiting review in FOC Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 Awaiting review

Development

Successfully merging this pull request may close these issues.

Enable payees (e.g., Storacha SPs) to settle

3 participants