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 Optional

Type: AddressOrENS

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

collectionId Optional

Type: number

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

collectionOwner Optional

Type: AddressOrENS

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

createdAfterTimestamp Optional

Type: number

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

isRentable Optional

Type: boolean

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

isForSale Optional

Type: boolean

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

isDistributed Optional

Type: boolean

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 Optional

Type: number

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

pageSize Optional

Type: number
Range: [10...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 ↗️