Struct terra_rust_api::client::GasOptions
source · [−]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
sourceimpl 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
sourceimpl Clone for GasOptions
impl Clone for GasOptions
sourcefn clone(&self) -> GasOptions
fn clone(&self) -> GasOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for GasOptions
impl Send for GasOptions
impl Sync for GasOptions
impl Unpin for GasOptions
impl UnwindSafe for GasOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more