useFulfillAuction
Hook for fulfilling auctions.
Import
import { useFulfillAuction } from '@ark-project/react'
Usage
import { useAccount } from '@starknet-react/core'
import { useFulfillAuction } from '@ark-project/react'
function FulfillAuction({
orderHash,
relatedOrderHash
tokenAddress,
tokenId,
}) {
const { account } = useAccount();
const { fulfillAuction, data, isLoading, isSuccess } = useFulfillAuction()
return (
<>
<button onClick={async () => {
await fulfillAuction({
account,
orderHash,
relatedOrderHash,
tokenAddress,
tokenId,
});
}}>
Fulfill Auction
</button>
{isLoading && <p>Loading...</p>}
{isSuccess && <div>{data.transactionHash}</div>}
</>
)
}
Return Type
import { type useFulfillAuctionReturnType } from '@ark-project/react'
- Name
fulfillAuction
- Type
- (params: FulfillAuctionParams) => FulfillAuctionResult
- Description
Mutation to fulfill an auction. See FulfillAuctionParams.
- Name
fulfillAuctionAsync
- Type
- (params: FulfillAuctionParams) => Promise<FulfillAuctionResult>
- Description
Async mutation to fulfill an auction. See FulfillAuctionParams.
- Name
data
- Type
- FulfillAuctionResult
- Description
The data returned from the mutation.
Parameters
- Name
config (optional)
- Type
- Config | undefined
- Description
Config to use instead of retrieving from the nearest ArkProvider.
Actions
FulfillAuctionParameters and FulfillAuctionResponse for more details.