Skip to content

fix: export the symbols the docs tell people to use - #983

Closed
Dusk1e wants to merge 1 commit into
ProjectOpenSea:mainfrom
Dusk1e:fix/export-documented-symbols
Closed

Dusk1e wants to merge 1 commit into
ProjectOpenSea:mainfrom
Dusk1e:fix/export-documented-symbols

Conversation

@Dusk1e

@Dusk1e Dusk1e commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Problem

The entry point exports Seaport and nothing else, so that is the whole surface a consumer gets without a deep import:

> require("@opensea/seaport-js")
[ 'Seaport' ]

Both order examples in the README are written with ItemType.ERC721, and neither imports it — because there is nowhere to import it from. Copy either example and ItemType is undefined.

fulfillOrder's doc comment has the same gap:

Units to fill are denominated by the max possible size of the order, which is the greatest common denominator (GCD). We expose a helper to get this: getMaximumSizeForOrder

That helper is not exported either.

Fix

Export the two the documentation already promises, and add the import line the README examples were missing. Adding to the entry point breaks nothing — Seaport resolves exactly as before.

While in those two code blocks: the second reached for a bare parseEther where the first uses ethers.parseEther, so it now matches its neighbour.

I stopped there on purpose. The rest of the constants and the input types are still deep-import only, and widening the public surface past what the docs already claim felt like a call to make deliberately rather than as a side effect of this. Happy to extend it if you'd rather the whole surface came out.

Test

test/public-exports.spec.ts asserts the entry point carries the client, ItemType, and getMaximumSizeForOrder. Two of the three go red against the current src/index.ts.

Building and requiring lib/index.js afterwards gives ItemType, Seaport, getMaximumSizeForOrder.

The entry point exports Seaport and nothing else, so that is the whole
surface a consumer gets without a deep import:

  require("@opensea/seaport-js")  ->  [ 'Seaport' ]

Both order examples in the README are written with ItemType.ERC721, and no
example imports it because there is nowhere to import it from. Copying
either one leaves ItemType undefined. fulfillOrder's doc comment has the
same problem: "We expose a helper to get this: getMaximumSizeForOrder", and
that helper is not exported either.

Export the two the documentation already promises, and add the import line
the README examples were missing. Adding to the entry point breaks nothing;
Seaport keeps resolving exactly as it did.

The second example also reached for a bare parseEther while the first uses
ethers.parseEther, so it now matches its neighbour.

Left alone deliberately: the rest of the constants and the input types are
still deep-import only. Widening the public surface further is a call worth
making on purpose rather than as a side effect of a docs fix.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.94%. Comparing base (f618d19) to head (3456062).
⚠️ Report is 368 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #983      +/-   ##
==========================================
+ Coverage   98.27%   98.94%   +0.66%     
==========================================
  Files          35       51      +16     
  Lines       14526    18451    +3925     
  Branches      660      980     +320     
==========================================
+ Hits        14276    18256    +3980     
+ Misses        245      188      -57     
- Partials        5        7       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ryanio

ryanio commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks. Documentation that references a symbol nobody can import is worse than no documentation, so this is worth having.

I agree with where you stopped. Widening the public surface past what the docs already claim is a deliberate decision rather than something to do as a side effect, and holding the line at exactly the two symbols the README and the fulfillOrder doc comment already promise makes the change easy to accept. If you do want to open the rest of the constants and input types, that is worth its own issue first.

Catching the bare parseEther in the second example while you were in there was a nice touch.

This has landed in #985 with seven other contributions from the same day. Closing in favour of that one.

@ryanio ryanio closed this Aug 22, 2026
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.

3 participants