Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot load metadata of NFT item when use deployNftCollection with not empty commonContent #15

Open
VTTruong287 opened this issue May 3, 2024 · 2 comments

Comments

@VTTruong287
Copy link

VTTruong287 commented May 3, 2024

I have a problem with commonContent. I cannot load metadata of NFT item when use deployNftCollection with NOT empty commonContent, but it work when commonContent = ''.

Can you guy help me explain about this case? Many thanks :)

Here is my code:

Deploy NFT Collection

...
const commonContent = await sdk.storage.uploadFile(
  Buffer.from(JSON.stringify(content), "utf-8")
);

const collection = await sdk.deployNftCollection(
  {
    collectionContent: content,
    commonContent: commonContent, // Issue here
  },
  {
    adminAddress: adminAddress,
  }
);
...

Deploy NFT Item:

...
const collection = sdk.openNftCollection(Address.parse(COLLECTION));

const content = Buffer.from(
  JSON.stringify({
    name: "Test NFT 1",
    description: "This is a test NFT 1",
    image: uploadedImageURL,
    "attributes":[{"trait_type":"Awesomeness","value":"Super cool"}],
  }), "utf-8"
);

const metadataURL = await sdk.storage.uploadFile(content);

const { nextItemIndex: index } = await collection.getData();
await collection.sendMint(sender, {
  index: index,
  owner: sdk.sender?.address!,
  individualContent: metadataURL,
});
...
@liho00
Copy link

liho00 commented Jul 17, 2024

hi ser any solution?

@wejaikao
Copy link

wejaikao commented Nov 1, 2024

my solution is:
leave commonContent empty and add option param onchainContent: true when deployNftCollection

const collection = await sdk.deployNftCollection(
  {
    collectionContent: content,
    commonContent: ''
  },
  {
    adminAddress: adminAddress,
    onchainContent: true
  }
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants