diff --git a/src/api/types.ts b/src/api/types.ts index 661d6a79e..880e8713e 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -211,6 +211,8 @@ export type NFT = { image_url: string; /** URL of metadata */ metadata_url: string; + /** URL on OpenSea */ + opensea_url: string; /** Date of latest NFT update */ updated_at: string; /** Whether NFT is disabled for trading on OpenSea */ @@ -219,6 +221,26 @@ export type NFT = { is_nsfw: boolean; /** Traits for the NFT, returns null if the NFT has than 50 traits */ traits: Trait[] | null; + /** Creator of the NFT */ + creator: string; + /** Owners of the NFT */ + owners: { + address: string; + quantity: number; + }; + /** Rarity of the NFT */ + rarity: null | { + strategy_id: string | null; + strategy_version: string | null; + rank: number | null; + score: number | null; + calculated_at: string; + max_rank: number | null; + tokens_scored: number | null; + ranking_features: null | { + unique_attribute_count: number; + }; + }; }; /** diff --git a/test/integration/getNFTs.spec.ts b/test/integration/getNFTs.spec.ts index be9cc13ca..864c7fc99 100644 --- a/test/integration/getNFTs.spec.ts +++ b/test/integration/getNFTs.spec.ts @@ -34,23 +34,11 @@ suite("SDK: NFTs", () => { test("Get NFT", async () => { const tokenAddress = "0x4768cbf202f365fbf704b9b9d397551a0443909b"; // Roo Troop - const identifier = "2"; - const response = await sdk.api.getNFT( - tokenAddress, - identifier, - Chain.Polygon, - ); + const tokenId = "2"; + const response = await sdk.api.getNFT(tokenAddress, tokenId, Chain.Polygon); assert(response.nft, "Response should contain nft."); - assert.equal( - response.nft.contract, - tokenAddress, - "NFT address should match token address", - ); - assert.equal( - response.nft.identifier, - identifier, - "NFT address should match token address", - ); + assert.equal(response.nft.contract, tokenAddress, "The address matches"); + assert.equal(response.nft.identifier, tokenId, "The token id matches"); }); test("Refresh NFT", async () => {