pub struct StacksTransaction {
    pub version: TransactionVersion,
    pub chain_id: u32,
    pub auth: TransactionAuth,
    pub anchor_mode: TransactionAnchorMode,
    pub post_condition_mode: TransactionPostConditionMode,
    pub post_conditions: Vec<TransactionPostCondition>,
    pub payload: TransactionPayload,
}

Fields

version: TransactionVersionchain_id: u32auth: TransactionAuthanchor_mode: TransactionAnchorModepost_condition_mode: TransactionPostConditionModepost_conditions: Vec<TransactionPostCondition>payload: TransactionPayload

Implementations

Create a new, unsigned transaction and an empty STX fee with no post-conditions.

Get fee rate

Set fee rate

Get origin nonce

get sponsor nonce

set origin nonce

set sponsor nonce

Set anchor mode

source

pub fn set_post_condition_mode(
    &mut self,
    postcond_mode: TransactionPostConditionMode
)

Set post-condition mode

source

pub fn add_post_condition(&mut self, post_condition: TransactionPostCondition)

Add a post-condition

a txid of a stacks transaction is its sha512/256 hash

Get a mutable reference to the internal auth structure

Get an immutable reference to the internal auth structure

Append the next signature from the origin account authorization. Return the next sighash.

Append the next public key to the origin account authorization.

Append the next signature from the sponsoring account. Return the next sighash

Append the next public key to the sponsor account authorization.

Verify this transaction’s signatures

Verify the transaction’s origin signatures only. Used by sponsors to get the next sig-hash to sign.

Get the origin account’s address

Get the sponsor account’s address, if this transaction is sponsored

Get a copy of the origin spending condition

Get a copy of the sending condition that will pay the tx fee

Is this a mainnet transaction? false means ‘testnet’

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
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more
serialize implementors should never error unless there is an underlying failure in writing to the fd Read more
Convenience for serialization to a vec. this function unwraps any underlying serialization error 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

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more