@@ -59,6 +59,14 @@ export class Transaction {
|
||||
return Transaction.fromBytes(bytes);
|
||||
}
|
||||
|
||||
public static fromAny(bytesOrHex: Uint8Array | string) {
|
||||
if (typeof bytesOrHex === 'string') {
|
||||
return Transaction.fromHex(bytesOrHex);
|
||||
}
|
||||
|
||||
return Transaction.fromBytes(bytesOrHex);
|
||||
}
|
||||
|
||||
public toBytes(): Uint8Array {
|
||||
const bytes = encodeTransaction(this.transaction);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user