Resolve "feat(Primitives): Have Bytes Primitive extends Uint8Array (if possible)"
This commit is contained in:
@@ -209,7 +209,7 @@ export class Address {
|
||||
type: 'P2SH20' | 'P2SH32' = 'P2SH32',
|
||||
): Address {
|
||||
// Return a new instance of address.
|
||||
return this.fromRedeemScript(Bytes.fromHex(hex).toBytes(), type);
|
||||
return this.fromRedeemScript(Bytes.fromHex(hex).toUint8Array(), type);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -257,7 +257,7 @@ export class Address {
|
||||
* @returns {Address} Instance of Address.
|
||||
*/
|
||||
public static fromLockscriptHex(hex: string): Address {
|
||||
return this.fromLockscriptBytes(Bytes.fromHex(hex).toBytes());
|
||||
return this.fromLockscriptBytes(Bytes.fromHex(hex).toUint8Array());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -298,7 +298,10 @@ export class Address {
|
||||
hash160Hex: string,
|
||||
type: AddressType = 'P2PKH',
|
||||
): Address {
|
||||
return this.fromHash160Bytes(Bytes.fromHex(hash160Hex).toBytes(), type);
|
||||
return this.fromHash160Bytes(
|
||||
Bytes.fromHex(hash160Hex).toUint8Array(),
|
||||
type,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user