Skip to content

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

@Chucks1093

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No 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