@eluvio/elv-client-js 4.0.147 → 4.2.0
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 +2 -67
- package/dist/ElvClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvClient-node-min.js +2 -66
- package/dist/ElvClient-node-min.js.LICENSE.txt +72 -0
- package/dist/ElvFrameClient-min.js +2 -60
- package/dist/ElvFrameClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvPermissionsClient-min.js +2 -60
- package/dist/ElvPermissionsClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-min.js +2 -67
- package/dist/ElvWalletClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-node-min.js +2 -66
- package/dist/ElvWalletClient-node-min.js.LICENSE.txt +72 -0
- package/dist/src/AuthorizationClient.js +713 -715
- package/dist/src/ContentObjectAudit.js +59 -59
- package/dist/src/Crypto.js +85 -86
- package/dist/src/ElvClient.js +532 -501
- package/dist/src/ElvWallet.js +30 -28
- package/dist/src/EthClient.js +316 -316
- package/dist/src/FrameClient.js +70 -71
- package/dist/src/HttpClient.js +60 -60
- package/dist/src/Id.js +1 -2
- package/dist/src/PermissionsClient.js +501 -489
- package/dist/src/RemoteSigner.js +83 -84
- package/dist/src/UserProfileClient.js +392 -374
- package/dist/src/Utils.js +67 -67
- package/dist/src/Validation.js +20 -12
- package/dist/src/client/ABRPublishing.js +412 -356
- package/dist/src/client/AccessGroups.js +479 -476
- package/dist/src/client/ContentAccess.js +1750 -1804
- package/dist/src/client/ContentManagement.js +874 -874
- package/dist/src/client/Contracts.js +586 -590
- package/dist/src/client/Files.js +702 -686
- package/dist/src/client/LiveConf.js +3 -5
- package/dist/src/client/LiveStream.js +659 -652
- package/dist/src/client/NFT.js +16 -16
- package/dist/src/client/NTP.js +84 -84
- package/dist/src/client/Shares.js +51 -51
- package/dist/src/walletClient/ClientMethods.js +979 -953
- package/dist/src/walletClient/Notifications.js +14 -14
- package/dist/src/walletClient/Profile.js +68 -68
- package/dist/src/walletClient/Utils.js +17 -17
- package/dist/src/walletClient/index.js +574 -564
- package/package.json +17 -16
- package/src/client/AccessGroups.js +1 -1
- package/testScripts/Test.js +5 -1
- package/webpack.config.js +10 -13
- package/dist/src/ContentObjectVerification.js +0 -281
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
|
-
_createClass(ElvWallet, [{
|
|
28
|
+
return _createClass(ElvWallet, [{
|
|
29
29
|
key: "GenerateMnemonic",
|
|
30
30
|
value: function GenerateMnemonic() {
|
|
31
31
|
return Ethers.Wallet.createRandom().mnemonic.phrase;
|
|
@@ -64,25 +64,25 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
64
64
|
*/
|
|
65
65
|
}, {
|
|
66
66
|
key: "AddAccountFromEncryptedPK",
|
|
67
|
-
value: function () {
|
|
68
|
-
var _AddAccountFromEncryptedPK = _asyncToGenerator(
|
|
67
|
+
value: (function () {
|
|
68
|
+
var _AddAccountFromEncryptedPK = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
69
69
|
var accountName, encryptedPrivateKey, password, signer;
|
|
70
|
-
return _regeneratorRuntime.wrap(function
|
|
70
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
71
71
|
while (1) switch (_context.prev = _context.next) {
|
|
72
72
|
case 0:
|
|
73
73
|
accountName = _ref2.accountName, encryptedPrivateKey = _ref2.encryptedPrivateKey, password = _ref2.password;
|
|
74
74
|
if (_typeof(encryptedPrivateKey) === "object") {
|
|
75
75
|
encryptedPrivateKey = JSON.stringify(encryptedPrivateKey);
|
|
76
76
|
}
|
|
77
|
-
_context.next =
|
|
77
|
+
_context.next = 1;
|
|
78
78
|
return Ethers.Wallet.fromEncryptedJson(encryptedPrivateKey, password);
|
|
79
|
-
case
|
|
79
|
+
case 1:
|
|
80
80
|
signer = _context.sent;
|
|
81
81
|
return _context.abrupt("return", this.AddAccount({
|
|
82
82
|
accountName: accountName,
|
|
83
83
|
privateKey: signer.privateKey
|
|
84
84
|
}));
|
|
85
|
-
case
|
|
85
|
+
case 2:
|
|
86
86
|
case "end":
|
|
87
87
|
return _context.stop();
|
|
88
88
|
}
|
|
@@ -102,6 +102,7 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
102
102
|
*
|
|
103
103
|
* @returns {Signer} - Signer with the private key, connected to the provider
|
|
104
104
|
*/
|
|
105
|
+
)
|
|
105
106
|
}, {
|
|
106
107
|
key: "AddAccount",
|
|
107
108
|
value: function AddAccount(_ref3) {
|
|
@@ -133,10 +134,10 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
133
134
|
*/
|
|
134
135
|
}, {
|
|
135
136
|
key: "GetAccountBalance",
|
|
136
|
-
value: function () {
|
|
137
|
-
var _GetAccountBalance = _asyncToGenerator(
|
|
138
|
-
var accountName, signer, accountSigner;
|
|
139
|
-
return _regeneratorRuntime.wrap(function
|
|
137
|
+
value: (function () {
|
|
138
|
+
var _GetAccountBalance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref4) {
|
|
139
|
+
var accountName, signer, accountSigner, _t, _t2;
|
|
140
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
140
141
|
while (1) switch (_context2.prev = _context2.next) {
|
|
141
142
|
case 0:
|
|
142
143
|
accountName = _ref4.accountName, signer = _ref4.signer;
|
|
@@ -144,18 +145,18 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
144
145
|
accountName: accountName
|
|
145
146
|
});
|
|
146
147
|
if (accountSigner) {
|
|
147
|
-
_context2.next =
|
|
148
|
+
_context2.next = 1;
|
|
148
149
|
break;
|
|
149
150
|
}
|
|
150
151
|
throw Error("Unknown account: " + accountName);
|
|
151
|
-
case
|
|
152
|
-
|
|
153
|
-
_context2.next =
|
|
152
|
+
case 1:
|
|
153
|
+
_t = Ethers.utils;
|
|
154
|
+
_context2.next = 2;
|
|
154
155
|
return accountSigner.getBalance();
|
|
155
|
-
case
|
|
156
|
-
|
|
157
|
-
return _context2.abrupt("return",
|
|
158
|
-
case
|
|
156
|
+
case 2:
|
|
157
|
+
_t2 = _context2.sent;
|
|
158
|
+
return _context2.abrupt("return", _t.formatEther.call(_t, _t2));
|
|
159
|
+
case 3:
|
|
159
160
|
case "end":
|
|
160
161
|
return _context2.stop();
|
|
161
162
|
}
|
|
@@ -180,12 +181,13 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
180
181
|
*
|
|
181
182
|
* @returns {Promise<string>} - The encrypted private key (in Ethereum keystore format)
|
|
182
183
|
*/
|
|
184
|
+
)
|
|
183
185
|
}, {
|
|
184
186
|
key: "GenerateEncryptedPrivateKey",
|
|
185
|
-
value: function () {
|
|
186
|
-
var _GenerateEncryptedPrivateKey = _asyncToGenerator(
|
|
187
|
+
value: (function () {
|
|
188
|
+
var _GenerateEncryptedPrivateKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
187
189
|
var accountName, signer, password, options, accountSigner;
|
|
188
|
-
return _regeneratorRuntime.wrap(function
|
|
190
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
189
191
|
while (1) switch (_context3.prev = _context3.next) {
|
|
190
192
|
case 0:
|
|
191
193
|
accountName = _ref5.accountName, signer = _ref5.signer, password = _ref5.password, options = _ref5.options;
|
|
@@ -193,16 +195,16 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
193
195
|
accountName: accountName
|
|
194
196
|
});
|
|
195
197
|
if (accountSigner) {
|
|
196
|
-
_context3.next =
|
|
198
|
+
_context3.next = 1;
|
|
197
199
|
break;
|
|
198
200
|
}
|
|
199
201
|
throw Error("Unknown account: " + accountName);
|
|
200
|
-
case
|
|
201
|
-
_context3.next =
|
|
202
|
+
case 1:
|
|
203
|
+
_context3.next = 2;
|
|
202
204
|
return accountSigner.encrypt(password, options);
|
|
203
|
-
case
|
|
205
|
+
case 2:
|
|
204
206
|
return _context3.abrupt("return", _context3.sent);
|
|
205
|
-
case
|
|
207
|
+
case 3:
|
|
206
208
|
case "end":
|
|
207
209
|
return _context3.stop();
|
|
208
210
|
}
|
|
@@ -220,6 +222,7 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
220
222
|
* @param {string} accountName - Name of the account
|
|
221
223
|
* @returns {(Signer|undefined)} - Signer of the saved account, if it exists
|
|
222
224
|
*/
|
|
225
|
+
)
|
|
223
226
|
}, {
|
|
224
227
|
key: "GetAccount",
|
|
225
228
|
value: function GetAccount(_ref6) {
|
|
@@ -240,6 +243,5 @@ var ElvWallet = /*#__PURE__*/function () {
|
|
|
240
243
|
delete this.signers[accountName];
|
|
241
244
|
}
|
|
242
245
|
}]);
|
|
243
|
-
return ElvWallet;
|
|
244
246
|
}();
|
|
245
247
|
module.exports = ElvWallet;
|