Struct celestia_types::TxConfig

source ·
pub struct TxConfig {
    pub signer_address: Option<AccAddress>,
    pub key_name: Option<String>,
    pub gas_price: Option<f64>,
    pub gas: Option<u64>,
    pub fee_granter_address: Option<AccAddress>,
}
Expand description

TxConfig specifies additional options that are be applied to the Tx.

If no options are provided, then the default ones will be used. Read more about the mechanisms of fees and gas usage in submitting data blobs.

Fields§

§signer_address: Option<AccAddress>

Specifies the address from the keystore that will sign transactions.

§NOTE

Only signer_address or key_name should be passed. signer_address is a primary cfg. This means If both the address and the key are specified, the address field will take priority.

§key_name: Option<String>

Specifies the key from the keystore associated with an account that will be used to sign transactions.

§NOTE

This account must be available in the Keystore.

§gas_price: Option<f64>

Represents the amount to be paid per gas unit.

Negative or missing gas_price means user want us to use the minGasPrice defined in the node.

§gas: Option<u64>

Calculated amount of gas to be used by transaction.

0 or missing gas means that the node should calculate it itself.

§fee_granter_address: Option<AccAddress>

Specifies the account that will pay for the transaction.

Implementations§

source§

impl TxConfig

source

pub fn with_gas_price(&mut self, gas_price: f64) -> &mut Self

Sets the gas_price of the transaction.

source

pub fn with_gas(&mut self, gas: u64) -> &mut Self

Sets the gas of the transaction.

source

pub fn with_fee_granter_address( &mut self, fee_granter_address: AccAddress, ) -> &mut Self

Sets the fee_granter_address of the transaction.

source

pub fn with_signer_address(&mut self, signer_address: AccAddress) -> &mut Self

Sets the signer_address of the transaction.

source

pub fn with_key_name(&mut self, key_name: impl Into<String>) -> &mut Self

Sets the key_name of the transaction.

Trait Implementations§

source§

impl Debug for TxConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for TxConfig

source§

fn default() -> TxConfig

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

impl Serialize for TxConfig

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<S> CondSend for S
where S: Send,

source§

impl<S> CondSync for S
where S: Send + Sync,