I made a small wrapper class to use it with just the hash :)
/**
* Wrapper around a transaction hash to enable fetching of the transaction via a TransactionWatcher.
*
* @export
* @class FetchableTransaction
*/
export class FetchableTransaction {
/**
* Hex representation of the transaction hash.
*
* @type {string}
* @memberof FetchableTransaction
*/
public hex: string;
/**
* Creates an instance of FetchableTransaction from a hex hash.
* @param {string} hex
* @memberof FetchableTransaction
*/
constructor(hex: string) {
this.hex = hex;
}
/**
* Return a hash object that can output the hash as hex.
*
* @return {{ hex(): string }}
* @memberof FetchableTransaction
*/
public getHash(): { hex(): string } {
return { hex: () => this.hex };
}
}
I made a small wrapper class to use it with just the hash :) /** * Wrapper around a transaction hash to enable fetching of the transaction via a TransactionWatcher. * * @export * @class FetchableTransaction */ export class FetchableTransaction { /** * Hex representation of the transaction hash. * * @type {string} * @memberof FetchableTransaction */ public hex: string; /** * Creates an instance of FetchableTransaction from a hex hash. * @param {string} hex * @memberof FetchableTransaction */ constructor(hex: string) { this.hex = hex; } /** * Return a hash object that can output the hash as hex. * * @return {{ hex(): string }} * @memberof FetchableTransaction */ public getHash(): { hex(): string } { return { hex: () => this.hex }; } }