-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: Add new order clusters endpoint and enhance contract state filtering #84
feat: Add new order clusters endpoint and enhance contract state filtering #84
Conversation
Changed Files
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR enhances contract management by adding state filtering capabilities and a new endpoint for retrieving clusters associated with orders.
- Added
--state
option tocontracts list
command with validation for "active", "upcoming", or "expired" values insrc/lib/contracts/index.tsx
- Modified
listContracts
function to accept a state parameter and pass it to the API instead of filtering client-side - Added new endpoint
/v0/orders/{id}/clusters
insrc/schema.ts
for retrieving clusters associated with a specific order - Enhanced contract objects with a
state
field throughout the schema with values "Upcoming", "Expired", or "Active" - Added
state
query parameter to/v0/contracts
endpoint for server-side filtering
2 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
const state = showAll | ||
? "all" | ||
: (stateFilter?.toLowerCase() as "expired" | "active" | "upcoming") || | ||
undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: The state logic could be simplified. If showAll
is true, it should override any state filter, but the current implementation still allows both parameters to be used together which might be confusing.
*/ | ||
start_at: string; | ||
/** | ||
* Format: date-time | ||
* @description The time at which the grid should stop placing new orders automatically. Must be on the hour. For sell grids, will be set to the given time (if any) or the end of the backing contract, whichever is sooner. This is not to be confused for the end time of the last order in the grid, i.e. `grid_front + num_orders * order.duration`. | ||
* @description The time at which the grid should stop placing new orders automatically. The grid never places an order whos (compute-available) end time is after this time. For sell grids, will be set to the given time (if any) or the end of the backing contract, whichever is sooner. This is not to be confused for the end time of the last order in the grid, i.e. `grid_front + num_orders * order.duration`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: There's a typo in the description - "whos" should be "whose" when referring to the order's end time
No description provided.