UNPKG

nmkr-studio-api

Version:

Typesafe API Client to work with the NMKR Studio V2 API

255 lines 10.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.NftService = void 0; class NftService { constructor(httpRequest) { this.httpRequest = httpRequest; } /** * Blocks/Unblocks an nft (nft uid) * You can block an nft, if it is not already sold or reserved and you can unblock blocked nfts * @returns any Returns the Nft Class * @throws ApiError */ getV2BlockUnblockNft({ nftuid, blockNft, }) { return this.httpRequest.request({ method: 'GET', url: '/v2/BlockUnblockNft/{nftuid}/{blockNft}', path: { 'nftuid': nftuid, 'blockNft': blockNft, }, errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The nft was not found`, 406: `Not Acceptable`, }, }); } /** * Checks if the metadata is valid * @returns ApiErrorResultClass Returns OK if the metadata are valid * @throws ApiError */ getV2CheckMetadata({ nftuid, }) { return this.httpRequest.request({ method: 'GET', url: '/v2/CheckMetadata/{nftuid}', path: { 'nftuid': nftuid, }, errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The NFT was not found`, 406: `See the errormessage in the resultset for further information`, 500: `Internal server error - see the errormessage in the resultset`, }, }); } /** * Checks if the metadata is valid * @returns ApiErrorResultClass Returns OK if the metadata are valid * @throws ApiError */ postV2CheckMetadata({ nftuid, requestBody, }) { return this.httpRequest.request({ method: 'POST', url: '/v2/CheckMetadata/{nftuid}', path: { 'nftuid': nftuid, }, body: requestBody, mediaType: 'application/json', errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The NFT was not found`, 406: `See the errormessage in the resultset for further information`, 500: `Internal server error - see the errormessage in the resultset`, }, }); } /** * Deletes all nfts from the database * This function deletes all NFTs from a project. You can delete a nft, if it is not in sold or reserved state. All other nfts will be deleted. * @returns DeleteAllNftsResultClass Returns the Nft Class * @throws ApiError */ getV2DeleteAllNftsFromProject({ projectuid, }) { return this.httpRequest.request({ method: 'GET', url: '/v2/DeleteAllNftsFromProject/{projectuid}', path: { 'projectuid': projectuid, }, errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The nft was not found`, 406: `Not Acceptable`, }, }); } /** * Deletes a nft from the database (nft uid) * You can delete a nft, if it is not in sold or reserved state * @returns any Returns the Nft Class * @throws ApiError */ getV2DeleteNft({ nftuid, }) { return this.httpRequest.request({ method: 'GET', url: '/v2/DeleteNft/{nftuid}', path: { 'nftuid': nftuid, }, errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The nft was not found`, 406: `Not Acceptable`, }, }); } /** * Duplicates a nft/token inside a project. If a token already exists, it will be skipped * @returns NftProjectsDetails Duplicate was successful. Returns the NtProjectDetails Class * @throws ApiError */ postV2DuplicateNft({ nftuid, requestBody, }) { return this.httpRequest.request({ method: 'POST', url: '/v2/DuplicateNft/{nftuid}', path: { 'nftuid': nftuid, }, body: requestBody, mediaType: 'application/json', errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The nft was not found`, 406: `The nft is not valid`, }, }); } /** * Returns detail information about one nft specified by Id (nft uid) * You will receive all information (fingerprint, ipfshash, etc.) about one nfts with the submitted id * @returns NftDetailsClass Returns the Nft Class * @throws ApiError */ getV2GetNftDetailsById({ nftuid, }) { return this.httpRequest.request({ method: 'GET', url: '/v2/GetNftDetailsById/{nftuid}', path: { 'nftuid': nftuid, }, errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The nft was not found`, }, }); } /** * Returns detail information about one nft specified by its name * You will receive all information (fingerprint, ipfshash, etc.) about one nft with the submitted name * @returns NftDetailsClass Returns the Nft Class * @throws ApiError */ getV2GetNftDetailsByTokenname({ projectuid, nftname, }) { return this.httpRequest.request({ method: 'GET', url: '/v2/GetNftDetailsByTokenname/{projectuid}/{nftname}', path: { 'projectuid': projectuid, 'nftname': nftname, }, errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The nft was not found`, }, }); } /** * Returns detail information about nfts with a specific state with Pagination support. (project uid) * You will receive all information (fingerprint, ipfshash, etc.) about the nfts within a specific state. * State "all" lists all available nft in this project. The other states are: "free", "reserved", "sold" and "error" * @returns NFT Returns a List of the NFT Class * @throws ApiError */ getV2GetNfts({ projectuid, state, count, page, orderby = 'id', }) { return this.httpRequest.request({ method: 'GET', url: '/v2/GetNfts/{projectuid}/{state}/{count}/{page}', path: { 'projectuid': projectuid, 'state': state, 'count': count, 'page': page, }, query: { 'orderby': orderby, }, errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `Not Found`, 406: `The projectuid was not found`, }, }); } /** * Updates the Metadata for one specific NFT * With this API you can update the Metadata Override for one specific NFT * If you leave the field blank, the Metadata override will be deleted and the Metadata from the project will be used. * @returns NftDetailsClass Returns the Nftdetails Class * @throws ApiError */ postV2UpdateMetadata({ projectuid, nftuid, requestBody, }) { return this.httpRequest.request({ method: 'POST', url: '/v2/UpdateMetadata/{projectuid}/{nftuid}', path: { 'projectuid': projectuid, 'nftuid': nftuid, }, body: requestBody, mediaType: 'application/json', errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `The NFT was not found`, 406: `See the errormessage in the resultset for further information`, 500: `Internal server error - see the errormessage in the resultset`, }, }); } /** * Upload a File to a project and pin it to IPFS * With this API you can upload a file to IPFS and add it to a project. You can upload the file as BASE64 Content or as URL Link or as IPFS Hash. * If you submit Metadata, this Metadata will be used instead of the Metadatatemplate from the project. You can either submit Metadata or MetadataPlaceholder, but not both (because it makes no sense). * The Metadata field is optional and if you dont use it, it will use the Template from your project. It is poosible to mix both versions in one project. You can have one nft with own metadata and other nfts * with the template. * @returns UploadNftResultClass Returns the UploadNftResult Class * @throws ApiError */ postV2UploadNft({ projectuid, uploadsource, requestBody, }) { return this.httpRequest.request({ method: 'POST', url: '/v2/UploadNft/{projectuid}', path: { 'projectuid': projectuid, }, query: { 'uploadsource': uploadsource, }, body: requestBody, mediaType: 'application/json', errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `No Image Content was provided. Send a file either as Base64 or as Link or IPFS Hash`, 406: `See the errormessage in the resultset for further information`, 409: `There is a conflict with the provided images. Send a file either as Base64 or as Link or IPFS Hash`, 500: `Internal server error - see the errormessage in the resultset`, }, }); } } exports.NftService = NftService; //# sourceMappingURL=NftService.js.map