UNPKG

@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.

93 lines (92 loc) 3.69 kB
import { AskPriceFragment, BidDataPartialFragment, CurrencyShortFragment, CurrentReserveBidFragment, Maybe, NftMediaFragment, PreviousReserveBidFragment, ReserveAuctionPartialFragment } from '../graph-queries/zora-graph-types'; import { ChainCurrencyType, NFTResultType, ReserveAuctionBidsWithCurrency } from '../fetcher/FetchResultTypes'; import { AuctionStateInfo } from './AuctionState'; import { OpenseaResponse } from './OpenseaUtils'; import { IndexerTokenWithAuctionFragment } from '../graph-queries/zora-indexer-types'; export declare type PricingInfo = { currency: CurrencyShortFragment; amount: string; prettyAmount: string; computedValue?: PricingInfoValue; }; export declare type BidPricingInfo = { pricing: PricingInfo; }; export declare type PastReserveBid = Omit<PreviousReserveBidFragment, 'currency' | 'amount'> & BidPricingInfo; export declare type CurrentReserveBid = Omit<CurrentReserveBidFragment, 'currency' | 'amount'> & BidPricingInfo; export declare type PerpetualBid = Omit<BidDataPartialFragment, 'currency' | 'amount'> & BidPricingInfo; export declare type PerpetualAsk = Pick<AskPriceFragment, 'id' | 'createdAtTimestamp'> & BidPricingInfo; export declare type PricingInfoValue = { inUSD: string; inETH: string; }; export declare enum AuctionType { NONE = "NONE", PERPETUAL = "PERPETUAL", RESERVE = "RESERVE" } export declare type CommonNFTMediaDataType = { nft: NFTResultType; pricing: { perpetual?: { bids: BidDataPartialFragment[]; ask: Maybe<AskPriceFragment>; }; reserve: Maybe<ReserveAuctionPartialFragment>; }; }; export declare type OpenseaNFTMediaDataType = CommonNFTMediaDataType & { openseaInfo: OpenseaResponse; }; export declare type BlockchainNFTMediaDataType = CommonNFTMediaDataType & {}; export declare type HighestBidType = { pricing: PricingInfo; placedBy: string; placedAt: string; }; export declare type PricingInfoData = { status: AuctionStateInfo; perpetual: { bids: PerpetualBid[]; ask?: PerpetualAsk; highestBid?: HighestBidType; }; reserve?: ReserveAuctionBidsWithCurrency & { current: { highestBid?: HighestBidType; likelyHasEnded: boolean; reserveMet: boolean; }; reservePrice?: PricingInfo; buyNowPrice?: PricingInfo; currentBid?: CurrentReserveBid; previousBids: PastReserveBid[]; }; auctionType: AuctionType; }; declare type ZoraNFTType = Omit<NftMediaFragment, 'currentBids' | 'currentAsk' | 'id' | 'owner' | 'creator'> & { creatorBidSharePercentage: number; ownerBidSharePercentage: number; }; export declare type OpenseaNFTDataType = Omit<OpenseaNFTMediaDataType, 'pricing'> & { pricing: PricingInfoData; }; export declare type BlockchainNFTDataType = Omit<BlockchainNFTMediaDataType, 'pricing'> & { pricing: PricingInfoData; zoraNFT?: ZoraNFTType; }; export declare type IndexerDataType = Omit<CommonNFTMediaDataType, 'pricing'> & { zoraIndexerResponse: IndexerTokenWithAuctionFragment; zoraNFT?: ZoraNFTType; pricing: PricingInfoData; }; export declare type IndexerV2DataType = Omit<CommonNFTMediaDataType, 'pricing'> & { zoraIndexerResponse: IndexerTokenWithAuctionFragment; zoraNFT?: ZoraNFTType; pricing: PricingInfoData; }; export declare type NFTDataType = OpenseaNFTDataType | IndexerDataType | IndexerV2DataType | BlockchainNFTDataType; export declare type CurrencyLookupType = { [currencyId: string]: ChainCurrencyType; }; export {};