Crate cw_denom

source ·
Expand description

CosmWasm Denom

This is a simple package for validating cw20 and Cosmos SDK native denominations. It proves the types, UncheckedDenom and CheckedDenom. UncheckedDenom may be used in CosmWasm contract messages and checked via the into_checked method.

To validate native denominations, this package uses the same rules as the SDK.

To validate cw20 denominations this package ensures that the specified address is valid, that the specified address is a CosmWasm contract, and that the specified address responds correctly to cw20 TokenInfo queries.

Enums

  • A denom that has been checked to point to a valid asset. This enum should never be constructed literally and should always be built by calling into_checked on an UncheckedDenom instance.
  • A denom that has not been checked to confirm it points to a valid asset.

Functions

  • Follows cosmos SDK validation logic. Specifically, the regex string [a-zA-Z][a-zA-Z0-9/:._-]{2,127}.