From 94d04cd255f8d9e6f09c89e500acd318a0d857ca Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Fri, 26 Sep 2025 10:08:11 +0200 Subject: [PATCH 1/2] refactor: remove outdated migration guide and glossary terms --- .vitepress/sidebar.ts | 4 - .../dataProtector/migrate-from-v1.md | 146 ------------------ src/references/glossary.md | 16 -- 3 files changed, 166 deletions(-) delete mode 100644 src/references/dataProtector/migrate-from-v1.md diff --git a/.vitepress/sidebar.ts b/.vitepress/sidebar.ts index 92129a2..f5f3deb 100644 --- a/.vitepress/sidebar.ts +++ b/.vitepress/sidebar.ts @@ -432,10 +432,6 @@ export function getSidebar() { }, ], }, - { - text: 'Migrate from v1 to v2', - link: '/references/dataProtector/migrate-from-v1', - }, ], }, { diff --git a/src/references/dataProtector/migrate-from-v1.md b/src/references/dataProtector/migrate-from-v1.md deleted file mode 100644 index 90640e5..0000000 --- a/src/references/dataProtector/migrate-from-v1.md +++ /dev/null @@ -1,146 +0,0 @@ ---- -title: Migrate from V1 to V2 -description: - Follow this guide to migrate your DataProtector project from v1 to v2beta with - the latest npm package ---- - -# Migrate from V1 to V2 - -::: tip - -This page concerns projects created with DataProtector prior or equal to version -1.0.0 - -::: - -```sh -npm install @iexec/dataprotector@latest -``` - -## Constructor - -The instantiation process has been updated to accommodate **new modular -architecture** introduced in version 2. This change allows for more flexibility -and enables the use of specific functionalities tailored to the developers' -needs. - -When instantiating the IExecDataProtector object, reference the _dataProtector_ -property to use core methods. Newer versions allow to use extended methods using -the _dataProtectorSharing_ property. - -```js -// 1.0.0 and before -const dataProtector = new IExecDataProtector(web3Provider); // [!code --] - -// AFTER 2.0.0 -// with Umbrella Module -const dataProtector = new IExecDataProtector(web3Provider).dataProtector; // [!code ++] -// Or with Core Module -const dataProtector = new IExecDataProtectorCore(web3Provider); // [!code ++] -``` - -## Methods - -Some methods were renamed to standardize the SDK, but they still provide the -same functionalities as before. - -### Rename `fetchProtectedData` & Add New Filtering Param - -```js -await dataProtector.fetchProtectedData({ // [!code --] -await dataProtector.getProtectedData({ // [!code ++] - owner: '0xa0c15e...', - creationTimestampGte: 1707237580, // Feb 6th, 2024 16:39:40 GMT // [!code ++] -}); -``` - -### Rename `fetchGrantedAccess` - -```js -await dataProtector.fetchGrantedAccess({ // [!code --] -await dataProtector.getGrantedAccess({ // [!code ++] - protectedData: '0x123abc...', - authorizedApp: '0x456def...', - owner: '0xa0c15e...', -}); -``` - -### Removed `protectDataObservable` - -The `protectDataObservable` function has been removed and its functionality has -been integrated into the `protectData` method with a new optional parameter. -This parameter is a callback function that provides status updates during the -data protection process. This change simplifies the API and enhances flexibility -in handling the protection process status updates. - - -```ts twoslash -import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector'; - -const web3Provider = getWeb3Provider('PRIVATE_KEY'); -const dataProtectorCore = new IExecDataProtectorCore(web3Provider); -// ---cut--- -const protectedData = await dataProtectorCore.protectData({ - name: 'myEmail', - data: { - email: 'example@gmail.com', - }, - onStatusUpdate: ({ title, isDone }) => { // [!code ++] - console.log(title, isDone); // [!code ++] - }, // [!code ++] -}); -``` - - -### Removed `revokeAllAccessObservable` - -Similarly, the `revokeAllAccessObservable` method has been replaced for -`revokeAllAccess` which does the same thing as `revokeAllAccessObservable` but -includes an optional callback function parameter. This callback allows -developers to receive feedback about the revocation status of the process, -providing more control and better handling of the process. - - -```ts twoslash -import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector'; - -const web3Provider = getWeb3Provider('PRIVATE_KEY'); -const dataProtectorCore = new IExecDataProtectorCore(web3Provider); -// ---cut--- -const allAccessRevoked = await dataProtectorCore.revokeAllAccess({ - protectedData: '0x123abc...', - onStatusUpdate: ({ title, isDone }) => { // [!code ++] - console.log(title, isDone); // [!code ++] - }, // [!code ++] -}); - -``` - - -::: tip - -The introduction of callback functions in `protectData` and `revokeAllAccess` -methods allows for real-time status updates, making the data protection and -access revocation processes more interactive and manageable. - -::: - -## Protected data schema - -The serialization of the data protected by `protectData()` has been changed to -support a wider range of numbers, and extend the support for processing -protected data in non-JS-based applications. - -The new serialization mechanism is based on the [Borsh](https://borsh.io/) -specification. - -Consequently, the data schemas associated with protected data have changed. - -| data type | v1 data schema | v2 data schema | -| --------- | ----------------------------------------------- | ---------------------------------------------- | -| boolean | `"boolean"` | `"bool"` | -| number | `"number"`
restricted to JS safe integers | `"f64"` | -| bigint | not supported | `"i128"`
restricted to 128 bits integers | -| string | `"string"` | `"string"` | -| binary | detected mime type | detected mime type | diff --git a/src/references/glossary.md b/src/references/glossary.md index 9eba3e9..bfdc4ff 100644 --- a/src/references/glossary.md +++ b/src/references/glossary.md @@ -245,14 +245,6 @@ See [Deal](#deal) and [PoCo](#poco-proof-of-contribution) for more information. ## O -### Oilers - -A term of affection used to designate the iExec community. Oilers are said to be -holding "digital oil". This term could also be in reference to the iExec -whitepaper that states: " iExec introduces a new paradigm in cloud computing: it -will allow the trading of computing resources as commodities; in the same way -markets may observe with resources such as oil, gold or rice." - ### Oracle Data feeds that connect the off-chain world to blockchain products. Oracles act @@ -424,14 +416,6 @@ special security measures that keep its contents completely private and secure. ## W -### Whitepaper - -Explain the purpose and technology behind a project. Producing a whitepaper is a -key step for a crypto startup to help investors understand technical information -about its concept; whitepaper usually include a roadmap for how the project -plans to grow and succeed. iExec's whitepaper is available at -[iEx.ec/whitepaper](https://www.iex.ec/whitepaper) - ### Workers Individuals or companies who own computing resources and are willing to make From 77a2d3294bd77cabd61543fd536f3d342d68944f Mon Sep 17 00:00:00 2001 From: Le-Caignec Date: Fri, 26 Sep 2025 10:27:12 +0200 Subject: [PATCH 2/2] refactor: clean up unused script tags in documentation --- .../dataProtectorCore/getResultFromCompletedTask.md | 3 --- src/references/dataProtector/types.md | 12 +++++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/references/dataProtector/dataProtectorCore/getResultFromCompletedTask.md b/src/references/dataProtector/dataProtectorCore/getResultFromCompletedTask.md index 6d1d869..ee78362 100644 --- a/src/references/dataProtector/dataProtectorCore/getResultFromCompletedTask.md +++ b/src/references/dataProtector/dataProtectorCore/getResultFromCompletedTask.md @@ -135,10 +135,7 @@ import { type GetResultFromCompletedTaskResponse } from '@iexec/dataprotector'; The actual content of the protected file. -``` - -``` diff --git a/src/references/dataProtector/types.md b/src/references/dataProtector/types.md index c679ce0..e78d120 100644 --- a/src/references/dataProtector/types.md +++ b/src/references/dataProtector/types.md @@ -17,14 +17,19 @@ Types in DataProtector. ### datasetprice: `string` -- Price (in nRLC) to charge the user specified in `requesterrestrict` for each - use of this `protectedData` +- Total number of authorized accesses for processing a Protected Data when the + access was signed and published ### volume: `string` - Number of authorized uses of this `protectedData`; each use decrements this counter +### remainingAccess: `number` + +- Number of remaining authorized accesses for processing a protected data; each + use decrements this counter + ### tag: `string` - Defines whether a `protectedData` is usable in a TEE environment; `0x00` is @@ -120,6 +125,3 @@ You can read more about the _Hash example:_ `0xc9c2d58fc01fe54149b7daf49a0026d4ab1fdd3d10fb7c76350790fff03fe24d` - -You can read more about the [iExec Explorer] -(/get-started/tooling-and-explorers/iexec-explorer).