From d9b01f99e3fb848d0748398aa87f7212619b15c4 Mon Sep 17 00:00:00 2001 From: SeddikBellamine Date: Wed, 25 Jun 2025 15:51:42 +0200 Subject: [PATCH] docs(dataprotector): add dataMaxPrice & appMaxPrice & workerpoolMaxPrice options option --- .../dataProtectorCore/processProtectedData.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tools/dataProtector/dataProtectorCore/processProtectedData.md b/tools/dataProtector/dataProtectorCore/processProtectedData.md index b3d7c43..30e124d 100644 --- a/tools/dataProtector/dataProtectorCore/processProtectedData.md +++ b/tools/dataProtector/dataProtectorCore/processProtectedData.md @@ -333,6 +333,73 @@ const processProtectedDataResponse = }); ``` +### dataMaxPrice + +**Type:** `number` +**Default:** `0` + +Allows specifying the maximum amount (in nRLC) you are willing to pay the +protected data owner for using their data. The owner of the protected data +receives this as a payment for sharing their data. + +```ts twoslash +import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector'; + +const web3Provider = getWeb3Provider('PRIVATE_KEY'); +const dataProtectorCore = new IExecDataProtectorCore(web3Provider); +// ---cut--- +const processProtectedDataResponse = + await dataProtectorCore.processProtectedData({ + protectedData: '0x123abc...', + app: '0x456def...', + dataMaxPrice: 42, // [!code focus] + }); +``` + +### appMaxPrice + +**Type:** `number` +**Default:** `0` + +Allows specifying the maximum amount (in nRLC) you are willing to pay the iApp +provider for using the deployed application. + +```ts twoslash +import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector'; + +const web3Provider = getWeb3Provider('PRIVATE_KEY'); +const dataProtectorCore = new IExecDataProtectorCore(web3Provider); +// ---cut--- +const processProtectedDataResponse = + await dataProtectorCore.processProtectedData({ + protectedData: '0x123abc...', + app: '0x456def...', + appMaxPrice: 42, // [!code focus] + }); +``` + +### workerpoolMaxPrice + +**Type:** `number` +**Default:** `0` + +Allows specifying the maximum amount you want to pay the workerpool provider for +using their infrastructure to run the iApp in nRLC. + +```ts twoslash +import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector'; + +const web3Provider = getWeb3Provider('PRIVATE_KEY'); +const dataProtectorCore = new IExecDataProtectorCore(web3Provider); +// ---cut--- +const processProtectedDataResponse = + await dataProtectorCore.processProtectedData({ + protectedData: '0x123abc...', + app: '0x456def...', + workerpoolMaxPrice: 42, // [!code focus] + }); +``` + ### onStatusUpdate **Type:** `OnStatusUpdateFn`