Summary
Stellar token amounts are stored on-chain as whole-number stroops (1 unit = 10,000,000 stroops). ProposalCard currently shows only the formatted decimal amount with no indication of the underlying raw value, which makes it harder for technically-minded owners to verify a proposal before signing.
Background
contract.ts already contains a formatAmount(raw: bigint): string helper that converts a stroop bigint to a readable decimal string (e.g., 50000000000n → "5,000"). This formatted string is stored in proposal.amount by mapProposal(), but the original raw stroop value is discarded. ProposalCard renders Send {proposal.amount} {proposal.token} with no secondary display. The Proposal type in accord.ts has a single amount: string field that holds only the formatted value.
What Needs to Be Done
-
In frontend/src/types/accord.ts, add a rawAmount: string field to the Proposal type. Storing it as a string avoids BigInt serialisation issues while preserving the exact value.
-
In frontend/src/lib/contract.ts, update mapProposal() to set rawAmount to String(raw.amount) — the original stroop integer as returned by the contract — alongside the existing formatted amount field.
-
In frontend/src/data/mockData.ts, add a rawAmount field to each mock proposal that matches its amount. Use 7 decimal places (e.g., "50000000000" for 5,000 USDC; "125000000000" for 12,500 XLM).
-
In frontend/src/components/ProposalCard.tsx, below the existing Send {proposal.amount} {proposal.token} line, add a secondary line that renders the raw stroop value in muted small text, formatted with a thousands separator and labelled "stroops".
Acceptance Criteria
Files to Look At
frontend/src/types/accord.ts — add rawAmount: string to the Proposal type
frontend/src/lib/contract.ts — mapProposal() is where rawAmount should be populated; formatAmount() is the existing conversion helper
frontend/src/components/ProposalCard.tsx — the amount is rendered on line 28; add the secondary stroop display beneath it
frontend/src/data/mockData.ts — add matching rawAmount values to all four mock proposals
Difficulty: Easy
Summary
Stellar token amounts are stored on-chain as whole-number stroops (1 unit = 10,000,000 stroops). ProposalCard currently shows only the formatted decimal amount with no indication of the underlying raw value, which makes it harder for technically-minded owners to verify a proposal before signing.
Background
contract.tsalready contains aformatAmount(raw: bigint): stringhelper that converts a stroop bigint to a readable decimal string (e.g.,50000000000n→"5,000"). This formatted string is stored inproposal.amountbymapProposal(), but the original raw stroop value is discarded. ProposalCard rendersSend {proposal.amount} {proposal.token}with no secondary display. TheProposaltype inaccord.tshas a singleamount: stringfield that holds only the formatted value.What Needs to Be Done
In
frontend/src/types/accord.ts, add arawAmount: stringfield to theProposaltype. Storing it as a string avoids BigInt serialisation issues while preserving the exact value.In
frontend/src/lib/contract.ts, updatemapProposal()to setrawAmounttoString(raw.amount)— the original stroop integer as returned by the contract — alongside the existing formattedamountfield.In
frontend/src/data/mockData.ts, add arawAmountfield to each mock proposal that matches itsamount. Use 7 decimal places (e.g.,"50000000000"for 5,000 USDC;"125000000000"for 12,500 XLM).In
frontend/src/components/ProposalCard.tsx, below the existingSend {proposal.amount} {proposal.token}line, add a secondary line that renders the raw stroop value in muted small text, formatted with a thousands separator and labelled "stroops".Acceptance Criteria
mockData.tsinclude arawAmountfield consistent with eachamountrawAmountfieldFiles to Look At
frontend/src/types/accord.ts— addrawAmount: stringto theProposaltypefrontend/src/lib/contract.ts—mapProposal()is whererawAmountshould be populated;formatAmount()is the existing conversion helperfrontend/src/components/ProposalCard.tsx— the amount is rendered on line 28; add the secondary stroop display beneath itfrontend/src/data/mockData.ts— add matchingrawAmountvalues to all four mock proposalsDifficulty: Easy