-
Notifications
You must be signed in to change notification settings - Fork 976
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
API Validation Enhancement api.ts #1598
Conversation
nice, thanks for this! good improvements. can you check using the OrderSide and OrderProtocol enums instead of hardcoding the options? |
Looks like it's on track with a few tweaks @ryanio |
hey @ryanio can you check please? |
lgtm, thank you! |
it looks like some errors on CI, once you can resolve i'll merge :) |
I had some problems with actions, I had to open a new pr, I would appreciate it if you could take a look when you are available @ryanio #1601 (comment) |
Motivation
The current implementation of the
postOrder
method in the OpenSea SDK lacks proper input validation, which can lead to unnecessary API calls and unclear error messages. This is evidenced by the existing TODO comment:// TODO: Validate apiOptions. Avoid API calls that will definitely fail
This enhancement aims to:
Related Issue: N/A (TODO comment in codebase)
Solution
The solution implements comprehensive validation checks for the
postOrder
method in the OpenSea SDK. Here's the detailed implementation:Validation Checks
Basic Input Validation
order
andapiOptions
parameters are providedProtocol Validation
Order Side Validation
Protocol Address Validation
Benefits
Developer Experience
Performance
Reliability
Testing
The following test cases should be added:
Checklist