@eluvio/elv-client-js 3.2.2 → 3.2.6
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 +15 -11
- package/dist/ElvClient-node-min.js +17 -13
- package/dist/ElvFrameClient-min.js +12 -8
- package/dist/ElvPermissionsClient-min.js +13 -9
- package/dist/ElvWalletClient-min.js +58 -0
- package/dist/ElvWalletClient-node-min.js +78 -0
- package/dist/src/AuthorizationClient.js +2248 -1990
- package/dist/src/ContentObjectVerification.js +164 -173
- package/dist/src/Crypto.js +376 -324
- package/dist/src/ElvClient.js +1182 -1019
- package/dist/src/ElvWallet.js +119 -95
- package/dist/src/EthClient.js +1040 -896
- package/dist/src/FrameClient.js +331 -300
- package/dist/src/HttpClient.js +153 -147
- package/dist/src/Id.js +1 -3
- package/dist/src/PermissionsClient.js +1294 -1168
- package/dist/src/RemoteSigner.js +263 -211
- package/dist/src/UserProfileClient.js +1164 -1023
- package/dist/src/Utils.js +209 -181
- package/dist/src/client/ABRPublishing.js +895 -858
- package/dist/src/client/AccessGroups.js +1102 -959
- package/dist/src/client/ContentAccess.js +3724 -3431
- package/dist/src/client/ContentManagement.js +2252 -2068
- package/dist/src/client/Contracts.js +647 -563
- package/dist/src/client/Files.js +1886 -1757
- package/dist/src/client/NFT.js +126 -112
- package/dist/src/client/NTP.js +478 -422
- package/dist/src/walletClient/ClientMethods.js +1029 -879
- package/dist/src/walletClient/Utils.js +84 -70
- package/dist/src/walletClient/index.js +1203 -1087
- package/package.json +4 -2
- package/src/Utils.js +0 -1
- package/src/walletClient/ClientMethods.js +34 -2
- package/src/walletClient/index.js +3 -3
- package/utilities/ProductionMasterCreate.js +2 -2
package/dist/src/EthClient.js
CHANGED
|
@@ -6,13 +6,21 @@ var _toConsumableArray = require("@babel/runtime/helpers/toConsumableArray");
|
|
|
6
6
|
|
|
7
7
|
var _regeneratorRuntime = require("@babel/runtime/regenerator");
|
|
8
8
|
|
|
9
|
+
var _asyncToGenerator = require("@babel/runtime/helpers/asyncToGenerator");
|
|
10
|
+
|
|
9
11
|
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
|
10
12
|
|
|
11
13
|
var _createClass = require("@babel/runtime/helpers/createClass");
|
|
12
14
|
|
|
13
|
-
function
|
|
15
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
16
|
+
|
|
17
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
+
|
|
19
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
20
|
+
|
|
21
|
+
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; }
|
|
14
22
|
|
|
15
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
23
|
+
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; }
|
|
16
24
|
|
|
17
25
|
// NOTE: Querying Ethereum requires CORS enabled
|
|
18
26
|
// Use --rpccorsdomain "http[s]://hostname:port" or set up proxy
|
|
@@ -36,19 +44,9 @@ var _require = require("./LogMessage"),
|
|
|
36
44
|
|
|
37
45
|
var Topics = require("./events/Topics");
|
|
38
46
|
|
|
39
|
-
var EthClient =
|
|
40
|
-
/*#__PURE__*/
|
|
41
|
-
function () {
|
|
47
|
+
var EthClient = /*#__PURE__*/function () {
|
|
42
48
|
"use strict";
|
|
43
49
|
|
|
44
|
-
_createClass(EthClient, [{
|
|
45
|
-
key: "Log",
|
|
46
|
-
value: function Log(message) {
|
|
47
|
-
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
48
|
-
LogMessage(this, message, error);
|
|
49
|
-
}
|
|
50
|
-
}]);
|
|
51
|
-
|
|
52
50
|
function EthClient(_ref) {
|
|
53
51
|
var client = _ref.client,
|
|
54
52
|
uris = _ref.uris,
|
|
@@ -78,6 +76,12 @@ function () {
|
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
_createClass(EthClient, [{
|
|
79
|
+
key: "Log",
|
|
80
|
+
value: function Log(message) {
|
|
81
|
+
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
82
|
+
LogMessage(this, message, error);
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
81
85
|
key: "SetEthereumURIs",
|
|
82
86
|
value: function SetEthereumURIs(uris) {
|
|
83
87
|
this.ethereumURIs = uris;
|
|
@@ -95,8 +99,8 @@ function () {
|
|
|
95
99
|
// data every time a contract is initialized in the client (often). Ethers.js just checks that the code isn't == "0x", so
|
|
96
100
|
// we can give it some dummy string instead and assume the contract is fine
|
|
97
101
|
|
|
98
|
-
this.provider.getCode = function _callee() {
|
|
99
|
-
return _regeneratorRuntime.
|
|
102
|
+
this.provider.getCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
103
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
100
104
|
while (1) {
|
|
101
105
|
switch (_context.prev = _context.next) {
|
|
102
106
|
case 0:
|
|
@@ -107,9 +111,8 @@ function () {
|
|
|
107
111
|
return _context.stop();
|
|
108
112
|
}
|
|
109
113
|
}
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
|
|
114
|
+
}, _callee);
|
|
115
|
+
}));
|
|
113
116
|
this.provider.pollingInterval = 500;
|
|
114
117
|
}
|
|
115
118
|
|
|
@@ -117,89 +120,103 @@ function () {
|
|
|
117
120
|
}
|
|
118
121
|
}, {
|
|
119
122
|
key: "ContractName",
|
|
120
|
-
value: function
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
this.contractNames[contractAddress]
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
_context2.prev =
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
123
|
+
value: function () {
|
|
124
|
+
var _ContractName = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(contractAddress) {
|
|
125
|
+
var _this = this;
|
|
126
|
+
|
|
127
|
+
var full,
|
|
128
|
+
versionContract,
|
|
129
|
+
version,
|
|
130
|
+
_args3 = arguments;
|
|
131
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
132
|
+
while (1) {
|
|
133
|
+
switch (_context3.prev = _context3.next) {
|
|
134
|
+
case 0:
|
|
135
|
+
full = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : false;
|
|
136
|
+
versionContract = new Ethers.Contract(contractAddress, AccessibleContract.abi, this.Provider());
|
|
137
|
+
|
|
138
|
+
if (!this.contractNames[contractAddress]) {
|
|
139
|
+
this.contractNames[contractAddress] = new Promise( /*#__PURE__*/function () {
|
|
140
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(resolve) {
|
|
141
|
+
var versionBytes32, _version;
|
|
142
|
+
|
|
143
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
144
|
+
while (1) {
|
|
145
|
+
switch (_context2.prev = _context2.next) {
|
|
146
|
+
case 0:
|
|
147
|
+
_context2.prev = 0;
|
|
148
|
+
_context2.next = 3;
|
|
149
|
+
return _this.CallContractMethod({
|
|
150
|
+
contract: versionContract,
|
|
151
|
+
abi: AccessibleContract.abi,
|
|
152
|
+
methodName: "version",
|
|
153
|
+
cacheContract: false
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
case 3:
|
|
157
|
+
versionBytes32 = _context2.sent;
|
|
158
|
+
_version = Ethers.utils.parseBytes32String( // Ensure bytes32 string is null terminated
|
|
159
|
+
versionBytes32.slice(0, -2) + "00");
|
|
160
|
+
resolve(_version);
|
|
161
|
+
_context2.next = 11;
|
|
162
|
+
break;
|
|
163
|
+
|
|
164
|
+
case 8:
|
|
165
|
+
_context2.prev = 8;
|
|
166
|
+
_context2.t0 = _context2["catch"](0);
|
|
167
|
+
resolve("Unknown");
|
|
168
|
+
|
|
169
|
+
case 11:
|
|
170
|
+
case "end":
|
|
171
|
+
return _context2.stop();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}, _callee2, null, [[0, 8]]);
|
|
175
|
+
}));
|
|
172
176
|
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
return function (_x2) {
|
|
178
|
+
return _ref3.apply(this, arguments);
|
|
179
|
+
};
|
|
180
|
+
}());
|
|
181
|
+
}
|
|
175
182
|
|
|
176
|
-
|
|
177
|
-
|
|
183
|
+
_context3.next = 5;
|
|
184
|
+
return this.contractNames[contractAddress];
|
|
178
185
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
186
|
+
case 5:
|
|
187
|
+
version = _context3.sent;
|
|
183
188
|
|
|
184
|
-
|
|
189
|
+
if (!full) {
|
|
190
|
+
_context3.next = 10;
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
185
193
|
|
|
186
|
-
|
|
187
|
-
return _context3.abrupt("return", version.split(/\d+/)[0]);
|
|
194
|
+
return _context3.abrupt("return", version);
|
|
188
195
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
196
|
+
case 10:
|
|
197
|
+
return _context3.abrupt("return", version.split(/\d+/)[0]);
|
|
198
|
+
|
|
199
|
+
case 11:
|
|
200
|
+
case "end":
|
|
201
|
+
return _context3.stop();
|
|
202
|
+
}
|
|
192
203
|
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
204
|
+
}, _callee3, this);
|
|
205
|
+
}));
|
|
206
|
+
|
|
207
|
+
function ContractName(_x) {
|
|
208
|
+
return _ContractName.apply(this, arguments);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return ContractName;
|
|
212
|
+
}()
|
|
196
213
|
}, {
|
|
197
214
|
key: "Contract",
|
|
198
|
-
value: function Contract(
|
|
199
|
-
var contractAddress =
|
|
200
|
-
abi =
|
|
201
|
-
cacheContract =
|
|
202
|
-
overrideCachedContract =
|
|
215
|
+
value: function Contract(_ref4) {
|
|
216
|
+
var contractAddress = _ref4.contractAddress,
|
|
217
|
+
abi = _ref4.abi,
|
|
218
|
+
cacheContract = _ref4.cacheContract,
|
|
219
|
+
overrideCachedContract = _ref4.overrideCachedContract;
|
|
203
220
|
var contract;
|
|
204
221
|
|
|
205
222
|
if (!overrideCachedContract) {
|
|
@@ -223,66 +240,74 @@ function () {
|
|
|
223
240
|
}
|
|
224
241
|
}, {
|
|
225
242
|
key: "MakeProviderCall",
|
|
226
|
-
value: function
|
|
227
|
-
var
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
243
|
+
value: function () {
|
|
244
|
+
var _MakeProviderCall = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref5) {
|
|
245
|
+
var methodName, _ref5$args, args, _ref5$attempts, attempts, provider;
|
|
246
|
+
|
|
247
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
248
|
+
while (1) {
|
|
249
|
+
switch (_context4.prev = _context4.next) {
|
|
250
|
+
case 0:
|
|
251
|
+
methodName = _ref5.methodName, _ref5$args = _ref5.args, args = _ref5$args === void 0 ? [] : _ref5$args, _ref5$attempts = _ref5.attempts, attempts = _ref5$attempts === void 0 ? 0 : _ref5$attempts;
|
|
252
|
+
_context4.prev = 1;
|
|
253
|
+
provider = this.Provider();
|
|
254
|
+
_context4.next = 5;
|
|
255
|
+
return this.provider.getNetwork();
|
|
256
|
+
|
|
257
|
+
case 5:
|
|
258
|
+
this.Log("ETH ".concat(provider.connection.url, " ").concat(methodName, " [").concat(args.join(", "), "]"));
|
|
259
|
+
_context4.next = 8;
|
|
260
|
+
return provider[methodName].apply(provider, _toConsumableArray(args));
|
|
261
|
+
|
|
262
|
+
case 8:
|
|
263
|
+
return _context4.abrupt("return", _context4.sent);
|
|
264
|
+
|
|
265
|
+
case 11:
|
|
266
|
+
_context4.prev = 11;
|
|
267
|
+
_context4.t0 = _context4["catch"](1);
|
|
268
|
+
// eslint-disable-next-line no-console
|
|
269
|
+
console.error(_context4.t0);
|
|
270
|
+
|
|
271
|
+
if (!(attempts < this.ethereumURIs.length)) {
|
|
272
|
+
_context4.next = 19;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
this.Log("EthClient failing over: ".concat(attempts + 1, " attempts"), true);
|
|
277
|
+
this.provider = undefined;
|
|
278
|
+
this.ethereumURIIndex = (this.ethereumURIIndex + 1) % this.ethereumURIs.length;
|
|
279
|
+
return _context4.abrupt("return", this.MakeProviderCall({
|
|
280
|
+
methodName: methodName,
|
|
281
|
+
args: args,
|
|
282
|
+
attempts: attempts + 1
|
|
283
|
+
}));
|
|
257
284
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}));
|
|
266
|
-
|
|
267
|
-
case 19:
|
|
268
|
-
return _context4.abrupt("return", {});
|
|
269
|
-
|
|
270
|
-
case 20:
|
|
271
|
-
case "end":
|
|
272
|
-
return _context4.stop();
|
|
285
|
+
case 19:
|
|
286
|
+
return _context4.abrupt("return", {});
|
|
287
|
+
|
|
288
|
+
case 20:
|
|
289
|
+
case "end":
|
|
290
|
+
return _context4.stop();
|
|
291
|
+
}
|
|
273
292
|
}
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
|
|
293
|
+
}, _callee4, this, [[1, 11]]);
|
|
294
|
+
}));
|
|
295
|
+
|
|
296
|
+
function MakeProviderCall(_x3) {
|
|
297
|
+
return _MakeProviderCall.apply(this, arguments);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return MakeProviderCall;
|
|
301
|
+
}()
|
|
277
302
|
/* General contract management */
|
|
278
303
|
|
|
279
304
|
}, {
|
|
280
305
|
key: "FormatContractArgument",
|
|
281
|
-
value: function FormatContractArgument(
|
|
306
|
+
value: function FormatContractArgument(_ref6) {
|
|
282
307
|
var _this2 = this;
|
|
283
308
|
|
|
284
|
-
var type =
|
|
285
|
-
value =
|
|
309
|
+
var type = _ref6.type,
|
|
310
|
+
value = _ref6.value;
|
|
286
311
|
|
|
287
312
|
// For array types, parse into array if necessary, then format each value.
|
|
288
313
|
if (type.endsWith("[]")) {
|
|
@@ -322,12 +347,12 @@ function () {
|
|
|
322
347
|
|
|
323
348
|
}, {
|
|
324
349
|
key: "FormatContractArguments",
|
|
325
|
-
value: function FormatContractArguments(
|
|
350
|
+
value: function FormatContractArguments(_ref7) {
|
|
326
351
|
var _this3 = this;
|
|
327
352
|
|
|
328
|
-
var abi =
|
|
329
|
-
methodName =
|
|
330
|
-
args =
|
|
353
|
+
var abi = _ref7.abi,
|
|
354
|
+
methodName = _ref7.methodName,
|
|
355
|
+
args = _ref7.args;
|
|
331
356
|
var method = abi.find(function (func) {
|
|
332
357
|
// Constructor has type=constructor but no name
|
|
333
358
|
return func.name === methodName || func.type === methodName;
|
|
@@ -355,360 +380,391 @@ function () {
|
|
|
355
380
|
}
|
|
356
381
|
}, {
|
|
357
382
|
key: "DeployContract",
|
|
358
|
-
value: function
|
|
359
|
-
var
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
383
|
+
value: function () {
|
|
384
|
+
var _DeployContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref8) {
|
|
385
|
+
var abi, bytecode, _ref8$constructorArgs, constructorArgs, _ref8$overrides, overrides, provider, signer, contractFactory, contract;
|
|
386
|
+
|
|
387
|
+
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
388
|
+
while (1) {
|
|
389
|
+
switch (_context5.prev = _context5.next) {
|
|
390
|
+
case 0:
|
|
391
|
+
abi = _ref8.abi, bytecode = _ref8.bytecode, _ref8$constructorArgs = _ref8.constructorArgs, constructorArgs = _ref8$constructorArgs === void 0 ? [] : _ref8$constructorArgs, _ref8$overrides = _ref8.overrides, overrides = _ref8$overrides === void 0 ? {} : _ref8$overrides;
|
|
392
|
+
this.Log("Deploying contract with args [".concat(constructorArgs.join(", "), "]"));
|
|
393
|
+
provider = this.Provider();
|
|
394
|
+
provider.getNetwork();
|
|
395
|
+
signer = this.client.signer.connect(provider);
|
|
396
|
+
this.ValidateSigner(signer);
|
|
397
|
+
contractFactory = new Ethers.ContractFactory(abi, bytecode, signer);
|
|
398
|
+
_context5.next = 9;
|
|
399
|
+
return contractFactory.deploy.apply(contractFactory, _toConsumableArray(constructorArgs).concat([overrides]));
|
|
400
|
+
|
|
401
|
+
case 9:
|
|
402
|
+
contract = _context5.sent;
|
|
403
|
+
_context5.next = 12;
|
|
404
|
+
return contract.deployed();
|
|
405
|
+
|
|
406
|
+
case 12:
|
|
407
|
+
this.Log("Deployed: ".concat(contract.address));
|
|
408
|
+
return _context5.abrupt("return", {
|
|
409
|
+
contractAddress: Utils.FormatAddress(contract.address),
|
|
410
|
+
transactionHash: contract.deployTransaction.hash
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
case 14:
|
|
414
|
+
case "end":
|
|
415
|
+
return _context5.stop();
|
|
416
|
+
}
|
|
390
417
|
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
418
|
+
}, _callee5, this);
|
|
419
|
+
}));
|
|
420
|
+
|
|
421
|
+
function DeployContract(_x4) {
|
|
422
|
+
return _DeployContract.apply(this, arguments);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return DeployContract;
|
|
426
|
+
}() // Accepts either contract object or contract address
|
|
394
427
|
|
|
395
428
|
}, {
|
|
396
429
|
key: "CallContractMethod",
|
|
397
|
-
value: function
|
|
398
|
-
var
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
430
|
+
value: function () {
|
|
431
|
+
var _CallContractMethod = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref9) {
|
|
432
|
+
var contract, contractAddress, abi, methodName, _ref9$methodArgs, methodArgs, value, _ref9$overrides, overrides, _ref9$formatArguments, formatArguments, _ref9$cacheContract, cacheContract, _ref9$overrideCachedC, overrideCachedContract, methodAbi, result, success, _contract$functions, latestBlock;
|
|
433
|
+
|
|
434
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
435
|
+
while (1) {
|
|
436
|
+
switch (_context6.prev = _context6.next) {
|
|
437
|
+
case 0:
|
|
438
|
+
contract = _ref9.contract, contractAddress = _ref9.contractAddress, abi = _ref9.abi, methodName = _ref9.methodName, _ref9$methodArgs = _ref9.methodArgs, methodArgs = _ref9$methodArgs === void 0 ? [] : _ref9$methodArgs, value = _ref9.value, _ref9$overrides = _ref9.overrides, overrides = _ref9$overrides === void 0 ? {} : _ref9$overrides, _ref9$formatArguments = _ref9.formatArguments, formatArguments = _ref9$formatArguments === void 0 ? true : _ref9$formatArguments, _ref9$cacheContract = _ref9.cacheContract, cacheContract = _ref9$cacheContract === void 0 ? true : _ref9$cacheContract, _ref9$overrideCachedC = _ref9.overrideCachedContract, overrideCachedContract = _ref9$overrideCachedC === void 0 ? false : _ref9$overrideCachedC;
|
|
439
|
+
|
|
440
|
+
if (abi) {
|
|
441
|
+
_context6.next = 5;
|
|
442
|
+
break;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
_context6.next = 4;
|
|
446
|
+
return this.client.ContractAbi({
|
|
447
|
+
contractAddress: contractAddress
|
|
448
|
+
});
|
|
405
449
|
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
break;
|
|
409
|
-
}
|
|
450
|
+
case 4:
|
|
451
|
+
abi = _context6.sent;
|
|
410
452
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}));
|
|
415
|
-
|
|
416
|
-
case 4:
|
|
417
|
-
abi = _context6.sent;
|
|
418
|
-
|
|
419
|
-
case 5:
|
|
420
|
-
contract = contract || this.Contract({
|
|
421
|
-
contractAddress: contractAddress,
|
|
422
|
-
abi: abi,
|
|
423
|
-
cacheContract: cacheContract,
|
|
424
|
-
overrideCachedContract: overrideCachedContract
|
|
425
|
-
});
|
|
426
|
-
abi = contract["interface"].abi; // Automatically format contract arguments
|
|
427
|
-
|
|
428
|
-
if (formatArguments) {
|
|
429
|
-
methodArgs = this.FormatContractArguments({
|
|
453
|
+
case 5:
|
|
454
|
+
contract = contract || this.Contract({
|
|
455
|
+
contractAddress: contractAddress,
|
|
430
456
|
abi: abi,
|
|
431
|
-
|
|
432
|
-
|
|
457
|
+
cacheContract: cacheContract,
|
|
458
|
+
overrideCachedContract: overrideCachedContract
|
|
459
|
+
});
|
|
460
|
+
abi = contract["interface"].abi; // Automatically format contract arguments
|
|
461
|
+
|
|
462
|
+
if (formatArguments) {
|
|
463
|
+
methodArgs = this.FormatContractArguments({
|
|
464
|
+
abi: abi,
|
|
465
|
+
methodName: methodName,
|
|
466
|
+
args: methodArgs
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (value) {
|
|
471
|
+
// Convert Ether to Wei
|
|
472
|
+
overrides.value = "0x" + Utils.EtherToWei(value.toString()).toString(16);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (!(contract.functions[methodName] === undefined)) {
|
|
476
|
+
_context6.next = 11;
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
throw Error("Unknown method: " + methodName);
|
|
481
|
+
|
|
482
|
+
case 11:
|
|
483
|
+
this.Log("Calling contract method:\n Provider: ".concat(this.Provider().connection.url, "\n Address: ").concat(contract.address, "\n Method: ").concat(methodName, "\n Args: [").concat(methodArgs.join(", "), "]"));
|
|
484
|
+
methodAbi = contract["interface"].abi.find(function (method) {
|
|
485
|
+
return method.name === methodName;
|
|
486
|
+
}); // Lock if performing a transaction
|
|
487
|
+
|
|
488
|
+
if (!(!methodAbi || !methodAbi.constant)) {
|
|
489
|
+
_context6.next = 20;
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
case 14:
|
|
494
|
+
if (!this.locked) {
|
|
495
|
+
_context6.next = 19;
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
_context6.next = 17;
|
|
500
|
+
return new Promise(function (resolve) {
|
|
501
|
+
return setTimeout(resolve, 100);
|
|
433
502
|
});
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
if (value) {
|
|
437
|
-
// Convert Ether to Wei
|
|
438
|
-
overrides.value = "0x" + Utils.EtherToWei(value.toString()).toString(16);
|
|
439
|
-
}
|
|
440
503
|
|
|
441
|
-
|
|
442
|
-
_context6.next =
|
|
504
|
+
case 17:
|
|
505
|
+
_context6.next = 14;
|
|
443
506
|
break;
|
|
444
|
-
}
|
|
445
507
|
|
|
446
|
-
|
|
508
|
+
case 19:
|
|
509
|
+
this.locked = true;
|
|
447
510
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
return method.name === methodName;
|
|
452
|
-
}); // Lock if performing a transaction
|
|
511
|
+
case 20:
|
|
512
|
+
_context6.prev = 20;
|
|
513
|
+
success = false;
|
|
453
514
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
515
|
+
case 22:
|
|
516
|
+
if (success) {
|
|
517
|
+
_context6.next = 49;
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
458
520
|
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
break;
|
|
463
|
-
}
|
|
521
|
+
_context6.prev = 23;
|
|
522
|
+
_context6.next = 26;
|
|
523
|
+
return (_contract$functions = contract.functions)[methodName].apply(_contract$functions, _toConsumableArray(methodArgs).concat([overrides]));
|
|
464
524
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
525
|
+
case 26:
|
|
526
|
+
result = _context6.sent;
|
|
527
|
+
success = true;
|
|
528
|
+
_context6.next = 47;
|
|
529
|
+
break;
|
|
469
530
|
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
531
|
+
case 30:
|
|
532
|
+
_context6.prev = 30;
|
|
533
|
+
_context6.t0 = _context6["catch"](23);
|
|
473
534
|
|
|
474
|
-
|
|
475
|
-
|
|
535
|
+
if (!(_context6.t0.code === -32000 || _context6.t0.code === "REPLACEMENT_UNDERPRICED")) {
|
|
536
|
+
_context6.next = 40;
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
476
539
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
540
|
+
_context6.next = 35;
|
|
541
|
+
return this.MakeProviderCall({
|
|
542
|
+
methodName: "getBlock",
|
|
543
|
+
args: ["latest"]
|
|
544
|
+
});
|
|
480
545
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
546
|
+
case 35:
|
|
547
|
+
latestBlock = _context6.sent;
|
|
548
|
+
overrides.gasLimit = latestBlock.gasLimit;
|
|
549
|
+
overrides.gasPrice = overrides.gasPrice ? overrides.gasPrice * 1.50 : 8000000000;
|
|
550
|
+
_context6.next = 47;
|
|
484
551
|
break;
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
_context6.prev = 23;
|
|
488
|
-
_context6.next = 26;
|
|
489
|
-
return _regeneratorRuntime.awrap((_contract$functions = contract.functions)[methodName].apply(_contract$functions, _toConsumableArray(methodArgs).concat([overrides])));
|
|
490
|
-
|
|
491
|
-
case 26:
|
|
492
|
-
result = _context6.sent;
|
|
493
|
-
success = true;
|
|
494
|
-
_context6.next = 47;
|
|
495
|
-
break;
|
|
496
552
|
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
553
|
+
case 40:
|
|
554
|
+
if (!(_context6.t0.code === "NONCE_EXPIRED" && _context6.t0.reason === "nonce has already been used")) {
|
|
555
|
+
_context6.next = 44;
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
500
558
|
|
|
501
|
-
|
|
502
|
-
_context6.next =
|
|
559
|
+
this.Log("Retrying method call ".concat(methodName));
|
|
560
|
+
_context6.next = 47;
|
|
503
561
|
break;
|
|
504
|
-
}
|
|
505
562
|
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
case 35:
|
|
513
|
-
latestBlock = _context6.sent;
|
|
514
|
-
overrides.gasLimit = latestBlock.gasLimit;
|
|
515
|
-
overrides.gasPrice = overrides.gasPrice ? overrides.gasPrice * 1.50 : 8000000000;
|
|
516
|
-
_context6.next = 47;
|
|
517
|
-
break;
|
|
518
|
-
|
|
519
|
-
case 40:
|
|
520
|
-
if (!(_context6.t0.code === "NONCE_EXPIRED" && _context6.t0.reason === "nonce has already been used")) {
|
|
521
|
-
_context6.next = 44;
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
563
|
+
case 44:
|
|
564
|
+
if ((_context6.t0.message || _context6.t0).includes("invalid response")) {
|
|
565
|
+
_context6.next = 47;
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
524
568
|
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
break;
|
|
569
|
+
this.Log(_typeof(_context6.t0) === "object" ? JSON.stringify(_context6.t0, null, 2) : _context6.t0, true);
|
|
570
|
+
throw _context6.t0;
|
|
528
571
|
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
_context6.next = 47;
|
|
572
|
+
case 47:
|
|
573
|
+
_context6.next = 22;
|
|
532
574
|
break;
|
|
533
|
-
}
|
|
534
575
|
|
|
535
|
-
|
|
536
|
-
|
|
576
|
+
case 49:
|
|
577
|
+
return _context6.abrupt("return", result);
|
|
537
578
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
break;
|
|
579
|
+
case 50:
|
|
580
|
+
_context6.prev = 50;
|
|
541
581
|
|
|
542
|
-
|
|
543
|
-
|
|
582
|
+
// Unlock if performing a transaction
|
|
583
|
+
if (!methodAbi || !methodAbi.constant) {
|
|
584
|
+
this.locked = false;
|
|
585
|
+
}
|
|
544
586
|
|
|
545
|
-
|
|
546
|
-
_context6.prev = 50;
|
|
587
|
+
return _context6.finish(50);
|
|
547
588
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
589
|
+
case 53:
|
|
590
|
+
case "end":
|
|
591
|
+
return _context6.stop();
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
}, _callee6, this, [[20,, 50, 53], [23, 30]]);
|
|
595
|
+
}));
|
|
552
596
|
|
|
553
|
-
|
|
597
|
+
function CallContractMethod(_x5) {
|
|
598
|
+
return _CallContractMethod.apply(this, arguments);
|
|
599
|
+
}
|
|
554
600
|
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
return _context6.stop();
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}, null, this, [[20,, 50, 53], [23, 30]]);
|
|
561
|
-
}
|
|
601
|
+
return CallContractMethod;
|
|
602
|
+
}()
|
|
562
603
|
}, {
|
|
563
604
|
key: "CallContractMethodAndWait",
|
|
564
|
-
value: function
|
|
565
|
-
var
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
605
|
+
value: function () {
|
|
606
|
+
var _CallContractMethodAndWait = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref10) {
|
|
607
|
+
var contractAddress, abi, methodName, methodArgs, value, timeout, _ref10$formatArgument, formatArguments, _ref10$cacheContract, cacheContract, _ref10$overrideCached, overrideCachedContract, contract, createMethodCall, interval, elapsed, methodEvent;
|
|
608
|
+
|
|
609
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
610
|
+
while (1) {
|
|
611
|
+
switch (_context7.prev = _context7.next) {
|
|
612
|
+
case 0:
|
|
613
|
+
contractAddress = _ref10.contractAddress, abi = _ref10.abi, methodName = _ref10.methodName, methodArgs = _ref10.methodArgs, value = _ref10.value, timeout = _ref10.timeout, _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;
|
|
614
|
+
timeout = timeout || this.timeout || 10000;
|
|
615
|
+
|
|
616
|
+
if (abi) {
|
|
617
|
+
_context7.next = 6;
|
|
618
|
+
break;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
_context7.next = 5;
|
|
622
|
+
return this.client.ContractAbi({
|
|
623
|
+
contractAddress: contractAddress
|
|
624
|
+
});
|
|
578
625
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
methodArgs: methodArgs,
|
|
601
|
-
value: value,
|
|
602
|
-
formatArguments: formatArguments,
|
|
603
|
-
cacheContract: cacheContract
|
|
604
|
-
}));
|
|
605
|
-
|
|
606
|
-
case 9:
|
|
607
|
-
createMethodCall = _context7.sent;
|
|
608
|
-
this.Log("Awaiting transaction completion: ".concat(createMethodCall.hash)); // Poll for transaction completion
|
|
609
|
-
|
|
610
|
-
interval = this.Provider().pollingInterval;
|
|
611
|
-
elapsed = 0;
|
|
612
|
-
|
|
613
|
-
case 13:
|
|
614
|
-
if (!(elapsed < timeout)) {
|
|
615
|
-
_context7.next = 25;
|
|
616
|
-
break;
|
|
617
|
-
}
|
|
626
|
+
case 5:
|
|
627
|
+
abi = _context7.sent;
|
|
628
|
+
|
|
629
|
+
case 6:
|
|
630
|
+
contract = this.Contract({
|
|
631
|
+
contractAddress: contractAddress,
|
|
632
|
+
abi: abi,
|
|
633
|
+
cacheContract: cacheContract,
|
|
634
|
+
overrideCachedContract: overrideCachedContract
|
|
635
|
+
}); // Make method call
|
|
636
|
+
|
|
637
|
+
_context7.next = 9;
|
|
638
|
+
return this.CallContractMethod({
|
|
639
|
+
contract: contract,
|
|
640
|
+
abi: abi,
|
|
641
|
+
methodName: methodName,
|
|
642
|
+
methodArgs: methodArgs,
|
|
643
|
+
value: value,
|
|
644
|
+
formatArguments: formatArguments,
|
|
645
|
+
cacheContract: cacheContract
|
|
646
|
+
});
|
|
618
647
|
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
args: [createMethodCall.hash]
|
|
623
|
-
}));
|
|
648
|
+
case 9:
|
|
649
|
+
createMethodCall = _context7.sent;
|
|
650
|
+
this.Log("Awaiting transaction completion: ".concat(createMethodCall.hash)); // Poll for transaction completion
|
|
624
651
|
|
|
625
|
-
|
|
626
|
-
|
|
652
|
+
interval = this.Provider().pollingInterval;
|
|
653
|
+
elapsed = 0;
|
|
627
654
|
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
655
|
+
case 13:
|
|
656
|
+
if (!(elapsed < timeout)) {
|
|
657
|
+
_context7.next = 25;
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
_context7.next = 16;
|
|
662
|
+
return this.MakeProviderCall({
|
|
663
|
+
methodName: "getTransactionReceipt",
|
|
664
|
+
args: [createMethodCall.hash]
|
|
665
|
+
});
|
|
632
666
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
667
|
+
case 16:
|
|
668
|
+
methodEvent = _context7.sent;
|
|
669
|
+
|
|
670
|
+
if (!methodEvent) {
|
|
671
|
+
_context7.next = 20;
|
|
672
|
+
break;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
methodEvent.logs = methodEvent.logs.map(function (log) {
|
|
676
|
+
return _objectSpread(_objectSpread({}, log), contract["interface"].parseLog(log));
|
|
677
|
+
});
|
|
678
|
+
return _context7.abrupt("break", 25);
|
|
679
|
+
|
|
680
|
+
case 20:
|
|
681
|
+
elapsed += interval;
|
|
682
|
+
_context7.next = 23;
|
|
683
|
+
return new Promise(function (resolve) {
|
|
684
|
+
return setTimeout(resolve, interval);
|
|
685
|
+
});
|
|
686
|
+
|
|
687
|
+
case 23:
|
|
688
|
+
_context7.next = 13;
|
|
652
689
|
break;
|
|
653
|
-
}
|
|
654
690
|
|
|
655
|
-
|
|
691
|
+
case 25:
|
|
692
|
+
if (methodEvent) {
|
|
693
|
+
_context7.next = 27;
|
|
694
|
+
break;
|
|
695
|
+
}
|
|
656
696
|
|
|
657
|
-
|
|
658
|
-
return _context7.abrupt("return", methodEvent);
|
|
697
|
+
throw Error("Timed out waiting for completion of ".concat(methodName, ". TXID: ").concat(createMethodCall.hash));
|
|
659
698
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
699
|
+
case 27:
|
|
700
|
+
return _context7.abrupt("return", methodEvent);
|
|
701
|
+
|
|
702
|
+
case 28:
|
|
703
|
+
case "end":
|
|
704
|
+
return _context7.stop();
|
|
705
|
+
}
|
|
663
706
|
}
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
|
|
707
|
+
}, _callee7, this);
|
|
708
|
+
}));
|
|
709
|
+
|
|
710
|
+
function CallContractMethodAndWait(_x6) {
|
|
711
|
+
return _CallContractMethodAndWait.apply(this, arguments);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
return CallContractMethodAndWait;
|
|
715
|
+
}()
|
|
667
716
|
}, {
|
|
668
717
|
key: "AwaitEvent",
|
|
669
|
-
value: function
|
|
670
|
-
var
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
contract.
|
|
684
|
-
|
|
718
|
+
value: function () {
|
|
719
|
+
var _AwaitEvent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref11) {
|
|
720
|
+
var contractAddress, abi, eventName, contract;
|
|
721
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
722
|
+
while (1) {
|
|
723
|
+
switch (_context8.prev = _context8.next) {
|
|
724
|
+
case 0:
|
|
725
|
+
contractAddress = _ref11.contractAddress, abi = _ref11.abi, eventName = _ref11.eventName;
|
|
726
|
+
contract = this.Contract({
|
|
727
|
+
contractAddress: contractAddress,
|
|
728
|
+
abi: abi
|
|
729
|
+
});
|
|
730
|
+
_context8.next = 4;
|
|
731
|
+
return new Promise(function (resolve) {
|
|
732
|
+
contract.on(eventName, function (_, __, event) {
|
|
733
|
+
contract.removeAllListeners(eventName);
|
|
734
|
+
resolve(event);
|
|
735
|
+
});
|
|
685
736
|
});
|
|
686
|
-
}));
|
|
687
737
|
|
|
688
|
-
|
|
689
|
-
|
|
738
|
+
case 4:
|
|
739
|
+
return _context8.abrupt("return", _context8.sent);
|
|
690
740
|
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
741
|
+
case 5:
|
|
742
|
+
case "end":
|
|
743
|
+
return _context8.stop();
|
|
744
|
+
}
|
|
694
745
|
}
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
|
|
746
|
+
}, _callee8, this);
|
|
747
|
+
}));
|
|
748
|
+
|
|
749
|
+
function AwaitEvent(_x7) {
|
|
750
|
+
return _AwaitEvent.apply(this, arguments);
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
return AwaitEvent;
|
|
754
|
+
}()
|
|
698
755
|
}, {
|
|
699
756
|
key: "ExtractEventFromLogs",
|
|
700
|
-
value: function ExtractEventFromLogs(
|
|
701
|
-
var abi =
|
|
702
|
-
event =
|
|
703
|
-
eventName =
|
|
757
|
+
value: function ExtractEventFromLogs(_ref12) {
|
|
758
|
+
var abi = _ref12.abi,
|
|
759
|
+
event = _ref12.event,
|
|
760
|
+
eventName = _ref12.eventName;
|
|
704
761
|
var contractInterface = new Ethers.utils.Interface(abi); // Loop through logs to find the desired log
|
|
705
762
|
|
|
706
|
-
var
|
|
707
|
-
|
|
708
|
-
var _iteratorError = undefined;
|
|
763
|
+
var _iterator = _createForOfIteratorHelper(event.logs),
|
|
764
|
+
_step;
|
|
709
765
|
|
|
710
766
|
try {
|
|
711
|
-
for (
|
|
767
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
712
768
|
var log = _step.value;
|
|
713
769
|
var parsedLog = contractInterface.parseLog(log);
|
|
714
770
|
|
|
@@ -717,361 +773,428 @@ function () {
|
|
|
717
773
|
}
|
|
718
774
|
}
|
|
719
775
|
} catch (err) {
|
|
720
|
-
|
|
721
|
-
_iteratorError = err;
|
|
776
|
+
_iterator.e(err);
|
|
722
777
|
} finally {
|
|
723
|
-
|
|
724
|
-
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
|
725
|
-
_iterator["return"]();
|
|
726
|
-
}
|
|
727
|
-
} finally {
|
|
728
|
-
if (_didIteratorError) {
|
|
729
|
-
throw _iteratorError;
|
|
730
|
-
}
|
|
731
|
-
}
|
|
778
|
+
_iterator.f();
|
|
732
779
|
}
|
|
733
780
|
}
|
|
734
781
|
}, {
|
|
735
782
|
key: "DeployDependentContract",
|
|
736
|
-
value: function
|
|
737
|
-
var
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
783
|
+
value: function () {
|
|
784
|
+
var _DeployDependentContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref13) {
|
|
785
|
+
var contractAddress, methodName, _ref13$args, args, eventName, eventValue, abi, event, eventLog, newContractAddress;
|
|
786
|
+
|
|
787
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
788
|
+
while (1) {
|
|
789
|
+
switch (_context9.prev = _context9.next) {
|
|
790
|
+
case 0:
|
|
791
|
+
contractAddress = _ref13.contractAddress, methodName = _ref13.methodName, _ref13$args = _ref13.args, args = _ref13$args === void 0 ? [] : _ref13$args, eventName = _ref13.eventName, eventValue = _ref13.eventValue;
|
|
792
|
+
_context9.next = 3;
|
|
793
|
+
return this.client.ContractAbi({
|
|
794
|
+
contractAddress: contractAddress
|
|
795
|
+
});
|
|
796
|
+
|
|
797
|
+
case 3:
|
|
798
|
+
abi = _context9.sent;
|
|
799
|
+
_context9.next = 6;
|
|
800
|
+
return this.CallContractMethodAndWait({
|
|
801
|
+
contractAddress: contractAddress,
|
|
802
|
+
abi: abi,
|
|
803
|
+
methodName: methodName,
|
|
804
|
+
methodArgs: args
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
case 6:
|
|
808
|
+
event = _context9.sent;
|
|
809
|
+
eventLog = this.ExtractEventFromLogs({
|
|
810
|
+
abi: abi,
|
|
811
|
+
event: event,
|
|
812
|
+
eventName: eventName,
|
|
813
|
+
eventValue: eventValue
|
|
814
|
+
});
|
|
815
|
+
|
|
816
|
+
if (eventLog) {
|
|
817
|
+
_context9.next = 10;
|
|
818
|
+
break;
|
|
819
|
+
}
|
|
772
820
|
|
|
773
|
-
|
|
821
|
+
throw Error("".concat(methodName, " failed - Log not present in transaction"));
|
|
774
822
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
823
|
+
case 10:
|
|
824
|
+
newContractAddress = eventLog.values[eventValue];
|
|
825
|
+
return _context9.abrupt("return", {
|
|
826
|
+
contractAddress: Utils.FormatAddress(newContractAddress),
|
|
827
|
+
transactionHash: event.transactionHash
|
|
828
|
+
});
|
|
781
829
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
830
|
+
case 12:
|
|
831
|
+
case "end":
|
|
832
|
+
return _context9.stop();
|
|
833
|
+
}
|
|
785
834
|
}
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
|
|
835
|
+
}, _callee9, this);
|
|
836
|
+
}));
|
|
837
|
+
|
|
838
|
+
function DeployDependentContract(_x8) {
|
|
839
|
+
return _DeployDependentContract.apply(this, arguments);
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
return DeployDependentContract;
|
|
843
|
+
}()
|
|
789
844
|
/* Specific contract management */
|
|
790
845
|
|
|
791
846
|
}, {
|
|
792
847
|
key: "DeployAccessGroupContract",
|
|
793
|
-
value: function
|
|
794
|
-
var
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
848
|
+
value: function () {
|
|
849
|
+
var _DeployAccessGroupContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref14) {
|
|
850
|
+
var contentSpaceAddress;
|
|
851
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
852
|
+
while (1) {
|
|
853
|
+
switch (_context10.prev = _context10.next) {
|
|
854
|
+
case 0:
|
|
855
|
+
contentSpaceAddress = _ref14.contentSpaceAddress;
|
|
856
|
+
return _context10.abrupt("return", this.DeployDependentContract({
|
|
857
|
+
contractAddress: contentSpaceAddress,
|
|
858
|
+
methodName: "createGroup",
|
|
859
|
+
args: [],
|
|
860
|
+
eventName: "CreateGroup",
|
|
861
|
+
eventValue: "groupAddress"
|
|
862
|
+
}));
|
|
863
|
+
|
|
864
|
+
case 2:
|
|
865
|
+
case "end":
|
|
866
|
+
return _context10.stop();
|
|
867
|
+
}
|
|
811
868
|
}
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
|
|
869
|
+
}, _callee10, this);
|
|
870
|
+
}));
|
|
871
|
+
|
|
872
|
+
function DeployAccessGroupContract(_x9) {
|
|
873
|
+
return _DeployAccessGroupContract.apply(this, arguments);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
return DeployAccessGroupContract;
|
|
877
|
+
}()
|
|
815
878
|
}, {
|
|
816
879
|
key: "DeployTypeContract",
|
|
817
|
-
value: function
|
|
818
|
-
var
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
880
|
+
value: function () {
|
|
881
|
+
var _DeployTypeContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref15) {
|
|
882
|
+
var contentSpaceAddress;
|
|
883
|
+
return _regeneratorRuntime.wrap(function _callee11$(_context11) {
|
|
884
|
+
while (1) {
|
|
885
|
+
switch (_context11.prev = _context11.next) {
|
|
886
|
+
case 0:
|
|
887
|
+
contentSpaceAddress = _ref15.contentSpaceAddress;
|
|
888
|
+
return _context11.abrupt("return", this.DeployDependentContract({
|
|
889
|
+
contractAddress: contentSpaceAddress,
|
|
890
|
+
methodName: "createContentType",
|
|
891
|
+
args: [],
|
|
892
|
+
eventName: "CreateContentType",
|
|
893
|
+
eventValue: "contentTypeAddress"
|
|
894
|
+
}));
|
|
895
|
+
|
|
896
|
+
case 2:
|
|
897
|
+
case "end":
|
|
898
|
+
return _context11.stop();
|
|
899
|
+
}
|
|
835
900
|
}
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
|
|
901
|
+
}, _callee11, this);
|
|
902
|
+
}));
|
|
903
|
+
|
|
904
|
+
function DeployTypeContract(_x10) {
|
|
905
|
+
return _DeployTypeContract.apply(this, arguments);
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
return DeployTypeContract;
|
|
909
|
+
}()
|
|
839
910
|
}, {
|
|
840
911
|
key: "DeployLibraryContract",
|
|
841
|
-
value: function
|
|
842
|
-
var
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
912
|
+
value: function () {
|
|
913
|
+
var _DeployLibraryContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref16) {
|
|
914
|
+
var contentSpaceAddress, kmsId, kmsAddress;
|
|
915
|
+
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
916
|
+
while (1) {
|
|
917
|
+
switch (_context12.prev = _context12.next) {
|
|
918
|
+
case 0:
|
|
919
|
+
contentSpaceAddress = _ref16.contentSpaceAddress, kmsId = _ref16.kmsId;
|
|
920
|
+
kmsAddress = Utils.HashToAddress(kmsId);
|
|
921
|
+
return _context12.abrupt("return", this.DeployDependentContract({
|
|
922
|
+
contractAddress: contentSpaceAddress,
|
|
923
|
+
methodName: "createLibrary",
|
|
924
|
+
args: [kmsAddress],
|
|
925
|
+
eventName: "CreateLibrary",
|
|
926
|
+
eventValue: "libraryAddress"
|
|
927
|
+
}));
|
|
928
|
+
|
|
929
|
+
case 3:
|
|
930
|
+
case "end":
|
|
931
|
+
return _context12.stop();
|
|
932
|
+
}
|
|
860
933
|
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
|
|
934
|
+
}, _callee12, this);
|
|
935
|
+
}));
|
|
936
|
+
|
|
937
|
+
function DeployLibraryContract(_x11) {
|
|
938
|
+
return _DeployLibraryContract.apply(this, arguments);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
return DeployLibraryContract;
|
|
942
|
+
}()
|
|
864
943
|
}, {
|
|
865
944
|
key: "DeployContentContract",
|
|
866
|
-
value: function
|
|
867
|
-
var
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
945
|
+
value: function () {
|
|
946
|
+
var _DeployContentContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref17) {
|
|
947
|
+
var contentLibraryAddress, typeAddress;
|
|
948
|
+
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
949
|
+
while (1) {
|
|
950
|
+
switch (_context13.prev = _context13.next) {
|
|
951
|
+
case 0:
|
|
952
|
+
contentLibraryAddress = _ref17.contentLibraryAddress, typeAddress = _ref17.typeAddress;
|
|
953
|
+
// If type is not specified, use null address
|
|
954
|
+
typeAddress = typeAddress || Utils.nullAddress;
|
|
955
|
+
return _context13.abrupt("return", this.DeployDependentContract({
|
|
956
|
+
contractAddress: contentLibraryAddress,
|
|
957
|
+
methodName: "createContent",
|
|
958
|
+
args: [typeAddress],
|
|
959
|
+
eventName: "ContentObjectCreated",
|
|
960
|
+
eventValue: "contentAddress"
|
|
961
|
+
}));
|
|
962
|
+
|
|
963
|
+
case 3:
|
|
964
|
+
case "end":
|
|
965
|
+
return _context13.stop();
|
|
966
|
+
}
|
|
886
967
|
}
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
|
|
968
|
+
}, _callee13, this);
|
|
969
|
+
}));
|
|
970
|
+
|
|
971
|
+
function DeployContentContract(_x12) {
|
|
972
|
+
return _DeployContentContract.apply(this, arguments);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
return DeployContentContract;
|
|
976
|
+
}()
|
|
890
977
|
}, {
|
|
891
978
|
key: "CommitContent",
|
|
892
|
-
value: function
|
|
893
|
-
var
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
979
|
+
value: function () {
|
|
980
|
+
var _CommitContent = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(_ref18) {
|
|
981
|
+
var contentObjectAddress, versionHash;
|
|
982
|
+
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
983
|
+
while (1) {
|
|
984
|
+
switch (_context14.prev = _context14.next) {
|
|
985
|
+
case 0:
|
|
986
|
+
contentObjectAddress = _ref18.contentObjectAddress, versionHash = _ref18.versionHash;
|
|
987
|
+
_context14.next = 3;
|
|
988
|
+
return this.CallContractMethodAndWait({
|
|
989
|
+
contractAddress: contentObjectAddress,
|
|
990
|
+
methodName: "commit",
|
|
991
|
+
methodArgs: [versionHash],
|
|
992
|
+
eventName: "CommitPending"
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
case 3:
|
|
996
|
+
return _context14.abrupt("return", _context14.sent);
|
|
997
|
+
|
|
998
|
+
case 4:
|
|
999
|
+
case "end":
|
|
1000
|
+
return _context14.stop();
|
|
1001
|
+
}
|
|
913
1002
|
}
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
|
|
1003
|
+
}, _callee14, this);
|
|
1004
|
+
}));
|
|
1005
|
+
|
|
1006
|
+
function CommitContent(_x13) {
|
|
1007
|
+
return _CommitContent.apply(this, arguments);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
return CommitContent;
|
|
1011
|
+
}()
|
|
917
1012
|
}, {
|
|
918
1013
|
key: "EngageAccountLibrary",
|
|
919
|
-
value: function
|
|
920
|
-
var
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1014
|
+
value: function () {
|
|
1015
|
+
var _EngageAccountLibrary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref19) {
|
|
1016
|
+
var contentSpaceAddress;
|
|
1017
|
+
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
1018
|
+
while (1) {
|
|
1019
|
+
switch (_context15.prev = _context15.next) {
|
|
1020
|
+
case 0:
|
|
1021
|
+
contentSpaceAddress = _ref19.contentSpaceAddress;
|
|
1022
|
+
return _context15.abrupt("return", this.CallContractMethodAndWait({
|
|
1023
|
+
contractAddress: contentSpaceAddress,
|
|
1024
|
+
methodName: "engageAccountLibrary",
|
|
1025
|
+
args: []
|
|
1026
|
+
}));
|
|
1027
|
+
|
|
1028
|
+
case 2:
|
|
1029
|
+
case "end":
|
|
1030
|
+
return _context15.stop();
|
|
1031
|
+
}
|
|
935
1032
|
}
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
|
|
1033
|
+
}, _callee15, this);
|
|
1034
|
+
}));
|
|
1035
|
+
|
|
1036
|
+
function EngageAccountLibrary(_x14) {
|
|
1037
|
+
return _EngageAccountLibrary.apply(this, arguments);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
return EngageAccountLibrary;
|
|
1041
|
+
}()
|
|
939
1042
|
}, {
|
|
940
1043
|
key: "SetCustomContentContract",
|
|
941
|
-
value: function
|
|
942
|
-
var
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
1044
|
+
value: function () {
|
|
1045
|
+
var _SetCustomContentContract = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref20) {
|
|
1046
|
+
var contentContractAddress, customContractAddress, _ref20$overrides, overrides;
|
|
1047
|
+
|
|
1048
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
1049
|
+
while (1) {
|
|
1050
|
+
switch (_context16.prev = _context16.next) {
|
|
1051
|
+
case 0:
|
|
1052
|
+
contentContractAddress = _ref20.contentContractAddress, customContractAddress = _ref20.customContractAddress, _ref20$overrides = _ref20.overrides, overrides = _ref20$overrides === void 0 ? {} : _ref20$overrides;
|
|
1053
|
+
_context16.next = 3;
|
|
1054
|
+
return this.CallContractMethodAndWait({
|
|
1055
|
+
contractAddress: contentContractAddress,
|
|
1056
|
+
methodName: "setContentContractAddress",
|
|
1057
|
+
methodArgs: [customContractAddress],
|
|
1058
|
+
overrides: overrides
|
|
1059
|
+
});
|
|
1060
|
+
|
|
1061
|
+
case 3:
|
|
1062
|
+
return _context16.abrupt("return", _context16.sent);
|
|
1063
|
+
|
|
1064
|
+
case 4:
|
|
1065
|
+
case "end":
|
|
1066
|
+
return _context16.stop();
|
|
1067
|
+
}
|
|
963
1068
|
}
|
|
964
|
-
}
|
|
965
|
-
}
|
|
966
|
-
} // Get all logs for the specified contract in the specified range
|
|
1069
|
+
}, _callee16, this);
|
|
1070
|
+
}));
|
|
967
1071
|
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
var _this4 = this;
|
|
972
|
-
|
|
973
|
-
var contractAddress, abi, _ref19$fromBlock, fromBlock, toBlock, topics, _ref19$includeTransac, includeTransaction, filter, contractLogs, blocks;
|
|
974
|
-
|
|
975
|
-
return _regeneratorRuntime.async(function ContractEvents$(_context18) {
|
|
976
|
-
while (1) {
|
|
977
|
-
switch (_context18.prev = _context18.next) {
|
|
978
|
-
case 0:
|
|
979
|
-
contractAddress = _ref19.contractAddress, abi = _ref19.abi, _ref19$fromBlock = _ref19.fromBlock, fromBlock = _ref19$fromBlock === void 0 ? 0 : _ref19$fromBlock, toBlock = _ref19.toBlock, topics = _ref19.topics, _ref19$includeTransac = _ref19.includeTransaction, includeTransaction = _ref19$includeTransac === void 0 ? false : _ref19$includeTransac;
|
|
980
|
-
filter = {
|
|
981
|
-
address: contractAddress,
|
|
982
|
-
fromBlock: fromBlock,
|
|
983
|
-
toBlock: toBlock
|
|
984
|
-
};
|
|
985
|
-
|
|
986
|
-
if (topics) {
|
|
987
|
-
filter.topics = topics;
|
|
988
|
-
}
|
|
1072
|
+
function SetCustomContentContract(_x15) {
|
|
1073
|
+
return _SetCustomContentContract.apply(this, arguments);
|
|
1074
|
+
}
|
|
989
1075
|
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
methodName: "getLogs",
|
|
993
|
-
args: [filter]
|
|
994
|
-
}));
|
|
1076
|
+
return SetCustomContentContract;
|
|
1077
|
+
}() // Get all logs for the specified contract in the specified range
|
|
995
1078
|
|
|
996
|
-
|
|
997
|
-
|
|
1079
|
+
}, {
|
|
1080
|
+
key: "ContractEvents",
|
|
1081
|
+
value: function () {
|
|
1082
|
+
var _ContractEvents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref21) {
|
|
1083
|
+
var _this4 = this;
|
|
1084
|
+
|
|
1085
|
+
var contractAddress, abi, _ref21$fromBlock, fromBlock, toBlock, topics, _ref21$includeTransac, includeTransaction, filter, contractLogs, blocks;
|
|
1086
|
+
|
|
1087
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1088
|
+
while (1) {
|
|
1089
|
+
switch (_context18.prev = _context18.next) {
|
|
1090
|
+
case 0:
|
|
1091
|
+
contractAddress = _ref21.contractAddress, abi = _ref21.abi, _ref21$fromBlock = _ref21.fromBlock, fromBlock = _ref21$fromBlock === void 0 ? 0 : _ref21$fromBlock, toBlock = _ref21.toBlock, topics = _ref21.topics, _ref21$includeTransac = _ref21.includeTransaction, includeTransaction = _ref21$includeTransac === void 0 ? false : _ref21$includeTransac;
|
|
1092
|
+
filter = {
|
|
1093
|
+
address: contractAddress,
|
|
1094
|
+
fromBlock: fromBlock,
|
|
1095
|
+
toBlock: toBlock
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
if (topics) {
|
|
1099
|
+
filter.topics = topics;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
_context18.next = 5;
|
|
1103
|
+
return this.MakeProviderCall({
|
|
1104
|
+
methodName: "getLogs",
|
|
1105
|
+
args: [filter]
|
|
1106
|
+
});
|
|
998
1107
|
|
|
999
|
-
|
|
1000
|
-
_context18.
|
|
1001
|
-
|
|
1002
|
-
|
|
1108
|
+
case 5:
|
|
1109
|
+
_context18.t0 = _context18.sent;
|
|
1110
|
+
|
|
1111
|
+
if (_context18.t0) {
|
|
1112
|
+
_context18.next = 8;
|
|
1113
|
+
break;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
_context18.t0 = [];
|
|
1117
|
+
|
|
1118
|
+
case 8:
|
|
1119
|
+
contractLogs = _context18.t0;
|
|
1120
|
+
|
|
1121
|
+
if (Array.isArray(contractLogs)) {
|
|
1122
|
+
_context18.next = 11;
|
|
1123
|
+
break;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
return _context18.abrupt("return", []);
|
|
1127
|
+
|
|
1128
|
+
case 11:
|
|
1129
|
+
blocks = {};
|
|
1130
|
+
_context18.next = 14;
|
|
1131
|
+
return Utils.LimitedMap(5, contractLogs, /*#__PURE__*/function () {
|
|
1132
|
+
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(log) {
|
|
1133
|
+
var eventInterface, parsedLog;
|
|
1134
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1135
|
+
while (1) {
|
|
1136
|
+
switch (_context17.prev = _context17.next) {
|
|
1137
|
+
case 0:
|
|
1138
|
+
eventInterface = new Ethers.utils.Interface(abi);
|
|
1139
|
+
parsedLog = _objectSpread(_objectSpread({}, log), eventInterface.parseLog(log));
|
|
1140
|
+
|
|
1141
|
+
if (!includeTransaction) {
|
|
1142
|
+
_context17.next = 9;
|
|
1143
|
+
break;
|
|
1144
|
+
}
|
|
1003
1145
|
|
|
1004
|
-
|
|
1146
|
+
_context17.t0 = _objectSpread;
|
|
1147
|
+
_context17.t1 = _objectSpread({}, parsedLog);
|
|
1148
|
+
_context17.next = 7;
|
|
1149
|
+
return _this4.MakeProviderCall({
|
|
1150
|
+
methodName: "getTransaction",
|
|
1151
|
+
args: [log.transactionHash]
|
|
1152
|
+
});
|
|
1005
1153
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1154
|
+
case 7:
|
|
1155
|
+
_context17.t2 = _context17.sent;
|
|
1156
|
+
parsedLog = (0, _context17.t0)(_context17.t1, _context17.t2);
|
|
1008
1157
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
break;
|
|
1012
|
-
}
|
|
1158
|
+
case 9:
|
|
1159
|
+
blocks[log.blockNumber] = [parsedLog].concat(blocks[log.blockNumber] || []);
|
|
1013
1160
|
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
blocks = {};
|
|
1018
|
-
_context18.next = 14;
|
|
1019
|
-
return _regeneratorRuntime.awrap(Utils.LimitedMap(5, contractLogs, function _callee3(log) {
|
|
1020
|
-
var eventInterface, parsedLog;
|
|
1021
|
-
return _regeneratorRuntime.async(function _callee3$(_context17) {
|
|
1022
|
-
while (1) {
|
|
1023
|
-
switch (_context17.prev = _context17.next) {
|
|
1024
|
-
case 0:
|
|
1025
|
-
eventInterface = new Ethers.utils.Interface(abi);
|
|
1026
|
-
parsedLog = _objectSpread({}, log, {}, eventInterface.parseLog(log));
|
|
1027
|
-
|
|
1028
|
-
if (!includeTransaction) {
|
|
1029
|
-
_context17.next = 11;
|
|
1030
|
-
break;
|
|
1161
|
+
case 10:
|
|
1162
|
+
case "end":
|
|
1163
|
+
return _context17.stop();
|
|
1031
1164
|
}
|
|
1165
|
+
}
|
|
1166
|
+
}, _callee17);
|
|
1167
|
+
}));
|
|
1168
|
+
|
|
1169
|
+
return function (_x17) {
|
|
1170
|
+
return _ref22.apply(this, arguments);
|
|
1171
|
+
};
|
|
1172
|
+
}());
|
|
1173
|
+
|
|
1174
|
+
case 14:
|
|
1175
|
+
return _context18.abrupt("return", Object.values(blocks).sort(function (a, b) {
|
|
1176
|
+
return a[0].blockNumber < b[0].blockNumber ? 1 : -1;
|
|
1177
|
+
}));
|
|
1178
|
+
|
|
1179
|
+
case 15:
|
|
1180
|
+
case "end":
|
|
1181
|
+
return _context18.stop();
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}, _callee18, this);
|
|
1185
|
+
}));
|
|
1032
1186
|
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
_context17.t3 = {};
|
|
1037
|
-
_context17.next = 9;
|
|
1038
|
-
return _regeneratorRuntime.awrap(_this4.MakeProviderCall({
|
|
1039
|
-
methodName: "getTransaction",
|
|
1040
|
-
args: [log.transactionHash]
|
|
1041
|
-
}));
|
|
1042
|
-
|
|
1043
|
-
case 9:
|
|
1044
|
-
_context17.t4 = _context17.sent;
|
|
1045
|
-
parsedLog = (0, _context17.t0)(_context17.t1, _context17.t2, _context17.t3, _context17.t4);
|
|
1046
|
-
|
|
1047
|
-
case 11:
|
|
1048
|
-
blocks[log.blockNumber] = [parsedLog].concat(blocks[log.blockNumber] || []);
|
|
1049
|
-
|
|
1050
|
-
case 12:
|
|
1051
|
-
case "end":
|
|
1052
|
-
return _context17.stop();
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
});
|
|
1056
|
-
}));
|
|
1057
|
-
|
|
1058
|
-
case 14:
|
|
1059
|
-
return _context18.abrupt("return", Object.values(blocks).sort(function (a, b) {
|
|
1060
|
-
return a[0].blockNumber < b[0].blockNumber ? 1 : -1;
|
|
1061
|
-
}));
|
|
1187
|
+
function ContractEvents(_x16) {
|
|
1188
|
+
return _ContractEvents.apply(this, arguments);
|
|
1189
|
+
}
|
|
1062
1190
|
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
return _context18.stop();
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
}, null, this);
|
|
1069
|
-
} // Look up the log topic and see if it is known. If so, parse it and inject it into the log
|
|
1191
|
+
return ContractEvents;
|
|
1192
|
+
}() // Look up the log topic and see if it is known. If so, parse it and inject it into the log
|
|
1070
1193
|
|
|
1071
1194
|
}, {
|
|
1072
1195
|
key: "ParseUnknownLog",
|
|
1073
|
-
value: function ParseUnknownLog(
|
|
1074
|
-
var log =
|
|
1196
|
+
value: function ParseUnknownLog(_ref23) {
|
|
1197
|
+
var log = _ref23.log;
|
|
1075
1198
|
|
|
1076
1199
|
if (log.topics && log.topics.length > 0) {
|
|
1077
1200
|
var topicHash = log.topics[0];
|
|
@@ -1081,7 +1204,7 @@ function () {
|
|
|
1081
1204
|
var eventInterface = new Ethers.utils.Interface(topicInfo.abi);
|
|
1082
1205
|
|
|
1083
1206
|
if (eventInterface) {
|
|
1084
|
-
log = _objectSpread({}, log,
|
|
1207
|
+
log = _objectSpread(_objectSpread(_objectSpread({}, log), eventInterface.parseLog(log)), {}, {
|
|
1085
1208
|
contract: topicInfo.contract
|
|
1086
1209
|
});
|
|
1087
1210
|
}
|
|
@@ -1094,160 +1217,181 @@ function () {
|
|
|
1094
1217
|
|
|
1095
1218
|
}, {
|
|
1096
1219
|
key: "Events",
|
|
1097
|
-
value: function
|
|
1098
|
-
var
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1220
|
+
value: function () {
|
|
1221
|
+
var _Events = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref24) {
|
|
1222
|
+
var _this5 = this;
|
|
1223
|
+
|
|
1224
|
+
var toBlock, fromBlock, _ref24$includeTransac, includeTransaction, logs, i, newLogs, blocks, output;
|
|
1225
|
+
|
|
1226
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1227
|
+
while (1) {
|
|
1228
|
+
switch (_context21.prev = _context21.next) {
|
|
1229
|
+
case 0:
|
|
1230
|
+
toBlock = _ref24.toBlock, fromBlock = _ref24.fromBlock, _ref24$includeTransac = _ref24.includeTransaction, includeTransaction = _ref24$includeTransac === void 0 ? false : _ref24$includeTransac;
|
|
1231
|
+
// Pull logs in batches of 100
|
|
1232
|
+
logs = [];
|
|
1233
|
+
i = fromBlock;
|
|
1234
|
+
|
|
1235
|
+
case 3:
|
|
1236
|
+
if (!(i < toBlock)) {
|
|
1237
|
+
_context21.next = 11;
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
_context21.next = 6;
|
|
1242
|
+
return this.MakeProviderCall({
|
|
1243
|
+
methodName: "getLogs",
|
|
1244
|
+
args: [{
|
|
1245
|
+
fromBlock: i,
|
|
1246
|
+
toBlock: Math.min(toBlock, i + 100)
|
|
1247
|
+
}]
|
|
1248
|
+
});
|
|
1249
|
+
|
|
1250
|
+
case 6:
|
|
1251
|
+
newLogs = _context21.sent;
|
|
1252
|
+
logs = logs.concat(newLogs || []);
|
|
1253
|
+
|
|
1254
|
+
case 8:
|
|
1255
|
+
i += 101;
|
|
1256
|
+
_context21.next = 3;
|
|
1114
1257
|
break;
|
|
1115
|
-
}
|
|
1116
1258
|
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
})].concat(blocks[log.blockNumber] || []);
|
|
1142
|
-
});
|
|
1143
|
-
output = [];
|
|
1144
|
-
_context21.next = 16;
|
|
1145
|
-
return _regeneratorRuntime.awrap(Utils.LimitedMap(3, _toConsumableArray(Array(toBlock - fromBlock + 1).keys()), function _callee5(i) {
|
|
1146
|
-
var blockNumber, blockInfo, transactionInfo;
|
|
1147
|
-
return _regeneratorRuntime.async(function _callee5$(_context20) {
|
|
1148
|
-
while (1) {
|
|
1149
|
-
switch (_context20.prev = _context20.next) {
|
|
1150
|
-
case 0:
|
|
1151
|
-
blockNumber = toBlock - i;
|
|
1152
|
-
blockInfo = blocks[blockNumber];
|
|
1153
|
-
|
|
1154
|
-
if (blockInfo) {
|
|
1155
|
-
_context20.next = 8;
|
|
1156
|
-
break;
|
|
1157
|
-
}
|
|
1259
|
+
case 11:
|
|
1260
|
+
// Group logs by blocknumber
|
|
1261
|
+
blocks = {};
|
|
1262
|
+
logs.forEach(function (log) {
|
|
1263
|
+
blocks[log.blockNumber] = [_this5.ParseUnknownLog({
|
|
1264
|
+
log: log
|
|
1265
|
+
})].concat(blocks[log.blockNumber] || []);
|
|
1266
|
+
});
|
|
1267
|
+
output = [];
|
|
1268
|
+
_context21.next = 16;
|
|
1269
|
+
return Utils.LimitedMap(3, _toConsumableArray(Array(toBlock - fromBlock + 1).keys()), /*#__PURE__*/function () {
|
|
1270
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(i) {
|
|
1271
|
+
var blockNumber, blockInfo, transactionInfo;
|
|
1272
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1273
|
+
while (1) {
|
|
1274
|
+
switch (_context20.prev = _context20.next) {
|
|
1275
|
+
case 0:
|
|
1276
|
+
blockNumber = toBlock - i;
|
|
1277
|
+
blockInfo = blocks[blockNumber];
|
|
1278
|
+
|
|
1279
|
+
if (blockInfo) {
|
|
1280
|
+
_context20.next = 8;
|
|
1281
|
+
break;
|
|
1282
|
+
}
|
|
1158
1283
|
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1284
|
+
_context20.next = 5;
|
|
1285
|
+
return _this5.MakeProviderCall({
|
|
1286
|
+
methodName: "getBlock",
|
|
1287
|
+
args: [blockNumber]
|
|
1288
|
+
});
|
|
1289
|
+
|
|
1290
|
+
case 5:
|
|
1291
|
+
blockInfo = _context20.sent;
|
|
1292
|
+
blockInfo = blockInfo.transactions.map(function (transactionHash) {
|
|
1293
|
+
return _objectSpread(_objectSpread({
|
|
1294
|
+
blockNumber: blockInfo.number,
|
|
1295
|
+
blockHash: blockInfo.hash
|
|
1296
|
+
}, blockInfo), {}, {
|
|
1297
|
+
transactionHash: transactionHash
|
|
1298
|
+
});
|
|
1299
|
+
});
|
|
1300
|
+
blocks[blockNumber] = blockInfo;
|
|
1301
|
+
|
|
1302
|
+
case 8:
|
|
1303
|
+
if (!includeTransaction) {
|
|
1304
|
+
_context20.next = 13;
|
|
1305
|
+
break;
|
|
1306
|
+
}
|
|
1182
1307
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1308
|
+
transactionInfo = {};
|
|
1309
|
+
_context20.next = 12;
|
|
1310
|
+
return Promise.all(blockInfo.map( /*#__PURE__*/function () {
|
|
1311
|
+
var _ref26 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(block) {
|
|
1312
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1313
|
+
while (1) {
|
|
1314
|
+
switch (_context19.prev = _context19.next) {
|
|
1315
|
+
case 0:
|
|
1316
|
+
if (transactionInfo[block.transactionHash]) {
|
|
1317
|
+
_context19.next = 12;
|
|
1318
|
+
break;
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
_context19.t0 = _objectSpread;
|
|
1322
|
+
_context19.t1 = _objectSpread;
|
|
1323
|
+
_context19.t2 = {};
|
|
1324
|
+
_context19.next = 6;
|
|
1325
|
+
return _this5.MakeProviderCall({
|
|
1326
|
+
methodName: "getTransaction",
|
|
1327
|
+
args: [block.transactionHash]
|
|
1328
|
+
});
|
|
1329
|
+
|
|
1330
|
+
case 6:
|
|
1331
|
+
_context19.t3 = _context19.sent;
|
|
1332
|
+
_context19.t4 = (0, _context19.t1)(_context19.t2, _context19.t3);
|
|
1333
|
+
_context19.next = 10;
|
|
1334
|
+
return _this5.MakeProviderCall({
|
|
1335
|
+
methodName: "getTransactionReceipt",
|
|
1336
|
+
args: [block.transactionHash]
|
|
1337
|
+
});
|
|
1338
|
+
|
|
1339
|
+
case 10:
|
|
1340
|
+
_context19.t5 = _context19.sent;
|
|
1341
|
+
transactionInfo[block.transactionHash] = (0, _context19.t0)(_context19.t4, _context19.t5);
|
|
1342
|
+
|
|
1343
|
+
case 12:
|
|
1344
|
+
return _context19.abrupt("return", _objectSpread(_objectSpread({}, block), transactionInfo[block.transactionHash]));
|
|
1345
|
+
|
|
1346
|
+
case 13:
|
|
1347
|
+
case "end":
|
|
1348
|
+
return _context19.stop();
|
|
1349
|
+
}
|
|
1193
1350
|
}
|
|
1351
|
+
}, _callee19);
|
|
1352
|
+
}));
|
|
1194
1353
|
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
methodName: "getTransaction",
|
|
1200
|
-
args: [block.transactionHash]
|
|
1201
|
-
}));
|
|
1202
|
-
|
|
1203
|
-
case 5:
|
|
1204
|
-
_context19.t2 = _context19.sent;
|
|
1205
|
-
_context19.t3 = {};
|
|
1206
|
-
_context19.next = 9;
|
|
1207
|
-
return _regeneratorRuntime.awrap(_this5.MakeProviderCall({
|
|
1208
|
-
methodName: "getTransactionReceipt",
|
|
1209
|
-
args: [block.transactionHash]
|
|
1210
|
-
}));
|
|
1211
|
-
|
|
1212
|
-
case 9:
|
|
1213
|
-
_context19.t4 = _context19.sent;
|
|
1214
|
-
transactionInfo[block.transactionHash] = (0, _context19.t0)(_context19.t1, _context19.t2, _context19.t3, _context19.t4);
|
|
1215
|
-
|
|
1216
|
-
case 11:
|
|
1217
|
-
return _context19.abrupt("return", _objectSpread({}, block, {}, transactionInfo[block.transactionHash]));
|
|
1218
|
-
|
|
1219
|
-
case 12:
|
|
1220
|
-
case "end":
|
|
1221
|
-
return _context19.stop();
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
});
|
|
1225
|
-
})));
|
|
1354
|
+
return function (_x20) {
|
|
1355
|
+
return _ref26.apply(this, arguments);
|
|
1356
|
+
};
|
|
1357
|
+
}()));
|
|
1226
1358
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1359
|
+
case 12:
|
|
1360
|
+
blocks[blockNumber] = _context20.sent;
|
|
1229
1361
|
|
|
1230
|
-
|
|
1231
|
-
|
|
1362
|
+
case 13:
|
|
1363
|
+
output.push(blocks[blockNumber]);
|
|
1232
1364
|
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1365
|
+
case 14:
|
|
1366
|
+
case "end":
|
|
1367
|
+
return _context20.stop();
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
}, _callee20);
|
|
1371
|
+
}));
|
|
1240
1372
|
|
|
1241
|
-
|
|
1242
|
-
|
|
1373
|
+
return function (_x19) {
|
|
1374
|
+
return _ref25.apply(this, arguments);
|
|
1375
|
+
};
|
|
1376
|
+
}());
|
|
1243
1377
|
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1378
|
+
case 16:
|
|
1379
|
+
return _context21.abrupt("return", output);
|
|
1380
|
+
|
|
1381
|
+
case 17:
|
|
1382
|
+
case "end":
|
|
1383
|
+
return _context21.stop();
|
|
1384
|
+
}
|
|
1247
1385
|
}
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1386
|
+
}, _callee21, this);
|
|
1387
|
+
}));
|
|
1388
|
+
|
|
1389
|
+
function Events(_x18) {
|
|
1390
|
+
return _Events.apply(this, arguments);
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
return Events;
|
|
1394
|
+
}()
|
|
1251
1395
|
}]);
|
|
1252
1396
|
|
|
1253
1397
|
return EthClient;
|