@@ -361,7 +361,7 @@ export class LitContracts {
361361 ( ! this . privateKey && this . randomPrivateKey ) ||
362362 this . options ?. storeOrUseStorageKey
363363 ) {
364- console . warn ( 'THIS.SIGNER:' , this . signer ) ;
364+ this . log ( 'THIS.SIGNER:' , this . signer ) ;
365365
366366 const STORAGE_KEY = 'lit-contracts-sdk-private-key' ;
367367
@@ -397,7 +397,7 @@ export class LitContracts {
397397
398398 // -- (OPTION) store private key in local storage
399399 if ( this . options ?. storeOrUseStorageKey ) {
400- console . warn (
400+ this . log (
401401 "You've set the option to store your private key in local storage."
402402 ) ;
403403 localStorage . setItem ( STORAGE_KEY , storagePrivateKey ) ;
@@ -428,12 +428,12 @@ export class LitContracts {
428428 }
429429
430430 this . log ( 'Your Signer:' , this . signer ) ;
431- this . log ( 'Your Provider:' , this . provider . connection ) ;
431+ this . log ( 'Your Provider:' , this . provider ? .connection ! ) ;
432432
433433 if ( ! this . provider ) {
434434 this . log ( 'No provider found. Will try to use the one from the signer.' ) ;
435435 this . provider = this . signer . provider ;
436- this . log ( 'Your Provider(from signer):' , this . provider . connection ) ;
436+ this . log ( 'Your Provider(from signer):' , this . provider ? .connection ! ) ;
437437 }
438438
439439 const addresses : any = await LitContracts . getContractAddresses (
@@ -1344,13 +1344,13 @@ https://developer.litprotocol.com/v3/sdk/wallets/auth-methods/#auth-method-scope
13441344 }
13451345
13461346 const tokenId = events [ 0 ] . topics [ 1 ] ;
1347- console . warn ( 'tokenId:' , tokenId ) ;
1347+ this . log ( 'tokenId:' , tokenId ) ;
13481348 let tries = 0 ;
13491349 const maxAttempts = 10 ;
13501350 let publicKey = '' ;
13511351 while ( tries < maxAttempts ) {
13521352 publicKey = await this . pkpNftContract . read . getPubkey ( tokenId ) ;
1353- console . log ( 'pkp pub key: ' , publicKey ) ;
1353+ this . log ( 'pkp pub key: ' , publicKey ) ;
13541354 if ( publicKey !== '0x' ) {
13551355 break ;
13561356 }
@@ -1975,15 +1975,15 @@ https://developer.litprotocol.com/v3/sdk/wallets/auth-methods/#auth-method-scope
19751975 const events = 'events' in res ? res . events : res . logs ;
19761976
19771977 const tokenIdFromEvent = events [ 0 ] . topics [ 1 ] ;
1978- console . warn ( 'tokenIdFromEvent:' , tokenIdFromEvent ) ;
1978+ this . log ( 'tokenIdFromEvent:' , tokenIdFromEvent ) ;
19791979 let tries = 0 ;
19801980 const maxAttempts = 10 ;
19811981 let publicKey = '' ;
19821982 while ( tries < maxAttempts ) {
19831983 publicKey = await this . pkpNftContract . read . getPubkey (
19841984 tokenIdFromEvent
19851985 ) ;
1986- console . log ( 'pkp pub key: ' , publicKey ) ;
1986+ this . log ( 'pkp pub key: ' , publicKey ) ;
19871987 if ( publicKey !== '0x' ) {
19881988 break ;
19891989 }
@@ -1993,7 +1993,7 @@ https://developer.litprotocol.com/v3/sdk/wallets/auth-methods/#auth-method-scope
19931993 } ) ;
19941994 }
19951995
1996- console . warn ( 'public key from token id' , publicKey ) ;
1996+ this . log ( 'public key from token id' , publicKey ) ;
19971997 if ( publicKey . startsWith ( '0x' ) ) {
19981998 publicKey = publicKey . slice ( 2 ) ;
19991999 }
0 commit comments