Skip to content

[FE-45] Build on-chain governance voting interface — create proposals and cast votes #982

Description

@yusuftomilola

Overview

Token holders in a tokenized asset can vote on governance proposals (e.g., "Should we sell the asset?", "Approve the new lease terms?"). This interface shows open proposals, vote counts, and allows token holders to cast weighted votes. Depends on BE-63.

Context

  • Route: Add a "Governance" tab to tokenized asset detail pages
  • API endpoints (from BE-63): POST /stellar/assets/:id/votes, POST /stellar/assets/:id/votes/:proposalId/cast, GET /stellar/assets/:id/votes
  • Vote weight = caller's token balance

Acceptance Criteria

  • "Governance" tab visible only on tokenized assets
  • Active Proposals list: title, description, options, vote deadline, current vote counts per option (progress bars)
  • "Vote" button per proposal opens a modal with option radio buttons and the user's voting power displayed
  • After voting: show "Vote cast" with the transaction hash, disable the Vote button for that proposal
  • Closed Proposals section: shows final results with winning option highlighted
  • "Create Proposal" button (admin only): form with title, description, options (add/remove input rows), closing date — calls POST /stellar/assets/:id/votes
  • Real-time vote count updates via polling every 30 seconds

Metadata

Metadata

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