mintBadge

Mint a Nabi Badge from a BadgeCollection

🔑 Requires authentication

This operation requires Bearer Token issued from our Authentication flow appended to the request headers. Please refer to Authentication page.

After a BadgeCollection has been created. You can go ahead to mint a Nabi Badge, which we refer to as BadgeItem for the rest of this documentation.

A BadgeItem must have a name and image source. You also have the flexibility to customise its description.

Similar to BadgeCollection, the name, description and image will be displayed on tonscan and other TON NFT marketplaces.

Interface

type BadgeItem {
  id: ID! # this is a string
  createdAt: DateTimeISO!
  profileId: String!
  recipient: Profile
  initiatedBy: String!
  initiator: Profile
  blockTimestamp: DateTimeISO
  nftContract: String
  nftTokenId: String
  nftChainId: Int
  collectionId: String!
  metadataUri: String
  metadataS3Uri: String!
  createdBlockHash: String
  badgeImageS3Uri: String
  name: String! @constraint(minLength: 4, maxLength: 50)
  description: String
  collection: BadgeCollection
}

Fields

  • profileId: profileId of the owner of this Nabi Badge item

  • initiatedBy: profileId of the initiator of this BadgeItem mint.

    • BadgeItem mint can be initiated by the recipient or the BadgeCollection owner

  • nftContract: The contract address of this BadgeCollection

  • collectionId: The identifier of the BadgeCollection this BadgeItem belongs to

Related fields

  • recipient: Profile of the owner of this BadgeItem

  • collection: BadgeCollection that this BadgeItem is minted from

GraphQL Schema
input CreateBadgeItemRequest {
  initiatorProfileId: String!
  recipientProfileId: String!
  badgeCollectionId: String!
  name: String! @constraint(minLength: 4, maxLength: 50)
  description: String
  itemImageS3Uri: String!
}

type Mutation {
  mintBadge(request: CreateBadgeItemRequest!): BadgeItem!
}

Request input

CreateBadgeItemRequest object

  • initiatorProfileId: [Required] profileId of initiator

  • recipientProfileId: [Required] profileId of recipient

  • badgeCollectionId: [Required] collectionId of the BadgeCollection to be minted

  • name: [Required]

    • Unescaped string

    • Minimum of 4 characters, maximum of 50 characters

    • Supports alphanumeric characters, whitespaces , hyphens - and underscores _

    • Linebreaks are not supported

  • description: [Optional]

    • Escaped string

  • itemImageS3Uri: [Required]

Operation

GraphQL Operation
mutation CreateBadge {
  mintBadge(request: {
      initiatorProfileId: "0x1f",
      recipientProfileId: "0x20",
      badgeCollectionId: "4aa7266b-163a-4c8a-8123-4b3da02e8feb",
      name: "Positive cats",
      itemImageS3Uri: "https://as2.ftcdn.net/v2/jpg/02/08/81/51/1000_F_208815112_RNJcm8DlSDpeTFqVtPJHYUaHq0b6QT9h.jpg"
    }
  ) {
    id
    name
    description
    profileId
    initiatedBy
    # ... any other BadgeItem fields
  }
}

Response

JSON Response
{
  "data": {
    "mintBadge": {
      "id": "d5c5185a-79ca-4df3-aa4f-52e4170c3d94",
      "name": "Positive Cats",
      "description": null,
      "initiatedBy": "0x1f"
    }
  }
}

Last updated