Skip to content

Conversation

ryanio
Copy link
Collaborator

@ryanio ryanio commented Jul 29, 2025

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

Motivation

Solution

ryanio and others added 10 commits July 29, 2025 13:17
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>
@ryanio ryanio merged commit 5833bf1 into main Jul 31, 2025
11 of 12 checks passed
@ryanio ryanio deleted the add-seaport-onchain-validation branch July 31, 2025 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants