pub struct GasOptions {
pub fees: Option<Coin>,
pub estimate_gas: bool,
pub gas: Option<u64>,
pub gas_price: Option<Coin>,
pub gas_adjustment: Option<f64>,
}
Expand description
When Submitting transactions you need to either submit gas or a fee to the validator This structure is used to determine what your preferences are by default Higher fees may be given preference by the validator to include the transaction in their block
Fields§
§fees: Option<Coin>
If specified the TX will use the fee specified
estimate_gas: bool
if true, the server will call the ‘estimate_transaction’ to get an estimate. This estimate is then multiplied by the gas_adjustment field
gas: Option<u64>
your estimate of the gas to use.
gas_price: Option<Coin>
used to calculate the fee .. gas * gas_price
gas_adjustment: Option<f64>
used to adjust the estimate
Implementations§
Source§impl GasOptions
impl GasOptions
Sourcepub fn create_with_fees(
fees: &str,
gas: u64,
) -> Result<GasOptions, TerraRustAPIError>
pub fn create_with_fees( fees: &str, gas: u64, ) -> Result<GasOptions, TerraRustAPIError>
for hard-coding of fees
Sourcepub fn create_with_gas_estimate(
gas_price: &str,
gas_adjustment: f64,
) -> Result<GasOptions, TerraRustAPIError>
pub fn create_with_gas_estimate( gas_price: &str, gas_adjustment: f64, ) -> Result<GasOptions, TerraRustAPIError>
for when you want the validator to give you an estimate on the amounts
pub async fn create_with_fcd( client: &Client, fcd_url: &str, gas_denom: &str, gas_adjustment: f64, ) -> Result<GasOptions, TerraRustAPIError>
Trait Implementations§
Source§impl Clone for GasOptions
impl Clone for GasOptions
Source§fn clone(&self) -> GasOptions
fn clone(&self) -> GasOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for GasOptions
impl RefUnwindSafe for GasOptions
impl Send for GasOptions
impl Sync for GasOptions
impl Unpin for GasOptions
impl UnwindSafe for GasOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more