Skip to content

310/897 ios upgrade register endpoint from v3 to v4#2264

Merged
zhouxl merged 5 commits intodevfrom
310/897-ios-upgrade-register-endpoint-from-v3-to-v4
Jan 14, 2026
Merged

310/897 ios upgrade register endpoint from v3 to v4#2264
zhouxl merged 5 commits intodevfrom
310/897-ios-upgrade-register-endpoint-from-v3-to-v4

Conversation

@zhouxl
Copy link
Collaborator

@zhouxl zhouxl commented Jan 12, 2026

Related Issue

Summary of Changes

Need Regression Testing

  • Yes
  • No

Risk Assessment

  • Low
  • Medium
  • High

Additional Notes

Screenshots (if applicable)

@zhouxl zhouxl requested a review from lmcmz January 12, 2026 09:12
@zhouxl zhouxl requested a review from a team as a code owner January 12, 2026 09:12
@zhouxl zhouxl linked an issue Jan 12, 2026 that may be closed by this pull request
@github-actions
Copy link

github-actions bot commented Jan 12, 2026

PR Summary

Upgraded the iOS app's authentication endpoints from v3 to v4 API, introducing support for EVM account information alongside Flow account data. The changes include restructuring request models to use FlowAccountInfo and EVMAccountInfo objects, adding a new bridge method getV4RegistrationSignatures for obtaining registration signatures, and updating multiple login flows to generate and include EVM signatures when available.

Changes

File Summary
FRW.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved Updated package revisions for flow-swift, flow-wallet-kit, and trust-web3-provider dependencies to newer versions.
FRW/Foundation/Bridge/RCTNativeFRWBridge.mm Added new Objective-C bridge method getV4RegistrationSignatures:resolve:reject: that calls the Swift getV4RegisteredSignatureWithMnemonic method and handles promise resolution/rejection for React Native integration.
FRW/Foundation/Bridge/TurboModule+Onboard.swift Added getV4RegisteredSignature(mnemonic:) async method that generates JWT-based signatures for v4 registration. Creates both Flow signature (using ECDSA_SECP256k1/SHA2_256) and EVM signature from the HD wallet, returning flowSignature, evmSignature, and eoaAddress.
FRW/Modules/Login/SyncAddDeviceView.swift Removed commented-out preview code block at the end of the file.
FRW/Modules/Login/ViewModel/LoginViewModelProtocol.swift Updated the register call in LoginViewModelProtocol extension to include the new evmAddress parameter, passing the address variable to support v4 registration.
FRW/Services/Manager/UserManager.swift Extensively refactored register and multiple login methods to support v4 API. Added evmAddress parameter to registration, restructured requests to use FlowAccountInfo and EVMAccountInfo models, and implemented EVM signature generation using EthereumKeyProtocol across all authentication flows including loginWithKey, loginWithSeedPhrase, loginWithSecureEnclave, loginWithPrivateKey, and loginWithKeyProvider.
FRW/Services/Network/FRW/FRWAPI+User.swift Changed login endpoint path from /v3/login to /v4/login and register endpoint from /v3/register to /v4/register. Updated register case to use RegisterParam instead of RegisterRequest.
FRW/Services/Network/FRW/Model/Request/UserRequests.swift Added new RegisterParam struct for v4 registration containing FlowAccountInfo, optional EVMAccountInfo, username, and device info. Created FlowAccountInfo and EVMAccountInfo structs. Updated LoginRequest to use FlowAccountInfo and optional EVMAccountInfo instead of separate signature and accountKey fields.

autogenerated by presubmit.ai

@github-actions
Copy link

github-actions bot commented Jan 12, 2026

Dependency Review

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

Scanned Files

None

Copy link

@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.

🚨 Pull request needs attention.

Review Summary

