Skip to content

Commit a0902fb

Browse files
authored
Merge pull request #48 from dimitrov-d/master
Update attributes field type
2 parents 169484d + 69d929d commit a0902fb

4 files changed

Lines changed: 27 additions & 19 deletions

File tree

packages/sdk/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,21 +291,21 @@ const uniqueCollection = await nft.createUnique({
291291
name: 'Unique NFT 1',
292292
description: 'Description for Unique NFT 1',
293293
image: 'https://example.com/nft1.png',
294-
attributes: {
294+
attributes: [{
295295
trait_type: 'color',
296296
value: 'red',
297297
display_type: 'string',
298-
},
298+
}],
299299
},
300300
'2': {
301301
name: 'Unique NFT 2',
302302
description: 'Description for Unique NFT 2',
303303
image: 'https://example.com/nft2.png',
304-
attributes: {
304+
attributes: [{
305305
trait_type: 'color',
306306
value: 'blue',
307307
display_type: 'string',
308-
},
308+
}],
309309
},
310310
},
311311
});

packages/sdk/src/tests/hosting.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,17 @@ describe('Hosting tests', () => {
2929
expect(website.uuid).toBeTruthy();
3030
});
3131

32-
test('upload website from folder', async () => {
32+
test.only('upload website from folder', async () => {
3333
const website = hosting.website(websiteUuid);
3434

3535
const uploadDir = resolve(__dirname, './helpers/website/');
3636
await website.uploadFromFolder(uploadDir, { ignoreFiles: false });
37-
const deployment = await website.deploy(DeployToEnvironment.TO_STAGING);
38-
expect(deployment.environment).toEqual(DeployToEnvironment.TO_STAGING);
37+
const deployment = await website.deploy(
38+
DeployToEnvironment.STAGING_TO_PRODUCTION,
39+
);
40+
expect(deployment.environment).toEqual(
41+
DeployToEnvironment.STAGING_TO_PRODUCTION,
42+
);
3943
deploymentUuid = deployment.uuid;
4044

4145
await website.get();

packages/sdk/src/tests/nft.test.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ describe('Nft tests', () => {
6767
expect(collection.isSoulbound).toEqual(false);
6868
});
6969

70-
test('creates a new unique collection', async () => {
70+
test.only('creates a new unique collection', async () => {
7171
const uniqueCollectionData = {
7272
...nftData,
7373
maxSupply: 1000,
@@ -78,21 +78,25 @@ describe('Nft tests', () => {
7878
name: 'Unique NFT 1',
7979
description: 'Description for Unique NFT 1',
8080
image: 'https://example.com/nft1.png',
81-
attributes: {
82-
value: 'Attribute Value 1',
83-
trait_type: 'Attribute Type 1',
84-
display_type: 'string',
85-
},
81+
attributes: [
82+
{
83+
value: 'Attribute Value 1',
84+
trait_type: 'Attribute Type 1',
85+
display_type: 'string',
86+
},
87+
],
8688
},
8789
'2': {
8890
name: 'Unique NFT 2',
8991
description: 'Description for Unique NFT 2',
9092
image: 'https://example.com/nft2.png',
91-
attributes: {
92-
value: 'Attribute Value 2',
93-
trait_type: 'Attribute Type 2',
94-
display_type: 'string',
95-
},
93+
attributes: [
94+
{
95+
value: 'Attribute Value 2',
96+
trait_type: 'Attribute Type 2',
97+
display_type: 'string',
98+
},
99+
],
96100
},
97101
},
98102
};

packages/sdk/src/types/nfts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export interface IMetadata {
111111
/**
112112
* Array of NFT attributes.
113113
*/
114-
attributes: IMetadataAttributes;
114+
attributes: IMetadataAttributes[];
115115
}
116116

117117
export interface ICreateUniqueCollection extends ICreateCollectionBase {

0 commit comments

Comments
 (0)