Skip to content

Add wallet holdings endpoint returning all creator keys a fan owns #421

Description

@Chucks1093

Summary

Fans have no way to see everything they own in one place. To check their portfolio they would have to query each creator individually, which is not practical. A dedicated holdings endpoint that takes a wallet address and returns all creator keys that wallet holds — with quantities and current values — is the foundation of any portfolio view on the client.

Scope

  • Add GET /wallets/:address/holdings endpoint
  • Response returns an array of entries: { creator_id, creator_handle, key_balance, current_price, total_value }
  • Data is read from the key ownership read model maintained by the indexer (not a live on-chain call)
  • Wallet address is validated as a well-formed Stellar address before querying
  • Entries with a balance of zero are excluded from the response
  • Support pagination for wallets with large holdings

Acceptance Criteria

  • Endpoint returns all creators a wallet holds keys in, with correct balances
  • Zero-balance entries are excluded
  • total_value is calculated as key_balance × current_price from the price snapshot
  • Returns 400 for a malformed Stellar address
  • Returns an empty array (not 404) for a valid address with no holdings
  • Integration test covers: wallet with multiple holdings, wallet with no holdings, invalid address

Coordinate on Telegram

Activity

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

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignStellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions