Module prelude

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

anyhow
Construct an ad-hoc error from a string or existing non-anyhow error value.
bail
Return early with an error.

Structs§

Addr
A human readable address.
Decimal256
A fixed-point decimal value with 18 fractional digits, i.e. Decimal256(1_000_000_000_000_000_000) == 1.0
Event
A full Cosmos SDK event.
Item
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.
Map
RawAddr
A raw address passed in via JSON.
ResponseBuilder
Helper data type, following builder pattern, for constructing a [Response].
Uint64
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§

AuthCheck
Check that an addr satisfies auth checks
Bound
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.
CongestionReason
What was the user doing when they hit the congestion error message?
MarketError
An error type for known market errors with potentially special error handling.
Order
TriggerPriceMustBe
Was the price provided by the trader too high or too low?
TriggerType
What type of price trigger occurred?

Traits§

Api
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.
Context
Provides the context method for Result.
Display
Format trait for an empty format, {}.
FromStr
Parse a value from a string
Storage
Storage provides read and write access to a persistent storage. If you only want to provide read access, provide &Storage

Functions§

assert_auth
Ensure that the given address passes the specified AuthCheck.
get_contract_version
get_contract_version can be use in migrate to read the previous version of this contract

Type Aliases§

Result
Result<T, Error>

Attribute Macros§

cw_serde