Skip to content

AI Credits Widget: Buy AI coding credits with G$ #61

Description

@blueogin

Short description of the new GoodWidget

Developers pay with G$ on Celo, get AntSeed AI credits on Base. GoodID-verified wallets get up to 20% bonus on streaming.

User pays G$ from payer wallet; buyer key signs operator consent and holds AntSeed credits. Backend settles USDC on Base via AntseedBuyerOperator.depositFor.

Which repos and packages the AI should work with

  • Widget package: GoodDollar/GoodWidget -> new packages/ai-credits-widget (@goodwidget/ai-credits-widget)
  • UI integration targets: GoodDollar/GoodWallet, GoodDollar/GoodProtocolUI - both should ship/include the AI credits widget
  • Reference (GoodWidget): packages/claim-widget structure, packages/ui, packages/core, packages/embed
  • Tests: Storybook stories + Playwright under tests/widgets/ai-credits-widget/
  • Mock backend APIs until a Worker URL exists.

UI implementation reference

Copy claim-widget patterns. One card flow, tokens from packages/ui, copyable setup snippets. Must embed cleanly in GoodWallet and GoodProtocolUI.

Layout: hero ("pay with G$, get up to 20% more") -> stepper (connect -> buyer key -> buyer signs operator consent -> buy -> setup) -> balance/usage card -> history.

No screenshots - keep it simple.

User flows, states and behaviours

Happy path: connect wallet → show G$ balance + verification badge (20% bonus if GoodID verified) → generate/paste buyer key (must copy + confirm if generated) → buyer signs operator consent (EIP-712 via buyer key; sets AntseedBuyerOperator as deposits operator) → pick deposit and/or monthly stream (min ~$1 G$ each; +10% deposit, +20% stream) → payer wallet confirms buy tx on Celo → credits land on Base → show balance, buyer key, AntSeed setup for Cursor/Cline/etc → usage log + FAQ.

States: disconnected, connected_empty, quote_ready, payment_pending, payment_confirmed, has_credits, usage_empty, usage_active, insufficient_g_balance, insufficient_ai_credits, payment_failed, backend_unavailable, unsupported_chain.

Create the plan (keep this section in the issue body)

Create the plan

Based on the above description create an execution plan in a new sub-issue and preserve the original issue content unchanged.
Do not execute the plan until given instructions to do so.

Sub-issue requirements:

  • Title format: [DRAFT][PLAN] <what issue is being planned>
  • Type: Task
  • Description must start with: <sub-issue title>
  • Link the sub-issue back to this parent issue.

Instructions when creating the plan:

  • Map relevant files that are too be used as reference from all repos mentioned
  • import existing @GoodDollar packages
  • Map new components that should be created. Assess when a new component should be created in the new savings widget package or made part of the reusable packages/ui

Plan specification required sections:

  • Required states, flows, and behaviors
  • Execution plan
  • acceptance criteria
  • human-reviewer checklist

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions