Skip to content

Fix incorrect OrderSide in createCollectionOffer price validation#1913

Closed
Viktohblake wants to merge 3 commits intoProjectOpenSea:mainfrom
Viktohblake:fix-incorrect-orderside
Closed

Fix incorrect OrderSide in createCollectionOffer price validation#1913
Viktohblake wants to merge 3 commits intoProjectOpenSea:mainfrom
Viktohblake:fix-incorrect-orderside

Conversation

@Viktohblake
Copy link

@Viktohblake Viktohblake commented Feb 23, 2026

Motivation

createCollectionOffer in src/sdk/orders.ts passes OrderSide.LISTING to the price parameters callback (_getPriceParameters) instead of OrderSide.OFFER. This bypasses the validation that prevents offers from using native ETH:

if (isEther && orderSide === OrderSide.OFFER) {
throw new Error("Offers must use wrapped ETH or an ERC-20 token.");
}

Seaport offers require ERC-20 token allowances; native ETH cannot be approved for spending by the Seaport contract. Both createOffer() and createBulkOffers() correctly pass OrderSide.OFFER, but createCollectionOffer() was incorrectly using OrderSide.LISTING, making it the only offer method that skips this check.

Solution

Changed OrderSide.LISTING to OrderSide.OFFER in createCollectionOffer's call to getPriceParametersCallback, aligning it with the other offer creation methods. This ensures native ETH is correctly rejected for collection offers, preventing invalid on-chain orders that would waste gas fees.

createCollectionOffer was passing OrderSide.LISTING to
getPriceParametersCallback instead of OrderSide.OFFER. This
bypassed the validation that prevents offers from using native
ETH (which is invalid since offers require wrapped ERC-20 tokens
for allowance-based approvals). Changed to OrderSide.OFFER to
match the behavior of createOffer and createBulkOffers.
ryanio added a commit that referenced this pull request Feb 25, 2026
createCollectionOffer was passing OrderSide.LISTING to getPriceParametersCallback
instead of OrderSide.OFFER, bypassing the validation that prevents offers from
using native ETH. This aligns it with createOffer and createBulkOffers.

Based on #1913 by @Viktohblake.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@ryanio
Copy link
Collaborator

ryanio commented Feb 25, 2026

Thanks for the contribution @Viktohblake! Great catch on the OrderSide bug. We've built on top of your fix in #1916 — same core change, just without the unrelated package-lock.json modifications. Closing in favor of that PR.

@ryanio ryanio closed this Feb 25, 2026
ryanio added a commit that referenced this pull request Feb 25, 2026
)

createCollectionOffer was passing OrderSide.LISTING to getPriceParametersCallback
instead of OrderSide.OFFER, bypassing the validation that prevents offers from
using native ETH. This aligns it with createOffer and createBulkOffers.

Based on #1913 by @Viktohblake.

Co-authored-by: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants