Skip to content

Add top-payers CLI command #416

Description

@Levi-Ojukwu

Description:

The contract maintains a fixed-size min-heap of the top 50 payers by reputation score (in contracts/invoice_liquidity/src/top_payers.rs). This data is valuable for LPs evaluating which payers to fund, but the CLI has no command to query it.

The get_top_payers(limit) function returns up to limit payers sorted by descending score. The heap is maintained automatically when payer scores change.

The CLI command should:

  • Accept --limit parameter (default 10, max 50)
  • Display payers in a formatted table with address and score
  • Sort by descending score

Why it matters: LPs need to quickly identify high-reputation payers to make informed funding decisions. A CLI command provides instant access without writing code.

Acceptance Criteria:

  • Create cli/src/commands/top-payers.ts
  • Accept --limit parameter with validation (1-50)
  • Display results in a formatted table
  • Register in cli/src/index.ts as iln top-payers
  • Add tests

Relevant Files: contracts/invoice_liquidity/src/top_payers.rs, cli/src/index.ts


Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions