@cross-nft-marketplace/auction-house-nft-hooks
Version:
Generic react hooks for fetching cross-nft-marketplace auctions, nfts, and data on arbitary 721s. Powers nft-components.
33 lines (32 loc) • 1.29 kB
TypeScript
import { NFTDataType } from '../fetcher/AuctionInfoTypes';
import { SWRConfiguration } from 'swr';
export declare type useNFTType = {
currencyLoaded: boolean;
error?: string;
data?: NFTDataType;
};
declare type OptionsType = {
loadCurrencyInfo?: boolean;
fetchStrategy?: NftDataFetchStrategy;
requireData?: boolean;
};
export declare enum NftDataFetchStrategy {
ZoraIndexer = 1,
Opensea = 2,
Blockchain = 4,
ZoraIndexerV2 = 8,
AllIndexers = 11,
All = 15
}
export declare const DEFAULT_FETCH_STRATEGY: NftDataFetchStrategy;
/**
* Fetches on-chain NFT data and pricing for the given zNFT id
*
* @param contractAddress address of the contract, if null and tokenID is passed in, a ZNFT is assumed
* @param tokenId id of NFT to fetch blockchain information for
* @param options custom options and an option to load currency info
* @param swrConfiguration SWR flags configuration
* @returns useNFTType hook results include loading, error, and chainNFT data.
*/
export declare function useNFT(contractAddress?: string, tokenId?: string, options?: OptionsType, swrConfiguration?: SWRConfiguration, auctionSwrConfiguration?: SWRConfiguration, currencySwrConfiguration?: SWRConfiguration): useNFTType;
export {};