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
balanceOf
Description
🔓 Public
Returns token balance of user
Response
Returns a String!
Arguments
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": "abc123",
"userId": "xyz789",
"network": "ropsten"
}
Response
{"data": {"balanceOf": "xyz789"}}
collection
collection
Description
🔓 Public
Returns single collection
Response
Returns a Collection
Arguments
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": "abc123",
"tokens": [Token],
"address": "xyz789",
"contractURI": "abc123",
"networkName": "ropsten",
"metadata": CollectionMetadataDto,
"createdAt": "abc123",
"updatedAt": "abc123"
}
}
}
collectionMetadata
collectionMetadata
Description
🔒 JWT Token
Retrieve collection metadata by id
Response
Returns a CollectionMetadataDto!
Arguments
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": "abc123",
"name": "xyz789",
"symbol": "abc123",
"description": "xyz789",
"coverImageS3Key": "xyz789",
"coverImageS3Url": "abc123",
"coverImageIpfsUrl": "xyz789",
"coverImageIpfsHash": "xyz789",
"bannerImageS3Key": "abc123",
"bannerImageS3Url": "abc123",
"bannerImageIpfsHash": "abc123",
"bannerImageIpfsUrl": "abc123",
"externalLink": "abc123",
"defaultRoyalties": "xyz789",
"defaultRoyaltyRecipient": "abc123",
"metadataIpfsHash": "xyz789",
"metadataIpfsUrl": "xyz789",
"networkName": "ropsten",
"status": "PENDING_UPLOAD"
}
}
}
collections
collections
Description
🔓 Public
Returns collections
Response
Returns [Collection!]!
Arguments
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": "xyz789",
"owner": "abc123",
"tokens": [Token],
"address": "abc123",
"contractURI": "xyz789",
"networkName": "ropsten",
"metadata": CollectionMetadataDto,
"createdAt": "abc123",
"updatedAt": "abc123"
}
]
}
}
currentPerson
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": "abc123",
"walletAddress": "xyz789",
"smartWalletAddress": "xyz789",
"username": "xyz789",
"avatarS3Key": "abc123",
"avatarUrl": "xyz789"
}
}
}
fees
fees
Description
🔓 Public
Returns market fees
Response
Returns a Fees!
Arguments
Example
Query
query Fees($network: NetworkName!) {
fees(network: $network) {
mintingFee
sellingFee
}
}
Variables
{"network": "ropsten"}
Response
{
"data": {
"fees": {
"mintingFee": "xyz789",
"sellingFee": "xyz789"
}
}
}
listCollectionMetadata
listCollectionMetadata
Description
🔒 JWT Token
Returns list of collection metadata
Response
Returns a CollectionMetadataListResDTO!
Arguments
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
}
}
}
listMetadata
listMetadata
Description
🔒 JWT Token
Returns list of NFT metadata
Response
Returns a NftMetadataListResDTO!
Arguments
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": 987.65
}
}
}
metadata
metadata
Description
🔒 JWT Token
Retrieve metadata by id
Response
Returns a NftMetadataDTO!
Arguments
Example
Query
query Metadata($id: Float!) {
metadata(id: $id) {
id
userSub
title
description
artistId
fileType
networkName
s3Key
s3CoverKey
ipfsNftUrl
ipfsCoverUrl
ipfsMetadataUrl
ipfsNftHash
ipfsCoverHash
licenceS3Key
ipfsLicenceHash
nftLicence {
revelatorTermsAndConditions
nftTitle
label
royaltyRate
personalUses {
...NftUseDTOFragment
}
commercialUses {
...NftUseDTOFragment
}
}
ipfsMetadataHash
status
backgroundColor
externalUrl
youtubeUrl
attributes {
value
traitType
displayType
}
ipfsNftPublicUrl
ipfsCoverPublicUrl
ipfsMetadataPublicUrl
ipfsLicencePublicUrl
}
}
Variables
{"id": 123.45}
Response
{
"data": {
"metadata": {
"id": 987,
"userSub": "abc123",
"title": "abc123",
"description": "abc123",
"artistId": "xyz789",
"fileType": "IMAGE",
"networkName": "ropsten",
"s3Key": "abc123",
"s3CoverKey": "xyz789",
"ipfsNftUrl": "xyz789",
"ipfsCoverUrl": "xyz789",
"ipfsMetadataUrl": "abc123",
"ipfsNftHash": "xyz789",
"ipfsCoverHash": "xyz789",
"licenceS3Key": "abc123",
"ipfsLicenceHash": "xyz789",
"nftLicence": NftLicenceDto,
"ipfsMetadataHash": "xyz789",
"status": "PENDING_UPLOAD",
"backgroundColor": "xyz789",
"externalUrl": "abc123",
"youtubeUrl": "xyz789",
"attributes": [NftMetadataAttributeObject],
"ipfsNftPublicUrl": "xyz789",
"ipfsCoverPublicUrl": "xyz789",
"ipfsMetadataPublicUrl": "abc123",
"ipfsLicencePublicUrl": "xyz789"
}
}
}
nftUses
nftUses
Description
🔒 JWT Token
Licensed nft buyer rights
Response
Returns a NftUsesDTO!
Example
Query
query NftUses {
nftUses {
list {
id
name
description
position
nftUseType
}
}
}
Response
{"data": {"nftUses": {"list": [NftUseDTO]}}}
person
person
Description
🔓 Public
Returns single person
Response
Returns a PersonDto
Arguments
Example
Query
query Person($identifier: PersonIdentifier!) {
person(identifier: $identifier) {
id
walletAddress
smartWalletAddress
username
avatarS3Key
avatarUrl
}
}
Variables
{"identifier": PersonIdentifier}
Response
{
"data": {
"person": {
"id": "abc123",
"walletAddress": "abc123",
"smartWalletAddress": "xyz789",
"username": "xyz789",
"avatarS3Key": "xyz789",
"avatarUrl": "abc123"
}
}
}
persons
persons
Description
🔓 Public
Returns persons
Response
Returns a Persons!
Arguments
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}
}
}
token
token
Description
🔓 Public
Returns single token
Response
Returns a Token
Arguments
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
licenceS3Key
ipfsLicenceHash
nftLicence {
...NftLicenceDtoFragment
}
ipfsMetadataHash
status
backgroundColor
externalUrl
youtubeUrl
attributes {
...NftMetadataAttributeObjectFragment
}
ipfsNftPublicUrl
ipfsCoverPublicUrl
ipfsMetadataPublicUrl
ipfsLicencePublicUrl
}
nftUrl
coverUrl
networkName
createdAt
updatedAt
}
}
Variables
{"network": "ropsten", "id": "xyz789"}
Response
{
"data": {
"token": {
"id": "xyz789",
"tokenId": "xyz789",
"collectionContract": Collection,
"minter": "xyz789",
"enterprise": CollectionEntity,
"artist": CollectionEntity,
"amount": "abc123",
"royaltyRecipient": "xyz789",
"royaltyNumerator": "abc123",
"owners": [TokenOwner],
"ownersWithMetadata": [OwnerWithMetadata],
"listing": Listing,
"purchases": [Purchase],
"tokenURI": "abc123",
"metadata": NftMetadataDTO,
"nftUrl": "xyz789",
"coverUrl": "abc123",
"networkName": "ropsten",
"createdAt": "abc123",
"updatedAt": "abc123"
}
}
}
tokens
tokens
Description
🔓 Public
Returns tokens
Response
Returns [Token!]!
Arguments
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
licenceS3Key
ipfsLicenceHash
nftLicence {
...NftLicenceDtoFragment
}
ipfsMetadataHash
status
backgroundColor
externalUrl
youtubeUrl
attributes {
...NftMetadataAttributeObjectFragment
}
ipfsNftPublicUrl
ipfsCoverPublicUrl
ipfsMetadataPublicUrl
ipfsLicencePublicUrl
}
nftUrl
coverUrl
networkName
createdAt
updatedAt
}
}
Variables
{"input": tokensInput}
Response
{
"data": {
"tokens": [
{
"id": "xyz789",
"tokenId": "abc123",
"collectionContract": Collection,
"minter": "abc123",
"enterprise": CollectionEntity,
"artist": CollectionEntity,
"amount": "xyz789",
"royaltyRecipient": "abc123",
"royaltyNumerator": "xyz789",
"owners": [TokenOwner],
"ownersWithMetadata": [OwnerWithMetadata],
"listing": Listing,
"purchases": [Purchase],
"tokenURI": "abc123",
"metadata": NftMetadataDTO,
"nftUrl": "xyz789",
"coverUrl": "abc123",
"networkName": "ropsten",
"createdAt": "abc123",
"updatedAt": "xyz789"
}
]
}
}
Mutations
createAvatarUrl
createAvatarUrl
Description
🔒 JWT Token
Creates Avatar URL
Response
Returns an AvatarLinkResDTO!
Arguments
Example
Query
mutation CreateAvatarUrl($avatarLink: AvatarLinkReqDTO!) {
createAvatarUrl(avatarLink: $avatarLink) {
avatarUploadUrl
}
}
Variables
{"avatarLink": AvatarLinkReqDTO}
Response
{
"data": {
"createAvatarUrl": {
"avatarUploadUrl": "xyz789"
}
}
}
createCollectionAssetsUploadUrl
createCollectionAssetsUploadUrl
Description
🔒 JWT Token
Creates Metadata URL
Response
Returns a CollectionMetadataLinkResDTO!
Arguments
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": "xyz789",
"bannerUploadUrl": "abc123"
}
}
}
createUrl
createUrl
Description
🔒 JWT Token
Creates Metadata URL
Response
Returns a NftMetadataLinkResDTO!
Arguments
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": "xyz789",
"coverUploadUrl": "xyz789"
}
}
}
saveCollectionDraft
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
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": 987,
"userSub": "xyz789",
"name": "abc123",
"symbol": "abc123",
"description": "abc123",
"coverImageS3Key": "xyz789",
"coverImageS3Url": "abc123",
"coverImageIpfsUrl": "abc123",
"coverImageIpfsHash": "xyz789",
"bannerImageS3Key": "abc123",
"bannerImageS3Url": "xyz789",
"bannerImageIpfsHash": "xyz789",
"bannerImageIpfsUrl": "xyz789",
"externalLink": "abc123",
"defaultRoyalties": "abc123",
"defaultRoyaltyRecipient": "xyz789",
"metadataIpfsHash": "xyz789",
"metadataIpfsUrl": "xyz789",
"networkName": "ropsten",
"status": "PENDING_UPLOAD"
}
}
}
saveDraft
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
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": 987.65,
"fileName": "abc123",
"title": "xyz789",
"description": "abc123",