@eluvio/elv-client-js 3.1.95 → 3.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.
Files changed (51) hide show
  1. package/dist/ElvClient-min.js +11 -15
  2. package/dist/ElvClient-node-min.js +13 -17
  3. package/dist/ElvFrameClient-min.js +9 -13
  4. package/dist/ElvPermissionsClient-min.js +9 -13
  5. package/dist/src/AuthorizationClient.js +1980 -2238
  6. package/dist/src/ContentObjectVerification.js +173 -164
  7. package/dist/src/Crypto.js +324 -376
  8. package/dist/src/ElvClient.js +1022 -1182
  9. package/dist/src/ElvWallet.js +95 -119
  10. package/dist/src/EthClient.js +896 -1040
  11. package/dist/src/FrameClient.js +300 -331
  12. package/dist/src/HttpClient.js +147 -153
  13. package/dist/src/Id.js +3 -1
  14. package/dist/src/PermissionsClient.js +1168 -1294
  15. package/dist/src/RemoteSigner.js +211 -263
  16. package/dist/src/UserProfileClient.js +1023 -1164
  17. package/dist/src/Utils.js +217 -212
  18. package/dist/src/client/ABRPublishing.js +858 -895
  19. package/dist/src/client/AccessGroups.js +959 -1102
  20. package/dist/src/client/ContentAccess.js +3433 -3717
  21. package/dist/src/client/ContentManagement.js +2068 -2252
  22. package/dist/src/client/Contracts.js +563 -647
  23. package/dist/src/client/Files.js +1757 -1886
  24. package/dist/src/client/NFT.js +112 -126
  25. package/dist/src/client/NTP.js +422 -478
  26. package/dist/src/index.js +11 -0
  27. package/dist/src/marketplaceClient/ClientMethods.js +1918 -0
  28. package/dist/src/marketplaceClient/Configuration.js +29 -0
  29. package/dist/src/marketplaceClient/Utils.js +304 -0
  30. package/dist/src/marketplaceClient/index.js +1553 -0
  31. package/dist/src/walletClient/ClientMethods.js +1828 -0
  32. package/dist/src/walletClient/Configuration.js +29 -0
  33. package/dist/src/walletClient/Utils.js +290 -0
  34. package/dist/src/walletClient/index.js +1459 -0
  35. package/package-lock.json +22001 -0
  36. package/package.json +6 -4
  37. package/src/AuthorizationClient.js +1 -1
  38. package/src/ElvClient.js +4 -1
  39. package/src/Utils.js +44 -3
  40. package/src/client/ContentAccess.js +4 -0
  41. package/src/index.js +7 -0
  42. package/src/walletClient/ClientMethods.js +1016 -0
  43. package/src/walletClient/Configuration.js +40 -0
  44. package/src/walletClient/README.md +185 -0
  45. package/src/walletClient/Utils.js +234 -0
  46. package/src/walletClient/index.js +884 -0
  47. package/testScripts/TestMarketplaceClient.js +25 -0
  48. package/utilities/ObjectSetPermission.js +4 -4
  49. package/utilities/SimpleIngest.js +41 -0
  50. package/utilities/example_files/simple_ingest_library_metadata.json +180 -0
  51. package/utilities/example_files/simple_ingest_library_metadata_animation_NFTs.json +133 -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
-
7
5
  var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
8
6
 
9
7
  var _createClass = require("@babel/runtime/helpers/createClass");
10
8
 
11
9
  var Ethers = require("ethers");
12
10
 
13
- var ElvWallet = /*#__PURE__*/function () {
11
+ var ElvWallet =
12
+ /*#__PURE__*/
13
+ function () {
14
14
  "use strict";
15
15
 
16
16
  /**
@@ -74,43 +74,35 @@ var ElvWallet = /*#__PURE__*/function () {
74
74
 
75
75
  }, {
76
76
  key: "AddAccountFromEncryptedPK",
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
- }
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();
104
102
  }
105
- }, _callee, this);
106
- }));
107
-
108
- function AddAccountFromEncryptedPK(_x) {
109
- return _AddAccountFromEncryptedPK.apply(this, arguments);
110
- }
111
-
112
- return AddAccountFromEncryptedPK;
113
- }()
103
+ }
104
+ }, null, this);
105
+ }
114
106
  /**
115
107
  * Add an account from a private key (Ethereum keystore format)
116
108
  *
@@ -155,48 +147,40 @@ var ElvWallet = /*#__PURE__*/function () {
155
147
 
156
148
  }, {
157
149
  key: "GetAccountBalance",
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
- }
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();
190
180
  }
191
- }, _callee2, this);
192
- }));
193
-
194
- function GetAccountBalance(_x2) {
195
- return _GetAccountBalance.apply(this, arguments);
196
- }
197
-
198
- return GetAccountBalance;
199
- }()
181
+ }
182
+ }, null, this);
183
+ }
200
184
  /**
201
185
  * Generate the encrypted private key (Ethereum keystore format) of the signer's private key
202
186
  * The private key to decrypt can be specified either by passing the signer object, or by passing
@@ -214,46 +198,38 @@ var ElvWallet = /*#__PURE__*/function () {
214
198
 
215
199
  }, {
216
200
  key: "GenerateEncryptedPrivateKey",
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
- }
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();
247
229
  }
248
- }, _callee3, this);
249
- }));
250
-
251
- function GenerateEncryptedPrivateKey(_x3) {
252
- return _GenerateEncryptedPrivateKey.apply(this, arguments);
253
- }
254
-
255
- return GenerateEncryptedPrivateKey;
256
- }()
230
+ }
231
+ }, null, this);
232
+ }
257
233
  /**
258
234
  * Get the signer of a previously saved account by name
259
235
  *