refactor: remove Biconomy dependencies and related components#557
Conversation
- 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.
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughRemoves all Biconomy MEE and ERC-4337 wallet migration infrastructure: bundler API routes, ChangesBiconomy and wallet migration removal
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
Comment |
There was a problem hiding this comment.
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 winKeep a fallback for the legacy smart-wallet branch.
useSmartWalletTransferstill exits early on!shouldUseEOAafter callingonRequireMigration?.(). 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 provideduseSmartWalletTransfercontract.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 winReturn the timeout cleanup from the effect. The cleanup returned inside
fetchBalanceis ignored, so the 10s timeout can still fire afterembeddedWalletappears 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 winBlock legacy smart-wallet swaps with clear guidance.
After the migration gate removal,
handleSwapcan still submit whenshouldUseEOAis false, while this component’s wallet selection still falls back tosmartWallet. 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
📒 Files selected for processing (27)
app/api/bundler/execute/route.tsapp/api/bundler/generate-transfer-userop/route.tsapp/api/bundler/generate-userop/route.tsapp/api/bundler/is-nexus/route.tsapp/api/bundler/nexus/status/route.tsapp/api/v1/wallets/deprecate/route.tsapp/components/AppLayout.tsxapp/components/MigrationZeroBalanceModal.tsxapp/components/MobileDropdown.tsxapp/components/TransferForm.tsxapp/components/WalletDetails.tsxapp/components/WalletMigrationBanner.tsxapp/components/WalletMigrationModal.tsxapp/components/WalletMigrationSuccessModal.tsxapp/components/WalletTransferApprovalModal.tsxapp/components/index.tsapp/context/MigrationContext.tsxapp/context/index.tsapp/hooks/useEIP7702Account.tsapp/hooks/useSwapButton.tsapp/lib/bundler/config.tsapp/lib/bundler/userOp.tsapp/lib/config.tsapp/pages/TransactionForm.tsxapp/providers.tsxapp/types.tspackage.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
Description
@biconomy/abstractjsdependency frompackage.json.PrivyConfigWrapperto reflect changes in sponsorship handling.app/types.ts.route.tsfiles for bundler execution and transfer user operations, as well as theWalletMigrationModaland associated components.AppLayoutand other components by removing references to the now-removed migration banner and modal.References
closes #545
Testing
Checklist
mainBy submitting a PR, I agree to Paycrest's Contributor Code of Conduct and Contribution Guide.
Summary by CodeRabbit
Bug Fixes
Chores