@eluvio/elv-client-js 4.2.22 → 4.2.23

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.
@@ -49,12 +49,12 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
49
49
  key: "Initialize",
50
50
  value: function () {
51
51
  var _Initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
52
- var body, _yield$Utils$Response, addr, eth, token, pubkey, keys, address;
52
+ var body, _yield$Utils$Response, addr, eth, token, keys, address;
53
53
  return _regeneratorRuntime.wrap(function _callee$(_context) {
54
54
  while (1) switch (_context.prev = _context.next) {
55
55
  case 0:
56
56
  if (this.authToken) {
57
- _context.next = 15;
57
+ _context.next = 13;
58
58
  break;
59
59
  }
60
60
  body = {
@@ -80,17 +80,15 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
80
80
  addr = _yield$Utils$Response.addr;
81
81
  eth = _yield$Utils$Response.eth;
82
82
  token = _yield$Utils$Response.token;
83
- pubkey = _yield$Utils$Response.pubkey;
84
83
  this.authToken = token;
85
84
  this.address = Utils.FormatAddress(addr);
86
85
  this.id = eth;
87
- this.publicKey = pubkey;
88
- case 15:
89
- if (!(!this.address || !this.publicKey)) {
90
- _context.next = 21;
86
+ case 13:
87
+ if (this.address) {
88
+ _context.next = 19;
91
89
  break;
92
90
  }
93
- _context.next = 18;
91
+ _context.next = 16;
94
92
  return Utils.ResponseToJson(this.HttpClient.Request({
95
93
  method: "GET",
96
94
  path: UrlJoin("as", "wlt", "keys"),
@@ -98,23 +96,18 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
98
96
  Authorization: "Bearer ".concat(this.authToken)
99
97
  }
100
98
  }));
101
- case 18:
99
+ case 16:
102
100
  keys = _context.sent;
103
- if (!this.address) {
104
- address = keys.eth[0];
105
- if (address && address.startsWith("0x")) {
106
- this.address = address;
107
- } else {
108
- this.address = Utils.HashToAddress(keys.eth[0]);
109
- }
110
- }
111
- if (!this.publicKey) {
112
- this.publicKey = keys.pubkey && keys.pubkey[0];
101
+ address = keys.eth[0];
102
+ if (address && address.startsWith("0x")) {
103
+ this.address = address;
104
+ } else {
105
+ this.address = Utils.HashToAddress(keys.eth[0]);
113
106
  }
114
- case 21:
107
+ case 19:
115
108
  this.id = this.address ? "ikms".concat(Utils.AddressToHash(this.address)) : undefined;
116
109
  this.signer = this.provider.getSigner(this.address);
117
- case 23:
110
+ case 21:
118
111
  case "end":
119
112
  return _context.stop();
120
113
  }
@@ -284,116 +277,23 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
284
277
  value: function getAddress() {
285
278
  return this.address;
286
279
  }
287
- }, {
288
- key: "_normalizePublicKey",
289
- value: function _normalizePublicKey(key) {
290
- var with0x = key.startsWith("0x") ? key : "0x".concat(key);
291
- return with0x.length === 2 + 128 ? "0x04".concat(with0x.slice(2)) : with0x;
292
- }
293
-
294
- /**
295
- * This signer's public key, as provided by the authd service
296
- *
297
- * @return {Promise<string>} - The public key, in uncompressed hex like SigningKey.publicKey
298
- */
299
- }, {
300
- key: "PublicKey",
301
- value: function () {
302
- var _PublicKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
303
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
304
- while (1) switch (_context6.prev = _context6.next) {
305
- case 0:
306
- if (this.publicKey) {
307
- _context6.next = 2;
308
- break;
309
- }
310
- throw Error("RemoteSigner: public key not available - call Initialize() first");
311
- case 2:
312
- return _context6.abrupt("return", this._normalizePublicKey(this.publicKey));
313
- case 3:
314
- case "end":
315
- return _context6.stop();
316
- }
317
- }, _callee6, this);
318
- }));
319
- function PublicKey() {
320
- return _PublicKey.apply(this, arguments);
321
- }
322
- return PublicKey;
323
- }() /** so remote signers can be used interchangeably with local signers */
324
- }, {
325
- key: "_signingKey",
326
- value: function _signingKey() {
327
- if (!this.publicKey) {
328
- throw Error("RemoteSigner: public key not available - call Initialize() first");
329
- }
330
- var publicKey = this._normalizePublicKey(this.publicKey);
331
- return {
332
- publicKey: publicKey,
333
- get privateKey() {
334
- throw Error("RemoteSigner: remote signer does not have direct access to a private key");
335
- }
336
- };
337
- }
338
-
339
- /**
340
- * Decrypt a secp256k1 ECIES-encrypted blob (e.g. a fabric encryption conk) that was wrapped
341
- * for this signer's public key, via the authd service's generic decrypt endpoint.
342
- *
343
- * @param {string} encryptedData - Base64-encoded ECIES-encrypted blob
344
- * @return {Promise<Object>} - The decrypted, JSON-parsed contents
345
- */
346
- }, {
347
- key: "DecryptCap",
348
- value: function () {
349
- var _DecryptCap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(encryptedData) {
350
- var _yield$Utils$Response2, data;
351
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
352
- while (1) switch (_context7.prev = _context7.next) {
353
- case 0:
354
- _context7.next = 2;
355
- return Utils.ResponseToJson(this.HttpClient.Request({
356
- method: "POST",
357
- path: UrlJoin("as", "wlt", "decrypt", "eth", this.id),
358
- headers: {
359
- Authorization: "Bearer ".concat(this.authToken)
360
- },
361
- body: {
362
- data: encryptedData
363
- }
364
- }));
365
- case 2:
366
- _yield$Utils$Response2 = _context7.sent;
367
- data = _yield$Utils$Response2.data;
368
- return _context7.abrupt("return", JSON.parse(Buffer.from(data, "base64").toString()));
369
- case 5:
370
- case "end":
371
- return _context7.stop();
372
- }
373
- }, _callee7, this);
374
- }));
375
- function DecryptCap(_x5) {
376
- return _DecryptCap.apply(this, arguments);
377
- }
378
- return DecryptCap;
379
- }()
380
280
  }, {
381
281
  key: "signDigest",
382
282
  value: function () {
383
- var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(digest) {
283
+ var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(digest) {
384
284
  var _this2 = this;
385
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
386
- while (1) switch (_context9.prev = _context9.next) {
285
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
286
+ while (1) switch (_context7.prev = _context7.next) {
387
287
  case 0:
388
288
  if (!this.signatureCache[digest]) {
389
289
  this.signatureCache[digest] = new Promise( /*#__PURE__*/function () {
390
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(resolve, reject) {
290
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(resolve, reject) {
391
291
  var signature;
392
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
393
- while (1) switch (_context8.prev = _context8.next) {
292
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
293
+ while (1) switch (_context6.prev = _context6.next) {
394
294
  case 0:
395
- _context8.prev = 0;
396
- _context8.next = 3;
295
+ _context6.prev = 0;
296
+ _context6.next = 3;
397
297
  return Utils.ResponseToJson(_this2.HttpClient.Request({
398
298
  method: "POST",
399
299
  path: UrlJoin("as", "wlt", "sign", "eth", _this2.id),
@@ -405,38 +305,38 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
405
305
  }
406
306
  }));
407
307
  case 3:
408
- signature = _context8.sent;
308
+ signature = _context6.sent;
409
309
  signature.v = parseInt(signature.v, 16);
410
310
  signature.recoveryParam = signature.v - 27;
411
311
  resolve(signature);
412
- _context8.next = 12;
312
+ _context6.next = 12;
413
313
  break;
414
314
  case 9:
415
- _context8.prev = 9;
416
- _context8.t0 = _context8["catch"](0);
417
- reject(_context8.t0);
315
+ _context6.prev = 9;
316
+ _context6.t0 = _context6["catch"](0);
317
+ reject(_context6.t0);
418
318
  case 12:
419
319
  case "end":
420
- return _context8.stop();
320
+ return _context6.stop();
421
321
  }
422
- }, _callee8, null, [[0, 9]]);
322
+ }, _callee6, null, [[0, 9]]);
423
323
  }));
424
- return function (_x7, _x8) {
324
+ return function (_x6, _x7) {
425
325
  return _ref6.apply(this, arguments);
426
326
  };
427
327
  }());
428
328
  }
429
- _context9.next = 3;
329
+ _context7.next = 3;
430
330
  return this.signatureCache[digest];
431
331
  case 3:
432
- return _context9.abrupt("return", _context9.sent);
332
+ return _context7.abrupt("return", _context7.sent);
433
333
  case 4:
434
334
  case "end":
435
- return _context9.stop();
335
+ return _context7.stop();
436
336
  }
437
- }, _callee9, this);
337
+ }, _callee7, this);
438
338
  }));
