Skip to content

311/1235 ios coa to eoa asset migration#2435

Merged
zhouxl merged 9 commits into
devfrom
311/1235-ios-coa-to-eoa-asset-migration
Feb 27, 2026
Merged

311/1235 ios coa to eoa asset migration#2435
zhouxl merged 9 commits into
devfrom
311/1235-ios-coa-to-eoa-asset-migration

Conversation

@zhouxl
Copy link
Copy Markdown
Collaborator

@zhouxl zhouxl commented Feb 26, 2026

Related Issue

Links onflow/FRW-monorepo#1235

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@zhouxl zhouxl requested a review from a team as a code owner February 26, 2026 13:55
@zhouxl zhouxl linked an issue Feb 26, 2026 that may be closed by this pull request
15 tasks
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 26, 2026

PR Summary

Implemented the COA (Contract-Owned Account) to EOA (Externally Owned Account) asset migration feature for iOS. This includes a new migration UI accessible from the side menu, bridge methods for React Native communication, and enhanced asset tracking with ERC-20 balance support. The feature detects when a COA account has assets (balance, NFTs, or ERC-20 tokens) and prompts users to migrate them to an EOA account. Added new data models for migration assets (Erc20Asset, Erc721Asset, Erc1155Asset) and methods to fetch and refresh COA assets after migration.

Changes

File Summary
FRW.xcodeproj/project.pbxproj Added BridgeModels+Extension.swift and TurboModule+CoaToEoa.swift to the project build phases. Also cleaned up empty inputPaths and outputPaths arrays in CocoaPods build scripts and updated OTHER_LDFLAGS format.
FRW/Foundation/Bridge/BridgeModels+Extension.swift New file defining RNBridge extension with structs for migration: TransactionDatas, Erc20Asset, Erc721Asset, Erc1155Asset, and MigrationAssetsData to represent ERC-20, ERC-721, and ERC-1155 assets for COA to EOA migration.
FRW/Foundation/Bridge/BridgeModels.swift Added migration case to the RouteType enum for React Native bridge routing.
FRW/Foundation/Bridge/RCTNativeFRWBridge.mm Added getMigrationAssets:resolve:reject: and refreshCoaAfterMigration:reject: methods to expose migration functionality to React Native, calling corresponding Swift methods in TurboModuleSwift.
FRW/Foundation/Bridge/TurboModule+CoaToEoa.swift New file implementing fetchAmountForCoa method that retrieves ERC-20, ERC-721, and ERC-1155 assets from a COA address using TokenBalanceHandler. Filters and transforms token/NFT data into MigrationAssetsData format for React Native consumption.
FRW/Foundation/Bridge/TurboModuleSwift.swift Added getMigrationAssets(sourceAddress:) to fetch COA assets and refreshCoaAfterMigration() to refresh profile and wallet data after migration completes. Both methods are exposed to Objective-C for React Native bridge.
FRW/Modules/EVM/View/EVMTagView.swift Simplified COATagView layout by removing nested HStack and offset positioning. Now uses proper padding and spacing for the EVM/FLOW combined tag display.
FRW/Modules/NFT/NFTModel/NFTModel.swift Added ERCType computed property to NFTCollectionInfo that returns the FlowProvider.ABIType (erc721 or erc1155) based on the contractType string, defaulting to erc721.
FRW/Modules/ReactNative/ReactNativeViewController.swift Added migration case to Route enum and corresponding mapping in RNBridge.InitialProps extension to support the migration React Native screen.
FRW/Modules/Wallet/SideMenu/SideMenuView.swift Added migrationInfoCard view that displays when shouldShowMigrationCard is true. The card shows migration prompt with COA and EOA tags, and triggers onClickMigrationCard() action when tapped.
FRW/Modules/Wallet/SideMenu/SideMenuViewModel.swift Added shouldShowMigrationCard published property and updateMigrationCardVisibility(for:) method that checks if a COA account has assets (balance, NFTs, or ERC-20 tokens) and EOAs exist. Added onClickMigrationCard() to navigate to migration screen.
FRW/Modules/Wallet/WalletAccount/WalletAccount+Bridge.swift Updated AssetData.loaded initialization to include erc20Balance: 0 parameter when converting from bridge model.
FRW/Modules/Wallet/WalletAccount/WalletAccount+Helpers.swift Extended copyWith method to accept optional erc20Balance parameter, preserving existing ERC-20 balance when not specified and including it in the new AssetData.loaded state.
FRW/Modules/Wallet/WalletAccount/WalletAccount+Mock.swift Updated all mock WalletAccount factory methods to include erc20Balance: 0 in AssetData.loaded initializations.
FRW/Modules/Wallet/WalletAccount/WalletAccount.swift Extended AssetData enum's loaded case to include erc20Balance: Double. Added erc20Balance computed property and updated isHidden logic to consider ERC-20 balance. Updated Codable implementation for persistence.
FRW/Services/Manager/ProfileManager/Services/ProfileFetchService.swift Added fetchERC20Balances(for:) and fetchERC20DisplayBalancesForAddresses(_:) methods to fetch ERC-20 token balances for COA accounts. Integrated into fetchAllAccountInfo pipeline between balances and NFT counts.
FRW/Services/Manager/Wallet/WalletManager.swift Removed empty line in the WalletManager extension for child account handling.
FRW/Services/Router/RouteMap+React.swift Added migration case to RouteMap.ReactNative enum and implemented navigation logic to push ReactNativeViewController with .migration route.
FRW/Services/Token/TokenBalanceHandler.swift Adjusted indentation in getNFTCollections method for consistency.
main.jsbundle Updated React Native JavaScript bundle with migration UI and related functionality.

autogenerated by presubmit.ai

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 26, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@zhouxl zhouxl merged commit 5bb8ff7 into dev Feb 27, 2026
4 checks passed
@zhouxl zhouxl deleted the 311/1235-ios-coa-to-eoa-asset-migration branch February 27, 2026 01:27
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

LGTM!

Review Summary

Commits Considered (1)
  • 48fbf5d: Merge branch 'dev' into 311/1235-ios-coa-to-eoa-asset-migration
Files Processed (1)
  • FRW.xcodeproj/project.pbxproj (17 hunks)
Actionable Comments (0)
Skipped Comments (0)

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.

[iOS] COA to EOA Asset Migration - Epic #1048

2 participants