token_bindings/types.rs
1use cosmwasm_schema::cw_serde;
2use cosmwasm_std::Coin;
3
4/// This maps to cosmos.bank.v1beta1.Metadata protobuf struct
5#[cw_serde]
6pub struct Metadata {
7 pub description: Option<String>,
8 /// denom_units represents the list of DenomUnit's for a given coin
9 pub denom_units: Vec<DenomUnit>,
10 /// base represents the base denom (should be the DenomUnit with exponent = 0).
11 pub base: Option<String>,
12 /// display indicates the suggested denom that should be displayed in clients.
13 pub display: Option<String>,
14 /// name defines the name of the token (eg: Cosmos Atom)
15 pub name: Option<String>,
16 /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can
17 /// be the same as the display.
18 pub symbol: Option<String>,
19}
20
21/// This maps to cosmos.bank.v1beta1.DenomUnit protobuf struct
22#[cw_serde]
23pub struct DenomUnit {
24 /// denom represents the string name of the given denom unit (e.g uatom).
25 pub denom: String,
26 /// exponent represents power of 10 exponent that one must
27 /// raise the base_denom to in order to equal the given DenomUnit's denom
28 /// 1 denom = 1^exponent base_denom
29 /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
30 /// exponent = 6, thus: 1 atom = 10^6 uatom).
31 pub exponent: u32,
32 /// aliases is a list of string aliases for the given denom
33 pub aliases: Vec<String>,
34}
35
36/// This maps to osmosis.tokenfactory.v1beta1.Params protobuf struct
37#[cw_serde]
38pub struct Params {
39 /// TODO: verify semantics - does it charge all of these or one of these?
40 pub denom_creation_fee: Vec<Coin>,
41}