Feature: Align AI Credits widget with credit-history API shape#89
Open
blueogin wants to merge 4 commits into
Open
Feature: Align AI Credits widget with credit-history API shape#89blueogin wants to merge 4 commits into
blueogin wants to merge 4 commits into
Conversation
…tion to operator consent requests and implementing credit history retrieval functionality. Update types and response structures for improved credit management and user experience.
…I changes. Changed endpoint from `/credit` to `/profile` for fetching payer wallet information, enhancing clarity in the widget's functionality.
…new endpoint for credit history retrieval. Update the buyer address resolution logic to utilize the credit history entries, improving accuracy in buyer identification. Remove unused buyerAddress property from types for cleaner code.
… payer field from requests and responses. Update the adapter and backend client to reflect these changes, ensuring cleaner code and improved consistency in consent management.
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns @goodwidget/ai-credits-widget with the updated AntSeed account API split between profile (/profile) and paginated history (/credit-history), updating both the production client and mocks accordingly.
Changes:
- Updates backend response types to remove
gdCreditsfrom the profile response and introduceCreditHistoryResponse/CreditHistoryQuery. - Adds
/credit-historysupport to the backend client and migrates transactions/usage/settlement lookups to use it. - Updates Storybook docs to reflect the new endpoints and responsibilities.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/ai-credits-widget/src/backendTypes.ts | Updates TS types to reflect profile-only response and adds credit-history response/query types. |
| packages/ai-credits-widget/src/backendClient.ts | Implements credit-history fetching + mock pagination, switches dependent logic to the new endpoints, and adjusts buyer-resolution logic. |
| examples/storybook/src/stories/ai-credits-widget/AiCreditsWidget.mdx | Documents the new /profile + /credit-history API split for the widget’s production stories. |
Contributor
|
Non-blocking but make sure your pull-request descriptions stay up to date to the actual implementation. it refers to endpoint ...../credit while the antseed integration and locally use a /profile endpoint? |
Contributor
Author
|
@L03TJ3 |
Copilot stopped work on behalf of
blueogin due to an error
July 16, 2026 16:14
L03TJ3
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Align
@goodwidget/ai-credits-widgetwith the updated AntSeed account APIs:GET /v1/accounts/:account/creditis profile-only (nogdCredits); profile may includebuyerAddressGET /v1/accounts/:account/credit-history(offset pagination; one page for now)POST /v1/accounts/:buyer/operator-consentsends required bodypayerDepends on AntSeed backend shipping the matching API shape (GoodDollar/antseed-integration#11). Widget will fail against older
/creditresponses that still returngdCredits.About # (link your issue here)
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: