Skip to content

Commit 3e9e758

Browse files
committed
ADDS more filtering options to the orderbook search
1 parent f218bf6 commit 3e9e758

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

src/sdk/v4/orderbook.ts

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,35 @@ const postOrderToOrderbook = async (
7474
return orderPostResult;
7575
};
7676

77+
/**
78+
* Available query parameters for searching the orderbook
79+
*/
7780
export interface SearchOrdersParams {
78-
erc20Token?: string;
79-
nftTokenId?: string | string[];
80-
nftToken?: string;
81-
nftType?: string;
82-
chainId?: string;
83-
maker?: string;
84-
taker?: string;
85-
nonce?: string | string[];
81+
nftTokenId: string | string[];
82+
erc20Token: string | string[];
83+
nftToken: string | string[];
84+
nftType: 'ERC721' | 'ERC1155';
85+
chainId: string | number | string[] | number[];
86+
maker: string;
87+
taker: string;
88+
nonce: string | string[];
89+
offset: string | number;
90+
limit: string | number;
91+
sellOrBuyNft: 'sell' | 'buy';
92+
direction: '0' | '1';
8693
// Defaults to only 'open' orders
87-
status?: 'open' | 'filled' | 'expired' | 'cancelled' | 'all';
94+
status: 'open' | 'filled' | 'expired' | 'cancelled' | 'all';
95+
visibility: 'public' | 'private';
96+
valid: 'valid' | 'all';
8897
}
8998

99+
/**
100+
* Search through the public hosted orderbook
101+
* @param filters Optional query param filters
102+
* @param requestOptions Fetch options/overrides
103+
* @param fetchFn Optional fetch function override. Uses unfetch by default.
104+
* @returns
105+
*/
90106
const searchOrderbook = async (
91107
filters?: Partial<SearchOrdersParams>,
92108
requestOptions?: Partial<OrderbookRequestOptions>,

0 commit comments

Comments
 (0)