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
impl TxConfig
sourcepub fn with_gas_price(&mut self, gas_price: f64) -> &mut Self
pub fn with_gas_price(&mut self, gas_price: f64) -> &mut Self
Sets the gas_price of the transaction.
sourcepub fn with_fee_granter_address(
&mut self,
fee_granter_address: AccAddress,
) -> &mut Self
pub fn with_fee_granter_address( &mut self, fee_granter_address: AccAddress, ) -> &mut Self
Sets the fee_granter_address of the transaction.
sourcepub fn with_signer_address(&mut self, signer_address: AccAddress) -> &mut Self
pub fn with_signer_address(&mut self, signer_address: AccAddress) -> &mut Self
Sets the signer_address of the transaction.
sourcepub fn with_key_name(&mut self, key_name: impl Into<String>) -> &mut Self
pub fn with_key_name(&mut self, key_name: impl Into<String>) -> &mut Self
Sets the key_name of the transaction.