Struct solana_sdk::transaction::Transaction[][src]

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 account_keys, program_ids, recent_blockhash, and instructions, signed by the first signatures.len() keys of account_keys NOTE: Serialization-related changes must be paired with the direct read at sigverify.

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 transaction and hash its message

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

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

This method tests for !=.

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.

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)

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.