Blockchain Traits

This commit is contained in:
Jim Hamill
2025-04-20 02:22:30 +00:00
parent b097abbd1c
commit 22bff76a55
13 changed files with 302 additions and 189 deletions
+15
View File
@@ -226,6 +226,21 @@ export class Address {
return this.fromRedeemScript(Bytes.fromHex(hex).toBytes(), type);
}
/**
* Attempt to instantiate Address from Locking Bytecode.
*
* @param lockscript The lockscript as bytes or hex.
*
* @throws {Error} If lock script cannot be decoded into an address.
*
* @returns Instance of Address.
*/
public static fromLockscript(lockscript: string | Uint8Array) {
return lockscript instanceof Uint8Array
? this.fromLockscriptBytes(lockscript)
: this.fromLockscriptHex(lockscript);
}
/**
* Attempt to instantiate Address from Locking Bytecode.
*