How to mint single Nfts on opensea from IPFS using ERC1155

Expected working: I have a form where in I take nft details from admin user like nft image and other details. And after entering the details, user can save it on ipfs and also mint it with multiple quantities on opensea.

Issues facing: I am not getting a fixed or standard ipfs link every time I try to store nft on ipfs.
A new hash link is created, which is not managble in erc1155 mint function.
Below I have mentioned nodejs code, wherein I am passing details of nft to store on IPFS and then calling ERC1155 smart contract function to mint the same.
I have also mentioned my erc1155 mint function.
So is there any way to handle this either in smart contract or in moralis ipfs?

Nodejs Code:

var metadata_ipfs_url='';
ipfsArray.push({
   path: `images/${imageid}.png`,
   content: image
})

var raw = JSON.stringify(ipfsArray);
await axios.post("https://deep-index.moralis.io/api/v2/ipfs/uploadFolder",
raw,
        {
            headers: {
                "X-API-KEY": 'API-Key',
                "Content-Type": "application/json",
                "accept": "application/json"
            }
        }
 ).then( (res) => {
        img_ipfs_url=res.data[0].path;
 }).catch ( (error) => {
        console.log("err:",error)
 })

let metadata = {
      name: req.body.name,
      description: req.body.description,
      image: img_ipfs_url,
      attributes:[{"trait_type":"occupation","value":req.body.occupation},
        {"trait_type":"nationality","value":req.body.nationality},
        {"trait_type":"rarity","value":req.body.rarity},
        {"trait_type":"birthday","value":req.body.birthday},
        {"trait_type":"tagfield","value":req.body.category}
    }
  let ipfsMetadatArray = [];
  ipfsMetadatArray.push({
    path: `metadata/${imageid}.json`,
    content: metadata
  })
  var raw1 = JSON.stringify(ipfsMetadatArray);
  await axios.post("https://deep-index.moralis.io/api/v2/ipfs/uploadFolder",
    raw1,
        {
            headers: {
                "X-API-KEY": 'API-Key',
                "Content-Type": "application/json",
                "accept": "application/json"
            }
        }
    ).then( (res) => {
      metadata_ipfs_url=res.data[0].path;
    })
    .catch ( (error) => {
        console.log("err:",error)
    })


const accounts = await web3.eth.accounts.privateKeyToAccount('0x' + PRIVATE_KEY);
const contract = new web3.eth.Contract(contractABI1155, contractAddress1155);
const nonce = await web3.eth.getTransactionCount(accounts.address, 'latest'); //get latest nonce
const tx = {
        'from': accounts.address,
        'to': contractAddress1155,
        'nonce': nonce,
        'gas': 300000,
        'data': contract.methods.mintToken(accounts.address,imageid,1).encodeABI()
      };

ERC1155 solidity code:

constructor(address _token) ERC1155("https://ipfs.moralis.io:2053/ipfs/Qmdvs9VFjFXEv47gsSEgTR2tELFPwwex75GJCxV4Qcxpgf/metadata/{id}.json")  {
       own = msg.sender;
       token = IERC20(_token);
    }

    function mintToken(address owner,uint256 tokenID, uint256 amount) public onlyOwner{
        _mint(owner, tokenID, amount, "");
    }

    function uri(uint256 _tokenId) override public pure returns (string memory){
        return string(      abi.encodePacked("https://ipfs.moralis.io:2053/ipfs/Qmdvs9VFjFXEv47gsSEgTR2tELFPwwex75GJCxV4Qcxpgf/metadata/", Strings.toString(_tokenId),".json"
            )
        );
    }

Reference Link:


Server Url:
https://1uvyaez8woy5.usemoralis.com:2053/server

If you know all the nfts metadata from the beginning then you can upload to an ipfs folder all the json files and they will start with same prefix. You can use pinata to upload a folder to ipfs.

No I would not be knowing the nfts prior. In that case I need to shift to Pinata IPFS?
Isn’t there any way in Moralis itself?

With pinata is easier to upload a folder. But it may still not solve your problem.

Any idea on how to do single nft storing and minting?
Or its not possible at all?

It may be possible, you have to research. For example opensea may be able to do it somehow. You may need a custom smart contract.

Can anyone from the Moralis team would provide support for this?
Do you mean something like the one mentioned in the below link:

There are two different things for metadata to be dynamic and to mint new nfts without changing the token_uri.

I need to mint new nfts without changing the token_uri.

I can not help you now too much, it may be possible with a modified version of erc1155

Okay. No problem.
Thank you for your quick replies.