@@ -20,17 +20,18 @@ public class UserModule: BaseModule {
2020 GetIdToken
2121 */
2222 public func getIdToken( _ configuration: GetIdTokenConfiguration ? = nil , response: @escaping Web3ResponseCompletion < String > ) {
23+ if #available( iOS 14 . 0 , * ) {
24+ UserModule . logger. warning ( " getIdToken: \( BaseWarningLog . MA_Method) " )
25+ } else {
26+ print ( " getIdToken: \( BaseWarningLog . MA_Method) " )
27+ }
28+
2329 let request = RPCRequest < [ GetIdTokenConfiguration ? ] > ( method: UserMethod . magic_auth_get_id_token. rawValue, params: [ configuration] )
2430
2531 return self . provider. send ( request: request, response: response)
2632 }
2733
2834 public func getIdToken( _ configuration: GetIdTokenConfiguration ? = nil ) -> Promise < String > {
29- if #available( iOS 14 . 0 , * ) {
30- UserModule . logger. warning ( " getIdToken: \( BaseWarningLog . MA_Method) " )
31- } else {
32- print ( " \( BaseWarningLog . MA_Method) " )
33- }
3435 return Promise { resolver in
3536 getIdToken ( configuration, response: promiseResolver ( resolver) )
3637 }
@@ -40,18 +41,18 @@ public class UserModule: BaseModule {
4041 Generate Id Token
4142 */
4243 public func generateIdToken( _ configuration: GenerateIdTokenConfiguration ? = nil , response: @escaping Web3ResponseCompletion < String > ) {
44+ if #available( iOS 14 . 0 , * ) {
45+ UserModule . logger. warning ( " generateIdToken: \( BaseWarningLog . MA_Method) " )
46+ } else {
47+ print ( " generateIdToken: \( BaseWarningLog . MA_Method) " )
48+ }
49+
4350 let request = RPCRequest < [ GenerateIdTokenConfiguration ? ] > ( method: UserMethod . magic_auth_generate_id_token. rawValue, params: [ configuration] )
4451
4552 return self . provider. send ( request: request, response: response)
4653 }
4754
4855 public func generateIdToken( _ configuration: GenerateIdTokenConfiguration ? = nil ) -> Promise < String > {
49- if #available( iOS 14 . 0 , * ) {
50- UserModule . logger. warning ( " generateIdToken: \( BaseWarningLog . MA_Method) " )
51- } else {
52- print ( " \( BaseWarningLog . MA_Method) " )
53- }
54-
5556 return Promise { resolver in
5657 generateIdToken ( configuration, response: promiseResolver ( resolver) )
5758 }
@@ -62,17 +63,17 @@ public class UserModule: BaseModule {
6263 Get Metadata
6364 */
6465 public func getMetadata( response: @escaping Web3ResponseCompletion < UserMetadata > ) {
65- let request = BasicRPCRequest ( method: UserMethod . magic_auth_get_metadata. rawValue, params: [ ] )
66- return self . provider. send ( request: request, response: response)
67- }
68-
69- public func getMetadata( ) -> Promise < UserMetadata > {
7066 if #available( iOS 14 . 0 , * ) {
7167 UserModule . logger. warning ( " getMetadata: \( BaseWarningLog . MA_Method) " )
7268 } else {
73- print ( " \( BaseWarningLog . MA_Method) " )
69+ print ( " getMetadata: \( BaseWarningLog . MA_Method) " )
7470 }
7571
72+ let request = BasicRPCRequest ( method: UserMethod . magic_auth_get_metadata. rawValue, params: [ ] )
73+ return self . provider. send ( request: request, response: response)
74+ }
75+
76+ public func getMetadata( ) -> Promise < UserMetadata > {
7677 return Promise { resolver in
7778 getMetadata ( response: promiseResolver ( resolver) )
7879 }
@@ -82,17 +83,16 @@ public class UserModule: BaseModule {
8283 IsLogged In
8384 */
8485 public func isLoggedIn( response: @escaping Web3ResponseCompletion < Bool > ) {
86+ if #available( iOS 14 . 0 , * ) {
87+ UserModule . logger. warning ( " isLoggedIn: \( BaseWarningLog . MA_Method) " )
88+ } else {
89+ print ( " isLoggedIn: \( BaseWarningLog . MA_Method) " )
90+ }
8591 let request = BasicRPCRequest ( method: UserMethod . magic_auth_is_logged_in. rawValue, params: [ ] )
8692 self . provider. send ( request: request, response: response)
8793 }
8894
8995 public func isLoggedIn( ) -> Promise < Bool > {
90- if #available( iOS 14 . 0 , * ) {
91- UserModule . logger. warning ( " isLoggedIn: \( BaseWarningLog . MA_Method) " )
92- } else {
93- print ( " \( BaseWarningLog . MA_Method) " )
94- }
95-
9696 return Promise { resolver in
9797 isLoggedIn ( response: promiseResolver ( resolver) )
9898 }
@@ -102,31 +102,18 @@ public class UserModule: BaseModule {
102102 * Update Email
103103 */
104104 public func updateEmail( _ configuration: UpdateEmailConfiguration , response: @escaping Web3ResponseCompletion < Bool > ) {
105-
106105 let request = RPCRequest < [ UpdateEmailConfiguration ] > ( method: UserMethod . magic_auth_update_email. rawValue, params: [ configuration] )
107106
108107 return self . provider. send ( request: request, response: response)
109108 }
110109
111110 public func updateEmail( _ configuration: UpdateEmailConfiguration ) -> Promise < Bool > {
112- if #available( iOS 14 . 0 , * ) {
113- UserModule . logger. warning ( " updateEmail: \( BaseWarningLog . MA_Method) " )
114- } else {
115- print ( " \( BaseWarningLog . MA_Method) " )
116- }
117-
118111 return Promise { resolver in
119112 updateEmail ( configuration, response: promiseResolver ( resolver) )
120113 }
121114 }
122115
123116 public func updateEmail( _ configuration: UpdateEmailConfiguration , eventLog: Bool ) -> MagicEventPromise < Bool > {
124- if #available( iOS 14 . 0 , * ) {
125- UserModule . logger. warning ( " updateEmail: \( BaseWarningLog . MA_Method) " )
126- } else {
127- print ( " \( BaseWarningLog . MA_Method) " )
128- }
129-
130117 return MagicEventPromise ( eventCenter: self . magicEventCenter, eventLog: eventLog) { resolver in
131118 self . updateEmail ( configuration, response: promiseResolver ( resolver) )
132119 }
@@ -136,17 +123,17 @@ public class UserModule: BaseModule {
136123 Logout
137124 */
138125 public func logout ( response: @escaping Web3ResponseCompletion < Bool > ) {
139- let request = BasicRPCRequest ( method: UserMethod . magic_auth_logout. rawValue, params: [ ] )
140- self . provider. send ( request: request, response: response)
141- }
142-
143- public func logout( ) -> Promise < Bool > {
144126 if #available( iOS 14 . 0 , * ) {
145127 UserModule . logger. warning ( " logout: \( BaseWarningLog . MA_Method) " )
146128 } else {
147- print ( " \( BaseWarningLog . MA_Method) " )
129+ print ( " logout: \( BaseWarningLog . MA_Method) " )
148130 }
149131
132+ let request = BasicRPCRequest ( method: UserMethod . magic_auth_logout. rawValue, params: [ ] )
133+ self . provider. send ( request: request, response: response)
134+ }
135+
136+ public func logout( ) -> Promise < Bool > {
150137 return Promise { resolver in
151138 logout ( response: promiseResolver ( resolver) )
152139 }
@@ -155,17 +142,17 @@ public class UserModule: BaseModule {
155142 showSettings
156143 */
157144 public func showSettings( response: @escaping Web3ResponseCompletion < String > ) {
158- let request = BasicRPCRequest ( method: UserMethod . magic_auth_settings. rawValue, params: [ ] )
159- self . provider. send ( request: request, response: response)
160- }
161-
162- public func showSettings( ) -> Promise < String > {
163145 if #available( iOS 14 . 0 , * ) {
164146 UserModule . logger. warning ( " showSettings: \( BaseWarningLog . MA_Method) " )
165147 } else {
166- print ( " \( BaseWarningLog . MA_Method) " )
148+ print ( " showSettings: \( BaseWarningLog . MA_Method) " )
167149 }
168150
151+ let request = BasicRPCRequest ( method: UserMethod . magic_auth_settings. rawValue, params: [ ] )
152+ self . provider. send ( request: request, response: response)
153+ }
154+
155+ public func showSettings( ) -> Promise < String > {
169156 return Promise { resolver in
170157 showSettings ( response: promiseResolver ( resolver) )
171158 }
@@ -175,6 +162,12 @@ public class UserModule: BaseModule {
175162 updatePhoneNumber
176163 */
177164 public func updatePhoneNumber( response: @escaping Web3ResponseCompletion < String > ) {
165+ if #available( iOS 14 . 0 , * ) {
166+ UserModule . logger. warning ( " updatePhoneNumber: \( BaseWarningLog . MA_Method) " )
167+ } else {
168+ print ( " updatePhoneNumber: \( BaseWarningLog . MA_Method) " )
169+ }
170+
178171 let request = BasicRPCRequest ( method: UserMethod . magic_auth_update_phone_number. rawValue, params: [ ] )
179172 self . provider. send ( request: request, response: response)
180173 }
@@ -189,6 +182,11 @@ public class UserModule: BaseModule {
189182 recoverAccount
190183 */
191184 public func recoverAccount( _ configuration: RecoverAccountConfiguration , response: @escaping Web3ResponseCompletion < Bool > ) {
185+ if #available( iOS 14 . 0 , * ) {
186+ UserModule . logger. warning ( " recoverAccount: \( BaseWarningLog . MA_Method) " )
187+ } else {
188+ print ( " recoverAccount: \( BaseWarningLog . MA_Method) " )
189+ }
192190
193191 let request = RPCRequest < [ RecoverAccountConfiguration ] > ( method: UserMethod . magic_auth_recover_account. rawValue, params: [ configuration] )
194192
0 commit comments