From 5c6a29274dee05513183288718ad8cbce91cbaf3 Mon Sep 17 00:00:00 2001 From: mihaisc Date: Thu, 25 Mar 2021 10:04:40 +0200 Subject: [PATCH] add encrypt to publish (#269) Signed-off-by: mihaisc --- src/hooks/usePublish/usePublish.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/hooks/usePublish/usePublish.ts b/src/hooks/usePublish/usePublish.ts index ac54ebb..a3ff0ce 100644 --- a/src/hooks/usePublish/usePublish.ts +++ b/src/hooks/usePublish/usePublish.ts @@ -16,7 +16,8 @@ interface UsePublish { serviceConfigs: ServiceType, dataTokenOptions?: DataTokenOptions, timeout?: number, - providerUri?: string + providerUri?: string, + encrypt?: boolean ) => Promise publishStep?: number publishStepText?: string @@ -41,6 +42,8 @@ function usePublish(): UsePublish { * @param {PriceOptions} priceOptions : number of tokens to mint, datatoken weight , liquidity fee, type : fixed, dynamic * @param {ServiceType} serviceType Desired service type of the asset access or compute * @param {DataTokenOptions} dataTokenOptions custom name, symbol and cap for datatoken + * @param {number} timeout timeout of the ddo + * @param {boolean} encrypt specify if the ddo should be encrypted * @return {Promise} Returns the newly published ddo */ async function publish( @@ -48,7 +51,8 @@ function usePublish(): UsePublish { serviceType: ServiceType, dataTokenOptions?: DataTokenOptions, timeout?: number, - providerUri?: string + providerUri?: string, + encrypt?: boolean ): Promise { if (status !== ProviderStatus.CONNECTED || !ocean || !account) return null setIsLoading(true) @@ -141,7 +145,7 @@ function usePublish(): UsePublish { ) .next(setStep) - await ocean.assets.publishDdo(ddo, accountId) + await ocean.assets.publishDdo(ddo, accountId, encrypt) Logger.log('ddo created', ddo) await sleep(20000) setStep(7)