Module levana_perpswap_cosmos::prelude
source · Expand description
Exports very commonly used items into the prelude glob
Re-exports§
pub use crate::contracts::factory::entry::ExecuteMsg as FactoryExecuteMsg;
pub use crate::contracts::factory::entry::QueryMsg as FactoryQueryMsg;
pub use crate::contracts::market::entry::ExecuteMsg as MarketExecuteMsg;
pub use crate::contracts::market::entry::QueryMsg as MarketQueryMsg;
pub use crate::direction::DirectionToBase;
pub use crate::direction::DirectionToNotional;
pub use crate::event::CosmwasmEventExt;
pub use crate::market_type::MarketId;
pub use crate::market_type::MarketType;
pub use crate::max_gains::MaxGainsInQuote;
pub use crate::namespace;
pub use crate::number::Signed;
pub use crate::time::Duration;
pub use crate::time::Timestamp;
pub use crate::storage::external_map_has;
pub use crate::storage::load_external_item;
pub use crate::storage::load_external_map;
pub use super::number::*;
pub use super::result::*;
pub use crate::cosmwasm::*;
pub use crate::error::*;
pub use crate::leverage::*;
pub use crate::price::*;
Macros§
- Construct an ad-hoc error from a string or existing non-
anyhow
error value. - Return early with an error.
Structs§
- A human readable address.
- A fixed-point decimal value with 18 fractional digits, i.e. Decimal256(1_000_000_000_000_000_000) == 1.0
- A full Cosmos SDK event.
- Item stores one typed item at the given key. This is an analog of Singleton. It functions the same way as Path does but doesn’t use a Vec and thus has a const fn constructor.
- A raw address passed in via JSON.
- Helper data type, following builder pattern, for constructing a [Response].
- A thin wrapper around u64 that is using strings for JSON encoding/decoding, such that the full u64 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
Enums§
- Check that an addr satisfies auth checks
Bound
is used to define the two ends of a range.None
means that we don’t limit that side of the range at all.Inclusive
means we use the given value as a limit and include anything at that exact key.Exclusive
means we use the given value as a limit and exclude anything at that exact key.- What was the user doing when they hit the congestion error message?
- An error type for known market errors with potentially special error handling.
- Was the price provided by the trader too high or too low?
- What type of price trigger occurred?
Traits§
- Api are callbacks to system functions implemented outside of the wasm modules. Currently it just supports address conversion but we could add eg. crypto functions here.
- Provides the
context
method forResult
. - Format trait for an empty format,
{}
. - Parse a value from a string
- Storage provides read and write access to a persistent storage. If you only want to provide read access, provide
&Storage
Functions§
- Ensure that the given address passes the specified AuthCheck.
- get_contract_version can be use in migrate to read the previous version of this contract
Type Aliases§
Result<T, Error>