Skip to content

Commit

Permalink
add nft metadata in open edition initializer (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
austinkline authored Sep 9, 2024
1 parent 0a03971 commit ece5ad2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion contracts/initializers/OpenEditionInitializer.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ access(all) contract OpenEditionInitializer: ContractInitializer {
container.addDrop(<- drop)
}

return NFTMetadata.initialize(acct: contractAcct, collectionInfo: collectionInfo, nftType: nftType)
let caps = NFTMetadata.initialize(acct: contractAcct, collectionInfo: collectionInfo, nftType: nftType)
caps.ownerCap.borrow()!.addMetadata(id: 0, data: data)

return caps
}
}
4 changes: 2 additions & 2 deletions contracts/nft/BaseNFT.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ access(all) contract interface BaseNFT: ViewResolver {
thumbnail: entry.getThumbnail()
)
case Type<MetadataViews.ExternalURL>():
return entry.externalURL
return entry.getExternalURL()
case Type<MetadataViews.Royalties>():
return entry.royalties
return entry.getRoyalties()
}
}

Expand Down

0 comments on commit ece5ad2

Please sign in to comment.