@@ -84,6 +84,11 @@ private async void ConnectWallet(WalletOptions options)
84
84
{
85
85
// Connect the wallet
86
86
87
+ var internalWalletProvider = options . Provider == WalletProvider . MetaMaskWallet ? WalletProvider . WalletConnectWallet : options . Provider ;
88
+ var currentPanel = WalletPanels . Find ( panel => panel . Identifier == internalWalletProvider . ToString ( ) ) ;
89
+
90
+ Log ( currentPanel . LogText , $ "Connecting...") ;
91
+
87
92
var wallet = await ThirdwebManager . Instance . ConnectWallet ( options ) ;
88
93
89
94
// Initialize the wallet panel
@@ -92,8 +97,6 @@ private async void ConnectWallet(WalletOptions options)
92
97
93
98
// Setup actions
94
99
95
- var internalWalletProvider = options . Provider == WalletProvider . MetaMaskWallet ? WalletProvider . WalletConnectWallet : options . Provider ;
96
- var currentPanel = WalletPanels . Find ( panel => panel . Identifier == internalWalletProvider . ToString ( ) ) ;
97
100
ClearLog ( currentPanel . LogText ) ;
98
101
currentPanel . Panel . SetActive ( true ) ;
99
102
@@ -121,6 +124,7 @@ private async void ConnectWallet(WalletOptions options)
121
124
currentPanel . Action3Button . onClick . RemoveAllListeners ( ) ;
122
125
currentPanel . Action3Button . onClick . AddListener ( async ( ) =>
123
126
{
127
+ LoadingLog ( currentPanel . LogText ) ;
124
128
var balance = await wallet . GetBalance ( chainId : ActiveChainId ) ;
125
129
var balanceEth = Utils . ToEth ( wei : balance . ToString ( ) , decimalsToDisplay : 4 , addCommas : true ) ;
126
130
Log ( currentPanel . LogText , $ "Balance: { balanceEth } { _chainDetails . NativeCurrency . Symbol } ") ;
@@ -171,7 +175,7 @@ private void InitializeInAppWalletPanel()
171
175
InitializeInAppWalletPanel_Phone ( ) ;
172
176
} ) ;
173
177
174
- // Socials (Using Google Here)
178
+ // Socials
175
179
panel . Action3Button . onClick . RemoveAllListeners ( ) ;
176
180
panel . Action3Button . onClick . AddListener ( ( ) =>
177
181
{
@@ -256,6 +260,7 @@ private void InitializeInAppWalletPanel_Socials()
256
260
{
257
261
try
258
262
{
263
+ Log ( panel . LogText , "Authenticating..." ) ;
259
264
var inAppWalletOptions = new InAppWalletOptions ( authprovider : AuthProvider . Google ) ;
260
265
var options = new WalletOptions ( provider : WalletProvider . InAppWallet , chainId : ActiveChainId , inAppWalletOptions : inAppWalletOptions ) ;
261
266
ConnectWallet ( options ) ;
@@ -271,6 +276,7 @@ private void InitializeInAppWalletPanel_Socials()
271
276
{
272
277
try
273
278
{
279
+ Log ( panel . LogText , "Authenticating..." ) ;
274
280
var inAppWalletOptions = new InAppWalletOptions ( authprovider : AuthProvider . Apple ) ;
275
281
var options = new WalletOptions ( provider : WalletProvider . InAppWallet , chainId : ActiveChainId , inAppWalletOptions : inAppWalletOptions ) ;
276
282
ConnectWallet ( options ) ;
@@ -286,6 +292,7 @@ private void InitializeInAppWalletPanel_Socials()
286
292
{
287
293
try
288
294
{
295
+ Log ( panel . LogText , "Authenticating..." ) ;
289
296
var inAppWalletOptions = new InAppWalletOptions ( authprovider : AuthProvider . Discord ) ;
290
297
var options = new WalletOptions ( provider : WalletProvider . InAppWallet , chainId : ActiveChainId , inAppWalletOptions : inAppWalletOptions ) ;
291
298
ConnectWallet ( options ) ;
@@ -318,6 +325,7 @@ private void InitializeContractsPanel()
318
325
{
319
326
try
320
327
{
328
+ LoadingLog ( panel . LogText ) ;
321
329
var dropErc1155Contract = await ThirdwebManager . Instance . GetContract ( address : "0x6A7a26c9a595E6893C255C9dF0b593e77518e0c3" , chainId : ActiveChainId ) ;
322
330
var nft = await dropErc1155Contract . ERC1155_GetNFT ( tokenId : 1 ) ;
323
331
Log ( panel . LogText , $ "NFT: { JsonConvert . SerializeObject ( nft . Metadata ) } ") ;
@@ -334,6 +342,7 @@ private void InitializeContractsPanel()
334
342
{
335
343
try
336
344
{
345
+ LoadingLog ( panel . LogText ) ;
337
346
var contract = await ThirdwebManager . Instance . GetContract ( address : "0x6A7a26c9a595E6893C255C9dF0b593e77518e0c3" , chainId : ActiveChainId ) ;
338
347
var result = await contract . ERC1155_URI ( tokenId : 1 ) ;
339
348
Log ( panel . LogText , $ "Result (uri): { result } ") ;
@@ -350,6 +359,7 @@ private void InitializeContractsPanel()
350
359
{
351
360
try
352
361
{
362
+ LoadingLog ( panel . LogText ) ;
353
363
var dropErc20Contract = await ThirdwebManager . Instance . GetContract ( address : "0xEBB8a39D865465F289fa349A67B3391d8f910da9" , chainId : ActiveChainId ) ;
354
364
var symbol = await dropErc20Contract . ERC20_Symbol ( ) ;
355
365
var balance = await dropErc20Contract . ERC20_BalanceOf ( ownerAddress : await ThirdwebManager . Instance . GetActiveWallet ( ) . GetAddress ( ) ) ;
@@ -431,6 +441,7 @@ private async void InitializeAccountAbstractionPanel()
431
441
{
432
442
try
433
443
{
444
+ LoadingLog ( panel . LogText ) ;
434
445
var activeSigners = await smartWallet . GetAllActiveSigners ( ) ;
435
446
Log ( panel . LogText , $ "Active Signers: { JsonConvert . SerializeObject ( activeSigners ) } ") ;
436
447
}
@@ -460,5 +471,10 @@ private void Log(TMP_Text logText, string message)
460
471
logText . text = message ;
461
472
ThirdwebDebug . Log ( message ) ;
462
473
}
474
+
475
+ private void LoadingLog ( TMP_Text logText )
476
+ {
477
+ logText . text = "Loading..." ;
478
+ }
463
479
}
464
480
}
0 commit comments