From cd42f6940c48c23a11de6e4595411f83cc42971c Mon Sep 17 00:00:00 2001 From: Austin Kline Date: Mon, 9 Sep 2024 08:56:49 -0700 Subject: [PATCH] add nft metadata in open edition initializer --- contracts/initializers/OpenEditionInitializer.cdc | 5 ++++- contracts/nft/BaseNFT.cdc | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/contracts/initializers/OpenEditionInitializer.cdc b/contracts/initializers/OpenEditionInitializer.cdc index fd001d2..f5501f4 100644 --- a/contracts/initializers/OpenEditionInitializer.cdc +++ b/contracts/initializers/OpenEditionInitializer.cdc @@ -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 } } \ No newline at end of file diff --git a/contracts/nft/BaseNFT.cdc b/contracts/nft/BaseNFT.cdc index 195c133..a9c6b31 100644 --- a/contracts/nft/BaseNFT.cdc +++ b/contracts/nft/BaseNFT.cdc @@ -93,9 +93,9 @@ access(all) contract interface BaseNFT: ViewResolver { thumbnail: entry.getThumbnail() ) case Type(): - return entry.externalURL + return entry.getExternalURL() case Type(): - return entry.royalties + return entry.getRoyalties() } }