useBuyWithFiatStatus

A hook to get a status of a "Buy with Fiat" transaction to determine if the transaction is completed, failed or pending.

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

useBuyWithFiatStatus refetches the status using getBuyWithFiatStatus every 5 seconds.

Example

import { useBuyWithFiatStatus } from "thirdweb/react";
import { client } from "./client";
function Example() {
const fiatStatus = useBuyWithFiatStatus({
client: client, // thirdweb client
intentId: "....", // get the intentId from quote ( quote.intentId )
});
console.log(fiatStatus.data);
return <div>...</div>;
}
function useBuyWithFiatStatus(
): UseQueryResult<BuyWithFiatStatus>;

Parameters

object of type GetBuyWithFiatStatusParams

Type

let params: { client: ThirdwebClient; intentId: string };

Returns

let returnType: UseQueryResult<BuyWithFiatStatus>;

A react query object which contains the data of type BuyWithFiatStatus