@zoralabs/nft-hooks
Advanced tools
Comparing version 1.0.30 to 1.0.31
@@ -64,8 +64,2 @@ "use strict"; | ||
object.media = { | ||
content: asset.contentURL | ||
? { | ||
uri: asset.contentURL, | ||
mime: asset.contentURLMimeType, | ||
} | ||
: undefined, | ||
image: asset.imageURL | ||
@@ -78,3 +72,18 @@ ? { | ||
source: NFTInterface_1.MEDIA_SOURCES.DERIVED, | ||
content: asset.contentURL | ||
? { | ||
uri: asset.contentURL, | ||
mime: asset.contentURLMimeType, | ||
} | ||
: undefined, | ||
}; | ||
if (asset.contentURL) { | ||
object.content = { | ||
source: NFTInterface_1.MEDIA_SOURCES.DERIVED, | ||
original: { | ||
uri: asset.contentURL, | ||
mime: asset.contentURLMimeType, | ||
}, | ||
}; | ||
} | ||
object.media = { | ||
@@ -87,8 +96,2 @@ image: asset.imageURL || ((_a = asset.contentURLMimeType) === null || _a === void 0 ? void 0 : _a.startsWith('image')) | ||
: undefined, | ||
content: asset.contentURL | ||
? { | ||
uri: asset.contentURL, | ||
mime: asset.contentURLMimeType, | ||
} | ||
: undefined, | ||
source: NFTInterface_1.MEDIA_SOURCES.DERIVED, | ||
@@ -95,0 +98,0 @@ }; |
@@ -86,9 +86,14 @@ "use strict"; | ||
: undefined, | ||
content: asset.animation_url | ||
? { | ||
uri: asset.animation_url || asset.image_original_url, | ||
} | ||
: undefined, | ||
source: NFTInterface_1.MEDIA_SOURCES.OPENSEA, | ||
}; | ||
if (asset.animation_url) { | ||
object.content = { | ||
source: NFTInterface_1.MEDIA_SOURCES.OPENSEA, | ||
original: asset.animation_url | ||
? { | ||
uri: asset.animation_url || asset.image_original_url, | ||
} | ||
: undefined, | ||
}; | ||
} | ||
if (!object.rawData) { | ||
@@ -95,0 +100,0 @@ object.rawData = {}; |
@@ -252,3 +252,3 @@ import { NetworkIDs, NFTObject } from '../../'; | ||
price: { | ||
__typename?: "PriceAtTime" | undefined; | ||
__typename: "PriceAtTime"; | ||
blockNumber: number; | ||
@@ -278,3 +278,3 @@ ethPrice?: { | ||
mintContext: { | ||
__typename?: "TransactionInfo" | undefined; | ||
__typename: "TransactionInfo"; | ||
blockNumber: number; | ||
@@ -292,7 +292,7 @@ blockTimestamp: any; | ||
mediaEncoding?: { | ||
__typename?: "AudioEncodingTypes" | undefined; | ||
__typename: "AudioEncodingTypes"; | ||
original: string; | ||
mp3?: string | null | undefined; | ||
large?: string | null | undefined; | ||
} | { | ||
__typename?: "ImageEncodingTypes" | undefined; | ||
__typename: "ImageEncodingTypes"; | ||
original: string; | ||
@@ -303,6 +303,6 @@ large?: string | null | undefined; | ||
} | { | ||
__typename?: "UnsupportedEncodingTypes" | undefined; | ||
__typename: "UnsupportedEncodingTypes"; | ||
original: string; | ||
} | { | ||
__typename?: "VideoEncodingTypes" | undefined; | ||
__typename: "VideoEncodingTypes"; | ||
original: string; | ||
@@ -321,7 +321,7 @@ large?: string | null | undefined; | ||
mediaEncoding?: { | ||
__typename?: "AudioEncodingTypes" | undefined; | ||
__typename: "AudioEncodingTypes"; | ||
original: string; | ||
mp3?: string | null | undefined; | ||
large?: string | null | undefined; | ||
} | { | ||
__typename?: "ImageEncodingTypes" | undefined; | ||
__typename: "ImageEncodingTypes"; | ||
original: string; | ||
@@ -332,6 +332,6 @@ large?: string | null | undefined; | ||
} | { | ||
__typename?: "UnsupportedEncodingTypes" | undefined; | ||
__typename: "UnsupportedEncodingTypes"; | ||
original: string; | ||
} | { | ||
__typename?: "VideoEncodingTypes" | undefined; | ||
__typename: "VideoEncodingTypes"; | ||
original: string; | ||
@@ -338,0 +338,0 @@ large?: string | null | undefined; |
@@ -387,3 +387,3 @@ "use strict"; | ||
function transformNFTZDKAlpha(tokenResponse, object) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; | ||
if (!object) { | ||
@@ -447,4 +447,3 @@ object = { rawData: {} }; | ||
: undefined, | ||
large: (((_l = (_k = token.image) === null || _k === void 0 ? void 0 : _k.mediaEncoding) === null || _l === void 0 ? void 0 : _l.__typename) === 'ImageEncodingTypes' || | ||
((_o = (_m = token.image) === null || _m === void 0 ? void 0 : _m.mediaEncoding) === null || _o === void 0 ? void 0 : _o.__typename) === 'VideoEncodingTypes') && | ||
large: ((_l = (_k = token.image) === null || _k === void 0 ? void 0 : _k.mediaEncoding) === null || _l === void 0 ? void 0 : _l.__typename) === 'ImageEncodingTypes' && | ||
token.image.mediaEncoding.large | ||
@@ -455,4 +454,3 @@ ? { | ||
: undefined, | ||
poster: (((_q = (_p = token.image) === null || _p === void 0 ? void 0 : _p.mediaEncoding) === null || _q === void 0 ? void 0 : _q.__typename) === 'ImageEncodingTypes' || | ||
((_s = (_r = token.image) === null || _r === void 0 ? void 0 : _r.mediaEncoding) === null || _s === void 0 ? void 0 : _s.__typename) === 'VideoEncodingTypes') && | ||
poster: ((_o = (_m = token.image) === null || _m === void 0 ? void 0 : _m.mediaEncoding) === null || _o === void 0 ? void 0 : _o.__typename) === 'ImageEncodingTypes' && | ||
token.image.mediaEncoding.poster | ||
@@ -463,3 +461,3 @@ ? { | ||
: undefined, | ||
image: ((_t = token.image) === null || _t === void 0 ? void 0 : _t.url) | ||
image: ((_p = token.image) === null || _p === void 0 ? void 0 : _p.url) | ||
? { | ||
@@ -470,8 +468,29 @@ mime: token.image.mimeType || undefined, | ||
: undefined, | ||
content: ((_u = token.content) === null || _u === void 0 ? void 0 : _u.url) | ||
}; | ||
object.content = { | ||
source: types_1.MEDIA_SOURCES.ZORA, | ||
original: ((_r = (_q = token.content) === null || _q === void 0 ? void 0 : _q.mediaEncoding) === null || _r === void 0 ? void 0 : _r.__typename) === 'VideoEncodingTypes' && | ||
token.content.mediaEncoding.original | ||
? { | ||
mime: token.content.mimeType || undefined, | ||
uri: token.content.url, | ||
uri: token.content.mediaEncoding.original, | ||
} | ||
: undefined, | ||
large: ((_t = (_s = token.content) === null || _s === void 0 ? void 0 : _s.mediaEncoding) === null || _t === void 0 ? void 0 : _t.__typename) === 'VideoEncodingTypes' && | ||
token.content.mediaEncoding.large | ||
? { | ||
uri: token.content.mediaEncoding.large, | ||
} | ||
: undefined, | ||
poster: ((_v = (_u = token.content) === null || _u === void 0 ? void 0 : _u.mediaEncoding) === null || _v === void 0 ? void 0 : _v.__typename) === 'VideoEncodingTypes' && | ||
token.content.mediaEncoding.poster | ||
? { | ||
uri: token.content.mediaEncoding.poster, | ||
} | ||
: undefined, | ||
thumbnail: ((_x = (_w = token.content) === null || _w === void 0 ? void 0 : _w.mediaEncoding) === null || _x === void 0 ? void 0 : _x.__typename) === 'VideoEncodingTypes' && | ||
token.content.mediaEncoding.thumbnail | ||
? { | ||
uri: token.content.mediaEncoding.thumbnail, | ||
} | ||
: undefined, | ||
}; | ||
@@ -478,0 +497,0 @@ if (!object.rawData) { |
@@ -53,4 +53,8 @@ "use strict"; | ||
object.media = { | ||
source: NFTInterface_1.MEDIA_SOURCES.DERIVED, | ||
content: { uri: asset.contentURI, mime: metadata.mimeType }, | ||
}; | ||
object.content = { | ||
source: NFTInterface_1.MEDIA_SOURCES.DERIVED, | ||
original: { uri: asset.contentURI, mime: metadata.mimeType }, | ||
}; | ||
@@ -57,0 +61,0 @@ object.metadata = metadata; |
@@ -207,8 +207,15 @@ import { EventInfoFragment } from '@zoralabs/zdk-alpha/dist/queries/queries-sdk'; | ||
media?: { | ||
thumbnail?: MediaObject; | ||
source: MEDIA_SOURCES; | ||
image?: MediaObject; | ||
large?: MediaObject; | ||
poster?: MediaObject; | ||
thumbnail?: MediaObject; | ||
content?: MediaObject; | ||
}; | ||
content?: { | ||
source: MEDIA_SOURCES; | ||
original?: MediaObject; | ||
large?: MediaObject; | ||
poster?: MediaObject; | ||
thumbnail?: MediaObject; | ||
}; | ||
@@ -215,0 +222,0 @@ nft?: { |
{ | ||
"name": "@zoralabs/nft-hooks", | ||
"version": "1.0.30", | ||
"version": "1.0.31", | ||
"description": "Generic react hooks for fetching zora auctions, nfts, and data on arbitary 721s. Powers nft-components.", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/ourzora/nft-hooks", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
933743
21118