pub struct ScriptPubKey {
pub asm: String,
pub descriptor: Option<String>,
pub hex: String,
pub required_signatures: Option<i64>,
pub type_: String,
pub address: Option<String>,
pub addresses: Option<Vec<String>>,
}Expand description
Data returned by Core for a script pubkey.
This is used by methods in the blockchain section and in the raw transaction section (i.e raw
transaction and psbt methods). The shape changed in Core v22 but the new shape is fully
backwards compatible so we only provide it not a v0.17 specific type. The mtype::ScriptPubKey
mirrors this design (but with concrete rust-bitcoin types).
Fields§
§asm: StringScript assembly.
descriptor: Option<String>Inferred descriptor for the output. v23 and later only.
hex: StringScript hex.
required_signatures: Option<i64>Number of required signatures - deprecated in Core v22.
Only returned in versions prior to 22 or for version 22 onwards if
config option -deprecatedrpc=addresses is passed.
type_: StringThe type, eg pubkeyhash.
address: Option<String>Bitcoin address (only if a well-defined address exists).
addresses: Option<Vec<String>>Array of bitcoin addresses - deprecated in Core v22.
Only returned in versions prior to 22 or for version 22 onwards if
config option -deprecatedrpc=addresses is passed.
Implementations§
Source§impl ScriptPubKey
impl ScriptPubKey
Sourcepub fn into_model(self) -> Result<ScriptPubKey, ScriptPubKeyError>
pub fn into_model(self) -> Result<ScriptPubKey, ScriptPubKeyError>
Converts version specific type to a version nonspecific, more strongly typed type.
Trait Implementations§
Source§impl Clone for ScriptPubKey
impl Clone for ScriptPubKey
Source§fn clone(&self) -> ScriptPubKey
fn clone(&self) -> ScriptPubKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more