Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.wc.on('connect', (err: Error | null, payload: any) => {
if (err) {
this.emit('error', err)
return
}
this.connected = true
if (this.qrcode) {
WCQRCode.close() // Close QR Code Modal
}
// Handle session update
this.updateState(payload.params[0])
// Emit connect event
this.emit('connect')
})
this.wc.on('connect', (err: Error | null, payload: any) => {
if (err) {
this.emit('error', err)
return
}
this.connected = true
if (this.qrcode) {
WCQRCode.close() // Close QR Code Modal
}
// Handle session update
this.updateState(payload.params[0])
// Emit connect event
this.emit('connect')
})
wc.on('connect', (error, payload) => {
if (this.qrcode) {
WalletConnectQRCodeModal.close()
}
if (error) {
this.isConnecting = false
return reject(error)
}
this.isConnecting = false
this.connected = true
if (payload) {
// Handle session update
this.updateState(payload.params[0])
}
// Emit connect event
this.emit('connect')
this.triggerConnect(wc)
walletConnector.on('connect', (error: string) => {
if (error) {
console.log('Error on connect:' + error);
}
// Close QR Code Modal
WalletConnectQRCodeModal.close();
});
this.connector.on("connect", (error, payload) => {
if (error) {
result.error(error);
}
ignoreClose = true;
// Close QR Code Modal
WalletConnectQRCodeModal.close();
result.next(true);
});
return result;
provider.wc.on('disconnect', (error, payload) => {
if (error) {
throw error
}
console.log("User cancel a sign-in request")
WalletConnectQRCodeModal.close()
provider.updateState({...INITIAL_STATE})
})
this.walletConnect.on('connect', (error, payload) => {
if (error) {
throw error;
}
WalletConnectQRCodeModal.close();
const { accounts, chainId } = payload.params[0];
resolve(
new MEWconnectWalletInterface(
sanitizeHex(accounts[0]),
this.isHardware,
this.identifier,
txSigner,
msgSigner,
this.walletConnect
)
);
console.log(accounts, chainId, 'onConnect');
});
});
walletConnector.on('connect', () => {
if (this.qrcode) {
WalletConnectQRCodeModal.close()
}
this.isConnecting = false
this.triggerConnect(walletConnector)
resolve(walletConnector)
})
})
public onDisconnect = async () => {
WalletConnectQRCodeModal.close();
this.resetApp();
};
walletConnector.on('connect', (error, payload) => {
if (error) {
throw error;
}
WalletConnectQRCodeModal.close();
const { accounts, chainId } = payload.params[0];
dispatch(
walletConnectHandleSession({ newSession: true, accounts, chainId }),
);
});