439
- function signDigest(_x6) {
339
+ function signDigest(_x5) {
440
340
  return _signDigest.apply(this, arguments);
441
341
  }
442
342
  return signDigest;
@@ -444,27 +344,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
444
344
  }, {
445
345
  key: "signMessage",
446
346
  value: function () {
447
- var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(message) {
448
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
449
- while (1) switch (_context10.prev = _context10.next) {
347
+ var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(message) {
348
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
349
+ while (1) switch (_context8.prev = _context8.next) {
450
350
  case 0:
451
- _context10.t0 = Promise;
452
- _context10.t1 = Ethers.utils;
453
- _context10.t2 = "0x";
454
- _context10.next = 5;
351
+ _context8.t0 = Promise;
352
+ _context8.t1 = Ethers.utils;
353
+ _context8.t2 = "0x";
354
+ _context8.next = 5;
455
355
  return this.signDigest(Ethers.utils.hashMessage(message));
456
356
  case 5:
457
- _context10.t3 = _context10.sent;
458
- _context10.t4 = _context10.t2.concat.call(_context10.t2, _context10.t3);
459
- _context10.t5 = _context10.t1.joinSignature.call(_context10.t1, _context10.t4);
460
- return _context10.abrupt("return", _context10.t0.resolve.call(_context10.t0, _context10.t5));
357
+ _context8.t3 = _context8.sent;
358
+ _context8.t4 = _context8.t2.concat.call(_context8.t2, _context8.t3);
359
+ _context8.t5 = _context8.t1.joinSignature.call(_context8.t1, _context8.t4);
360
+ return _context8.abrupt("return", _context8.t0.resolve.call(_context8.t0, _context8.t5));
461
361
  case 9:
462
362
  case "end":
463
- return _context10.stop();
363
+ return _context8.stop();
464
364
  }
465
- }, _callee10, this);
365
+ }, _callee8, this);
466
366
  }));
