Skip to content

refactor: remove Biconomy dependencies and related components#557

Merged
chibie merged 3 commits into
mainfrom
refactor/remove-everything-biconomy
Jul 2, 2026
Merged

refactor: remove Biconomy dependencies and related components#557
chibie merged 3 commits into
mainfrom
refactor/remove-everything-biconomy

Conversation

@Dprof-in-tech

@Dprof-in-tech Dprof-in-tech commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Removed the @biconomy/abstractjs dependency from package.json.
  • Updated comments in PrivyConfigWrapper to reflect changes in sponsorship handling.
  • Removed unused types and properties related to Biconomy from app/types.ts.
  • Deleted several API routes and components related to wallet migration and user operations, including route.ts files for bundler execution and transfer user operations, as well as the WalletMigrationModal and associated components.
  • Cleaned up the AppLayout and other components by removing references to the now-removed migration banner and modal.
  • This refactor streamlines the codebase by eliminating unused features and dependencies, enhancing maintainability.

References

closes #545

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.

Summary by CodeRabbit

  • Bug Fixes

    • Removed wallet migration prompts and related modals from the app.
    • Simplified transfer and swap flows so they no longer depend on migration checks.
    • Streamlined wallet handling for EOA and smart-wallet selection.
  • Chores

    • Cleaned up unused bundler-related routes, settings, and supporting logic.
    • Updated app configuration to reflect the current sponsorship and contact settings.

- Removed the `@biconomy/abstractjs` dependency from `package.json`.
- Updated comments in `PrivyConfigWrapper` to reflect changes in sponsorship handling.
- Removed unused types and properties related to Biconomy from `app/types.ts`.
- Deleted several API routes and components related to wallet migration and user operations, including `route.ts` files for bundler execution and transfer user operations, as well as the `WalletMigrationModal` and associated components.
- Cleaned up the `AppLayout` and other components by removing references to the now-removed migration banner and modal.
- This refactor streamlines the codebase by eliminating unused features and dependencies, enhancing maintainability.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2c83e807-3c68-4186-b11d-bb5546983091

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
📝 Walkthrough

Walkthrough

Removes all Biconomy MEE and ERC-4337 wallet migration infrastructure: bundler API routes, userOp.ts utilities, migration modal components (WalletMigrationModal, WalletTransferApprovalModal, WalletMigrationBanner, MigrationZeroBalanceModal), migration context/hooks, and all call-site wiring in TransferForm, TransactionForm, WalletDetails, and MobileDropdown. The @biconomy/abstractjs package is removed.

Changes

Biconomy and wallet migration removal

