Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async getTransaction(txHash: string): Promise {
try {
const response = await this.provider.send(
RPCMethod.GetTransaction,
txHash,
);
if (response.error) {
return Promise.reject(response.error);
}
return response.result.receipt.success
? Transaction.confirm(toTxParams(response), this.provider)
: Transaction.reject(toTxParams(response), this.provider);
} catch (err) {
throw err;
}
}