Skip to content

getCollectionSubscriptions

Method to get all subscriptions for:

  • a specific collection
  • a specific user

Usage

ts

const 
collectionActiveSubscriptions
=
await
dataProtectorSharing
.
getCollectionSubscriptions
({
collectionId
: 9,
});

Parameters

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

subscriberAddress

AddressOrENS | undefined

ts

const 
userActiveSubscriptions
=
await
dataProtectorSharing
.
getCollectionSubscriptions
({
subscriberAddress
: '0x246bdf...',
});

collectionId

number | undefined

ts

const 
collectionActiveSubscriptions
=
await
dataProtectorSharing
.
getCollectionSubscriptions
({
collectionId
: 9,
});

includePastSubscriptions

boolean | undefined

default: false

ts

const 
userRentals
= await
dataProtectorSharing
.
getCollectionSubscriptions
({
subscriberAddress
: '0x246bdf...',
includePastSubscriptions
: true,
});

Return value

ts
import { type 
GetCollectionSubscriptionsResponse
} from '@iexec/dataprotector';
// Child types import { type
CollectionSubscription
} from '@iexec/dataprotector';

See Type ↗️