Skip to main content

FoundryTransactionBuilder

Trait FoundryTransactionBuilder 

Source
pub trait FoundryTransactionBuilder<N: Network>: TransactionBuilder<N> {
Show 38 methods // Required method fn reset_gas_limit(&mut self); // Provided methods fn max_fee_per_blob_gas(&self) -> Option<u128> { ... } fn set_max_fee_per_blob_gas(&mut self, _max_fee_per_blob_gas: u128) { ... } fn with_max_fee_per_blob_gas(self, max_fee_per_blob_gas: u128) -> Self { ... } fn blob_versioned_hashes(&self) -> Option<&[B256]> { ... } fn set_blob_versioned_hashes(&mut self, _hashes: Vec<B256>) { ... } fn with_blob_versioned_hashes(self, hashes: Vec<B256>) -> Self { ... } fn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant> { ... } fn set_blob_sidecar(&mut self, _sidecar: BlobTransactionSidecarVariant) { ... } fn with_blob_sidecar(self, sidecar: BlobTransactionSidecarVariant) -> Self { ... } fn blob_sidecar_4844(&self) -> Option<&BlobTransactionSidecar> { ... } fn set_blob_sidecar_4844(&mut self, sidecar: BlobTransactionSidecar) { ... } fn with_blob_sidecar_4844(self, sidecar: BlobTransactionSidecar) -> Self { ... } fn blob_sidecar_7594(&self) -> Option<&BlobTransactionSidecarEip7594> { ... } fn set_blob_sidecar_7594(&mut self, sidecar: BlobTransactionSidecarEip7594) { ... } fn with_blob_sidecar_7594( self, sidecar: BlobTransactionSidecarEip7594, ) -> Self { ... } fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>> { ... } fn set_authorization_list( &mut self, _authorization_list: Vec<SignedAuthorization>, ) { ... } fn with_authorization_list( self, authorization_list: Vec<SignedAuthorization>, ) -> Self { ... } fn fee_token(&self) -> Option<Address> { ... } fn set_fee_token(&mut self, _fee_token: Address) { ... } fn with_fee_token(self, fee_token: Address) -> Self { ... } fn nonce_key(&self) -> Option<U256> { ... } fn set_nonce_key(&mut self, _nonce_key: U256) { ... } fn with_nonce_key(self, nonce_key: U256) -> Self { ... } fn key_id(&self) -> Option<Address> { ... } fn set_key_id(&mut self, _key_id: Address) { ... } fn with_key_id(self, key_id: Address) -> Self { ... } fn valid_before(&self) -> Option<u64> { ... } fn set_valid_before(&mut self, _valid_before: u64) { ... } fn with_valid_before(self, valid_before: u64) -> Self { ... } fn valid_after(&self) -> Option<u64> { ... } fn set_valid_after(&mut self, _valid_after: u64) { ... } fn with_valid_after(self, valid_after: u64) -> Self { ... } fn fee_payer_signature(&self) -> Option<Signature> { ... } fn set_fee_payer_signature(&mut self, _signature: Signature) { ... } fn with_fee_payer_signature(self, signature: Signature) -> Self { ... } fn compute_sponsor_hash(&self, _from: Address) -> Option<B256> { ... }
}
Expand description

Composite transaction builder trait for Foundry transactions.

This extends the base TransactionBuilder trait with the same methods as [alloy_network::TransactionBuilder4844] for handling blob transaction sidecars, and [alloy_network::TransactionBuilder7702] for handling EIP-7702 authorization lists.

By default, all methods have no-op implementations, so this can be implemented for any Network.

If the Network supports Eip4844 blob transactions implement these methods:

If the Network supports EIP-7702 authorization lists, implement these methods:

If the Network supports Tempo transactions, implement these methods:

Required Methods§

Source

fn reset_gas_limit(&mut self)

Reset gas limit

Provided Methods§

Source

fn max_fee_per_blob_gas(&self) -> Option<u128>

Get the max fee per blob gas for the transaction.

Source

fn set_max_fee_per_blob_gas(&mut self, _max_fee_per_blob_gas: u128)

Set the max fee per blob gas for the transaction.

Source

