Minting NFTs

Minting NFTs belong to HashGuild Application, powered by the minting application. The repository is opensource and be found here - contribution is happily seen. Endpoints developed in the course of the minting application can be used for automated minting of NFTs by posting to the API and retrieving signed data back. Take into account here, that the smart contract developed by the HashGuild Team is used here.

The Mint model

There are two mint models - one for uploading/pinning data to IPFS and one for sending the metadata to the smart contract for minting.

Required Properties for pinning Data to IPFS

  • Name
    name
    Type
    string
    Description

    The Name of the token.

  • Name
    creator
    Type
    string
    Description

    The ame of the creator.

  • Name
    description
    Type
    string
    Description

    The description for the NFT.

  • Name
    thumbnailFile
    Type
    Blob
    Description

    The thumbnailFile for the NFT.

Required Properties for calling the smart contract

  • Name
    tokenName
    Type
    string
    Description

    The Name of the token.

  • Name
    tokenSymbol
    Type
    string
    Description

    The tokenSymbol of the token.

  • Name
    maxSupply
    Type
    int
    Description

    The max supply of the token

  • Name
    metadataUInt8Array
    Type
    Buffer[]
    Description

    The buffer from the IPFS link returned after pinning.

  • Name
    royalties
    Type
    Object[]
    Description

    The royalties for the NFT, consisting of Key-Value pairs.


POST/api/uploadMetadataToIPFS

Upload/ Pin the Metadata to IPFS

This endpoint allows you to pin files directly to IPFS.

Optional attributes

  • Name
    attributes
    Type
    nftAttributes[]
    Description

    Add attributes to the NFT in key-value pairs.

  • Name
    files
    Type
    File[]
    Description

    Add more files than the thumbnail to the NFT.

Request

POST
/api/uploadMetadataToIPFS
curl -G https://mint.hashguild.xyz/api/uploadMetadataToIPFS \
  -H "Authorization: Bearer {token}"
  -H "Content-Type: multipart/form-data"
  -d "{
    "name": "<name>",
    "creator": "<creator>",
    "description": "<description>", 
    "thumbnailFile": "<thumbnailFile>"
}" 

Response

{
    "success": true,
    "url": "ipfs://bafkreifek53mxm3ne5z4wdtcmzvddqpn2bzdgtonoazf6hzycyaeen"
}

GET/api/mintWithSmartContractHashPack

Mint NFTs via Smart Contract

This endpoint allows you retrieve the Hashpack mint transaction string to direct to the Hashpack extension.

Request

GET
/api/mintWithSmartContractHashPack
 curl -X https://mint.hashguild.xyz/api/mintWithSmartContractHashPack \
  -H "Authorization: Bearer {token}" 
   -d "{
        "tokenName": "<tokenName>",
        "tokenSymbol": "<tokenSymbol>",
        "maxSupply": <maxSupply>, 
        "metadataUInt8Array": <metadataUInt8Array>, 
        "royalties": <royalties>, 
   }" 

Response

{
    "byteArray": "CrkCKrYCCssBChsKDAitq9adBhC244DZARIJCAAQABiUmrAQGAASBggAEAAYAxiAwtcvIgIIeDJCUHVyY2hhc2luZyBORlQgd2l0aCAwLjAuNDkxMzk0OTggYW5kIFNlcmlhbCBOdW1iZXIgMSBmb3IgMjIyIEhCQVIuclcKLAoUCgkIABAAGKHnnBAQgPjIs6UBGAAKFAoJCAAQABiUmrAQEP/3yLOlARgAEicKCQgAEAAYqp63FxoaCgkIABAAGKHnnBASCQgAEAAYlJqwEBgBIAASZgpkCiBU2pWm+80uY3j0QRo5jGHMi0dC0CAdWflAzJ1kLKmbLhpAWN1ZRc6MRHhTwgCtA1VgIbZRAifO72cjuYgKDirVplUgeXwjVwF8OIJ0oPVdOuCxYkiQ0oYbzy0VKd6WiKVIDQ==",
    "metadata": {
        "accountToSign": "0.0.34344212",
        "returnTransaction": false
    }
}