@@ -59,18 +59,20 @@ class IMMUTABLE_API UImmutablePassport : public UObject
59
59
60
60
/* *
61
61
* Initialises passport. This sets up the Passport instance, configures the web browser, and waits for the ready signal.
62
- * @param InitData Parameters to initialise the passport with.
63
- * @param ResponseDelegate Callback delegate.
62
+ *
63
+ * @param InitData Parameters to initialise the passport with.
64
+ * @param ResponseDelegate Callback delegate.
64
65
*/
65
66
void Initialize (const FImmutablePassportInitData& InitData, const FImtblPassportResponseDelegate& ResponseDelegate);
66
67
67
68
/* *
68
69
* Logs the user into Passport via device code auth and sets up the Immutable X provider.
70
+ *
69
71
* This will open the user's default browser and take them through Passport login.
70
- * @param IsConnectImx If true, the "re-connect" method is used to authenticate into Passport with Immutable X.
71
- * Else, "re-login" is used for authentication. To access a wallet with Immutable X or zkEVM later, you must call "Connect" again with this value set to true, or use "ConnectEvm."
72
- * @param TryToRelogin If true, the game bridge will use a cached session to re-connect or re-login the user, avoiding the need for a web browser. If this attempt fails, it will fall back to device code authentication.
73
- * @param ResponseDelegate Callback delegate.
72
+ * @param IsConnectImx If true, the "re-connect" method is used to authenticate into Passport with Immutable X.
73
+ * Else, "re-login" is used for authentication. To access a wallet with Immutable X or zkEVM later, you must call "Connect" again with this value set to true, or use "ConnectEvm."
74
+ * @param TryToRelogin If true, the game bridge will use a cached session to re-connect or re-login the user, avoiding the need for a web browser. If this attempt fails, it will fall back to device code authentication.
75
+ * @param ResponseDelegate Callback delegate.
74
76
*/
75
77
void Connect (bool IsConnectImx, bool TryToRelogin, const FImtblPassportResponseDelegate& ResponseDelegate);
76
78
#if PLATFORM_ANDROID | PLATFORM_IOS | PLATFORM_MAC
@@ -79,9 +81,10 @@ class IMMUTABLE_API UImmutablePassport : public UObject
79
81
80
82
/* *
81
83
* Logs the user out of Passport.
82
- * @param DoHardLogout If true, clears sessions and any stored credentials from both the SDK/plugin and the browser.
83
- * Else, clears session and any stored credentials from the SDK only, browser session and stored credentials are cleared when session expires.
84
- * @param ResponseDelegate Callback delegate.
84
+ *
85
+ * @param DoHardLogout If true, clears sessions and any stored credentials from both the SDK/plugin and the browser.
86
+ * Else, clears session and any stored credentials from the SDK only, browser session and stored credentials are cleared when session expires.
87
+ * @param ResponseDelegate Callback delegate.
85
88
*/
86
89
void Logout (bool DoHardLogout, const FImtblPassportResponseDelegate& ResponseDelegate);
87
90
@@ -141,30 +144,35 @@ class IMMUTABLE_API UImmutablePassport : public UObject
141
144
142
145
/* *
143
146
* Gets the currently saved ID token without verifying its validity.
147
+ *
144
148
* @param ResponseDelegate Callback delegate.
145
149
*/
146
150
void GetIdToken (const FImtblPassportResponseDelegate& ResponseDelegate);
147
151
148
152
/* *
149
153
* Gets the currently saved access token without verifying its validity.
154
+ *
150
155
* @param ResponseDelegate Callback delegate.
151
156
*/
152
157
void GetAccessToken (const FImtblPassportResponseDelegate& ResponseDelegate);
153
158
154
159
/* *
155
160
* Gets the wallet address of the logged in user.
161
+ *
156
162
* @param ResponseDelegate Callback delegate.
157
163
*/
158
164
void GetAddress (const FImtblPassportResponseDelegate& ResponseDelegate);
159
165
160
166
/* *
161
167
* Retrieves the email address of the user whose credentials are currently stored.
168
+ *
162
169
* @param ResponseDelegate Callback delegate.
163
170
*/
164
171
void GetEmail (const FImtblPassportResponseDelegate& ResponseDelegate);
165
172
166
173
/* *
167
174
* Gets the list of external wallets the user has linked to their Passport account via the
175
+ *
168
176
* @param ResponseDelegate Callback delegate.
169
177
*/
170
178
void GetLinkedAddresses (const FImtblPassportResponseDelegate& ResponseDelegate);
@@ -212,22 +220,28 @@ class IMMUTABLE_API UImmutablePassport : public UObject
212
220
213
221
/* *
214
222
* Retrieves the "result" as string field from Response.JsonObject.
215
- * @param Response The response to use to retrieve the "result" as string field.
216
- * @return The "result" as string field from Response.JsonObject if Response.JsonObject is valid, otherwise, an empty string.
223
+ *
224
+ * @param Response The response to use to retrieve the "result" as string field.
225
+ *
226
+ * @return The "result" as string field from Response.JsonObject if Response.JsonObject is valid, otherwise, an empty string.
217
227
*/
218
228
static FString GetResponseResultAsString (const FImtblJSResponse& Response);
219
229
220
230
/* *
221
231
* Retrieves the "result" as bool field from Response.JsonObject.
222
- * @param Response The response to use to retrieve the "result" as bool field.
223
- * @return True if Response.JsonObject is valid, otherwise, false.
232
+ *
233
+ * @param Response The response to use to retrieve the "result" as bool field.
234
+ *
235
+ * @return True if Response.JsonObject is valid, otherwise, false.
224
236
*/
225
237
static bool GetResponseResultAsBool (const FImtblJSResponse& Response);
226
238
227
239
/* *
228
240
* Retrieves the "result" as array field from Response.JsonObject and extracting them into an array of FString.
229
- * @param Response The response to use to retrieve and extract.
230
- * @return An array of FString extracted from the "result" field if Response.JsonObject is valid, otherwise, an empty array.
241
+ *
242
+ * @param Response The response to use to retrieve and extract.
243
+ *
244
+ * @return An array of FString extracted from the "result" field if Response.JsonObject is valid, otherwise, an empty array.
231
245
*/
232
246
static TArray<FString> GetResponseResultAsStringArray (const FImtblJSResponse& Response);
233
247
@@ -249,75 +263,88 @@ class IMMUTABLE_API UImmutablePassport : public UObject
249
263
250
264
/* *
251
265
* Calls JavaScript function to the connected browser with specified parameters.
252
- * @param Action The name of the JavaScript action to be called.
253
- * @param Data The data to be passed to the JavaScript action as FString.
254
- * @param ClientResponseDelegate Delegate to handle the response from the client.
255
- * @param HandleJSResponse Delegate to handle the response from the JavaScript function.
256
- * @param bCheckInitialized (Optional) If true, check if the passport is initialised. Else, initialised checks are skipped.
266
+ *
267
+ * @param Action The name of the JavaScript action to be called.
268
+ * @param Data The data to be passed to the JavaScript action as FString.
269
+ * @param ClientResponseDelegate Delegate to handle the response from the client.
270
+ * @param HandleJSResponse Delegate to handle the response from the JavaScript function.
271
+ * @param bCheckInitialized (Optional) If true, check if the passport is initialised. Else, initialised checks are skipped.
257
272
*/
258
273
void CallJS (const FString& Action, const FString& Data, const FImtblPassportResponseDelegate& ClientResponseDelegate, const FImtblJSResponseDelegate& HandleJSResponse, const bool bCheckInitialized = true );
259
274
260
275
/* *
261
276
* Sets up passport with the JavaScript connector
277
+ *
262
278
* @param Connector A weak pointer to the JavaScript Connector. If the connector is invalid set up will be aborted.
263
279
*/
264
280
void Setup (TWeakObjectPtr<class UImtblJSConnector > Connector);
265
281
266
282
/* *
267
283
* Reinstate the connection based on the provided JavaScript response.
284
+ *
268
285
* @param Response The JavaScript response object to reinstate the connection.
269
286
*/
270
287
void ReinstateConnection (FImtblJSResponse Response);
271
288
272
289
/* *
273
290
* Checks if the passport has been initialised before allowing an action to proceed.
274
- * @param Action The name of the JavaScript action to be called. Used for logging purposes.
275
- * @param ResponseDelegate Delegate to handle the response if the passport is not initialised.
276
- * @return True if the passport is initialised, otherwise, false.
291
+ *
292
+ * @param Action The name of the JavaScript action to be called. Used for logging purposes.
293
+ * @param ResponseDelegate Delegate to handle the response if the passport is not initialised.
294
+ *
295
+ * @return True if the passport is initialised, otherwise, false.
277
296
*/
278
297
bool CheckIsInitialized (const FString& Action, const FImtblPassportResponseDelegate& ResponseDelegate) const ;
279
298
280
299
/* *
281
300
* Retrieves the response delegate associated with a given JavaScript response from ResponseDelegates TMap.
282
- * @param Response The Javascript response object containing the request Id.
283
- * @return A TOptional containing the response delegate if found, otherwise, an empty TOptional.
301
+ *
302
+ * @param Response The Javascript response object containing the request Id.
303
+ *
304
+ * @return A TOptional containing the response delegate if found, otherwise, an empty TOptional.
284
305
*/
285
306
TOptional<FImtblPassportResponseDelegate> GetResponseDelegate (const FImtblJSResponse& Response);
286
307
287
308
/* *
288
309
* Confirms the device code by calling the appropriate JavaScript action.
289
- * @param DeviceCode The device code to be confirmed.
290
- * @param Interval The time interval to wait between attempts.
291
- * @param ResponseDelegate A delegate to handle the response from the confirmation request.
310
+ *
311
+ * @param DeviceCode The device code to be confirmed.
312
+ * @param Interval The time interval to wait between attempts.
313
+ * @param ResponseDelegate A delegate to handle the response from the confirmation request.
292
314
*/
293
315
void ConfirmCode (const FString& DeviceCode, const float Interval, const FImtblPassportResponseDelegate& ResponseDelegate);
294
316
295
317
/* *
296
318
* Common callback that handles the responses from game bridge
319
+ *
297
320
* @param Response The JavaScript response object containing the result of the callback.
298
321
*/
299
322
void OnBridgeCallbackResponse (FImtblJSResponse Response);
300
323
301
324
/* *
302
325
* Callback from init (passport).
326
+ *
303
327
* @param Response The JavaScript response object containing the result of the callback.
304
328
*/
305
329
void OnInitializeResponse (FImtblJSResponse Response);
306
330
307
331
/* *
308
332
* Callback from init device flow (device code auth login flow).
333
+ *
309
334
* @param Response The JavaScript response object containing the result of the callback.
310
335
*/
311
336
void OnInitDeviceFlowResponse (FImtblJSResponse Response);
312
337
313
338
/* *
314
339
* Callback from logout.
340
+ *
315
341
* @param Response The JavaScript response object containing the result of the callback.
316
342
*/
317
343
void OnLogoutResponse (FImtblJSResponse Response);
318
344
319
345
/* *
320
346
* Callback from confirm code.
347
+ *
321
348
* @param Response The JavaScript response object containing the result of the callback.
322
349
*/
323
350
void OnConfirmCodeResponse (FImtblJSResponse Response);
@@ -338,20 +365,24 @@ class IMMUTABLE_API UImmutablePassport : public UObject
338
365
339
366
/* *
340
367
* Sets the specified state flags by applying a bitwise OR operation.
368
+ *
341
369
* @param StateIn The state flags to be set.
342
370
*/
343
371
void SetStateFlags (uint8 StateIn);
344
372
345
373
/* *
346
374
* Resets the specified state flags by applying a bitwise AND operation with the negated flags.
375
+ *
347
376
* @param StateIn The state flags to be reset.
348
377
*/
349
378
void ResetStateFlags (uint8 StateIn);
350
379
351
380
/* *
352
381
* Checks if the specified state flags are set.
353
- * @param StateIn The state flags to check.
354
- * @return True if all StateIn flags are set, otherwise, false.
382
+ *
383
+ * @param StateIn The state flags to check.
384
+ *
385
+ * @return True if all StateIn flags are set, otherwise, false.
355
386
*/
356
387
bool IsStateFlagsSet (uint8 StateIn) const ;
357
388
0 commit comments