@zoralabs/nft-hooks
Advanced tools
Comparing version 1.0.32 to 1.1.0
@@ -11,4 +11,4 @@ export { CurrencyInterface } from './currency/CurrencyInterface'; | ||
export { OpenseaInterface } from './opensea/OpenseaInterface'; | ||
export { ZDKAlphaDataInterface } from './zdk-alpha/ZDKAlphaDataInterface'; | ||
export { ZDKAlphaDataSource, transformNFTZDKAlpha } from './zdk-alpha/ZDKAlphaDataSource'; | ||
export { ZDKDataInterface } from './zdk/ZDKDataInterface'; | ||
export { ZDKDataSource, transformNFTZDK } from './zdk/ZDKDataSource'; | ||
export { GraphAuctionDataSource } from './zora-graph/GraphAuctionDataSource'; | ||
@@ -15,0 +15,0 @@ export { GraphAuctionInterface } from './zora-graph/GraphAuctionInterface'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ZoraUserDataSource = exports.transformNFTZoraIndexerV1DataSource = exports.ZoraIndexerV1DataSource = exports.transformNFTZoraGraph = exports.ZoraGraphDataSource = exports.GraphAuctionDataSource = exports.transformNFTZDKAlpha = exports.ZDKAlphaDataSource = exports.OpenseaDataSource = exports.GenericMediaData = exports.EtherActorDataSource = exports.ENSDataSource = exports.CurrencyDataSourceUniswap = void 0; | ||
exports.ZoraUserDataSource = exports.transformNFTZoraIndexerV1DataSource = exports.ZoraIndexerV1DataSource = exports.transformNFTZoraGraph = exports.ZoraGraphDataSource = exports.GraphAuctionDataSource = exports.transformNFTZDK = exports.ZDKDataSource = exports.OpenseaDataSource = exports.GenericMediaData = exports.EtherActorDataSource = exports.ENSDataSource = exports.CurrencyDataSourceUniswap = void 0; | ||
var CurrencyDataSourceUniswap_1 = require("./currency/CurrencyDataSourceUniswap"); | ||
@@ -14,5 +14,5 @@ Object.defineProperty(exports, "CurrencyDataSourceUniswap", { enumerable: true, get: function () { return CurrencyDataSourceUniswap_1.CurrencyDataSourceUniswap; } }); | ||
Object.defineProperty(exports, "OpenseaDataSource", { enumerable: true, get: function () { return OpenseaDataSource_1.OpenseaDataSource; } }); | ||
var ZDKAlphaDataSource_1 = require("./zdk-alpha/ZDKAlphaDataSource"); | ||
Object.defineProperty(exports, "ZDKAlphaDataSource", { enumerable: true, get: function () { return ZDKAlphaDataSource_1.ZDKAlphaDataSource; } }); | ||
Object.defineProperty(exports, "transformNFTZDKAlpha", { enumerable: true, get: function () { return ZDKAlphaDataSource_1.transformNFTZDKAlpha; } }); | ||
var ZDKDataSource_1 = require("./zdk/ZDKDataSource"); | ||
Object.defineProperty(exports, "ZDKDataSource", { enumerable: true, get: function () { return ZDKDataSource_1.ZDKDataSource; } }); | ||
Object.defineProperty(exports, "transformNFTZDK", { enumerable: true, get: function () { return ZDKDataSource_1.transformNFTZDK; } }); | ||
var GraphAuctionDataSource_1 = require("./zora-graph/GraphAuctionDataSource"); | ||
@@ -19,0 +19,0 @@ Object.defineProperty(exports, "GraphAuctionDataSource", { enumerable: true, get: function () { return GraphAuctionDataSource_1.GraphAuctionDataSource; } }); |
@@ -46,3 +46,3 @@ import DataLoader from 'dataloader'; | ||
__typename?: "AuctionBidEvent" | undefined; | ||
} & Pick<import("./zora-indexer-types").AuctionBidEvent, "id" | "value" | "blockNumber" | "sender" | "transactionHash" | "blockTimestamp">)[]; | ||
} & Pick<import("./zora-indexer-types").AuctionBidEvent, "id" | "value" | "sender" | "blockNumber" | "transactionHash" | "blockTimestamp">)[]; | ||
})[]; | ||
@@ -71,3 +71,3 @@ } & { | ||
__typename?: "Event" | undefined; | ||
} & Pick<import("./zora-indexer-types").Event, "address" | "blockNumber" | "eventType" | "transactionHash" | "blockTimestamp">)[]; | ||
} & Pick<import("./zora-indexer-types").Event, "address" | "eventType" | "blockNumber" | "transactionHash" | "blockTimestamp">)[]; | ||
}> | undefined; | ||
@@ -86,3 +86,3 @@ } & { | ||
__typename?: "Event" | undefined; | ||
} & Pick<import("./zora-indexer-types").Event, "address" | "details" | "blockNumber" | "eventType" | "transactionHash" | "blockTimestamp">)[]; | ||
} & Pick<import("./zora-indexer-types").Event, "address" | "details" | "eventType" | "blockNumber" | "transactionHash" | "blockTimestamp">)[]; | ||
}))[]>; | ||
@@ -89,0 +89,0 @@ queryNFTs: ({ query, sort, pagination, additional }: NFTQuery) => Promise<IndexerTokenWithAuctionFragment[]>; |
@@ -6,2 +6,2 @@ export { NFTStrategy } from './NFTStrategy'; | ||
export { ZoraV2IndexerStrategy } from './ZoraV2IndexerStrategy'; | ||
export { ZDKAlphaFetchStrategy } from './ZDKAlphaFetchStrategy'; | ||
export { ZDKFetchStrategy } from './ZDKFetchStrategy'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ZDKAlphaFetchStrategy = exports.ZoraV2IndexerStrategy = exports.ZoraGraphStrategy = exports.ZoraGraphEtherActorStrategy = exports.OpenseaStrategy = exports.NFTStrategy = void 0; | ||
exports.ZDKFetchStrategy = exports.ZoraV2IndexerStrategy = exports.ZoraGraphStrategy = exports.ZoraGraphEtherActorStrategy = exports.OpenseaStrategy = exports.NFTStrategy = void 0; | ||
var NFTStrategy_1 = require("./NFTStrategy"); | ||
@@ -14,3 +14,3 @@ Object.defineProperty(exports, "NFTStrategy", { enumerable: true, get: function () { return NFTStrategy_1.NFTStrategy; } }); | ||
Object.defineProperty(exports, "ZoraV2IndexerStrategy", { enumerable: true, get: function () { return ZoraV2IndexerStrategy_1.ZoraV2IndexerStrategy; } }); | ||
var ZDKAlphaFetchStrategy_1 = require("./ZDKAlphaFetchStrategy"); | ||
Object.defineProperty(exports, "ZDKAlphaFetchStrategy", { enumerable: true, get: function () { return ZDKAlphaFetchStrategy_1.ZDKAlphaFetchStrategy; } }); | ||
var ZDKFetchStrategy_1 = require("./ZDKFetchStrategy"); | ||
Object.defineProperty(exports, "ZDKFetchStrategy", { enumerable: true, get: function () { return ZDKFetchStrategy_1.ZDKFetchStrategy; } }); |
@@ -6,3 +6,3 @@ export { CurrencyInterface } from './backends'; | ||
export { OpenseaInterface } from './backends'; | ||
export { ZDKAlphaDataInterface } from './backends'; | ||
export { ZDKDataInterface } from './backends'; | ||
export { GraphAuctionInterface } from './backends'; | ||
@@ -9,0 +9,0 @@ export { ZoraGraphDataInterface } from './backends'; |
@@ -1,2 +0,2 @@ | ||
import { EventInfoFragment } from '@zoralabs/zdk-alpha/dist/queries/queries-sdk'; | ||
import { EventInfoFragment } from '@zoralabs/zdk/dist/queries/queries-sdk'; | ||
import { NFTQuery } from '../types/NFTQuery'; | ||
@@ -69,2 +69,12 @@ export declare enum KNOWN_CONTRACTS { | ||
}; | ||
export declare type MarketInfo = { | ||
raw: any; | ||
amount?: CurrencyValue; | ||
status: MARKET_INFO_STATUSES; | ||
createdAt: TimedAction; | ||
createdBy?: string; | ||
finishedAt?: TimedAction; | ||
canceledAt?: TimedAction; | ||
marketContract?: ETHAddress; | ||
}; | ||
export declare type TimedAction = { | ||
@@ -110,12 +120,2 @@ timestamp: string; | ||
} & MarketInfo; | ||
export declare type MarketInfo = { | ||
raw: any; | ||
amount?: CurrencyValue; | ||
status: MARKET_INFO_STATUSES; | ||
createdAt: TimedAction; | ||
createdBy?: string; | ||
finishedAt?: TimedAction; | ||
canceledAt?: TimedAction; | ||
marketContract?: ETHAddress; | ||
}; | ||
export declare type MarketModule = AuctionLike | FixedPriceLike | EditionLike; | ||
@@ -175,2 +175,8 @@ export declare enum AUCTION_EVENT_TYPES { | ||
seller?: ETHAddress; | ||
price?: { | ||
symbol: string; | ||
amount: number; | ||
usdcPrice?: Pick<CurrencyAmount, 'decimals' | 'raw'>; | ||
nativePrice?: Pick<CurrencyAmount, 'decimals' | 'raw'>; | ||
}; | ||
raw: { | ||
@@ -177,0 +183,0 @@ source: FIXED_PRICE_MARKET_SOURCES.ZORA_ASK_V3; |
{ | ||
"name": "@zoralabs/nft-hooks", | ||
"version": "1.0.32", | ||
"version": "1.1.0", | ||
"description": "Generic react hooks for fetching zora auctions, nfts, and data on arbitary 721s. Powers nft-components.", | ||
@@ -71,3 +71,3 @@ "repository": "https://github.com/ourzora/nft-hooks", | ||
"@types/deepmerge": "^2.2.0", | ||
"@zoralabs/zdk-alpha": "^0.0.38", | ||
"@zoralabs/zdk": "^2.0.0", | ||
"big.js": "^6.1.0", | ||
@@ -74,0 +74,0 @@ "cross-fetch": "^3.1.4", |
@@ -40,5 +40,6 @@ ## @zoralabs/nft-hooks | ||
| -- | -- | | ||
| [useNFT](docs/useNFT.md) | Fetches on-chain NFT data for either zora or non-zora NFTs | | ||
| [useNFTQuery](docs/useZNFTQuery.md) | Fetches on-chain zora zNFT data (most likely want to use useNFT) | | ||
| [useNFTContent](docs/useNFTContent.md) | Fetches text content from server for rendering from content URL | | ||
| [useNFT](docs/useNFT.md) | Fetches on-chain NFT data using a configured backend strategy | ||
| [useNFTQuery](docs/useNFTQuery.md) | Queries for NFTs using a configured backend strategy | ||
| [useNFTMetadata](docs/useNFTMetadata.md) | Fetches off-chain metadata (not required for most indexers) | ||
| [useNFTContent](docs/useNFTContent.md) | Fetches off-chain content (useful for some text content, but less often used) | ||
@@ -50,7 +51,9 @@ ### Configuration: | ||
```ts | ||
import {Networks, NFTFetchConfiguration} from '@zoralabs/nft-hooks'; | ||
import {Networks, NFTFetchConfiguration, Strategies} from '@zoralabs/nft-hooks'; | ||
const zdkStrategy = Strategies.ZDKFetchStrategy(); | ||
function NFTGallery() { | ||
return ( | ||
<NFTFetchConfiguration network={Networks.MAINNET}> | ||
<NFTFetchConfiguration strategy={zdkStrategy} network={Networks.MAINNET}> | ||
<NFTList> | ||
@@ -64,6 +67,8 @@ </NFTFetchConfiguration> | ||
Currently data is fetched from: | ||
1. TheGraph for auction information, zNFT information, and currency information | ||
2. Direct metadata URIs for zNFT metadata | ||
3. Opensea for non-zora tracked NFTs | ||
Provided strategies are: | ||
1. ZDKFetchStrategy from the zora indexer (recommended) | ||
2. ZoraV2Indexer strategy from the legacy zora indexer (deprecated) | ||
3. ZoraGraphStrategy strategy from the zora subgraph (not recommended) | ||
4. EtherActorStrategy using ether.actor as a nft backend (not recommended) | ||
5. OpenseaStrategy using opensea's api as a nft backend (not recommended) | ||
@@ -70,0 +75,0 @@ Links direct to zora.co interfaces, but can be overridden to directly use the [zdk](https://github.com/ourzora/zdk) instead. |
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
944792
135
21383
84
+ Added@zoralabs/zdk@^2.0.0
+ Added@zoralabs/zdk@2.4.0(transitive)
- Removed@zoralabs/zdk-alpha@^0.0.38
- Removed@zoralabs/zdk-alpha@0.0.38(transitive)