fn with_max_fee_per_blob_gas(self, max_fee_per_blob_gas: u128) -> Self

Builder-pattern method for setting max fee per blob gas.

Source

fn blob_versioned_hashes(&self) -> Option<&[B256]>

Gets the EIP-4844 blob versioned hashes of the transaction.

These may be set independently of the sidecar, e.g. when the sidecar has been pruned but the hashes are still needed for eth_call.

Source

fn set_blob_versioned_hashes(&mut self, _hashes: Vec<B256>)

Sets the EIP-4844 blob versioned hashes of the transaction.

Source

fn with_blob_versioned_hashes(self, hashes: Vec<B256>) -> Self

Builder-pattern method for setting the EIP-4844 blob versioned hashes.

Source

fn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant>

Gets the blob sidecar (either EIP-4844 or EIP-7594 variant) of the transaction.

Source

fn set_blob_sidecar(&mut self, _sidecar: BlobTransactionSidecarVariant)

Sets the blob sidecar (either EIP-4844 or EIP-7594 variant) of the transaction.

Note: This will also set the versioned blob hashes accordingly: [BlobTransactionSidecarVariant::versioned_hashes]

Source

fn with_blob_sidecar(self, sidecar: BlobTransactionSidecarVariant) -> Self

Builder-pattern method for setting the blob sidecar of the transaction.

Source

fn blob_sidecar_4844(&self) -> Option<&BlobTransactionSidecar>

Gets the EIP-4844 blob sidecar if the current sidecar is of that variant.

Source

fn set_blob_sidecar_4844(&mut self, sidecar: BlobTransactionSidecar)

Sets the EIP-4844 blob sidecar of the transaction.

Source

fn with_blob_sidecar_4844(self, sidecar: BlobTransactionSidecar) -> Self

Builder-pattern method for setting the EIP-4844 blob sidecar of the transaction.

Source

fn blob_sidecar_7594(&self) -> Option<&BlobTransactionSidecarEip7594>

Gets the EIP-7594 blob sidecar if the current sidecar is of that variant.

Source

fn set_blob_sidecar_7594(&mut self, sidecar: BlobTransactionSidecarEip7594)

Sets the EIP-7594 blob sidecar of the transaction.

Source

fn with_blob_sidecar_7594(self, sidecar: BlobTransactionSidecarEip7594) -> Self

Builder-pattern method for setting the EIP-7594 blob sidecar of the transaction.

Source

fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>>

Get the EIP-7702 authorization list for the transaction.

Source

fn set_authorization_list( &mut self, _authorization_list: Vec<SignedAuthorization>, )

Sets the EIP-7702 authorization list.

Source

fn with_authorization_list( self, authorization_list: Vec<SignedAuthorization>, ) -> Self

Builder-pattern method for setting the authorization list.

Source

fn fee_token(&self) -> Option<Address>

Get the fee token for a Tempo transaction.

Source

fn set_fee_token(&mut self, _fee_token: Address)

Set the fee token for a Tempo transaction.

Source

fn with_fee_token(self, fee_token: Address) -> Self

Builder-pattern method for setting the Tempo fee token.

Source

fn nonce_key(&self) -> Option<U256>

Get the 2D nonce key for a Tempo transaction.

Source

fn set_nonce_key(&mut self, _nonce_key: U256)

Set the 2D nonce key for the Tempo transaction.

Source

fn with_nonce_key(self, nonce_key: U256) -> Self

Builder-pattern method for setting a 2D nonce key for a Tempo transaction.

Source

fn key_id(&self) -> Option<Address>

Get the access key ID for a Tempo transaction.

Source

fn set_key_id(&mut self, _key_id: Address)

Set the access key ID for a Tempo transaction.

Used during gas estimation to override the key_id that would normally be recovered from the signature.

Source

fn with_key_id(self, key_id: Address) -> Self

Builder-pattern method for setting the Tempo access key ID.

Source

fn valid_before(&self) -> Option<u64>

Get the valid_before timestamp for a Tempo expiring nonce transaction.

Source

fn set_valid_before(&mut self, _valid_before: u64)

Set the valid_before timestamp for a Tempo expiring nonce transaction.

