@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
@@ -4,11 +4,9 @@ var _typeof = require("@babel/runtime/helpers/typeof");
4
4
 
5
5
  var _regeneratorRuntime = require("@babel/runtime/regenerator");
6
6
 
7
- var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
7
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
8
8
 
9
- 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; }
10
-
11
- 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; }
9
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
12
10
 
13
11
  /**
14
12
  * Methods for deploying and interacting with contracts
@@ -34,33 +32,27 @@ var _require = require("../Validation"),
34
32
  */
35
33
 
36
34
 
37
- exports.ContractName = /*#__PURE__*/function () {
38
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
39
- var contractAddress;
40
- return _regeneratorRuntime.wrap(function _callee$(_context) {
41
- while (1) {
42
- switch (_context.prev = _context.next) {
43
- case 0:
44
- contractAddress = _ref.contractAddress;
45
- contractAddress = ValidateAddress(contractAddress);
46
- _context.next = 4;
47
- return this.ethClient.ContractName(contractAddress);
48
-
49
- case 4:
50
- return _context.abrupt("return", _context.sent);
51
-
52
- case 5:
53
- case "end":
54
- return _context.stop();
55
- }
56
- }
57
- }, _callee, this);
58
- }));
35
+ exports.ContractName = function _callee(_ref) {
36
+ var contractAddress;
37
+ return _regeneratorRuntime.async(function _callee$(_context) {
38
+ while (1) {
39
+ switch (_context.prev = _context.next) {
40
+ case 0:
41
+ contractAddress = _ref.contractAddress;
42
+ contractAddress = ValidateAddress(contractAddress);
43
+ _context.next = 4;
44
+ return _regeneratorRuntime.awrap(this.ethClient.ContractName(contractAddress));
45
+
46
+ case 4:
47
+ return _context.abrupt("return", _context.sent);
59
48
 
60
- return function (_x) {
61
- return _ref2.apply(this, arguments);
62
- };
63
- }();
49
+ case 5:
50
+ case "end":
51
+ return _context.stop();
52
+ }
53
+ }
54
+ }, null, this);
55
+ };
64
56
  /**
65
57
  * Retrieve the ABI for the given contract via its address or a Fabric ID. Contract must be a standard Eluvio contract
66
58
  *
@@ -75,45 +67,39 @@ exports.ContractName = /*#__PURE__*/function () {
75
67
  */
76
68
 
77
69
 
78
- exports.ContractAbi = /*#__PURE__*/function () {
79
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
80
- var contractAddress, id, contractInfo;
81
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
82
- while (1) {
83
- switch (_context2.prev = _context2.next) {
84
- case 0:
85
- contractAddress = _ref3.contractAddress, id = _ref3.id;
86
- _context2.next = 3;
87
- return this.authClient.ContractInfo({
88
- address: contractAddress,
89
- id: id
90
- });
91
-
92
- case 3:
93
- contractInfo = _context2.sent;
94
-
95
- if (contractInfo) {
96
- _context2.next = 6;
97
- break;
98
- }
70
+ exports.ContractAbi = function _callee2(_ref2) {
71
+ var contractAddress, id, contractInfo;
72
+ return _regeneratorRuntime.async(function _callee2$(_context2) {
73
+ while (1) {
74
+ switch (_context2.prev = _context2.next) {
75
+ case 0:
76
+ contractAddress = _ref2.contractAddress, id = _ref2.id;
77
+ _context2.next = 3;
78
+ return _regeneratorRuntime.awrap(this.authClient.ContractInfo({
79
+ address: contractAddress,
80
+ id: id
81
+ }));
82
+
83
+ case 3:
84
+ contractInfo = _context2.sent;
99
85
 
100
- throw Error("Unable to determine contract info for ".concat(contractAddress));
86
+ if (contractInfo) {
87
+ _context2.next = 6;
88
+ break;
89
+ }
101
90
 
102
- case 6:
103
- return _context2.abrupt("return", contractInfo.abi);
91
+ throw Error("Unable to determine contract info for ".concat(contractAddress));
104
92
 
105
- case 7:
106
- case "end":
107
- return _context2.stop();
108
- }
109
- }
110
- }, _callee2, this);
111
- }));
93
+ case 6:
94
+ return _context2.abrupt("return", contractInfo.abi);
112
95
 
113
- return function (_x2) {
114
- return _ref4.apply(this, arguments);
115
- };
116
- }();
96
+ case 7:
97
+ case "end":
98
+ return _context2.stop();
99
+ }
100
+ }
101
+ }, null, this);
102
+ };
117
103
  /**
118
104
  * Format the arguments to be used for the specified method of the contract
119
105
  *
@@ -127,10 +113,10 @@ exports.ContractAbi = /*#__PURE__*/function () {
127
113
  */
128
114
 
129
115
 
130
- exports.FormatContractArguments = function (_ref5) {
131
- var abi = _ref5.abi,
132
- methodName = _ref5.methodName,
133
- args = _ref5.args;
116
+ exports.FormatContractArguments = function (_ref3) {
117
+ var abi = _ref3.abi,
118
+ methodName = _ref3.methodName,
119
+ args = _ref3.args;
134
120
  return this.ethClient.FormatContractArguments({
135
121
  abi: abi,
136
122
  methodName: methodName,
@@ -151,39 +137,33 @@ exports.FormatContractArguments = function (_ref5) {
151
137
  */
152
138
 
153
139
 
154
- exports.DeployContract = /*#__PURE__*/function () {
155
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref6) {
156
- var abi, bytecode, constructorArgs, _ref6$overrides, overrides;
140
+ exports.DeployContract = function _callee3(_ref4) {
141
+ var abi, bytecode, constructorArgs, _ref4$overrides, overrides;
157
142
 
158
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
159
- while (1) {
160
- switch (_context3.prev = _context3.next) {
161
- case 0:
162
- abi = _ref6.abi, bytecode = _ref6.bytecode, constructorArgs = _ref6.constructorArgs, _ref6$overrides = _ref6.overrides, overrides = _ref6$overrides === void 0 ? {} : _ref6$overrides;
163
- _context3.next = 3;
164
- return this.ethClient.DeployContract({
165
- abi: abi,
166
- bytecode: bytecode,
167
- constructorArgs: constructorArgs,
168
- overrides: overrides,
169
- signer: this.signer
170
- });
171
-
172
- case 3:
173
- return _context3.abrupt("return", _context3.sent);
174
-
175
- case 4:
176
- case "end":
177
- return _context3.stop();
178
- }
179
- }
180
- }, _callee3, this);
181
- }));
143
+ return _regeneratorRuntime.async(function _callee3$(_context3) {
144
+ while (1) {
145
+ switch (_context3.prev = _context3.next) {
146
+ case 0:
147
+ abi = _ref4.abi, bytecode = _ref4.bytecode, constructorArgs = _ref4.constructorArgs, _ref4$overrides = _ref4.overrides, overrides = _ref4$overrides === void 0 ? {} : _ref4$overrides;
148
+ _context3.next = 3;
149
+ return _regeneratorRuntime.awrap(this.ethClient.DeployContract({
150
+ abi: abi,
151
+ bytecode: bytecode,
152
+ constructorArgs: constructorArgs,
153
+ overrides: overrides,
154
+ signer: this.signer
155
+ }));
182
156
 
183
- return function (_x3) {
184
- return _ref7.apply(this, arguments);
185
- };
186
- }();
157
+ case 3:
158
+ return _context3.abrupt("return", _context3.sent);
159
+
160
+ case 4:
161
+ case "end":
162
+ return _context3.stop();
163
+ }
164
+ }
165
+ }, null, this);
166
+ };
187
167
  /**
188
168
  * Get all events on the specified contract
189
169
  *
@@ -200,66 +180,60 @@ exports.DeployContract = /*#__PURE__*/function () {
200
180
  */
201
181
 
202
182
 
203
- exports.ContractEvents = /*#__PURE__*/function () {
204
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref8) {
205
- var contractAddress, abi, _ref8$fromBlock, fromBlock, toBlock, _ref8$count, count, topics, _ref8$includeTransact, includeTransaction, blocks;
183
+ exports.ContractEvents = function _callee4(_ref5) {
184
+ var contractAddress, abi, _ref5$fromBlock, fromBlock, toBlock, _ref5$count, count, topics, _ref5$includeTransact, includeTransaction, blocks;
206
185
 
207
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
208
- while (1) {
209
- switch (_context4.prev = _context4.next) {
210
- case 0:
211
- contractAddress = _ref8.contractAddress, abi = _ref8.abi, _ref8$fromBlock = _ref8.fromBlock, fromBlock = _ref8$fromBlock === void 0 ? 0 : _ref8$fromBlock, toBlock = _ref8.toBlock, _ref8$count = _ref8.count, count = _ref8$count === void 0 ? 1000 : _ref8$count, topics = _ref8.topics, _ref8$includeTransact = _ref8.includeTransaction, includeTransaction = _ref8$includeTransact === void 0 ? false : _ref8$includeTransact;
212
- contractAddress = ValidateAddress(contractAddress);
186
+ return _regeneratorRuntime.async(function _callee4$(_context4) {
187
+ while (1) {
188
+ switch (_context4.prev = _context4.next) {
189
+ case 0:
190
+ contractAddress = _ref5.contractAddress, abi = _ref5.abi, _ref5$fromBlock = _ref5.fromBlock, fromBlock = _ref5$fromBlock === void 0 ? 0 : _ref5$fromBlock, toBlock = _ref5.toBlock, _ref5$count = _ref5.count, count = _ref5$count === void 0 ? 1000 : _ref5$count, topics = _ref5.topics, _ref5$includeTransact = _ref5.includeTransaction, includeTransaction = _ref5$includeTransact === void 0 ? false : _ref5$includeTransact;
191
+ contractAddress = ValidateAddress(contractAddress);
213
192
 
214
- if (abi) {
215
- _context4.next = 6;
216
- break;
217
- }
193
+ if (abi) {
194
+ _context4.next = 6;
195
+ break;
196
+ }
218
197
 
219
- _context4.next = 5;
220
- return this.ContractAbi({
221
- contractAddress: contractAddress
222
- });
223
-
224
- case 5:
225
- abi = _context4.sent;
226
-
227
- case 6:
228
- _context4.next = 8;
229
- return this.FormatBlockNumbers({
230
- fromBlock: fromBlock,
231
- toBlock: toBlock,
232
- count: count
233
- });
234
-
235
- case 8:
236
- blocks = _context4.sent;
237
- this.Log("Querying contract events ".concat(contractAddress, " - Blocks ").concat(blocks.fromBlock, " to ").concat(blocks.toBlock));
238
- _context4.next = 12;
239
- return this.ethClient.ContractEvents({
240
- contractAddress: contractAddress,
241
- abi: abi,
242
- fromBlock: blocks.fromBlock,
243
- toBlock: blocks.toBlock,
244
- topics: topics,
245
- includeTransaction: includeTransaction
246
- });
247
-
248
- case 12:
249
- return _context4.abrupt("return", _context4.sent);
250
-
251
- case 13:
252
- case "end":
253
- return _context4.stop();
254
- }
255
- }
256
- }, _callee4, this);
257
- }));
198
+ _context4.next = 5;
199
+ return _regeneratorRuntime.awrap(this.ContractAbi({
200
+ contractAddress: contractAddress
201
+ }));
202
+
203
+ case 5:
204
+ abi = _context4.sent;
258
205
 
259
- return function (_x4) {
260
- return _ref9.apply(this, arguments);
261
- };
262
- }();
206
+ case 6:
207
+ _context4.next = 8;
208
+ return _regeneratorRuntime.awrap(this.FormatBlockNumbers({
209
+ fromBlock: fromBlock,
210
+ toBlock: toBlock,
211
+ count: count
212
+ }));
213
+
214
+ case 8:
215
+ blocks = _context4.sent;
216
+ this.Log("Querying contract events ".concat(contractAddress, " - Blocks ").concat(blocks.fromBlock, " to ").concat(blocks.toBlock));
217
+ _context4.next = 12;
218
+ return _regeneratorRuntime.awrap(this.ethClient.ContractEvents({
219
+ contractAddress: contractAddress,
220
+ abi: abi,
221
+ fromBlock: blocks.fromBlock,
222
+ toBlock: blocks.toBlock,
223
+ topics: topics,
224
+ includeTransaction: includeTransaction
225
+ }));
226
+
227
+ case 12:
228
+ return _context4.abrupt("return", _context4.sent);
229
+
230
+ case 13:
231
+ case "end":
232
+ return _context4.stop();
233
+ }
234
+ }
235
+ }, null, this);
236
+ };
263
237
  /**
264
238
  * Call the specified method on a deployed contract. This action will be performed by this client's signer.
265
239
  *
@@ -280,65 +254,59 @@ exports.ContractEvents = /*#__PURE__*/function () {
280
254
  */
281
255
 
282
256
 
283
- exports.CallContractMethod = /*#__PURE__*/function () {
284
- var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref10) {
285
- var contractAddress, abi, methodName, _ref10$methodArgs, methodArgs, value, _ref10$overrides, overrides, _ref10$formatArgument, formatArguments, _ref10$cacheContract, cacheContract, _ref10$overrideCached, overrideCachedContract;
257
+ exports.CallContractMethod = function _callee5(_ref6) {
258
+ var contractAddress, abi, methodName, _ref6$methodArgs, methodArgs, value, _ref6$overrides, overrides, _ref6$formatArguments, formatArguments, _ref6$cacheContract, cacheContract, _ref6$overrideCachedC, overrideCachedContract;
286
259
 
287
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
288
- while (1) {
289
- switch (_context5.prev = _context5.next) {
290
- case 0:
291
- contractAddress = _ref10.contractAddress, abi = _ref10.abi, methodName = _ref10.methodName, _ref10$methodArgs = _ref10.methodArgs, methodArgs = _ref10$methodArgs === void 0 ? [] : _ref10$methodArgs, value = _ref10.value, _ref10$overrides = _ref10.overrides, overrides = _ref10$overrides === void 0 ? {} : _ref10$overrides, _ref10$formatArgument = _ref10.formatArguments, formatArguments = _ref10$formatArgument === void 0 ? true : _ref10$formatArgument, _ref10$cacheContract = _ref10.cacheContract, cacheContract = _ref10$cacheContract === void 0 ? true : _ref10$cacheContract, _ref10$overrideCached = _ref10.overrideCachedContract, overrideCachedContract = _ref10$overrideCached === void 0 ? false : _ref10$overrideCached;
292
- contractAddress = ValidateAddress(contractAddress); // Delete cached visibility value if it is being changed
260
+ return _regeneratorRuntime.async(function _callee5$(_context5) {
261
+ while (1) {
262
+ switch (_context5.prev = _context5.next) {
263
+ case 0:
264
+ contractAddress = _ref6.contractAddress, abi = _ref6.abi, methodName = _ref6.methodName, _ref6$methodArgs = _ref6.methodArgs, methodArgs = _ref6$methodArgs === void 0 ? [] : _ref6$methodArgs, value = _ref6.value, _ref6$overrides = _ref6.overrides, overrides = _ref6$overrides === void 0 ? {} : _ref6$overrides, _ref6$formatArguments = _ref6.formatArguments, formatArguments = _ref6$formatArguments === void 0 ? true : _ref6$formatArguments, _ref6$cacheContract = _ref6.cacheContract, cacheContract = _ref6$cacheContract === void 0 ? true : _ref6$cacheContract, _ref6$overrideCachedC = _ref6.overrideCachedContract, overrideCachedContract = _ref6$overrideCachedC === void 0 ? false : _ref6$overrideCachedC;
265
+ contractAddress = ValidateAddress(contractAddress); // Delete cached visibility value if it is being changed
293
266
 
294
- contractAddress = this.utils.FormatAddress(contractAddress);
267
+ contractAddress = this.utils.FormatAddress(contractAddress);
295
268
 
296
- if (methodName === "setVisibility" && this.visibilityInfo[contractAddress]) {
297
- delete this.visibilityInfo[contractAddress];
298
- }
269
+ if (methodName === "setVisibility" && this.visibilityInfo[contractAddress]) {
270
+ delete this.visibilityInfo[contractAddress];
271
+ }
299
272
 
300
- if (abi) {
301
- _context5.next = 8;
302
- break;
303
- }
273
+ if (abi) {
274
+ _context5.next = 8;
275
+ break;
276
+ }
304
277
 
305
- _context5.next = 7;
306
- return this.ContractAbi({
307
- contractAddress: contractAddress
308
- });
278
+ _context5.next = 7;
279
+ return _regeneratorRuntime.awrap(this.ContractAbi({
280
+ contractAddress: contractAddress
281
+ }));
309
282
 
310
- case 7:
311
- abi = _context5.sent;
283
+ case 7:
284
+ abi = _context5.sent;
312
285
 
313
- case 8:
314
- _context5.next = 10;
315
- return this.ethClient.CallContractMethod({
316
- contractAddress: contractAddress,
317
- abi: abi,
318
- methodName: methodName,
319
- methodArgs: methodArgs,
320
- value: value,
321
- overrides: overrides,
322
- formatArguments: formatArguments,
323
- cacheContract: cacheContract,
324
- overrideCachedContract: overrideCachedContract
325
- });
326
-
327
- case 10:
328
- return _context5.abrupt("return", _context5.sent);
329
-
330
- case 11:
331
- case "end":
332
- return _context5.stop();
333
- }
286
+ case 8:
287
+ _context5.next = 10;
288
+ return _regeneratorRuntime.awrap(this.ethClient.CallContractMethod({
289
+ contractAddress: contractAddress,
290
+ abi: abi,
291
+ methodName: methodName,
292
+ methodArgs: methodArgs,
293
+ value: value,
294
+ overrides: overrides,
295
+ formatArguments: formatArguments,
296
+ cacheContract: cacheContract,
297
+ overrideCachedContract: overrideCachedContract
298
+ }));
299
+
300
+ case 10:
301
+ return _context5.abrupt("return", _context5.sent);
302
+
303
+ case 11:
304
+ case "end":
305
+ return _context5.stop();
334
306
  }
335
- }, _callee5, this);
336
- }));
337
-
338
- return function (_x5) {
339
- return _ref11.apply(this, arguments);
340
- };
341
- }();
307
+ }
308
+ }, null, this);
309
+ };
342
310
  /**
343
311
  * Call the specified method on a deployed contract and wait for the transaction to be mined.
344
312
  * This action will be performed by this client's signer.
@@ -362,65 +330,59 @@ exports.CallContractMethod = /*#__PURE__*/function () {
362
330
  */
363
331
 
364
332
 
365
- exports.CallContractMethodAndWait = /*#__PURE__*/function () {
366
- var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref12) {
367
- var contractAddress, abi, methodName, methodArgs, value, _ref12$overrides, overrides, _ref12$formatArgument, formatArguments, _ref12$cacheContract, cacheContract, _ref12$overrideCached, overrideCachedContract;
333
+ exports.CallContractMethodAndWait = function _callee6(_ref7) {
334
+ var contractAddress, abi, methodName, methodArgs, value, _ref7$overrides, overrides, _ref7$formatArguments, formatArguments, _ref7$cacheContract, cacheContract, _ref7$overrideCachedC, overrideCachedContract;
368
335
 
369
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
370
- while (1) {
371
- switch (_context6.prev = _context6.next) {
372
- case 0:
373
- contractAddress = _ref12.contractAddress, abi = _ref12.abi, methodName = _ref12.methodName, methodArgs = _ref12.methodArgs, value = _ref12.value, _ref12$overrides = _ref12.overrides, overrides = _ref12$overrides === void 0 ? {} : _ref12$overrides, _ref12$formatArgument = _ref12.formatArguments, formatArguments = _ref12$formatArgument === void 0 ? true : _ref12$formatArgument, _ref12$cacheContract = _ref12.cacheContract, cacheContract = _ref12$cacheContract === void 0 ? true : _ref12$cacheContract, _ref12$overrideCached = _ref12.overrideCachedContract, overrideCachedContract = _ref12$overrideCached === void 0 ? false : _ref12$overrideCached;
374
- contractAddress = ValidateAddress(contractAddress); // Delete cached visibility value if it is being changed
336
+ return _regeneratorRuntime.async(function _callee6$(_context6) {
337
+ while (1) {
338
+ switch (_context6.prev = _context6.next) {
339
+ case 0:
340
+ contractAddress = _ref7.contractAddress, abi = _ref7.abi, methodName = _ref7.methodName, methodArgs = _ref7.methodArgs, value = _ref7.value, _ref7$overrides = _ref7.overrides, overrides = _ref7$overrides === void 0 ? {} : _ref7$overrides, _ref7$formatArguments = _ref7.formatArguments, formatArguments = _ref7$formatArguments === void 0 ? true : _ref7$formatArguments, _ref7$cacheContract = _ref7.cacheContract, cacheContract = _ref7$cacheContract === void 0 ? true : _ref7$cacheContract, _ref7$overrideCachedC = _ref7.overrideCachedContract, overrideCachedContract = _ref7$overrideCachedC === void 0 ? false : _ref7$overrideCachedC;
341
+ contractAddress = ValidateAddress(contractAddress); // Delete cached visibility value if it is being changed
375
342
 
376
- contractAddress = this.utils.FormatAddress(contractAddress);
343
+ contractAddress = this.utils.FormatAddress(contractAddress);
377
344
 
378
- if (methodName === "setVisibility" && this.visibilityInfo[contractAddress]) {
379
- delete this.visibilityInfo[contractAddress];
380
- }
345
+ if (methodName === "setVisibility" && this.visibilityInfo[contractAddress]) {
346
+ delete this.visibilityInfo[contractAddress];
347
+ }
381
348
 
382
- if (abi) {
383
- _context6.next = 8;
384
- break;
385
- }
349
+ if (abi) {
350
+ _context6.next = 8;
351
+ break;
352
+ }
386
353
 
387
- _context6.next = 7;
388
- return this.ContractAbi({
389
- contractAddress: contractAddress
390
- });
354
+ _context6.next = 7;
355
+ return _regeneratorRuntime.awrap(this.ContractAbi({
356
+ contractAddress: contractAddress
357
+ }));
391
358
 
392
- case 7:
393
- abi = _context6.sent;
359
+ case 7:
360
+ abi = _context6.sent;
394
361
 
395
- case 8:
396
- _context6.next = 10;
397
- return this.ethClient.CallContractMethodAndWait({
398
- contractAddress: contractAddress,
399
- abi: abi,
400
- methodName: methodName,
401
- methodArgs: methodArgs,
402
- value: value,
403
- overrides: overrides,
404
- formatArguments: formatArguments,
405
- cacheContract: cacheContract,
406
- overrideCachedContract: overrideCachedContract
407
- });
408
-
409
- case 10:
410
- return _context6.abrupt("return", _context6.sent);
411
-
412
- case 11:
413
- case "end":
414
- return _context6.stop();
415
- }
362
+ case 8:
363
+ _context6.next = 10;
364
+ return _regeneratorRuntime.awrap(this.ethClient.CallContractMethodAndWait({
365
+ contractAddress: contractAddress,
366
+ abi: abi,
367
+ methodName: methodName,
368
+ methodArgs: methodArgs,
369
+ value: value,
370
+ overrides: overrides,
371
+ formatArguments: formatArguments,
372
+ cacheContract: cacheContract,
373
+ overrideCachedContract: overrideCachedContract
374
+ }));
375
+
376
+ case 10:
377
+ return _context6.abrupt("return", _context6.sent);
378
+
379
+ case 11:
380
+ case "end":
381
+ return _context6.stop();
416
382
  }
417
- }, _callee6, this);
418
- }));
419
-
420
- return function (_x6) {
421
- return _ref13.apply(this, arguments);
422
- };
423
- }();
383
+ }
384
+ }, null, this);
385
+ };
424
386
  /**
425
387
  * Retrieve metadata from the specified contract
426
388
  *
@@ -433,56 +395,50 @@ exports.CallContractMethodAndWait = /*#__PURE__*/function () {
433
395
  */
434
396
 
435
397
 
436
- exports.ContractMetadata = /*#__PURE__*/function () {
437
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref14) {
438
- var contractAddress, metadataKey, metadata, data;
439
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
440
- while (1) {
441
- switch (_context7.prev = _context7.next) {
442
- case 0:
443
- contractAddress = _ref14.contractAddress, metadataKey = _ref14.metadataKey;
444
- ValidatePresence("contractAddress", contractAddress);
445
- ValidatePresence("metadataKey", metadataKey);
446
- _context7.prev = 3;
447
- _context7.next = 6;
448
- return this.CallContractMethod({
449
- contractAddress: contractAddress,
450
- methodName: "getMeta",
451
- methodArgs: [metadataKey]
452
- });
453
-
454
- case 6:
455
- metadata = _context7.sent;
456
- data = Buffer.from((metadata || "").replace("0x", ""), "hex").toString("utf-8");
457
- _context7.prev = 8;
458
- return _context7.abrupt("return", JSON.parse(data));
459
-
460
- case 12:
461
- _context7.prev = 12;
462
- _context7.t0 = _context7["catch"](8);
463
- return _context7.abrupt("return", data);
464
-
465
- case 15:
466
- _context7.next = 20;
467
- break;
468
-
469
- case 17:
470
- _context7.prev = 17;
471
- _context7.t1 = _context7["catch"](3);
472
- return _context7.abrupt("return", "");
473
-
474
- case 20:
475
- case "end":
476
- return _context7.stop();
477
- }
398
+ exports.ContractMetadata = function _callee7(_ref8) {
399
+ var contractAddress, metadataKey, metadata, data;
400
+ return _regeneratorRuntime.async(function _callee7$(_context7) {
401
+ while (1) {
402
+ switch (_context7.prev = _context7.next) {
403
+ case 0:
404
+ contractAddress = _ref8.contractAddress, metadataKey = _ref8.metadataKey;
405
+ ValidatePresence("contractAddress", contractAddress);
406
+ ValidatePresence("metadataKey", metadataKey);
407
+ _context7.prev = 3;
408
+ _context7.next = 6;
409
+ return _regeneratorRuntime.awrap(this.CallContractMethod({
410
+ contractAddress: contractAddress,
411
+ methodName: "getMeta",
412
+ methodArgs: [metadataKey]
413
+ }));
414
+
415
+ case 6:
416
+ metadata = _context7.sent;
417
+ data = Buffer.from((metadata || "").replace("0x", ""), "hex").toString("utf-8");
418
+ _context7.prev = 8;
419
+ return _context7.abrupt("return", JSON.parse(data));
420
+
421
+ case 12:
422
+ _context7.prev = 12;
423
+ _context7.t0 = _context7["catch"](8);
424
+ return _context7.abrupt("return", data);
425
+
426
+ case 15:
427
+ _context7.next = 20;
428
+ break;
429
+
430
+ case 17:
431
+ _context7.prev = 17;
432
+ _context7.t1 = _context7["catch"](3);
433
+ return _context7.abrupt("return", "");
434
+
435
+ case 20:
436
+ case "end":
437
+ return _context7.stop();
478
438
  }
479
- }, _callee7, this, [[3, 17], [8, 12]]);
480
- }));
481
-
482
- return function (_x7) {
483
- return _ref15.apply(this, arguments);
484
- };
485
- }();
439
+ }
440
+ }, null, this, [[3, 17], [8, 12]]);
441
+ };
486
442
  /**
487
443
  * Merge contract metadata at the specified key.
488
444
  *
@@ -494,58 +450,52 @@ exports.ContractMetadata = /*#__PURE__*/function () {
494
450
  */
495
451
 
496
452
 
497
- exports.MergeContractMetadata = /*#__PURE__*/function () {
498
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref16) {
499
- var contractAddress, metadataKey, metadata, existingMetadata;
500
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
501
- while (1) {
502
- switch (_context8.prev = _context8.next) {
503
- case 0:
504
- contractAddress = _ref16.contractAddress, metadataKey = _ref16.metadataKey, metadata = _ref16.metadata;
505
- ValidatePresence("contractAddress", contractAddress);
506
- ValidatePresence("metadataKey", metadataKey);
507
- _context8.next = 5;
508
- return this.ContractMetadata({
509
- contractAddress: contractAddress,
510
- metadataKey: metadataKey
511
- });
512
-
513
- case 5:
514
- _context8.t0 = _context8.sent;
515
-
516
- if (_context8.t0) {
517
- _context8.next = 8;
518
- break;
519
- }
453
+ exports.MergeContractMetadata = function _callee8(_ref9) {
454
+ var contractAddress, metadataKey, metadata, existingMetadata;
455
+ return _regeneratorRuntime.async(function _callee8$(_context8) {
456
+ while (1) {
457
+ switch (_context8.prev = _context8.next) {
458
+ case 0:
459
+ contractAddress = _ref9.contractAddress, metadataKey = _ref9.metadataKey, metadata = _ref9.metadata;
460
+ ValidatePresence("contractAddress", contractAddress);
461
+ ValidatePresence("metadataKey", metadataKey);
462
+ _context8.next = 5;
463
+ return _regeneratorRuntime.awrap(this.ContractMetadata({
464
+ contractAddress: contractAddress,
465
+ metadataKey: metadataKey
466
+ }));
467
+
468
+ case 5:
469
+ _context8.t0 = _context8.sent;
470
+
471
+ if (_context8.t0) {
472
+ _context8.next = 8;
473
+ break;
474
+ }
520
475
 
521
- _context8.t0 = {};
476
+ _context8.t0 = {};
522
477
 
523
- case 8:
524
- existingMetadata = _context8.t0;
478
+ case 8:
479
+ existingMetadata = _context8.t0;
525
480
 
526
- if (_typeof(existingMetadata) === "object") {
527
- metadata = _objectSpread(_objectSpread({}, existingMetadata), metadata);
528
- }
481
+ if (_typeof(existingMetadata) === "object") {
482
+ metadata = _objectSpread({}, existingMetadata, {}, metadata);
483
+ }
529
484
 
530
- _context8.next = 12;
531
- return this.CallContractMethodAndWait({
532
- contractAddress: contractAddress,
533
- methodName: "putMeta",
534
- methodArgs: [metadataKey, JSON.stringify(metadata)]
535
- });
536
-
537
- case 12:
538
- case "end":
539
- return _context8.stop();
540
- }
541
- }
542
- }, _callee8, this);
543
- }));
485
+ _context8.next = 12;
486
+ return _regeneratorRuntime.awrap(this.CallContractMethodAndWait({
487
+ contractAddress: contractAddress,
488
+ methodName: "putMeta",
489
+ methodArgs: [metadataKey, JSON.stringify(metadata)]
490
+ }));
544
491
 
545
- return function (_x8) {
546
- return _ref17.apply(this, arguments);
547
- };
548
- }();
492
+ case 12:
493
+ case "end":
494
+ return _context8.stop();
495
+ }
496
+ }
497
+ }, null, this);
498
+ };
549
499
  /**
550
500
  * Replace the contract metadata at the specified key
551
501
  *
@@ -557,35 +507,29 @@ exports.MergeContractMetadata = /*#__PURE__*/function () {
557
507
  */
558
508
 
559
509
 
560
- exports.ReplaceContractMetadata = /*#__PURE__*/function () {
561
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref18) {
562
- var contractAddress, metadataKey, metadata;
563
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
564
- while (1) {
565
- switch (_context9.prev = _context9.next) {
566
- case 0:
567
- contractAddress = _ref18.contractAddress, metadataKey = _ref18.metadataKey, metadata = _ref18.metadata;
568
- ValidatePresence("contractAddress", contractAddress);
569
- ValidatePresence("metadataKey", metadataKey);
570
- _context9.next = 5;
571
- return this.CallContractMethodAndWait({
572
- contractAddress: contractAddress,
573
- methodName: "putMeta",
574
- methodArgs: [metadataKey, JSON.stringify(metadata)]
575
- });
576
-
577
- case 5:
578
- case "end":
579
- return _context9.stop();
580
- }
510
+ exports.ReplaceContractMetadata = function _callee9(_ref10) {
511
+ var contractAddress, metadataKey, metadata;
512
+ return _regeneratorRuntime.async(function _callee9$(_context9) {
513
+ while (1) {
514
+ switch (_context9.prev = _context9.next) {
515
+ case 0:
516
+ contractAddress = _ref10.contractAddress, metadataKey = _ref10.metadataKey, metadata = _ref10.metadata;
517
+ ValidatePresence("contractAddress", contractAddress);
518
+ ValidatePresence("metadataKey", metadataKey);
519
+ _context9.next = 5;
520
+ return _regeneratorRuntime.awrap(this.CallContractMethodAndWait({
521
+ contractAddress: contractAddress,
522
+ methodName: "putMeta",
523
+ methodArgs: [metadataKey, JSON.stringify(metadata)]
524
+ }));
525
+
526
+ case 5:
527
+ case "end":
528
+ return _context9.stop();
581
529
  }
582
- }, _callee9, this);
583
- }));
584
-
585
- return function (_x9) {
586
- return _ref19.apply(this, arguments);
587
- };
588
- }();
530
+ }
531
+ }, null, this);
532
+ };
589
533
  /**
590
534
  * Get the custom contract of the specified object
591
535
  *
@@ -599,73 +543,67 @@ exports.ReplaceContractMetadata = /*#__PURE__*/function () {
599
543
  */
600
544
 
601
545
 
602
- exports.CustomContractAddress = /*#__PURE__*/function () {
603
- var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref20) {
604
- var libraryId, objectId, versionHash, abi, customContractAddress;
605
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
606
- while (1) {
607
- switch (_context10.prev = _context10.next) {
608
- case 0:
609
- libraryId = _ref20.libraryId, objectId = _ref20.objectId, versionHash = _ref20.versionHash;
610
- ValidateParameters({
611
- libraryId: libraryId,
612
- objectId: objectId,
613
- versionHash: versionHash
614
- });
615
-
616
- if (versionHash) {
617
- objectId = this.utils.DecodeVersionHash(versionHash).objectId;
618
- }
619
-
620
- if (!(libraryId === this.contentSpaceLibraryId || this.utils.EqualHash(libraryId, objectId))) {
621
- _context10.next = 5;
622
- break;
623
- }
546
+ exports.CustomContractAddress = function _callee10(_ref11) {
547
+ var libraryId, objectId, versionHash, abi, customContractAddress;
548
+ return _regeneratorRuntime.async(function _callee10$(_context10) {
549
+ while (1) {
550
+ switch (_context10.prev = _context10.next) {
551
+ case 0:
552
+ libraryId = _ref11.libraryId, objectId = _ref11.objectId, versionHash = _ref11.versionHash;
553
+ ValidateParameters({
554
+ libraryId: libraryId,
555
+ objectId: objectId,
556
+ versionHash: versionHash
557
+ });
624
558
 
625
- return _context10.abrupt("return");
559
+ if (versionHash) {
560
+ objectId = this.utils.DecodeVersionHash(versionHash).objectId;
561
+ }
626
562
 
627
- case 5:
628
- this.Log("Retrieving custom contract address: ".concat(objectId));
629
- _context10.next = 8;
630
- return this.ContractAbi({
631
- id: objectId
632
- });
563
+ if (!(libraryId === this.contentSpaceLibraryId || this.utils.EqualHash(libraryId, objectId))) {
564
+ _context10.next = 5;
565
+ break;
566
+ }
633
567
 
634
- case 8:
635
- abi = _context10.sent;
636
- _context10.next = 11;
637
- return this.ethClient.CallContractMethod({
638
- contractAddress: this.utils.HashToAddress(objectId),
639
- abi: abi,
640
- methodName: "contentContractAddress",
641
- methodArgs: []
642
- });
568
+ return _context10.abrupt("return");
643
569
 
644
- case 11:
645
- customContractAddress = _context10.sent;
570
+ case 5:
571
+ this.Log("Retrieving custom contract address: ".concat(objectId));
572
+ _context10.next = 8;
573
+ return _regeneratorRuntime.awrap(this.ContractAbi({
574
+ id: objectId
575
+ }));
646
576
 
647
- if (!(customContractAddress === this.utils.nullAddress)) {
648
- _context10.next = 14;
649
- break;
650
- }
577
+ case 8:
578
+ abi = _context10.sent;
579
+ _context10.next = 11;
580
+ return _regeneratorRuntime.awrap(this.ethClient.CallContractMethod({
581
+ contractAddress: this.utils.HashToAddress(objectId),
582
+ abi: abi,
583
+ methodName: "contentContractAddress",
584
+ methodArgs: []
585
+ }));
586
+
587
+ case 11:
588
+ customContractAddress = _context10.sent;
589
+
590
+ if (!(customContractAddress === this.utils.nullAddress)) {
591
+ _context10.next = 14;
592
+ break;
593
+ }
651
594
 
652
- return _context10.abrupt("return");
595
+ return _context10.abrupt("return");
653
596
 
654
- case 14:
655
- return _context10.abrupt("return", this.utils.FormatAddress(customContractAddress));
597
+ case 14:
598
+ return _context10.abrupt("return", this.utils.FormatAddress(customContractAddress));
656
599
 
657
- case 15:
658
- case "end":
659
- return _context10.stop();
660
- }
600
+ case 15:
601
+ case "end":
602
+ return _context10.stop();
661
603
  }
662
- }, _callee10, this);
663
- }));
664
-
665
- return function (_x10) {
666
- return _ref21.apply(this, arguments);
667
- };
668
- }();
604
+ }
605
+ }, null, this);
606
+ };
669
607
  /**
670
608
  * Set the custom contract of the specified object with the contract at the specified address
671
609
  *
@@ -686,79 +624,73 @@ exports.CustomContractAddress = /*#__PURE__*/function () {
686
624
  */
687
625
 
688
626
 
689
- exports.SetCustomContentContract = /*#__PURE__*/function () {
690
- var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref22) {
691
- var libraryId, objectId, customContractAddress, name, description, abi, factoryAbi, _ref22$overrides, overrides, setResult, writeToken;
692
-
693
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
694
- while (1) {
695
- switch (_context11.prev = _context11.next) {
696
- case 0:
697
- libraryId = _ref22.libraryId, objectId = _ref22.objectId, customContractAddress = _ref22.customContractAddress, name = _ref22.name, description = _ref22.description, abi = _ref22.abi, factoryAbi = _ref22.factoryAbi, _ref22$overrides = _ref22.overrides, overrides = _ref22$overrides === void 0 ? {} : _ref22$overrides;
698
- ValidateParameters({
699
- libraryId: libraryId,
700
- objectId: objectId
701
- });
702
- customContractAddress = ValidateAddress(customContractAddress);
703
- customContractAddress = this.utils.FormatAddress(customContractAddress);
704
- this.Log("Setting custom contract address: ".concat(objectId, " ").concat(customContractAddress));
705
- _context11.next = 7;
706
- return this.ethClient.SetCustomContentContract({
707
- contentContractAddress: this.utils.HashToAddress(objectId),
708
- customContractAddress: customContractAddress,
709
- overrides: overrides,
710
- signer: this.signer
711
- });
712
-
713
- case 7:
714
- setResult = _context11.sent;
715
- _context11.next = 10;
716
- return this.EditContentObject({
717
- libraryId: libraryId,
718
- objectId: objectId
719
- });
720
-
721
- case 10:
722
- writeToken = _context11.sent.write_token;
723
- _context11.next = 13;
724
- return this.ReplaceMetadata({
725
- libraryId: libraryId,
726
- objectId: objectId,
727
- writeToken: writeToken,
728
- metadataSubtree: "custom_contract",
729
- metadata: {
730
- name: name,
731
- description: description,
732
- address: customContractAddress,
733
- abi: abi,
734
- factoryAbi: factoryAbi
735
- }
736
- });
737
-
738
- case 13:
739
- _context11.next = 15;
740
- return this.FinalizeContentObject({
741
- libraryId: libraryId,
742
- objectId: objectId,
743
- writeToken: writeToken,
744
- commitMessage: "Set custom contract"
745
- });
746
-
747
- case 15:
748
- return _context11.abrupt("return", setResult);
749
-
750
- case 16:
751
- case "end":
752
- return _context11.stop();
753
- }
754
- }
755
- }, _callee11, this);
756
- }));
627
+ exports.SetCustomContentContract = function _callee11(_ref12) {
628
+ var libraryId, objectId, customContractAddress, name, description, abi, factoryAbi, _ref12$overrides, overrides, setResult, writeToken;
629
+
630
+ return _regeneratorRuntime.async(function _callee11$(_context11) {
631
+ while (1) {
632
+ switch (_context11.prev = _context11.next) {
633
+ case 0:
634
+ libraryId = _ref12.libraryId, objectId = _ref12.objectId, customContractAddress = _ref12.customContractAddress, name = _ref12.name, description = _ref12.description, abi = _ref12.abi, factoryAbi = _ref12.factoryAbi, _ref12$overrides = _ref12.overrides, overrides = _ref12$overrides === void 0 ? {} : _ref12$overrides;
635
+ ValidateParameters({
636
+ libraryId: libraryId,
637
+ objectId: objectId
638
+ });
639
+ customContractAddress = ValidateAddress(customContractAddress);
640
+ customContractAddress = this.utils.FormatAddress(customContractAddress);
641
+ this.Log("Setting custom contract address: ".concat(objectId, " ").concat(customContractAddress));
642
+ _context11.next = 7;
643
+ return _regeneratorRuntime.awrap(this.ethClient.SetCustomContentContract({
644
+ contentContractAddress: this.utils.HashToAddress(objectId),
645
+ customContractAddress: customContractAddress,
646
+ overrides: overrides,
647
+ signer: this.signer
648
+ }));
649
+
650
+ case 7:
651
+ setResult = _context11.sent;
652
+ _context11.next = 10;
653
+ return _regeneratorRuntime.awrap(this.EditContentObject({
654
+ libraryId: libraryId,
655
+ objectId: objectId
656
+ }));
657
+
658
+ case 10:
659
+ writeToken = _context11.sent.write_token;
660
+ _context11.next = 13;
661
+ return _regeneratorRuntime.awrap(this.ReplaceMetadata({
662
+ libraryId: libraryId,
663
+ objectId: objectId,
664
+ writeToken: writeToken,
665
+ metadataSubtree: "custom_contract",
666
+ metadata: {
667
+ name: name,
668
+ description: description,
669
+ address: customContractAddress,
670
+ abi: abi,
671
+ factoryAbi: factoryAbi
672
+ }
673
+ }));
674
+
675
+ case 13:
676
+ _context11.next = 15;
677
+ return _regeneratorRuntime.awrap(this.FinalizeContentObject({
678
+ libraryId: libraryId,
679
+ objectId: objectId,
680
+ writeToken: writeToken,
681
+ commitMessage: "Set custom contract"
682
+ }));
683
+
684
+ case 15:
685
+ return _context11.abrupt("return", setResult);
757
686
 
758
- return function (_x11) {
759
- return _ref23.apply(this, arguments);
760
- };
761
- }();
687
+ case 16:
688
+ case "end":
689
+ return _context11.stop();
690
+ }
691
+ }
692
+ }, null, this);
693
+ };
762
694
  /**
763
695
  * Extract the specified event log from the given event obtained from the
764
696
  * CallContractAndMethodAndWait method
@@ -776,10 +708,10 @@ exports.SetCustomContentContract = /*#__PURE__*/function () {
776
708
  */
777
709
 
778
710
 
779
- exports.ExtractEventFromLogs = function (_ref24) {
780
- var abi = _ref24.abi,
781
- event = _ref24.event,
782
- eventName = _ref24.eventName;
711
+ exports.ExtractEventFromLogs = function (_ref13) {
712
+ var abi = _ref13.abi,
713
+ event = _ref13.event,
714
+ eventName = _ref13.eventName;
783
715
  return this.ethClient.ExtractEventFromLogs({
784
716
  abi: abi,
785
717
  event: event,
@@ -802,11 +734,11 @@ exports.ExtractEventFromLogs = function (_ref24) {
802
734
  */
803
735
 
804
736
 
805
- exports.ExtractValueFromEvent = function (_ref25) {
806
- var abi = _ref25.abi,
807
- event = _ref25.event,
808
- eventName = _ref25.eventName,
809
- eventValue = _ref25.eventValue;
737
+ exports.ExtractValueFromEvent = function (_ref14) {
738
+ var abi = _ref14.abi,
739
+ event = _ref14.event,
740
+ eventName = _ref14.eventName,
741
+ eventValue = _ref14.eventValue;
810
742
  var eventLog = this.ethClient.ExtractEventFromLogs({
811
743
  abi: abi,
812
744
  event: event,
@@ -816,58 +748,52 @@ exports.ExtractValueFromEvent = function (_ref25) {
816
748
  return eventLog ? eventLog.values[eventValue] : undefined;
817
749
  };
818
750
 
819
- exports.FormatBlockNumbers = /*#__PURE__*/function () {
820
- var _ref27 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref26) {
821
- var fromBlock, toBlock, _ref26$count, count, latestBlock;
822
-
823
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
824
- while (1) {
825
- switch (_context12.prev = _context12.next) {
826
- case 0:
827
- fromBlock = _ref26.fromBlock, toBlock = _ref26.toBlock, _ref26$count = _ref26.count, count = _ref26$count === void 0 ? 10 : _ref26$count;
828
- _context12.next = 3;
829
- return this.BlockNumber();
830
-
831
- case 3:
832
- latestBlock = _context12.sent;
833
-
834
- if (!toBlock) {
835
- if (!fromBlock) {
836
- toBlock = latestBlock;
837
- fromBlock = toBlock - count + 1;
838
- } else {
839
- toBlock = fromBlock + count - 1;
840
- }
841
- } else if (!fromBlock) {
842
- fromBlock = toBlock - count + 1;
843
- } // Ensure block numbers are valid
751
+ exports.FormatBlockNumbers = function _callee12(_ref15) {
752
+ var fromBlock, toBlock, _ref15$count, count, latestBlock;
844
753
 
754
+ return _regeneratorRuntime.async(function _callee12$(_context12) {
755
+ while (1) {
756
+ switch (_context12.prev = _context12.next) {
757
+ case 0:
758
+ fromBlock = _ref15.fromBlock, toBlock = _ref15.toBlock, _ref15$count = _ref15.count, count = _ref15$count === void 0 ? 10 : _ref15$count;
759
+ _context12.next = 3;
760
+ return _regeneratorRuntime.awrap(this.BlockNumber());
761
+
762
+ case 3:
763
+ latestBlock = _context12.sent;
845
764
 
846
- if (toBlock > latestBlock) {
765
+ if (!toBlock) {
766
+ if (!fromBlock) {
847
767
  toBlock = latestBlock;
768
+ fromBlock = toBlock - count + 1;
769
+ } else {
770
+ toBlock = fromBlock + count - 1;
848
771
  }
772
+ } else if (!fromBlock) {
773
+ fromBlock = toBlock - count + 1;
774
+ } // Ensure block numbers are valid
849
775
 
850
- if (fromBlock < 0) {
851
- fromBlock = 0;
852
- }
853
776
 
854
- return _context12.abrupt("return", {
855
- fromBlock: fromBlock,
856
- toBlock: toBlock
857
- });
777
+ if (toBlock > latestBlock) {
778
+ toBlock = latestBlock;
779
+ }
858
780
 
859
- case 8:
860
- case "end":
861
- return _context12.stop();
862
- }
863
- }
864
- }, _callee12, this);
865
- }));
781
+ if (fromBlock < 0) {
782
+ fromBlock = 0;
783
+ }
866
784
 
867
- return function (_x12) {
868
- return _ref27.apply(this, arguments);
869
- };
870
- }();
785
+ return _context12.abrupt("return", {
786
+ fromBlock: fromBlock,
787
+ toBlock: toBlock
788
+ });
789
+
790
+ case 8:
791
+ case "end":
792
+ return _context12.stop();
793
+ }
794
+ }
795
+ }, null, this);
796
+ };
871
797
  /**
872
798
  * Get events from the blockchain in reverse chronological order, starting from toBlock. This will also attempt
873
799
  * to identify and parse any known Eluvio contract methods. If successful, the method name, signature, and input
@@ -884,38 +810,38 @@ exports.FormatBlockNumbers = /*#__PURE__*/function () {
884
810
  */
885
811
 
886
812
 
887
- exports.Events = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
888
- var _ref29,
813
+ exports.Events = function _callee13() {
814
+ var _ref16,
889
815
  toBlock,
890
816
  fromBlock,
891
- _ref29$count,
817
+ _ref16$count,
892
818
  count,
893
- _ref29$includeTransac,
819
+ _ref16$includeTransac,
894
820
  includeTransaction,
895
821
  blocks,
896
822
  _args13 = arguments;
897
823
 
898
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
824
+ return _regeneratorRuntime.async(function _callee13$(_context13) {
899
825
  while (1) {
900
826
  switch (_context13.prev = _context13.next) {
901
827
  case 0:
902
- _ref29 = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {}, toBlock = _ref29.toBlock, fromBlock = _ref29.fromBlock, _ref29$count = _ref29.count, count = _ref29$count === void 0 ? 10 : _ref29$count, _ref29$includeTransac = _ref29.includeTransaction, includeTransaction = _ref29$includeTransac === void 0 ? false : _ref29$includeTransac;
828
+ _ref16 = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {}, toBlock = _ref16.toBlock, fromBlock = _ref16.fromBlock, _ref16$count = _ref16.count, count = _ref16$count === void 0 ? 10 : _ref16$count, _ref16$includeTransac = _ref16.includeTransaction, includeTransaction = _ref16$includeTransac === void 0 ? false : _ref16$includeTransac;
903
829
  _context13.next = 3;
904
- return this.FormatBlockNumbers({
830
+ return _regeneratorRuntime.awrap(this.FormatBlockNumbers({
905
831
  fromBlock: fromBlock,
906
832
  toBlock: toBlock,
907
833
  count: count
908
- });
834
+ }));
909
835
 
910
836
  case 3:
911
837
  blocks = _context13.sent;
912
838
  this.Log("Querying events - Blocks ".concat(blocks.fromBlock, " to ").concat(blocks.toBlock));
913
839
  _context13.next = 7;
914
- return this.ethClient.Events({
840
+ return _regeneratorRuntime.awrap(this.ethClient.Events({
915
841
  fromBlock: blocks.fromBlock,
916
842
  toBlock: blocks.toBlock,
917
843
  includeTransaction: includeTransaction
918
- });
844
+ }));
919
845
 
920
846
  case 7:
921
847
  return _context13.abrupt("return", _context13.sent);
@@ -925,8 +851,8 @@ exports.Events = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
925
851
  return _context13.stop();
926
852
  }
927
853
  }
928
- }, _callee13, this);
929
- }));
854
+ }, null, this);
855
+ };
930
856
  /**
931
857
  * Retrieve the latest block number on the blockchain
932
858
  *
@@ -935,15 +861,16 @@ exports.Events = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
935
861
  * @returns {Promise<number>} - The latest block number
936
862
  */
937
863
 
938
- exports.BlockNumber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
939
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
864
+
865
+ exports.BlockNumber = function _callee14() {
866
+ return _regeneratorRuntime.async(function _callee14$(_context14) {
940
867
  while (1) {
941
868
  switch (_context14.prev = _context14.next) {
942
869
  case 0:
943
870
  _context14.next = 2;
944
- return this.ethClient.MakeProviderCall({
871
+ return _regeneratorRuntime.awrap(this.ethClient.MakeProviderCall({
945
872
  methodName: "getBlockNumber"
946
- });
873
+ }));
947
874
 
948
875
  case 2:
949
876
  return _context14.abrupt("return", _context14.sent);
@@ -953,8 +880,8 @@ exports.BlockNumber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorR
953
880
  return _context14.stop();
954
881
  }
955
882
  }
956
- }, _callee14, this);
957
- }));
883
+ }, null, this);
884
+ };
958
885
  /**
959
886
  * Get the balance (in ether) of the specified address
960
887
  *
@@ -965,37 +892,32 @@ exports.BlockNumber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorR
965
892
  * @returns {Promise<string>} - Balance of the account, in ether (as string)
966
893
  */
