execute

Handles the execution of a specific step.

execute(params)Receipt

Parameter
Type
Required
Description

account

Buyer’s account

confirmations

number

Number of confirmation blocks (Default 1)

Returns: Receipt

Example:

// account is created via createAccountEthers5 / createAccountViem
const receipts = []

for (const step of preparedPurchase.steps) {
  const receipt = await step.execute(account)
  receipts.push(receipt)

  console.log('Confirmed tx:', receipt.transactionReceipt.txHash)

  if (receipt.order) {
    receipt.order.items.forEach((item) => {
      console.log(`Minted token ${item.token.tokenId}`)
    })
  }
}

Last updated