Commits Considered (4)
  • 35dbb8e: feat: bridge for getV4RegisteredSignature
  • 8968f01: Merge branch 'dev' into 310/897-ios-upgrade-register-endpoint-from-v3-to-v4
  • 5ad1e3c: feat: update v3/login to v4
  • 6129317: feat: update v3/register to v4
Files Processed (8)
  • FRW.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (2 hunks)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm (1 hunk)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift (1 hunk)
  • FRW/Modules/Login/SyncAddDeviceView.swift (1 hunk)
  • FRW/Modules/Login/ViewModel/LoginViewModelProtocol.swift (1 hunk)
  • FRW/Services/Manager/UserManager.swift (7 hunks)
  • FRW/Services/Network/FRW/FRWAPI+User.swift (2 hunks)
  • FRW/Services/Network/FRW/Model/Request/UserRequests.swift (2 hunks)
Actionable Comments (1)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm [330-330]

    typo: "Typo in error message string."

Skipped Comments (2)
  • FRW/Services/Manager/UserManager.swift [618-625]

    possible bug: "Dead code block that never assigns evmAccountInfo."

  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [171-172]

    maintainability: "Unreachable code after return statement."

- (void)getV4RegistrationSignatures:(NSString *)mnemonic resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
[TurboModuleSwift getV4RegisteredSignatureWithMnemonic:mnemonic completionHandler:^(NSDictionary<NSString *,id> * _Nullable result, NSError * _Nullable error) {
if (error) {
reject(@"fet signature fail for regist v4 ", error.localizedDescription, error);

Choose a reason for hiding this comment

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

There's a typo in the error code string: "fet signature fail for regist v4" should be "get signature fail for register v4".

Copy link

@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.

🚨 Pull request needs attention.

Review Summary

Commits Considered (1)
  • fb6d723: Merge branch 'dev' into 310/897-ios-upgrade-register-endpoint-from-v3-to-v4
Files Processed (7)
  • FRW.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved (2 hunks)
  • FRW/Foundation/Bridge/RCTNativeFRWBridge.mm (1 hunk)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift (1 hunk)
  • FRW/Modules/Login/ViewModel/LoginViewModelProtocol.swift (1 hunk)
  • FRW/Services/Manager/UserManager.swift (7 hunks)
  • FRW/Services/Network/FRW/FRWAPI+User.swift (2 hunks)
  • FRW/Services/Network/FRW/Model/Request/UserRequests.swift (2 hunks)
Actionable Comments (1)
  • FRW/Services/Manager/UserManager.swift [618-625]

    possible bug: "EVM account info is never populated in this code path."

Skipped Comments (2)
  • FRW/Foundation/Bridge/TurboModule+Onboard.swift [171-172]

    enhancement: "Consider error handling for ethAddress call."

  • FRW/Services/Manager/UserManager.swift [214-214]

    possible issue: "Empty data fallback may cause silent authentication failures."

Comment on lines +618 to +625
let flowAccountInfo = FlowAccountInfo(accountKey: key, signature: signature.hexValue)
var evmAccountInfo: EVMAccountInfo?
if let ethProvider = secureKey as? EthereumKeyProtocol,
let evmSignature = try? ethProvider.ethSign(digest: signData) {
// SecureEnclaveKey might not have a direct ethAddress in this context,
// but if it supports ethSign, we might need more info.
// For now, following the pattern.
}

Choose a reason for hiding this comment

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

The evmAccountInfo variable is declared and conditionally populated, but the if block only checks if ethSign is available without actually setting evmAccountInfo. The comment suggests uncertainty about how to get the EVM address. This results in evmAccountInfo always being nil in this code path, which may not be the intended behavior.

@zhouxl zhouxl merged commit 0ae4100 into dev Jan 14, 2026
4 checks passed
@zhouxl zhouxl deleted the 310/897-ios-upgrade-register-endpoint-from-v3-to-v4 branch January 14, 2026 07:31
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] Upgrade register endpoint from v3 to v4

2 participants