nft-service-api

GraphQL API Reference

GraphQl endpoints for nft-service!

API Endpoints

# devel:
https://nft-service.devel.original.works/graphql
# staging:
https://nft-service.stage.original.works/graphql
# prod:
https://nft-service.original.works/graphql

Queries

balanceOf

Description

🔓 Public

Returns token balance of user

Response

Returns a String!

Arguments

NameDescription

collectionContract - String!

tokenId - String!

userId - String!

network - NetworkName!

Example

Query

query BalanceOf(
  $collectionContract: String!,
  $tokenId: String!,
  $userId: String!,
  $network: NetworkName!
) {
  balanceOf(
    collectionContract: $collectionContract,
    tokenId: $tokenId,
    userId: $userId,
    network: $network
  )
}

Variables

{
  "collectionContract": "abc123",
  "tokenId": "xyz789",
  "userId": "abc123",
  "network": "ropsten"
}

Response

{"data": {"balanceOf": "abc123"}}

Queries

collection

Description

🔓 Public

Returns single collection

Response

Returns a Collection

Arguments

NameDescription

network - NetworkName!

id - String!

Example

Query

query Collection(
  $network: NetworkName!,
  $id: String!
) {
  collection(
    network: $network,
    id: $id
  ) {
    id
    owner
    tokens {
      id
      tokenId
      collectionContract {
        ...CollectionFragment
      }
      minter
      enterprise {
        ...CollectionEntityFragment
      }
      artist {
        ...CollectionEntityFragment
      }
      amount
      royaltyRecipient
      royaltyNumerator
      owners {
        ...TokenOwnerFragment
      }
      ownersWithMetadata {
        ...OwnerWithMetadataFragment
      }
      listing {
        ...ListingFragment
      }
      purchases {
        ...PurchaseFragment
      }
      tokenURI
      metadata {
        ...NftMetadataDTOFragment
      }
      nftUrl
      coverUrl
      networkName
      createdAt
      updatedAt
    }
    address
    contractURI
    networkName
    metadata {
      id
      userSub
      name
      symbol
      description
      coverImageS3Key
      coverImageS3Url
      coverImageIpfsUrl
      coverImageIpfsHash
      bannerImageS3Key
      bannerImageS3Url
      bannerImageIpfsHash
      bannerImageIpfsUrl
      externalLink
      defaultRoyalties
      defaultRoyaltyRecipient
      metadataIpfsHash
      metadataIpfsUrl
      networkName
      status
    }
    createdAt
    updatedAt
  }
}

Variables

{"network": "ropsten", "id": "abc123"}

Response

{
  "data": {
    "collection": {
      "id": "abc123",
      "owner": "xyz789",
      "tokens": [Token],
      "address": "abc123",
      "contractURI": "abc123",
      "networkName": "ropsten",
      "metadata": CollectionMetadataDto,
      "createdAt": "xyz789",
      "updatedAt": "abc123"
    }
  }
}

Queries

collectionMetadata

Description

🔒 JWT Token

Retrieve collection metadata by id

Response

Returns a CollectionMetadataDto!

Arguments

NameDescription

id - Float!

Example

Query

query CollectionMetadata($id: Float!) {
  collectionMetadata(id: $id) {
    id
    userSub
    name
    symbol
    description
    coverImageS3Key
    coverImageS3Url
    coverImageIpfsUrl
    coverImageIpfsHash
    bannerImageS3Key
    bannerImageS3Url
    bannerImageIpfsHash
    bannerImageIpfsUrl
    externalLink
    defaultRoyalties
    defaultRoyaltyRecipient
    metadataIpfsHash
    metadataIpfsUrl
    networkName
    status
  }
}

Variables

{"id": 987.65}

Response

