Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.announce = (url, tx, ...subscriber) => {
const transactionHttp = new nem.TransactionHttp(url)
const subscription = transactionHttp.announce(tx)
announceUtil(subscription, url, tx, ...subscriber)
}
public constructor(url: string) {
this.transactionHttp = new TransactionHttp(url);
this.accountHttp = new AccountHttp(url);
this.listener = new Listener(url);
}
public getTransactionById(transactionID: string, urls?: string): Observable {
let transactionHttp: TransactionHttp;
if (urls) {
transactionHttp = new TransactionHttp(urls);
} else {
if (this.publicAccount.address.networkType === NetworkType.MIJIN) {
throw new Error(Errors[Errors.MIJIN_ENDPOINT_NEEDED]);
}
transactionHttp = new TransactionHttp(HistoricalEndpoints[this.publicAccount.address.networkType]);
}
return transactionHttp.getTransaction(transactionID);
}
public getTransactionById(transactionID: string, urls?: string): Observable {
let transactionHttp: TransactionHttp;
if (urls) {
transactionHttp = new TransactionHttp(urls);
} else {
if (this.publicAccount.address.networkType === NetworkType.MIJIN) {
throw new Error(Errors[Errors.MIJIN_ENDPOINT_NEEDED]);
}
transactionHttp = new TransactionHttp(HistoricalEndpoints[this.publicAccount.address.networkType]);
}
return transactionHttp.getTransaction(transactionID);
}