Skip to content

Add SDK getDistributionAccrual method #425

Description

@Levi-Ojukwu

Description:

The distribution contract exposes get_accrual(participant) (at lib.rs:98-100) that returns the total tokens earned by a participant. The SDK does not expose this method.

The accrual is calculated from three sources:

  • LP funding volume reward: lp_volume / 100_000_000 * 10_000_000
  • Freelancer settlement reward: freelancer_settled * 5_000_000
  • Payer on-time reward: payer_on_time * 5_000_000

Why it matters: Participants need to see their pending token earnings before claiming.

Acceptance Criteria:

  • Create a function that calls the contract's get_accrual view
  • Return the total earned amount as a number
  • Add tests

Relevant Files: contracts/iln_distribution/src/lib.rs:98-100, sdk/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