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
Type: AddressOrENS
ts
const oneProtectedData =
await dataProtectorSharing.getProtectedDataInCollections({
protectedData: '0x123abc...',
});collectionId
Type: number
ts
const protectedDataByCollection =
await dataProtectorSharing.getProtectedDataInCollections({
collectionId: 12,
});collectionOwner
Type: AddressOrENS
ts
const protectedDataByOwner =
await dataProtectorSharing.getProtectedDataInCollections({
collectionOwner: '0x123...',
});createdAfterTimestamp
Type: number
ts
const latestProtectedData =
await dataProtectorSharing.getProtectedDataInCollections({
createdAfterTimestamp: 1707237580, // Feb 6th, 2024 16:39:40 GMT
});isRentable
Type: boolean
ts
const rentableProtectedData =
await dataProtectorSharing.getProtectedDataInCollections({
isRentable: true,
});isForSale
Type: boolean
ts
const protectedDataForSale =
await dataProtectorSharing.getProtectedDataInCollections({
isForSale: true,
});isDistributed
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
Type: number
ts
const protectedData = await dataProtectorSharing.getProtectedDataInCollections({
collectionId: 12,
page: 3,
pageSize: 25,
});pageSize
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';