diff --git a/schemas/common.json b/schemas/common.json index 700b8485..5fe1dd01 100644 --- a/schemas/common.json +++ b/schemas/common.json @@ -748,6 +748,44 @@ "pHeight": { "type": "integer", "description": "Preview/Image height" + }, + "nft": { + "type": "object", + "required": [ + "price", + "supply", + "image" + ], + "properties": { + "price": { + "type": "string" + }, + "supply": { + "type": "number" + }, + "image": { + "type": "string", + "format": "uri" + }, + "attributes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "title", + "url" + ], + "properties": { + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + } + } + } + } } } }, diff --git a/src/constant.js b/src/constant.js index b72a0401..e8b96d13 100644 --- a/src/constant.js +++ b/src/constant.js @@ -77,6 +77,7 @@ exports.FILES_ARPROPS_FIELD = 'ar3dviewProps'; exports.FILES_CREATION_INFO_FIELD = 'creationInfo'; exports.FILES_PLAYER_SETTINGS_FIELD = 'playerSettings'; exports.FILES_PLAYER_FRAMES_CYCLE_FIELD = 'cycle'; +exports.FILES_NFT_FIELD = 'nft'; exports.FIELDS_TO_STRINGIFY = [ exports.FILES_TAGS_FIELD, @@ -88,6 +89,7 @@ exports.FIELDS_TO_STRINGIFY = [ exports.FILES_CREATION_INFO_FIELD, exports.FILES_PLAYER_SETTINGS_FIELD, exports.FILES_PLAYER_FRAMES_CYCLE_FIELD, + exports.FILES_NFT_FIELD, ]; exports.CAPPASITY_3D_MODEL = 'model'; diff --git a/test/suites/update.js b/test/suites/update.js index 63a7fb88..8bc60528 100644 --- a/test/suites/update.js +++ b/test/suites/update.js @@ -456,6 +456,38 @@ describe('update suite', function suite() { }); }); + describe('update nft', function emptyDescription() { + it('update nft fields', async function test() { + const { uploadId } = this.response; + meta.nft = { + price: '1', + supply: 1, + image: 'http://website.com/image.jpeg', + attributes: [{ + title: 'test', + url: 'http://test.com', + }], + }; + + await this.send({ + uploadId, + username, + meta, + }, 45000); + + const fileInfo = await getInfo.call(this, { + filename: uploadId, + username, + }); + + assert.equal(fileInfo.file.nft.price, '1'); + assert.equal(fileInfo.file.nft.supply, 1); + assert.equal(fileInfo.file.nft.image, 'http://website.com/image.jpeg'); + assert.equal(fileInfo.file.nft.attributes[0].title, 'test'); + assert.equal(fileInfo.file.nft.attributes[0].url, 'http://test.com'); + }); + }); + describe('update background image', function afterUpdateSuite() { before('upload background image', function upload() { return initAndUpload(backgroundData, false).call(this)