secret_cosmwasm_std/
lib.rs

1#![cfg_attr(feature = "backtraces", feature(error_generic_member_access))]
2#![cfg_attr(feature = "backtraces", feature(provide_any))]
3
4// Exposed on all platforms
5
6mod addresses;
7mod assertions;
8mod binary;
9mod coin;
10mod conversion;
11mod deps;
12mod errors;
13mod hex_binary;
14mod ibc;
15mod import_helpers;
16#[cfg(feature = "iterator")]
17mod iterator;
18mod math;
19mod panic;
20mod query;
21mod results;
22mod sections;
23mod serde;
24mod storage;
25mod timestamp;
26mod traits;
27mod types;
28
29pub use crate::addresses::{Addr, CanonicalAddr};
30pub use crate::binary::Binary;
31pub use crate::coin::{coin, coins, has_coins, Coin};
32pub use crate::deps::{Deps, DepsMut, OwnedDeps};
33pub use crate::errors::{
34    CheckedFromRatioError, CheckedMultiplyRatioError, ConversionOverflowError, DivideByZeroError,
35    OverflowError, OverflowOperation, RecoverPubkeyError, StdError, StdResult, SystemError,
36    VerificationError,
37};
38pub use crate::hex_binary::HexBinary;
39#[cfg(feature = "stargate")]
40pub use crate::ibc::{
41    Ibc3ChannelOpenResponse, IbcAcknowledgement, IbcBasicResponse, IbcChannel, IbcChannelCloseMsg,
42    IbcChannelConnectMsg, IbcChannelOpenMsg, IbcChannelOpenResponse, IbcEndpoint, IbcMsg, IbcOrder,
43    IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse,
44    IbcTimeout, IbcTimeoutBlock,
45};
46#[cfg(feature = "iterator")]
47pub use crate::iterator::{Order, Record};
48pub use crate::math::{
49    Decimal, Decimal256, Decimal256RangeExceeded, DecimalRangeExceeded, Fraction, Isqrt, Uint128,
50    Uint256, Uint512, Uint64,
51};
52#[cfg(feature = "cosmwasm_1_1")]
53pub use crate::query::SupplyResponse;
54pub use crate::query::{
55    AllBalanceResponse, BalanceResponse, BankQuery, ContractInfoResponse, CustomQuery,
56    QueryRequest, WasmQuery,
57};
58#[cfg(feature = "staking")]
59pub use crate::query::{
60    AllDelegationsResponse, AllValidatorsResponse, BondedDenomResponse, Delegation,
61    DelegationResponse, FullDelegation, StakingQuery, Validator, ValidatorResponse,
62};
63#[cfg(feature = "stargate")]
64pub use crate::query::{ChannelResponse, IbcQuery, ListChannelsResponse, PortIdResponse};
65#[allow(deprecated)]
66pub use crate::results::SubMsgExecutionResponse;
67pub use crate::results::{
68    attr, attr_plaintext, wasm_execute, wasm_instantiate, Attribute, BankMsg, ContractResult,
69    CosmosMsg, CustomMsg, Empty, Event, QueryResponse, Reply, ReplyOn, Response, SubMsg,
70    SubMsgResponse, SubMsgResult, SystemResult, WasmMsg,
71};
72#[cfg(feature = "staking")]
73pub use crate::results::{DistributionMsg, StakingMsg};
74#[cfg(feature = "stargate")]
75pub use crate::results::{GovMsg, VoteOption};
76pub use crate::serde::{from_binary, from_slice, to_binary, to_vec};
77pub use crate::storage::MemoryStorage;
78pub use crate::timestamp::Timestamp;
79pub use crate::traits::{Api, Querier, QuerierResult, QuerierWrapper, Storage};
80pub use crate::types::{BlockInfo, ContractInfo, Env, MessageInfo, TransactionInfo};
81
82// Exposed in wasm build only
83
84#[cfg(target_arch = "wasm32")]
85mod exports;
86#[cfg(target_arch = "wasm32")]
87mod imports;
88#[cfg(target_arch = "wasm32")]
89mod memory; // Used by exports and imports only. This assumes pointers are 32 bit long, which makes it untestable on dev machines.
90
91#[cfg(target_arch = "wasm32")]
92pub use crate::exports::{do_execute, do_instantiate, do_migrate, do_query, do_reply, do_sudo};
93#[cfg(all(feature = "stargate", target_arch = "wasm32"))]
94pub use crate::exports::{
95    do_ibc_channel_close, do_ibc_channel_connect, do_ibc_channel_open, do_ibc_packet_ack,
96    do_ibc_packet_receive, do_ibc_packet_timeout,
97};
98#[cfg(target_arch = "wasm32")]
99pub use crate::imports::{ExternalApi, ExternalQuerier, ExternalStorage};
100
101// Exposed for testing only
102// Both unit tests and integration tests are compiled to native code, so everything in here does not need to compile to Wasm.
103#[cfg(not(target_arch = "wasm32"))]
104pub mod testing;
105
106// Re-exports
107
108pub use cosmwasm_derive::entry_point;