@eluvio/elv-client-js 4.0.121 → 4.0.122
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/README.md +1 -1
- package/dist/ElvClient-min.js +14 -15
- package/dist/ElvClient-node-min.js +13 -14
- package/dist/ElvFrameClient-min.js +10 -10
- package/dist/ElvPermissionsClient-min.js +9 -9
- package/dist/ElvWalletClient-min.js +14 -15
- package/dist/ElvWalletClient-node-min.js +13 -14
- package/dist/src/AuthorizationClient.js +12 -9
- package/dist/src/ContentObjectAudit.js +3 -3
- package/dist/src/ContentObjectVerification.js +3 -3
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +47 -60
- package/dist/src/ElvWallet.js +5 -7
- package/dist/src/EthClient.js +9 -8
- package/dist/src/FrameClient.js +10 -9
- package/dist/src/HttpClient.js +2 -1
- package/dist/src/Id.js +2 -1
- package/dist/src/PermissionsClient.js +19 -31
- package/dist/src/RemoteSigner.js +8 -6
- package/dist/src/UserProfileClient.js +20 -35
- package/dist/src/Utils.js +3 -2
- package/dist/src/client/ABRPublishing.js +3 -3
- package/dist/src/client/AccessGroups.js +2 -2
- package/dist/src/client/ContentAccess.js +3 -2
- package/dist/src/client/ContentManagement.js +3 -3
- package/dist/src/client/Contracts.js +2 -2
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/LiveConf.js +5 -3
- package/dist/src/client/LiveStream.js +2 -0
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/client/Shares.js +284 -0
- package/dist/src/walletClient/ClientMethods.js +2 -2
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +2 -2
- package/dist/src/walletClient/index.js +14 -17
- package/package.json +2 -2
- package/src/ElvClient.js +9 -2
- package/src/FrameClient.js +5 -0
- package/src/client/ABRPublishing.js +1 -1
- package/src/client/Shares.js +161 -0
- package/build/BuildDocs.js +0 -12
|
@@ -3,8 +3,9 @@ var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
|
3
3
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
4
4
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
5
5
|
var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
6
|
-
|
|
7
|
-
function
|
|
6
|
+
var _v, _v2;
|
|
7
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
9
|
var HttpClient = require("./HttpClient");
|
|
9
10
|
var Ethers = require("ethers");
|
|
10
11
|
var Utils = require("./Utils");
|
|
@@ -37,8 +38,8 @@ var ACCESS_TYPES = {
|
|
|
37
38
|
OTHER: "other"
|
|
38
39
|
};
|
|
39
40
|
var CONTRACTS = {
|
|
40
|
-
v2:
|
|
41
|
-
v3:
|
|
41
|
+
v2: (_v = {}, _defineProperty(_v, ACCESS_TYPES.SPACE, require("./contracts/v2/BaseContentSpace")), _defineProperty(_v, ACCESS_TYPES.LIBRARY, require("./contracts/v2/BaseLibrary")), _defineProperty(_v, ACCESS_TYPES.TYPE, require("./contracts/v2/BaseContentType")), _defineProperty(_v, ACCESS_TYPES.OBJECT, require("./contracts/v2/BaseContent")), _defineProperty(_v, ACCESS_TYPES.WALLET, require("./contracts/v2/BaseAccessWallet")), _defineProperty(_v, ACCESS_TYPES.GROUP, require("./contracts/v2/BaseAccessControlGroup")), _defineProperty(_v, ACCESS_TYPES.ACCESSIBLE, require("./contracts/v2/Accessible")), _defineProperty(_v, ACCESS_TYPES.EDITABLE, require("./contracts/v2/Editable")), _v),
|
|
42
|
+
v3: (_v2 = {}, _defineProperty(_v2, ACCESS_TYPES.SPACE, require("./contracts/v3/BaseContentSpace")), _defineProperty(_v2, ACCESS_TYPES.LIBRARY, require("./contracts/v3/BaseLibrary")), _defineProperty(_v2, ACCESS_TYPES.TYPE, require("./contracts/v3/BaseContentType")), _defineProperty(_v2, ACCESS_TYPES.OBJECT, require("./contracts/v3/BaseContent")), _defineProperty(_v2, ACCESS_TYPES.WALLET, require("./contracts/v3/BaseAccessWallet")), _defineProperty(_v2, ACCESS_TYPES.GROUP, require("./contracts/v3/BaseAccessControlGroup")), _defineProperty(_v2, ACCESS_TYPES.ACCESSIBLE, require("./contracts/v3/Accessible")), _defineProperty(_v2, ACCESS_TYPES.EDITABLE, require("./contracts/v3/Editable")), _defineProperty(_v2, ACCESS_TYPES.TENANT, require("./contracts/v3/BaseTenantSpace")), _v2),
|
|
42
43
|
v3b: _defineProperty({}, ACCESS_TYPES.GROUP, require("./contracts/v3b/BaseAccessControlGroup"))
|
|
43
44
|
};
|
|
44
45
|
var AuthorizationClient = /*#__PURE__*/function () {
|
|
@@ -76,7 +77,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
// Return authorization token in appropriate headers
|
|
79
|
-
|
|
80
|
+
_createClass(AuthorizationClient, [{
|
|
80
81
|
key: "Log",
|
|
81
82
|
value: function Log(message) {
|
|
82
83
|
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -1025,6 +1026,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
1025
1026
|
}
|
|
1026
1027
|
}
|
|
1027
1028
|
}
|
|
1029
|
+
|
|
1028
1030
|
if (isV3 && (!args || args.length === 0)) {
|
|
1029
1031
|
args = [[],
|
|
1030
1032
|
// customValues
|
|
@@ -1171,7 +1173,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
1171
1173
|
}() /* Utility methods */
|
|
1172
1174
|
}, {
|
|
1173
1175
|
key: "ContractInfo",
|
|
1174
|
-
value:
|
|
1176
|
+
value: function () {
|
|
1175
1177
|
var _ContractInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref14) {
|
|
1176
1178
|
var id, address, isV3, contractName, accessType, v3Version, version;
|
|
1177
1179
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
@@ -1222,7 +1224,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
1222
1224
|
return _ContractInfo.apply(this, arguments);
|
|
1223
1225
|
}
|
|
1224
1226
|
return ContractInfo;
|
|
1225
|
-
}()
|
|
1227
|
+
}()
|
|
1226
1228
|
}, {
|
|
1227
1229
|
key: "GetAccessCharge",
|
|
1228
1230
|
value: function () {
|
|
@@ -2024,7 +2026,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
2024
2026
|
}() /* Creation methods */
|
|
2025
2027
|
}, {
|
|
2026
2028
|
key: "CreateAccessGroup",
|
|
2027
|
-
value:
|
|
2029
|
+
value: function () {
|
|
2028
2030
|
var _CreateAccessGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
|
|
2029
2031
|
var _yield$this$client$et, contractAddress, transactionHash;
|
|
2030
2032
|
return _regeneratorRuntime.wrap(function _callee30$(_context30) {
|
|
@@ -2053,7 +2055,7 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
2053
2055
|
return _CreateAccessGroup.apply(this, arguments);
|
|
2054
2056
|
}
|
|
2055
2057
|
return CreateAccessGroup;
|
|
2056
|
-
}()
|
|
2058
|
+
}()
|
|
2057
2059
|
}, {
|
|
2058
2060
|
key: "CreateContentType",
|
|
2059
2061
|
value: function () {
|
|
@@ -2162,5 +2164,6 @@ var AuthorizationClient = /*#__PURE__*/function () {
|
|
|
2162
2164
|
this.channelContentTokens = {};
|
|
2163
2165
|
}
|
|
2164
2166
|
}]);
|
|
2167
|
+
return AuthorizationClient;
|
|
2165
2168
|
}();
|
|
2166
2169
|
module.exports = AuthorizationClient;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
2
|
var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function _createForOfIteratorHelper(
|
|
5
|
-
function _unsupportedIterableToArray(
|
|
6
|
-
function _arrayLikeToArray(
|
|
4
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
7
7
|
var UrlJoin = require("url-join");
|
|
8
8
|
var HttpClient = require("./HttpClient");
|
|
9
9
|
var UUID = require("uuid").v4;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
2
2
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
3
|
-
function _createForOfIteratorHelper(
|
|
4
|
-
function _unsupportedIterableToArray(
|
|
5
|
-
function _arrayLikeToArray(
|
|
3
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
6
6
|
var CBOR = require("cbor");
|
|
7
7
|
var SJCL = require("sjcl");
|
|
8
8
|
var MultiHash = require("multihashes");
|
package/dist/src/Crypto.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
2
2
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
3
3
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
4
|
-
function _getRequireWildcardCache(
|
|
5
|
-
function _interopRequireWildcard(
|
|
4
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
5
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
6
6
|
if (typeof globalThis.Buffer === "undefined") {
|
|
7
7
|
globalThis.Buffer = require("buffer/").Buffer;
|
|
8
8
|
}
|
package/dist/src/ElvClient.js
CHANGED
|
@@ -5,8 +5,8 @@ var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
|
5
5
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
6
6
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
7
7
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
8
|
-
function ownKeys(
|
|
9
|
-
function _objectSpread(
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
10
|
if (typeof globalThis.Buffer === "undefined") {
|
|
11
11
|
globalThis.Buffer = require("buffer/").Buffer;
|
|
12
12
|
}
|
|
@@ -142,7 +142,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
142
142
|
* @param {string=} clientIP - IP address to use in determining the region to use
|
|
143
143
|
* @return {Promise<Object>} - Object containing content space ID and fabric and ethereum URLs
|
|
144
144
|
*/
|
|
145
|
-
|
|
145
|
+
_createClass(ElvClient, [{
|
|
146
146
|
key: "Log",
|
|
147
147
|
value: function Log(message) {
|
|
148
148
|
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -341,7 +341,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
341
341
|
*/
|
|
342
342
|
}, {
|
|
343
343
|
key: "UseRegion",
|
|
344
|
-
value:
|
|
344
|
+
value: function () {
|
|
345
345
|
var _UseRegion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref4) {
|
|
346
346
|
var region, _yield$ElvClient$Conf, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs;
|
|
347
347
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -401,10 +401,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
401
401
|
*
|
|
402
402
|
* @return {Promise<Object>} - An object containing the updated fabric and ethereum URLs in order of preference
|
|
403
403
|
*/
|
|
404
|
-
)
|
|
405
404
|
}, {
|
|
406
405
|
key: "ResetRegion",
|
|
407
|
-
value:
|
|
406
|
+
value: function () {
|
|
408
407
|
var _ResetRegion = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
409
408
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
410
409
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -444,10 +443,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
444
443
|
*
|
|
445
444
|
* @return {Promise<string>} - The node ID reported by the fabric
|
|
446
445
|
*/
|
|
447
|
-
)
|
|
448
446
|
}, {
|
|
449
447
|
key: "NodeId",
|
|
450
|
-
value:
|
|
448
|
+
value: function () {
|
|
451
449
|
var _NodeId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
|
|
452
450
|
var region, _yield$ElvClient$Conf2, nodeId;
|
|
453
451
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
@@ -481,7 +479,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
481
479
|
*
|
|
482
480
|
* @return {Promise<Object>} - An object containing the lists of fabric, ethereum, auth service, and search urls in use by the client
|
|
483
481
|
*/
|
|
484
|
-
)
|
|
485
482
|
}, {
|
|
486
483
|
key: "Nodes",
|
|
487
484
|
value: function Nodes() {
|
|
@@ -553,7 +550,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
553
550
|
*/
|
|
554
551
|
}, {
|
|
555
552
|
key: "SpaceNodes",
|
|
556
|
-
value:
|
|
553
|
+
value: function () {
|
|
557
554
|
var _SpaceNodes = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
558
555
|
var _this = this;
|
|
559
556
|
var _ref7,
|
|
@@ -640,7 +637,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
640
637
|
* @methodGroup Nodes
|
|
641
638
|
* @returns {Object} - The name, ID and configuration URL of the network
|
|
642
639
|
*/
|
|
643
|
-
)
|
|
644
640
|
}, {
|
|
645
641
|
key: "NetworkInfo",
|
|
646
642
|
value: function NetworkInfo() {
|
|
@@ -712,6 +708,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
712
708
|
}, {
|
|
713
709
|
key: "SetSigner",
|
|
714
710
|
value: function SetSigner(_ref10) {
|
|
711
|
+
var _this2 = this;
|
|
715
712
|
var signer = _ref10.signer,
|
|
716
713
|
_ref10$reset = _ref10.reset,
|
|
717
714
|
reset = _ref10$reset === void 0 ? true : _ref10$reset;
|
|
@@ -719,6 +716,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
719
716
|
signer.connect(this.ethClient.Provider());
|
|
720
717
|
signer.provider.pollingInterval = 500;
|
|
721
718
|
this.signer = signer;
|
|
719
|
+
this.CreateFabricToken({}).then(function (token) {
|
|
720
|
+
return _this2.signedToken = token;
|
|
721
|
+
});
|
|
722
722
|
if (reset) {
|
|
723
723
|
this.InitializeClients();
|
|
724
724
|
}
|
|
@@ -738,7 +738,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
738
738
|
*/
|
|
739
739
|
}, {
|
|
740
740
|
key: "SetRemoteSigner",
|
|
741
|
-
value:
|
|
741
|
+
value: function () {
|
|
742
742
|
var _SetRemoteSigner = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref11) {
|
|
743
743
|
var idToken, authToken, tenantId, extraData, signerURIs, unsignedPublicAuth, signer;
|
|
744
744
|
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
@@ -793,10 +793,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
793
793
|
* @namedParams
|
|
794
794
|
* @param {object} provider - The web3 provider object
|
|
795
795
|
*/
|
|
796
|
-
)
|
|
797
796
|
}, {
|
|
798
797
|
key: "SetSignerFromWeb3Provider",
|
|
799
|
-
value:
|
|
798
|
+
value: function () {
|
|
800
799
|
var _SetSignerFromWeb3Provider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref12) {
|
|
801
800
|
var provider, ethProvider;
|
|
802
801
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
@@ -839,10 +838,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
839
838
|
*
|
|
840
839
|
* @return {string} - The address of the user
|
|
841
840
|
*/
|
|
842
|
-
)
|
|
843
841
|
}, {
|
|
844
842
|
key: "CreateAccount",
|
|
845
|
-
value:
|
|
843
|
+
value: function () {
|
|
846
844
|
var _CreateAccount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref13) {
|
|
847
845
|
var tenantId, fundingToken, _ref13$funds, funds, groupToken, wallet, signer;
|
|
848
846
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
@@ -917,12 +915,11 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
917
915
|
PAYLOAD 85b json-compressed
|
|
918
916
|
json 79b {"adr":"VVf4DQU357tDnZGYQeDrntRJ5rs=","spc":"ispc3ANoVSzNA3P6t7abLR69ho5YPPZU"}
|
|
919
917
|
*/
|
|
920
|
-
)
|
|
921
918
|
}, {
|
|
922
919
|
key: "PersonalSign",
|
|
923
|
-
value:
|
|
920
|
+
value: function () {
|
|
924
921
|
var _PersonalSign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref14) {
|
|
925
|
-
var
|
|
922
|
+
var _this3 = this;
|
|
926
923
|
var message, addEthereumPrefix, Sign;
|
|
927
924
|
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
928
925
|
while (1) switch (_context11.prev = _context11.next) {
|
|
@@ -936,19 +933,19 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
936
933
|
while (1) switch (_context10.prev = _context10.next) {
|
|
937
934
|
case 0:
|
|
938
935
|
_context10.t0 = Ethers.utils;
|
|
939
|
-
if (!
|
|
936
|
+
if (!_this3.signer.signDigest) {
|
|
940
937
|
_context10.next = 7;
|
|
941
938
|
break;
|
|
942
939
|
}
|
|
943
940
|
_context10.next = 4;
|
|
944
|
-
return
|
|
941
|
+
return _this3.signer.signDigest(message);
|
|
945
942
|
case 4:
|
|
946
943
|
_context10.t1 = _context10.sent;
|
|
947
944
|
_context10.next = 10;
|
|
948
945
|
break;
|
|
949
946
|
case 7:
|
|
950
947
|
_context10.next = 9;
|
|
951
|
-
return
|
|
948
|
+
return _this3.signer._signingKey().signDigest(message);
|
|
952
949
|
case 9:
|
|
953
950
|
_context10.t1 = _context10.sent;
|
|
954
951
|
case 10:
|
|
@@ -994,10 +991,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
994
991
|
* @param {function=} Sign - If specified, this function will be used to produce the signature instead of the client's current signer
|
|
995
992
|
* @param {boolean=} addEthereumPrefix=true - If specified, the 'Ethereum Signed Message' prefixed hash format will be performed. Disable this if the provided Sign method already does this (e.g. Metamask)
|
|
996
993
|
*/
|
|
997
|
-
)
|
|
998
994
|
}, {
|
|
999
995
|
key: "CreateFabricToken",
|
|
1000
|
-
value:
|
|
996
|
+
value: function () {
|
|
1001
997
|
var _CreateFabricToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
1002
998
|
var _ref16,
|
|
1003
999
|
_ref16$duration,
|
|
@@ -1079,10 +1075,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1079
1075
|
* enabling the user of this token to download encrypted content from the specified object
|
|
1080
1076
|
* @param {Object=} context - Additional JSON context
|
|
1081
1077
|
*/
|
|
1082
|
-
)
|
|
1083
1078
|
}, {
|
|
1084
1079
|
key: "CreateSignedToken",
|
|
1085
|
-
value:
|
|
1080
|
+
value: function () {
|
|
1086
1081
|
var _CreateSignedToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref17) {
|
|
1087
1082
|
var libraryId, objectId, versionHash, policyId, subject, _ref17$grantType, grantType, _ref17$allowDecryptio, allowDecryption, duration, _ref17$context, context, token, cap, compressedToken, signature;
|
|
1088
1083
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
@@ -1195,10 +1190,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1195
1190
|
* @namedParams
|
|
1196
1191
|
* @param {string} messasge - A JSON object representing the message to sign
|
|
1197
1192
|
*/
|
|
1198
|
-
)
|
|
1199
1193
|
}, {
|
|
1200
1194
|
key: "CreateSignedMessageJSON",
|
|
1201
|
-
value:
|
|
1195
|
+
value: function () {
|
|
1202
1196
|
var _CreateSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref18) {
|
|
1203
1197
|
var message, type, msg, signature;
|
|
1204
1198
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
@@ -1235,10 +1229,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1235
1229
|
* @param {string} signedMessage - a signed message as created by CreateSignedMessageJSON
|
|
1236
1230
|
* @returns {Promise<Object>} - The decoded message, signer address, signature and signature type
|
|
1237
1231
|
*/
|
|
1238
|
-
)
|
|
1239
1232
|
}, {
|
|
1240
1233
|
key: "DecodeSignedMessageJSON",
|
|
1241
|
-
value:
|
|
1234
|
+
value: function () {
|
|
1242
1235
|
var _DecodeSignedMessageJSON = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref19) {
|
|
1243
1236
|
var signedMessage, type, msgBytes, signature, msg, obj, prefixedMsgHash, signerAddr;
|
|
1244
1237
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
@@ -1281,7 +1274,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1281
1274
|
* @methodGroup Signers
|
|
1282
1275
|
* @returns {string} - The address of the current signer
|
|
1283
1276
|
*/
|
|
1284
|
-
)
|
|
1285
1277
|
}, {
|
|
1286
1278
|
key: "CurrentAccountAddress",
|
|
1287
1279
|
value: function CurrentAccountAddress() {
|
|
@@ -1297,7 +1289,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1297
1289
|
*/
|
|
1298
1290
|
}, {
|
|
1299
1291
|
key: "SetOauthToken",
|
|
1300
|
-
value:
|
|
1292
|
+
value: function () {
|
|
1301
1293
|
var _SetOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref20) {
|
|
1302
1294
|
var token, wallet, signer;
|
|
1303
1295
|
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
@@ -1333,10 +1325,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1333
1325
|
* @namedParams
|
|
1334
1326
|
* @param {string} token - The OAuth ID
|
|
1335
1327
|
*/
|
|
1336
|
-
)
|
|
1337
1328
|
}, {
|
|
1338
1329
|
key: "SetSignerFromOauthToken",
|
|
1339
|
-
value:
|
|
1330
|
+
value: function () {
|
|
1340
1331
|
var _SetSignerFromOauthToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref21) {
|
|
1341
1332
|
var token, wallet, client, _yield$client$authCli, urls, path, httpClient, response, privateKey;
|
|
1342
1333
|
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
@@ -1440,7 +1431,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1440
1431
|
*
|
|
1441
1432
|
* @return {string} - The created static token
|
|
1442
1433
|
*/
|
|
1443
|
-
)
|
|
1444
1434
|
}, {
|
|
1445
1435
|
key: "CreateStaticToken",
|
|
1446
1436
|
value: function CreateStaticToken(_ref22) {
|
|
@@ -1495,7 +1485,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1495
1485
|
*/
|
|
1496
1486
|
}, {
|
|
1497
1487
|
key: "SetPolicyAuthorization",
|
|
1498
|
-
value:
|
|
1488
|
+
value: function () {
|
|
1499
1489
|
var _SetPolicyAuthorization = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref24) {
|
|
1500
1490
|
var objectId;
|
|
1501
1491
|
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
@@ -1530,10 +1520,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1530
1520
|
* @param {string} string - The string to sign
|
|
1531
1521
|
* @return {Promise<string>} - The signed string
|
|
1532
1522
|
*/
|
|
1533
|
-
)
|
|
1534
1523
|
}, {
|
|
1535
1524
|
key: "Sign",
|
|
1536
|
-
value:
|
|
1525
|
+
value: function () {
|
|
1537
1526
|
var _Sign = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(string) {
|
|
1538
1527
|
var signature;
|
|
1539
1528
|
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
@@ -1564,10 +1553,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1564
1553
|
*
|
|
1565
1554
|
* @return {Promise<string>} - The encrypted message
|
|
1566
1555
|
*/
|
|
1567
|
-
)
|
|
1568
1556
|
}, {
|
|
1569
1557
|
key: "EncryptECIES",
|
|
1570
|
-
value:
|
|
1558
|
+
value: function () {
|
|
1571
1559
|
var _EncryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(_ref25) {
|
|
1572
1560
|
var message, publicKey;
|
|
1573
1561
|
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
@@ -1604,10 +1592,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1604
1592
|
*
|
|
1605
1593
|
* @return {Promise<string | Object>} - The decrypted string or object
|
|
1606
1594
|
*/
|
|
1607
|
-
)
|
|
1608
1595
|
}, {
|
|
1609
1596
|
key: "DecryptECIES",
|
|
1610
|
-
value:
|
|
1597
|
+
value: function () {
|
|
1611
1598
|
var _DecryptECIES = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref26) {
|
|
1612
1599
|
var message;
|
|
1613
1600
|
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
@@ -1647,10 +1634,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1647
1634
|
*
|
|
1648
1635
|
* @return {Promise<*>} - Response in the specified format
|
|
1649
1636
|
*/
|
|
1650
|
-
)
|
|
1651
1637
|
}, {
|
|
1652
1638
|
key: "Request",
|
|
1653
|
-
value:
|
|
1639
|
+
value: function () {
|
|
1654
1640
|
var _Request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22(_ref27) {
|
|
1655
1641
|
var url, _ref27$format, format, _ref27$method, method, _ref27$headers, headers, body;
|
|
1656
1642
|
return _regeneratorRuntime.wrap(function _callee22$(_context22) {
|
|
@@ -1672,17 +1658,17 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1672
1658
|
return _Request.apply(this, arguments);
|
|
1673
1659
|
}
|
|
1674
1660
|
return Request;
|
|
1675
|
-
}()
|
|
1661
|
+
}()
|
|
1676
1662
|
}, {
|
|
1677
1663
|
key: "MakeAuthServiceRequest",
|
|
1678
1664
|
value: function () {
|
|
1679
1665
|
var _MakeAuthServiceRequest = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(_ref28) {
|
|
1680
|
-
var kmsId, objectId, versionHash, _ref28$method, method, path, bodyType, _ref28$body, body, _ref28$queryParams, queryParams, headers;
|
|
1666
|
+
var kmsId, objectId, versionHash, _ref28$method, method, path, bodyType, _ref28$body, body, _ref28$queryParams, queryParams, headers, format, response;
|
|
1681
1667
|
return _regeneratorRuntime.wrap(function _callee23$(_context23) {
|
|
1682
1668
|
while (1) switch (_context23.prev = _context23.next) {
|
|
1683
1669
|
case 0:
|
|
1684
|
-
kmsId = _ref28.kmsId, objectId = _ref28.objectId, versionHash = _ref28.versionHash, _ref28$method = _ref28.method, method = _ref28$method === void 0 ? "GET" : _ref28$method, path = _ref28.path, bodyType = _ref28.bodyType, _ref28$body = _ref28.body, body = _ref28$body === void 0 ? {} : _ref28$body, _ref28$queryParams = _ref28.queryParams, queryParams = _ref28$queryParams === void 0 ? {} : _ref28$queryParams, headers = _ref28.headers;
|
|
1685
|
-
|
|
1670
|
+
kmsId = _ref28.kmsId, objectId = _ref28.objectId, versionHash = _ref28.versionHash, _ref28$method = _ref28.method, method = _ref28$method === void 0 ? "GET" : _ref28$method, path = _ref28.path, bodyType = _ref28.bodyType, _ref28$body = _ref28.body, body = _ref28$body === void 0 ? {} : _ref28$body, _ref28$queryParams = _ref28.queryParams, queryParams = _ref28$queryParams === void 0 ? {} : _ref28$queryParams, headers = _ref28.headers, format = _ref28.format;
|
|
1671
|
+
response = this.authClient.MakeAuthServiceRequest({
|
|
1686
1672
|
kmsId: kmsId,
|
|
1687
1673
|
objectId: objectId,
|
|
1688
1674
|
versionHash: versionHash,
|
|
@@ -1692,8 +1678,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1692
1678
|
body: body,
|
|
1693
1679
|
queryParams: queryParams,
|
|
1694
1680
|
headers: headers
|
|
1695
|
-
})
|
|
1696
|
-
|
|
1681
|
+
});
|
|
1682
|
+
return _context23.abrupt("return", !format ? response : this.utils.ResponseToFormat(format, response));
|
|
1683
|
+
case 3:
|
|
1697
1684
|
case "end":
|
|
1698
1685
|
return _context23.stop();
|
|
1699
1686
|
}
|
|
@@ -1709,10 +1696,10 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1709
1696
|
}, {
|
|
1710
1697
|
key: "FrameAllowedMethods",
|
|
1711
1698
|
value: function FrameAllowedMethods() {
|
|
1712
|
-
var
|
|
1699
|
+
var _this4 = this;
|
|
1713
1700
|
var forbiddenMethods = ["constructor", "AccessGroupMembershipMethod", "CallFromFrameMessage", "ClearSigner", "CreateAccount", "EnableMethodLogging", "FormatBlockNumbers", "FrameAllowedMethods", "FromConfigurationUrl", "GenerateWallet", "InitializeClients", "Log", "PersonalSign", "SetRemoteSigner", "SetSigner", "SetSignerFromWeb3Provider", "Sign", "ToggleLogging"];
|
|
1714
1701
|
return Object.getOwnPropertyNames(Object.getPrototypeOf(this)).filter(function (method) {
|
|
1715
|
-
return typeof
|
|
1702
|
+
return typeof _this4[method] === "function" && !forbiddenMethods.includes(method);
|
|
1716
1703
|
});
|
|
1717
1704
|
}
|
|
1718
1705
|
|
|
@@ -1721,7 +1708,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1721
1708
|
key: "CallFromFrameMessage",
|
|
1722
1709
|
value: function () {
|
|
1723
1710
|
var _CallFromFrameMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(message, Respond) {
|
|
1724
|
-
var
|
|
1711
|
+
var _this5 = this;
|
|
1725
1712
|
var callback, method, methodResults, responseError;
|
|
1726
1713
|
return _regeneratorRuntime.wrap(function _callee24$(_context24) {
|
|
1727
1714
|
while (1) switch (_context24.prev = _context24.next) {
|
|
@@ -1734,7 +1721,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1734
1721
|
case 2:
|
|
1735
1722
|
if (message.callbackId) {
|
|
1736
1723
|
callback = function callback(result) {
|
|
1737
|
-
Respond(
|
|
1724
|
+
Respond(_this5.utils.MakeClonable({
|
|
1738
1725
|
type: "ElvFrameResponse",
|
|
1739
1726
|
requestId: message.callbackId,
|
|
1740
1727
|
response: result
|
|
@@ -1829,7 +1816,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1829
1816
|
}()
|
|
1830
1817
|
}], [{
|
|
1831
1818
|
key: "Configuration",
|
|
1832
|
-
value:
|
|
1819
|
+
value: function () {
|
|
1833
1820
|
var _Configuration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25(_ref29) {
|
|
1834
1821
|
var configUrl, _ref29$kmsUrls, kmsUrls, region, clientIP, uri, fabricInfo, filterHTTPS, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs, fabricVersion;
|
|
1835
1822
|
return _regeneratorRuntime.wrap(function _callee25$(_context25) {
|
|
@@ -1910,7 +1897,6 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1910
1897
|
*
|
|
1911
1898
|
* @return {Object} - An object using network names as keys and configuration URLs as values.
|
|
1912
1899
|
*/
|
|
1913
|
-
)
|
|
1914
1900
|
}, {
|
|
1915
1901
|
key: "Networks",
|
|
1916
1902
|
value: function Networks() {
|
|
@@ -1935,7 +1921,7 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1935
1921
|
*/
|
|
1936
1922
|
}, {
|
|
1937
1923
|
key: "FromNetworkName",
|
|
1938
|
-
value:
|
|
1924
|
+
value: function () {
|
|
1939
1925
|
var _FromNetworkName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26(_ref30) {
|
|
1940
1926
|
var networkName, region, clientIP, trustAuthorityId, staticToken, _ref30$ethereumContra, ethereumContractTimeout, _ref30$noCache, noCache, _ref30$noAuth, noAuth, assumeV3, configUrl;
|
|
1941
1927
|
return _regeneratorRuntime.wrap(function _callee26$(_context26) {
|
|
@@ -1990,10 +1976,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
1990
1976
|
*
|
|
1991
1977
|
* @return {Promise<ElvClient>} - New ElvClient connected to the specified content fabric and blockchain
|
|
1992
1978
|
*/
|
|
1993
|
-
)
|
|
1994
1979
|
}, {
|
|
1995
1980
|
key: "FromConfigurationUrl",
|
|
1996
|
-
value:
|
|
1981
|
+
value: function () {
|
|
1997
1982
|
var _FromConfigurationUrl = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27(_ref31) {
|
|
1998
1983
|
var configUrl, region, clientIP, trustAuthorityId, staticToken, _ref31$ethereumContra, ethereumContractTimeout, _ref31$noCache, noCache, _ref31$noAuth, noAuth, _ref31$assumeV, assumeV3, _yield$ElvClient$Conf3, contentSpaceId, networkId, networkName, fabricURIs, ethereumURIs, authServiceURIs, fileServiceURIs, searchURIs, fabricVersion, client;
|
|
1999
1984
|
return _regeneratorRuntime.wrap(function _callee27$(_context27) {
|
|
@@ -2048,8 +2033,9 @@ var ElvClient = /*#__PURE__*/function () {
|
|
|
2048
2033
|
return _FromConfigurationUrl.apply(this, arguments);
|
|
2049
2034
|
}
|
|
2050
2035
|
return FromConfigurationUrl;
|
|
2051
|
-
}()
|
|
2036
|
+
}()
|
|
2052
2037
|
}]);
|
|
2038
|
+
return ElvClient;
|
|
2053
2039
|
}();
|
|
2054
2040
|
Object.assign(ElvClient.prototype, require("./client/AccessGroups"));
|
|
2055
2041
|
Object.assign(ElvClient.prototype, require("./client/ContentAccess"));
|
|
@@ -2060,4 +2046,5 @@ Object.assign(ElvClient.prototype, require("./client/LiveStream"));
|
|
|
2060
2046
|
Object.assign(ElvClient.prototype, require("./client/ContentManagement"));
|
|
2061
2047
|
Object.assign(ElvClient.prototype, require("./client/NTP"));
|
|
2062
2048
|
Object.assign(ElvClient.prototype, require("./client/NFT"));
|
|
2049
|
+
Object.assign(ElvClient.prototype, require("./client/Shares"));
|
|
2063
2050
|
exports.ElvClient = ElvClient;
|
package/dist/src/ElvWallet.js
CHANGED
|
@@ -25,7 +25,7 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
25
25
|
*
|
|
26
26
|
* @returns {string} - Space-separated list of random words
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
_createClass(ElvWallet, [{
|
|
29
29
|
key: "GenerateMnemonic",
|
|
30
30
|
value: function GenerateMnemonic() {
|
|
31
31
|
return Ethers.Wallet.createRandom().mnemonic.phrase;
|
|
@@ -64,7 +64,7 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
64
64
|
*/
|
|
65
65
|
}, {
|
|
66
66
|
key: "AddAccountFromEncryptedPK",
|
|
67
|
-
value:
|
|
67
|
+
value: function () {
|
|
68
68
|
var _AddAccountFromEncryptedPK = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
69
69
|
var accountName, encryptedPrivateKey, password, signer;
|
|
70
70
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -102,7 +102,6 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
102
102
|
*
|
|
103
103
|
* @returns {Signer} - Signer with the private key, connected to the provider
|
|
104
104
|
*/
|
|
105
|
-
)
|
|
106
105
|
}, {
|
|
107
106
|
key: "AddAccount",
|
|
108
107
|
value: function AddAccount(_ref3) {
|
|
@@ -134,7 +133,7 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
134
133
|
*/
|
|
135
134
|
}, {
|
|
136
135
|
key: "GetAccountBalance",
|
|
137
|
-
value:
|
|
136
|
+
value: function () {
|
|
138
137
|
var _GetAccountBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref4) {
|
|
139
138
|
var accountName, signer, accountSigner;
|
|
140
139
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -181,10 +180,9 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
181
180
|
*
|
|
182
181
|
* @returns {Promise<string>} - The encrypted private key (in Ethereum keystore format)
|
|
183
182
|
*/
|
|
184
|
-
)
|
|
185
183
|
}, {
|
|
186
184
|
key: "GenerateEncryptedPrivateKey",
|
|
187
|
-
value:
|
|
185
|
+
value: function () {
|
|
188
186
|
var _GenerateEncryptedPrivateKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
189
187
|
var accountName, signer, password, options, accountSigner;
|
|
190
188
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
@@ -222,7 +220,6 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
222
220
|
* @param {string} accountName - Name of the account
|
|
223
221
|
* @returns {(Signer|undefined)} - Signer of the saved account, if it exists
|
|
224
222
|
*/
|
|
225
|
-
)
|
|
226
223
|
}, {
|
|
227
224
|
key: "GetAccount",
|
|
228
225
|
value: function GetAccount(_ref6) {
|
|
@@ -243,5 +240,6 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
243
240
|
delete this.signers[accountName];
|
|
244
241
|
}
|
|
245
242
|
}]);
|
|
243
|
+
return ElvWallet;
|
|
246
244
|
}();
|
|
247
245
|
module.exports = ElvWallet;
|