@eluvio/elv-client-js 3.1.78 → 3.1.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,10 +95,24 @@ function () {
95
95
  this.reencryptionKeys = {};
96
96
  this.requestIds = {};
97
97
  this.providers = {};
98
- } // Return authorization token in appropriate headers
99
-
98
+ }
100
99
 
101
100
  _createClass(AuthorizationClient, [{
101
+ key: "CreateStaticToken",
102
+ value: function CreateStaticToken(_ref2) {
103
+ var libraryId = _ref2.libraryId;
104
+ var token = {
105
+ qspace_id: this.client.contentSpaceId
106
+ };
107
+
108
+ if (libraryId) {
109
+ token.qlib_id = libraryId;
110
+ }
111
+
112
+ return Utils.B64(JSON.stringify(token));
113
+ } // Return authorization token in appropriate headers
114
+
115
+ }, {
102
116
  key: "AuthorizationHeader",
103
117
  value: function AuthorizationHeader(params) {
104
118
  var authorizationToken, headers;
@@ -130,14 +144,14 @@ function () {
130
144
  }
131
145
  }, {
132
146
  key: "AuthorizationToken",
133
- value: function AuthorizationToken(_ref2) {
134
- var libraryId, objectId, versionHash, partHash, encryption, audienceData, context, _ref2$update, update, _ref2$channelAuth, channelAuth, oauthToken, _ref2$noCache, noCache, _ref2$noAuth, noAuth, isWalletRequest, initialNoCache, authorizationToken;
147
+ value: function AuthorizationToken(_ref3) {
148
+ var libraryId, objectId, versionHash, partHash, encryption, audienceData, context, _ref3$update, update, _ref3$channelAuth, channelAuth, oauthToken, _ref3$noCache, noCache, _ref3$noAuth, noAuth, isWalletRequest, initialNoCache, authorizationToken;
135
149
 
136
150
  return _regeneratorRuntime.async(function AuthorizationToken$(_context2) {
137
151
  while (1) {
138
152
  switch (_context2.prev = _context2.next) {
139
153
  case 0:
140
- libraryId = _ref2.libraryId, objectId = _ref2.objectId, versionHash = _ref2.versionHash, partHash = _ref2.partHash, encryption = _ref2.encryption, audienceData = _ref2.audienceData, context = _ref2.context, _ref2$update = _ref2.update, update = _ref2$update === void 0 ? false : _ref2$update, _ref2$channelAuth = _ref2.channelAuth, channelAuth = _ref2$channelAuth === void 0 ? false : _ref2$channelAuth, oauthToken = _ref2.oauthToken, _ref2$noCache = _ref2.noCache, noCache = _ref2$noCache === void 0 ? false : _ref2$noCache, _ref2$noAuth = _ref2.noAuth, noAuth = _ref2$noAuth === void 0 ? false : _ref2$noAuth;
154
+ libraryId = _ref3.libraryId, objectId = _ref3.objectId, versionHash = _ref3.versionHash, partHash = _ref3.partHash, encryption = _ref3.encryption, audienceData = _ref3.audienceData, context = _ref3.context, _ref3$update = _ref3.update, update = _ref3$update === void 0 ? false : _ref3$update, _ref3$channelAuth = _ref3.channelAuth, channelAuth = _ref3$channelAuth === void 0 ? false : _ref3$channelAuth, oauthToken = _ref3.oauthToken, _ref3$noCache = _ref3.noCache, noCache = _ref3$noCache === void 0 ? false : _ref3$noCache, _ref3$noAuth = _ref3.noAuth, noAuth = _ref3$noAuth === void 0 ? false : _ref3$noAuth;
141
155
 
142
156
  if (versionHash) {
143
157
  objectId = this.client.utils.DecodeVersionHash(versionHash).objectId;
@@ -200,11 +214,21 @@ function () {
200
214
 
201
215
  case 20:
202
216
  authorizationToken = _context2.sent;
203
- _context2.next = 26;
217
+ _context2.next = 28;
204
218
  break;
205
219
 
206
220
  case 23:
207
- _context2.next = 25;
221
+ if (!noAuth) {
222
+ _context2.next = 25;
223
+ break;
224
+ }
225
+
226
+ return _context2.abrupt("return", this.CreateStaticToken({
227
+ libraryId: libraryId
228
+ }));
229
+
230
+ case 25:
231
+ _context2.next = 27;
208
232
  return _regeneratorRuntime.awrap(this.GenerateAuthorizationToken({
209
233
  libraryId: libraryId,
210
234
  objectId: objectId,
@@ -215,39 +239,39 @@ function () {
215
239
  noAuth: noAuth
216
240
  }));
217
241
 
218
- case 25:
242
+ case 27:
219
243
  authorizationToken = _context2.sent;
220
244
 
221
- case 26:
245
+ case 28:
222
246
  return _context2.abrupt("return", authorizationToken);
223
247
 
224
- case 29:
225
- _context2.prev = 29;
248
+ case 31:
249
+ _context2.prev = 31;
226
250
  _context2.t4 = _context2["catch"](14);
227
251
  throw _context2.t4;
228
252
 
229
- case 32:
230
- _context2.prev = 32;
253
+ case 34:
254
+ _context2.prev = 34;
231
255
  this.noCache = initialNoCache;
232
- return _context2.finish(32);
256
+ return _context2.finish(34);
233
257
 
234
- case 35:
258
+ case 37:
235
259
  case "end":
236
260
  return _context2.stop();
237
261
  }
238
262
  }
239
- }, null, this, [[14, 29, 32, 35]]);
263
+ }, null, this, [[14, 31, 34, 37]]);
240
264
  }
241
265
  }, {
242
266
  key: "GenerateAuthorizationToken",
243
- value: function GenerateAuthorizationToken(_ref3) {
244
- var libraryId, objectId, versionHash, partHash, encryption, _ref3$update, update, _ref3$noAuth, noAuth, publicKey, owner, ownerCapKey, ownerCap, cap, token, _ref4, transactionHash, signature, multiSig;
267
+ value: function GenerateAuthorizationToken(_ref4) {
268
+ var libraryId, objectId, versionHash, partHash, encryption, _ref4$update, update, _ref4$noAuth, noAuth, publicKey, owner, ownerCapKey, ownerCap, cap, token, _ref5, transactionHash, signature, multiSig;
245
269
 
246
270
  return _regeneratorRuntime.async(function GenerateAuthorizationToken$(_context3) {
247
271
  while (1) {
248
272
  switch (_context3.prev = _context3.next) {
249
273
  case 0:
250
- libraryId = _ref3.libraryId, objectId = _ref3.objectId, versionHash = _ref3.versionHash, partHash = _ref3.partHash, encryption = _ref3.encryption, _ref3$update = _ref3.update, update = _ref3$update === void 0 ? false : _ref3$update, _ref3$noAuth = _ref3.noAuth, noAuth = _ref3$noAuth === void 0 ? false : _ref3$noAuth;
274
+ libraryId = _ref4.libraryId, objectId = _ref4.objectId, versionHash = _ref4.versionHash, partHash = _ref4.partHash, encryption = _ref4.encryption, _ref4$update = _ref4.update, update = _ref4$update === void 0 ? false : _ref4$update, _ref4$noAuth = _ref4.noAuth, noAuth = _ref4$noAuth === void 0 ? false : _ref4$noAuth;
251
275
 
252
276
  if (versionHash) {
253
277
  objectId = Utils.DecodeVersionHash(versionHash).objectId;
@@ -284,7 +308,7 @@ function () {
284
308
  owner = _context3.sent;
285
309
  ownerCapKey = "eluv.caps.iusr".concat(Utils.AddressToHash(this.client.signer.address));
286
310
  _context3.next = 16;
287
- return _regeneratorRuntime.awrap(client.ContentObjectMetadata({
311
+ return _regeneratorRuntime.awrap(this.client.ContentObjectMetadata({
288
312
  libraryId: libraryId,
289
313
  objectId: objectId,
290
314
  metadataSubtree: ownerCapKey
@@ -331,8 +355,8 @@ function () {
331
355
  }));
332
356
 
333
357
  case 26:
334
- _ref4 = _context3.sent;
335
- transactionHash = _ref4.transactionHash;
358
+ _ref5 = _context3.sent;
359
+ transactionHash = _ref5.transactionHash;
336
360
 
337
361
  if (transactionHash) {
338
362
  token.tx_id = transactionHash;
@@ -369,16 +393,16 @@ function () {
369
393
  }
370
394
  }, {
371
395
  key: "MakeAccessRequest",
372
- value: function MakeAccessRequest(_ref5) {
396
+ value: function MakeAccessRequest(_ref6) {
373
397
  var _this = this;
374
398
 
375
- var libraryId, objectId, versionHash, _ref5$args, args, _ref5$publicKey, publicKey, _ref5$update, update, _ref5$skipCache, skipCache, _ref5$noCache, noCache, cacheOnly, walletContractAddress, walletCreated, id, _ref6, isV3, accessType, abi, _ref7, accessArgs, checkAccessCharge, address, elapsed, _cache, accessRequest, cache;
399
+ var libraryId, objectId, versionHash, _ref6$args, args, _ref6$publicKey, publicKey, _ref6$update, update, _ref6$skipCache, skipCache, _ref6$noCache, noCache, cacheOnly, walletContractAddress, walletCreated, id, _ref7, isV3, accessType, abi, _ref8, accessArgs, checkAccessCharge, address, elapsed, _cache, accessRequest, cache;
376
400
 
377
401
  return _regeneratorRuntime.async(function MakeAccessRequest$(_context4) {
378
402
  while (1) {
379
403
  switch (_context4.prev = _context4.next) {
380
404
  case 0:
381
- libraryId = _ref5.libraryId, objectId = _ref5.objectId, versionHash = _ref5.versionHash, _ref5$args = _ref5.args, args = _ref5$args === void 0 ? [] : _ref5$args, _ref5$publicKey = _ref5.publicKey, publicKey = _ref5$publicKey === void 0 ? "" : _ref5$publicKey, _ref5$update = _ref5.update, update = _ref5$update === void 0 ? false : _ref5$update, _ref5$skipCache = _ref5.skipCache, skipCache = _ref5$skipCache === void 0 ? false : _ref5$skipCache, _ref5$noCache = _ref5.noCache, noCache = _ref5$noCache === void 0 ? false : _ref5$noCache, cacheOnly = _ref5.cacheOnly;
405
+ libraryId = _ref6.libraryId, objectId = _ref6.objectId, versionHash = _ref6.versionHash, _ref6$args = _ref6.args, args = _ref6$args === void 0 ? [] : _ref6$args, _ref6$publicKey = _ref6.publicKey, publicKey = _ref6$publicKey === void 0 ? "" : _ref6$publicKey, _ref6$update = _ref6.update, update = _ref6$update === void 0 ? false : _ref6$update, _ref6$skipCache = _ref6.skipCache, skipCache = _ref6$skipCache === void 0 ? false : _ref6$skipCache, _ref6$noCache = _ref6.noCache, noCache = _ref6$noCache === void 0 ? false : _ref6$noCache, cacheOnly = _ref6.cacheOnly;
382
406
 
383
407
  if (this.client.signer) {
384
408
  _context4.next = 3;
@@ -428,10 +452,10 @@ function () {
428
452
  }));
429
453
 
430
454
  case 16:
431
- _ref6 = _context4.sent;
432
- isV3 = _ref6.isV3;
433
- accessType = _ref6.accessType;
434
- abi = _ref6.abi;
455
+ _ref7 = _context4.sent;
456
+ isV3 = _ref7.isV3;
457
+ accessType = _ref7.accessType;
458
+ abi = _ref7.abi;
435
459
 
436
460
  if (!(typeof accessType === "undefined")) {
437
461
  _context4.next = 22;
@@ -451,9 +475,9 @@ function () {
451
475
  }));
452
476
 
453
477
  case 24:
454
- _ref7 = _context4.sent;
455
- accessArgs = _ref7.accessArgs;
456
- checkAccessCharge = _ref7.checkAccessCharge;
478
+ _ref8 = _context4.sent;
479
+ accessArgs = _ref8.accessArgs;
480
+ checkAccessCharge = _ref8.checkAccessCharge;
457
481
  address = Utils.HashToAddress(id);
458
482
  elapsed = 0;
459
483
 
@@ -588,24 +612,24 @@ function () {
588
612
  }
589
613
  }, {
590
614
  key: "AccessRequest",
591
- value: function AccessRequest(_ref8) {
592
- var id, _ref8$args, args, _ref8$checkAccessChar, checkAccessCharge, _ref9, isV3, accessType, abi, accessCharge, owner, accessChargeArgs, event, methodName, contractAddress;
615
+ value: function AccessRequest(_ref9) {
616
+ var id, _ref9$args, args, _ref9$checkAccessChar, checkAccessCharge, _ref10, isV3, accessType, abi, accessCharge, owner, accessChargeArgs, event, methodName, contractAddress;
593
617
 
594
618
  return _regeneratorRuntime.async(function AccessRequest$(_context5) {
595
619
  while (1) {
596
620
  switch (_context5.prev = _context5.next) {
597
621
  case 0:
598
- id = _ref8.id, _ref8$args = _ref8.args, args = _ref8$args === void 0 ? [] : _ref8$args, _ref8$checkAccessChar = _ref8.checkAccessCharge, checkAccessCharge = _ref8$checkAccessChar === void 0 ? false : _ref8$checkAccessChar;
622
+ id = _ref9.id, _ref9$args = _ref9.args, args = _ref9$args === void 0 ? [] : _ref9$args, _ref9$checkAccessChar = _ref9.checkAccessCharge, checkAccessCharge = _ref9$checkAccessChar === void 0 ? false : _ref9$checkAccessChar;
599
623
  _context5.next = 3;
600
624
  return _regeneratorRuntime.awrap(this.ContractInfo({
601
625
  id: id
602
626
  }));
603
627
 
604
628
  case 3:
605
- _ref9 = _context5.sent;
606
- isV3 = _ref9.isV3;
607
- accessType = _ref9.accessType;
608
- abi = _ref9.abi;
629
+ _ref10 = _context5.sent;
630
+ isV3 = _ref10.isV3;
631
+ accessType = _ref10.accessType;
632
+ abi = _ref10.abi;
609
633
  // Send some bux if access charge is required
610
634
  accessCharge = 0;
611
635
 
@@ -715,13 +739,13 @@ function () {
715
739
  }
716
740
  }, {
717
741
  key: "UpdateRequest",
718
- value: function UpdateRequest(_ref10) {
742
+ value: function UpdateRequest(_ref11) {
719
743
  var id, abi, event, updateRequestEvent;
720
744
  return _regeneratorRuntime.async(function UpdateRequest$(_context6) {
721
745
  while (1) {
722
746
  switch (_context6.prev = _context6.next) {
723
747
  case 0:
724
- id = _ref10.id, abi = _ref10.abi;
748
+ id = _ref11.id, abi = _ref11.abi;
725
749
  _context6.next = 3;
726
750
  return _regeneratorRuntime.awrap(this.client.CallContractMethodAndWait({
727
751
  contractAddress: Utils.HashToAddress(id),
@@ -757,14 +781,14 @@ function () {
757
781
  }
758
782
  }, {
759
783
  key: "AudienceData",
760
- value: function AudienceData(_ref11) {
761
- var objectId = _ref11.objectId,
762
- versionHash = _ref11.versionHash,
763
- _ref11$protocols = _ref11.protocols,
764
- protocols = _ref11$protocols === void 0 ? [] : _ref11$protocols,
765
- _ref11$drms = _ref11.drms,
766
- drms = _ref11$drms === void 0 ? [] : _ref11$drms,
767
- context = _ref11.context;
784
+ value: function AudienceData(_ref12) {
785
+ var objectId = _ref12.objectId,
786
+ versionHash = _ref12.versionHash,
787
+ _ref12$protocols = _ref12.protocols,
788
+ protocols = _ref12$protocols === void 0 ? [] : _ref12$protocols,
789
+ _ref12$drms = _ref12.drms,
790
+ drms = _ref12$drms === void 0 ? [] : _ref12$drms,
791
+ context = _ref12.context;
768
792
  this.Log("Retrieving audience data: ".concat(objectId));
769
793
  context = context || this.client.authContext || {};
770
794
 
@@ -794,14 +818,14 @@ function () {
794
818
  }
795
819
  }, {
796
820
  key: "GenerateChannelContentToken",
797
- value: function GenerateChannelContentToken(_ref12) {
798
- var objectId, versionHash, issuer, code, email, audienceData, context, oauthToken, _ref12$value, value, token, tenantId, kmsAddress, stateChannelApi, additionalParams, payload, signature, multiSig;
821
+ value: function GenerateChannelContentToken(_ref13) {
822
+ var objectId, versionHash, issuer, code, email, audienceData, context, oauthToken, _ref13$value, value, token, tenantId, kmsAddress, stateChannelApi, additionalParams, payload, signature, multiSig;
799
823
 
800
824
  return _regeneratorRuntime.async(function GenerateChannelContentToken$(_context7) {
801
825
  while (1) {
802
826
  switch (_context7.prev = _context7.next) {
803
827
  case 0:
804
- objectId = _ref12.objectId, versionHash = _ref12.versionHash, issuer = _ref12.issuer, code = _ref12.code, email = _ref12.email, audienceData = _ref12.audienceData, context = _ref12.context, oauthToken = _ref12.oauthToken, _ref12$value = _ref12.value, value = _ref12$value === void 0 ? 0 : _ref12$value;
828
+ objectId = _ref13.objectId, versionHash = _ref13.versionHash, issuer = _ref13.issuer, code = _ref13.code, email = _ref13.email, audienceData = _ref13.audienceData, context = _ref13.context, oauthToken = _ref13.oauthToken, _ref13$value = _ref13.value, value = _ref13$value === void 0 ? 0 : _ref13$value;
805
829
 
806
830
  if (!oauthToken) {
807
831
  _context7.next = 5;
@@ -967,14 +991,14 @@ function () {
967
991
  }
968
992
  }, {
969
993
  key: "ChannelContentFinalize",
970
- value: function ChannelContentFinalize(_ref13) {
971
- var objectId, versionHash, _ref13$percent, percent, result;
994
+ value: function ChannelContentFinalize(_ref14) {
995
+ var objectId, versionHash, _ref14$percent, percent, result;
972
996
 
973
997
  return _regeneratorRuntime.async(function ChannelContentFinalize$(_context8) {
974
998
  while (1) {
975
999
  switch (_context8.prev = _context8.next) {
976
1000
  case 0:
977
- objectId = _ref13.objectId, versionHash = _ref13.versionHash, _ref13$percent = _ref13.percent, percent = _ref13$percent === void 0 ? 0 : _ref13$percent;
1001
+ objectId = _ref14.objectId, versionHash = _ref14.versionHash, _ref14$percent = _ref14.percent, percent = _ref14$percent === void 0 ? 0 : _ref14$percent;
978
1002
  this.Log("Making state channel finalize request: ".concat(objectId));
979
1003
  _context8.next = 4;
980
1004
  return _regeneratorRuntime.awrap(this.MakeKMSCall({
@@ -1002,13 +1026,13 @@ function () {
1002
1026
  }
1003
1027
  }, {
1004
1028
  key: "GenerateOauthChannelToken",
1005
- value: function GenerateOauthChannelToken(_ref14) {
1029
+ value: function GenerateOauthChannelToken(_ref15) {
1006
1030
  var objectId, versionHash, token, fabricToken;
1007
1031
  return _regeneratorRuntime.async(function GenerateOauthChannelToken$(_context9) {
1008
1032
  while (1) {
1009
1033
  switch (_context9.prev = _context9.next) {
1010
1034
  case 0:
1011
- objectId = _ref14.objectId, versionHash = _ref14.versionHash, token = _ref14.token;
1035
+ objectId = _ref15.objectId, versionHash = _ref15.versionHash, token = _ref15.token;
1012
1036
 
1013
1037
  if (versionHash) {
1014
1038
  objectId = Utils.DecodeVersionHash(versionHash).objectId;
@@ -1070,17 +1094,26 @@ function () {
1070
1094
  }
1071
1095
  }, {
1072
1096
  key: "IsV3",
1073
- value: function IsV3(_ref15) {
1097
+ value: function IsV3(_ref16) {
1074
1098
  var id, contractName;
1075
1099
  return _regeneratorRuntime.async(function IsV3$(_context10) {
1076
1100
  while (1) {
1077
1101
  switch (_context10.prev = _context10.next) {
1078
1102
  case 0:
1079
- id = _ref15.id;
1080
- _context10.next = 3;
1081
- return _regeneratorRuntime.awrap(this.client.ethClient.ContractName(Utils.HashToAddress(id), true));
1103
+ id = _ref16.id;
1104
+
1105
+ if (!this.client.assumeV3) {
1106
+ _context10.next = 3;
1107
+ break;
1108
+ }
1109
+
1110
+ return _context10.abrupt("return", true);
1082
1111
 
1083
1112
  case 3:
1113
+ _context10.next = 5;
1114
+ return _regeneratorRuntime.awrap(this.client.ethClient.ContractName(Utils.HashToAddress(id), true));
1115
+
1116
+ case 5:
1084
1117
  contractName = _context10.sent;
1085
1118
 
1086
1119
  if (!this.accessVersions[contractName]) {
@@ -1091,13 +1124,13 @@ function () {
1091
1124
  });
1092
1125
  }
1093
1126
 
1094
- _context10.next = 7;
1127
+ _context10.next = 9;
1095
1128
  return _regeneratorRuntime.awrap(this.accessVersions[contractName]);
1096
1129
 
1097
- case 7:
1130
+ case 9:
1098
1131
  return _context10.abrupt("return", _context10.sent);
1099
1132
 
1100
- case 8:
1133
+ case 10:
1101
1134
  case "end":
1102
1135
  return _context10.stop();
1103
1136
  }
@@ -1106,13 +1139,13 @@ function () {
1106
1139
  }
1107
1140
  }, {
1108
1141
  key: "AccessInfo",
1109
- value: function AccessInfo(_ref16) {
1142
+ value: function AccessInfo(_ref17) {
1110
1143
  var accessType, publicKey, args, isV3, checkAccessCharge;
1111
1144
  return _regeneratorRuntime.async(function AccessInfo$(_context11) {
1112
1145
  while (1) {
1113
1146
  switch (_context11.prev = _context11.next) {
1114
1147
  case 0:
1115
- accessType = _ref16.accessType, publicKey = _ref16.publicKey, args = _ref16.args, isV3 = _ref16.isV3;
1148
+ accessType = _ref17.accessType, publicKey = _ref17.publicKey, args = _ref17.args, isV3 = _ref17.isV3;
1116
1149
  checkAccessCharge = false;
1117
1150
 
1118
1151
  if (accessType === ACCESS_TYPES.OBJECT) {
@@ -1222,14 +1255,14 @@ function () {
1222
1255
  }
1223
1256
  }, {
1224
1257
  key: "AccessComplete",
1225
- value: function AccessComplete(_ref17) {
1226
- var id, score, _ref18, abi, isV3, address, requestId, event;
1258
+ value: function AccessComplete(_ref18) {
1259
+ var id, score, _ref19, abi, isV3, address, requestId, event;
1227
1260
 
1228
1261
  return _regeneratorRuntime.async(function AccessComplete$(_context13) {
1229
1262
  while (1) {
1230
1263
  switch (_context13.prev = _context13.next) {
1231
1264
  case 0:
1232
- id = _ref17.id, score = _ref17.score;
1265
+ id = _ref18.id, score = _ref18.score;
1233
1266
  this.Log("Calling access complete on ".concat(id, " with score ").concat(score));
1234
1267
  _context13.next = 4;
1235
1268
  return _regeneratorRuntime.awrap(this.ContractInfo({
@@ -1237,9 +1270,9 @@ function () {
1237
1270
  }));
1238
1271
 
1239
1272
  case 4:
1240
- _ref18 = _context13.sent;
1241
- abi = _ref18.abi;
1242
- isV3 = _ref18.isV3;
1273
+ _ref19 = _context13.sent;
1274
+ abi = _ref19.abi;
1275
+ isV3 = _ref19.isV3;
1243
1276
  address = Utils.HashToAddress(id);
1244
1277
  requestId = this.requestIds[address];
1245
1278
 
@@ -1297,13 +1330,13 @@ function () {
1297
1330
 
1298
1331
  }, {
1299
1332
  key: "ContractInfo",
1300
- value: function ContractInfo(_ref19) {
1333
+ value: function ContractInfo(_ref20) {
1301
1334
  var id, address, isV3, version, accessType;
1302
1335
  return _regeneratorRuntime.async(function ContractInfo$(_context14) {
1303
1336
  while (1) {
1304
1337
  switch (_context14.prev = _context14.next) {
1305
1338
  case 0:
1306
- id = _ref19.id, address = _ref19.address;
1339
+ id = _ref20.id, address = _ref20.address;
1307
1340
 
1308
1341
  if (!address) {
1309
1342
  address = Utils.HashToAddress(id);
@@ -1350,22 +1383,22 @@ function () {
1350
1383
  }
1351
1384
  }, {
1352
1385
  key: "GetAccessCharge",
1353
- value: function GetAccessCharge(_ref20) {
1354
- var objectId, args, _ref21, abi, info;
1386
+ value: function GetAccessCharge(_ref21) {
1387
+ var objectId, args, _ref22, abi, info;
1355
1388
 
1356
1389
  return _regeneratorRuntime.async(function GetAccessCharge$(_context15) {
1357
1390
  while (1) {
1358
1391
  switch (_context15.prev = _context15.next) {
1359
1392
  case 0:
1360
- objectId = _ref20.objectId, args = _ref20.args;
1393
+ objectId = _ref21.objectId, args = _ref21.args;
1361
1394
  _context15.next = 3;
1362
1395
  return _regeneratorRuntime.awrap(this.ContractInfo({
1363
1396
  id: objectId
1364
1397
  }));
1365
1398
 
1366
1399
  case 3:
1367
- _ref21 = _context15.sent;
1368
- abi = _ref21.abi;
1400
+ _ref22 = _context15.sent;
1401
+ abi = _ref22.abi;
1369
1402
  _context15.next = 7;
1370
1403
  return _regeneratorRuntime.awrap(this.client.CallContractMethod({
1371
1404
  contractAddress: Utils.HashToAddress(objectId),
@@ -1387,13 +1420,13 @@ function () {
1387
1420
  }
1388
1421
  }, {
1389
1422
  key: "Owner",
1390
- value: function Owner(_ref22) {
1423
+ value: function Owner(_ref23) {
1391
1424
  var id, address, ownerAddress;
1392
1425
  return _regeneratorRuntime.async(function Owner$(_context16) {
1393
1426
  while (1) {
1394
1427
  switch (_context16.prev = _context16.next) {
1395
1428
  case 0:
1396
- id = _ref22.id, address = _ref22.address;
1429
+ id = _ref23.id, address = _ref23.address;
1397
1430
 
1398
1431
  if (this.client.signer) {
1399
1432
  _context16.next = 3;
@@ -1473,14 +1506,14 @@ function () {
1473
1506
  }
1474
1507
  }, {
1475
1508
  key: "KMSAddress",
1476
- value: function KMSAddress(_ref23) {
1477
- var objectId, versionHash, _ref24, abi;
1509
+ value: function KMSAddress(_ref24) {
1510
+ var objectId, versionHash, _ref25, abi;
1478
1511
 
1479
1512
  return _regeneratorRuntime.async(function KMSAddress$(_context18) {
1480
1513
  while (1) {
1481
1514
  switch (_context18.prev = _context18.next) {
1482
1515
  case 0:
1483
- objectId = _ref23.objectId, versionHash = _ref23.versionHash;
1516
+ objectId = _ref24.objectId, versionHash = _ref24.versionHash;
1484
1517
 
1485
1518
  if (versionHash) {
1486
1519
  objectId = Utils.DecodeVersionHash(versionHash).objectId;
@@ -1492,8 +1525,8 @@ function () {
1492
1525
  }));
1493
1526
 
1494
1527
  case 4:
1495
- _ref24 = _context18.sent;
1496
- abi = _ref24.abi;
1528
+ _ref25 = _context18.sent;
1529
+ abi = _ref25.abi;
1497
1530
 
1498
1531
  if (abi) {
1499
1532
  _context18.next = 8;
@@ -1522,14 +1555,14 @@ function () {
1522
1555
  }
1523
1556
  }, {
1524
1557
  key: "KMSInfo",
1525
- value: function KMSInfo(_ref25) {
1526
- var objectId, versionHash, kmsId, KMSInfo, _ref26, abi, _ref27, _abi, publicKey;
1558
+ value: function KMSInfo(_ref26) {
1559
+ var objectId, versionHash, kmsId, KMSInfo, _ref27, abi, _ref28, _abi, publicKey;
1527
1560
 
1528
1561
  return _regeneratorRuntime.async(function KMSInfo$(_context19) {
1529
1562
  while (1) {
1530
1563
  switch (_context19.prev = _context19.next) {
1531
1564
  case 0:
1532
- objectId = _ref25.objectId, versionHash = _ref25.versionHash, kmsId = _ref25.kmsId;
1565
+ objectId = _ref26.objectId, versionHash = _ref26.versionHash, kmsId = _ref26.kmsId;
1533
1566
 
1534
1567
  if (!kmsId) {
1535
1568
  _context19.next = 11;
@@ -1542,8 +1575,8 @@ function () {
1542
1575
  }));
1543
1576
 
1544
1577
  case 4:
1545
- _ref26 = _context19.sent;
1546
- abi = _ref26.abi;
1578
+ _ref27 = _context19.sent;
1579
+ abi = _ref27.abi;
1547
1580
  _context19.next = 8;
1548
1581
  return _regeneratorRuntime.awrap(this.client.CallContractMethod({
1549
1582
  contractAddress: this.client.contentSpaceAddress,
@@ -1569,8 +1602,8 @@ function () {
1569
1602
  }));
1570
1603
 
1571
1604
  case 14:
1572
- _ref27 = _context19.sent;
1573
- _abi = _ref27.abi;
1605
+ _ref28 = _context19.sent;
1606
+ _abi = _ref28.abi;
1574
1607
  _context19.next = 18;
1575
1608
  return _regeneratorRuntime.awrap(this.client.CallContractMethod({
1576
1609
  contractAddress: Utils.HashToAddress(objectId),
@@ -1601,13 +1634,13 @@ function () {
1601
1634
 
1602
1635
  }, {
1603
1636
  key: "RetrieveConk",
1604
- value: function RetrieveConk(_ref28) {
1637
+ value: function RetrieveConk(_ref29) {
1605
1638
  var libraryId, objectId, kmsAddress, kmsCapId, kmsCap, cap;
1606
1639
  return _regeneratorRuntime.async(function RetrieveConk$(_context20) {
1607
1640
  while (1) {
1608
1641
  switch (_context20.prev = _context20.next) {
1609
1642
  case 0:
1610
- libraryId = _ref28.libraryId, objectId = _ref28.objectId;
1643
+ libraryId = _ref29.libraryId, objectId = _ref29.objectId;
1611
1644
 
1612
1645
  if (libraryId) {
1613
1646
  _context20.next = 5;
@@ -1671,13 +1704,13 @@ function () {
1671
1704
 
1672
1705
  }, {
1673
1706
  key: "RetrieveReencryptionSymmetricKey",
1674
- value: function RetrieveReencryptionSymmetricKey(_ref29) {
1707
+ value: function RetrieveReencryptionSymmetricKey(_ref30) {
1675
1708
  var libraryId, objectId, kmsAddress, kmsCapId, kmsCap;
1676
1709
  return _regeneratorRuntime.async(function RetrieveReencryptionSymmetricKey$(_context21) {
1677
1710
  while (1) {
1678
1711
  switch (_context21.prev = _context21.next) {
1679
1712
  case 0:
1680
- libraryId = _ref29.libraryId, objectId = _ref29.objectId;
1713
+ libraryId = _ref30.libraryId, objectId = _ref30.objectId;
1681
1714
 
1682
1715
  if (libraryId) {
1683
1716
  _context21.next = 5;
@@ -1740,14 +1773,14 @@ function () {
1740
1773
 
1741
1774
  }, {
1742
1775
  key: "MakeKMSCall",
1743
- value: function MakeKMSCall(_ref30) {
1744
- var kmsId, tenantId, objectId, versionHash, methodName, params, paramTypes, _ref30$additionalPara, additionalParams, _ref30$signature, signature, packedHash, KMSUrls, i, kmsUrl;
1776
+ value: function MakeKMSCall(_ref31) {
1777
+ var kmsId, tenantId, objectId, versionHash, methodName, params, paramTypes, _ref31$additionalPara, additionalParams, _ref31$signature, signature, packedHash, KMSUrls, i, kmsUrl;
1745
1778
 
1746
1779
  return _regeneratorRuntime.async(function MakeKMSCall$(_context22) {
1747
1780
  while (1) {
1748
1781
  switch (_context22.prev = _context22.next) {
1749
1782
  case 0:
1750
- kmsId = _ref30.kmsId, tenantId = _ref30.tenantId, objectId = _ref30.objectId, versionHash = _ref30.versionHash, methodName = _ref30.methodName, params = _ref30.params, paramTypes = _ref30.paramTypes, _ref30$additionalPara = _ref30.additionalParams, additionalParams = _ref30$additionalPara === void 0 ? [] : _ref30$additionalPara, _ref30$signature = _ref30.signature, signature = _ref30$signature === void 0 ? true : _ref30$signature;
1783
+ kmsId = _ref31.kmsId, tenantId = _ref31.tenantId, objectId = _ref31.objectId, versionHash = _ref31.versionHash, methodName = _ref31.methodName, params = _ref31.params, paramTypes = _ref31.paramTypes, _ref31$additionalPara = _ref31.additionalParams, additionalParams = _ref31$additionalPara === void 0 ? [] : _ref31$additionalPara, _ref31$signature = _ref31.signature, signature = _ref31$signature === void 0 ? true : _ref31$signature;
1751
1784
 
1752
1785
  if (versionHash) {
1753
1786
  objectId = Utils.DecodeVersionHash(versionHash).objectId;
@@ -1846,14 +1879,14 @@ function () {
1846
1879
 
1847
1880
  }, {
1848
1881
  key: "MakeAuthServiceRequest",
1849
- value: function MakeAuthServiceRequest(_ref31) {
1850
- var kmsId, objectId, versionHash, _ref31$method, method, path, bodyType, _ref31$body, body, _ref31$queryParams, queryParams, headers;
1882
+ value: function MakeAuthServiceRequest(_ref32) {
1883
+ var kmsId, objectId, versionHash, _ref32$method, method, path, bodyType, _ref32$body, body, _ref32$queryParams, queryParams, headers;
1851
1884
 
1852
1885
  return _regeneratorRuntime.async(function MakeAuthServiceRequest$(_context23) {
1853
1886
  while (1) {
1854
1887
  switch (_context23.prev = _context23.next) {
1855
1888
  case 0:
1856
- kmsId = _ref31.kmsId, objectId = _ref31.objectId, versionHash = _ref31.versionHash, _ref31$method = _ref31.method, method = _ref31$method === void 0 ? "GET" : _ref31$method, path = _ref31.path, bodyType = _ref31.bodyType, _ref31$body = _ref31.body, body = _ref31$body === void 0 ? {} : _ref31$body, _ref31$queryParams = _ref31.queryParams, queryParams = _ref31$queryParams === void 0 ? {} : _ref31$queryParams, headers = _ref31.headers;
1889
+ kmsId = _ref32.kmsId, objectId = _ref32.objectId, versionHash = _ref32.versionHash, _ref32$method = _ref32.method, method = _ref32$method === void 0 ? "GET" : _ref32$method, path = _ref32.path, bodyType = _ref32.bodyType, _ref32$body = _ref32.body, body = _ref32$body === void 0 ? {} : _ref32$body, _ref32$queryParams = _ref32.queryParams, queryParams = _ref32$queryParams === void 0 ? {} : _ref32$queryParams, headers = _ref32.headers;
1857
1890
 
1858
1891
  if (!(this.client.authServiceURIs.length === 0)) {
1859
1892
  _context23.next = 5;
@@ -1900,14 +1933,14 @@ function () {
1900
1933
 
1901
1934
  }, {
1902
1935
  key: "MakeKMSRequest",
1903
- value: function MakeKMSRequest(_ref32) {
1904
- var kmsId, objectId, versionHash, _ref32$method, method, path, bodyType, _ref32$body, body, _ref32$queryParams, queryParams, headers, kmsUrls, kmsHttpClient;
1936
+ value: function MakeKMSRequest(_ref33) {
1937
+ var kmsId, objectId, versionHash, _ref33$method, method, path, bodyType, _ref33$body, body, _ref33$queryParams, queryParams, headers, kmsUrls, kmsHttpClient;
1905
1938
 
1906
1939
  return _regeneratorRuntime.async(function MakeKMSRequest$(_context24) {
1907
1940
  while (1) {
1908
1941
  switch (_context24.prev = _context24.next) {
1909
1942
  case 0:
1910
- kmsId = _ref32.kmsId, objectId = _ref32.objectId, versionHash = _ref32.versionHash, _ref32$method = _ref32.method, method = _ref32$method === void 0 ? "GET" : _ref32$method, path = _ref32.path, bodyType = _ref32.bodyType, _ref32$body = _ref32.body, body = _ref32$body === void 0 ? {} : _ref32$body, _ref32$queryParams = _ref32.queryParams, queryParams = _ref32$queryParams === void 0 ? {} : _ref32$queryParams, headers = _ref32.headers;
1943
+ kmsId = _ref33.kmsId, objectId = _ref33.objectId, versionHash = _ref33.versionHash, _ref33$method = _ref33.method, method = _ref33$method === void 0 ? "GET" : _ref33$method, path = _ref33.path, bodyType = _ref33.bodyType, _ref33$body = _ref33.body, body = _ref33$body === void 0 ? {} : _ref33$body, _ref33$queryParams = _ref33.queryParams, queryParams = _ref33$queryParams === void 0 ? {} : _ref33$queryParams, headers = _ref33.headers;
1911
1944
 
1912
1945
  if (versionHash) {
1913
1946
  objectId = Utils.DecodeVersionHash(versionHash).objectId;
@@ -1972,13 +2005,13 @@ function () {
1972
2005
  }
1973
2006
  }, {
1974
2007
  key: "ContractHasMethod",
1975
- value: function ContractHasMethod(_ref33) {
2008
+ value: function ContractHasMethod(_ref34) {
1976
2009
  var contractAddress, abi, methodName, key, method, methodSignature, methodId;
1977
2010
  return _regeneratorRuntime.async(function ContractHasMethod$(_context25) {
1978
2011
  while (1) {
1979
2012
  switch (_context25.prev = _context25.next) {
1980
2013
  case 0:
1981
- contractAddress = _ref33.contractAddress, abi = _ref33.abi, methodName = _ref33.methodName;
2014
+ contractAddress = _ref34.contractAddress, abi = _ref34.abi, methodName = _ref34.methodName;
1982
2015
  contractAddress = Utils.FormatAddress(contractAddress);
1983
2016
  key = "".concat(contractAddress, "-").concat(methodName);
1984
2017
 
@@ -2048,13 +2081,13 @@ function () {
2048
2081
  }
2049
2082
  }, {
2050
2083
  key: "MakeElvMasterCall",
2051
- value: function MakeElvMasterCall(_ref34) {
2084
+ value: function MakeElvMasterCall(_ref35) {
2052
2085
  var methodName, params;
2053
2086
  return _regeneratorRuntime.async(function MakeElvMasterCall$(_context26) {
2054
2087
  while (1) {
2055
2088
  switch (_context26.prev = _context26.next) {
2056
2089
  case 0:
2057
- methodName = _ref34.methodName, params = _ref34.params;
2090
+ methodName = _ref35.methodName, params = _ref35.params;
2058
2091
  _context26.next = 3;
2059
2092
  return _regeneratorRuntime.awrap(this.client.ethClient.MakeProviderCall({
2060
2093
  methodName: "send",
@@ -2073,13 +2106,13 @@ function () {
2073
2106
  }
2074
2107
  }, {
2075
2108
  key: "ReEncryptionConk",
2076
- value: function ReEncryptionConk(_ref35) {
2109
+ value: function ReEncryptionConk(_ref36) {
2077
2110
  var libraryId, objectId, versionHash, cap;
2078
2111
  return _regeneratorRuntime.async(function ReEncryptionConk$(_context27) {
2079
2112
  while (1) {
2080
2113
  switch (_context27.prev = _context27.next) {
2081
2114
  case 0:
2082
- libraryId = _ref35.libraryId, objectId = _ref35.objectId, versionHash = _ref35.versionHash;
2115
+ libraryId = _ref36.libraryId, objectId = _ref36.objectId, versionHash = _ref36.versionHash;
2083
2116
 
2084
2117
  if (versionHash) {
2085
2118
  objectId = Utils.DecodeVersionHash(versionHash).objectId;
@@ -2117,14 +2150,14 @@ function () {
2117
2150
  }
2118
2151
  }, {
2119
2152
  key: "EncryptionConk",
2120
- value: function EncryptionConk(_ref36) {
2121
- var libraryId, objectId, versionHash, conk, _ref37, secret_key;
2153
+ value: function EncryptionConk(_ref37) {
2154
+ var libraryId, objectId, versionHash, conk, _ref38, secret_key;
2122
2155
 
2123
2156
  return _regeneratorRuntime.async(function EncryptionConk$(_context28) {
2124
2157
  while (1) {
2125
2158
  switch (_context28.prev = _context28.next) {
2126
2159
  case 0:
2127
- libraryId = _ref36.libraryId, objectId = _ref36.objectId, versionHash = _ref36.versionHash;
2160
+ libraryId = _ref37.libraryId, objectId = _ref37.objectId, versionHash = _ref37.versionHash;
2128
2161
 
2129
2162
  if (versionHash) {
2130
2163
  objectId = Utils.DecodeVersionHash(versionHash).objectId;
@@ -2163,8 +2196,8 @@ function () {
2163
2196
  }));
2164
2197
 
2165
2198
  case 12:
2166
- _ref37 = _context28.sent;
2167
- secret_key = _ref37.secret_key;
2199
+ _ref38 = _context28.sent;
2200
+ secret_key = _ref38.secret_key;
2168
2201
  conk.secret_key = secret_key; // { secret_key, public_key, symm_key, block_size }
2169
2202
 
2170
2203
  this.encryptionKeys[objectId] = conk;
@@ -2181,14 +2214,14 @@ function () {
2181
2214
  }
2182
2215
  }, {
2183
2216
  key: "RecordTags",
2184
- value: function RecordTags(_ref38) {
2185
- var accessType, libraryId, objectId, versionHash, _ref39, abi, owner;
2217
+ value: function RecordTags(_ref39) {
2218
+ var accessType, libraryId, objectId, versionHash, _ref40, abi, owner;
2186
2219
 
2187
2220
  return _regeneratorRuntime.async(function RecordTags$(_context29) {
2188
2221
  while (1) {
2189
2222
  switch (_context29.prev = _context29.next) {
2190
2223
  case 0:
2191
- accessType = _ref38.accessType, libraryId = _ref38.libraryId, objectId = _ref38.objectId, versionHash = _ref38.versionHash;
2224
+ accessType = _ref39.accessType, libraryId = _ref39.libraryId, objectId = _ref39.objectId, versionHash = _ref39.versionHash;
2192
2225
 
2193
2226
  if (!(accessType !== ACCESS_TYPES.OBJECT)) {
2194
2227
  _context29.next = 3;
@@ -2204,8 +2237,8 @@ function () {
2204
2237
  }));
2205
2238
 
2206
2239
  case 5:
2207
- _ref39 = _context29.sent;
2208
- abi = _ref39.abi;
2240
+ _ref40 = _context29.sent;
2241
+ abi = _ref40.abi;
2209
2242
  _context29.next = 9;
2210
2243
  return _regeneratorRuntime.awrap(this.Owner({
2211
2244
  id: objectId,
@@ -2239,7 +2272,7 @@ function () {
2239
2272
  }, {
2240
2273
  key: "CreateAccessGroup",
2241
2274
  value: function CreateAccessGroup() {
2242
- var _ref40, contractAddress, transactionHash;
2275
+ var _ref41, contractAddress, transactionHash;
2243
2276
 
2244
2277
  return _regeneratorRuntime.async(function CreateAccessGroup$(_context30) {
2245
2278
  while (1) {
@@ -2252,9 +2285,9 @@ function () {
2252
2285
  }));
2253
2286
 
2254
2287
  case 2:
2255
- _ref40 = _context30.sent;
2256
- contractAddress = _ref40.contractAddress;
2257
- transactionHash = _ref40.transactionHash;
2288
+ _ref41 = _context30.sent;
2289
+ contractAddress = _ref41.contractAddress;
2290
+ transactionHash = _ref41.transactionHash;
2258
2291
  return _context30.abrupt("return", {
2259
2292
  contractAddress: contractAddress,
2260
2293
  transactionHash: transactionHash
@@ -2270,7 +2303,7 @@ function () {
2270
2303
  }, {
2271
2304
  key: "CreateContentType",
2272
2305
  value: function CreateContentType() {
2273
- var _ref41, contractAddress, transactionHash;
2306
+ var _ref42, contractAddress, transactionHash;
2274
2307
 
2275
2308
  return _regeneratorRuntime.async(function CreateContentType$(_context31) {
2276
2309
  while (1) {
@@ -2283,9 +2316,9 @@ function () {
2283
2316
  }));
2284
2317
 
2285
2318
  case 2:
2286
- _ref41 = _context31.sent;
2287
- contractAddress = _ref41.contractAddress;
2288
- transactionHash = _ref41.transactionHash;
2319
+ _ref42 = _context31.sent;
2320
+ contractAddress = _ref42.contractAddress;
2321
+ transactionHash = _ref42.transactionHash;
2289
2322
  return _context31.abrupt("return", {
2290
2323
  contractAddress: contractAddress,
2291
2324
  transactionHash: transactionHash
@@ -2300,14 +2333,14 @@ function () {
2300
2333
  }
2301
2334
  }, {
2302
2335
  key: "CreateContentLibrary",
2303
- value: function CreateContentLibrary(_ref42) {
2304
- var kmsId, _ref43, contractAddress, transactionHash;
2336
+ value: function CreateContentLibrary(_ref43) {
2337
+ var kmsId, _ref44, contractAddress, transactionHash;
2305
2338
 
2306
2339
  return _regeneratorRuntime.async(function CreateContentLibrary$(_context32) {
2307
2340
  while (1) {
2308
2341
  switch (_context32.prev = _context32.next) {
2309
2342
  case 0:
2310
- kmsId = _ref42.kmsId;
2343
+ kmsId = _ref43.kmsId;
2311
2344
  _context32.next = 3;
2312
2345
  return _regeneratorRuntime.awrap(this.client.ethClient.DeployLibraryContract({
2313
2346
  contentSpaceAddress: Utils.HashToAddress(this.contentSpaceId),
@@ -2316,9 +2349,9 @@ function () {
2316
2349
  }));
2317
2350
 
2318
2351
  case 3:
2319
- _ref43 = _context32.sent;
2320
- contractAddress = _ref43.contractAddress;
2321
- transactionHash = _ref43.transactionHash;
2352
+ _ref44 = _context32.sent;
2353
+ contractAddress = _ref44.contractAddress;
2354
+ transactionHash = _ref44.transactionHash;
2322
2355
  return _context32.abrupt("return", {
2323
2356
  contractAddress: contractAddress,
2324
2357
  transactionHash: transactionHash
@@ -2333,14 +2366,14 @@ function () {
2333
2366
  }
2334
2367
  }, {
2335
2368
  key: "CreateContentObject",
2336
- value: function CreateContentObject(_ref44) {
2337
- var libraryId, typeId, _ref45, contractAddress, transactionHash;
2369
+ value: function CreateContentObject(_ref45) {
2370
+ var libraryId, typeId, _ref46, contractAddress, transactionHash;
2338
2371
 
2339
2372
  return _regeneratorRuntime.async(function CreateContentObject$(_context33) {
2340
2373
  while (1) {
2341
2374
  switch (_context33.prev = _context33.next) {
2342
2375
  case 0:
2343
- libraryId = _ref44.libraryId, typeId = _ref44.typeId;
2376
+ libraryId = _ref45.libraryId, typeId = _ref45.typeId;
2344
2377
  _context33.next = 3;
2345
2378
  return _regeneratorRuntime.awrap(this.client.ethClient.DeployContentContract({
2346
2379
  contentLibraryAddress: Utils.HashToAddress(libraryId),
@@ -2349,9 +2382,9 @@ function () {
2349
2382
  }));
2350
2383
 
2351
2384
  case 3:
2352
- _ref45 = _context33.sent;
2353
- contractAddress = _ref45.contractAddress;
2354
- transactionHash = _ref45.transactionHash;
2385
+ _ref46 = _context33.sent;
2386
+ contractAddress = _ref46.contractAddress;
2387
+ transactionHash = _ref46.transactionHash;
2355
2388
  return _context33.abrupt("return", {
2356
2389
  contractAddress: contractAddress,
2357
2390
  transactionHash: transactionHash