- Notifications
You must be signed in to change notification settings - Fork 990
feat: add validateOrderOnchain method for Seaport integration #1729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This adds a new method to validate orders onchain using Seaport's validate() method, which makes orders cheaper to fulfill since signature verification is skipped during fulfillment. - Add validateOrderOnchain method to OpenSeaSDK - Include comprehensive JSDoc documentation explaining benefits - Add integration test for Polygon network using existing test infrastructure - Bump package version to 7.2.1 The method submits orders onchain and pre-validates them using Seaport. While not strictly required (orders can be submitted to the API for free), this approach reduces gas costs during fulfillment at the expense of upfront validation gas costs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixes TypeError when domain parameter is undefined by conditionally calling the validate method with or without the domain parameter. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add validateOrderOnchain method to SDK for onchain order validation - Method calls seaport.validate() to submit orders onchain for pre-validation - Add integration test for Polygon network with proper test flow - Remove domain parameter and signature validation per requirements - Bump package version to 7.2.1 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove submitOrder parameter from createListing/createOffer - Extract order building logic into reusable _buildListingOrder/_buildOfferOrder helpers - Update validateOrderOnchain to accept OrderComponents instead of OrderV2 - Add createListingAndValidateOnchain/createOfferAndValidateOnchain convenience methods - Update integration tests to use new convenience methods - Refactor createListing/createOffer to use internal helpers (DRY) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update offer test to use OFFER_AMOUNT constant matching other tests - Add comprehensive API verification for both listing and offer tests - Tests now create orders, validate onchain, then verify orders exist in OpenSea API - Enhanced error messages with specific order hashes for debugging - Add proper timeout and retry logic for API polling - Tests fail explicitly if orders not found in API within 10 seconds 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add getRandomSalt() function to test/integration/setup.ts - Generate cryptographically random 32-byte salt values as hex strings - Update both listing and offer tests to use random salts - Ensures order uniqueness and prevents hash collisions in tests - Follows same pattern as existing getRandomExpiration() function 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Update getRandomSalt() to return bigint instead of hex string - Ensures proper type compatibility with order creation methods - Maintains cryptographically secure 32-byte random salt generation - BigInt conversion preserves full precision of random bytes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove createListing/createOffer calls that submit orders to API first - Build order components directly using private helper methods - Tests now properly validate pure onchain validation without API dependency - Remove API verification logic since orders aren't submitted beforehand - Focus on testing the core onchain validation functionality - Use random salts for order uniqueness without API conflicts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace complex private method calls with createListingAndValidateOnchain - Replace complex private method calls with createOfferAndValidateOnchain - Much cleaner and simpler test implementation - Tests now use the public API as intended - Remove unnecessary OrderComponents import and type casting - Add random salt generation for unique orders 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
chavezcossbrandon-gif approved these changes Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
This adds a new method to validate orders onchain using Seaport's validate() method, which makes orders cheaper to fulfill since signature verification is skipped during fulfillment.
The method submits orders onchain and pre-validates them using Seaport. While not strictly required (orders can be submitted to the API for free), this approach reduces gas costs during fulfillment at the expense of upfront validation gas costs.
🤖 Generated with Claude Code
Motivation
Solution