@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.
96 lines (95 loc) • 3.88 kB
TypeScript
import { CurrencyShortFragment, ReserveAuctionBidType, ReserveAuctionPartialFragment, ReserveAuctionStatus } from '../graph-queries/zora-graph-types';
import type { GetTokenPricesQuery } from '../graph-queries/uniswap-types';
import { ChainCurrencyType } from './FetchResultTypes';
import { CurrencyLookupType, PricingInfoData, CommonNFTMediaDataType } from './AuctionInfoTypes';
export declare const NULL_ETH_CURRENCY_ID = "0x0000000000000000000000000000000000000000";
export declare function transformCurrencyEth(currency: CurrencyShortFragment): {
__typename?: "Currency" | undefined;
symbol: string;
id: string;
name: string;
decimals?: import("../graph-queries/zora-graph-types").Maybe<number> | undefined;
};
export declare function auctionDataToPricing(auctionData: ReserveAuctionPartialFragment | undefined): {
reserveAndBuyNowCurrency: {
__typename?: "Currency" | undefined;
symbol: string;
id: string;
name: string;
decimals?: import("../graph-queries/zora-graph-types").Maybe<number> | undefined;
};
auctionCurrencies: {
__typename?: "Currency" | undefined;
symbol: string;
id: string;
name: string;
decimals?: import("../graph-queries/zora-graph-types").Maybe<number> | undefined;
}[] | undefined;
currentBid: {
currency: {
__typename?: "Currency" | undefined;
symbol: string;
id: string;
name: string;
decimals?: import("../graph-queries/zora-graph-types").Maybe<number> | undefined;
};
__typename?: "ReserveAuctionBid" | undefined;
id: string;
amount: any;
createdAtTimestamp: any;
transactionHash: string;
bidType: ReserveAuctionBidType;
buyNowRequested: boolean;
buyNowActual: boolean;
bidder: {
__typename?: "User" | undefined;
} & Pick<import("../graph-queries/zora-graph-types").User, "id">;
} | undefined;
previousBids: {
currency: {
__typename?: "Currency" | undefined;
symbol: string;
id: string;
name: string;
decimals?: import("../graph-queries/zora-graph-types").Maybe<number> | undefined;
};
__typename?: "InactiveReserveAuctionBid" | undefined;
id: string;
amount: any;
createdAtTimestamp: any;
transactionHash: string;
bidType: ReserveAuctionBidType;
buyNowRequested: boolean;
buyNowActual: boolean;
bidInactivatedAtTimestamp: any;
bidInactivatedAtBlockNumber: any;
bidder: {
__typename?: "User" | undefined;
} & Pick<import("../graph-queries/zora-graph-types").User, "id">;
}[] | undefined;
__typename?: "ReserveAuction" | undefined;
id: string;
createdAtTimestamp: any;
transactionHash: string;
approved: boolean;
tokenId: any;
tokenContract: string;
status: ReserveAuctionStatus;
reservePrice: any;
buyNowPrice: any;
firstBidTime?: any;
token: string;
approvedTimestamp?: any;
curatorFeePercentage: number;
duration: any;
expectedEndTimestamp?: any;
finalizedAtTimestamp?: any;
curator: {
__typename?: "User" | undefined;
} & Pick<import("../graph-queries/zora-graph-types").User, "id">;
tokenOwner: {
__typename?: "User" | undefined;
} & Pick<import("../graph-queries/zora-graph-types").User, "id">;
} | null;
export declare function transformCurrencyForKey(result: GetTokenPricesQuery, key: string): ChainCurrencyType;
export declare function addAuctionInformation(pricing: CommonNFTMediaDataType['pricing'], currencyInfos?: CurrencyLookupType): PricingInfoData;