@@ -330,6 +330,23 @@ public static async Task<BlockWithTransactions> GetBlockWithTransactions(BigInte
330330 return JsonConvert . DeserializeObject < Result < BlockWithTransactions > > ( result ) . result ;
331331 }
332332
333+ public static async Task < string > GetEmail ( )
334+ {
335+ if ( ! Utils . IsWebGLBuild ( ) )
336+ {
337+ ThirdwebDebug . LogWarning ( "Interacting with the thirdweb SDK is not fully supported in the editor." ) ;
338+ return "" ;
339+ }
340+ string taskId = Guid . NewGuid ( ) . ToString ( ) ;
341+ var task = new TaskCompletionSource < string > ( ) ;
342+ taskMap [ taskId ] = task ;
343+ #if UNITY_WEBGL
344+ ThirdwebGetEmail ( taskId , jsCallback ) ;
345+ #endif
346+ string result = await task . Task ;
347+ return JsonConvert . DeserializeObject < Result < string > > ( result ) . result ;
348+ }
349+
333350#if UNITY_WEBGL
334351 [ DllImport ( "__Internal" ) ]
335352 private static extern string ThirdwebInvoke ( string taskId , string route , string payload , Action < string , string , string > cb ) ;
@@ -361,7 +378,8 @@ public static async Task<BlockWithTransactions> GetBlockWithTransactions(BigInte
361378 private static extern string ThirdwebGetBlock ( string taskId , string blockNumber , Action < string , string , string > cb ) ;
362379 [ DllImport ( "__Internal" ) ]
363380 private static extern string ThirdwebGetBlockWithTransactions ( string taskId , string blockNumber , Action < string , string , string > cb ) ;
364-
381+ [ DllImport ( "__Internal" ) ]
382+ private static extern string ThirdwebGetEmail ( string taskId , Action < string , string , string > cb ) ;
365383#endif
366384 }
367385}
0 commit comments