Skip to content

Implement client.membership.getHistory() method #322

Description

@Lakes41

Difficulty: Intermediate
Type: Feature
Recommended labels (if available in this repo): enhancement, sdk, membership

Background

The SDK roadmap listed in docs/CAMPAIGN_TASKS.md under 'Planned (not yet open)' includes a client.membership.getHistory() method that has not been implemented yet. Consumers can currently check current membership status via the access/membership services, but there is no way to retrieve a wallet's historical membership changes (joins, renewals, expirations, role changes over time).

Problem

Downstream apps (e.g. guildpass-mobile's access history screen, guildpass-integrations' member dashboard) need a client-side method to fetch a wallet's membership history from the core API, but no such method exists on GuildPassClient.

Expected Outcome

client.membership.getHistory(walletAddress, options?) returns a typed, paginated list of historical membership events for a wallet, consistent with the existing service patterns in src/access/access.service.ts.

Suggested Implementation

Add a getHistory method to a new or existing membership service module following the same request/response typing conventions as access.service.ts. Reuse the existing HTTP client/adapter pattern (ethers/viem adapters are unrelated — this is a REST call to the access API). Add pagination options (cursor or offset-based, matching whatever guildpass-core's API contract uses) and expose typed response shapes.

Acceptance Criteria

  • client.membership.getHistory() is implemented and exported from the client
  • Method accepts a wallet address and optional pagination/filter options
  • Response is fully typed (no any)
  • Unit tests cover successful history fetch, empty history, and HTTP error handling
  • pnpm test:run and pnpm typecheck pass

Likely Affected Files/Directories

  • src/access/access.service.ts
  • src/access/access.types.ts
  • src/client/GuildPassClient.ts
  • src/client/GuildPassClientBuilder.ts

Activity

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsThird CampaignOfficial FWC26 campaign issue — eligible for campaign scoring and rewards

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions