From bcc5996fbbab70a37494ceccbb026b016ec40c66 Mon Sep 17 00:00:00 2001 From: mr-t Date: Tue, 7 May 2024 13:46:21 +0200 Subject: [PATCH] define UniversalCollectionInfoResponse --- packages/ics721/src/state.rs | 7 +++++++ packages/ics721/src/utils.rs | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/ics721/src/state.rs b/packages/ics721/src/state.rs index 8d297d0e..5f69287f 100644 --- a/packages/ics721/src/state.rs +++ b/packages/ics721/src/state.rs @@ -53,6 +53,13 @@ pub struct UniversalAllNftInfoResponse { pub info: UniversalNftInfoResponse, } +/// Based on `cw721::ContractInfoResponse v0.18` +#[derive(Deserialize)] +pub struct UniversalCollectionInfoResponse { + pub name: String, + pub symbol: String, +} + #[derive(Deserialize)] pub struct UniversalNftInfoResponse { pub token_uri: Option, diff --git a/packages/ics721/src/utils.rs b/packages/ics721/src/utils.rs index 978b4217..3a29e4e5 100644 --- a/packages/ics721/src/utils.rs +++ b/packages/ics721/src/utils.rs @@ -1,8 +1,8 @@ use cosmwasm_std::{Addr, DepsMut, Empty, Env, StdResult}; -use cw721::{ContractInfoResponse, NumTokensResponse}; +use cw721::NumTokensResponse; use cw_ownable::Ownership; -use crate::state::CollectionData; +use crate::state::{CollectionData, UniversalCollectionInfoResponse}; pub fn get_collection_data(deps: &DepsMut, collection: &Addr) -> StdResult { // cw721 v0.17 and higher holds ownership in the contract @@ -21,7 +21,7 @@ pub fn get_collection_data(deps: &DepsMut, collection: &Addr) -> StdResult::ContractInfo {}, )?;