pub struct Transaction {
    pub signatures: Vec<Signature>,
    pub account_keys: Vec<Pubkey>,
    pub last_id: Hash,
    pub fee: u64,
    pub program_ids: Vec<Pubkey>,
    pub instructions: Vec<Instruction>,
}
Expand description

An atomic transaction

Fields

signatures: Vec<Signature>

A set of digital signature of account_keys, program_ids, last_id, fee and instructions, signed by the first signatures.len() keys of account_keys

account_keys: Vec<Pubkey>

The Pubkeys that are executing this transaction userdata. The meaning of each key is program-specific.

  • account_keys[0] - Typically this is the caller public key. signature is verified with account_keys[0]. In the future which key pays the fee and which keys have signatures would be configurable.
  • account_keys[1] - Typically this is the program context or the recipient of the tokens
last_id: Hash

The ID of a recent ledger entry.

fee: u64

The number of tokens paid for processing and storage of this transaction.

program_ids: Vec<Pubkey>

Keys identifying programs in the instructions vector.

instructions: Vec<Instruction>

Programs that will be executed in sequence and commited in one atomic transaction if all succeed.

Implementations

Create a signed transaction

  • from_keypair - The key used to sign the transaction. This key is stored as keys[0]
  • account_keys - The keys for the transaction. These are the program state instances or token recipient keys.
  • last_id - The PoH hash.
  • fee - The transaction fee.
  • program_ids - The keys that identify programs used in the instruction vector.
  • instructions - The programs and their arguments that the transaction will execute atomically

Get the transaction data to sign.

Sign this transaction.

Verify only the transaction signature.

Verify that references in the instructions are valid

Trait Implementations

Create and sign a new Transaction. Used for unit-testing.

Create and sign a new Transaction. Used for unit-testing.

Create and sign a new Witness Timestamp. Used for unit-testing.

Create and sign a new Witness Signature. Used for unit-testing.

Create and sign a postdated Transaction. Used for unit-testing.

Create and sign a multisig Transaction.

Verify only the payment plan.

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

Create and sign new SystemInstruction::CreateAccount transaction

Create and sign new SystemInstruction::Assign transaction

Create and sign new SystemInstruction::CreateAccount transaction with some defaults

Create and sign new SystemInstruction::Move transaction

Create and sign new SystemInstruction::Move transaction to many destinations

Create and sign new SystemInstruction::Spawn transaction

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.

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.