@@ -84,7 +84,7 @@ export const useGateway = (
84
84
[ ]
85
85
) ;
86
86
const addTransaction = useCallback ( ( newTx : GatewayTransaction ) => {
87
- console . log ( "gateway detected tx:" , newTx . hash , newTx ) ;
87
+ console . info ( "gateway detected tx:" , newTx . hash , newTx ) ;
88
88
setTransactions ( ( txs ) => {
89
89
const index = txs . findIndex ( ( tx ) => tx . hash === newTx . hash ) ;
90
90
if ( index >= 0 ) {
@@ -96,7 +96,7 @@ export const useGateway = (
96
96
97
97
useEffect ( ( ) => {
98
98
// setRenJs(null); // added
99
- console . log ( "gateway useEffect renJs and provider" ) ;
99
+ console . info ( "gateway useEffect renJs and provider" ) ;
100
100
if ( ! chains ) {
101
101
return ;
102
102
}
@@ -119,11 +119,11 @@ export const useGateway = (
119
119
120
120
useEffect ( ( ) => {
121
121
// setGateway(null); // added
122
- console . log ( "gateway useEffect gateway init" ) ;
122
+ console . info ( "gateway useEffect gateway init" ) ;
123
123
let newGateway : Gateway | null = null ;
124
124
if ( renJs && chains !== null ) {
125
125
const initializeGateway = async ( ) => {
126
- console . log ( "gateway params" , {
126
+ console . info ( "gateway params" , {
127
127
asset,
128
128
from,
129
129
to,
@@ -137,13 +137,13 @@ export const useGateway = (
137
137
chains ,
138
138
partialTx
139
139
) ;
140
- console . log ( "gateway created" , newGateway ) ;
140
+ console . info ( "gateway created" , newGateway ) ;
141
141
newGateway . on ( "transaction" , addTransaction ) ;
142
- console . log ( "gateway transaction listener added" ) ;
142
+ console . info ( "gateway transaction listener added" ) ;
143
143
( window as any ) . gateway = newGateway ;
144
144
return newGateway ;
145
145
} ;
146
- console . log ( "gateway initializing" , chains ) ;
146
+ console . info ( "gateway initializing" , chains ) ;
147
147
initializeGateway ( )
148
148
. then ( ( newGateway ) => setGateway ( newGateway ) )
149
149
. catch ( ( error ) => {
@@ -154,7 +154,7 @@ export const useGateway = (
154
154
155
155
return ( ) => {
156
156
if ( newGateway && autoTeardown ) {
157
- console . log ( "gateway removing listeners" ) ;
157
+ console . info ( "gateway removing listeners" ) ;
158
158
newGateway . eventEmitter . removeListener ( "transaction" , addTransaction ) ;
159
159
}
160
160
} ;
@@ -177,14 +177,12 @@ export const useGateway = (
177
177
async ( txHash , localTxEntry ) => {
178
178
// tx.done?
179
179
if ( renJs !== null && gateway !== null ) {
180
- console . log ( "tx: gateway transactions before" , gateway . transactions ) ;
181
- console . log ( "tx: recovering" , localTxEntry ) ;
180
+ console . info ( "tx: recovering" , localTxEntry ) ;
182
181
183
182
const tx = await renJs . gatewayTransaction ( localTxEntry . params ) ;
184
- console . log ( "tx: created" , tx ) ;
183
+ console . info ( "tx: created" , tx ) ;
185
184
// TODO: TBD: discuss with Noah
186
185
gateway . transactions = gateway . transactions . set ( txHash , tx ) ;
187
- console . log ( "tx: gateway transactions after" , gateway . transactions ) ;
188
186
// addTransaction(tx); will be handled automatically, emitter is required
189
187
gateway . eventEmitter . emit ( "transaction" , tx ) ;
190
188
} else {
@@ -248,7 +246,7 @@ export const useGatewayFeesObject = (
248
246
} ) ;
249
247
return gatewayFeesObject ;
250
248
} ;
251
- console . log ( "gateway initializing" , chains ) ;
249
+ console . info ( "gateway initializing" , chains ) ;
252
250
initializeGatewayFees ( )
253
251
. then ( ( gatewayFeesObject ) => setGatewayFeesObject ( gatewayFeesObject ) )
254
252
. catch ( ( error ) => {
@@ -262,7 +260,6 @@ export const useGatewayFeesObject = (
262
260
} ;
263
261
264
262
export const useAssetDecimals = ( chain : Chain , asset : string | Asset ) => {
265
- console . log ( "useAssetDecimals" , chain , asset ) ;
266
263
const chains = useCurrentNetworkChains ( ) ;
267
264
const instance = chains [ chain ] ?. chain ;
268
265
return useChainInstanceAssetDecimals ( instance , asset ) ;
@@ -351,22 +348,19 @@ export const useContractChainAssetBalance = (
351
348
decimals === null ||
352
349
! isContractBaseChain ( instance . chain as Chain )
353
350
) {
354
- console . log ( "not ready" ) ;
355
351
setBalance ( null ) ;
356
352
return ;
357
353
}
358
354
if ( connected !== undefined && ! connected ) {
359
- console . log ( "!connected mode" ) ;
360
355
return ;
361
356
}
362
357
const getBalance = async ( ) => {
363
- console . log ( `asset balance ${ instance ?. chain } /${ asset } : ${ decimals } ` ) ;
358
+ console . info ( `asset balance ${ instance ?. chain } /${ asset } : ${ decimals } ` ) ;
364
359
setBalance ( null ) ;
365
360
const balanceBn = (
366
361
await ( instance as ContractChain ) . getBalance ( asset , address || "" )
367
362
) . shiftedBy ( - decimals ) ;
368
363
setBalance ( balanceBn . toFixed ( ) ) ;
369
- console . log ( `gateway balance: ${ balanceBn } ` ) ;
370
364
} ;
371
365
getBalance ( ) . catch ( ( error ) => {
372
366
console . error ( error ) ;
@@ -494,7 +488,7 @@ export const useGatewayFees = (
494
488
. estimateOutput ( amountBn . shiftedBy ( fromChainDecimals ) )
495
489
. shiftedBy ( - fromChainDecimals ) ;
496
490
setOutputAmount ( estimatedOutputBn . toFixed ( ) ) ;
497
- console . log ( `gateway amount estimated output: ${ estimatedOutputBn } ` ) ;
491
+ console . info ( `gateway amount estimated output: ${ estimatedOutputBn } ` ) ;
498
492
499
493
const renVMFeeAmountBn = renVMFeePercentBn . div ( 100 ) . multipliedBy ( amountBn ) ;
500
494
setRenVMFeeAmount ( renVMFeeAmountBn . toFixed ( ) ) ;
@@ -759,14 +753,13 @@ export const useGatewayMeta = (
759
753
}
760
754
reset ( ) ;
761
755
setError ( undefined ) ;
762
- console . log ( asset , from , to ) ;
763
756
if ( asset === null || from === null || to === null ) {
764
757
return ;
765
758
}
766
759
setIsToContractChain ( Boolean ( chains [ to ] ?. connectionRequired ) ) ;
767
760
setIsFromContractChain ( Boolean ( chains [ from ] ?. connectionRequired ) ) ;
768
761
769
- console . log ( "getInputAndOutputTypes" , asset , from , to ) ;
762
+ console . info ( "getInputAndOutputTypes" , asset , from , to ) ;
770
763
771
764
const promise = getInputAndOutputTypes ( {
772
765
asset,
@@ -775,7 +768,7 @@ export const useGatewayMeta = (
775
768
} ) ;
776
769
const cancelablePromise = cancelable ( promise )
777
770
. then ( ( { inputType, outputType, selector } ) => {
778
- console . log ( "getInputAndOutputTypes" , inputType , outputType , selector ) ;
771
+ console . info ( "getInputAndOutputTypes" , inputType , outputType , selector ) ;
779
772
// deprecated, keep until cleaned
780
773
if ( inputType === InputType . Burn ) {
781
774
setIsBurn ( true ) ;
0 commit comments