Skip to content

fix: add ORDER event type to AssetEventType enum#1927

Closed
MuhammadMinhaj wants to merge 1 commit intoProjectOpenSea:mainfrom
MuhammadMinhaj:patch-1
Closed

fix: add ORDER event type to AssetEventType enum#1927
MuhammadMinhaj wants to merge 1 commit intoProjectOpenSea:mainfrom
MuhammadMinhaj:patch-1

Conversation

@MuhammadMinhaj
Copy link
Contributor

The OpenSea REST API returns event_type "order" for listing events, but the SDK enum only had "listing". This caused listing events to fall through unhandled when consuming real API responses.

Added ORDER = "order" to AssetEventType. LISTING is kept for backwards compatibility. No breaking changes.

Motivation

The OpenSea Events API (/api/v2/events) returns event_type: "order" for listing events in real API responses. The SDK's AssetEventType enum only defined "listing", causing a mismatch where listing events were silently unhandled when processing live API data.

Solution

Added ORDER = "order" to the AssetEventType enum. LISTING is retained for backwards compatibility. This is a purely additive change with no breaking changes.

The OpenSea REST API returns event_type "order" for listing events,
but the SDK enum only had "listing". This caused listing events to
fall through unhandled when consuming real API responses.

Added ORDER = "order" to AssetEventType. LISTING is kept for
backwards compatibility. No breaking changes.
@ryanio
Copy link
Collaborator

ryanio commented Mar 11, 2026

Thanks for identifying this gap @MuhammadMinhaj! The API does indeed return event_type: "order" in responses.

We've opened #1929 which builds on your change with a couple of additions:

  • Added a corresponding OrderEvent response type (with asset optional for collection/trait offers, criteria optional, and order_type field)
  • Added OrderEvent to the AssetEvent union so consumers can properly type-narrow
  • Noted that "order" is a response-only value (the API query filter accepts the specific types like listing, offer, etc.)

You're credited as co-author on the commit. Closing in favor of #1929.

@ryanio ryanio closed this Mar 11, 2026
@MuhammadMinhaj
Copy link
Contributor Author

Thanks for the update and improvements! Appreciate the co-author credit. 🙌

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