Open
Conversation
Add USDC as a payment option alongside credit cards. Today the billing flow only routes through Stripe checkout — developers who want to pay with USDC have no CLI path. This surfaces the on-chain credit purchase flow that the billing API (PR #22) enables. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CLI calls approve + purchaseCreditsFor(amount, account) directly using the user's loaded wallet. Stubbed until the contract address is deployed, but the full flow is wired: prompt amount → approve USDC → submit purchaseCreditsFor → poll billing API for credit confirmation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
What this is
A stub demonstrating the proposed USDC credit purchasing flow in the ecloud CLI. Not a final implementation — makes the proposed UX concrete so the team can evaluate it. The billing API backend for USDC credit purchases already exists (PR #22 on ecloud-billing-api).
Problem
ecloud billingonly routes through Stripe checkout (credit card). Developers who want to purchase credits with USDC have no CLI path — they'd need to know the contract address independently.What changed
ecloud billing top-upUSDCCredits.purchaseCreditsFor(amount, account)on-chain. Prompts for USDC amount → approves USDC spend → calls purchaseCreditsFor → polls billing API for credit confirmation. Stubbed until contract address is deployed.ecloud billing subscribetop-up.ecloud billing statusecloud billing top-up" when credits < $10 or subscription inactive.ecloud billing cancelHow
top-upworksThe user's wallet is already loaded (private key is a prerequisite for all billing commands), so the CLI forms and submits the transaction directly.
Demo
What's stubbed
0x...) until PR chore: update dev billing API server URL to use HTTPS domain #22's USDCCredits contract is deployed on Basetop-upcommandNo billing API changes. No new dependencies (viem already in the project).
Related
top-upas the fourth billing command; Sean confirmed the contract call ispurchaseCreditsFor