{
  "data": {
    "collectionMetadata": {
      "id": 987,
      "userSub": "xyz789",
      "name": "abc123",
      "symbol": "xyz789",
      "description": "xyz789",
      "coverImageS3Key": "abc123",
      "coverImageS3Url": "xyz789",
      "coverImageIpfsUrl": "abc123",
      "coverImageIpfsHash": "xyz789",
      "bannerImageS3Key": "abc123",
      "bannerImageS3Url": "xyz789",
      "bannerImageIpfsHash": "xyz789",
      "bannerImageIpfsUrl": "abc123",
      "externalLink": "xyz789",
      "defaultRoyalties": "xyz789",
      "defaultRoyaltyRecipient": "abc123",
      "metadataIpfsHash": "abc123",
      "metadataIpfsUrl": "xyz789",
      "networkName": "ropsten",
      "status": "PENDING_UPLOAD"
    }
  }
}

Queries

collections

Description

🔓 Public

Returns collections

Response

Returns [Collection!]!

Arguments

NameDescription

Example

Query

query Collections($input: CollectionsInput!) {
  collections(input: $input) {
    id
    owner
    tokens {
      id
      tokenId
      collectionContract {
        ...CollectionFragment
      }
      minter
      enterprise {
        ...CollectionEntityFragment
      }
      artist {
        ...CollectionEntityFragment
      }
      amount
      royaltyRecipient
      royaltyNumerator
      owners {
        ...TokenOwnerFragment
      }
      ownersWithMetadata {
        ...OwnerWithMetadataFragment
      }
      listing {
        ...ListingFragment
      }
      purchases {
        ...PurchaseFragment
      }
      tokenURI
      metadata {
        ...NftMetadataDTOFragment
      }
      nftUrl
      coverUrl
      networkName
      createdAt
      updatedAt
    }
    address
    contractURI
    networkName
    metadata {
      id
      userSub
      name
      symbol
      description
      coverImageS3Key
      coverImageS3Url
      coverImageIpfsUrl
      coverImageIpfsHash
      bannerImageS3Key
      bannerImageS3Url
      bannerImageIpfsHash
      bannerImageIpfsUrl
      externalLink
      defaultRoyalties
      defaultRoyaltyRecipient
      metadataIpfsHash
      metadataIpfsUrl
      networkName
      status
    }
    createdAt
    updatedAt
  }
}

Variables

{"input": CollectionsInput}

Response

{
  "data": {
    "collections": [
      {
        "id": "abc123",
        "owner": "abc123",
        "tokens": [Token],
        "address": "abc123",
        "contractURI": "xyz789",
        "networkName": "ropsten",
        "metadata": CollectionMetadataDto,
        "createdAt": "abc123",
        "updatedAt": "xyz789"
      }
    ]
  }
}

Queries

currentPerson

Description

🔒 JWT Token

Returns person from the context

Response

Returns a PersonDto!

Example

Query

query CurrentPerson {
  currentPerson {
    id
    walletAddress
    smartWalletAddress
    username
    avatarS3Key
    avatarUrl
  }
}

Response

{
  "data": {
    "currentPerson": {
      "id": "xyz789",
      "walletAddress": "abc123",
      "smartWalletAddress": "abc123",
      "username": "abc123",
      "avatarS3Key": "xyz789",
      "avatarUrl": "xyz789"
    }
  }
}

Queries

fees

Description

🔓 Public

Returns market fees

Response

Returns a Fees!

Arguments

NameDescription

network - NetworkName!

Example

Query

query Fees($network: NetworkName!) {
  fees(network: $network) {
    mintingFee
    sellingFee
  }
}

Variables

{"network": "ropsten"}

Response

{
  "data": {
    "fees": {
      "mintingFee": "xyz789",
      "sellingFee": "xyz789"
    }
  }
}

Queries

listCollectionMetadata

Description

🔒 JWT Token

Returns list of collection metadata

Response

Returns a CollectionMetadataListResDTO!

Arguments

NameDescription

pagination - PaginationParams!

Example

Query

query ListCollectionMetadata($pagination: PaginationParams!) {
  listCollectionMetadata(pagination: $pagination) {
    items {
      id
      userSub
      name
      symbol
      description
      coverImageS3Key
      coverImageS3Url
      coverImageIpfsUrl
      coverImageIpfsHash
      bannerImageS3Key
      bannerImageS3Url
      bannerImageIpfsHash
      bannerImageIpfsUrl
      externalLink
      defaultRoyalties
      defaultRoyaltyRecipient
      metadataIpfsHash
      metadataIpfsUrl
      networkName
      status
    }
    count
  }
}

