Skip to content

Merging Main into Stable#406

Merged
onahprosper merged 14 commits intostablefrom
main
Mar 6, 2026
Merged

Merging Main into Stable#406
onahprosper merged 14 commits intostablefrom
main

Conversation

@Dprof-in-tech
Copy link
Copy Markdown
Collaborator

Description

This pull request introduces several improvements and fixes across the recipient API, wallet migration flow, and transfer UI. The main focus is on enhancing data validation and sanitization for recipients, improving the wallet migration modal's user experience, and refining how token balances are displayed and handled during wallet migration.

Recipient API validation and sanitization:

  • Added currency to the recipient creation API and enforced NUBAN digit-length validation for NGN recipients, ensuring account identifiers are the correct length (10 or 6 digits) depending on the institution code. Account identifiers are now sanitized and stored in a consistent format in the database. (app/api/v1/recipients/route.ts) [1] [2] [3] [4] [5]

Wallet migration and transfer UI improvements:

  • Improved the wallet migration modal to prevent accidental modal closures and ensure correct modal state transitions, using useEffect and event handlers to manage the transfer modal's visibility. (app/components/WalletMigrationModal.tsx) [1] [2]
  • Refined the wallet transfer approval modal to filter out "dust" (very small) token balances using both raw token amount and USD value thresholds, ensuring only meaningful balances are shown for migration. Also improved token metadata handling. (app/components/WalletTransferApprovalModal.tsx) [1] [2] [3] [4]

Code cleanup and dependency updates:

  • Removed unused imports and props related to smart wallets from the transfer form, and updated the migration callback logic. (app/components/TransferForm.tsx) [1] [2] [3]
  • Cleaned up error handling comments and structure in the wallet migration status API route. (app/api/v1/wallets/migration-status/route.ts)

Configuration:

  • Added a new environment variable NEXT_PUBLIC_BUNDLER_SERVER_URL to the example .env file. (.env.example)

References

Testing

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

By submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.

onahprosper and others added 14 commits March 2, 2026 16:17
…migration process

* Replaced deprecated paymaster configuration with Biconomy MEE API key across components.
* Updated WalletTransferApprovalModal to handle wallet upgrades and token transfers using the new MEE API.
* Enhanced error handling for missing API keys and improved migration logic for better user experience.
* Refactored configuration management to streamline the upgrade server URL and API key usage.
* Introduced logic to ignore tiny balances (dust) in the WalletTransferApprovalModal and migration processes.
* Added utility function to calculate dust thresholds based on token decimals.
* Updated balance checks in useEIP7702Account to treat small residual balances as zero for migration decisions.
* Enhanced error handling for access token retrieval during migration.
* Updated .env.example to include NEXT_PUBLIC_UPGRADE_SERVER_URL for local development.
* Modified config.ts to set upgradeServerUrl based on the new environment variable, defaulting to an empty string if not provided.
…related components

* Changed environment variable from NEXT_PUBLIC_UPGRADE_SERVER_URL to NEXT_PUBLIC_BUNDLER_SERVER_URL in .env.example.
* Updated Config type and configuration management to reflect the new bundler server URL.
* Refactored WalletTransferApprovalModal to utilize the new bundler server URL for wallet upgrade and token transfer operations.
* Enhanced error handling for bundler server URL validation.
… and useSmartWalletTransfer

* Updated comments in PrivyConfigWrapper to remove deprecated references.
* Removed unused import of useSmartWallets in TransferForm.
* Enhanced error message in WalletTransferApprovalModal for clarity.
* Refactored useSmartWalletTransfer to eliminate the client parameter and streamline migration handling.
* Eliminated the deprecated comment regarding the MEE API key in the Config type definition to improve clarity and maintainability.
* Added useEffect to manage transfer modal visibility based on isOpen state.
* Simplified handleApproveMigration function to directly show transfer modal.
* Adjusted rendering logic to prevent showing the wallet migration modal when the transfer modal is active.
refactor: improve WalletMigrationModal logic and state management
* refactor: enhance WalletMigrationModal and MigrationContext for improved modal visibility

* Updated handleApproveMigration to prevent click-through issues and ensure proper modal display timing.
* Implemented useEffect in MigrationContext to maintain stable visibility of migration-related modals during loading states.
* Adjusted rendering logic to utilize stable visibility state for migration banner and zero balance modal.

* feat: integrate smart wallet deployment in WalletTransferApprovalModal

* Added useSmartWallets hook to manage smart wallet interactions.
* Implemented logic to deploy wallets on the selected chain if not already deployed, enhancing the upgrade process to Nexus.
* Updated progress messaging to reflect wallet deployment status during the upgrade.

---------

Co-authored-by: Onah Prosper <prosperauthor@gmail.com>
* Simplified wallet deployment progress message by removing "Privy" reference.
* Adjusted confirmation progress message to indicate a longer expected wait time (2–5 min) for transaction confirmation.
)

* Simplified wallet deployment progress message by removing "Privy" reference.
* Adjusted confirmation progress message to indicate a longer expected wait time (2–5 min) for transaction confirmation.

Co-authored-by: Onah Prosper <prosperauthor@gmail.com>
…nce) (#372)

* feat: validate account identifier length for NUBAN and SAFAKEPC in recipient forms

* fix: update error messages for account number validation and store sanitized digits for consistent database format

* refactor: trim institution code for validation and consistent storage in recipient API

* feat: add currency support and validate account identifier length for NGN in recipient forms

---------

Co-authored-by: Prosper <40717516+onahprosper@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e3e500ce-bfb2-4885-9f8c-7279cb4ad564

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch main

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

@onahprosper onahprosper merged commit f9f99de into stable Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants