abstract_std/objects/ownership/cw721.rs
1use cosmwasm_schema::cw_serde;
2
3/// Expiration represents a point in time when some event happens.
4/// It can compare with a BlockInfo and will return is_expired() == true
5/// once the condition is hit (and for every block in the future)
6// #[cw_serde]
7// #[derive(Copy)]
8// pub enum Expiration {
9// /// AtHeight will expire when `env.block.height` >= height
10// AtHeight(u64),
11// /// AtTime will expire when `env.block.time` >= time
12// AtTime(cosmwasm_std::Timestamp),
13// /// Never will never expire. Used to express the empty variant
14// Never {},
15// }
16
17// #[cw_serde]
18// pub struct Approval {
19// /// Account that can transfer/send the token
20// pub spender: String,
21// /// When the Approval expires (maybe Expiration::never)
22// pub expires: Expiration,
23// }
24
25#[cw_serde]
26pub struct OwnerOfResponse {
27 /// Owner of the token
28 pub owner: String,
29 // Left out as an optimization.
30 // /// If set this address is approved to transfer/send the token as well
31 // pub approvals: Vec<Approval>,
32}
33
34#[cw_serde]
35pub enum Cw721QueryMsg {
36 /// Return the owner of the given token, error if token does not exist
37 /// Return type: OwnerOfResponse
38 OwnerOf {
39 token_id: String,
40 /// unset or false will filter out expired approvals, you must set to true to see them
41 include_expired: Option<bool>,
42 },
43}