Source

fn with_valid_before(self, valid_before: u64) -> Self

Builder-pattern method for setting the valid_before timestamp.

Source

fn valid_after(&self) -> Option<u64>

Get the valid_after timestamp for a Tempo expiring nonce transaction.

Source

fn set_valid_after(&mut self, _valid_after: u64)

Set the valid_after timestamp for a Tempo expiring nonce transaction.

Source

fn with_valid_after(self, valid_after: u64) -> Self

Builder-pattern method for setting the valid_after timestamp.

Source

fn fee_payer_signature(&self) -> Option<Signature>

Get the fee payer (sponsor) signature for a Tempo sponsored transaction.

Source

fn set_fee_payer_signature(&mut self, _signature: Signature)

Set the fee payer (sponsor) signature for a Tempo sponsored transaction.

Source

fn with_fee_payer_signature(self, signature: Signature) -> Self

Builder-pattern method for setting the fee payer signature.

Source

fn compute_sponsor_hash(&self, _from: Address) -> Option<B256>

Computes the sponsor (fee payer) signature hash for this transaction.

This builds an unsigned consensus-level transaction from the request and computes the hash that a sponsor needs to sign. Returns None for networks that don’t support sponsored transactions.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FoundryTransactionBuilder<AnyNetwork> for <AnyNetwork as Network>::TransactionRequest

Source§

fn reset_gas_limit(&mut self)

Source§

fn max_fee_per_blob_gas(&self) -> Option<u128>

Source§

fn set_max_fee_per_blob_gas(&mut self, max_fee_per_blob_gas: u128)

Source§

fn blob_versioned_hashes(&self) -> Option<&[B256]>

Source§

fn set_blob_versioned_hashes(&mut self, hashes: Vec<B256>)

Source§

fn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant>

Source§

fn set_blob_sidecar(&mut self, sidecar: BlobTransactionSidecarVariant)

Source§

fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>>

Source§

fn set_authorization_list( &mut self, authorization_list: Vec<SignedAuthorization>, )

Source§

impl FoundryTransactionBuilder<Ethereum> for <Ethereum as Network>::TransactionRequest

Source§

fn reset_gas_limit(&mut self)

Source§

fn max_fee_per_blob_gas(&self) -> Option<u128>

Source§

fn set_max_fee_per_blob_gas(&mut self, max_fee_per_blob_gas: u128)

Source§

fn blob_versioned_hashes(&self) -> Option<&[B256]>

Source§

fn set_blob_versioned_hashes(&mut self, hashes: Vec<B256>)

Source§

fn blob_sidecar(&self) -> Option<&BlobTransactionSidecarVariant>

Source§

fn set_blob_sidecar(&mut self, sidecar: BlobTransactionSidecarVariant)

Source§

fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>>

Source§

fn set_authorization_list( &mut self, authorization_list: Vec<SignedAuthorization>, )

Source§

impl FoundryTransactionBuilder<TempoNetwork> for <TempoNetwork as Network>::TransactionRequest

Source§

fn reset_gas_limit(&mut self)

Source§

fn authorization_list(&self) -> Option<&Vec<SignedAuthorization>>

Source§

fn set_authorization_list( &mut self, authorization_list: Vec<SignedAuthorization>, )

Source§

fn fee_token(&self) -> Option<Address>

Source§

fn set_fee_token(&mut self, fee_token: Address)

Source§

fn nonce_key(&self) -> Option<U256>

Source§

fn set_nonce_key(&mut self, nonce_key: U256)

Source§

fn key_id(&self) -> Option<Address>

Source§

fn set_key_id(&mut self, key_id: Address)

Source§

fn valid_before(&self) -> Option<u64>

Source§

fn set_valid_before(&mut self, valid_before: u64)

Source§

fn valid_after(&self) -> Option<u64>

Source§

fn set_valid_after(&mut self, valid_after: u64)

Source§

fn fee_payer_signature(&self) -> Option<Signature>

Source§

fn set_fee_payer_signature(&mut self, signature: Signature)

Source§

fn compute_sponsor_hash(&self, from: Address) -> Option<B256>

Implementors§