From f94d68c601d1fb073903be3f715f84104a7c8e50 Mon Sep 17 00:00:00 2001 From: Raul Duarte Pereira Date: Tue, 27 Feb 2024 17:56:29 -0300 Subject: [PATCH 1/2] CU-86drpn7yq - Enhance Ghostmarket Integration to return NFT Author --- packages/blockchain-service/src/interfaces.ts | 4 ++++ packages/bs-ethereum/src/GhostMarketNDSEthereum.ts | 6 +++++- .../src/__tests__/GhostMarketNDSEthereum.spec.ts | 4 ++++ packages/bs-neo3/src/GhostMarketNDSNeo3.ts | 6 +++++- packages/bs-neo3/src/__tests__/GhostMarketNDSNeo3.spec.ts | 5 +++++ 5 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/blockchain-service/src/interfaces.ts b/packages/blockchain-service/src/interfaces.ts index 31197b6..259fa29 100644 --- a/packages/blockchain-service/src/interfaces.ts +++ b/packages/blockchain-service/src/interfaces.ts @@ -154,6 +154,10 @@ export interface NftResponse { id: string contractHash: string collectionName?: string + creator: { + address: string + name?: string + } collectionImage?: string symbol: string image?: string diff --git a/packages/bs-ethereum/src/GhostMarketNDSEthereum.ts b/packages/bs-ethereum/src/GhostMarketNDSEthereum.ts index 7768175..c97f7fd 100644 --- a/packages/bs-ethereum/src/GhostMarketNDSEthereum.ts +++ b/packages/bs-ethereum/src/GhostMarketNDSEthereum.ts @@ -19,7 +19,7 @@ type GhostMarketNFT = { symbol: string } creator: { - address?: string + address: string offchainName?: string } apiUrl?: string @@ -114,6 +114,10 @@ export class GhostMarketNDSEthereum implements NftDataService { image: this.treatGhostMarketImage(data.metadata.mediaUri), isSVG: String(data.metadata.mediaType).includes('svg+xml'), name: data.metadata.name, + creator: { + address: data.creator.address, + name: data.creator.offchainName, + }, } return nftResponse diff --git a/packages/bs-ethereum/src/__tests__/GhostMarketNDSEthereum.spec.ts b/packages/bs-ethereum/src/__tests__/GhostMarketNDSEthereum.spec.ts index f5c9ba8..4b10ef2 100644 --- a/packages/bs-ethereum/src/__tests__/GhostMarketNDSEthereum.spec.ts +++ b/packages/bs-ethereum/src/__tests__/GhostMarketNDSEthereum.spec.ts @@ -23,6 +23,10 @@ describe('GhostMarketNDSEthereum', () => { image: expect.any(String), isSVG: expect.any(Boolean), name: 'MOAR #379', + creator: { + address: '0xd71ef31e9d4e8674d9177c28cc2d0d633580615b', + name: undefined, + }, }) ) }) diff --git a/packages/bs-neo3/src/GhostMarketNDSNeo3.ts b/packages/bs-neo3/src/GhostMarketNDSNeo3.ts index 551193d..fb7109a 100644 --- a/packages/bs-neo3/src/GhostMarketNDSNeo3.ts +++ b/packages/bs-neo3/src/GhostMarketNDSNeo3.ts @@ -19,7 +19,7 @@ type GhostMarketNFT = { symbol: string } creator: { - address?: string + address: string offchainName?: string } apiUrl?: string @@ -110,6 +110,10 @@ export class GhostMarketNDSNeo3 implements NftDataService { image: this.treatGhostMarketImage(data.metadata.mediaUri), isSVG: String(data.metadata.mediaType).includes('svg+xml'), name: data.metadata.name, + creator: { + address: data.creator.address, + name: data.creator.offchainName, + }, } return nftResponse diff --git a/packages/bs-neo3/src/__tests__/GhostMarketNDSNeo3.spec.ts b/packages/bs-neo3/src/__tests__/GhostMarketNDSNeo3.spec.ts index 1d58338..c1e835a 100644 --- a/packages/bs-neo3/src/__tests__/GhostMarketNDSNeo3.spec.ts +++ b/packages/bs-neo3/src/__tests__/GhostMarketNDSNeo3.spec.ts @@ -12,6 +12,7 @@ describe('GhostMarketNDSNeo3', () => { contractHash: '0xaa4fb927b3fe004e689a278d188689c9f050a8b2', tokenId: 'SVBLTUYxMTY1', }) + expect(nft).toEqual( expect.objectContaining({ id: 'SVBLTUYxMTY1', @@ -22,6 +23,10 @@ describe('GhostMarketNDSNeo3', () => { image: expect.any(String), isSVG: expect.any(Boolean), name: 'Pink Moon Fish', + creator: { + address: 'NQJpnvRaLvPqu8Mm5Bx3d1uJEttwJBN2p9', + name: undefined, + }, }) ) }) From 005ea14a1b5c44385a14f5caadc077535f5220c4 Mon Sep 17 00:00:00 2001 From: Raul Duarte Pereira Date: Tue, 27 Feb 2024 18:00:52 -0300 Subject: [PATCH 2/2] changes descriptions --- .../CU-86drpn7yq_2024-02-27-21-00.json | 10 ++++++++++ .../bs-ethereum/CU-86drpn7yq_2024-02-27-21-00.json | 10 ++++++++++ .../bs-neo3/CU-86drpn7yq_2024-02-27-21-00.json | 10 ++++++++++ 3 files changed, 30 insertions(+) create mode 100644 common/changes/@cityofzion/blockchain-service/CU-86drpn7yq_2024-02-27-21-00.json create mode 100644 common/changes/@cityofzion/bs-ethereum/CU-86drpn7yq_2024-02-27-21-00.json create mode 100644 common/changes/@cityofzion/bs-neo3/CU-86drpn7yq_2024-02-27-21-00.json diff --git a/common/changes/@cityofzion/blockchain-service/CU-86drpn7yq_2024-02-27-21-00.json b/common/changes/@cityofzion/blockchain-service/CU-86drpn7yq_2024-02-27-21-00.json new file mode 100644 index 0000000..1f3f650 --- /dev/null +++ b/common/changes/@cityofzion/blockchain-service/CU-86drpn7yq_2024-02-27-21-00.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@cityofzion/blockchain-service", + "comment": "Add creator infomations in nft methods return", + "type": "patch" + } + ], + "packageName": "@cityofzion/blockchain-service" +} \ No newline at end of file diff --git a/common/changes/@cityofzion/bs-ethereum/CU-86drpn7yq_2024-02-27-21-00.json b/common/changes/@cityofzion/bs-ethereum/CU-86drpn7yq_2024-02-27-21-00.json new file mode 100644 index 0000000..5d53033 --- /dev/null +++ b/common/changes/@cityofzion/bs-ethereum/CU-86drpn7yq_2024-02-27-21-00.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@cityofzion/bs-ethereum", + "comment": "Add creator infomations in nft methods return", + "type": "patch" + } + ], + "packageName": "@cityofzion/bs-ethereum" +} \ No newline at end of file diff --git a/common/changes/@cityofzion/bs-neo3/CU-86drpn7yq_2024-02-27-21-00.json b/common/changes/@cityofzion/bs-neo3/CU-86drpn7yq_2024-02-27-21-00.json new file mode 100644 index 0000000..f009c8e --- /dev/null +++ b/common/changes/@cityofzion/bs-neo3/CU-86drpn7yq_2024-02-27-21-00.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@cityofzion/bs-neo3", + "comment": "Add creator infomations in nft methods return", + "type": "patch" + } + ], + "packageName": "@cityofzion/bs-neo3" +} \ No newline at end of file