Skip to content

Commit

Permalink
Merge pull request #38 from CityOfZion/CU-86drpn7yq
Browse files Browse the repository at this point in the history
CU-86drpn7yq - Enhance Ghostmarket Integration to return NFT Author
  • Loading branch information
melanke authored Feb 28, 2024
2 parents 119088f + 005ea14 commit 527bf4b
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cityofzion/blockchain-service",
"comment": "Add creator infomations in nft methods return",
"type": "patch"
}
],
"packageName": "@cityofzion/blockchain-service"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cityofzion/bs-ethereum",
"comment": "Add creator infomations in nft methods return",
"type": "patch"
}
],
"packageName": "@cityofzion/bs-ethereum"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cityofzion/bs-neo3",
"comment": "Add creator infomations in nft methods return",
"type": "patch"
}
],
"packageName": "@cityofzion/bs-neo3"
}
4 changes: 4 additions & 0 deletions packages/blockchain-service/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ export interface NftResponse {
id: string
contractHash: string
collectionName?: string
creator: {
address: string
name?: string
}
collectionImage?: string
symbol: string
image?: string
Expand Down
6 changes: 5 additions & 1 deletion packages/bs-ethereum/src/GhostMarketNDSEthereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type GhostMarketNFT = {
symbol: string
}
creator: {
address?: string
address: string
offchainName?: string
}
apiUrl?: string
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ describe('GhostMarketNDSEthereum', () => {
image: expect.any(String),
isSVG: expect.any(Boolean),
name: 'MOAR #379',
creator: {
address: '0xd71ef31e9d4e8674d9177c28cc2d0d633580615b',
name: undefined,
},
})
)
})
Expand Down
6 changes: 5 additions & 1 deletion packages/bs-neo3/src/GhostMarketNDSNeo3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type GhostMarketNFT = {
symbol: string
}
creator: {
address?: string
address: string
offchainName?: string
}
apiUrl?: string
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions packages/bs-neo3/src/__tests__/GhostMarketNDSNeo3.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('GhostMarketNDSNeo3', () => {
contractHash: '0xaa4fb927b3fe004e689a278d188689c9f050a8b2',
tokenId: 'SVBLTUYxMTY1',
})

expect(nft).toEqual(
expect.objectContaining({
id: 'SVBLTUYxMTY1',
Expand All @@ -22,6 +23,10 @@ describe('GhostMarketNDSNeo3', () => {
image: expect.any(String),
isSVG: expect.any(Boolean),
name: 'Pink Moon Fish',
creator: {
address: 'NQJpnvRaLvPqu8Mm5Bx3d1uJEttwJBN2p9',
name: undefined,
},
})
)
})
Expand Down

0 comments on commit 527bf4b

Please sign in to comment.