public-awesome / cw-nfts

Examples and helpers to build NFT contracts on CosmWasm
Apache License 2.0
185 stars 179 forks source link

Query ContractInfo: add num_tokens and minter/owner #139

Open taitruong opened 8 months ago

taitruong commented 8 months ago

By adding number of tokens and minter/owner, this may lead to less queries - at least in my case :).

taitruong commented 8 months ago

After looking into this: https://github.com/CosmWasm/cw-nfts/blob/main/packages/cw721/src/query.rs#L120-L123

I'd suggest extending these:

#[cw_serde]
pub struct ContractInfoResponse {
    pub name: String,
    pub symbol: String,
    pub num_tokens: u64,
    //optional props for backwards compatibility
    pub minter: Option<String>,
    pub description: Option<String>,
    pub uri: Option<String>, // uri or image
}
taitruong commented 2 weeks ago

should be considered for #150 in PR #156