Layer / File(s) Summary
Bundler lib, API routes, config, and dependency removal
app/lib/bundler/userOp.ts, app/lib/bundler/config.ts, app/api/bundler/*/route.ts, app/api/v1/wallets/deprecate/route.ts, app/lib/config.ts, app/types.ts, app/providers.tsx, package.json
Deletes all ERC-4337 userOp utilities, bundler config constants, five bundler/deprecation API routes, Biconomy fields from runtime config and Config type, and removes @biconomy/abstractjs from dependencies.
Migration context, hooks, and barrel exports
app/context/MigrationContext.tsx, app/context/index.ts, app/hooks/useEIP7702Account.ts, app/components/index.ts
Removes MigrationBannerWrapper, useWalletMigrationStatus, and WalletMigrationStatus; updates barrel to expose MigrationStatusProvider/useMigrationStatus instead.
useSwapButton migration props and logic removal
app/hooks/useSwapButton.ts
Drops needsMigration/isRemainingFundsMigration props, MIGRATION_DEADLINE, isMigrationMandatory, migration CTA text branch, and openMigrationModal callback from the hook's public API.
TransferForm EOA balance logic and migration wiring removal
app/components/TransferForm.tsx
Removes onOpenMigration prop, migration-status hook usage, and WalletMigrationModal render; replaces migration-check balance-fetch guard with an embedded-wallet availability timeout for EOA mode.
TransactionForm, WalletDetails, MobileDropdown call-site cleanup
app/pages/TransactionForm.tsx, app/components/WalletDetails.tsx, app/components/MobileDropdown.tsx, app/components/AppLayout.tsx
Removes WalletMigrationModal imports/renders, migration state, migration modal callbacks, and migration gating in handleSwap across all three consuming components.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • paycrest/noblocks#358: Introduces the wallet-migration endpoints and UI modules (app/api/v1/wallets/deprecate/route.ts, MigrationZeroBalanceModal, MigrationBannerWrapper) that this PR removes.
  • paycrest/noblocks#400: Implements the MEE-sponsored WalletTransferApprovalModal migration flow that this PR deletes.
  • paycrest/noblocks#387: Adds MigrationStatusContext and adjusts TransferForm/context exports that this PR rewires.

Suggested reviewers

  • 5ran6
  • onahprosper
  • chibie

Poem

🐇 Hippity-hop, the Biconomy's gone,
No more migration banners to fret upon!
The userOps vanished, the modals took flight,
EOA wallets now shine in the light.
The bundler unpacked its last bag and left —
The codebase feels lighter, joyful, bereft! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Biconomy removal is broad, but the PR does not show the required legacy-smart-wallet fallback/migration guidance or docs/env-example cleanup for #545. Add a clear non-Biconomy migration path or explicit user-facing fallback for old smart wallets, and update docs/env examples to remove Biconomy references.
Out of Scope Changes check ⚠️ Warning The PR adds unrelated config fields in app/types.ts (Brevo and blockfestEndDate) that are not part of the Biconomy-removal objective. Move unrelated config additions to a separate PR or justify them in the Biconomy-removal scope.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing Biconomy dependencies and migration-related components.
Description check ✅ Passed The PR description follows the template sections and covers purpose, references, testing, and checklist, though testing details are minimal.

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
app/components/TransferForm.tsx (2)

118-130: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Keep a fallback for the legacy smart-wallet branch.

useSmartWalletTransfer still exits early on !shouldUseEOA after calling onRequireMigration?.(). With this callback removed, old smart-wallet users can submit and see no guidance. Add a toast/error fallback here or update the hook to return a user-visible unsupported-wallet error. Based on the PR objective to disable migration with clear fallback guidance and the provided useSmartWalletTransfer contract.

Proposed localized fallback
   } = useSmartWalletTransfer({
     selectedNetwork: transferNetwork,
     user,
     supportedTokens: fetchedTokens,
     getAccessToken,
     refreshBalance,
+    onRequireMigration: () => {
+      toast.error(
+        "Transfers from legacy smart wallets are no longer supported. Contact support for help moving funds.",
+      );
+    },
     starknetWallet: {
       walletId,
       publicKey,
       address,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/components/TransferForm.tsx` around lines 118 - 130, The legacy
smart-wallet path in useSmartWalletTransfer still returns early when
shouldUseEOA is false, so users now get no visible guidance after
onRequireMigration?.() is removed. Update the hook’s unsupported-wallet branch
to surface a user-facing fallback, such as a toast or returned error state, and
make sure the transfer flow in useSmartWalletTransfer and its caller in
TransferForm can present that message instead of silently exiting.

162-220: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Return the timeout cleanup from the effect. The cleanup returned inside fetchBalance is ignored, so the 10s timeout can still fire after embeddedWallet appears and overwrite a valid balance with “Wallet unavailable.” app/components/TransferForm.tsx:162-180

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/components/TransferForm.tsx` around lines 162 - 220, The timeout cleanup
inside the TransferForm useEffect is currently returned from fetchBalance and
never registered, so the 10s fallback can still fire after a wallet becomes
available. Move the cleanup return to the outer useEffect scope in TransferForm,
keeping the timeout creation in the shouldUseEOA && !embeddedWallet branch, and
ensure the effect returns a function that clears that timeout when dependencies
change or the component unmounts.
app/pages/TransactionForm.tsx (1)

644-692: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Block legacy smart-wallet swaps with clear guidance.

After the migration gate removal, handleSwap can still submit when shouldUseEOA is false, while this component’s wallet selection still falls back to smartWallet. That leaves old smart-wallet users on an unsupported path instead of the required fallback guidance. Based on the PR objective to disable/replace Biconomy migration flows with clear guidance.

Proposed guard
   const handleSwap = () => {
+    if (!isInjectedWallet && !shouldUseEOA) {
+      toast.error(
+        "Swaps from legacy smart wallets are no longer supported. Contact support for help moving funds.",
+      );
+      return;
+    }
 
     const kyc = getKycStatusSnapshot();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/pages/TransactionForm.tsx` around lines 644 - 692, `handleSwap` in
`TransactionForm` still allows submission for legacy smart-wallet users when
`shouldUseEOA` is false, even though the wallet selection can fall back to
`smartWallet`. Add a guard near the start of `handleSwap` that detects
non-EOA/legacy smart-wallet usage and stops the swap flow, then route users to
the existing fallback guidance/modal instead of calling
`handleSubmit(onSubmit)()`. Make sure the check is placed alongside the existing
KYC/limit gates so `getKycStatusSnapshot`, `shouldUseEOA`, and `handleSubmit`
all follow the same unsupported-wallet path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@app/components/TransferForm.tsx`:
- Around line 118-130: The legacy smart-wallet path in useSmartWalletTransfer
still returns early when shouldUseEOA is false, so users now get no visible
guidance after onRequireMigration?.() is removed. Update the hook’s
unsupported-wallet branch to surface a user-facing fallback, such as a toast or
returned error state, and make sure the transfer flow in useSmartWalletTransfer
and its caller in TransferForm can present that message instead of silently
exiting.
- Around line 162-220: The timeout cleanup inside the TransferForm useEffect is
currently returned from fetchBalance and never registered, so the 10s fallback
can still fire after a wallet becomes available. Move the cleanup return to the
outer useEffect scope in TransferForm, keeping the timeout creation in the
shouldUseEOA && !embeddedWallet branch, and ensure the effect returns a function
that clears that timeout when dependencies change or the component unmounts.

In `@app/pages/TransactionForm.tsx`:
- Around line 644-692: `handleSwap` in `TransactionForm` still allows submission
for legacy smart-wallet users when `shouldUseEOA` is false, even though the
wallet selection can fall back to `smartWallet`. Add a guard near the start of
`handleSwap` that detects non-EOA/legacy smart-wallet usage and stops the swap
flow, then route users to the existing fallback guidance/modal instead of
calling `handleSubmit(onSubmit)()`. Make sure the check is placed alongside the
existing KYC/limit gates so `getKycStatusSnapshot`, `shouldUseEOA`, and
`handleSubmit` all follow the same unsupported-wallet path.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a9b5da82-a459-4834-8acf-e23a035ac510

📥 Commits

Reviewing files that changed from the base of the PR and between 47fd4c3 and c3fe029.

📒 Files selected for processing (27)
  • app/api/bundler/execute/route.ts
  • app/api/bundler/generate-transfer-userop/route.ts
  • app/api/bundler/generate-userop/route.ts
  • app/api/bundler/is-nexus/route.ts
  • app/api/bundler/nexus/status/route.ts
  • app/api/v1/wallets/deprecate/route.ts
  • app/components/AppLayout.tsx
  • app/components/MigrationZeroBalanceModal.tsx
  • app/components/MobileDropdown.tsx
  • app/components/TransferForm.tsx
  • app/components/WalletDetails.tsx
  • app/components/WalletMigrationBanner.tsx
  • app/components/WalletMigrationModal.tsx
  • app/components/WalletMigrationSuccessModal.tsx
  • app/components/WalletTransferApprovalModal.tsx
  • app/components/index.ts
  • app/context/MigrationContext.tsx
  • app/context/index.ts
  • app/hooks/useEIP7702Account.ts
  • app/hooks/useSwapButton.ts
  • app/lib/bundler/config.ts
  • app/lib/bundler/userOp.ts
  • app/lib/config.ts
  • app/pages/TransactionForm.tsx
  • app/providers.tsx
  • app/types.ts
  • package.json
💤 Files with no reviewable changes (24)
  • app/api/bundler/is-nexus/route.ts
  • package.json
  • app/components/WalletMigrationSuccessModal.tsx
  • app/components/AppLayout.tsx
  • app/components/MigrationZeroBalanceModal.tsx
  • app/api/bundler/generate-userop/route.ts
  • app/api/bundler/nexus/status/route.ts
  • app/components/WalletMigrationModal.tsx
  • app/api/v1/wallets/deprecate/route.ts
  • app/context/index.ts
  • app/components/WalletTransferApprovalModal.tsx
  • app/api/bundler/execute/route.ts
  • app/lib/bundler/config.ts
  • app/api/bundler/generate-transfer-userop/route.ts
  • app/context/MigrationContext.tsx
  • app/types.ts
  • app/components/WalletMigrationBanner.tsx
  • app/lib/config.ts
  • app/lib/bundler/userOp.ts
  • app/components/index.ts
  • app/components/WalletDetails.tsx
  • app/components/MobileDropdown.tsx
  • app/hooks/useEIP7702Account.ts
  • app/hooks/useSwapButton.ts

@chibie
chibie merged commit ff19be4 into main Jul 2, 2026
2 checks passed
@chibie
chibie deleted the refactor/remove-everything-biconomy branch July 2, 2026 21:05
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.

Remove Biconomy dependency from Noblocks

3 participants