Created
September 8, 2022 20:56
-
-
Save macelai/911026c8397681bf50b5de9094eaab0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return new Promise((_, rej) => { | |
const provider = webSocketProvider() | |
//@ts-ignore | |
provider.on('error', e => rej(e)) | |
const web3 = new Web3(provider) | |
try { | |
var contract = new web3.eth.Contract(signaturesAbi, SIGNATURES_CONTRACT) | |
contract.events | |
.NewMigration({ fromBlock: verifiedSignatureLatestBlock }, handleEvent) | |
.on('error', (event: any) => debug.error(event, 'error on signature event')) | |
} catch (error) { | |
rej(error) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the webSocketProvider function is missing