Skip to content

Conversation

Zishan-7
Copy link
Contributor

@Zishan-7 Zishan-7 commented Sep 8, 2025

No description provided.

Copy link
Contributor

coderabbitai bot commented Sep 8, 2025

Walkthrough

Increased the DaimoPayButton maxAmount from 4,000 to 30,000 in the Add Money Crypto Direct page and the ActionListDaimoPayButton component. No other logic, UI, or exported/public declarations were changed.

Changes

Cohort / File(s) Summary
DaimoPayButton maxAmount updates
src/app/(mobile-ui)/add-money/crypto/direct/page.tsx, src/components/Common/ActionListDaimoPayButton.tsx
Raised DaimoPayButton prop maxAmount from 4000 to 30_000; all other props and logic unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • jjramirezn
  • kushagrasarathe
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/increase-daimo--amount-limit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

vercel bot commented Sep 8, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
peanut-wallet Building Building Preview Comment Sep 8, 2025 4:44pm

@coderabbitai coderabbitai bot added the enhancement New feature or request label Sep 8, 2025
@kushagrasarathe kushagrasarathe merged commit fa07163 into peanut-wallet Sep 8, 2025
6 of 8 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
src/app/(mobile-ui)/add-money/crypto/direct/page.tsx (2)

86-99: Keep the $30k cap centralized to prevent drift

Mirror the constant here to avoid divergent limits across screens.

+ import { DAIMO_MAX_AMOUNT_USD } from '@/constants/daimo'-                        maxAmount={30_000}
+                        maxAmount={DAIMO_MAX_AMOUNT_USD}

Verification (same as other comment): search for all DaimoPayButton maxAmount usages and any "$4,000"/"4000" remnants.


96-99: Disable button when amount is empty or below min

Currently only the literal '0.00' disables the button; empty strings like '' remain enabled and rely on downstream validation. Tighten the guard.

-                        disabled={inputTokenAmount === '0.00'}
+                        disabled={
+                          !inputTokenAmount ||
+                          Number(inputTokenAmount.replace(/,/g, '')) < 0.1
+                        }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ad7bfef and f15017a.

📒 Files selected for processing (2)
  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx (1 hunks)
  • src/components/Common/ActionListDaimoPayButton.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (7)
📓 Common learnings
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#495
File: src/components/Global/TokenAmountInput/index.tsx:23-30
Timestamp: 2024-10-29T12:19:41.968Z
Learning: In the `TokenAmountInput` component (`src/components/Global/TokenAmountInput/index.tsx`), when the 'Max' button is clicked, we intentionally set the input denomination to 'TOKEN' because we are setting the value as token.
📚 Learning: 2024-10-29T12:19:41.968Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#495
File: src/components/Global/TokenAmountInput/index.tsx:23-30
Timestamp: 2024-10-29T12:19:41.968Z
Learning: In the `TokenAmountInput` component (`src/components/Global/TokenAmountInput/index.tsx`), when the 'Max' button is clicked, we intentionally set the input denomination to 'TOKEN' because we are setting the value as token.

Applied to files:

  • src/components/Common/ActionListDaimoPayButton.tsx
  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx
📚 Learning: 2025-08-26T15:25:53.328Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1132
File: src/app/[...recipient]/client.tsx:394-397
Timestamp: 2025-08-26T15:25:53.328Z
Learning: In `src/components/Common/ActionListDaimoPayButton.tsx`, the `handleCompleteDaimoPayment` function should not display error messages to users when DB update fails because the Daimo payment itself has succeeded - showing errors would be confusing since the payment was successful.

Applied to files:

  • src/components/Common/ActionListDaimoPayButton.tsx
📚 Learning: 2025-08-22T07:28:32.281Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1104
File: src/components/Payment/PaymentForm/index.tsx:522-545
Timestamp: 2025-08-22T07:28:32.281Z
Learning: In `src/components/Payment/PaymentForm/index.tsx`, the `handleCompleteDaimoPayment` function is only for updating payment status in the backend after a successful Daimo payment. Payment success/failure is handled by Daimo itself, so try/catch error handling and error display are not needed for backend sync failures - users shouldn't see errors if payment succeeded but database update failed.

Applied to files:

  • src/components/Common/ActionListDaimoPayButton.tsx
📚 Learning: 2024-10-08T20:13:42.967Z
Learnt from: Hugo0
PR: peanutprotocol/peanut-ui#420
File: src/components/Offramp/Offramp.consts.ts:27-28
Timestamp: 2024-10-08T20:13:42.967Z
Learning: In `src/components/Offramp/Offramp.consts.ts`, the `MIN_CASHOUT_LIMIT` is set to $10 because smaller amounts are impractical due to approximately $1 fee per cashout.

Applied to files:

  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx
📚 Learning: 2024-10-29T12:20:47.207Z
Learnt from: jjramirezn
PR: peanutprotocol/peanut-ui#495
File: src/components/Create/Link/Input.view.tsx:244-248
Timestamp: 2024-10-29T12:20:47.207Z
Learning: In the `TokenAmountInput` component within `src/components/Global/TokenAmountInput/index.tsx`, when `balance` is undefined, the `maxValue` prop should be set to an empty string `''`.

Applied to files:

  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx
📚 Learning: 2025-08-22T07:25:59.304Z
Learnt from: Zishan-7
PR: peanutprotocol/peanut-ui#1104
File: src/components/Payment/PaymentForm/index.tsx:596-600
Timestamp: 2025-08-22T07:25:59.304Z
Learning: The `TokenAmountInput` component in `src/components/Global/TokenAmountInput/` always returns decimal strings (e.g., "1,234.56"), not base units. When passing these values to external APIs like Daimo's `toUnits` prop, simply stripping commas with `.replace(/,/g, '')` is sufficient.

Applied to files:

  • src/app/(mobile-ui)/add-money/crypto/direct/page.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Deploy-Preview
🔇 Additional comments (1)
src/components/Common/ActionListDaimoPayButton.tsx (1)

138-138: Extract shared DAIMO_MAX_AMOUNT_USD constant & verify $30k upstream

  • Confirm backend/business/SDK accepts a $30,000 maxAmount to prevent server-side or SDK rejections.
  • Define a single DAIMO_MAX_AMOUNT_USD = 30_000 (e.g. in src/constants/daimo.ts) and import it in both ActionListDaimoPayButton.tsx (line 138) and app/(mobile-ui)/add-money/crypto/direct/page.tsx (line 95) to replace the magic literal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants