Skip to content

getRentals

Method to get all rentals for:

  • a specific protected data
  • a specific user

Usage

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

Parameters

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

renterAddress Optional

Type: AddressOrENS

ts
const 
userActiveRentals
= await
dataProtectorSharing
.
getRentals
({
renterAddress
: '0x246bdf...',
});

protectedData Optional

Type: AddressOrENS

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

includePastRentals Optional

Type: boolean
Default: false

ts
const 
userRentals
= await
dataProtectorSharing
.
getRentals
({
renterAddress
: '0x246bdf...',
includePastRentals
: true,
});

Return value

ts
import { type 
GetRentalsResponse
} from '@iexec/dataprotector';
// Child types import type {
ProtectedDataRental
} from '@iexec/dataprotector';

See Type ↗️