Signed-off-by: James Zuccon <zuccon@gmail.com>
This commit is contained in:
James Zuccon
2024-09-06 10:59:30 +10:00
parent b9a53659ce
commit f189c4643b
12 changed files with 311 additions and 13 deletions
+14
View File
@@ -1,3 +1,5 @@
import { TransactionHash } from './transaction-hash.js';
import {
binToHex,
hexToBin,
@@ -69,6 +71,18 @@ export class Transaction {
return binToHex(bytes);
}
public toHash(): TransactionHash {
return TransactionHash.fromTransactionBytes(this.toBytes());
}
public toHashHex(): string {
return this.toHash().toHex();
}
public toHashBytes(): Uint8Array {
return this.toHash().toBytes();
}
public getVersion() {
return this.transaction.version;
}