Add USDC crypto deposit funding for OpenClaw credits#1
Open
davidlsneider wants to merge 1 commit intomainfrom
Open
Add USDC crypto deposit funding for OpenClaw credits#1davidlsneider wants to merge 1 commit intomainfrom
davidlsneider wants to merge 1 commit intomainfrom
Conversation
Agents can now send USDC on Base to a deposit address to top up their OpenClaw deployment LLM credit balance, alongside the existing Stripe payment method. - Add DepositWallet, CryptoDeposit, and PollerState Prisma models - Add deposit poller background worker monitoring Base chain for USDC Transfer events to the configured deposit address - Add addCryptoCredit() to openclaw.service.ts (mirrors addCredits but skips Stripe since payment is onchain) - Add wallet registration, deposit info, and deposit history endpoints on /api/openclaw/deployments/:id/ - Add USDC_DEPOSIT_ADDRESS and USDC_DEPOSIT_POLL_INTERVAL_MS env vars Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
Deployment NoteBefore deploying, set the Also run the Prisma migration: TODO (follow-up): The deposit address should also be surfaced in the webapp UI so users can see where to send USDC. Currently it's only available via the |
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.
Summary
creditBalanceUsdbalance that Stripe already tops up, and updates the OpenRouter key spending limitChanges
DepositWallet(sender address registration),CryptoDeposit(deposit records),PollerState(block tracking)depositPoller.service.ts(background worker using viem),depositWallet.service.ts(wallet CRUD)addCryptoCredit()inopenclaw.service.ts— mirrorsaddCredits()but skips Stripe (idempotent via txHash unique constraint)/api/openclaw/deployments/:id/:POST /deposit-wallets— register sender addressGET /deposit-wallets— list registered walletsDELETE /deposit-wallets/:wid— revoke a walletGET /deposit-info— returns deposit address + chain infoGET /deposits— list crypto deposit historyUSDC_DEPOSIT_ADDRESS,USDC_DEPOSIT_POLL_INTERVAL_MSTest plan
npx prisma migrate dev --name add-crypto-depositsUSDC_DEPOSIT_ADDRESSenv var and verify poller starts on bootPOST /deposit-walletsand verify it appears inGET /deposit-walletsGET /usageshows increased balanceGET /depositsshows the deposit record🤖 Generated with Claude Code