You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few people have tried to build on cw721-base but want to add extra metadata to the contract and cannot extend it. Basically, we would need:
#[derive(Serialize,Deserialize,Clone,Debug,PartialEq,JsonSchema)]pubstructTokenInfo<T>{/// The owner of the newly minted NFTpubowner:Addr,/// Approvals are stored here, as we clear them all upon transfer and cannot accumulate muchpubapprovals:Vec<Approval>,/// Identifies the asset to which this NFT representspubname:String,/// Describes the asset to which this NFT representspubdescription:String,/// A URI pointing to an image representing the assetpubimage:Option<String>,pubextension:Option<T>,}
The default implementation can simply leave extension: None. (Or use extension: Empty, removing the Option).
This can be done and then we make all query and execute methods accept this T. However, when thinking about it, it would be a great first example of using a struct to represent a contract, as described in #391
The text was updated successfully, but these errors were encountered:
I am not sure if it is worth it for now waiting for #391 - I am doing some things around this after hours, but for now I don't put time on this unless we are agreed on this idea. Adding generic extension is relatively small change and it can be done in current environment (I am not sure how important is it).
One thing I would change here - make extension just T and leave it to the user to decide if it is optional (T may always be an option itself), making it Empty by default.
One thing I would change here - make extension just T and leave it to the user to decide if it is optional (T may always be an option itself), making it Empty by default.
Sounds good to use T.
Making it Option<Empty> by default is nice, so it is compatible with current serialised data that don't have that field.
A first step on #391
A few people have tried to build on cw721-base but want to add extra metadata to the contract and cannot extend it. Basically, we would need:
(source)
The default implementation can simply leave
extension: None
. (Or useextension: Empty
, removing the Option).This can be done and then we make all query and execute methods accept this T. However, when thinking about it, it would be a great first example of using a struct to represent a contract, as described in #391
The text was updated successfully, but these errors were encountered: