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>;
}

Parameters

Returns

A react query object which contains the data of type BuyWithFiatStatus