type GetItemsFilter = {
from?: number;
to?: number;
collectionId?: string;
searchString?: string;
groupingValue?: string;
fetchAttributes?: boolean;
sort?: 'name';
order?: 'asc' | 'desc';
attributes?: AttributeFilter[];
appId?: string;
group?: boolean;
externalId?: string;
};
export type AttributeFilter = {
name: string;
displayType: 'string' | 'number';
operation: 'equal' | 'greater' | 'lower';
value: string | number;
};
// Example: Filter items from a specific collection with attributes
const params: GetItemsFilter = {
from: 0,
to: 20,
collectionId: '64b93458b3a3a4daa4404455',
attributes: [
{
name: 'element',
displayType: 'string',
operation: 'equal',
value: 'Wind',
},
{
name: 'edition',
displayType: 'string',
operation: 'matches',
value: 'Fi*',
},
],
};
const inventory = await account.items.getItemsInventory(params);