Variables

{"pagination": PaginationParams}

Response

{
  "data": {
    "listCollectionMetadata": {
      "items": [CollectionMetadataDto],
      "count": 123.45
    }
  }
}

Queries

listMetadata

Description

🔒 JWT Token

Returns list of NFT metadata

Response

Returns a NftMetadataListResDTO!

Arguments

NameDescription

pagination - PaginationParams!

Example

Query

query ListMetadata($pagination: PaginationParams!) {
  listMetadata(pagination: $pagination) {
    items {
      id
      fileName
      title
      description
      artistId
      fileType
      networkName
      backgroundColor
      externalUrl
      youtubeUrl
      attributes {
        ...NftMetadataAttributeObjectFragment
      }
    }
    count
  }
}

Variables

{"pagination": PaginationParams}

Response

{
  "data": {
    "listMetadata": {
      "items": [NftMetadataDraftResDTO],
      "count": 123.45
    }
  }
}

Queries

metadata

Description

🔒 JWT Token

Retrieve metadata by id

Response

Returns a NftMetadataDTO!

Arguments

NameDescription

id - Float!

Example

Query

query Metadata($id: Float!) {
  metadata(id: $id) {
    id
    userSub
    title
    description
    artistId
    fileType
    networkName
    s3Key
    s3CoverKey
    ipfsNftUrl
    ipfsCoverUrl
    ipfsMetadataUrl
    ipfsNftHash
    ipfsCoverHash
    ipfsMetadataHash
    status
    backgroundColor
    externalUrl
    youtubeUrl
    attributes {
      value
      traitType
      displayType
    }
    ipfsNftPublicUrl
    ipfsCoverPublicUrl
    ipfsMetadataPublicUrl
  }
}

Variables

{"id": 987.65}

Response

{
  "data": {
    "metadata": {
      "id": 987,
      "userSub": "xyz789",
      "title": "abc123",
      "description": "xyz789",
      "artistId": "xyz789",
      "fileType": "IMAGE",
      "networkName": "ropsten",
      "s3Key": "xyz789",
      "s3CoverKey": "xyz789",
      "ipfsNftUrl": "abc123",
      "ipfsCoverUrl": "abc123",
      "ipfsMetadataUrl": "abc123",
      "ipfsNftHash": "xyz789",
      "ipfsCoverHash": "xyz789",
      "ipfsMetadataHash": "abc123",
      "status": "PENDING_UPLOAD",
      "backgroundColor": "xyz789",
      "externalUrl": "abc123",
      "youtubeUrl": "xyz789",
      "attributes": [NftMetadataAttributeObject],
      "ipfsNftPublicUrl": "xyz789",
      "ipfsCoverPublicUrl": "xyz789",
      "ipfsMetadataPublicUrl": "xyz789"
    }
  }
}

Queries

person

Description

🔓 Public

Returns single person

Response

Returns a PersonDto

Arguments

NameDescription

identifier - PersonIdentifier!

Example

Query

query Person($identifier: PersonIdentifier!) {
  person(identifier: $identifier) {
    id
    walletAddress
    smartWalletAddress
    username
    avatarS3Key
    avatarUrl
  }
}

Variables

{"identifier": PersonIdentifier}

Response

{
  "data": {
    "person": {
      "id": "xyz789",
      "walletAddress": "abc123",
      "smartWalletAddress": "xyz789",
      "username": "abc123",
      "avatarS3Key": "abc123",
      "avatarUrl": "xyz789"
    }
  }
}

Queries

persons

Description

🔓 Public

Returns persons

Response

Returns a Persons!

Arguments

NameDescription

pagination - PaginationParams!

Example

Query

