-
Notifications
You must be signed in to change notification settings - Fork 995
fix: use OpenSea API fulfillment transaction data directly #1803
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
Fixes #1795 Changes: - Modified fulfillOrder to use transaction data from OpenSea API's generateFulfillmentData endpoint instead of using seaport-js - This ensures that collection offers are fulfilled correctly with proper criterias automatically generated by the API - Deprecated recipientAddress, unitsToFill, and domain parameters as these are now determined by the API transaction data - Updated tests to reflect the new implementation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Removed recipientAddress, unitsToFill, and domain parameters - These are now determined by the OpenSea API transaction data - Updated public SDK method and internal FulfillmentManager - Removed tests for deprecated parameters - Updated documentation
- Encode transaction calldata using ethers.Interface with function signature - Pass structured input_data values from API to encoded function - Updated type definitions to support new API response structure - Updated test mocks with proper function signatures and input data
- Use existing context.requireAccountIsAvailable check - Simplify code by directly using context.signerOrProvider as Signer
- Order parameters correctly based on function name - Handle fulfillAdvancedOrder, fulfillBasicOrder, and fulfillOrder - Provide default values for optional parameters like fulfillerConduitKey
- Keep original input_data type with orders field only - Use 'as any' type assertion to access dynamic fields - Maintains backward compatibility
- Created union type with specific variants for each Seaport function - fulfillAdvancedOrder: advancedOrder, criteriaResolvers, fulfillerConduitKey, recipient - fulfillBasicOrder: basicOrderParameters - fulfillOrder: order, fulfillerConduitKey, recipient - Legacy: orders array for backward compatibility - Added type guards in fulfillment code to narrow union type - Removed 'as any' assertion - now fully typed
|
@ryanio When can this fix be merged? |
Collaborator
Author
|
@BernardGeorge sorry had some pre-work that had to be done on the API side, this should be ready now will try to merge and publish now, just have to fix CI |
- Add unitsToFill parameter to both listing and offer fulfillment - For listings: defaults to remaining quantity on API side - For offers: defaults to 1 on API side - Add recipientAddress parameter to listing fulfillment only - Allows specifying NFT recipient when fulfilling listings - Not applicable for offers - Update API layer to pass new parameters through payload functions - Add test for recipientAddress parameter - Update tests to verify unitsToFill behavior - Bump version to 8.0.4
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.
Summary
Fixes #1795
This PR modifies the
fulfillOrdermethod to use transaction data directly from the OpenSea API'sgenerateFulfillmentDataendpoint. The transaction is encoded using ethers and sent directly, ensuring that collection offers (and trait offers) are fulfilled correctly with proper criterias automatically generated by the API.Changes
fulfillOrderto get transaction data from OpenSea API'sgenerateFulfillmentDataendpointethers.Interfaceto encode the transaction calldata from the API's function signature and structured input datarecipientAddress,unitsToFill, anddomain(these are now determined by the API)How it works
generateFulfillmentDatawith order hash, account address, and optional asset detailsfulfillAdvancedOrder(...))advancedOrder,criteriaResolvers,recipient)ethers.Interfaceto encode the function call with the structured input dataWhy this approach?
The OpenSea API's
generateFulfillmentDataendpoint returns complete transaction data with all necessary parameters properly encoded. By using this data directly:considerationCriteriawhenassetContractAddressandtokenIdare providedBreaking Changes
Removed parameters from
fulfillOrder:domain- Domain attribution is now included in the API transaction dataTest plan
🤖 Generated with Claude Code