1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4use cosmwasm_schema::cw_serde;
5use cosmwasm_std::{Addr, Binary, Uint128};
6
7use crate::logo::LogoInfo;
8use cw_utils::Expiration;
9
10#[cw_serde]
11
12pub enum Cw20QueryMsg {
13 Balance { address: String },
16 TokenInfo {},
19 Allowance { owner: String, spender: String },
23 Minter {},
27 MarketingInfo {},
32 DownloadLogo {},
37 AllAllowances {
41 owner: String,
42 start_after: Option<String>,
43 limit: Option<u32>,
44 },
45 AllAccounts {
49 start_after: Option<String>,
50 limit: Option<u32>,
51 },
52}
53
54#[cw_serde]
55pub struct BalanceResponse {
56 pub balance: Uint128,
57}
58
59#[cw_serde]
60pub struct TokenInfoResponse {
61 pub name: String,
62 pub symbol: String,
63 pub decimals: u8,
64 pub total_supply: Uint128,
65}
66
67#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug, Default)]
68pub struct AllowanceResponse {
69 pub allowance: Uint128,
70 pub expires: Expiration,
71}
72
73#[cw_serde]
74pub struct MinterResponse {
75 pub minter: String,
76 pub cap: Option<Uint128>,
80}
81
82#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug, Default)]
83pub struct MarketingInfoResponse {
84 pub project: Option<String>,
86 pub description: Option<String>,
88 pub logo: Option<LogoInfo>,
90 pub marketing: Option<Addr>,
92}
93
94#[cw_serde]
97pub struct DownloadLogoResponse {
98 pub mime_type: String,
99 pub data: Binary,
100}
101
102#[cw_serde]
103pub struct AllowanceInfo {
104 pub spender: String,
105 pub allowance: Uint128,
106 pub expires: Expiration,
107}
108
109#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug, Default)]
110pub struct AllAllowancesResponse {
111 pub allowances: Vec<AllowanceInfo>,
112}
113
114#[cw_serde]
115pub struct SpenderAllowanceInfo {
116 pub owner: String,
117 pub allowance: Uint128,
118 pub expires: Expiration,
119}
120
121#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug, Default)]
122pub struct AllSpenderAllowancesResponse {
123 pub allowances: Vec<SpenderAllowanceInfo>,
124}
125
126#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, Debug, Default)]
127pub struct AllAccountsResponse {
128 pub accounts: Vec<String>,
129}