Skip to content

Conversation

andriy-shymkiv
Copy link
Contributor

getDeltaOrders:

  • chainId and status filters
  • removed type=ALL filter option

@github-actions
Copy link

github-actions bot commented Oct 17, 2025

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 15.33 KB (+0.48% 🔺)
dist/sdk.esm.js 15.26 KB (+0.62% 🔺)

Comment on lines +41 to +48
* Filter by any known DeltaAuctionStatus and some custom statuses:
* - **INSUFFICIENT_BALANCE** — returned as SUSPENDED from API
* - **INSUFFICIENT_ALLOWANCE** — returned as SUSPENDED from API
* - **INVALIDATED** — returned as FAILED from API
* - **ACTIVE** — All orders with NOT_STARTED, RUNNING, EXECUTING or SUSPENDED statuses.
* - **INACTIVE** — All orders with EXECUTED, FAILED, EXPIRED, CANCELLED or INVALIDATED statuses.
*/
status?: DeltaOrderFilterByStatus[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like SDK accepting all statuses even those that are never returned because they are internal to API.

It's very useful to query for SUSPENDED and API will return all Orders with INSUFFICIENT_*

On the other hand I do want to keep the option to query for very specific statuses, so maybe your approach with a comprehensive jsdoc comment is the best.

chainId?: number; // @TODO currently not working
/** @description Filter by type. MARKET, LIMIT, or ALL. Default is ALL */
type?: 'MARKET' | 'LIMIT' | 'ALL';
chainId?: number[];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chainIds?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not always require an array? Would be cleaner

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chainIds?

I'd like to keep it the same as API does. chainId=, status=

Why not always require an array? Would be cleaner

Maybe, but why would I pass an array with a single value?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass as array, because it's simpler than a variable type. We have it in a bunch of places: include/exclude methods, dexs, bridges -- off the top of my head

@andriy-shymkiv andriy-shymkiv force-pushed the feat/extend_delta_orders_filtering branch from 55956cf to d3e5555 Compare October 22, 2025 09:22
Comment on lines +117 to +120
const chainIdString = options.chainId
? options.chainId.join(',')
: undefined;
const statusString = options.status ? options.status.join(',') : undefined;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can probably do options.chainId?.join()

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.

2 participants