query Persons($pagination: PaginationParams!) {
  persons(pagination: $pagination) {
    items {
      id
      walletAddress
      smartWalletAddress
      username
      avatarS3Key
      avatarUrl
    }
    count
  }
}

Variables

{"pagination": PaginationParams}

Response

{
  "data": {
    "persons": {"items": [PersonDto], "count": 123.45}
  }
}

Queries

token

Description

🔓 Public

Returns single token

Response

Returns a Token

Arguments

NameDescription

network - NetworkName!

id - String!

Example

Query

query Token(
  $network: NetworkName!,
  $id: String!
) {
  token(
    network: $network,
    id: $id
  ) {
    id
    tokenId
    collectionContract {
      id
      owner
      tokens {
        ...TokenFragment
      }
      address
      contractURI
      networkName
      metadata {
        ...CollectionMetadataDtoFragment
      }
      createdAt
      updatedAt
    }
    minter
    enterprise {
      id
      type
      entityUri
      name
      description
      avatarUrl
      bannerUrl
      createdAt
      updatedAt
    }
    artist {
      id
      type
      entityUri
      name
      description
      avatarUrl
      bannerUrl
      createdAt
      updatedAt
    }
    amount
    royaltyRecipient
    royaltyNumerator
    owners {
      id
      owner {
        ...OwnerFragment
      }
      amountOwned
      amountDeposited
    }
    ownersWithMetadata {
      amountOwned
      amountDeposited
      id
      walletAddress
      smartWalletAddress
      username
      avatarS3Key
      avatarUrl
    }
    listing {
      id
      onSale
      seller {
        ...OwnerFragment
      }
      salePrice
      amountListed
      amountRemaining
      createdAt
      updatedAt
    }
    purchases {
      id
      amount
      salePrice
      value
      buyer {
        ...OwnerFragment
      }
      createdAt
    }
    tokenURI
    metadata {
      id
      userSub
      title
      description
      artistId
      fileType
      networkName
      s3Key
      s3CoverKey
      ipfsNftUrl
      ipfsCoverUrl
      ipfsMetadataUrl
      ipfsNftHash
      ipfsCoverHash
      ipfsMetadataHash
      status
      backgroundColor
      externalUrl
      youtubeUrl
      attributes {
        ...NftMetadataAttributeObjectFragment
      }
      ipfsNftPublicUrl
      ipfsCoverPublicUrl
      ipfsMetadataPublicUrl
    }
    nftUrl
    coverUrl
    networkName
    createdAt
    updatedAt
  }
}

Variables

{"network": "ropsten", "id": "xyz789"}

Response

{
  "data": {
    "token": {
      "id": "xyz789",
      "tokenId": "abc123",
      "collectionContract": Collection,
      "minter": "abc123",
      "enterprise": CollectionEntity,
      "artist": CollectionEntity,
      "amount": "xyz789",
      "royaltyRecipient": "abc123",
      "royaltyNumerator": "abc123",
      "owners": [TokenOwner],
      "ownersWithMetadata": [OwnerWithMetadata],
      "listing": Listing,
      "purchases": [Purchase],
      "tokenURI": "xyz789",
      "metadata": NftMetadataDTO,
      "nftUrl": "xyz789",
      "coverUrl": "xyz789",
      "networkName": "ropsten",
      "createdAt": "xyz789",
      "updatedAt": "abc123"
    }
  }
}

Queries

tokens

Description

🔓 Public

Returns tokens

Response

Returns [Token!]!

Arguments

NameDescription

input - tokensInput!

Example

Query

