1use cosmwasm_std::{Addr, Binary, Coin};
4use cw721::Expiration;
5use schemars::JsonSchema;
6use serde::{Deserialize, Serialize};
7
8#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, JsonSchema)]
9#[serde(rename_all = "snake_case")]
10pub struct InstantiateMsg {
11 pub name: String,
13 pub symbol: String,
15 }
18
19#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
20#[serde(rename_all = "snake_case")]
21pub enum ExecuteMsg {
22 TransferNft { recipient: String, token_id: u64 },
24 SendNft {
27 contract: String,
28 token_id: u64,
29 msg: Binary,
30 },
31 Approve {
34 operator: String,
35 token_id: u64,
36 expires: Option<Expiration>,
37 },
38 Revoke { operator: String, token_id: u64 },
40 ApproveAll {
43 operator: String,
44 expires: Option<Expiration>,
45 },
46 RevokeAll { operator: String },
48 Mint(MintMsg),
50}
51
52#[derive(Serialize, Deserialize, Clone, PartialEq, JsonSchema, Debug)]
53pub struct Approval {
54 pub operator: Addr,
56 pub expires: Expiration,
58}
59
60#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
61pub struct MintMsg {
62 pub owner: String,
66 pub token_uri: Option<String>,
70 pub price: Vec<Coin>,
72}
73
74#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
75#[serde(rename_all = "snake_case")]
76pub enum QueryMsg {
77 AskingPrice {
79 token_id: u64,
80 },
81 OwnerOf {
83 token_id: u64,
84 include_expired: Option<bool>,
85 },
86 Approval {
88 token_id: u64,
89 operator: String,
90 include_expired: Option<bool>,
91 },
92
93 Approvals {
95 token_id: u64,
96 include_expired: Option<bool>,
97 },
98 AllOperators {
100 owner: String,
101 include_expired: Option<bool>,
102 start_after: Option<String>,
103 limit: Option<u32>,
104 },
105 NumTokens {},
107 ContractInfo {},
110 NftInfo {
113 token_id: u64,
114 },
115 AllNftInfo {
118 token_id: u64,
119 include_expired: Option<bool>,
120 },
121}
122
123#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
124pub struct AskingPriceResponse {
125 pub price: Vec<Coin>,
126}
127
128#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
129pub struct OwnerOfResponse {
130 pub owner: String,
131 pub approvals: Vec<Approval>,
132}
133
134#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
135pub struct ApprovalResponse {
136 pub approval: Approval,
137}
138
139#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
140pub struct ApprovalsResponse {
141 pub approvals: Vec<Approval>,
142}
143
144#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
145pub struct NumTokensResponse {
146 pub tokens: u64,
147}
148
149#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
150pub struct ContractInfoResponse {
151 pub name: String,
152 pub symbol: String,
153}
154
155#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
156pub struct NftInfoResponse {
157 pub token_uri: String,
158}
159
160#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
161pub struct AllNftInfoResponse {
162 pub owner: OwnerOfResponse,
163 pub info: NftInfoResponse,
164}