Skip to content

Replace mock data in useVesting and useAirdrop with real on-chain queries #2

Description

@whiteghost0001

Problem

Both hooks/useVesting.ts and hooks/useAirdrop.ts return hardcoded mock data instead of querying the Soroban contracts:

// useVesting.ts
const mockSchedules: VestingSchedule[] = [ /* hardcoded */ ];
setTimeout(() => { setSchedules(mockSchedules); }, 800);

// useAirdrop.ts  
const mockCampaigns: AirdropCampaign[] = [ /* hardcoded */ ];
setTimeout(() => { setCampaigns(mockCampaigns); }, 800);

Additionally, claimVested() and distributeCampaign() simulate work with setTimeout rather than submitting real transactions via ContractService.

Expected Fix

  • Replace the mock useEffect bodies with actual ContractService / Soroban RPC calls to fetch schedules and campaigns owned by the connected publicKey.
  • Wire claimVested(scheduleId) and distributeCampaign(campaignId) through ContractService, sign via Freighter, and submit the XDR to the network.
  • Handle loading and error states from real async responses.

Notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions