@eluvio/elv-client-js 3.2.4 → 3.2.7

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.
Files changed (46) hide show
  1. package/dist/ElvClient-min.js +15 -11
  2. package/dist/ElvClient-node-min.js +17 -13
  3. package/dist/ElvFrameClient-min.js +12 -8
  4. package/dist/ElvPermissionsClient-min.js +13 -9
  5. package/dist/ElvWalletClient-min.js +58 -0
  6. package/dist/ElvWalletClient-node-min.js +78 -0
  7. package/dist/src/AuthorizationClient.js +2248 -1990
  8. package/dist/src/ContentObjectVerification.js +164 -173
  9. package/dist/src/Crypto.js +376 -324
  10. package/dist/src/ElvClient.js +1198 -1019
  11. package/dist/src/ElvWallet.js +119 -95
  12. package/dist/src/EthClient.js +1040 -896
  13. package/dist/src/FrameClient.js +331 -300
  14. package/dist/src/HttpClient.js +153 -147
  15. package/dist/src/Id.js +1 -3
  16. package/dist/src/PermissionsClient.js +1294 -1168
  17. package/dist/src/RemoteSigner.js +263 -211
  18. package/dist/src/UserProfileClient.js +1164 -1023
  19. package/dist/src/Utils.js +229 -184
  20. package/dist/src/client/ABRPublishing.js +895 -858
  21. package/dist/src/client/AccessGroups.js +1102 -959
  22. package/dist/src/client/ContentAccess.js +3724 -3431
  23. package/dist/src/client/ContentManagement.js +2252 -2068
  24. package/dist/src/client/Contracts.js +647 -563
  25. package/dist/src/client/Files.js +1886 -1757
  26. package/dist/src/client/NFT.js +126 -112
  27. package/dist/src/client/NTP.js +478 -422
  28. package/dist/src/index.js +11 -0
  29. package/dist/src/marketplaceClient/ClientMethods.js +1918 -0
  30. package/dist/src/marketplaceClient/Configuration.js +29 -0
  31. package/dist/src/marketplaceClient/Utils.js +304 -0
  32. package/dist/src/marketplaceClient/index.js +1553 -0
  33. package/dist/src/walletClient/ClientMethods.js +2080 -0
  34. package/dist/src/walletClient/Configuration.js +29 -0
  35. package/dist/src/walletClient/Utils.js +304 -0
  36. package/dist/src/walletClient/index.js +1770 -0
  37. package/package.json +8 -4
  38. package/src/ElvClient.js +5 -2
  39. package/src/Utils.js +22 -4
  40. package/src/index.js +7 -0
  41. package/src/walletClient/ClientMethods.js +1111 -0
  42. package/src/walletClient/Configuration.js +40 -0
  43. package/src/walletClient/README.md +191 -0
  44. package/src/walletClient/Utils.js +234 -0
  45. package/src/walletClient/index.js +977 -0
  46. package/testScripts/TestMarketplaceClient.js +25 -0
@@ -2,15 +2,15 @@ var _regeneratorRuntime = require("@babel/runtime/regenerator");
2
2
 
3
3
  var _typeof = require("@babel/runtime/helpers/typeof");
4
4
 
5
+ var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
6
+
5
7
  var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
6
8
 
7
9
  var _createClass = require("@babel/runtime/helpers/createClass");
8
10
 
9
11
  var Ethers = require("ethers");
10
12
 
11
- var ElvWallet =
12
- /*#__PURE__*/
13
- function () {
13
+ var ElvWallet = /*#__PURE__*/function () {
14
14
  "use strict";
15
15
 
16
16
  /**
@@ -74,35 +74,43 @@ function () {
74
74
 
75
75
  }, {
76
76
  key: "AddAccountFromEncryptedPK",
77
- value: function AddAccountFromEncryptedPK(_ref2) {
78
- var accountName, encryptedPrivateKey, password, signer;
79
- return _regeneratorRuntime.async(function AddAccountFromEncryptedPK$(_context) {
80
- while (1) {
81
- switch (_context.prev = _context.next) {
82
- case 0:
83
- accountName = _ref2.accountName, encryptedPrivateKey = _ref2.encryptedPrivateKey, password = _ref2.password;
84
-
85
- if (_typeof(encryptedPrivateKey) === "object") {
86
- encryptedPrivateKey = JSON.stringify(encryptedPrivateKey);
87
- }
88
-
89
- _context.next = 4;
90
- return _regeneratorRuntime.awrap(Ethers.Wallet.fromEncryptedJson(encryptedPrivateKey, password));
91
-
92
- case 4:
93
- signer = _context.sent;
94
- return _context.abrupt("return", this.AddAccount({
95
- accountName: accountName,
96
- privateKey: signer.privateKey
97
- }));
98
-
99
- case 6:
100
- case "end":
101
- return _context.stop();
77
+ value: function () {
78
+ var _AddAccountFromEncryptedPK = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
79
+ var accountName, encryptedPrivateKey, password, signer;
80
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
81
+ while (1) {
82
+ switch (_context.prev = _context.next) {
83
+ case 0:
84
+ accountName = _ref2.accountName, encryptedPrivateKey = _ref2.encryptedPrivateKey, password = _ref2.password;
85
+
86
+ if (_typeof(encryptedPrivateKey) === "object") {
87
+ encryptedPrivateKey = JSON.stringify(encryptedPrivateKey);
88
+ }
89
+
90
+ _context.next = 4;
91
+ return Ethers.Wallet.fromEncryptedJson(encryptedPrivateKey, password);
92
+
93
+ case 4:
94
+ signer = _context.sent;
95
+ return _context.abrupt("return", this.AddAccount({
96
+ accountName: accountName,
97
+ privateKey: signer.privateKey
98
+ }));
99
+
100
+ case 6:
101
+ case "end":
102
+ return _context.stop();
103
+ }
102
104
  }
103
- }
104
- }, null, this);
105
- }
105
+ }, _callee, this);
106
+ }));
107
+
108
+ function AddAccountFromEncryptedPK(_x) {
109
+ return _AddAccountFromEncryptedPK.apply(this, arguments);
110
+ }
111
+
112
+ return AddAccountFromEncryptedPK;
113
+ }()
106
114
  /**
107
115
  * Add an account from a private key (Ethereum keystore format)
108
116
  *
@@ -147,40 +155,48 @@ function () {
147
155
 
148
156
  }, {
149
157
  key: "GetAccountBalance",
150
- value: function GetAccountBalance(_ref4) {
151
- var accountName, signer, accountSigner;
152
- return _regeneratorRuntime.async(function GetAccountBalance$(_context2) {
153
- while (1) {
154
- switch (_context2.prev = _context2.next) {
155
- case 0:
156
- accountName = _ref4.accountName, signer = _ref4.signer;
157
- accountSigner = signer || this.GetAccount({
158
- accountName: accountName
159
- });
160
-
161
- if (accountSigner) {
162
- _context2.next = 4;
163
- break;
164
- }
165
-
166
- throw Error("Unknown account: " + accountName);
167
-
168
- case 4:
169
- _context2.t0 = Ethers.utils;
170
- _context2.next = 7;
171
- return _regeneratorRuntime.awrap(accountSigner.getBalance());
172
-
173
- case 7:
174
- _context2.t1 = _context2.sent;
175
- return _context2.abrupt("return", _context2.t0.formatEther.call(_context2.t0, _context2.t1));
176
-
177
- case 9:
178
- case "end":
179
- return _context2.stop();
158
+ value: function () {
159
+ var _GetAccountBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref4) {
160
+ var accountName, signer, accountSigner;
161
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
162
+ while (1) {
163
+ switch (_context2.prev = _context2.next) {
164
+ case 0:
165
+ accountName = _ref4.accountName, signer = _ref4.signer;
166
+ accountSigner = signer || this.GetAccount({
167
+ accountName: accountName
168
+ });
169
+
170
+ if (accountSigner) {
171
+ _context2.next = 4;
172
+ break;
173
+ }
174
+
175
+ throw Error("Unknown account: " + accountName);
176
+
177
+ case 4:
178
+ _context2.t0 = Ethers.utils;
179
+ _context2.next = 7;
180
+ return accountSigner.getBalance();
181
+
182
+ case 7:
183
+ _context2.t1 = _context2.sent;
184
+ return _context2.abrupt("return", _context2.t0.formatEther.call(_context2.t0, _context2.t1));
185
+
186
+ case 9:
187
+ case "end":
188
+ return _context2.stop();
189
+ }
180
190
  }
181
- }
182
- }, null, this);
183
- }
191
+ }, _callee2, this);
192
+ }));
193
+
194
+ function GetAccountBalance(_x2) {
195
+ return _GetAccountBalance.apply(this, arguments);
196
+ }
197
+
198
+ return GetAccountBalance;
199
+ }()
184
200
  /**
185
201
  * Generate the encrypted private key (Ethereum keystore format) of the signer's private key
186
202
  * The private key to decrypt can be specified either by passing the signer object, or by passing
@@ -198,38 +214,46 @@ function () {
198
214
 
199
215
  }, {
200
216
  key: "GenerateEncryptedPrivateKey",
201
- value: function GenerateEncryptedPrivateKey(_ref5) {
202
- var accountName, signer, password, options, accountSigner;
203
- return _regeneratorRuntime.async(function GenerateEncryptedPrivateKey$(_context3) {
204
- while (1) {
205
- switch (_context3.prev = _context3.next) {
206
- case 0:
207
- accountName = _ref5.accountName, signer = _ref5.signer, password = _ref5.password, options = _ref5.options;
208
- accountSigner = signer || this.GetAccount({
209
- accountName: accountName
210
- });
211
-
212
- if (accountSigner) {
213
- _context3.next = 4;
214
- break;
215
- }
216
-
217
- throw Error("Unknown account: " + accountName);
218
-
219
- case 4:
220
- _context3.next = 6;
221
- return _regeneratorRuntime.awrap(accountSigner.encrypt(password, options));
222
-
223
- case 6:
224
- return _context3.abrupt("return", _context3.sent);
225
-
226
- case 7:
227
- case "end":
228
- return _context3.stop();
217
+ value: function () {
218
+ var _GenerateEncryptedPrivateKey = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
219
+ var accountName, signer, password, options, accountSigner;
220
+ return _regeneratorRuntime.wrap(function _callee3$(_context3) {
221
+ while (1) {
222
+ switch (_context3.prev = _context3.next) {
223
+ case 0:
224
+ accountName = _ref5.accountName, signer = _ref5.signer, password = _ref5.password, options = _ref5.options;
225
+ accountSigner = signer || this.GetAccount({
226
+ accountName: accountName
227
+ });
228
+
229
+ if (accountSigner) {
230
+ _context3.next = 4;
231
+ break;
232
+ }
233
+
234
+ throw Error("Unknown account: " + accountName);
235
+
236
+ case 4:
237
+ _context3.next = 6;
238
+ return accountSigner.encrypt(password, options);
239
+
240
+ case 6:
241
+ return _context3.abrupt("return", _context3.sent);
242
+
243
+ case 7:
244
+ case "end":
245
+ return _context3.stop();
246
+ }
229
247
  }
230
- }
231
- }, null, this);
232
- }
248
+ }, _callee3, this);
249
+ }));
250
+
251
+ function GenerateEncryptedPrivateKey(_x3) {
252
+ return _GenerateEncryptedPrivateKey.apply(this, arguments);
253
+ }
254
+
255
+ return GenerateEncryptedPrivateKey;
256
+ }()
233
257
  /**
234
258
  * Get the signer of a previously saved account by name
235
259
  *