Skip to content

Latest commit

 

History

History
155 lines (71 loc) · 4.53 KB

script_buf.md

File metadata and controls

155 lines (71 loc) · 4.53 KB

Module 0x4::script_buf

Struct ScriptBuf

#[data_struct]
struct ScriptBuf has copy, drop, store

Function new

public fun new(bytes: vector<u8>): script_buf::ScriptBuf

Function bytes

public fun bytes(self: &script_buf::ScriptBuf): &vector<u8>

Function is_p2sh

Checks if the given script is a P2SH script.

public fun is_p2sh(self: &script_buf::ScriptBuf): bool

Function p2sh_script_hash

Get the script hash from a P2SH script. This function does not check if the script is a P2SH script, the caller must do that.

Function is_p2pkh

Checks if the given script is a P2PKH script.

public fun is_p2pkh(self: &script_buf::ScriptBuf): bool

Function p2pkh_pubkey_hash

Get the public key hash from a P2PKH script. This function does not check if the script is a P2PKH script, the caller must do that.

Function is_witness_program

public fun is_witness_program(self: &script_buf::ScriptBuf): bool

Function witness_program

Get the witness program from a witness program script.

Function get_address

try to get a BitcoinAddress from a ScriptBuf.

Function is_op_return

Checks if the given script is an OP_RETURN script.

public fun is_op_return(self: &script_buf::ScriptBuf): bool