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