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.

34 lines (33 loc) 1.22 kB
import AbortController from 'node-abort-controller'; /** * Simple Fetch wrapper that enables a timeout. * Allows for showing an error state for slow-to-load IPFS files */ export declare class FetchWithTimeout { controller: AbortController; expectedContentType?: string; timeoutDuration: number; constructor(timeoutDuration?: number, contentType?: string | undefined); fetch(url: string, options?: any): Promise<Response>; } export interface IFetchOptions { method?: string; timeoutMs?: number; responseRequiredContentType?: string; responseMaxLimitInBytes?: number; } export declare class FetchEror extends Error { } export declare class FetchDifferentContentTypeError extends FetchEror { constructor(actualContentType_: string); readonly actualContentType: string; } export declare class FetchContentLengthExceededLimitError extends FetchEror { constructor(); } export declare class FetchStatusNotSuccessError extends FetchEror { constructor(status: number, statusText?: string); readonly status: number; readonly statusText?: string; } export declare function fetchEx(url: string, options_?: IFetchOptions): Promise<string>;