Crate secret_cosmwasm_std

Source

Modules§

testing

Macros§

assert_approx_eq
Asserts that two expressions are approximately equal to each other.
ensure
Quick check for a guard. If the condition (first argument) is false, then return the second argument x wrapped in Err(x).
ensure_eq
Quick check for a guard. Like assert_eq!, but rather than panic, it returns the third argument x wrapped in Err(x).
ensure_ne
Quick check for a guard. Like assert_ne!, but rather than panic, it returns the third argument x wrapped in Err(x).

Structs§

Addr
A human readable address.
AllBalanceResponse
AllDelegationsResponse
DelegationsResponse is data format returned from StakingRequest::AllDelegations query
AllValidatorsResponse
The data format returned from StakingRequest::AllValidators query
Attribute
An key value pair that is used in the context of event attributes in logs
BalanceResponse
Binary
Binary is a wrapper around Vec to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.
BlockInfo
BondedDenomResponse
BondedDenomResponse is data format returned from StakingRequest::BondedDenom query
CanonicalAddr
A blockchain address in its binary form.
ChannelResponse
Coin
ContractInfo
ContractInfoResponse
ConversionOverflowError
The error returned by TryFrom conversions that overflow, for example when converting from Uint256 to Uint128.
Decimal
A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0
Decimal256
A fixed-point decimal value with 18 fractional digits, i.e. Decimal256(1_000_000_000_000_000_000) == 1.0
Decimal256RangeExceeded
DecimalRangeExceeded
Delegation
Delegation is basic (cheap to query) data about a delegation.
DelegationResponse
DelegationResponse is data format returned from StakingRequest::Delegation query
Deps
DepsMut
DivideByZeroError
Empty
An empty struct that serves as a placeholder in different places, such as contracts that don’t set a custom message.
Env
Event
A full Cosmos SDK event.
FullDelegation
FullDelegation is all the info on the delegation, some (like accumulated_reward and can_redelegate) is expensive to query.
HexBinary
This is a wrapper around Vec to add hex de/serialization with serde. It also adds some helper methods to help encode inline.
Ibc3ChannelOpenResponse
IbcAcknowledgement
IbcBasicResponse
This is the return value for the majority of the ibc handlers. That are able to dispatch messages / events on their own, but have no meaningful return value to the calling code.
IbcChannel
IbcChannel defines all information on a channel. This is generally used in the hand-shake process, but can be queried directly.
IbcEndpoint
IbcPacket
IbcPacketAckMsg
The message that is passed into ibc_packet_ack
IbcPacketReceiveMsg
The message that is passed into ibc_packet_receive
IbcPacketTimeoutMsg
The message that is passed into ibc_packet_timeout
IbcReceiveResponse
IbcTimeout
In IBC each package must set at least one type of timeout: the timestamp or the block height. Using this rather complex enum instead of two timeout fields we ensure that at least one timeout is set.
IbcTimeoutBlock
IBCTimeoutHeight Height is a monotonically increasing data type that can be compared against another Height for the purposes of updating and freezing clients. Ordering is (revision_number, timeout_height)
ListChannelsResponse
MemoryStorage
MessageInfo
Additional information from MsgInstantiateContract and MsgExecuteContract, which is passed along with the contract execution message into the instantiate and execute entry points.
OverflowError
OwnedDeps
Holds all external dependencies of the contract. Designed to allow easy dependency injection at runtime. This cannot be copied or cloned since it would behave differently for mock storages and a bridge storage in the VM.
PortIdResponse
QuerierWrapper
Reply
The result object returned to reply. We always get the ID from the submessage back and then must handle success and error cases ourselves.
Response
A response of a contract entry point, such as instantiate, execute or migrate.
SubMsg
A submessage that will guarantee a reply call on success or error, depending on the reply_on setting. If you do not need to process the result, use regular messages instead.
SubMsgResponse
The information we get back from a successful sub message execution, with full Cosmos SDK events.
Timestamp
A point in time in nanosecond precision.
TransactionInfo
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.
Uint128
A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
Uint256
An implementation of u256 that is using strings for JSON encoding/decoding, such that the full u256 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
Uint512
An implementation of u512 that is using strings for JSON encoding/decoding, such that the full u512 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.
Validator
Instances are created in the querier.
ValidatorResponse
The data format returned from StakingRequest::Validator query

Enums§

BankMsg
The message types of the bank module.
BankQuery
CheckedFromRatioError
CheckedMultiplyRatioError
ContractResult
This is the final result type that is created and serialized in a contract for every init/execute/migrate call. The VM then deserializes this type to distinguish between successful and failed executions.
CosmosMsg
DistributionMsg
The message types of the distribution module.
GovMsg
IbcChannelCloseMsg
The message that is passed into ibc_channel_close
IbcChannelConnectMsg
The message that is passed into ibc_channel_connect
IbcChannelOpenMsg
The message that is passed into ibc_channel_open
IbcMsg
These are messages in the IBC lifecycle. Only usable by IBC-enabled contracts (contracts that directly speak the IBC protocol via 6 entry points)
IbcOrder
IbcOrder defines if a channel is ORDERED or UNORDERED Values come from https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/ibc/core/channel/v1/channel.proto#L69-L80 Naming comes from the protobuf files and go translations.
IbcQuery
These are queries to the various IBC modules to see the state of the contract’s IBC connection. These will return errors if the contract is not “ibc enabled”
OverflowOperation
QueryRequest
RecoverPubkeyError
ReplyOn
Use this to define when the contract gets a response callback. If you only need it for errors or success you can select just those in order to save gas.
StakingMsg
The message types of the staking module.
StakingQuery
StdError
Structured error type for init, execute and query.
SubMsgResult
This is the result type that is returned from a sub message execution.
SystemError
SystemError is used for errors inside the VM and is API friendly (i.e. serializable).
SystemResult
This is the outer result type returned by a querier to the contract.
VerificationError
VoteOption
WasmMsg
The message types of the wasm module.
WasmQuery

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.
CustomMsg
Like CustomQuery for better type clarity. Also makes it shorter to use as a trait bound.
CustomQuery
A trait that is required to avoid conflicts with other query types like BankQuery and WasmQuery in generic implementations. You need to implement it in your custom query type.
Fraction
A fraction p/q with integers p and q.
Isqrt
A trait for calculating the integer square root.
Querier
Storage
Storage provides read and write access to a persistent storage. If you only want to provide read access, provide &Storage

Functions§

attr
Creates a new ENCRYPTED Attribute. Attribute::new is an alias for this.
attr_plaintext
Creates a new plaintext Attribute. Attribute::new_plaintext is an alias for this.
coin
A shorthand constructor for Coin
coins
A shortcut constructor for a set of one denomination of coins
from_binary
from_slice
has_coins
has_coins returns true if the list of coins has at least the required amount
to_binary
to_vec
wasm_execute
Shortcut helper as the construction of WasmMsg::Instantiate can be quite verbose in contract code
wasm_instantiate
Shortcut helper as the construction of WasmMsg::Instantiate can be quite verbose in contract code.

Type Aliases§

IbcChannelOpenResponse
This serializes either as “null” or a JSON object.
QuerierResult
A short-hand alias for the two-level query result (1. accessing the contract, 2. executing query in the contract)
QueryResponse
StdResult
The return type for init, execute and query. Since the error type cannot be serialized to JSON, this is only available within the contract and its unit tests.
SubMsgExecutionResponseDeprecated

Attribute Macros§

entry_point