pub struct Transaction {
    pub signatures: Vec<Signature>,
    pub message: Message,
}
Expand description

An atomic transaction

Fields

signatures: Vec<Signature>

A set of digital signatures of a serialized Message, signed by the first signatures.len() keys of account_keys.

message: Message

The message to sign.

Implementations

Create a signed transaction with the given payer.

Panics

Panics when signing fails.

Create a signed transaction.

Panics

Panics when signing fails.

Create a signed transaction

  • from_keypairs - The keys used to sign the transaction.
  • keys - The keys for the transaction. These are the program state instances or lamport recipient keys.
  • recent_blockhash - The PoH hash.
  • program_ids - The keys that identify programs used in the instruction vector.
  • instructions - Instructions that will be executed atomically.
Panics

Panics when signing fails.

Return a message containing all data that should be signed.

Return the serialized message data to sign.

Check keys and keypair lengths, then sign this transaction.

Panics

Panics when signing fails, use Transaction::try_sign to handle the error.

Sign using some subset of required keys if recent_blockhash is not the same as currently in the transaction, clear any prior signatures and update recent_blockhash

Panics

Panics when signing fails, use Transaction::try_partial_sign to handle the error.

Sign the transaction and place the signatures in their associated positions in signatures without checking that the positions are correct.

Panics

Panics when signing fails, use Transaction::try_partial_sign_unchecked to handle the error.

Check keys and keypair lengths, then sign this transaction, returning any signing errors encountered

Sign using some subset of required keys, returning any signing errors encountered. If recent_blockhash is not the same as currently in the transaction, clear any prior signatures and update recent_blockhash

Sign the transaction, returning any signing errors encountered, and place the signatures in their associated positions in signatures without checking that the positions are correct.

Verify the transaction

Verify the length of signatures matches the value in the message header

Verify the transaction and hash its message

Verify the precompiled programs in this transaction

Get the positions of the pubkeys in account_keys associated with signing keypairs

Replace all the signatures and pubkeys

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

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Performs the conversion.

The wasm ABI type that this converts from when coming back out from the ABI boundary. Read more

Recover a Self from Self::Abi. Read more

The wasm ABI type that this converts into when crossing the ABI boundary. Read more

Convert self into Self::Abi so that it can be sent across the wasm ABI boundary. Read more

Tests whether the argument is a “none” instance. If so it will be deserialized as None, and otherwise it will be passed to FromWasmAbi. Read more

Returns an ABI instance indicating “none”, which JS will interpret as the None branch of this option. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The wasm ABI type references to Self are recovered from.

The type that holds the reference to Self for the duration of the invocation of the function that has an &Self parameter. This is required to ensure that the lifetimes don’t persist beyond one function call, and so that they remain anonymous. Read more

Recover a Self::Anchor from Self::Abi. Read more

Same as RefFromWasmAbi::Abi

Same as RefFromWasmAbi::Anchor

Same as RefFromWasmAbi::ref_from_abi

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.

Same as IntoWasmAbi::Abi

Same as IntoWasmAbi::into_abi, except that it may throw and never return in the case of Err. Read more

Should always be Self

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)

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.