Skip to content

getProtectedDataInCollections

Method to get protected data that are in collections.

A protected data can only be in one collection at a time.

Results are ordered by creationTimestamp desc.

Usage

ts

const 
protectedData
=
await
dataProtectorSharing
.
getProtectedDataInCollections
();

Parameters

ts
import { type 
GetProtectedDataInCollectionsParams
} from '@iexec/dataprotector';

protectedData

AddressOrENS | undefined

ts

const 
oneProtectedData
=
await
dataProtectorSharing
.
getProtectedDataInCollections
({
protectedData
: '0x123abc...',
});

collectionId

number | undefined

ts

const 
protectedDataByCollection
=
await
dataProtectorSharing
.
getProtectedDataInCollections
({
collectionId
: 12,
});

collectionOwner

AddressOrENS | undefined

ts

const 
protectedDataByOwner
=
await
dataProtectorSharing
.
getProtectedDataInCollections
({
collectionOwner
: '0x123...',
});

createdAfterTimestamp

number | undefined

ts

const 
latestProtectedData
=
await
dataProtectorSharing
.
getProtectedDataInCollections
({
createdAfterTimestamp
: 1707237580, // Feb 6th, 2024 16:39:40 GMT
});

isRentable

boolean | undefined

ts

const 
rentableProtectedData
=
await
dataProtectorSharing
.
getProtectedDataInCollections
({
isRentable
: true,
});

isForSale

boolean | undefined

ts

const 
protectedDataForSale
=
await
dataProtectorSharing
.
getProtectedDataInCollections
({
isForSale
: true,
});

isDistributed

boolean | undefined

Used to filter protected data that are either for sale, renting or part of a subscription.

ts

const 
protectedDataForSale
=
await
dataProtectorSharing
.
getProtectedDataInCollections
({
isDistributed
: true,
});

page

number | undefined

ts

const 
protectedData
= await
dataProtectorSharing
.
getProtectedDataInCollections
({
collectionId
: 12,
page
: 3,
pageSize
: 25,
});

pageSize

number | undefined

Value between 10 and 1000.

ts

const 
protectedData
= await
dataProtectorSharing
.
getProtectedDataInCollections
({
collectionId
: 12,
page
: 3,
pageSize
: 25,
});

Return value

ts
import type { 
GetProtectedDataInCollectionsResponse
} from '@iexec/dataprotector';
// Child types import type {
ProtectedDataInCollection
,
RentingParams
,
SellingParams
,
} from '@iexec/dataprotector';

See Type ↗️