Links

NFTs

Mint & Update NFTs via simple endpoints. 🌠
NFTs can be easily minted and updated using the following endpoints.
🌟 Mint NFTs (up to 25 in a single call)
POST /collection/{collection_uuid}/mint
Request Body:
A JSON object containing the following parameters:
  • receiver_addresses (required; type string[])
    • NEAR account IDs (named or implicit) that NFTs should be minted to
  • quantity_per_receiver (optional; type integer, defaults to 1)
    • Note that the maximum number of mints per API call is 25.
  • metadata (optional; type TokenMetadata)
    • Object containing the following optional properties:
      • asset_file_url (optional; type string)
        • A URL pointing to a media file for this NFT (max size 100MB)
      • reference_file_url (optional; type string)
        • A URL pointing to a JSON file for this NFT
      • extra (optional; type string)
        • JSON string to be stored on-chain for this NFT
      • copies (optional; type integer)
        • Number of NFT copies with this metadata, stored on NFT (defaults to total Collection copies)
      • title (optional; type string)
        • Title for this NFT (defaults to Collection title)
      • subtitle (optional; type string)
        • Subtitle for this NFT
      • description (optional; type string)
        • Description for this NFT (defaults to Collection description)
201 Success Response Body
A success response will contain the following properties:
  • message (type string)
    • "success" if the action was successful
  • tokens (type Token[])
    • On-chain token objects, as per the FNF-007 Specification
  • tx_results (type NearTransactionResult[])
    • Refer to the "Referenced Types" section for details. Contains a single NearTransactionResult (for the mint transaction)
A note on end-user (non-API) Minting
  • If you wish for your users to mint NFTs directly without an API call, utilize a NEAR wallet client-side library to make an nft_mint function call to the contract address for your collection and pass the collection_id integer as its singular argument.
  • The user will be able to sign a transaction using their NEAR wallet of choice (assuming that a public mint has been configured, or the user has been added to a private mint whitelist). The contract will mint the NFT to the method caller's account.
  • Example JS Contract Call:
await wallet.callMethod({ contractId, method: "nft_mint", args: { collection_id: YOUR_COLLECTION_ID }, gas: "100000000000000", deposit: YOUR_MINT_FEE_IN_YOCTO_NEAR })
🌟 Update an NFT
PUT /collection/{collection_uuid}/nft-update
Request Body:
A JSON object containing the following parameters:
  • token_id (required; type string)
    • The on-chain ID for the token to update (e.g. "1:100")
  • asset_file_url (optional; type string)
    • A URL pointing to a media file for this NFT (max size 100MB)
  • reference_file_url (optional; type string)
    • A URL pointing to a JSON file for this NFT
  • extra (optional; type string)
    • JSON string to be stored on-chain for this NFT
  • copies (optional; type integer)
    • Number of NFT copies with this metadata, stored on NFT (defaults to total Collection copies)
  • title (optional; type string)
    • Title for this NFT (defaults to Collection title)
  • subtitle (optional; type string)
    • Subtitle for this NFT
  • description (optional; type string)
    • Description for this NFT (defaults to Collection description)
200 Success Response Body
A success response will contain the following properties:
  • message (type string)
    • "success" if the action was successful
  • token (type Token)
    • Updated on-chain token object, as per the FNF-007 Specification
  • tx_results (type NearTransactionResult[])
    • Refer to the "Referenced Types" section for details. Contains a single NearTransactionResult (for the update transaction)