@eluvio/elv-client-js 4.2.23 → 4.2.25
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.
- package/dist/ElvClient-min.js +1 -1
- package/dist/ElvClient-node-min.js +1 -1
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/ElvPermissionsClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +1 -1
- package/dist/ElvWalletClient-node-min.js +1 -1
- package/dist/src/AuthorizationClient.js +7 -12
- package/dist/src/ContentObjectAudit.js +2 -1
- package/dist/src/ContentObjectVerification.js +281 -0
- package/dist/src/Crypto.js +33 -5
- package/dist/src/ElvClient.js +9 -10
- package/dist/src/FrameClient.js +1 -1
- package/dist/src/HttpClient.js +90 -47
- package/dist/src/NetworkUrls.js +8 -0
- package/dist/src/RemoteSigner.js +170 -70
- package/dist/src/abr_profiles/abr_profile_live_drm.js +0 -10
- package/dist/src/client/ContentAccess.js +1165 -1149
- package/dist/src/client/ContentManagement.js +2 -2
- package/dist/src/client/Contracts.js +2 -2
- package/dist/src/client/LiveConf.js +171 -84
- package/dist/src/client/LiveStream.js +5649 -2155
- package/dist/src/client/NTP.js +172 -77
- package/dist/src/live_recording_config_profiles/live_recording_config_default.js +45 -0
- package/package.json +1 -1
- package/src/FrameClient.js +2 -0
- package/src/client/Contracts.js +1 -1
- package/src/client/LiveConf.js +46 -27
- package/src/client/LiveStream.js +337 -92
- package/utilities/LiveOutputs.js +9 -4
package/dist/src/HttpClient.js
CHANGED
|
@@ -7,17 +7,21 @@ var _Fetch = typeof fetch !== "undefined" ? fetch : require("node-fetch")["defau
|
|
|
7
7
|
var _require = require("./LogMessage"),
|
|
8
8
|
LogMessage = _require.LogMessage;
|
|
9
9
|
var Utils = require("./Utils");
|
|
10
|
+
var UrlJoin = require("url-join");
|
|
11
|
+
var NetworkUrls = require("./NetworkUrls");
|
|
10
12
|
var HttpClient = /*#__PURE__*/function () {
|
|
11
13
|
"use strict";
|
|
12
14
|
|
|
13
15
|
function HttpClient(_ref) {
|
|
14
16
|
var uris = _ref.uris,
|
|
17
|
+
networkName = _ref.networkName,
|
|
15
18
|
debug = _ref.debug;
|
|
16
19
|
_classCallCheck(this, HttpClient);
|
|
17
20
|
this.uris = uris;
|
|
18
21
|
this.uriIndex = 0;
|
|
19
22
|
this.debug = debug;
|
|
20
23
|
this.draftURIs = {};
|
|
24
|
+
this.networkName = networkName;
|
|
21
25
|
this.retries = Math.max(3, uris.length);
|
|
22
26
|
}
|
|
23
27
|
_createClass(HttpClient, [{
|
|
@@ -67,7 +71,7 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
67
71
|
key: "Request",
|
|
68
72
|
value: function () {
|
|
69
73
|
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
|
|
70
|
-
var method, path, _ref3$queryParams, queryParams, body, _ref3$bodyType, bodyType, _ref3$headers, headers, _ref3$attempts, attempts, _ref3$allowFailover, allowFailover, _ref3$forceFailover, forceFailover, _ref3$allowRetry, allowRetry, uriIndex, baseURI, writeTokenMatch, writeToken, uri, fetchParameters, response, responseType, errorBody, error;
|
|
74
|
+
var method, path, _ref3$queryParams, queryParams, body, _ref3$bodyType, bodyType, _ref3$headers, headers, _ref3$attempts, attempts, _ref3$allowFailover, allowFailover, _ref3$forceFailover, forceFailover, _ref3$allowRetry, allowRetry, uriIndex, baseURI, writeTokenMatch, writeToken, configUrl, uri, fetchParameters, response, responseType, errorBody, error;
|
|
71
75
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
72
76
|
while (1) switch (_context.prev = _context.next) {
|
|
73
77
|
case 0:
|
|
@@ -75,16 +79,55 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
75
79
|
baseURI = this.BaseURI(uriIndex); // If URL contains a write token, it must go to the correct server and can not fail over
|
|
76
80
|
writeTokenMatch = path.replace(/^\//, "").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw__[a-zA-Z0-9]+)/);
|
|
77
81
|
writeToken = writeTokenMatch ? writeTokenMatch[2] : undefined;
|
|
78
|
-
if (writeToken) {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
82
|
+
if (!writeToken) {
|
|
83
|
+
_context.next = 30;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
allowFailover = false;
|
|
87
|
+
if (!this.draftURIs[writeToken]) {
|
|
88
|
+
_context.next = 10;
|
|
89
|
+
break;
|
|
87
90
|
}
|
|
91
|
+
// Use saved write token URI
|
|
92
|
+
baseURI = this.draftURIs[writeToken];
|
|
93
|
+
_context.next = 29;
|
|
94
|
+
break;
|
|
95
|
+
case 10:
|
|
96
|
+
if (!this.networkName) {
|
|
97
|
+
_context.next = 28;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
_context.prev = 11;
|
|
101
|
+
configUrl = new URL(NetworkUrls[this.networkName]);
|
|
102
|
+
configUrl.pathname = UrlJoin("/s", this.networkName, "nodes");
|
|
103
|
+
configUrl.searchParams.set("token", writeToken);
|
|
104
|
+
_context.t0 = URI;
|
|
105
|
+
_context.next = 18;
|
|
106
|
+
return fetch(configUrl);
|
|
107
|
+
case 18:
|
|
108
|
+
_context.next = 20;
|
|
109
|
+
return _context.sent.json();
|
|
110
|
+
case 20:
|
|
111
|
+
_context.t1 = _context.sent.nodes[0].services.fabric_api.urls[0];
|
|
112
|
+
baseURI = new _context.t0(_context.t1);
|
|
113
|
+
_context.next = 28;
|
|
114
|
+
break;
|
|
115
|
+
case 24:
|
|
116
|
+
_context.prev = 24;
|
|
117
|
+
_context.t2 = _context["catch"](11);
|
|
118
|
+
this.Log("Failed to retrieve write token node for " + writeToken);
|
|
119
|
+
this.Log(_context.t2);
|
|
120
|
+
case 28:
|
|
121
|
+
// Save current URI for all future requests involving this write token
|
|
122
|
+
this.draftURIs[writeToken] = baseURI;
|
|
123
|
+
case 29:
|
|
124
|
+
// If write token is present in headers, we may get redirected even if we try and use the right node.
|
|
125
|
+
// When a network request is redirected, the authorization header is dropped, which will cause issues.
|
|
126
|
+
// Ensure it is present in query params as well
|
|
127
|
+
if ((headers.Authorization || headers.authorization) && !queryParams.authorization) {
|
|
128
|
+
queryParams.authorization = headers.Authorization || headers.authorization;
|
|
129
|
+
}
|
|
130
|
+
case 30:
|
|
88
131
|
uri = baseURI.path(path).query(queryParams).hash("");
|
|
89
132
|
fetchParameters = {
|
|
90
133
|
method: method,
|
|
@@ -101,50 +144,50 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
101
144
|
this.Log("".concat(method, " - ").concat(uri.toString()));
|
|
102
145
|
this.Log("fetchParameters: ".concat(JSON.stringify(fetchParameters, null, 2)));
|
|
103
146
|
}
|
|
104
|
-
_context.prev =
|
|
105
|
-
_context.next =
|
|
147
|
+
_context.prev = 34;
|
|
148
|
+
_context.next = 37;
|
|
106
149
|
return HttpClient.Fetch(uri.toString(), fetchParameters);
|
|
107
|
-
case
|
|
150
|
+
case 37:
|
|
108
151
|
response = _context.sent;
|
|
109
|
-
_context.next =
|
|
152
|
+
_context.next = 43;
|
|
110
153
|
break;
|
|
111
|
-
case
|
|
112
|
-
_context.prev =
|
|
113
|
-
_context.
|
|
154
|
+
case 40:
|
|
155
|
+
_context.prev = 40;
|
|
156
|
+
_context.t3 = _context["catch"](34);
|
|
114
157
|
response = {
|
|
115
158
|
ok: false,
|
|
116
|
-
status: _context.
|
|
117
|
-
statusText: "ElvClient Error: " + _context.
|
|
159
|
+
status: _context.t3 && _context.t3.status || 500,
|
|
160
|
+
statusText: "ElvClient Error: " + _context.t3.message,
|
|
118
161
|
url: uri.toString(),
|
|
119
|
-
error: _context.
|
|
162
|
+
error: _context.t3
|
|
120
163
|
};
|
|
121
|
-
case
|
|
164
|
+
case 43:
|
|
122
165
|
if (response.ok) {
|
|
123
|
-
_context.next =
|
|
166
|
+
_context.next = 72;
|
|
124
167
|
break;
|
|
125
168
|
}
|
|
126
169
|
if (!((parseInt(response.status) >= 500 || forceFailover) && allowRetry && attempts < this.retries)) {
|
|
127
|
-
_context.next =
|
|
170
|
+
_context.next = 56;
|
|
128
171
|
break;
|
|
129
172
|
}
|
|
130
173
|
if (!allowFailover) {
|
|
131
|
-
_context.next =
|
|
174
|
+
_context.next = 50;
|
|
132
175
|
break;
|
|
133
176
|
}
|
|
134
177
|
// Fail over to alternate node
|
|
135
178
|
this.uriIndex = (this.uriIndex + 1) % this.uris.length;
|
|
136
179
|
this.Log("HttpClient failing over from ".concat(baseURI.toString(), ": ").concat(attempts + 1, " attempts"), true);
|
|
137
|
-
_context.next =
|
|
180
|
+
_context.next = 53;
|
|
138
181
|
break;
|
|
139
|
-
case
|
|
182
|
+
case 50:
|
|
140
183
|
// Wait and retry
|
|
141
184
|
this.Log("HttpClient retrying request from ".concat(baseURI.toString(), ": ").concat(attempts + 1, " attempts"), true);
|
|
142
|
-
_context.next =
|
|
185
|
+
_context.next = 53;
|
|
143
186
|
return new Promise(function (resolve) {
|
|
144
187
|
return setTimeout(resolve, 1000);
|
|
145
188
|
});
|
|
146
|
-
case
|
|
147
|
-
_context.next =
|
|
189
|
+
case 53:
|
|
190
|
+
_context.next = 55;
|
|
148
191
|
return this.Request({
|
|
149
192
|
method: method,
|
|
150
193
|
path: path,
|
|
@@ -156,34 +199,34 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
156
199
|
uriIndex: uriIndex,
|
|
157
200
|
forceFailover: forceFailover
|
|
158
201
|
});
|
|
159
|
-
case
|
|
202
|
+
case 55:
|
|
160
203
|
return _context.abrupt("return", _context.sent);
|
|
161
|
-
case
|
|
204
|
+
case 56:
|
|
162
205
|
// Parse JSON error if headers indicate JSON
|
|
163
206
|
responseType = response.headers ? response.headers.get("content-type") || "" : "";
|
|
164
207
|
errorBody = "";
|
|
165
208
|
if (!(response.text && response.json)) {
|
|
166
|
-
_context.next =
|
|
209
|
+
_context.next = 69;
|
|
167
210
|
break;
|
|
168
211
|
}
|
|
169
212
|
if (!responseType.includes("application/json")) {
|
|
170
|
-
_context.next =
|
|
213
|
+
_context.next = 65;
|
|
171
214
|
break;
|
|
172
215
|
}
|
|
173
|
-
_context.next =
|
|
216
|
+
_context.next = 62;
|
|
174
217
|
return response.json();
|
|
175
|
-
case
|
|
176
|
-
_context.
|
|
177
|
-
_context.next =
|
|
218
|
+
case 62:
|
|
219
|
+
_context.t4 = _context.sent;
|
|
220
|
+
_context.next = 68;
|
|
178
221
|
break;
|
|
179
|
-
case
|
|
180
|
-
_context.next =
|
|
222
|
+
case 65:
|
|
223
|
+
_context.next = 67;
|
|
181
224
|
return response.text();
|
|
182
|
-
case
|
|
183
|
-
_context.
|
|
184
|
-
case
|
|
185
|
-
errorBody = _context.
|
|
186
|
-
case
|
|
225
|
+
case 67:
|
|
226
|
+
_context.t4 = _context.sent;
|
|
227
|
+
case 68:
|
|
228
|
+
errorBody = _context.t4;
|
|
229
|
+
case 69:
|
|
187
230
|
error = {
|
|
188
231
|
name: "ElvHttpClientError",
|
|
189
232
|
status: response.status,
|
|
@@ -196,14 +239,14 @@ var HttpClient = /*#__PURE__*/function () {
|
|
|
196
239
|
};
|
|
197
240
|
if (this.debug) this.Log(JSON.stringify(error, null, 2), true);
|
|
198
241
|
throw error;
|
|
199
|
-
case
|
|
242
|
+
case 72:
|
|
200
243
|
this.Log("".concat(response.status, " - ").concat(method, " ").concat(uri.toString()));
|
|
201
244
|
return _context.abrupt("return", response);
|
|
202
|
-
case
|
|
245
|
+
case 74:
|
|
203
246
|
case "end":
|
|
204
247
|
return _context.stop();
|
|
205
248
|
}
|
|
206
|
-
}, _callee, this, [[
|
|
249
|
+
}, _callee, this, [[11, 24], [34, 40]]);
|
|
207
250
|
}));
|
|
208
251
|
function Request(_x) {
|
|
209
252
|
return _Request.apply(this, arguments);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var networks = {
|
|
2
|
+
"main": "https://main.net955305.contentfabric.io",
|
|
3
|
+
"demo": "https://demov3.net955210.contentfabric.io",
|
|
4
|
+
"demov3": "https://demov3.net955210.contentfabric.io",
|
|
5
|
+
"local": "http://127.0.0.1:8008/config?qspace=dev&self",
|
|
6
|
+
"test": "https://test.net955203.contentfabric.io"
|
|
7
|
+
};
|
|
8
|
+
module.exports = networks;
|
package/dist/src/RemoteSigner.js
CHANGED
|
@@ -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, keys, address;
|
|
52
|
+
var body, _yield$Utils$Response, addr, eth, token, pubkey, 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 =
|
|
57
|
+
_context.next = 15;
|
|
58
58
|
break;
|
|
59
59
|
}
|
|
60
60
|
body = {
|
|
@@ -80,15 +80,17 @@ 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;
|
|
83
84
|
this.authToken = token;
|
|
84
85
|
this.address = Utils.FormatAddress(addr);
|
|
85
86
|
this.id = eth;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
this.publicKey = pubkey;
|
|
88
|
+
case 15:
|
|
89
|
+
if (!(!this.address || !this.publicKey)) {
|
|
90
|
+
_context.next = 21;
|
|
89
91
|
break;
|
|
90
92
|
}
|
|
91
|
-
_context.next =
|
|
93
|
+
_context.next = 18;
|
|
92
94
|
return Utils.ResponseToJson(this.HttpClient.Request({
|
|
93
95
|
method: "GET",
|
|
94
96
|
path: UrlJoin("as", "wlt", "keys"),
|
|
@@ -96,18 +98,23 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
96
98
|
Authorization: "Bearer ".concat(this.authToken)
|
|
97
99
|
}
|
|
98
100
|
}));
|
|
99
|
-
case
|
|
101
|
+
case 18:
|
|
100
102
|
keys = _context.sent;
|
|
101
|
-
address
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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];
|
|
106
113
|
}
|
|
107
|
-
case
|
|
114
|
+
case 21:
|
|
108
115
|
this.id = this.address ? "ikms".concat(Utils.AddressToHash(this.address)) : undefined;
|
|
109
116
|
this.signer = this.provider.getSigner(this.address);
|
|
110
|
-
case
|
|
117
|
+
case 23:
|
|
111
118
|
case "end":
|
|
112
119
|
return _context.stop();
|
|
113
120
|
}
|
|
@@ -278,22 +285,115 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
278
285
|
return this.address;
|
|
279
286
|
}
|
|
280
287
|
}, {
|
|
281
|
-
key: "
|
|
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",
|
|
282
301
|
value: function () {
|
|
283
|
-
var
|
|
284
|
-
|
|
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;
|
|
285
351
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
286
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
|
+
}, {
|
|
381
|
+
key: "signDigest",
|
|
382
|
+
value: function () {
|
|
383
|
+
var _signDigest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(digest) {
|
|
384
|
+
var _this2 = this;
|
|
385
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
386
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
287
387
|
case 0:
|
|
288
388
|
if (!this.signatureCache[digest]) {
|
|
289
389
|
this.signatureCache[digest] = new Promise( /*#__PURE__*/function () {
|
|
290
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
390
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(resolve, reject) {
|
|
291
391
|
var signature;
|
|
292
|
-
return _regeneratorRuntime.wrap(function
|
|
293
|
-
while (1) switch (
|
|
392
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
393
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
294
394
|
case 0:
|
|
295
|
-
|
|
296
|
-
|
|
395
|
+
_context8.prev = 0;
|
|
396
|
+
_context8.next = 3;
|
|
297
397
|
return Utils.ResponseToJson(_this2.HttpClient.Request({
|
|
298
398
|
method: "POST",
|
|
299
399
|
path: UrlJoin("as", "wlt", "sign", "eth", _this2.id),
|
|
@@ -305,38 +405,38 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
305
405
|
}
|
|
306
406
|
}));
|
|
307
407
|
case 3:
|
|
308
|
-
signature =
|
|
408
|
+
signature = _context8.sent;
|
|
309
409
|
signature.v = parseInt(signature.v, 16);
|
|
310
410
|
signature.recoveryParam = signature.v - 27;
|
|
311
411
|
resolve(signature);
|
|
312
|
-
|
|
412
|
+
_context8.next = 12;
|
|
313
413
|
break;
|
|
314
414
|
case 9:
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
reject(
|
|
415
|
+
_context8.prev = 9;
|
|
416
|
+
_context8.t0 = _context8["catch"](0);
|
|
417
|
+
reject(_context8.t0);
|
|
318
418
|
case 12:
|
|
319
419
|
case "end":
|
|
320
|
-
return
|
|
420
|
+
return _context8.stop();
|
|
321
421
|
}
|
|
322
|
-
},
|
|
422
|
+
}, _callee8, null, [[0, 9]]);
|
|
323
423
|
}));
|
|
324
|
-
return function (
|
|
424
|
+
return function (_x7, _x8) {
|
|
325
425
|
return _ref6.apply(this, arguments);
|
|
326
426
|
};
|
|
327
427
|
}());
|
|
328
428
|
}
|
|
329
|
-
|
|
429
|
+
_context9.next = 3;
|
|
330
430
|
return this.signatureCache[digest];
|
|
331
431
|
case 3:
|
|
332
|
-
return
|
|
432
|
+
return _context9.abrupt("return", _context9.sent);
|
|
333
433
|
case 4:
|
|
334
434
|
case "end":
|
|
335
|
-
return
|
|
435
|
+
return _context9.stop();
|
|
336
436
|
}
|
|
337
|
-
},
|
|
437
|
+
}, _callee9, this);
|
|
338
438
|
}));
|
|
339
|
-
function signDigest(
|
|
439
|
+
function signDigest(_x6) {
|
|
340
440
|
return _signDigest.apply(this, arguments);
|
|
341
441
|
}
|
|
342
442
|
return signDigest;
|
|
@@ -344,27 +444,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
344
444
|
}, {
|
|
345
445
|
key: "signMessage",
|
|
346
446
|
value: function () {
|
|
347
|
-
var _signMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
348
|
-
return _regeneratorRuntime.wrap(function
|
|
349
|
-
while (1) switch (
|
|
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) {
|
|
350
450
|
case 0:
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
451
|
+
_context10.t0 = Promise;
|
|
452
|
+
_context10.t1 = Ethers.utils;
|
|
453
|
+
_context10.t2 = "0x";
|
|
454
|
+
_context10.next = 5;
|
|
355
455
|
return this.signDigest(Ethers.utils.hashMessage(message));
|
|
356
456
|
case 5:
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
return
|
|
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));
|
|
361
461
|
case 9:
|
|
362
462
|
case "end":
|
|
363
|
-
return
|
|
463
|
+
return _context10.stop();
|
|
364
464
|
}
|
|
365
|
-
},
|
|
465
|
+
}, _callee10, this);
|
|
366
466
|
}));
|
|
367
|
-
function signMessage(
|
|
467
|
+
function signMessage(_x9) {
|
|
368
468
|
return _signMessage.apply(this, arguments);
|
|
369
469
|
}
|
|
370
470
|
return signMessage;
|
|
@@ -372,27 +472,27 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
372
472
|
}, {
|
|
373
473
|
key: "sign",
|
|
374
474
|
value: function () {
|
|
375
|
-
var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
475
|
+
var _sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(transaction) {
|
|
376
476
|
var signature;
|
|
377
|
-
return _regeneratorRuntime.wrap(function
|
|
378
|
-
while (1) switch (
|
|
477
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
478
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
379
479
|
case 0:
|
|
380
|
-
|
|
480
|
+
_context11.next = 2;
|
|
381
481
|
return Ethers.utils.resolveProperties(transaction);
|
|
382
482
|
case 2:
|
|
383
|
-
transaction =
|
|
384
|
-
|
|
483
|
+
transaction = _context11.sent;
|
|
484
|
+
_context11.next = 5;
|
|
385
485
|
return this.signDigest(Ethers.utils.keccak256(Ethers.utils.serializeTransaction(transaction)));
|
|
386
486
|
case 5:
|
|
387
|
-
signature =
|
|
388
|
-
return
|
|
487
|
+
signature = _context11.sent;
|
|
488
|
+
return _context11.abrupt("return", Ethers.utils.serializeTransaction(transaction, signature));
|
|
389
489
|
case 7:
|
|
390
490
|
case "end":
|
|
391
|
-
return
|
|
491
|
+
return _context11.stop();
|
|
392
492
|
}
|
|
393
|
-
},
|
|
493
|
+
}, _callee11, this);
|
|
394
494
|
}));
|
|
395
|
-
function sign(
|
|
495
|
+
function sign(_x10) {
|
|
396
496
|
return _sign.apply(this, arguments);
|
|
397
497
|
}
|
|
398
498
|
return sign;
|
|
@@ -400,33 +500,33 @@ var RemoteSigner = /*#__PURE__*/function (_Ethers$Signer) {
|
|
|
400
500
|
}, {
|
|
401
501
|
key: "sendTransaction",
|
|
402
502
|
value: function () {
|
|
403
|
-
var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
503
|
+
var _sendTransaction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(transaction) {
|
|
404
504
|
var _this3 = this;
|
|
405
|
-
return _regeneratorRuntime.wrap(function
|
|
406
|
-
while (1) switch (
|
|
505
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
506
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
407
507
|
case 0:
|
|
408
508
|
if (!(transaction.nonce == null)) {
|
|
409
|
-
|
|
509
|
+
_context12.next = 5;
|
|
410
510
|
break;
|
|
411
511
|
}
|
|
412
512
|
transaction = Ethers.utils.shallowCopy(transaction);
|
|
413
|
-
|
|
513
|
+
_context12.next = 4;
|
|
414
514
|
return this.provider.getTransactionCount(this.address, "pending");
|
|
415
515
|
case 4:
|
|
416
|
-
transaction.nonce =
|
|
516
|
+
transaction.nonce = _context12.sent;
|
|
417
517
|
case 5:
|
|
418
|
-
return
|
|
518
|
+
return _context12.abrupt("return", this.populateTransaction(transaction, this.provider, this.address).then(function (tx) {
|
|
419
519
|
return _this3.sign(tx).then(function (signedTransaction) {
|
|
420
520
|
return _this3.provider.sendTransaction(signedTransaction);
|
|
421
521
|
});
|
|
422
522
|
}));
|
|
423
523
|
case 6:
|
|
424
524
|
case "end":
|
|
425
|
-
return
|
|
525
|
+
return _context12.stop();
|
|
426
526
|
}
|
|
427
|
-
},
|
|
527
|
+
}, _callee12, this);
|
|
428
528
|
}));
|
|
429
|
-
function sendTransaction(
|
|
529
|
+
function sendTransaction(_x11) {
|
|
430
530
|
return _sendTransaction.apply(this, arguments);
|
|
431
531
|
}
|
|
432
532
|
return sendTransaction;
|
|
@@ -1578,16 +1578,6 @@ 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
|
-
},
|
|
1591
1581
|
"dash-widevine": {
|
|
1592
1582
|
"drm": {
|
|
1593
1583
|
"content_id": "",
|