Skip to content

[BE-63] Implement Stellar dividends and on-chain voting API #936

Description

@yusuftomilola

Overview

Token holders in a tokenized asset can receive dividend payments proportional to their holdings, and participate in governance votes on asset decisions. This issue exposes the dividends and voting contract modules as API endpoints. Enables FE-46 (Dividend UI) and FE-45 (Voting UI).

Context

  • Depends on BE-62 (tokenization must be active for an asset)
  • Contract sources: contracts/assetsup/src/dividends.rs and contracts/assetsup/src/voting.rs
  • Dividend distribution requires the caller to have sufficient XLM or token balance to distribute

Acceptance Criteria

  • POST /stellar/assets/:id/dividends/distribute body: { totalAmount: number, token: 'XLM'|string } — calls contract distribute_dividends(), returns the transaction hash and per-holder amounts
  • GET /stellar/assets/:id/dividends/history — list of past distributions with amounts and dates (read from on-chain events)
  • GET /stellar/assets/:id/dividends/my — dividends owed to the current user's Stellar address
  • POST /stellar/assets/:id/votes body: { title, description, options: string[], closesAt } — creates an on-chain governance proposal
  • POST /stellar/assets/:id/votes/:proposalId/cast body: { option: number } — casts a vote (weighted by token holdings)
  • GET /stellar/assets/:id/votes — list active and closed proposals with current vote counts

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions