@eluvio/elv-client-js 4.0.70 → 4.0.72
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 +10 -10
- package/dist/ElvClient-node-min.js +10 -10
- package/dist/ElvFrameClient-min.js +9 -9
- package/dist/ElvPermissionsClient-min.js +10 -10
- package/dist/ElvWalletClient-min.js +10 -10
- package/dist/ElvWalletClient-node-min.js +10 -10
- package/dist/src/AuthorizationClient.js +18 -12
- package/dist/src/Crypto.js +2 -2
- package/dist/src/ElvClient.js +111 -76
- package/dist/src/EthClient.js +2 -2
- package/dist/src/FrameClient.js +4 -4
- package/dist/src/PermissionsClient.js +2 -2
- package/dist/src/Utils.js +6 -5
- package/dist/src/client/ABRPublishing.js +2 -2
- package/dist/src/client/AccessGroups.js +18 -20
- package/dist/src/client/ContentAccess.js +2 -2
- package/dist/src/client/ContentManagement.js +3 -3
- package/dist/src/client/Contracts.js +235 -203
- package/dist/src/client/Files.js +2 -2
- package/dist/src/client/NFT.js +2 -2
- package/dist/src/contracts/v3b/BaseAccessControlGroup.js +1704 -0
- package/dist/src/walletClient/ClientMethods.js +2 -2
- package/dist/src/walletClient/Profile.js +2 -2
- package/dist/src/walletClient/Utils.js +7 -3
- package/dist/src/walletClient/index.js +116 -41
- package/package.json +1 -1
- package/src/AuthorizationClient.js +8 -1
- package/src/Utils.js +1 -1
- package/src/client/AccessGroups.js +8 -8
- package/src/contracts/v3b/BaseAccessControlGroup.js +1 -0
|
@@ -2,8 +2,8 @@ var _defineProperty = require("@babel/runtime/helpers/defineProperty");
|
|
|
2
2
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
3
3
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
4
4
|
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
/**
|
|
8
8
|
* Methods for deploying and interacting with contracts
|
|
9
9
|
*
|
|
@@ -95,6 +95,38 @@ exports.ContractAbi = /*#__PURE__*/function () {
|
|
|
95
95
|
};
|
|
96
96
|
}();
|
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Retrieve the ABI, access type, and whether V3 is used for a given contract via its address or a Fabric ID.
|
|
100
|
+
*
|
|
101
|
+
* @methodGroup Contracts
|
|
102
|
+
* @namedParams
|
|
103
|
+
* @param {string=} id - The Fabric ID of the contract
|
|
104
|
+
* @param {string=} address - The address of the contract
|
|
105
|
+
*
|
|
106
|
+
* @return {Promise<Object>} - The ABI, access type, and isV3 for the given contract
|
|
107
|
+
*/
|
|
108
|
+
exports.ContractInfo = /*#__PURE__*/function () {
|
|
109
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref5) {
|
|
110
|
+
var id, address;
|
|
111
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
112
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
id = _ref5.id, address = _ref5.address;
|
|
115
|
+
return _context3.abrupt("return", this.authClient.ContractInfo({
|
|
116
|
+
id: id,
|
|
117
|
+
address: address
|
|
118
|
+
}));
|
|
119
|
+
case 2:
|
|
120
|
+
case "end":
|
|
121
|
+
return _context3.stop();
|
|
122
|
+
}
|
|
123
|
+
}, _callee3, this);
|
|
124
|
+
}));
|
|
125
|
+
return function (_x3) {
|
|
126
|
+
return _ref6.apply(this, arguments);
|
|
127
|
+
};
|
|
128
|
+
}();
|
|
129
|
+
|
|
98
130
|
/**
|
|
99
131
|
* Format the arguments to be used for the specified method of the contract
|
|
100
132
|
*
|
|
@@ -106,10 +138,10 @@ exports.ContractAbi = /*#__PURE__*/function () {
|
|
|
106
138
|
*
|
|
107
139
|
* @returns {Array<string>} - List of formatted arguments
|
|
108
140
|
*/
|
|
109
|
-
exports.FormatContractArguments = function (
|
|
110
|
-
var abi =
|
|
111
|
-
methodName =
|
|
112
|
-
args =
|
|
141
|
+
exports.FormatContractArguments = function (_ref7) {
|
|
142
|
+
var abi = _ref7.abi,
|
|
143
|
+
methodName = _ref7.methodName,
|
|
144
|
+
args = _ref7.args;
|
|
113
145
|
return this.ethClient.FormatContractArguments({
|
|
114
146
|
abi: abi,
|
|
115
147
|
methodName: methodName,
|
|
@@ -130,13 +162,13 @@ exports.FormatContractArguments = function (_ref5) {
|
|
|
130
162
|
* @returns {Promise<Object>} - Response containing the deployed contract address and the transaction hash of the deployment
|
|
131
163
|
*/
|
|
132
164
|
exports.DeployContract = /*#__PURE__*/function () {
|
|
133
|
-
var
|
|
134
|
-
var abi, bytecode, constructorArgs,
|
|
135
|
-
return _regeneratorRuntime.wrap(function
|
|
136
|
-
while (1) switch (
|
|
165
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref8) {
|
|
166
|
+
var abi, bytecode, constructorArgs, _ref8$overrides, overrides;
|
|
167
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
168
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
137
169
|
case 0:
|
|
138
|
-
abi =
|
|
139
|
-
|
|
170
|
+
abi = _ref8.abi, bytecode = _ref8.bytecode, constructorArgs = _ref8.constructorArgs, _ref8$overrides = _ref8.overrides, overrides = _ref8$overrides === void 0 ? {} : _ref8$overrides;
|
|
171
|
+
_context4.next = 3;
|
|
140
172
|
return this.ethClient.DeployContract({
|
|
141
173
|
abi: abi,
|
|
142
174
|
bytecode: bytecode,
|
|
@@ -145,15 +177,15 @@ exports.DeployContract = /*#__PURE__*/function () {
|
|
|
145
177
|
signer: this.signer
|
|
146
178
|
});
|
|
147
179
|
case 3:
|
|
148
|
-
return
|
|
180
|
+
return _context4.abrupt("return", _context4.sent);
|
|
149
181
|
case 4:
|
|
150
182
|
case "end":
|
|
151
|
-
return
|
|
183
|
+
return _context4.stop();
|
|
152
184
|
}
|
|
153
|
-
},
|
|
185
|
+
}, _callee4, this);
|
|
154
186
|
}));
|
|
155
|
-
return function (
|
|
156
|
-
return
|
|
187
|
+
return function (_x4) {
|
|
188
|
+
return _ref9.apply(this, arguments);
|
|
157
189
|
};
|
|
158
190
|
}();
|
|
159
191
|
|
|
@@ -172,34 +204,34 @@ exports.DeployContract = /*#__PURE__*/function () {
|
|
|
172
204
|
* @returns {Promise<Array<Array<Object>>>} - List of blocks, in ascending order by block number, each containing a list of the events in the block.
|
|
173
205
|
*/
|
|
174
206
|
exports.ContractEvents = /*#__PURE__*/function () {
|
|
175
|
-
var
|
|
176
|
-
var contractAddress, abi,
|
|
177
|
-
return _regeneratorRuntime.wrap(function
|
|
178
|
-
while (1) switch (
|
|
207
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref10) {
|
|
208
|
+
var contractAddress, abi, _ref10$fromBlock, fromBlock, toBlock, _ref10$count, count, topics, _ref10$includeTransac, includeTransaction, blocks;
|
|
209
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
210
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
179
211
|
case 0:
|
|
180
|
-
contractAddress =
|
|
212
|
+
contractAddress = _ref10.contractAddress, abi = _ref10.abi, _ref10$fromBlock = _ref10.fromBlock, fromBlock = _ref10$fromBlock === void 0 ? 0 : _ref10$fromBlock, toBlock = _ref10.toBlock, _ref10$count = _ref10.count, count = _ref10$count === void 0 ? 1000 : _ref10$count, topics = _ref10.topics, _ref10$includeTransac = _ref10.includeTransaction, includeTransaction = _ref10$includeTransac === void 0 ? false : _ref10$includeTransac;
|
|
181
213
|
contractAddress = ValidateAddress(contractAddress);
|
|
182
214
|
if (abi) {
|
|
183
|
-
|
|
215
|
+
_context5.next = 6;
|
|
184
216
|
break;
|
|
185
217
|
}
|
|
186
|
-
|
|
218
|
+
_context5.next = 5;
|
|
187
219
|
return this.ContractAbi({
|
|
188
220
|
contractAddress: contractAddress
|
|
189
221
|
});
|
|
190
222
|
case 5:
|
|
191
|
-
abi =
|
|
223
|
+
abi = _context5.sent;
|
|
192
224
|
case 6:
|
|
193
|
-
|
|
225
|
+
_context5.next = 8;
|
|
194
226
|
return this.FormatBlockNumbers({
|
|
195
227
|
fromBlock: fromBlock,
|
|
196
228
|
toBlock: toBlock,
|
|
197
229
|
count: count
|
|
198
230
|
});
|
|
199
231
|
case 8:
|
|
200
|
-
blocks =
|
|
232
|
+
blocks = _context5.sent;
|
|
201
233
|
this.Log("Querying contract events ".concat(contractAddress, " - Blocks ").concat(blocks.fromBlock, " to ").concat(blocks.toBlock));
|
|
202
|
-
|
|
234
|
+
_context5.next = 12;
|
|
203
235
|
return this.ethClient.ContractEvents({
|
|
204
236
|
contractAddress: contractAddress,
|
|
205
237
|
abi: abi,
|
|
@@ -209,15 +241,15 @@ exports.ContractEvents = /*#__PURE__*/function () {
|
|
|
209
241
|
includeTransaction: includeTransaction
|
|
210
242
|
});
|
|
211
243
|
case 12:
|
|
212
|
-
return
|
|
244
|
+
return _context5.abrupt("return", _context5.sent);
|
|
213
245
|
case 13:
|
|
214
246
|
case "end":
|
|
215
|
-
return
|
|
247
|
+
return _context5.stop();
|
|
216
248
|
}
|
|
217
|
-
},
|
|
249
|
+
}, _callee5, this);
|
|
218
250
|
}));
|
|
219
|
-
return function (
|
|
220
|
-
return
|
|
251
|
+
return function (_x5) {
|
|
252
|
+
return _ref11.apply(this, arguments);
|
|
221
253
|
};
|
|
222
254
|
}();
|
|
223
255
|
|
|
@@ -240,12 +272,12 @@ exports.ContractEvents = /*#__PURE__*/function () {
|
|
|
240
272
|
* @returns {Promise<*>} - Response containing information about the transaction
|
|
241
273
|
*/
|
|
242
274
|
exports.CallContractMethod = /*#__PURE__*/function () {
|
|
243
|
-
var
|
|
244
|
-
var contractAddress, abi, methodName,
|
|
245
|
-
return _regeneratorRuntime.wrap(function
|
|
246
|
-
while (1) switch (
|
|
275
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref12) {
|
|
276
|
+
var contractAddress, abi, methodName, _ref12$methodArgs, methodArgs, value, _ref12$overrides, overrides, _ref12$formatArgument, formatArguments, _ref12$cacheContract, cacheContract, _ref12$overrideCached, overrideCachedContract;
|
|
277
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
278
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
247
279
|
case 0:
|
|
248
|
-
contractAddress =
|
|
280
|
+
contractAddress = _ref12.contractAddress, abi = _ref12.abi, methodName = _ref12.methodName, _ref12$methodArgs = _ref12.methodArgs, methodArgs = _ref12$methodArgs === void 0 ? [] : _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;
|
|
249
281
|
contractAddress = ValidateAddress(contractAddress);
|
|
250
282
|
|
|
251
283
|
// Delete cached visibility value if it is being changed
|
|
@@ -254,17 +286,17 @@ exports.CallContractMethod = /*#__PURE__*/function () {
|
|
|
254
286
|
delete this.visibilityInfo[contractAddress];
|
|
255
287
|
}
|
|
256
288
|
if (abi) {
|
|
257
|
-
|
|
289
|
+
_context6.next = 8;
|
|
258
290
|
break;
|
|
259
291
|
}
|
|
260
|
-
|
|
292
|
+
_context6.next = 7;
|
|
261
293
|
return this.ContractAbi({
|
|
262
294
|
contractAddress: contractAddress
|
|
263
295
|
});
|
|
264
296
|
case 7:
|
|
265
|
-
abi =
|
|
297
|
+
abi = _context6.sent;
|
|
266
298
|
case 8:
|
|
267
|
-
|
|
299
|
+
_context6.next = 10;
|
|
268
300
|
return this.ethClient.CallContractMethod({
|
|
269
301
|
contractAddress: contractAddress,
|
|
270
302
|
abi: abi,
|
|
@@ -277,15 +309,15 @@ exports.CallContractMethod = /*#__PURE__*/function () {
|
|
|
277
309
|
overrideCachedContract: overrideCachedContract
|
|
278
310
|
});
|
|
279
311
|
case 10:
|
|
280
|
-
return
|
|
312
|
+
return _context6.abrupt("return", _context6.sent);
|
|
281
313
|
case 11:
|
|
282
314
|
case "end":
|
|
283
|
-
return
|
|
315
|
+
return _context6.stop();
|
|
284
316
|
}
|
|
285
|
-
},
|
|
317
|
+
}, _callee6, this);
|
|
286
318
|
}));
|
|
287
|
-
return function (
|
|
288
|
-
return
|
|
319
|
+
return function (_x6) {
|
|
320
|
+
return _ref13.apply(this, arguments);
|
|
289
321
|
};
|
|
290
322
|
}();
|
|
291
323
|
|
|
@@ -311,12 +343,12 @@ exports.CallContractMethod = /*#__PURE__*/function () {
|
|
|
311
343
|
* the resulting event(s)
|
|
312
344
|
*/
|
|
313
345
|
exports.CallContractMethodAndWait = /*#__PURE__*/function () {
|
|
314
|
-
var
|
|
315
|
-
var contractAddress, abi, methodName, methodArgs, value,
|
|
316
|
-
return _regeneratorRuntime.wrap(function
|
|
317
|
-
while (1) switch (
|
|
346
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref14) {
|
|
347
|
+
var contractAddress, abi, methodName, methodArgs, value, _ref14$overrides, overrides, _ref14$formatArgument, formatArguments, _ref14$cacheContract, cacheContract, _ref14$overrideCached, overrideCachedContract;
|
|
348
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
349
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
318
350
|
case 0:
|
|
319
|
-
contractAddress =
|
|
351
|
+
contractAddress = _ref14.contractAddress, abi = _ref14.abi, methodName = _ref14.methodName, methodArgs = _ref14.methodArgs, value = _ref14.value, _ref14$overrides = _ref14.overrides, overrides = _ref14$overrides === void 0 ? {} : _ref14$overrides, _ref14$formatArgument = _ref14.formatArguments, formatArguments = _ref14$formatArgument === void 0 ? true : _ref14$formatArgument, _ref14$cacheContract = _ref14.cacheContract, cacheContract = _ref14$cacheContract === void 0 ? true : _ref14$cacheContract, _ref14$overrideCached = _ref14.overrideCachedContract, overrideCachedContract = _ref14$overrideCached === void 0 ? false : _ref14$overrideCached;
|
|
320
352
|
contractAddress = ValidateAddress(contractAddress);
|
|
321
353
|
|
|
322
354
|
// Delete cached visibility value if it is being changed
|
|
@@ -325,17 +357,17 @@ exports.CallContractMethodAndWait = /*#__PURE__*/function () {
|
|
|
325
357
|
delete this.visibilityInfo[contractAddress];
|
|
326
358
|
}
|
|
327
359
|
if (abi) {
|
|
328
|
-
|
|
360
|
+
_context7.next = 8;
|
|
329
361
|
break;
|
|
330
362
|
}
|
|
331
|
-
|
|
363
|
+
_context7.next = 7;
|
|
332
364
|
return this.ContractAbi({
|
|
333
365
|
contractAddress: contractAddress
|
|
334
366
|
});
|
|
335
367
|
case 7:
|
|
336
|
-
abi =
|
|
368
|
+
abi = _context7.sent;
|
|
337
369
|
case 8:
|
|
338
|
-
|
|
370
|
+
_context7.next = 10;
|
|
339
371
|
return this.ethClient.CallContractMethodAndWait({
|
|
340
372
|
contractAddress: contractAddress,
|
|
341
373
|
abi: abi,
|
|
@@ -348,15 +380,15 @@ exports.CallContractMethodAndWait = /*#__PURE__*/function () {
|
|
|
348
380
|
overrideCachedContract: overrideCachedContract
|
|
349
381
|
});
|
|
350
382
|
case 10:
|
|
351
|
-
return
|
|
383
|
+
return _context7.abrupt("return", _context7.sent);
|
|
352
384
|
case 11:
|
|
353
385
|
case "end":
|
|
354
|
-
return
|
|
386
|
+
return _context7.stop();
|
|
355
387
|
}
|
|
356
|
-
},
|
|
388
|
+
}, _callee7, this);
|
|
357
389
|
}));
|
|
358
|
-
return function (
|
|
359
|
-
return
|
|
390
|
+
return function (_x7) {
|
|
391
|
+
return _ref15.apply(this, arguments);
|
|
360
392
|
};
|
|
361
393
|
}();
|
|
362
394
|
|
|
@@ -371,45 +403,45 @@ exports.CallContractMethodAndWait = /*#__PURE__*/function () {
|
|
|
371
403
|
* @return {Promise<Object|string>}
|
|
372
404
|
*/
|
|
373
405
|
exports.ContractMetadata = /*#__PURE__*/function () {
|
|
374
|
-
var
|
|
406
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref16) {
|
|
375
407
|
var contractAddress, metadataKey, metadata, data;
|
|
376
|
-
return _regeneratorRuntime.wrap(function
|
|
377
|
-
while (1) switch (
|
|
408
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
409
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
378
410
|
case 0:
|
|
379
|
-
contractAddress =
|
|
411
|
+
contractAddress = _ref16.contractAddress, metadataKey = _ref16.metadataKey;
|
|
380
412
|
ValidatePresence("contractAddress", contractAddress);
|
|
381
413
|
ValidatePresence("metadataKey", metadataKey);
|
|
382
|
-
|
|
383
|
-
|
|
414
|
+
_context8.prev = 3;
|
|
415
|
+
_context8.next = 6;
|
|
384
416
|
return this.CallContractMethod({
|
|
385
417
|
contractAddress: contractAddress,
|
|
386
418
|
methodName: "getMeta",
|
|
387
419
|
methodArgs: [metadataKey]
|
|
388
420
|
});
|
|
389
421
|
case 6:
|
|
390
|
-
metadata =
|
|
422
|
+
metadata = _context8.sent;
|
|
391
423
|
data = Buffer.from((metadata || "").replace("0x", ""), "hex").toString("utf-8");
|
|
392
|
-
|
|
393
|
-
return
|
|
424
|
+
_context8.prev = 8;
|
|
425
|
+
return _context8.abrupt("return", JSON.parse(data));
|
|
394
426
|
case 12:
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
return
|
|
427
|
+
_context8.prev = 12;
|
|
428
|
+
_context8.t0 = _context8["catch"](8);
|
|
429
|
+
return _context8.abrupt("return", data);
|
|
398
430
|
case 15:
|
|
399
|
-
|
|
431
|
+
_context8.next = 20;
|
|
400
432
|
break;
|
|
401
433
|
case 17:
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
return
|
|
434
|
+
_context8.prev = 17;
|
|
435
|
+
_context8.t1 = _context8["catch"](3);
|
|
436
|
+
return _context8.abrupt("return", "");
|
|
405
437
|
case 20:
|
|
406
438
|
case "end":
|
|
407
|
-
return
|
|
439
|
+
return _context8.stop();
|
|
408
440
|
}
|
|
409
|
-
},
|
|
441
|
+
}, _callee8, this, [[3, 17], [8, 12]]);
|
|
410
442
|
}));
|
|
411
|
-
return function (
|
|
412
|
-
return
|
|
443
|
+
return function (_x8) {
|
|
444
|
+
return _ref17.apply(this, arguments);
|
|
413
445
|
};
|
|
414
446
|
}();
|
|
415
447
|
|
|
@@ -423,32 +455,32 @@ exports.ContractMetadata = /*#__PURE__*/function () {
|
|
|
423
455
|
* @param {string} metadata
|
|
424
456
|
*/
|
|
425
457
|
exports.MergeContractMetadata = /*#__PURE__*/function () {
|
|
426
|
-
var
|
|
458
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref18) {
|
|
427
459
|
var contractAddress, metadataKey, metadata, existingMetadata;
|
|
428
|
-
return _regeneratorRuntime.wrap(function
|
|
429
|
-
while (1) switch (
|
|
460
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
461
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
430
462
|
case 0:
|
|
431
|
-
contractAddress =
|
|
463
|
+
contractAddress = _ref18.contractAddress, metadataKey = _ref18.metadataKey, metadata = _ref18.metadata;
|
|
432
464
|
ValidatePresence("contractAddress", contractAddress);
|
|
433
465
|
ValidatePresence("metadataKey", metadataKey);
|
|
434
|
-
|
|
466
|
+
_context9.next = 5;
|
|
435
467
|
return this.ContractMetadata({
|
|
436
468
|
contractAddress: contractAddress,
|
|
437
469
|
metadataKey: metadataKey
|
|
438
470
|
});
|
|
439
471
|
case 5:
|
|
440
|
-
|
|
441
|
-
if (
|
|
442
|
-
|
|
472
|
+
_context9.t0 = _context9.sent;
|
|
473
|
+
if (_context9.t0) {
|
|
474
|
+
_context9.next = 8;
|
|
443
475
|
break;
|
|
444
476
|
}
|
|
445
|
-
|
|
477
|
+
_context9.t0 = {};
|
|
446
478
|
case 8:
|
|
447
|
-
existingMetadata =
|
|
479
|
+
existingMetadata = _context9.t0;
|
|
448
480
|
if (_typeof(existingMetadata) === "object") {
|
|
449
481
|
metadata = _objectSpread(_objectSpread({}, existingMetadata), metadata);
|
|
450
482
|
}
|
|
451
|
-
|
|
483
|
+
_context9.next = 12;
|
|
452
484
|
return this.CallContractMethodAndWait({
|
|
453
485
|
contractAddress: contractAddress,
|
|
454
486
|
methodName: "putMeta",
|
|
@@ -456,12 +488,12 @@ exports.MergeContractMetadata = /*#__PURE__*/function () {
|
|
|
456
488
|
});
|
|
457
489
|
case 12:
|
|
458
490
|
case "end":
|
|
459
|
-
return
|
|
491
|
+
return _context9.stop();
|
|
460
492
|
}
|
|
461
|
-
},
|
|
493
|
+
}, _callee9, this);
|
|
462
494
|
}));
|
|
463
|
-
return function (
|
|
464
|
-
return
|
|
495
|
+
return function (_x9) {
|
|
496
|
+
return _ref19.apply(this, arguments);
|
|
465
497
|
};
|
|
466
498
|
}();
|
|
467
499
|
|
|
@@ -475,15 +507,15 @@ exports.MergeContractMetadata = /*#__PURE__*/function () {
|
|
|
475
507
|
* @param {string|Object} metadata - The metadata to insert
|
|
476
508
|
*/
|
|
477
509
|
exports.ReplaceContractMetadata = /*#__PURE__*/function () {
|
|
478
|
-
var
|
|
510
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref20) {
|
|
479
511
|
var contractAddress, metadataKey, metadata;
|
|
480
|
-
return _regeneratorRuntime.wrap(function
|
|
481
|
-
while (1) switch (
|
|
512
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
513
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
482
514
|
case 0:
|
|
483
|
-
contractAddress =
|
|
515
|
+
contractAddress = _ref20.contractAddress, metadataKey = _ref20.metadataKey, metadata = _ref20.metadata;
|
|
484
516
|
ValidatePresence("contractAddress", contractAddress);
|
|
485
517
|
ValidatePresence("metadataKey", metadataKey);
|
|
486
|
-
|
|
518
|
+
_context10.next = 5;
|
|
487
519
|
return this.CallContractMethodAndWait({
|
|
488
520
|
contractAddress: contractAddress,
|
|
489
521
|
methodName: "putMeta",
|
|
@@ -491,12 +523,12 @@ exports.ReplaceContractMetadata = /*#__PURE__*/function () {
|
|
|
491
523
|
});
|
|
492
524
|
case 5:
|
|
493
525
|
case "end":
|
|
494
|
-
return
|
|
526
|
+
return _context10.stop();
|
|
495
527
|
}
|
|
496
|
-
},
|
|
528
|
+
}, _callee10, this);
|
|
497
529
|
}));
|
|
498
|
-
return function (
|
|
499
|
-
return
|
|
530
|
+
return function (_x10) {
|
|
531
|
+
return _ref21.apply(this, arguments);
|
|
500
532
|
};
|
|
501
533
|
}();
|
|
502
534
|
|
|
@@ -512,12 +544,12 @@ exports.ReplaceContractMetadata = /*#__PURE__*/function () {
|
|
|
512
544
|
* @returns {Promise<string> | undefined} - If the object has a custom contract, this will return the address of the custom contract
|
|
513
545
|
*/
|
|
514
546
|
exports.CustomContractAddress = /*#__PURE__*/function () {
|
|
515
|
-
var
|
|
547
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref22) {
|
|
516
548
|
var libraryId, objectId, versionHash, abi, customContractAddress;
|
|
517
|
-
return _regeneratorRuntime.wrap(function
|
|
518
|
-
while (1) switch (
|
|
549
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
550
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
519
551
|
case 0:
|
|
520
|
-
libraryId =
|
|
552
|
+
libraryId = _ref22.libraryId, objectId = _ref22.objectId, versionHash = _ref22.versionHash;
|
|
521
553
|
ValidateParameters({
|
|
522
554
|
libraryId: libraryId,
|
|
523
555
|
objectId: objectId,
|
|
@@ -527,19 +559,19 @@ exports.CustomContractAddress = /*#__PURE__*/function () {
|
|
|
527
559
|
objectId = this.utils.DecodeVersionHash(versionHash).objectId;
|
|
528
560
|
}
|
|
529
561
|
if (!(libraryId === this.contentSpaceLibraryId || this.utils.EqualHash(libraryId, objectId))) {
|
|
530
|
-
|
|
562
|
+
_context11.next = 5;
|
|
531
563
|
break;
|
|
532
564
|
}
|
|
533
|
-
return
|
|
565
|
+
return _context11.abrupt("return");
|
|
534
566
|
case 5:
|
|
535
567
|
this.Log("Retrieving custom contract address: ".concat(objectId));
|
|
536
|
-
|
|
568
|
+
_context11.next = 8;
|
|
537
569
|
return this.ContractAbi({
|
|
538
570
|
id: objectId
|
|
539
571
|
});
|
|
540
572
|
case 8:
|
|
541
|
-
abi =
|
|
542
|
-
|
|
573
|
+
abi = _context11.sent;
|
|
574
|
+
_context11.next = 11;
|
|
543
575
|
return this.ethClient.CallContractMethod({
|
|
544
576
|
contractAddress: this.utils.HashToAddress(objectId),
|
|
545
577
|
abi: abi,
|
|
@@ -547,22 +579,22 @@ exports.CustomContractAddress = /*#__PURE__*/function () {
|
|
|
547
579
|
methodArgs: []
|
|
548
580
|
});
|
|
549
581
|
case 11:
|
|
550
|
-
customContractAddress =
|
|
582
|
+
customContractAddress = _context11.sent;
|
|
551
583
|
if (!(customContractAddress === this.utils.nullAddress)) {
|
|
552
|
-
|
|
584
|
+
_context11.next = 14;
|
|
553
585
|
break;
|
|
554
586
|
}
|
|
555
|
-
return
|
|
587
|
+
return _context11.abrupt("return");
|
|
556
588
|
case 14:
|
|
557
|
-
return
|
|
589
|
+
return _context11.abrupt("return", this.utils.FormatAddress(customContractAddress));
|
|
558
590
|
case 15:
|
|
559
591
|
case "end":
|
|
560
|
-
return
|
|
592
|
+
return _context11.stop();
|
|
561
593
|
}
|
|
562
|
-
},
|
|
594
|
+
}, _callee11, this);
|
|
563
595
|
}));
|
|
564
|
-
return function (
|
|
565
|
-
return
|
|
596
|
+
return function (_x11) {
|
|
597
|
+
return _ref23.apply(this, arguments);
|
|
566
598
|
};
|
|
567
599
|
}();
|
|
568
600
|
|
|
@@ -585,12 +617,12 @@ exports.CustomContractAddress = /*#__PURE__*/function () {
|
|
|
585
617
|
* @returns {Promise<Object>} - Result transaction of calling the setCustomContract method on the content object contract
|
|
586
618
|
*/
|
|
587
619
|
exports.SetCustomContentContract = /*#__PURE__*/function () {
|
|
588
|
-
var
|
|
589
|
-
var libraryId, objectId, customContractAddress, name, description, abi, factoryAbi,
|
|
590
|
-
return _regeneratorRuntime.wrap(function
|
|
591
|
-
while (1) switch (
|
|
620
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref24) {
|
|
621
|
+
var libraryId, objectId, customContractAddress, name, description, abi, factoryAbi, _ref24$overrides, overrides, setResult, writeToken;
|
|
622
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
623
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
592
624
|
case 0:
|
|
593
|
-
libraryId =
|
|
625
|
+
libraryId = _ref24.libraryId, objectId = _ref24.objectId, customContractAddress = _ref24.customContractAddress, name = _ref24.name, description = _ref24.description, abi = _ref24.abi, factoryAbi = _ref24.factoryAbi, _ref24$overrides = _ref24.overrides, overrides = _ref24$overrides === void 0 ? {} : _ref24$overrides;
|
|
594
626
|
ValidateParameters({
|
|
595
627
|
libraryId: libraryId,
|
|
596
628
|
objectId: objectId
|
|
@@ -598,7 +630,7 @@ exports.SetCustomContentContract = /*#__PURE__*/function () {
|
|
|
598
630
|
customContractAddress = ValidateAddress(customContractAddress);
|
|
599
631
|
customContractAddress = this.utils.FormatAddress(customContractAddress);
|
|
600
632
|
this.Log("Setting custom contract address: ".concat(objectId, " ").concat(customContractAddress));
|
|
601
|
-
|
|
633
|
+
_context12.next = 7;
|
|
602
634
|
return this.ethClient.SetCustomContentContract({
|
|
603
635
|
contentContractAddress: this.utils.HashToAddress(objectId),
|
|
604
636
|
customContractAddress: customContractAddress,
|
|
@@ -606,15 +638,15 @@ exports.SetCustomContentContract = /*#__PURE__*/function () {
|
|
|
606
638
|
signer: this.signer
|
|
607
639
|
});
|
|
608
640
|
case 7:
|
|
609
|
-
setResult =
|
|
610
|
-
|
|
641
|
+
setResult = _context12.sent;
|
|
642
|
+
_context12.next = 10;
|
|
611
643
|
return this.EditContentObject({
|
|
612
644
|
libraryId: libraryId,
|
|
613
645
|
objectId: objectId
|
|
614
646
|
});
|
|
615
647
|
case 10:
|
|
616
|
-
writeToken =
|
|
617
|
-
|
|
648
|
+
writeToken = _context12.sent.write_token;
|
|
649
|
+
_context12.next = 13;
|
|
618
650
|
return this.ReplaceMetadata({
|
|
619
651
|
libraryId: libraryId,
|
|
620
652
|
objectId: objectId,
|
|
@@ -629,7 +661,7 @@ exports.SetCustomContentContract = /*#__PURE__*/function () {
|
|
|
629
661
|
}
|
|
630
662
|
});
|
|
631
663
|
case 13:
|
|
632
|
-
|
|
664
|
+
_context12.next = 15;
|
|
633
665
|
return this.FinalizeContentObject({
|
|
634
666
|
libraryId: libraryId,
|
|
635
667
|
objectId: objectId,
|
|
@@ -637,15 +669,15 @@ exports.SetCustomContentContract = /*#__PURE__*/function () {
|
|
|
637
669
|
commitMessage: "Set custom contract"
|
|
638
670
|
});
|
|
639
671
|
case 15:
|
|
640
|
-
return
|
|
672
|
+
return _context12.abrupt("return", setResult);
|
|
641
673
|
case 16:
|
|
642
674
|
case "end":
|
|
643
|
-
return
|
|
675
|
+
return _context12.stop();
|
|
644
676
|
}
|
|
645
|
-
},
|
|
677
|
+
}, _callee12, this);
|
|
646
678
|
}));
|
|
647
|
-
return function (
|
|
648
|
-
return
|
|
679
|
+
return function (_x12) {
|
|
680
|
+
return _ref25.apply(this, arguments);
|
|
649
681
|
};
|
|
650
682
|
}();
|
|
651
683
|
|
|
@@ -664,10 +696,10 @@ exports.SetCustomContentContract = /*#__PURE__*/function () {
|
|
|
664
696
|
*
|
|
665
697
|
* @returns {Promise<Object>} - The parsed event log from the event
|
|
666
698
|
*/
|
|
667
|
-
exports.ExtractEventFromLogs = function (
|
|
668
|
-
var abi =
|
|
669
|
-
event =
|
|
670
|
-
eventName =
|
|
699
|
+
exports.ExtractEventFromLogs = function (_ref26) {
|
|
700
|
+
var abi = _ref26.abi,
|
|
701
|
+
event = _ref26.event,
|
|
702
|
+
eventName = _ref26.eventName;
|
|
671
703
|
return this.ethClient.ExtractEventFromLogs({
|
|
672
704
|
abi: abi,
|
|
673
705
|
event: event,
|
|
@@ -689,11 +721,11 @@ exports.ExtractEventFromLogs = function (_ref24) {
|
|
|
689
721
|
*
|
|
690
722
|
* @returns {Promise<string>} The value extracted from the event
|
|
691
723
|
*/
|
|
692
|
-
exports.ExtractValueFromEvent = function (
|
|
693
|
-
var abi =
|
|
694
|
-
event =
|
|
695
|
-
eventName =
|
|
696
|
-
eventValue =
|
|
724
|
+
exports.ExtractValueFromEvent = function (_ref27) {
|
|
725
|
+
var abi = _ref27.abi,
|
|
726
|
+
event = _ref27.event,
|
|
727
|
+
eventName = _ref27.eventName,
|
|
728
|
+
eventValue = _ref27.eventValue;
|
|
697
729
|
var eventLog = this.ethClient.ExtractEventFromLogs({
|
|
698
730
|
abi: abi,
|
|
699
731
|
event: event,
|
|
@@ -703,16 +735,16 @@ exports.ExtractValueFromEvent = function (_ref25) {
|
|
|
703
735
|
return eventLog ? eventLog.args[eventValue] : undefined;
|
|
704
736
|
};
|
|
705
737
|
exports.FormatBlockNumbers = /*#__PURE__*/function () {
|
|
706
|
-
var
|
|
707
|
-
var fromBlock, toBlock,
|
|
708
|
-
return _regeneratorRuntime.wrap(function
|
|
709
|
-
while (1) switch (
|
|
738
|
+
var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref28) {
|
|
739
|
+
var fromBlock, toBlock, _ref28$count, count, latestBlock;
|
|
740
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
741
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
710
742
|
case 0:
|
|
711
|
-
fromBlock =
|
|
712
|
-
|
|
743
|
+
fromBlock = _ref28.fromBlock, toBlock = _ref28.toBlock, _ref28$count = _ref28.count, count = _ref28$count === void 0 ? 10 : _ref28$count;
|
|
744
|
+
_context13.next = 3;
|
|
713
745
|
return this.BlockNumber();
|
|
714
746
|
case 3:
|
|
715
|
-
latestBlock =
|
|
747
|
+
latestBlock = _context13.sent;
|
|
716
748
|
if (!toBlock) {
|
|
717
749
|
if (!fromBlock) {
|
|
718
750
|
toBlock = latestBlock;
|
|
@@ -731,18 +763,18 @@ exports.FormatBlockNumbers = /*#__PURE__*/function () {
|
|
|
731
763
|
if (fromBlock < 0) {
|
|
732
764
|
fromBlock = 0;
|
|
733
765
|
}
|
|
734
|
-
return
|
|
766
|
+
return _context13.abrupt("return", {
|
|
735
767
|
fromBlock: fromBlock,
|
|
736
768
|
toBlock: toBlock
|
|
737
769
|
});
|
|
738
770
|
case 8:
|
|
739
771
|
case "end":
|
|
740
|
-
return
|
|
772
|
+
return _context13.stop();
|
|
741
773
|
}
|
|
742
|
-
},
|
|
774
|
+
}, _callee13, this);
|
|
743
775
|
}));
|
|
744
|
-
return function (
|
|
745
|
-
return
|
|
776
|
+
return function (_x13) {
|
|
777
|
+
return _ref29.apply(this, arguments);
|
|
746
778
|
};
|
|
747
779
|
}();
|
|
748
780
|
|
|
@@ -760,42 +792,42 @@ exports.FormatBlockNumbers = /*#__PURE__*/function () {
|
|
|
760
792
|
* Note: This requires two extra network calls per transaction, so it should not be used for very large ranges
|
|
761
793
|
* @returns {Promise<Array<Array<Object>>>} - List of blocks, in ascending order by block number, each containing a list of the events in the block.
|
|
762
794
|
*/
|
|
763
|
-
exports.Events = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
764
|
-
var
|
|
795
|
+
exports.Events = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
796
|
+
var _ref31,
|
|
765
797
|
toBlock,
|
|
766
798
|
fromBlock,
|
|
767
|
-
|
|
799
|
+
_ref31$count,
|
|
768
800
|
count,
|
|
769
|
-
|
|
801
|
+
_ref31$includeTransac,
|
|
770
802
|
includeTransaction,
|
|
771
803
|
blocks,
|
|
772
|
-
|
|
773
|
-
return _regeneratorRuntime.wrap(function
|
|
774
|
-
while (1) switch (
|
|
804
|
+
_args14 = arguments;
|
|
805
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
806
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
775
807
|
case 0:
|
|
776
|
-
|
|
777
|
-
|
|
808
|
+
_ref31 = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {}, toBlock = _ref31.toBlock, fromBlock = _ref31.fromBlock, _ref31$count = _ref31.count, count = _ref31$count === void 0 ? 10 : _ref31$count, _ref31$includeTransac = _ref31.includeTransaction, includeTransaction = _ref31$includeTransac === void 0 ? false : _ref31$includeTransac;
|
|
809
|
+
_context14.next = 3;
|
|
778
810
|
return this.FormatBlockNumbers({
|
|
779
811
|
fromBlock: fromBlock,
|
|
780
812
|
toBlock: toBlock,
|
|
781
813
|
count: count
|
|
782
814
|
});
|
|
783
815
|
case 3:
|
|
784
|
-
blocks =
|
|
816
|
+
blocks = _context14.sent;
|
|
785
817
|
this.Log("Querying events - Blocks ".concat(blocks.fromBlock, " to ").concat(blocks.toBlock));
|
|
786
|
-
|
|
818
|
+
_context14.next = 7;
|
|
787
819
|
return this.ethClient.Events({
|
|
788
820
|
fromBlock: blocks.fromBlock,
|
|
789
821
|
toBlock: blocks.toBlock,
|
|
790
822
|
includeTransaction: includeTransaction
|
|
791
823
|
});
|
|
792
824
|
case 7:
|
|
793
|
-
return
|
|
825
|
+
return _context14.abrupt("return", _context14.sent);
|
|
794
826
|
case 8:
|
|
795
827
|
case "end":
|
|
796
|
-
return
|
|
828
|
+
return _context14.stop();
|
|
797
829
|
}
|
|
798
|
-
},
|
|
830
|
+
}, _callee14, this);
|
|
799
831
|
}));
|
|
800
832
|
|
|
801
833
|
/**
|
|
@@ -805,21 +837,21 @@ exports.Events = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntim
|
|
|
805
837
|
*
|
|
806
838
|
* @returns {Promise<number>} - The latest block number
|
|
807
839
|
*/
|
|
808
|
-
exports.BlockNumber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
809
|
-
return _regeneratorRuntime.wrap(function
|
|
810
|
-
while (1) switch (
|
|
840
|
+
exports.BlockNumber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
841
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
842
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
811
843
|
case 0:
|
|
812
|
-
|
|
844
|
+
_context15.next = 2;
|
|
813
845
|
return this.ethClient.MakeProviderCall({
|
|
814
846
|
methodName: "getBlockNumber"
|
|
815
847
|
});
|
|
816
848
|
case 2:
|
|
817
|
-
return
|
|
849
|
+
return _context15.abrupt("return", _context15.sent);
|
|
818
850
|
case 3:
|
|
819
851
|
case "end":
|
|
820
|
-
return
|
|
852
|
+
return _context15.stop();
|
|
821
853
|
}
|
|
822
|
-
},
|
|
854
|
+
}, _callee15, this);
|
|
823
855
|
}));
|
|
824
856
|
|
|
825
857
|
/**
|
|
@@ -832,29 +864,29 @@ exports.BlockNumber = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorR
|
|
|
832
864
|
* @returns {Promise<string>} - Balance of the account, in ether (as string)
|
|
833
865
|
*/
|
|
834
866
|
exports.GetBalance = /*#__PURE__*/function () {
|
|
835
|
-
var
|
|
867
|
+
var _ref34 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref33) {
|
|
836
868
|
var address, balance;
|
|
837
|
-
return _regeneratorRuntime.wrap(function
|
|
838
|
-
while (1) switch (
|
|
869
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
870
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
839
871
|
case 0:
|
|
840
|
-
address =
|
|
872
|
+
address = _ref33.address;
|
|
841
873
|
address = ValidateAddress(address);
|
|
842
|
-
|
|
874
|
+
_context16.next = 4;
|
|
843
875
|
return this.ethClient.MakeProviderCall({
|
|
844
876
|
methodName: "getBalance",
|
|
845
877
|
args: [address]
|
|
846
878
|
});
|
|
847
879
|
case 4:
|
|
848
|
-
balance =
|
|
849
|
-
return
|
|
880
|
+
balance = _context16.sent;
|
|
881
|
+
return _context16.abrupt("return", Ethers.utils.formatEther(balance));
|
|
850
882
|
case 6:
|
|
851
883
|
case "end":
|
|
852
|
-
return
|
|
884
|
+
return _context16.stop();
|
|
853
885
|
}
|
|
854
|
-
},
|
|
886
|
+
}, _callee16, this);
|
|
855
887
|
}));
|
|
856
|
-
return function (
|
|
857
|
-
return
|
|
888
|
+
return function (_x14) {
|
|
889
|
+
return _ref34.apply(this, arguments);
|
|
858
890
|
};
|
|
859
891
|
}();
|
|
860
892
|
|
|
@@ -869,31 +901,31 @@ exports.GetBalance = /*#__PURE__*/function () {
|
|
|
869
901
|
* @returns {Promise<Object>} - The transaction receipt
|
|
870
902
|
*/
|
|
871
903
|
exports.SendFunds = /*#__PURE__*/function () {
|
|
872
|
-
var
|
|
904
|
+
var _ref36 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref35) {
|
|
873
905
|
var recipient, ether, transaction;
|
|
874
|
-
return _regeneratorRuntime.wrap(function
|
|
875
|
-
while (1) switch (
|
|
906
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
907
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
876
908
|
case 0:
|
|
877
|
-
recipient =
|
|
909
|
+
recipient = _ref35.recipient, ether = _ref35.ether;
|
|
878
910
|
recipient = ValidateAddress(recipient);
|
|
879
|
-
|
|
911
|
+
_context17.next = 4;
|
|
880
912
|
return this.signer.sendTransaction({
|
|
881
913
|
to: recipient,
|
|
882
914
|
value: Ethers.utils.parseEther(ether.toString())
|
|
883
915
|
});
|
|
884
916
|
case 4:
|
|
885
|
-
transaction =
|
|
886
|
-
|
|
917
|
+
transaction = _context17.sent;
|
|
918
|
+
_context17.next = 7;
|
|
887
919
|
return transaction.wait();
|
|
888
920
|
case 7:
|
|
889
|
-
return
|
|
921
|
+
return _context17.abrupt("return", _context17.sent);
|
|
890
922
|
case 8:
|
|
891
923
|
case "end":
|
|
892
|
-
return
|
|
924
|
+
return _context17.stop();
|
|
893
925
|
}
|
|
894
|
-
},
|
|
926
|
+
}, _callee17, this);
|
|
895
927
|
}));
|
|
896
|
-
return function (
|
|
897
|
-
return
|
|
928
|
+
return function (_x15) {
|
|
929
|
+
return _ref36.apply(this, arguments);
|
|
898
930
|
};
|
|
899
931
|
}();
|