fulfillAuction
Action for fulfilling an auction.
Import
import { fulfillAuction } from '@arkproject/core'
Usage
import { createAuction, createOffer, fulfillAuction } from '@arkproject/core'
import { config, buyer, seller, brokerAddress } from './config'
const auction = await createAuction(config, {
account: seller,
brokerAddress,
tokenAddress
'0x02acee8c430f62333cf0e0e7a94b2347b5513b4c25f699461dd8d7b23c072478',
tokenId: BigInt(1),
amount: BigInt(1000),
})
const offer = await createOffer(config, {
account: buyer,
brokerAddress,
tokenAddress:
'0x02acee8c430f62333cf0e0e7a94b2347b5513b4c25f699461dd8d7b23c072478',
tokenId: BigInt(1),
amount: BigInt(1000),
})
const { transactionHash } = await fulfillAuction(config, {
account: seller,
brokerAddress,
orderHash: auction.orderHash,
relatedOrderHash: offer.orderHash,
tokenAddress:
'0x02acee8c430f62333cf0e0e7a94b2347b5513b4c25f699461dd8d7b23c072478',
tokenId: BigInt(1),
})
Returns
The result of the fulfill auction action, including the transaction hash.
Parameters
- Name
account
- Type
- AccountInterface
- Description
The account responsible for executing the transaction.
- Name
brokerAddress
- Type
- string
- Description
The address of the broker contract.
- Name
orderHash
- Type
- bigint
- Description
The hash of the auction order.
- Name
relatedOrderHash
- Type
- bigint
- Description
The hash of the related offer order.
- Name
tokenAddress
- Type
- string
- Description
The address of the token contract.
- Name
tokenId
- Type
- bigint
- Description
The ID of the token.
- Name
currencyAddress (optional)
- Type
- string
- Description
The currency address for the offer. Defaults to ETH.
- Name
waitForTransaction (optional)
- Type
- boolean
- Description
If
false
, the function will return immediately after sending the transaction. Defaults totrue
.