Skip to content

Commit 9b4a978

Browse files
feat: add result encryption types to processProtectedData
- Add encryptResult and pemPrivateKey parameters to ProcessProtectedDataParams - Add PUSH_ENCRYPTION_KEY status to ProcessProtectedDataStatuses - Add pemPrivateKey to ProcessProtectedDataResponse and GetResultFromCompletedTaskResponse
1 parent 62dcd6a commit 9b4a978

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/sdk/src/lib/types/coreTypes.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ export type GetResultFromCompletedTaskParams = {
223223

224224
export type GetResultFromCompletedTaskResponse = {
225225
result: ArrayBuffer;
226+
pemPrivateKey?: string;
226227
};
227228

228229
// ---------------------RevokeAccess Types------------------------------------
@@ -280,6 +281,7 @@ export type ProcessProtectedDataStatuses =
280281
| 'FETCH_APP_ORDERBOOK'
281282
| 'FETCH_WORKERPOOL_ORDERBOOK'
282283
| 'PUSH_REQUESTER_SECRET'
284+
| 'PUSH_ENCRYPTION_KEY'
283285
| 'REQUEST_TO_PROCESS_PROTECTED_DATA'
284286
| 'CONSUME_TASK'
285287
| 'CONSUME_RESULT_DOWNLOAD'
@@ -355,6 +357,17 @@ export type ProcessProtectedDataParams = {
355357
*/
356358
voucherOwner?: AddressOrENS;
357359

360+
/**
361+
* Enable result encryption for the processed data.
362+
* @default = false
363+
*/
364+
encryptResult?: boolean;
365+
366+
/**
367+
* Private key in PEM format for result encryption/decryption.
368+
* If not provided and encryptResult is true, a new key pair will be generated.
369+
*/
370+
pemPrivateKey?: string;
358371
/**
359372
* Callback function that will get called at each step of the process
360373
*/
@@ -366,4 +379,5 @@ export type ProcessProtectedDataResponse = {
366379
dealId: string;
367380
taskId: string;
368381
result: ArrayBuffer;
382+
pemPrivateKey?: string;
369383
};

0 commit comments

Comments
 (0)