@@ -168,6 +168,26 @@ public struct AuthConnectionConfig: Codable {
168168}
169169
170170public struct Web3AuthOptions : Codable {
171+
172+ public var isFlutterAnalytics : Bool = false
173+ public var sdkVersion : String ? = nil
174+
175+ public mutating func setFlutterAnalytics( _ isFlutter: Bool ? , sdkVersion: String ? = nil ) {
176+ self . isFlutterAnalytics = isFlutter ?? false
177+ self . sdkVersion = sdkVersion
178+ }
179+
180+ public func getSdkName( ) -> String {
181+ return isFlutterAnalytics ? AnalyticsSdkType . flutter : AnalyticsSdkType . ios
182+ }
183+
184+ public func getSdkVersion( ) -> String {
185+ if let version = sdkVersion, !version. isEmpty {
186+ return version // Flutter SDK version
187+ }
188+ return AnalyticsEvents . iosSdkVersion // Default iOS SDK version
189+ }
190+
171191 public init ( clientId: String , redirectUrl: String , originData: [ String : String ] ? = nil , authBuildEnv: BuildEnv ? = . production, sdkUrl: String ? = nil ,
172192 storageServerUrl: String ? = nil , sessionSocketUrl: String ? = nil , authConnectionConfig: [ AuthConnectionConfig ] ? = nil ,
173193 whiteLabel: WhiteLabelData ? = nil , dashboardUrl: String ? = nil , accountAbstractionConfig: String ? = nil , walletSdkUrl: String ? = nil ,
@@ -253,7 +273,7 @@ public struct Web3AuthOptions: Codable {
253273 var web3AuthNetwork : Web3AuthNetwork
254274 var useSFAKey : Bool ?
255275 var walletServicesConfig : WalletServicesConfig ?
256- let mfaSettings : MfaSettings ?
276+ var mfaSettings : MfaSettings ?
257277
258278
259279 enum CodingKeys : String , CodingKey {
@@ -736,6 +756,8 @@ public struct ProjectConfigResponse: Codable {
736756 public var walletConnectEnabled : Bool ? = nil
737757 public var walletConnectProjectId : String ? = nil
738758 public var whitelabel : WhiteLabelData ? = nil
759+ public var teamId : Int ? = nil
760+ public var mfaSettings : MfaSettings ?
739761
740762 enum CodingKeys : String , CodingKey {
741763 case userDataInIdToken
@@ -750,6 +772,8 @@ public struct ProjectConfigResponse: Codable {
750772 case walletConnectEnabled = " wallet_connect_enabled "
751773 case walletConnectProjectId
752774 case whitelabel
775+ case teamId
776+ case mfaSettings
753777 }
754778
755779 public init ( from decoder: Decoder ) throws {
@@ -766,6 +790,8 @@ public struct ProjectConfigResponse: Codable {
766790 self . walletConnectEnabled = try container. decodeIfPresent ( Bool . self, forKey: . walletConnectEnabled) ?? false
767791 self . walletConnectProjectId = try container. decodeIfPresent ( String . self, forKey: . walletConnectProjectId)
768792 self . whitelabel = try container. decodeIfPresent ( WhiteLabelData . self, forKey: . whitelabel)
793+ self . teamId = try container. decodeIfPresent ( Int . self, forKey: . teamId)
794+ self . mfaSettings = try container. decodeIfPresent ( MfaSettings . self, forKey: . mfaSettings)
769795 }
770796}
771797
@@ -815,3 +841,17 @@ public struct Web3AuthSubVerifierInfo: Codable {
815841 var idToken : String
816842}
817843
844+ extension MfaSettings {
845+ func merge( with other: MfaSettings ? ) -> MfaSettings {
846+ guard let other = other else { return self }
847+ return MfaSettings (
848+ deviceShareFactor: other. deviceShareFactor ?? self . deviceShareFactor,
849+ backUpShareFactor: other. backUpShareFactor ?? self . backUpShareFactor,
850+ socialBackupFactor: other. socialBackupFactor ?? self . socialBackupFactor,
851+ passwordFactor: other. passwordFactor ?? self . passwordFactor,
852+ passkeysFactor: other. passkeysFactor ?? self . passkeysFactor,
853+ authenticatorFactor: other. authenticatorFactor ?? self . authenticatorFactor
854+ )
855+ }
856+ }
857+
0 commit comments