Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createTransactionObserver(moduleInstance) {
if (moduleInstance.currentProvider.supportsSubscriptions()) {
return new SocketTransactionObserver(
moduleInstance.currentProvider,
this.getTimeout(moduleInstance),
moduleInstance.transactionConfirmationBlocks,
new GetTransactionReceiptMethod(this.utils, this.formatters, moduleInstance),
new NewHeadsSubscription(this.utils, this.formatters, moduleInstance)
);
}
return new HttpTransactionObserver(
moduleInstance.currentProvider,
this.getTimeout(moduleInstance),
moduleInstance.transactionConfirmationBlocks,
new GetTransactionReceiptMethod(this.utils, this.formatters, moduleInstance),
new GetBlockByNumberMethod(this.utils, this.formatters, moduleInstance)
);
}
createTransactionObserver(moduleInstance) {
if (moduleInstance.currentProvider.supportsSubscriptions()) {
return new SocketTransactionObserver(
moduleInstance.currentProvider,
this.getTimeout(moduleInstance),
moduleInstance.transactionConfirmationBlocks,
new GetTransactionReceiptMethod(this.utils, this.formatters, moduleInstance),
new NewHeadsSubscription(this.utils, this.formatters, moduleInstance)
);
}
return new HttpTransactionObserver(
moduleInstance.currentProvider,
this.getTimeout(moduleInstance),
moduleInstance.transactionConfirmationBlocks,
new GetTransactionReceiptMethod(this.utils, this.formatters, moduleInstance),
new GetBlockByNumberMethod(this.utils, this.formatters, moduleInstance)
);
}