[][src]Crate cosmwasm_std

Modules

testing

Macros

create_entry_points

This macro generates the boilerplate required to call into the contract-specific logic from the entry-points to the Wasm module.

create_entry_points_with_migration

This macro is very similar to the create_entry_points macro, except it also requires the migrate method:

Structs

AllBalanceResponse
AllDelegationsResponse

DelegationsResponse is data format returned from StakingRequest::AllDelegations query

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
Coin
Context
ContractInfo
Decimal

A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0

Delegation

Delegation is basic (cheap to query) data about a delegation

Empty

An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.

Env
Extern

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.

FullDelegation

FullDelegation is all the info on the delegation, some (like accumulated_reward and can_redelegate) is expensive to query

HandleResponse
HumanAddr
InitResponse
LogAttribute
MemoryStorage
MessageInfo
MigrateResponse
Uint128
Validator
ValidatorsResponse

ValidatorsResponse is data format returned from StakingRequest::Validators query

Enums

BankMsg
BankQuery
CosmosMsg
QueryRequest
StakingMsg
StakingQuery
StdError

Structured error type for init, handle and query.

SystemError

SystemError is used for errors inside the VM and is API friendly (i.e. serializable).

WasmMsg
WasmQuery

Traits

Api

Api are callbacks to system functions defined outside of the wasm modules. This is a trait to allow Mocks in the test code.

Querier
ReadonlyStorage

ReadonlyStorage is access to the contracts persistent data store

Storage

Functions

coin
coins
from_binary
from_slice
has_coins

has_coins returns true if the list of coins has at least the required amount

log

A shorthand to produce a log attribute

to_binary
to_vec

Type Definitions

HandleResult
InitResult
MigrateResult
QuerierResult

A short-hand alias for the two-level query result (1. accessing the contract, 2. executing query in the contract)

QueryResponse
QueryResult
StdResult

The return type for init, handle and query. Since the error type cannot be serialized to JSON, this is only available within the contract and its unit tests.

SystemResult