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

AddressOrENS | undefined

ts

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

protectedData

AddressOrENS | undefined

ts

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

includePastRentals

boolean | undefined

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 ↗️