467
- function signMessage(_x9) {
367
+ function signMessage(_x8) {
468
368
  return _signMessage.apply(this, arguments);
469
369
  }
470
370
  return signMessage;
@@ -472,27 +372,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
472
372
  }, {
473
373
  key: "sign",
474
374
  value: function () {
475
- var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(transaction) {
375
+ var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(transaction) {
476
376
  var signature;
477
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
478
- while (1) switch (_context11.prev = _context11.next) {
377
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
378
+ while (1) switch (_context9.prev = _context9.next) {
479
379
  case 0:
480
- _context11.next = 2;
380
+ _context9.next = 2;
481
381
  return Ethers.utils.resolveProperties(transaction);
482
382
  case 2:
483
- transaction = _context11.sent;
484
- _context11.next = 5;
383
+ transaction = _context9.sent;
384
+ _context9.next = 5;
485
385
  return this.signDigest(Ethers.utils.keccak256(Ethers.utils.serializeTransaction(transaction)));
486
386
  case 5:
487
- signature = _context11.sent;
488
- return _context11.abrupt("return", Ethers.utils.serializeTransaction(transaction, signature));
387
+ signature = _context9.sent;
388
+ return _context9.abrupt("return", Ethers.utils.serializeTransaction(transaction, signature));
489
389
  case 7:
490
390
  case "end":
491
- return _context11.stop();
391
+ return _context9.stop();
492
392
  }
493
- }, _callee11, this);
393
+ }, _callee9, this);
494
394
  }));
495
- function sign(_x10) {
395
+ function sign(_x9) {
496
396
  return _sign.apply(this, arguments);
497
397
  }
498
398
  return sign;
@@ -500,33 +400,33 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
500
400
  }, {
501
401
  key: "sendTransaction",
502
402
  value: function () {
503
- var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(transaction) {
403
+ var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(transaction) {
504
404
  var _this3 = this;
505
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
506
- while (1) switch (_context12.prev = _context12.next) {
405
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
406
+ while (1) switch (_context10.prev = _context10.next) {
507
407
  case 0:
508
408
  if (!(transaction.nonce == null)) {
509
- _context12.next = 5;
409
+ _context10.next = 5;
510
410
  break;
511
411
  }
512
412
  transaction = Ethers.utils.shallowCopy(transaction);
513
- _context12.next = 4;
413
+ _context10.next = 4;
514
414
  return this.provider.getTransactionCount(this.address, "pending");
515
415
  case 4:
516
- transaction.nonce = _context12.sent;
416
+ transaction.nonce = _context10.sent;
517
417
  case 5:
518
- return _context12.abrupt("return", this.populateTransaction(transaction, this.provider, this.address).then(function (tx) {
418
+ return _context10.abrupt("return", this.populateTransaction(transaction, this.provider, this.address).then(function (tx) {
519
419
  return _this3.sign(tx).then(function (signedTransaction) {
520
420
  return _this3.provider.sendTransaction(signedTransaction);
521
421
  });
522
422
  }));
523
423
  case 6:
524
424
  case "end":
525
- return _context12.stop();
425
+ return _context10.stop();
526
426
  }
527
- }, _callee12, this);
427
+ }, _callee10, this);
528
428
  }));
529
- function sendTransaction(_x11) {
429
+ function sendTransaction(_x10) {
530
430
  return _sendTransaction.apply(this, arguments);
531
431
  }
532
432
  return sendTransaction;
@@ -1578,6 +1578,16 @@ var AbrProfileLiveDrm = {
1578
1578
  }
1579
1579
  },
1580
1580
  "playout_formats": {
1581
+ "dash-playready-cenc": {
1582
+ "drm": {
1583
+ "enc_scheme_name": "cenc",
1584
+ "type": "DrmPlayReady"
1585
+ },
1586
+ "protocol": {
1587
+ "min_buffer_length": 2,
1588
+ "type": "ProtoDash"
1589
+ }
1590
+ },
1581
1591
  "dash-widevine": {
1582
1592
  "drm": {
1583
1593
  "content_id": "",