Skip to content

Commit 55956cf

Browse files
getDeltaOrders/ allow non-array filters for chainId and status
1 parent d3e5555 commit 55956cf

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/methods/delta/getDeltaOrders.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type OrdersFilter = {
3535
/** @description Pagination option, limit. Default 100 */
3636
limit?: number;
3737
/** @description Filter by chainId, without this filter, orders from all chains are returned */
38-
chainId?: number[];
38+
chainId?: number | number[];
3939
/**
4040
* @description
4141
* Filter by any known DeltaAuctionStatus and some custom statuses:
@@ -45,7 +45,7 @@ type OrdersFilter = {
4545
* - **ACTIVE** — All orders with NOT_STARTED, RUNNING, EXECUTING or SUSPENDED statuses.
4646
* - **INACTIVE** — All orders with EXECUTED, FAILED, EXPIRED, CANCELLED or INVALIDATED statuses.
4747
*/
48-
status?: DeltaOrderFilterByStatus[];
48+
status?: DeltaOrderFilterByStatus | DeltaOrderFilterByStatus[];
4949
/** @description Filter by type. MARKET, LIMIT. Orders with both types are returned if not specified */
5050
type?: 'MARKET' | 'LIMIT';
5151
};
@@ -115,9 +115,15 @@ export const constructGetDeltaOrders = ({
115115

116116
const getDeltaOrders: GetDeltaOrders = async (options, requestParams) => {
117117
const chainIdString = options.chainId
118-
? options.chainId.join(',')
118+
? Array.isArray(options.chainId)
119+
? options.chainId.join(',')
120+
: options.chainId.toString()
121+
: undefined;
122+
const statusString = options.status
123+
? Array.isArray(options.status)
124+
? options.status.join(',')
125+
: options.status.toString()
119126
: undefined;
120-
const statusString = options.status ? options.status.join(',') : undefined;
121127

122128
const search = constructSearchString<OrderFiltersQuery>({
123129
userAddress: options.userAddress,

0 commit comments

Comments
 (0)