Skip to content

feat: cow api integration #8

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
merged 6 commits into from
Feb 9, 2025
Merged

feat: cow api integration #8

merged 6 commits into from
Feb 9, 2025

Conversation

lumoswiz
Copy link
Owner

@lumoswiz lumoswiz commented Feb 8, 2025

This PR adds CoW API integration for quote and order submission, with order storage for later use with TradingModule.

Changes:

  • Add CoW API quote and order submission
  • Add error handling for API responses
  • Add order storage with encoded GPv2Order.Data
  • Move GPv2Order ABI to separate file

Add ABI loading helper to reduce duplication
Add quote payload construction for CoW API
Add initial block handler for GNO/COW quotes
Use Python booleans for JSON conversion
Add API constants for CoW Swap endpoints
Add quote payload construction with presign scheme
Add quote request function with basic error handling
Test successful quote request for GNO/COW pair
Add order payload construction from quote response
Add order submission function to /orders endpoint
Add create_and_submit_order function that combines quote and order flow
Clean up error handling in API functions
Strip quotes from order UID response
Add order storage in CSV with encoded GPv2Order.Data struct
Move GPv2Order ABI to separate file
Add order saving on successful submission
Store order parameters directly in CSV instead of encoding them. This makes it easier to:
- Read and debug orders
- Construct GPv2Order.Data when needed
- Maintain order data
@lumoswiz lumoswiz marked this pull request as ready for review February 9, 2025 22:00
@lumoswiz lumoswiz merged commit 7640419 into main Feb 9, 2025
4 checks passed
@lumoswiz lumoswiz deleted the feat/cow-api-integration branch February 9, 2025 22:00
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.

1 participant