Skip to content

Using the sdk fulfillorder get error "You must supply the appropriate criterias for criteria based items" #1795

@BernardGeorge

Description

@BernardGeorge

Component

Other (please describe)

Have you ensured that all of these are up to date?

  • opensea-js
  • Node (minimum v16)

What version of opensea-js are you on?

8.0.3

What function is the bug in?

sdk.fulfillOrder

Operating System

macOS (Apple Silicon)

Describe the bug

📦 Environment

  • opensea-js version: 8.0.0 (also tested with 7.4.0)
  • @opensea/seaport-js version: 4.0.5
  • ethers version: 6.9.0
  • Node.js version: v23.7.0
  • Network: Arbitrum
  • Protocol Address: 0x0000000000000068F116a894984e2DB1123eB395 (Seaport 1.6)

When attempting to fulfill a Collection Offer using sdk.fulfillOrder() , the transaction fails with the error:

const transactionHash = await sdk.fulfillOrder({
order: bestOffer,
accountAddress: accountAddress,
assetContractAddress: '0x80c3c93e6c3cde742fa0435c38f1044ca401e585',
tokenId: '1',
});

Result: ❌ Fails with error:

Error: You must supply the appropriate criterias for criteria based items
    at fulfillStandardOrder (.../seaport-js/lib/utils/fulfill.js:204:15)
    at Seaport.fulfillOrder (.../seaport-js/lib/seaport.js:547:51)
    at FulfillmentManager.fulfillOrder (.../opensea-js/lib/sdk/fulfillment.js:121:39)

The problem: Although assetContractAddress and tokenId are passed to the OpenSea API's generateFulfillmentData endpoint, they are NOT converted to considerationCriteria when calling the underlying seaport.fulfillOrder() method.

💡 Expected Behavior

sdk.fulfillOrder() should work for Collection Offers when assetContractAddress and tokenId are provided:

let considerationCriteria = [];
  if (assetContractAddress && tokenId) {
    considerationCriteria = [{
      identifier: tokenId,
      proof: []
    }];
  }
  
  const seaport = getSeaportInstance(protocolAddress, this.context.seaport);
  const { executeAllActions } = await seaport.fulfillOrder({
    order: protocolData,
    accountAddress,
    recipientAddress,
    unitsToFill: effectiveUnitsToFill,
    extraData,
    domain,
    overrides,
    offerCriteria: [],              // ✅ ADD THIS
    considerationCriteria,          // ✅ ADD THIS
  });

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions