fulfillListing

Action for fulfilling a listing.

import

import { fulfillListing } from '@arkproject/core'

Usage

import { fulfillListing } from '@arkproject/core'
import { config } from './config'

await fulfillListing(config, {
  starknetAccount: '0x0...',
  fulfillListingInfo: {
    orderHash: '0x...',
    tokenAddress:
      '0x02acee8c430f62333cf0e0e7a94b2347b5513b4c25f699461dd8d7b23c072478',
    tokenId: BigInt(1),
    brokerId: '0x...',
  },
  approveInfo: {
    currencyAddress: '0x...',
    amount: BigInt(1000),
  },
})

Parameters

starknetAccount

AccountInterface

The Starknet account used for the transaction.

fulfillListingInfo

FulfillListingInfo

Informations about the listing to fulfill, includes :

  • orderHash: bigint
  • tokenAddress: string
  • tokenId: bigint
  • brokerId: string

approveInfo

ApproveErc20Info

Informations about the ERC20 token to approve, includes :

  • currencyAddress: string
  • amount: bigint

Function Description

fulfillListing starts by extracting details from the provided parameters, including Starknet and Arkchain accounts, and information about the listing to be fulfilled. It retrieves the chain ID and constructs a FulfillInfo object with the necessary data. The function then calls _fulfillOrder to execute the transaction, completing the fulfillment process of the listing.