MCPcopy Create free account
hub / github.com/UniqueNetwork/unique-chain / createCollectionAsync

Function createCollectionAsync

examples/testnft/create_collection.js:30–46  ·  view source on GitHub ↗
(api, alice)

Source from the content-addressed store, hash-verified

28}
29
30async function createCollectionAsync(api, alice) {
31 // Test NFT
32 const name = [0x54, 0x65, 0x73, 0x74, 0x20, 0x4e, 0x46, 0x54];
33 // Test NFT Collection
34 const description = [0x54, 0x65, 0x73, 0x74, 0x20, 0x4e, 0x46, 0x54, 0x20, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e];
35 // TestNFT
36 const tokenPrefix = [0x54, 0x65, 0x73, 0x74, 0x4e, 0x46, 0x54];
37
38 // Mode: NFT
39 const tx = api.tx.nft.createCollection(name, description, tokenPrefix, {"NFT": config.collectionDataSize});
40 await submitTransaction(alice, tx);
41
42 const collectionId = 1;
43
44 const tx2 = api.tx.nft.setOffchainSchema(collectionId, "https://ipfs-gateway.usetech.com/ipfs/QmVdFFZjnq6i3fNDjm6FQe2tfAtUDnqMNkBh8e4sYWUmbH/images/image{id}.png");
45 await submitTransaction(alice, tx2);
46}
47
48async function main() {
49 // Initialise the provider to connect to the node

Callers 1

mainFunction · 0.70

Calls 1

submitTransactionFunction · 0.70

Tested by

no test coverage detected