pub fn extract_script_pub_key_address(
script_public_key: &ScriptPublicKey,
prefix: Prefix,
) -> Result<Address, TxScriptError>Expand description
Returns the address encoded in a script public key.
Notes:
-
This function only works for ‘standard’ transaction script types. Any data such as public keys which are invalid will return the
TxScriptError::PubKeyFormaterror. -
In case a ScriptClass is needed by the caller, call
ScriptClass::from(address.version)or useaddress.versiondirectly instead, where address is the successfully returned address.