@ethereansos/interfaces-core 0.4.131 → 0.4.132
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +20 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +20 -10
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -23767,43 +23767,53 @@ function instrumentProvider(_x, _x2) {
|
|
23767
23767
|
|
23768
23768
|
function _instrumentProvider() {
|
23769
23769
|
_instrumentProvider = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(provider, method) {
|
23770
|
+
var _instrumentableMethod;
|
23771
|
+
|
23770
23772
|
var instrumentableMethods, entry, chainId, _ref, chainProvider;
|
23771
23773
|
|
23772
23774
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
23773
23775
|
while (1) {
|
23774
23776
|
switch (_context.prev = _context.next) {
|
23775
23777
|
case 0:
|
23776
|
-
instrumentableMethods =
|
23778
|
+
instrumentableMethods = [];
|
23777
23779
|
|
23778
23780
|
try {
|
23779
|
-
instrumentableMethods = sendAsync.context.providerInstrumentableMethods;
|
23781
|
+
instrumentableMethods = _toConsumableArray(sendAsync.context.providerInstrumentableMethods || []);
|
23780
23782
|
} catch (e) {}
|
23781
23783
|
|
23782
|
-
|
23783
|
-
|
23784
|
+
(_instrumentableMethod = instrumentableMethods).push.apply(_instrumentableMethod, defaultInstrumentableMethods);
|
23785
|
+
|
23786
|
+
instrumentableMethods = instrumentableMethods.map(function (it) {
|
23787
|
+
return it.toLowerCase();
|
23788
|
+
}).filter(function (it, i, arr) {
|
23789
|
+
return arr.indexOf(it) === i;
|
23790
|
+
});
|
23791
|
+
|
23792
|
+
if (!(instrumentableMethods.indexOf(method.toLowerCase()) === -1)) {
|
23793
|
+
_context.next = 6;
|
23784
23794
|
break;
|
23785
23795
|
}
|
23786
23796
|
|
23787
23797
|
return _context.abrupt("return", provider);
|
23788
23798
|
|
23789
|
-
case
|
23799
|
+
case 6:
|
23790
23800
|
entry = instrumentedProviders.filter(function (it) {
|
23791
23801
|
return it.provider === provider;
|
23792
23802
|
})[0];
|
23793
23803
|
|
23794
23804
|
if (!entry) {
|
23795
|
-
_context.next =
|
23805
|
+
_context.next = 9;
|
23796
23806
|
break;
|
23797
23807
|
}
|
23798
23808
|
|
23799
23809
|
return _context.abrupt("return", entry.instrumentedProvider);
|
23800
23810
|
|
23801
|
-
case
|
23811
|
+
case 9:
|
23802
23812
|
_context.t0 = parseInt;
|
23803
|
-
_context.next =
|
23813
|
+
_context.next = 12;
|
23804
23814
|
return sendAsync(provider, 'eth_chainId');
|
23805
23815
|
|
23806
|
-
case
|
23816
|
+
case 12:
|
23807
23817
|
_context.t1 = _context.sent;
|
23808
23818
|
chainId = (0, _context.t0)(_context.t1);
|
23809
23819
|
instrumentedProviders.push(entry = {
|
@@ -23816,7 +23826,7 @@ function _instrumentProvider() {
|
|
23816
23826
|
}, chainProvider = _ref.chainProvider;
|
23817
23827
|
return _context.abrupt("return", entry.instrumentedProvider = chainId !== 1 && chainProvider[chainId] ? new Web3__default["default"].providers.HttpProvider(chainProvider[chainId]) : provider);
|
23818
23828
|
|
23819
|
-
case
|
23829
|
+
case 17:
|
23820
23830
|
case "end":
|
23821
23831
|
return _context.stop();
|
23822
23832
|
}
|