useBuyHistory

Hook to get the history of Buy transactions for a given wallet - This includes both "buy with crypto" and "buy with fiat" transactions.

This hook is a React Query wrapper of the getBuyHistory function. You can also use that function directly

Example

import { useBuyHistory } from "thirdweb/react";
function Component() {
const buyHistoryQuery = useBuyHistory(params);
return <div> ... </div>;
}
function useBuyHistory(
params?: BuyHistoryParams,
queryParams?: BuyHistoryQueryOptions,
): UseQueryResult<BuyHistoryData>;

Parameters

object of type BuyHistoryParams

Type

let params: {
client: ThirdwebClient;
count: number;
start: number;
walletAddress: string;
};

options to configure the react query

Type

let queryParams: BuyHistoryQueryOptions;

Returns

let returnType: UseQueryResult<BuyHistoryData>;

A React Query object which contains the data of type BuyHistoryData