Struct sapio::template::Template[][src]

pub struct Template {
    pub ctv: Hash,
    pub ctv_index: u32,
    pub max: Amount,
    pub min_feerate_sats_vbyte: Option<Amount>,
    pub metadata_map_s2s: TemplateMetadata,
    pub tx: Transaction,
    pub outputs: Vec<Output>,
}
Expand description

Template holds the data needed to construct a Transaction for CTV Purposes, along with relevant metadata

Fields

ctv: Hash

the precomputed template hash for this Template

ctv_index: u32

the index used for the template hash. (TODO: currently always 0, although future version may support other indexes)

max: Amount

the amount being sent to this Template (TODO: currently computed via tx.total_amount())

min_feerate_sats_vbyte: Option<Amount>

the amount being sent to this Template (TODO: currently computed via tx.total_amount())

metadata_map_s2s: TemplateMetadata

any metadata fields attached to this template

tx: Transaction

The actual transaction this template will create

outputs: Vec<Output>

sapio specific information about all the outputs in the tx.

Implementations

Get the cached template hash of this Template

recompute the total amount spent in this template. This is the total amount required to be sent to this template for this transaction to succeed.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

The name of the generated JSON Schema. Read more

Generates a JSON Schema for this type. Read more

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.