cancelOrder

Action for cancelling an order.

Import

import { cancelOrder } from '@arkproject/core'

Usage

import { cancel } from '@arkproject/core'
import { config, buyer, brokerAddress } from './config'

const { orderHash } = await createOffer(config, {
  account: buyer,
  brokerAddress,
  tokenAddress:
    '0x02acee8c430f62333cf0e0e7a94b2347b5513b4c25f699461dd8d7b23c072478',
  tokenId: BigInt(1),
  amount: BigInt(10),
})

const { transactionHash } = await cancelOrder(config, {
  account: buyer,
  orderHash,
  tokenAddress:
    '0x02acee8c430f62333cf0e0e7a94b2347b5513b4c25f699461dd8d7b23c072478',
  tokenId: BigInt(1),
})

Returns

CancelOrderResult

The result of the cancel order action.

Parameters

  • Name
    account
    Type
    AccountInterface
    Description

    The account responsible for executing the transaction.

  • Name
    orderHash
    Type
    bigint
    Description

    The orderHash of the order.

  • Name
    tokenAddress
    Type
    string
    Description

    The contract address of the token.

  • Name
    tokenId
    Type
    bigint
    Description

    The ID of the token.

  • Name
    waitForTransaction (optional)
    Type
    boolean
    Description

    If false, the function will return immediately after sending the transaction. Defaults to true.