Function useOffers

  • Beta

    Get all the offers for a listing

    Parameters

    • contract: RequiredParam<Marketplace>

      an instance of a Marketplace contract

    • listingId: RequiredParam<BigNumberish>

      the id of the listing to fetch offers for

    Returns {
        data: Record<string, any>[] | undefined;
        dataUpdatedAt: number;
        error: unknown;
        errorUpdateCount: number;
        errorUpdatedAt: number;
        failureCount: number;
        failureReason: unknown;
        fetchStatus: FetchStatus;
        isError: true;
        isFetched: boolean;
        isFetchedAfterMount: boolean;
        isFetching: boolean;
        isInitialLoading: boolean;
        isLoading: false;
        isLoadingError: false;
        isPaused: boolean;
        isPlaceholderData: boolean;
        isPreviousData: boolean;
        isRefetchError: true;
        isRefetching: boolean;
        isStale: boolean;
        isSuccess: false;
        refetch: (<TPageData>(options?) => Promise<QueryObserverResult>);
        remove: (() => void);
        status: "error";
    } | {
        data: Record<string, any>[] | undefined;
        dataUpdatedAt: number;
        error: null;
        errorUpdateCount: number;
        errorUpdatedAt: number;
        failureCount: number;
        failureReason: unknown;
        fetchStatus: FetchStatus;
        isError: false;
        isFetched: boolean;
        isFetchedAfterMount: boolean;
        isFetching: boolean;
        isInitialLoading: boolean;
        isLoading: false;
        isLoadingError: false;
        isPaused: boolean;
        isPlaceholderData: boolean;
        isPreviousData: boolean;
        isRefetchError: false;
        isRefetching: boolean;
        isStale: boolean;
        isSuccess: true;
        refetch: (<TPageData>(options?) => Promise<QueryObserverResult>);
        remove: (() => void);
        status: "success";
    } | {
        data: Record<string, any>[] | undefined;
        dataUpdatedAt: number;
        error: unknown;
        errorUpdateCount: number;
        errorUpdatedAt: number;
        failureCount: number;
        failureReason: unknown;
        fetchStatus: FetchStatus;
        isError: true;
        isFetched: boolean;
        isFetchedAfterMount: boolean;
        isFetching: boolean;
        isInitialLoading: boolean;
        isLoading: false;
        isLoadingError: true;
        isPaused: boolean;
        isPlaceholderData: boolean;
        isPreviousData: boolean;
        isRefetchError: false;
        isRefetching: boolean;
        isStale: boolean;
        isSuccess: false;
        refetch: (<TPageData>(options?) => Promise<QueryObserverResult>);
        remove: (() => void);
        status: "error";
    } | {
        data: Record<string, any>[] | undefined;
        dataUpdatedAt: number;
        error: null;
        errorUpdateCount: number;
        errorUpdatedAt: number;
        failureCount: number;
        failureReason: unknown;
        fetchStatus: FetchStatus;
        isError: false;
        isFetched: boolean;
        isFetchedAfterMount: boolean;
        isFetching: boolean;
        isInitialLoading: boolean;
        isLoading: true;
        isLoadingError: false;
        isPaused: boolean;
        isPlaceholderData: boolean;
        isPreviousData: boolean;
        isRefetchError: false;
        isRefetching: boolean;
        isStale: boolean;
        isSuccess: false;
        refetch: (<TPageData>(options?) => Promise<QueryObserverResult>);
        remove: (() => void);
        status: "loading";
    }

    Remarks

    Fetch all the offers for a specified direct or auction listing.

    Example

    const listingId = 0;
    const { data: offers, isLoading, error } = useOffers(contract, listingId);

    See

    Documentation

Generated using TypeDoc