Skip to content

setProtectedDataForSale

Method to set a protected data for sale.

During a successful sale, the ownership of the protected data is transferred to the buyer. The buyer will then be able to set their own pricing parameters, or simply keep the protected data for their own use.

Usage

ts
const 
setForSaleResult
= await
dataProtectorSharing
.
setProtectedDataForSale
({
protectedData
: '0x123abc...',
price
: 2, // 2 nRLC
});

Parameters

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

protectedData Required *

Type: AddressOrENS

Address of the protected data that you'd like to set for sale.

ts
const 
setForSaleResult
= await
dataProtectorSharing
.
setProtectedDataForSale
({
protectedData
: '0x123abc...',
price
: 2, // 2 nRLC
});

price Required *

Type: number

The price in nano RLC (nRLC) you ask from someone who wants to buy the protected data.

ts
const 
setForSaleResult
= await
dataProtectorSharing
.
setProtectedDataForSale
({
protectedData
: '0x123abc...',
price
: 2, // 2 nRLC
});

Return value

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

See SuccessWithTransactionHash