967
894
 
968
- exports.GetBalance = /*#__PURE__*/function () {
969
- var _ref32 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref31) {
970
- var address, balance;
971
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
972
- while (1) {
973
- switch (_context15.prev = _context15.next) {
974
- case 0:
975
- address = _ref31.address;
976
- address = ValidateAddress(address);
977
- _context15.next = 4;
978
- return this.ethClient.MakeProviderCall({
979
- methodName: "getBalance",
980
- args: [address]
981
- });
982
-
983
- case 4:
984
- balance = _context15.sent;
985
- return _context15.abrupt("return", Ethers.utils.formatEther(balance));
986
-
987
- case 6:
988
- case "end":
989
- return _context15.stop();
990
- }
991
- }
992
- }, _callee15, this);
993
- }));
994
895
 
995
- return function (_x13) {
996
- return _ref32.apply(this, arguments);
997
- };
998
- }();
896
+ exports.GetBalance = function _callee15(_ref17) {
897
+ var address, balance;
898
+ return _regeneratorRuntime.async(function _callee15$(_context15) {
899
+ while (1) {
900
+ switch (_context15.prev = _context15.next) {
901
+ case 0:
902
+ address = _ref17.address;
903
+ address = ValidateAddress(address);
904
+ _context15.next = 4;
905
+ return _regeneratorRuntime.awrap(this.ethClient.MakeProviderCall({
906
+ methodName: "getBalance",
907
+ args: [address]
908
+ }));
909
+
910
+ case 4:
911
+ balance = _context15.sent;
912
+ return _context15.abrupt("return", Ethers.utils.formatEther(balance));
913
+
914
+ case 6:
915
+ case "end":
916
+ return _context15.stop();
917
+ }
918
+ }
919
+ }, null, this);
920
+ };
999
921
  /**
1000
922
  * Send ether from this client's current signer to the specified recipient address
1001
923
  *
@@ -1008,38 +930,32 @@ exports.GetBalance = /*#__PURE__*/function () {
1008
930
  */
1009
931
 
1010
932
 
1011
- exports.SendFunds = /*#__PURE__*/function () {
1012
- var _ref34 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref33) {
1013
- var recipient, ether, transaction;
1014
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
1015
- while (1) {
1016
- switch (_context16.prev = _context16.next) {
1017
- case 0:
1018
- recipient = _ref33.recipient, ether = _ref33.ether;
1019
- recipient = ValidateAddress(recipient);
1020
- _context16.next = 4;
1021
- return this.signer.sendTransaction({
1022
- to: recipient,
1023
- value: Ethers.utils.parseEther(ether.toString())
1024
- });
1025
-
1026
- case 4:
1027
- transaction = _context16.sent;
1028
- _context16.next = 7;
1029
- return transaction.wait();
1030
-
1031
- case 7:
1032
- return _context16.abrupt("return", _context16.sent);
1033
-
1034
- case 8:
1035
- case "end":
1036
- return _context16.stop();
1037
- }
1038
- }
1039
- }, _callee16, this);
1040
- }));
933
+ exports.SendFunds = function _callee16(_ref18) {
934
+ var recipient, ether, transaction;
935
+ return _regeneratorRuntime.async(function _callee16$(_context16) {
936
+ while (1) {
937
+ switch (_context16.prev = _context16.next) {
938
+ case 0:
939
+ recipient = _ref18.recipient, ether = _ref18.ether;
940
+ recipient = ValidateAddress(recipient);
941
+ _context16.next = 4;
942
+ return _regeneratorRuntime.awrap(this.signer.sendTransaction({
943
+ to: recipient,
944
+ value: Ethers.utils.parseEther(ether.toString())
945
+ }));
946
+
947
+ case 4:
948
+ transaction = _context16.sent;
949
+ _context16.next = 7;
950
+ return _regeneratorRuntime.awrap(transaction.wait());
951
+
952
+ case 7:
953
+ return _context16.abrupt("return", _context16.sent);
1041
954
 
1042
- return function (_x14) {
1043
- return _ref34.apply(this, arguments);
1044
- };
1045
- }();
955
+ case 8:
956
+ case "end":
957
+ return _context16.stop();
958
+ }
959
+ }
960
+ }, null, this);
961
+ };