query Tokens($input: tokensInput!) {
  tokens(input: $input) {
    id
    tokenId
    collectionContract {
      id
      owner
      tokens {
        ...TokenFragment
      }
      address
      contractURI
      networkName
      metadata {
        ...CollectionMetadataDtoFragment
      }
      createdAt
      updatedAt
    }
    minter
    enterprise {
      id
      type
      entityUri
      name
      description
      avatarUrl
      bannerUrl
      createdAt
      updatedAt
    }
    artist {
      id
      type
      entityUri
      name
      description
      avatarUrl
      bannerUrl
      createdAt
      updatedAt
    }
    amount
    royaltyRecipient
    royaltyNumerator
    owners {
      id
      owner {
        ...OwnerFragment
      }
      amountOwned
      amountDeposited
    }
    ownersWithMetadata {
      amountOwned
      amountDeposited
      id
      walletAddress
      smartWalletAddress
      username
      avatarS3Key
      avatarUrl
    }
    listing {
      id
      onSale
      seller {
        ...OwnerFragment
      }
      salePrice
      amountListed
      amountRemaining
      createdAt
      updatedAt
    }
    purchases {
      id
      amount
      salePrice
      value
      buyer {
        ...OwnerFragment
      }
      createdAt
    }
    tokenURI
    metadata {
      id
      userSub
      title
      description
      artistId
      fileType
      networkName
      s3Key
      s3CoverKey
      ipfsNftUrl
      ipfsCoverUrl
      ipfsMetadataUrl
      ipfsNftHash
      ipfsCoverHash
      ipfsMetadataHash
      status
      backgroundColor
      externalUrl
      youtubeUrl
      attributes {
        ...NftMetadataAttributeObjectFragment
      }
      ipfsNftPublicUrl
      ipfsCoverPublicUrl
      ipfsMetadataPublicUrl
    }
    nftUrl
    coverUrl
    networkName
    createdAt
    updatedAt
  }
}

Variables

{"input": tokensInput}

Response

{
  "data": {
    "tokens": [
      {
        "id": "xyz789",
        "tokenId": "abc123",
        "collectionContract": Collection,
        "minter": "abc123",
        "enterprise": CollectionEntity,
        "artist": CollectionEntity,
        "amount": "abc123",
        "royaltyRecipient": "abc123",
        "royaltyNumerator": "xyz789",
        "owners": [TokenOwner],
        "ownersWithMetadata": [OwnerWithMetadata],
        "listing": Listing,
        "purchases": [Purchase],
        "tokenURI": "abc123",
        "metadata": NftMetadataDTO,
        "nftUrl": "xyz789",
        "coverUrl": "xyz789",
        "networkName": "ropsten",
        "createdAt": "xyz789",
        "updatedAt": "abc123"
      }
    ]
  }
}

Mutations

createAvatarUrl

Description

🔒 JWT Token

Creates Avatar URL

Response

Returns an AvatarLinkResDTO!

Arguments

NameDescription

avatarLink - AvatarLinkReqDTO!

Example

Query

mutation CreateAvatarUrl($avatarLink: AvatarLinkReqDTO!) {
  createAvatarUrl(avatarLink: $avatarLink) {
    avatarUploadUrl
  }
}

Variables

{"avatarLink": AvatarLinkReqDTO}

Response

{
  "data": {
    "createAvatarUrl": {
      "avatarUploadUrl": "abc123"
    }
  }
}

Mutations

createCollectionAssetsUploadUrl

Description

🔒 JWT Token

Creates Metadata URL

Response

Returns a CollectionMetadataLinkResDTO!

Arguments

NameDescription

collectionMetadataLink - CollectionMetadataLinkReqDTO!

id - Float!

id of the collection-metadata draft

Example

Query

mutation CreateCollectionAssetsUploadUrl(
  $collectionMetadataLink: CollectionMetadataLinkReqDTO!,
  $id: Float!
) {
  createCollectionAssetsUploadUrl(
    collectionMetadataLink: $collectionMetadataLink,
    id: $id
  ) {
    coverUploadUrl
    bannerUploadUrl
  }
}

Variables

{
  "collectionMetadataLink": CollectionMetadataLinkReqDTO,
  "id": 987.65
}

Response

{
  "data": {
    "createCollectionAssetsUploadUrl": {
      "coverUploadUrl": "abc123",
      "bannerUploadUrl": "xyz789"
    }
  }
}

Mutations

createUrl

Description

🔒 JWT Token

Creates Metadata URL

Response

Returns a NftMetadataLinkResDTO!

Arguments

NameDescription

