Niftory GraphQL API Reference

Launch your NFT experience. Learn more at niftory.com!

Contact

Niftory Engineering

support@niftory.com

API Endpoints
https://api.niftory.com/v1/graphql

Developer Documentation

Detailed API documentation is available at docs.niftory.com.

Queries

app

Description

Gets the App for the current application context. Read more here.

Response

Returns an App

Example

Query
query app {
  app {
    contract {
      ...ContractFragment
    }
    id
  }
}
Response
{"data": {"app": {"contract": Contract, "id": 4}}}

appById

Description

Gets an App by its ID. Read more here.

Response

Returns an App

Arguments
Name Description
id - ID The ID of the App to retrieve. If unspecified, then 'name' must be specified.
name - String The name of the App to retrieve. If unspecified, then 'id' must be specified.

Example

Query
query appById(
  $id: ID,
  $name: String
) {
  appById(
    id: $id,
    name: $name
  ) {
    contract {
      ...ContractFragment
    }
    id
  }
}
Variables
{"id": 4, "name": "xyz789"}
Response
{
  "data": {
    "appById": {
      "contract": Contract,
      "id": "4"
    }
  }
}

appUser

Description

Gets the currently logged-in AppUser context. Read more here.

Response

Returns an AppUser

Example

Query
query appUser {
  appUser {
    app {
      ...AppFragment
    }
    email
    id
    image
    name
    wallet {
      ...WalletFragment
    }
  }
}
Response
{
  "data": {
    "appUser": {
      "app": App,
      "email": "test@test.com",
      "id": 4,
      "image": "xyz789",
      "name": "abc123",
      "wallet": Wallet
    }
  }
}

appUserById

Description

Gets an AppUser by its ID. Read more here.

Response

Returns an AppUser

Arguments
Name Description
id - ID! The ID of the AppUser to retrieve.

Example

