useCreateDirectListingBatch
Create multiple direct listings in one batch
const Component = () => { const { contract } = useContract("{{contract_address}}"); const { mutate: createDirectListingBatch, isLoading, error, } = useCreateDirectListingBatch(contract); if (error) { console.error("failed to create direct listing batch", error); } // Sample data const directListingData = [ { assetContractAddress: "nft-contract-address", tokenId: "token-id-1", quantity: "quantity-1", currencyContractAddress: "currency-address", pricePerToken: 1, }, { assetContractAddress: "nft-contract-address", tokenId: "token-id-2", quantity: 1, currencyContractAddress: "currency-address", pricePerToken: 0, }, ]; return ( <button disabled={isLoading} onClick={() => createDirectListingBatch(directListingData)} > Create batch Direct Listing! </button> );};
function useCreateDirectListingBatch< TMarketplaceV3 extends MarketplaceV3,>( contract: RequiredParam<TMarketplaceV3>,): UseMutationResult< unknown, Array<{}>, unknown>;
let returnType: UseMutationResult< unknown, Array<{}>, unknown>;
a mutation object that can be used to create a new batch of direct listings