nftMetadataLink - NftMetadataLinkReqDTO!

id - Float!

id of the nft-metadata draft

Example

Query

mutation CreateUrl(
  $nftMetadataLink: NftMetadataLinkReqDTO!,
  $id: Float!
) {
  createUrl(
    nftMetadataLink: $nftMetadataLink,
    id: $id
  ) {
    uploadUrl
    coverUploadUrl
  }
}

Variables

{"nftMetadataLink": NftMetadataLinkReqDTO, "id": 987.65}

Response

{
  "data": {
    "createUrl": {
      "uploadUrl": "abc123",
      "coverUploadUrl": "abc123"
    }
  }
}

Mutations

saveCollectionDraft

Description

🔒 JWT Token

Save collection metadata as a draft. Does not deploy an NFT contract. You can edit the data.

Response

Returns a CollectionMetadataDto!

Arguments

NameDescription

collectionMetadataDraft - CollectionMetadataDraftReqDTO!

Example

Query

mutation SaveCollectionDraft($collectionMetadataDraft: CollectionMetadataDraftReqDTO!) {
  saveCollectionDraft(collectionMetadataDraft: $collectionMetadataDraft) {
    id
    userSub
    name
    symbol
    description
    coverImageS3Key
    coverImageS3Url
    coverImageIpfsUrl
    coverImageIpfsHash
    bannerImageS3Key
    bannerImageS3Url
    bannerImageIpfsHash
    bannerImageIpfsUrl
    externalLink
    defaultRoyalties
    defaultRoyaltyRecipient
    metadataIpfsHash
    metadataIpfsUrl
    networkName
    status
  }
}

Variables

{"collectionMetadataDraft": CollectionMetadataDraftReqDTO}

Response

{
  "data": {
    "saveCollectionDraft": {
      "id": 123,
      "userSub": "xyz789",
      "name": "abc123",
      "symbol": "abc123",
      "description": "xyz789",
      "coverImageS3Key": "xyz789",
      "coverImageS3Url": "abc123",
      "coverImageIpfsUrl": "xyz789",
      "coverImageIpfsHash": "xyz789",
      "bannerImageS3Key": "xyz789",
      "bannerImageS3Url": "abc123",
      "bannerImageIpfsHash": "xyz789",
      "bannerImageIpfsUrl": "xyz789",
      "externalLink": "abc123",
      "defaultRoyalties": "xyz789",
      "defaultRoyaltyRecipient": "xyz789",
      "metadataIpfsHash": "xyz789",
      "metadataIpfsUrl": "xyz789",
      "networkName": "ropsten",
      "status": "PENDING_UPLOAD"
    }
  }
}

Mutations

saveDraft

Description

🔒 JWT Token

Save nft metadata as a draft. Does not create a token. You can edit the data.

Response

Returns a NftMetadataDraftResDTO!

Arguments

NameDescription

nftMetadataDraft - NftMetadataDraftReqDTO!

Example

Query

mutation SaveDraft($nftMetadataDraft: NftMetadataDraftReqDTO!) {
  saveDraft(nftMetadataDraft: $nftMetadataDraft) {
    id
    fileName
    title
    description
    artistId
    fileType
    networkName
    backgroundColor
    externalUrl
    youtubeUrl
    attributes {
      value
      traitType
      displayType
    }
  }
}

Variables

{"nftMetadataDraft": NftMetadataDraftReqDTO}

Response

{
  "data": {
    "saveDraft": {
      "id": 123.45,
      "fileName": "abc123",
      "title": "abc123",
      "description": "xyz789",
      "artistId": "abc123",
      "fileType": "IMAGE",
      "networkName": "ropsten",
      "backgroundColor": "xyz789",
      "externalUrl": "xyz789",
      "youtubeUrl": "xyz789",
      "attributes": [NftMetadataAttributeObject]
    }
  }
}

Mutations

updateCollectionDraft

Description

🔒 JWT Token

Updates collection metadata draft

Response

Returns a CollectionMetadataDto!

Arguments

NameDescription

collectionMetadataDraft -