Skip to content

feat(mobile): governance vote via Privy Server SDK proxy #2351

Description

@rozagerardo

Implements the first on-chain write action from the Hypha mobile app: casting a governance vote.

Comes out of #2239 (analysis + direction decision): Path A confirmed — Flutter app sends its Privy JWT to the backend, which uses the Privy Server SDK to sign and submit the transaction in Privy's TEE. No private keys on the mobile device.

Scope

Backend (hypha-web / apps/api):

  • POST /api/v1/wallet/provision — provision a Privy smart wallet for a user on first governance interaction (verify Flutter JWT via Privy Server SDK, create/retrieve smart wallet, store userId → smartWalletAddress mapping)
  • POST /api/v1/vote (or /api/v1/proposals/:id/vote) — verify JWT to identify user + wallet, encode the vote function call, submit transaction via Privy Server SDK, return txHash

Mobile (hypha-mobile / Flutter):

  • Call provisioning endpoint on first governance interaction
  • Wire the vote button (currently onPressed: () {}) to the vote endpoint (send proposalId, support, Bearer token)
  • Handle loading/error states; surface txHash or error to the user

Starting point

  • wallet_provision_repository.dart in hypha-mobile has the provisioning call started (WIP, uncommitted)
  • The JWT-bearer → apps/api proxy pattern is already in use for reads

Phase

Phase A — spec before code. Kick off with /hypha-task-init #2350-mobile-governance-vote in hypha-context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    mobileFlutter / React Native mobile appnew featureNew feature or request

    Type

    No type

    Fields

    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