@@ -69,6 +69,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
6969 // -------------------- Collection --------------------
7070
7171 async createCollection ( ) : Promise < CreateCollectionResponse > {
72+ await this . init ( ) ;
7273 await isValidProvider ( this . iexec ) ;
7374 return createCollection ( {
7475 iexec : this . iexec ,
@@ -79,6 +80,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
7980 async removeCollection (
8081 args : RemoveCollectionParams
8182 ) : Promise < SuccessWithTransactionHash > {
83+ await this . init ( ) ;
8284 await isValidProvider ( this . iexec ) ;
8385 return removeCollection ( {
8486 ...args ,
@@ -90,6 +92,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
9092 async addToCollection (
9193 args : AddToCollectionParams
9294 ) : Promise < SuccessWithTransactionHash > {
95+ await this . init ( ) ;
9396 await isValidProvider ( this . iexec ) ;
9497 return addToCollection ( {
9598 ...args ,
@@ -101,6 +104,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
101104 async removeProtectedDataFromCollection (
102105 args : RemoveFromCollectionParams
103106 ) : Promise < SuccessWithTransactionHash > {
107+ await this . init ( ) ;
104108 await isValidProvider ( this . iexec ) ;
105109 return removeProtectedDataFromCollection ( {
106110 ...args ,
@@ -114,6 +118,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
114118 async setProtectedDataToRenting (
115119 args : SetProtectedDataToRentingParams
116120 ) : Promise < SuccessWithTransactionHash > {
121+ await this . init ( ) ;
117122 await isValidProvider ( this . iexec ) ;
118123 return setProtectedDataToRenting ( {
119124 ...args ,
@@ -126,6 +131,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
126131 async setProtectedDataRentingParams (
127132 args : SetProtectedDataRentingParams
128133 ) : Promise < SuccessWithTransactionHash > {
134+ await this . init ( ) ;
129135 await isValidProvider ( this . iexec ) ;
130136 return setProtectedDataToRenting ( {
131137 ...args ,
@@ -137,6 +143,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
137143 async rentProtectedData (
138144 args : RentProtectedDataParams
139145 ) : Promise < SuccessWithTransactionHash > {
146+ await this . init ( ) ;
140147 await isValidProvider ( this . iexec ) ;
141148 return rentProtectedData ( {
142149 ...args ,
@@ -148,6 +155,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
148155 async removeProtectedDataFromRenting (
149156 args : RemoveProtectedDataFromRentingParams
150157 ) : Promise < SuccessWithTransactionHash > {
158+ await this . init ( ) ;
151159 await isValidProvider ( this . iexec ) ;
152160 return removeProtectedDataFromRenting ( {
153161 ...args ,
@@ -161,6 +169,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
161169 async setProtectedDataForSale (
162170 args : SetProtectedDataForSaleParams
163171 ) : Promise < SuccessWithTransactionHash > {
172+ await this . init ( ) ;
164173 await isValidProvider ( this . iexec ) ;
165174 return setProtectedDataForSale ( {
166175 ...args ,
@@ -172,6 +181,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
172181 async buyProtectedData (
173182 args : BuyProtectedDataParams
174183 ) : Promise < SuccessWithTransactionHash > {
184+ await this . init ( ) ;
175185 await isValidProvider ( this . iexec ) ;
176186 return buyProtectedData ( {
177187 ...args ,
@@ -183,6 +193,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
183193 async removeProtectedDataForSale (
184194 args : RemoveProtectedDataForSaleParams
185195 ) : Promise < SuccessWithTransactionHash > {
196+ await this . init ( ) ;
186197 await isValidProvider ( this . iexec ) ;
187198 return removeProtectedDataForSale ( {
188199 ...args ,
@@ -196,6 +207,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
196207 async setSubscriptionParams (
197208 args : SetSubscriptionParams
198209 ) : Promise < SuccessWithTransactionHash > {
210+ await this . init ( ) ;
199211 await isValidProvider ( this . iexec ) ;
200212 return setSubscriptionParams ( {
201213 ...args ,
@@ -207,6 +219,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
207219 async setProtectedDataToSubscription (
208220 args : SetProtectedDataToSubscriptionParams
209221 ) : Promise < SuccessWithTransactionHash > {
222+ await this . init ( ) ;
210223 await isValidProvider ( this . iexec ) ;
211224 return setProtectedDataToSubscription ( {
212225 ...args ,
@@ -218,6 +231,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
218231 async subscribeToCollection (
219232 args : SubscribeToCollectionParams
220233 ) : Promise < SuccessWithTransactionHash > {
234+ await this . init ( ) ;
221235 await isValidProvider ( this . iexec ) ;
222236 return subscribeToCollection ( {
223237 ...args ,
@@ -229,6 +243,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
229243 async removeProtectedDataFromSubscription (
230244 args : RemoveProtectedDataFromSubscriptionParams
231245 ) : Promise < SuccessWithTransactionHash > {
246+ await this . init ( ) ;
232247 await isValidProvider ( this . iexec ) ;
233248 return removeProtectedDataFromSubscription ( {
234249 ...args ,
@@ -243,6 +258,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
243258 async consumeProtectedData (
244259 args : ConsumeProtectedDataParams
245260 ) : Promise < ConsumeProtectedDataResponse > {
261+ await this . init ( ) ;
246262 await isValidProvider ( this . iexec ) ;
247263 return consumeProtectedData ( {
248264 ...args ,
@@ -254,6 +270,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
254270 // -------------------- Apps whitelist --------------------
255271
256272 async createAddOnlyAppWhitelist ( ) : Promise < CreateAppWhitelistResponse > {
273+ await this . init ( ) ;
257274 await isValidProvider ( this . iexec ) ;
258275 return createAddOnlyAppWhitelist ( {
259276 iexec : this . iexec ,
@@ -264,6 +281,7 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
264281 async addAppToAddOnlyAppWhitelist (
265282 args : AddAppToAppWhitelistParams
266283 ) : Promise < SuccessWithTransactionHash > {
284+ await this . init ( ) ;
267285 await isValidProvider ( this . iexec ) ;
268286 return addAppToAddOnlyAppWhitelist ( {
269287 ...args ,
@@ -276,62 +294,69 @@ class IExecDataProtectorSharing extends IExecDataProtectorModule {
276294 * Read-only functions *
277295 ******************************************************************/
278296
279- getProtectedDataInCollections (
297+ async getProtectedDataInCollections (
280298 args ?: GetProtectedDataInCollectionsParams
281299 ) : Promise < GetProtectedDataInCollectionsResponse > {
300+ await this . init ( ) ;
282301 return getProtectedDataInCollections ( {
283302 ...args ,
284303 graphQLClient : this . graphQLClient ,
285304 } ) ;
286305 }
287306
288- getProtectedDataPricingParams (
307+ async getProtectedDataPricingParams (
289308 args : GetProtectedDataPricingParams
290309 ) : Promise < GetProtectedDataPricingParamsResponse > {
310+ await this . init ( ) ;
291311 return getProtectedDataPricingParams ( {
292312 ...args ,
293313 graphQLClient : this . graphQLClient ,
294314 } ) ;
295315 }
296316
297- getCollectionOwners (
317+ async getCollectionOwners (
298318 args ?: GetCollectionOwnersParams
299319 ) : Promise < GetCollectionOwnersResponse > {
320+ await this . init ( ) ;
300321 return getCollectionOwners ( {
301322 ...args ,
302323 iexec : this . iexec ,
303324 graphQLClient : this . graphQLClient ,
304325 } ) ;
305326 }
306327
307- getCollectionsByOwner (
328+ async getCollectionsByOwner (
308329 args : GetCollectionsByOwnerParams
309330 ) : Promise < GetCollectionsByOwnerResponse > {
331+ await this . init ( ) ;
310332 return getCollectionsByOwner ( {
311333 ...args ,
312334 graphQLClient : this . graphQLClient ,
313335 } ) ;
314336 }
315337
316- getCollectionSubscriptions (
338+ async getCollectionSubscriptions (
317339 args ?: GetCollectionSubscriptionsParams
318340 ) : Promise < GetCollectionSubscriptionsResponse > {
341+ await this . init ( ) ;
319342 return getCollectionSubscriptions ( {
320343 ...args ,
321344 graphQLClient : this . graphQLClient ,
322345 } ) ;
323346 }
324347
325- getRentals ( args ?: GetRentalsParams ) : Promise < GetRentalsResponse > {
348+ async getRentals ( args ?: GetRentalsParams ) : Promise < GetRentalsResponse > {
349+ await this . init ( ) ;
326350 return getRentals ( {
327351 ...args ,
328352 graphQLClient : this . graphQLClient ,
329353 } ) ;
330354 }
331355
332- getUserAddOnlyAppWhitelist (
356+ async getUserAddOnlyAppWhitelist (
333357 args ?: GetUserAppWhitelistParams
334358 ) : Promise < GetUserAppWhitelistResponse > {
359+ await this . init ( ) ;
335360 return getUserAddOnlyAppWhitelist ( {
336361 ...args ,
337362 iexec : this . iexec ,
0 commit comments