Skip to main content

useCreateAuctionListing() function

This feature is currently in beta and may change based on feedback that we receive.

Use this to create a new Auction Listing on your marketplace contract.

Example

const Component = () => {
const {
mutate: createAuctionListing,
isLoading,
error,
} = useCreateAuctionListing(">>YourMarketplaceContractInstance<<");

if (error) {
console.error("failed to create auction listing", error);
}

return (
<button
disabled={isLoading}
onClick={() => createAuctionListing(auctionListingData)}
>
Create Auction Listing!
</button>
);
};

Signature:

export declare function useCreateAuctionListing(
contract: RequiredParam<Marketplace>,
): import("@tanstack/react-query").UseMutationResult<
import("@thirdweb-dev/sdk").TransactionResultWithId<never>,
unknown,
NewAuctionListing,
unknown
>;

Parameters

ParameterTypeDescription
contractRequiredParam<Marketplace>an instance of a Marketplace contract

Returns:

import("@tanstack/react-query").UseMutationResult<import("@thirdweb-dev/sdk").TransactionResultWithId<never>, unknown, NewAuctionListing, unknown>

a mutation object that can be used to create a new auction listing