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
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
contracts/assetsup/src/dividends.rsandcontracts/assetsup/src/voting.rsAcceptance Criteria
POST /stellar/assets/:id/dividends/distributebody:{ totalAmount: number, token: 'XLM'|string }— calls contractdistribute_dividends(), returns the transaction hash and per-holder amountsGET /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 addressPOST /stellar/assets/:id/votesbody:{ title, description, options: string[], closesAt }— creates an on-chain governance proposalPOST /stellar/assets/:id/votes/:proposalId/castbody:{ option: number }— casts a vote (weighted by token holdings)GET /stellar/assets/:id/votes— list active and closed proposals with current vote counts