VaultStandardQueryMsg

Enum VaultStandardQueryMsg 

Source
pub enum VaultStandardQueryMsg<T = ExtensionQueryMsg>
where T: JsonSchema,
{ VaultStandardInfo {}, Info {}, PreviewDeposit { amount: Uint128, }, PreviewRedeem { amount: Uint128, }, TotalAssets {}, TotalVaultTokenSupply {}, VaultTokenExchangeRate { quote_denom: String, }, ConvertToShares { amount: Uint128, }, ConvertToAssets { amount: Uint128, }, VaultExtension(T), }
Expand description

The default QueryMsg variants that all vaults must implement. This enum can be extended with additional variants by defining an extension enum and then passing it as the generic argument T to this enum.

Variants§

§

VaultStandardInfo

Returns VaultStandardInfoResponse with information on the version of the vault standard used as well as any enabled extensions.

§

Info

Returns VaultInfoResponse representing vault requirements, lockup, & vault token denom.

§

PreviewDeposit

👎Deprecated since 0.4.1: PreviewDeposit and PreviewRedeem turned out to be too difficult to implement in most cases. We recommend to use transaction simulation from non-contract clients such as frontends.

Returns Uint128 amount of vault tokens that will be returned for the passed in amount of base tokens.

Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions.

Must return as close to and no more than the exact amount of vault tokens that would be minted in a deposit call in the same transaction. I.e. Deposit should return the same or more vault tokens as PreviewDeposit if called in the same transaction.

Fields

§amount: Uint128
👎Deprecated since 0.4.1: PreviewDeposit and PreviewRedeem turned out to be too difficult to implement in most cases. We recommend to use transaction simulation from non-contract clients such as frontends.

The amount of base tokens to preview depositing.

§

PreviewRedeem

👎Deprecated since 0.4.1: PreviewDeposit and PreviewRedeem turned out to be too difficult to implement in most cases. We recommend to use transaction simulation from non-contract clients such as frontends.

Returns Uint128 amount of base tokens that would be withdrawn in exchange for redeeming amount of vault tokens.

Allows an on-chain or off-chain user to simulate the effects of their redeem at the current block, given current on-chain conditions.

Must return as close to and no more than the exact amount of base tokens that would be withdrawn in a redeem call in the same transaction.

Fields

§amount: Uint128
👎Deprecated since 0.4.1: PreviewDeposit and PreviewRedeem turned out to be too difficult to implement in most cases. We recommend to use transaction simulation from non-contract clients such as frontends.

The amount of vault tokens to preview redeeming.

§

TotalAssets

Returns the amount of assets managed by the vault denominated in base tokens. Useful for display purposes, and does not have to confer the exact amount of base tokens.

§

TotalVaultTokenSupply

Returns Uint128 total amount of vault tokens in circulation.

§

VaultTokenExchangeRate

Returns the exchange rate of vault tokens quoted in terms of the supplied quote_denom. Returns a Decimal containing the amount of quote_denom assets that can be exchanged for 1 unit of vault tokens.

May return an error if the quote denom is not supported by the vault.

Fields

§quote_denom: String

The quote denom to quote the exchange rate in.

§

ConvertToShares

The amount of vault tokens that the vault would exchange for the amount of assets provided, in an ideal scenario where all the conditions are met.

Useful for display purposes and does not have to confer the exact amount of vault tokens returned by the vault if the passed in assets were deposited. This calculation should not reflect the “per-user” price-per-share, and instead should reflect the “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and from.

Fields

§amount: Uint128

The amount of base tokens to convert to vault tokens.

§

ConvertToAssets

Returns the amount of base tokens that the Vault would exchange for the amount of vault tokens provided, in an ideal scenario where all the conditions are met.

Useful for display purposes and does not have to confer the exact amount of assets returned by the vault if the passed in vault tokens were redeemed. This calculation should not reflect the “per-user” price-per-share, and instead should reflect the “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and from.

Fields

§amount: Uint128

The amount of vault tokens to convert to base tokens.

§

VaultExtension(T)

Handle queries of any enabled extensions.

Trait Implementations§

Source§

impl<T> Clone for VaultStandardQueryMsg<T>
where T: JsonSchema + Clone,

Source§

fn clone(&self) -> VaultStandardQueryMsg<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for VaultStandardQueryMsg<T>
where T: JsonSchema + Debug,

Source§

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

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

impl<'de, T> Deserialize<'de> for VaultStandardQueryMsg<T>
where T: JsonSchema + Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T> JsonSchema for VaultStandardQueryMsg<T>

Source§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
Source§

impl<T> PartialEq for VaultStandardQueryMsg<T>
where T: JsonSchema + PartialEq,

Source§

fn eq(&self, other: &VaultStandardQueryMsg<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> QueryResponses for VaultStandardQueryMsg<T>

Available on non-WebAssembly only.
Source§

impl<T> Serialize for VaultStandardQueryMsg<T>
where T: JsonSchema + Serialize,

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
Source§

impl<T> StructuralPartialEq for VaultStandardQueryMsg<T>
where T: JsonSchema,

Auto Trait Implementations§

§

impl<T> Freeze for VaultStandardQueryMsg<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for VaultStandardQueryMsg<T>
where T: RefUnwindSafe,

§

impl<T> Send for VaultStandardQueryMsg<T>
where T: Send,

§

impl<T> Sync for VaultStandardQueryMsg<T>
where T: Sync,

§

impl<T> Unpin for VaultStandardQueryMsg<T>
where T: Unpin,

§

impl<T> UnwindSafe for VaultStandardQueryMsg<T>
where T: UnwindSafe,

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<U> As for U

Source§

fn as_<T>(self) -> T
where T: CastFrom<U>,

Casts self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,