Query
query appUserById($id: ID!) {
  appUserById(id: $id) {
    app {
      ...AppFragment
    }
    email
    id
    image
    name
    wallet {
      ...WalletFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "appUserById": {
      "app": App,
      "email": "test@test.com",
      "id": 4,
      "image": "abc123",
      "name": "xyz789",
      "wallet": Wallet
    }
  }
}

contract

Description

Gets the Contract from the currently authenticated app. Read more here.

Response

Returns a Contract

Example

Query
query contract {
  contract {
    address
    blockchain
    id
    name
  }
}
Response
{
  "data": {
    "contract": {
      "address": "xyz789",
      "blockchain": "ETHEREUM",
      "id": "4",
      "name": "xyz789"
    }
  }
}

file

Description

Gets a File by its ID.

Response

Returns a SimpleFile

Arguments
Name Description
id - ID! The database ID of the NFTFile to retrieve.

Example

Query
query file($id: ID!) {
  file(id: $id) {
    contentType
    id
    md5
    name
    state
    url
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "file": {
      "contentType": "abc123",
      "id": 4,
      "md5": "abc123",
      "name": "abc123",
      "state": "ERROR",
      "url": "http://www.test.com/"
    }
  }
}

nft

Description

Gets an NFT by database ID. Read more here.

Response

Returns an NFT

Arguments
Name Description
id - ID! The database ID of the NFT to retrieve.

Example

Query
query nft($id: ID!) {
  nft(id: $id) {
    blockchainId
    id
    metadata
    model {
      ...NFTModelFragment
    }
    serialNumber
    status
    wallet {
      ...WalletFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "nft": {
      "blockchainId": "xyz789",
      "id": "4",
      "metadata": {},
      "model": NFTModel,
      "serialNumber": 987,
      "status": "AVAILABLE",
      "wallet": Wallet
    }
  }
}

nftListing

Description

Gets an NFTListing by ID.

Response

Returns an NFTListing

Arguments
Name Description
id - ID! The ID of the NFTListing to retrieve.

Example

Query
query nftListing($id: ID!) {
  nftListing(id: $id) {
    appId
    attributes
    description
    id
    nftModel {
      ...NFTModelFragment
    }
    pricing {
      ...FixedPricingFragment
    }
    state
    title
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "nftListing": {
      "appId": "4",
      "attributes": {},
      "description": "xyz789",
      "id": "4",
      "nftModel": NFTModel,
      "pricing": FixedPricing,
      "state": "ACTIVE",
      "title": "abc123"
    }
  }
}

nftListings

Description

Gets NFTListings for the current App context

Response

Returns an NFTListingList

Arguments
Name Description
cursor - String The pagination cursor returned by your last call to NFTListings
filter - NFTListingFilterInput Properties to filter NFTListings by.
maxResults - PositiveInt The maximum number of results to return. Defaults to 50, max is 100.

Example

Query
query nftListings(
  $cursor: String,
  $filter: NFTListingFilterInput,
  $maxResults: PositiveInt
) {
  nftListings(
    cursor: $cursor,
    filter: $filter,
    maxResults: $maxResults
  ) {
    cursor
    items {
      ...NFTListingFragment
    }
  }
}
Variables
{
  "cursor": "abc123",
  "filter": NFTListingFilterInput,
  "maxResults": 123
}
Response
{
  "data": {
    "nftListings": {
      "cursor": "abc123",
      "items": [NFTListing]
    }
  }
}

nftModel

Description

Gets an NFTModel by database ID. Read more here.

Response

Returns an NFTModel

Arguments
Name Description
id - ID! The database ID of the NFTModel to retrieve.

Example

Query
query nftModel($id: ID!) {
  nftModel(id: $id) {
    attributes
    blockchainId
    content {
      ...NFTContentFragment
    }
    description
    id
    metadata
    nfts {
      ...NFTFragment
    }
    quantity
    rarity
    set {
      ...NFTSetFragment
    }
    status
    title
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "nftModel": {
      "attributes": {},
      "blockchainId": "xyz789",
      "content": NFTContent,
      "description": "abc123",
      "id": 4,
      "metadata": {},
      "nfts": [NFT],
      "quantity": 123,
      "rarity": "COMMON",
      "set": NFTSet,
      "status": "DONE",
      "title": "abc123"
    }
  }
}

nftModels

Description

Gets NFTModels for the current App context. Read more here.

Response

Returns an NFTModelList

Arguments
Name Description
appId - ID The ID of the client app.
cursor - String The pagination cursor returned by your last call to nftModels
filter - NFTModelFilterInput Properties to filter NFTModel's by.
maxResults - PositiveInt The maximum number of results to return. Defaults to 50, max is 100.

Example

Query
query nftModels(
  $appId: ID,
  $cursor: String,
  $filter: NFTModelFilterInput,
  $maxResults: PositiveInt
) {
  nftModels(
    appId: $appId,
    cursor: $cursor,
    filter: $filter,
    maxResults: $maxResults
  ) {
    cursor
    items {
      ...NFTModelFragment
    }
  }
}
Variables
{
  "appId": "4",
  "cursor": "xyz789",
  "filter": NFTModelFilterInput,
  "maxResults": 123
}
Response
{
  "data": {
    "nftModels": {
      "cursor": "xyz789",
      "items": [NFTModel]
    }
  }
}

nfts

Description

Gets NFTs associated with the current AppUser context, including those that are transferring or failed to transfer. Read more here.

Response

Returns an NFTList

Arguments
Name Description
appId - ID The ID of the client app.
cursor - String The pagination cursor returned by your last call to nfts
filter - NFTFilterInput Properties to filter NFT's by.
maxResults - PositiveInt The maximum number of results to return. Defaults to 50, max is 100.
userId - ID The ID of the AppUser to filter by. Can only be the currently logged in user without privileged token.

Example

Query
query nfts(
  $appId: ID,
  $cursor: String,
  $filter: NFTFilterInput,
  $maxResults: PositiveInt,
  $userId: ID
) {
  nfts(
    appId: $appId,
    cursor: $cursor,
    filter: $filter,
    maxResults: $maxResults,
    userId: $userId
  ) {
    cursor
    items {
      ...NFTFragment
    }
  }
}
Variables
{
  "appId": "4",
  "cursor": "xyz789",
  "filter": NFTFilterInput,
  "maxResults": 123,
  "userId": "4"
}
Response
{
  "data": {
    "nfts": {
      "cursor": "xyz789",
      "items": [NFT]
    }
  }
}

nftsByWallet

Description

Gets NFTs associated with the current wallet, including those that are transferring or failed to transfer. Read more here.

Response

Returns an NFTList

Arguments
Name Description
address - String The address of the Wallet to filter by. This query requires the ID or the Wallet Address.
appId - ID The ID of the client app.
cursor - String The pagination cursor returned by your last call to nfts
filter - NFTFilterInput Properties to filter NFT's by.
maxResults - PositiveInt The maximum number of results to return. Defaults to 50, max is 100.
walletId - ID The database ID of the Wallet to filter by. This query requires the ID or the Wallet Address.

Example

Query
query nftsByWallet(
  $address: String,
  $appId: ID,
  $cursor: String,
  $filter: NFTFilterInput,
  $maxResults: PositiveInt,
  $walletId: ID
) {
  nftsByWallet(
    address: $address,
    appId: $appId,
    cursor: $cursor,
    filter: $filter,
    maxResults: $maxResults,
    walletId: $walletId
  ) {
    cursor
    items {
      ...NFTFragment
    }
  }
}
Variables
{
  "address": "xyz789",
  "appId": 4,
  "cursor": "abc123",
  "filter": NFTFilterInput,
  "maxResults": 123,
  "walletId": "4"
}
Response
{
  "data": {
    "nftsByWallet": {
      "cursor": "xyz789",
      "items": [NFT]
    }
  }
}

set

Description

Gets an NFTSet by database ID.

Response

Returns an NFTSet

Arguments
Name Description
id - ID! The database ID of the NFTSet to retrieve.

Example

Query
query set($id: ID!) {
  set(id: $id) {
    app {
      ...AppFragment
    }
    attributes
    blockchainId
    id
    image
    metadata
    models {
      ...NFTModelFragment
    }
    status
    title
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "set": {
      "app": App,
      "attributes": {},
      "blockchainId": "abc123",
      "id": 4,
      "image": "http://www.test.com/",
      "metadata": {},
      "models": [NFTModel],
      "status": "DONE",
      "title": "xyz789"
    }
  }
}

sets

Description

Gets NFTSets for the current App context.

Response

Returns [NFTSet]

Arguments
Name Description
filter - NFTSetFilterInput Properties to filter NFTSets by.

Example

Query
query sets($filter: NFTSetFilterInput) {
  sets(filter: $filter) {
    app {
      ...AppFragment
    }
    attributes
    blockchainId
    id
    image
    metadata
    models {
      ...NFTModelFragment
    }
    status
    title
  }
}
Variables
{"filter": NFTSetFilterInput}
Response
{
  "data": {
    "sets": [
      {
        "app": App,
        "attributes": {},
        "blockchainId": "abc123",
        "id": "4",
        "image": "http://www.test.com/",
        "metadata": {},
        "models": [NFTModel],
        "status": "DONE",
        "title": "xyz789"
      }
    ]
  }
}

wallet

Description

Gets the Wallet belonging to the current AppUser context. Read more here.

Response

Returns a Wallet

Example

Query
query wallet {
  wallet {
    address
    attributes
    id
    nfts {
      ...NFTFragment
    }
    state
    verificationCode
  }
}
Response
{
  "data": {
    "wallet": {
      "address": "xyz789",
      "attributes": {},
      "id": 4,
      "nfts": [NFT],
      "state": "CREATION_FAILED",
      "verificationCode": "abc123"
    }
  }
}

walletByAddress

Description

Gets a Wallet by its blockchain address. Wallet must be registered using registerWallet before this request succeeds. Read more here.

Response

Returns a Wallet

Arguments
Name Description
address - String! The address of the Wallet to retrieve.

Example

Query
query walletByAddress($address: String!) {
  walletByAddress(address: $address) {
    address
    attributes
    id
    nfts {
      ...NFTFragment
    }
    state
    verificationCode
  }
}
Variables
{"address": "xyz789"}
Response
{
  "data": {
    "walletByAddress": {
      "address": "abc123",
      "attributes": {},
      "id": 4,
      "nfts": [NFT],
      "state": "CREATION_FAILED",
      "verificationCode": "xyz789"
    }
  }
}

walletById

Description

Gets a Wallet by its database ID. Read more here.

Response

Returns a Wallet

Arguments
Name Description
id - ID! The ID of the Wallet to retrieve.

Example

Query
query walletById($id: ID!) {
  walletById(id: $id) {
    address
    attributes
    id
    nfts {
      ...NFTFragment
    }
    state
    verificationCode
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "walletById": {
      "address": "xyz789",
      "attributes": {},
      "id": "4",
      "nfts": [NFT],
      "state": "CREATION_FAILED",
      "verificationCode": "xyz789"
    }
  }
}

walletByUserId

Description

Gets a Wallet for a given AppUser. Read more here.

Response

Returns a Wallet

Arguments
Name Description
userId - ID! The ID of the AppUser to retrieve the wallet for.

Example

Query
query walletByUserId($userId: ID!) {
  walletByUserId(userId: $userId) {
    address
    attributes
    id
    nfts {
      ...NFTFragment
    }
    state
    verificationCode
  }
}
Variables
{"userId": "4"}
Response
{
  "data": {
    "walletByUserId": {
      "address": "abc123",
      "attributes": {},
      "id": 4,
      "nfts": [NFT],
      "state": "CREATION_FAILED",
      "verificationCode": "abc123"
    }
  }
}

wallets

Description

Gets all Wallets for a given app. Read more here.

Response

Returns a WalletList

Arguments
Name Description
appId - ID! The ID of the AppUser to retrieve the wallet for.
cursor - String The pagination cursor returned by your last call to nftModels
maxResults - PositiveInt The maximum number of results to return. Defaults to 50, max is 100.

Example

Query
query wallets(
  $appId: ID!,
  $cursor: String,
  $maxResults: PositiveInt
) {
  wallets(
    appId: $appId,
    cursor: $cursor,
    maxResults: $maxResults
  ) {
    cursor
    items {
      ...WalletFragment
    }
  }
}
Variables
{
  "appId": "4",
  "cursor": "abc123",
  "maxResults": 123
}
Response
{
  "data": {
    "wallets": {
      "cursor": "xyz789",
      "items": [Wallet]
    }
  }
}

Mutations

createFileUploadUrl

Description

Generates a pre-signed URL that can then be used to upload a file. Once the file has been uploaded to the URL, it will automatically be uploaded to IPFS (if desired). Use the returned File.state to track the upload.

Response

Returns a File

Arguments
Name Description
description - String Description about the file. If specified, and uploadToIpfs=true, this description will be added to the IPFS file metadata.
name - String! A friendly name for the file.
options - CreateFileOptionsInput! File upload options, such as whether to upload to IPFS.

Example

Query
mutation createFileUploadUrl(
  $description: String,
  $name: String!,
  $options: CreateFileOptionsInput!
) {
  createFileUploadUrl(
    description: $description,
    name: $name,
    options: $options
  ) {
    contentType
    id
    md5
    name
    state
    url
  }
}
Variables
{
  "description": "xyz789",
  "name": "xyz789",
  "options": CreateFileOptionsInput
}
Response
{
  "data": {
    "createFileUploadUrl": {
      "contentType": "abc123",
      "id": 4,
      "md5": "xyz789",
      "name": "xyz789",
      "state": "ERROR",
      "url": "http://www.test.com/"
    }
  }
}

createNFTModel

Description

Creates a new NFTModel.

Response

Returns an NFTModel

Arguments
Name Description
data - NFTModelCreateInput! The data to create the NFTModel.
setId - ID! The ID of the NFTSet that this model should belong to. This can be created using createNFTSet or retrieved using This can be created using sets.

Example

Query
mutation createNFTModel(
  $data: NFTModelCreateInput!,
  $setId: ID!
) {
  createNFTModel(
    data: $data,
    setId: $setId
  ) {
    attributes
    blockchainId
    content {
      ...NFTContentFragment
    }
    description
    id
    metadata
    nfts {
      ...NFTFragment
    }
    quantity
    rarity
    set {
      ...NFTSetFragment
    }
    status
    title
  }
}
Variables
{"data": NFTModelCreateInput, "setId": 4}
Response
{
  "data": {
    "createNFTModel": {
      "attributes": {},
      "blockchainId": "abc123",
      "content": NFTContent,
      "description": "xyz789",
      "id": 4,
      "metadata": {},
      "nfts": [NFT],
      "quantity": 123,
      "rarity": "COMMON",
      "set": NFTSet,
      "status": "DONE",
      "title": "abc123"
    }
  }
}

createNFTSet

Description

Creates a new NFTSet.

Response

Returns an NFTSet

Arguments
Name Description
data - NFTSetCreateInput! The input data for the NFTSet.

Example

Query
mutation createNFTSet($data: NFTSetCreateInput!) {
  createNFTSet(data: $data) {
    app {
      ...AppFragment
    }
    attributes
    blockchainId
    id
    image
    metadata
    models {
      ...NFTModelFragment
    }
    status
    title
  }
}
Variables
{"data": NFTSetCreateInput}
Response
{
  "data": {
    "createNFTSet": {
      "app": App,
      "attributes": {},
      "blockchainId": "xyz789",
      "id": 4,
      "image": "http://www.test.com/",
      "metadata": {},
      "models": [NFTModel],
      "status": "DONE",
      "title": "abc123"
    }
  }
}

createNiftoryWallet

Description

Provisions a custodial Niftory Wallet and, if specified, associates it with the given AppUser. Note: The call fails if the user already has a wallet.

Response

Returns a Wallet

Arguments
Name Description
userId - ID The ID of the AppUser to associate with the created Wallet. If unspecified, the caller is responsible for mapping the Wallet to their user.

Example

Query
mutation createNiftoryWallet($userId: ID) {
  createNiftoryWallet(userId: $userId) {
    address
    attributes
    id
    nfts {
      ...NFTFragment
    }
    state
    verificationCode
  }
}
Variables
{"userId": "4"}
Response
{
  "data": {
    "createNiftoryWallet": {
      "address": "xyz789",
      "attributes": {},
      "id": 4,
      "nfts": [NFT],
      "state": "CREATION_FAILED",
      "verificationCode": "xyz789"
    }
  }
}

readyWallet

Description

Marks a Wallet as ready, indicating that the wallet is ready to receive NFTs from the app's Contract. The wallet must be verified before this succeeds. Read more here.

Response

Returns a Wallet

Arguments
Name Description
address - String! The address of the wallet.

Example

Query
mutation readyWallet($address: String!) {
  readyWallet(address: $address) {
    address
    attributes
    id
    nfts {
      ...NFTFragment
    }
    state
    verificationCode
  }
}
Variables
{"address": "abc123"}
Response
{
  "data": {
    "readyWallet": {
      "address": "xyz789",
      "attributes": {},
      "id": 4,
      "nfts": [NFT],
      "state": "CREATION_FAILED",
      "verificationCode": "xyz789"
    }
  }
}

registerWallet

Description

Registers a Wallet to the currently signed-in user. Read more here.

Response

Returns a Wallet

Arguments
Name Description
address - String! The address of the wallet.

Example

Query
mutation registerWallet($address: String!) {
  registerWallet(address: $address) {
    address
    attributes
    id
    nfts {
      ...NFTFragment
    }
    state
    verificationCode
  }
}
Variables
{"address": "xyz789"}
Response
{
  "data": {
    "registerWallet": {
      "address": "xyz789",
      "attributes": {},
      "id": "4",
      "nfts": [NFT],
      "state": "CREATION_FAILED",
      "verificationCode": "xyz789"
    }
  }
}

transfer

Description

Initiates the transfer of an NFT to the currently-logged in AppUser. The NFT is reserved for the user in database, and you can use the NFT.status field to check on the transfer progress.

Response

Returns an NFT

Arguments
Name Description
address - String The address of the Wallet to filter by. This mutation requires the userId, walletId' or the wallet address` to be specified.
id - ID The ID of the NFT to send.
nftModelId - ID Used if NFT ID is unspecified to randomly select an NFT from the NFTModel
userId - ID The ID of the AppUser to send the NFT to. This mutation requires the userId, walletId' or the wallet address` to be specified.
walletId - ID The database ID of the Wallet to filter by. This mutation requires the userId, walletId' or the wallet address` to be specified.

Example

Query
mutation transfer(
  $address: String,
  $id: ID,
  $nftModelId: ID,
  $userId: ID,
  $walletId: ID
) {
  transfer(
    address: $address,
    id: $id,
    nftModelId: $nftModelId,
    userId: $userId,
    walletId: $walletId
  ) {
    blockchainId
    id
    metadata
    model {
      ...NFTModelFragment
    }
    serialNumber
    status
    wallet {
      ...WalletFragment
    }
  }
}
Variables
{
  "address": "xyz789",
  "id": "4",
  "nftModelId": "4",
  "userId": 4,
  "walletId": 4
}
Response
{
  "data": {
    "transfer": {
      "blockchainId": "abc123",
      "id": 4,
      "metadata": {},
      "model": NFTModel,
      "serialNumber": 123,
      "status": "AVAILABLE",
      "wallet": Wallet
    }
  }
}

updateNFTModel

Description

Updates an existing NFTModel. Note that if this NFTModel has already been used to mint an NFT, the update operation will fail for any properties that affect the blockchain (such as 'quantity', 'title', 'metadata', etc.), whereas updating 'attributes' will succeed.

Response

Returns an NFTModel

Arguments
Name Description
data - NFTModelUpdateInput! The data to update the NFTModel.
id - ID! The ID of the NFT model to update.

Example

Query
mutation updateNFTModel(
  $data: NFTModelUpdateInput!,
  $id: ID!
) {
  updateNFTModel(
    data: $data,
    id: $id
  ) {
    attributes
    blockchainId
    content {
      ...NFTContentFragment
    }
    description
    id
    metadata
    nfts {
      ...NFTFragment
    }
    quantity
    rarity
    set {
      ...NFTSetFragment
    }
    status
    title
  }
}
Variables
{"data": NFTModelUpdateInput, "id": 4}
Response
{
  "data": {
    "updateNFTModel": {
      "attributes": {},
      "blockchainId": "abc123",
      "content": NFTContent,
      "description": "abc123",
      "id": "4",
      "metadata": {},
      "nfts": [NFT],
      "quantity": 123,
      "rarity": "COMMON",
      "set": NFTSet,
      "status": "DONE",
      "title": "xyz789"
    }
  }
}

updateNFTSet

Description

Updates an existing NFTSet.

Response

Returns an NFTSet

Arguments
Name Description
data - NFTSetUpdateInput! The input data for the NFTSet.
id - ID! The ID of the NFTSet to update.

Example

Query
mutation updateNFTSet(
  $data: NFTSetUpdateInput!,
  $id: ID!
) {
  updateNFTSet(
    data: $data,
    id: $id
  ) {
    app {
      ...AppFragment
    }
    attributes
    blockchainId
    id
    image
    metadata
    models {
      ...NFTModelFragment
    }
    status
    title
  }
}
Variables
{"data": NFTSetUpdateInput, "id": 4}
Response
{
  "data": {
    "updateNFTSet": {
      "app": App,
      "attributes": {},
      "blockchainId": "abc123",
      "id": 4,
      "image": "http://www.test.com/",
      "metadata": {},
      "models": [NFTModel],
      "status": "DONE",
      "title": "abc123"
    }
  }
}

uploadNFTContent

Description

Creates an NFTContent object containing pre-signed URLs that can then be used to upload a file and poster. The primary file will automatically be uploaded to IPFS once it's been uploaded to the pre-signed URL. Each returned File has a 'state' property to track the upload.

Response

Returns an NFTContent

Arguments
Name Description
description - String Description about the file. If specified, this description will be added to the IPFS file metadata.
name - String A friendly name for the file.

Example

Query
mutation uploadNFTContent(
  $description: String,
  $name: String
) {
  uploadNFTContent(
    description: $description,
    name: $name
  ) {
    files {
      ...NFTFileFragment
    }
    id
    poster {
      ...SimpleFileFragment
    }
  }
}
Variables
{
  "description": "abc123",
  "name": "abc123"
}
Response
{
  "data": {
    "uploadNFTContent": {
      "files": [NFTFile],
      "id": 4,
      "poster": SimpleFile
    }
  }
}

verifyWallet

Description

Verifies a Wallet to the currently signed-in user. If the signed verification code fails to decode with the wallet's public key or doesn't match the wallet's verification code, the request will fail. Read more here.

Response

Returns a Wallet

Arguments
Name Description
address - String! The address of the wallet.
signedVerificationCode - JSON! The verification code of the wallet signed by the wallet's private key.

Example

Query
mutation verifyWallet(
  $address: String!,
  $signedVerificationCode: JSON!
) {
  verifyWallet(
    address: $address,
    signedVerificationCode: $signedVerificationCode
  ) {
    address
    attributes
    id
    nfts {
      ...NFTFragment
    }
    state
    verificationCode
  }
}
Variables
{
  "address": "abc123",
  "signedVerificationCode": {}
}
Response
{
  "data": {
    "verifyWallet": {
      "address": "abc123",
      "attributes": {},
      "id": 4,
      "nfts": [NFT],
      "state": "CREATION_FAILED",
      "verificationCode": "abc123"
    }
  }
}

Types

App

Description

An application in the Niftory ecosystem. Read more here.

Fields
Field Name Description
contract - Contract The contract associated with this app.
id - ID! A unique identifier for this object in the Niftory API.
Example
{"contract": Contract, "id": 4}

AppUser

Description

Represents a user of a particular Niftory App. Read more here.

Fields
Field Name Description
app - App The app this user is scoped to.
email - EmailAddress This user's email.
id - ID! A unique identifier for this object in the Niftory API.
image - String The URL for this user's image.
name - String The user's full name.
wallet - Wallet The wallet owned by this user.
Example
{
  "app": App,
  "email": "test@test.com",
  "id": "4",
  "image": "abc123",
  "name": "abc123",
  "wallet": Wallet
}

Attributable

Description

An interface representing objects that have attributes property for non-blockchain property storage.

Fields
Field Name Description
attributes - JSON A mapping of attributes for this object. These will be stored in the Niftory API but will not be added to the blockchain.
Possible Types
Attributable Types

NFTListing

NFTModel

NFTSet

Wallet

Example
{"attributes": {}}

Blockchain

Description

The blockchains supported by Niftory.

Values
Enum Value Description

ETHEREUM

The Ethereum blockchain. https://ethereum.org/en/

FLOW

The Flow blockchain. https://www.onflow.org/

POLYGON

The Polygon blockchain. https://polygon.technology/
Example
"ETHEREUM"

BlockchainEntity

Description

An interface representing properties common to all objects that exist on the blockchain

Fields
Field Name Description
blockchainId - String The ID of this resource on the blockchain.
metadata - JSON A mapping of properties that will be added to the blockchain.
Possible Types
BlockchainEntity Types

NFT

NFTModel

NFTSet

Example
{"blockchainId": "xyz789", "metadata": {}}

BlockchainResource

Description

An interface representing properties common to all objects that exist on the blockchain

Fields
Field Name Description
attributes - JSON A mapping of attributes for this object. These will be stored in the Niftory API but will not be added to the blockchain.
blockchainId - String The ID of this resource on the blockchain.
id - ID! A unique identifier for this object in the Niftory API.
metadata - JSON A mapping of properties that will be added to the blockchain.
status - Status The status of this resource. Can be used to track progress in designing and creating resources.
Possible Types
BlockchainResource Types

NFTModel

NFTSet

Example
{
  "attributes": {},
  "blockchainId": "xyz789",
  "id": 4,
  "metadata": {},
  "status": "DONE"
}

Boolean

Description

The Boolean scalar type represents true or false.

Contract

Description

A smart contract on the blockchain. Read more here.

Fields
Field Name Description
address - String The address at which this contract is deployed.
blockchain - Blockchain The blockchain in which this contract is deployed.
id - ID! A unique identifier for this object in the Niftory API.
name - String The name of this contract.
Example
{
  "address": "xyz789",
  "blockchain": "ETHEREUM",
  "id": 4,
  "name": "xyz789"
}

CreateFileOptionsInput

Fields
Input Field Description
posterFileId - ID

Required if the file to be uploaded is a video, and uploadToIPFS=true. In that case a poster must have already been uploaded (so it can be used as the image on IPFS).

uploadToIPFS - Boolean

Whether to asynchronously trigger an IPFS upload after the file has been uploaded to the returned cloud storage URL.

Example
{"posterFileId": "4", "uploadToIPFS": true}

Currency

Description

A currency that can be accepted for payment.

Values
Enum Value Description

USD

The United States dollar.
Example
"USD"

EmailAddress

Description

A field whose value conforms to the standard internet email address format as specified in RFC822: https://www.w3.org/Protocols/rfc822/.

Example
"test@test.com"

File

Description

An interface containing common data about files.

Fields
Field Name Description
contentType - String The MIME content type for this file.
id - ID! A unique identifier for this file in the Niftory API.
md5 - String The MD5 hash of this file.
name - String! A friendly name for the file.
state - FileState! The upload state of the file.
url - URL! The cloud storage URL for this file. If state is GENERATED_UPLOAD_URL, then this url is the presigned URL to upload to.
Possible Types
File Types

NFTFile

SimpleFile

Example
{
  "contentType": "xyz789",
  "id": 4,
  "md5": "xyz789",
  "name": "xyz789",
  "state": "ERROR",
  "url": "http://www.test.com/"
}

FileState

Description

The upload state of a File.

Values
Enum Value Description

ERROR

The file failed to ready.

GENERATED_UPLOAD_URL

Niftory has created a pre-signed URL where the file can be uploaded.

PENDING

Niftory has created a file entry in the database table.

READY

The file is ready for use.

UPLOADED_TO_CLOUD_STORAGE

The file has been uploaded to a cloud storage for fast retrieval.

UPLOADED_TO_IPFS

The file (and potentially its corresponding metadata) have been uploaded to IPFS.
Example
"ERROR"

FixedPricing

Description

A simple pricing strategy for listings with fixed prices.

Fields
Field Name Description
currency - Currency! The currency at which this price is set.
price - PositiveFloat! The price in the specified currency at which this item is for sale.
Example
{"currency": "USD", "price": 123.45}

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
4

Identifiable

Description

An interface representing objects with unique IDs

Fields
Field Name Description
id - ID! A unique identifier for this object in the Niftory API.
Possible Types
Identifiable Types

App

AppUser

Contract

NFT

NFTContent

NFTListing

NFTModel

NFTSet

Wallet

Example
{"id": "4"}

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
123

JSON

Description

The JSON scalar type represents JSON values as specified by ECMA-404.

Example
{}

ListingState

Description

The state of a listing.

Values
Enum Value Description

ACTIVE

The listing is active and available for sale.

INACTIVE

The listing is inactive, so it's not open for sale.

SOLD

All NFTs in this listing have been sold.
Example
"ACTIVE"

NFT

Description

Respresentation of a non-fungible token in the Niftory ecosystem (it doesn't have to be minted on the blockchain yet). Read more here.

Fields
Field Name Description
blockchainId - String The ID of this resource on the blockchain.
id - ID! A unique identifier for this object in the Niftory API.
metadata - JSON A mapping of properties that will be added to the blockchain.
model - NFTModel The model from which this NFT was created.
serialNumber - Int The serial number for this NFT within its model.
status - TransferState The status of this NFT (e.g. if it is available or being transferred to a user
wallet - Wallet The wallet containing this NFT, if it is owned by a user.
Example
{
  "blockchainId": "abc123",
  "id": "4",
  "metadata": {},
  "model": NFTModel,
  "serialNumber": 123,
  "status": "AVAILABLE",
  "wallet": Wallet
}

NFTContent

Description

The content for an NFT.

Fields
Field Name Description
files - [NFTFile] The file content in this NFT.
id - ID! A unique identifier for this object in the Niftory API.
poster - SimpleFile The poster file for this NFT's content
Example
{
  "files": [NFTFile],
  "id": 4,
  "poster": SimpleFile
}

NFTContentInput

Description

The input to create or update NFTContent.

Fields
Input Field Description
fileId - ID!

The ID of the NFTFile content. This can be created using createFileUploadUrl.

posterId - ID

The ID of the poster File. This can be created using createFileUploadUrl.

Example
{"fileId": 4, "posterId": "4"}

NFTFile

Description

File (with ipfsContentUrl and ipfsMetadataUrl). A file to be included in an NFT. Extends File to includes the IPFS addresses for the content and metadata.

Fields
Field Name Description
contentType - String The MIME content type for this file.
id - ID! A unique identifier for this file in the Niftory API.
ipfsContentAddress - String! The IPFS address for the content of this file.
ipfsMetadataAddress - String! The IPFS address for the metadata of this file.
md5 - String The MD5 hash of this file.
name - String! A friendly name for the file.
state - FileState! The upload state of the file.
url - URL! The cloud storage URL for this file. If state is GENERATED_UPLOAD_URL, then this url is the presigned URL to upload to.
Example
{
  "contentType": "xyz789",
  "id": 4,
  "ipfsContentAddress": "xyz789",
  "ipfsMetadataAddress": "xyz789",
  "md5": "xyz789",
  "name": "abc123",
  "state": "ERROR",
  "url": "http://www.test.com/"
}

NFTFilterInput

Description

Properties to filter NFTs by when querying them.

Fields
Input Field Description
blockchainIds - [String]

Blockchain IDs of the NFTs to find.

ids - [ID]

Database IDs of the NFTs to find.

nftModelIds - [ID]

The IDs of the NFTModel that the NFT should belong to.

transferStates - [TransferState]

Transfer states of the NFTs to find. Defaults to all.

Example
{
  "blockchainIds": ["xyz789"],
  "ids": [4],
  "nftModelIds": ["4"],
  "transferStates": ["AVAILABLE"]
}

NFTList

Description

A list of NFTs.

Fields
Field Name Description
cursor - String The cursor to use to fetch the next page of results, if any.
items - [NFT] The NFTs in this list.
Example
{
  "cursor": "abc123",
  "items": [NFT]
}

NFTListing

Description

A listing of NFTs for sale.

Fields
Field Name Description
appId - ID! The appId of the app this NFTListing belongs to.
attributes - JSON A mapping of attributes for this object. These will be stored in the Niftory API but will not be added to the blockchain.
description - String The description of the listing.
id - ID! A unique identifier for this object in the Niftory API.
nftModel - NFTModel! The NFT Model for this listing, NFTs from this model will be sold when a user checks out with this listing
pricing - FixedPricing! The pricing for this listing
state - ListingState! The state of this listing.
title - String The title of the listing.
Example
{
  "appId": "4",
  "attributes": {},
  "description": "xyz789",
  "id": 4,
  "nftModel": NFTModel,
  "pricing": FixedPricing,
  "state": "ACTIVE",
  "title": "abc123"
}

NFTListingFilterInput

Fields
Input Field Description
ids - [ID]

The IDs of the NFTListing.

state - ListingState

The ID of the NFTModel that the NFTListing should belong to.

title - String

The title of the NFTListing.

Example
{
  "ids": [4],
  "state": "ACTIVE",
  "title": "abc123"
}

NFTListingList

Description

A list of NFTListings.

Fields
Field Name Description
cursor - String The cursor to use to fetch the next page of results, if any.
items - [NFTListing] The NFTListings in this list.
Example
{
  "cursor": "abc123",
  "items": [NFTListing]
}

NFTModel

Description

The blueprint for an NFT, containing everything needed to mint one -- file content, blockchain metadata, etc. Read more here.

Fields
Field Name Description
attributes - JSON A mapping of attributes for this object. These will be stored in the Niftory API but will not be added to the blockchain.
blockchainId - String The ID of this resource on the blockchain.
content - NFTContent This NFT model's content.
description - String! The user-friendly description for this model.
id - ID! A unique identifier for this object in the Niftory API.
metadata - JSON A mapping of properties that will be added to the blockchain.
nfts - [NFT] The NFTs created using this model.
quantity - PositiveInt The total quantity of NFTs that will be available for this model.
rarity - SimpleRarityLevel The rarity of the NFTs in this model.
set - NFTSet! The NFT model set containing this model.
status - Status The status of this resource. Can be used to track progress in designing and creating resources.
title - String! The user-friendly title for this model.
Example
{
  "attributes": {},
  "blockchainId": "abc123",
  "content": NFTContent,
  "description": "abc123",
  "id": "4",
  "metadata": {},
  "nfts": [NFT],
  "quantity": 123,
  "rarity": "COMMON",
  "set": NFTSet,
  "status": "DONE",
  "title": "xyz789"
}

NFTModelCreateInput

Description

The input to create an NFTModel.

Fields
Input Field Description
attributes - JSON

A mapping of attributes for this resource. These will be stored in the Niftory API but will not be added to the blockchain.

content - NFTContentInput

The file content for this model. Either 'content' or 'contentId' must be specified.

contentId - ID

The ID of the NFTContent for this model. Either 'content' or 'contentId' must be specified.

description - String!

The user-friendly details about this model. This will be added to the blockchain metadata when an NFT is minted.

metadata - JSON

Metadata that will be added to the blockchain for any NFTs minted from this model.

quantity - PositiveInt

The total supply of NFTs that can be available for this model. This can be updated until the NFTModel is minted.

status - Status

The status of the model.

subtitle - String

The user-friendly subtitle for this model. This will be added to the blockchain metadata when an NFT is minted.

title - String!

The user-friendly title for this model. This will be added to the blockchain metadata when an NFT is minted.

Example
{
  "attributes": {},
  "content": NFTContentInput,
  "contentId": "4",
  "description": "abc123",
  "metadata": {},
  "quantity": 123,
  "status": "DONE",
  "subtitle": "xyz789",
  "title": "xyz789"
}

NFTModelFilterInput

Description

Properties to filter NFTModels when querying them.

Fields
Input Field Description
blockchainIds - [String]

Blockchain IDs of the NFTModels to find.

ids - [ID]

Database IDs of the NFTModels to find.

setIds - [ID]

The IDs of the NFTSets that the NFTModel should belong to.

status - Status

Filter by NFTModel status.

Example
{
  "blockchainIds": ["xyz789"],
  "ids": ["4"],
  "setIds": ["4"],
  "status": "DONE"
}

NFTModelList

Description

A list of NFTModels.

Fields
Field Name Description
cursor - String The cursor to use to fetch the next page of results, if any.
items - [NFTModel] The NFTModels in this list.
Example
{
  "cursor": "xyz789",
  "items": [NFTModel]
}

NFTModelUpdateInput

Description

The input to update an NFT model.

Fields
Input Field Description
attributes - JSON

A mapping of attributes for this resource. These will be stored in the Niftory API but will not be added to the blockchain.

content - NFTContentInput

The file content for this model. This can be updated until the NFTModel is minted.

contentId - ID

The ID of the NFTContent for this model.

description - String

The user-friendly details about this model. This will be added to the blockchain metadata when an NFT is minted.

metadata - JSON

Metadata that will be added to the blockchain for any NFTs minted from this model. This can be updated until the NFTModel is minted

quantity - PositiveInt

The total supply of NFTs that can be available for this model. This can be updated until the NFTModel is minted.

status - Status

The status of the model.

subtitle - String

The user-friendly subtitle for this model. This will be added to the blockchain metadata when an NFT is minted.

title - String

The user-friendly title for this model. This will be added to the blockchain metadata when an NFT is minted.

Example
{
  "attributes": {},
  "content": NFTContentInput,
  "contentId": 4,
  "description": "xyz789",
  "metadata": {},
  "quantity": 123,
  "status": "DONE",
  "subtitle": "xyz789",
  "title": "xyz789"
}

NFTSet

Description

A set of NFTModels, to help you organize your NFTs. Read more here.

Fields
Field Name Description
app - App The app this set belongs to.
attributes - JSON A mapping of attributes for this object. These will be stored in the Niftory API but will not be added to the blockchain.
blockchainId - String The ID of this resource on the blockchain.
id - ID! A unique identifier for this object in the Niftory API.
image - URL The image to represent this set.
metadata - JSON A mapping of properties that will be added to the blockchain.
models - [NFTModel] Models contained in this set.
status - Status The status of this resource. Can be used to track progress in designing and creating resources.
title - String! The display image for this set.
Example
{
  "app": App,
  "attributes": {},
  "blockchainId": "xyz789",
  "id": 4,
  "image": "http://www.test.com/",
  "metadata": {},
  "models": [NFTModel],
  "status": "DONE",
  "title": "xyz789"
}

NFTSetCreateInput

Description

The input to create an NFTSet.

Fields
Input Field Description
attributes - JSON

A mapping of attributes for this resource. These will be stored in the Niftory API but will not be added to the blockchain.

title - String!

The user-friendly title for this model.

Example
{"attributes": {}, "title": "abc123"}

NFTSetFilterInput

Fields
Input Field Description
blockchainIds - [String]

Blockchain IDs of the NFTSets to find.

ids - [ID]

Database IDs of the NFTSets to find.

title - String

The title of the NFTSet to find.

Example
{
  "blockchainIds": ["xyz789"],
  "ids": ["4"],
  "title": "abc123"
}

NFTSetUpdateInput

Description

The input to update an NFTSet.

Fields
Input Field Description
attributes - JSON

A mapping of attributes for this resource. These will be stored in the Niftory API but will not be added to the blockchain.

title - String

The user-friendly title for this set.

Example
{"attributes": {}, "title": "abc123"}

Pageable

Description

An interface representing lists that can be paginated with a cursor.

Fields
Field Name Description
cursor - String The cursor to use to fetch the next page of results, if any.
Possible Types
Pageable Types

NFTList

NFTListingList

NFTModelList

WalletList

Example
{"cursor": "abc123"}

PositiveFloat

Description

Floats that will have a value greater than 0.

Example
123.45

PositiveInt

Description

Integers that will have a value greater than 0.

Example
123

Resource

Description

An interface representing properties common to all user-managed resources in the Niftory API.

Fields
Field Name Description
attributes - JSON A mapping of attributes for this object. These will be stored in the Niftory API but will not be added to the blockchain.
id - ID! A unique identifier for this object in the Niftory API.
status - Status The status of this resource. Can be used to track progress in designing and creating resources.
Possible Types
Resource Types

NFTModel

NFTSet

Example
{
  "attributes": {},
  "id": "4",
  "status": "DONE"
}

SimpleFile

Description

A file uploaded to the Niftory API.

Fields
Field Name Description
contentType - String The MIME content type for this file.
id - ID! A unique identifier for this file in the Niftory API.
md5 - String The MD5 hash of this file.
name - String! A friendly name for the file.
state - FileState! The upload state of the file.
url - URL! The cloud storage URL for this file. If state is GENERATED_UPLOAD_URL, then this url is the presigned URL to upload to.
Example
{
  "contentType": "abc123",
  "id": 4,
  "md5": "abc123",
  "name": "xyz789",
  "state": "ERROR",
  "url": "http://www.test.com/"
}

SimpleRarityLevel

Description

The default rarity levels in the Niftory API.

Values
Enum Value Description

COMMON

The most common NFTs.

LEGENDARY

The rarest of the rare NFTs, for the most dedicated collectors.

RARE

These are rarer, harder to get and more expensive.
Example
"COMMON"

Status

Description

Status of this resource for user workflows.

Values
Enum Value Description

DONE

"Here you go!"

DRAFT

"I'm just getting started."

IN_PROGRESS

"I'm working on it!"

TO_DO

"I'll get to it eventually..."
Example
"DONE"

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"

TransferState

Description

The state of an item being transferred.

Values
Enum Value Description

AVAILABLE

The item has been created, but not transferred.

ERROR

The item failed to transfer.

IN_PROGRESS

The item is being transferred.

RESERVED

The item is reserved for a future transfer.

SUCCESS

The item has been transferred.
Example
"AVAILABLE"

URL

Description

A field whose value conforms to the standard URL format as specified in RFC3986: https://www.ietf.org/rfc/rfc3986.txt.

Example
"http://www.test.com/"

UserData

Description

An interface containing common data about users.

Fields
Field Name Description
email - EmailAddress This user's email.
image - String The URL for this user's image.
name - String The user's full name.
Possible Types
UserData Types

AppUser

Example
{
  "email": "test@test.com",
  "image": "xyz789",
  "name": "xyz789"
}

Wallet

Description

Represents a blockchain wallet scoped to a particular App and AppUser. Read more here.

Fields
Field Name Description
address - String! This wallet's address on the blockchain.
attributes - JSON A mapping of attributes for this object. These will be stored in the Niftory API but will not be added to the blockchain.
id - ID! A unique identifier for this object in the Niftory API.
nfts - [NFT] The NFTs from the current app that are in this wallet.
state - WalletState! The state of this wallet.
verificationCode - String The verification code that can be used to verify this wallet for this user.
Example
{
  "address": "abc123",
  "attributes": {},
  "id": 4,
  "nfts": [NFT],
  "state": "CREATION_FAILED",
  "verificationCode": "abc123"
}

WalletList

Description

A list of Wallets.

Fields
Field Name Description
cursor - String The cursor to use to fetch the next page of results, if any.
items - [Wallet] The Wallets in this list.
Example
{
  "cursor": "abc123",
  "items": [Wallet]
}

WalletState

Description

The state of a wallet.

Values
Enum Value Description

CREATION_FAILED

(Custodial Wallet Only) The Niftory custodial wallet failed to be created on the blockchain.

PENDING_CREATION

(Custodial Wallet Only) The Niftory custodial wallet is in the process of being created on-chain. The address and state of the Wallet object will be updated once complete.

READY

The wallet is ready to receive NFTs from this app's contract.

UNVERIFIED

The wallet has been registered with Niftory, but not yet verified to belong to the signed-in user.

VERIFIED

The wallet is verified to belong to the signed-in user, but not yet ready to receive NFTs from this app's contract.
Example
"CREATION_FAILED"