@ethereansos/interfaces-core 0.4.14 → 0.4.19
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/index.cjs.js +79 -17
- package/dist/index.esm.js +79 -17
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
@@ -804,7 +804,7 @@ function sendAsync(provider, method) {
|
|
804
804
|
_context.prev = 0;
|
805
805
|
_context.next = 3;
|
806
806
|
return (provider.sendAsync || provider.send).call(provider, {
|
807
|
-
|
807
|
+
jsonrpc: '2.0',
|
808
808
|
method: method,
|
809
809
|
params: params,
|
810
810
|
id: new Date().getTime()
|
@@ -11339,7 +11339,7 @@ nhp.Node;
|
|
11339
11339
|
nhp.TextNode;
|
11340
11340
|
nhp.NodeType;
|
11341
11341
|
|
11342
|
-
var url =
|
11342
|
+
var url = 'https://etherscan.io/gastracker/';
|
11343
11343
|
function gasCalculator(_x) {
|
11344
11344
|
return _gasCalculator.apply(this, arguments);
|
11345
11345
|
}
|
@@ -11364,7 +11364,7 @@ function _gasCalculator() {
|
|
11364
11364
|
break;
|
11365
11365
|
}
|
11366
11366
|
|
11367
|
-
return _context2.abrupt("return",
|
11367
|
+
return _context2.abrupt("return", '1.500000009');
|
11368
11368
|
|
11369
11369
|
case 7:
|
11370
11370
|
_context2.next = 9;
|
@@ -11376,7 +11376,7 @@ function _gasCalculator() {
|
|
11376
11376
|
switch (_context.prev = _context.next) {
|
11377
11377
|
case 0:
|
11378
11378
|
backup = function backup() {
|
11379
|
-
return ok(
|
11379
|
+
return ok('2000000000');
|
11380
11380
|
};
|
11381
11381
|
|
11382
11382
|
_context.prev = 1;
|
@@ -11391,7 +11391,7 @@ function _gasCalculator() {
|
|
11391
11391
|
|
11392
11392
|
case 8:
|
11393
11393
|
_context.t2 = _context.sent;
|
11394
|
-
_context.t3 = (0, _context.t1)(_context.t2).querySelectorAll(
|
11394
|
+
_context.t3 = (0, _context.t1)(_context.t2).querySelectorAll('#spanHighPrice')[0].innerHTML.trim();
|
11395
11395
|
gas = (0, _context.t0)(_context.t3);
|
11396
11396
|
return _context.abrupt("return", ok(numberToString(parseInt(numberToString(gas * 1.3)))));
|
11397
11397
|
|
@@ -11468,7 +11468,7 @@ function sendBlockchainTransaction(provider, fromOrPlainPrivateKey, to, data, va
|
|
11468
11468
|
_context2.prev = 0;
|
11469
11469
|
tx = {};
|
11470
11470
|
_context2.next = 4;
|
11471
|
-
return sendAsync(provider, 'eth_getTransactionCount', address,
|
11471
|
+
return sendAsync(provider, 'eth_getTransactionCount', address, 'latest');
|
11472
11472
|
|
11473
11473
|
case 4:
|
11474
11474
|
nonce = _context2.sent;
|
@@ -11601,7 +11601,7 @@ function sendBlockchainTransaction(provider, fromOrPlainPrivateKey, to, data, va
|
|
11601
11601
|
|
11602
11602
|
case 72:
|
11603
11603
|
transactionHash = _context2.sent;
|
11604
|
-
console.log(new Date().toUTCString(),
|
11604
|
+
console.log(new Date().toUTCString(), 'Transaction!', getEtherscanAddress('tx/' + transactionHash, tx.chainId));
|
11605
11605
|
|
11606
11606
|
timeout = /*#__PURE__*/function () {
|
11607
11607
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
@@ -11943,7 +11943,7 @@ function _blockchainCall() {
|
|
11943
11943
|
_context.prev = 0;
|
11944
11944
|
_context.t0 = web3.utils;
|
11945
11945
|
_context.next = 4;
|
11946
|
-
return sendAsync(method._parent.currentProvider,
|
11946
|
+
return sendAsync(method._parent.currentProvider, 'eth_getCode', address, 'latest');
|
11947
11947
|
|
11948
11948
|
case 4:
|
11949
11949
|
_context.t1 = _context.sent;
|
@@ -11952,27 +11952,26 @@ function _blockchainCall() {
|
|
11952
11952
|
if (!key) {
|
11953
11953
|
setTimeout(set);
|
11954
11954
|
}
|
11955
|
-
|
11956
11955
|
(global.compiledContracts = global.compiledContracts || {})[key] = {
|
11957
11956
|
name: method._parent.name,
|
11958
11957
|
abi: method._parent.abi
|
11959
11958
|
};
|
11960
|
-
_context.next =
|
11959
|
+
_context.next = 13;
|
11961
11960
|
break;
|
11962
11961
|
|
11963
|
-
case
|
11964
|
-
_context.prev =
|
11962
|
+
case 11:
|
11963
|
+
_context.prev = 11;
|
11965
11964
|
_context.t2 = _context["catch"](0);
|
11966
11965
|
|
11967
|
-
case
|
11966
|
+
case 13:
|
11968
11967
|
return _context.abrupt("return", ok());
|
11969
11968
|
|
11970
|
-
case
|
11969
|
+
case 14:
|
11971
11970
|
case "end":
|
11972
11971
|
return _context.stop();
|
11973
11972
|
}
|
11974
11973
|
}
|
11975
|
-
}, _callee, null, [[0,
|
11974
|
+
}, _callee, null, [[0, 11]]);
|
11976
11975
|
}));
|
11977
11976
|
|
11978
11977
|
return function set() {
|
@@ -12199,6 +12198,56 @@ function _loadTokenInfos() {
|
|
12199
12198
|
return _loadTokenInfos.apply(this, arguments);
|
12200
12199
|
}
|
12201
12200
|
|
12201
|
+
var isProduction = process.env.NODE_ENV === 'production';
|
12202
|
+
var prefix = 'Invariant failed';
|
12203
|
+
function invariant(condition, message) {
|
12204
|
+
if (condition) {
|
12205
|
+
return;
|
12206
|
+
}
|
12207
|
+
if (isProduction) {
|
12208
|
+
throw new Error(prefix);
|
12209
|
+
}
|
12210
|
+
var provided = typeof message === 'function' ? message() : message;
|
12211
|
+
var value = provided ? prefix + ": " + provided : prefix;
|
12212
|
+
throw new Error(value);
|
12213
|
+
}
|
12214
|
+
|
12215
|
+
var ConnectorEvent;
|
12216
|
+
|
12217
|
+
(function (ConnectorEvent) {
|
12218
|
+
ConnectorEvent["Update"] = "Web3ReactUpdate";
|
12219
|
+
ConnectorEvent["Error"] = "Web3ReactError";
|
12220
|
+
ConnectorEvent["Deactivate"] = "Web3ReactDeactivate";
|
12221
|
+
})(ConnectorEvent || (ConnectorEvent = {}));
|
12222
|
+
|
12223
|
+
// A type of promise-like that resolves synchronously and supports only one observer
|
12224
|
+
typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = /*#__PURE__*/Symbol("Symbol.iterator")) : "@@iterator"; // Asynchronously iterate through an object's values
|
12225
|
+
typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = /*#__PURE__*/Symbol("Symbol.asyncIterator")) : "@@asyncIterator"; // Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing
|
12226
|
+
var ActionType;
|
12227
|
+
|
12228
|
+
(function (ActionType) {
|
12229
|
+
ActionType[ActionType["ACTIVATE_CONNECTOR"] = 0] = "ACTIVATE_CONNECTOR";
|
12230
|
+
ActionType[ActionType["UPDATE"] = 1] = "UPDATE";
|
12231
|
+
ActionType[ActionType["UPDATE_FROM_ERROR"] = 2] = "UPDATE_FROM_ERROR";
|
12232
|
+
ActionType[ActionType["ERROR"] = 3] = "ERROR";
|
12233
|
+
ActionType[ActionType["ERROR_FROM_ACTIVATION"] = 4] = "ERROR_FROM_ACTIVATION";
|
12234
|
+
ActionType[ActionType["DEACTIVATE_CONNECTOR"] = 5] = "DEACTIVATE_CONNECTOR";
|
12235
|
+
})(ActionType || (ActionType = {}));
|
12236
|
+
|
12237
|
+
var PRIMARY_KEY = 'primary';
|
12238
|
+
var CONTEXTS = {};
|
12239
|
+
function getWeb3ReactContext(key) {
|
12240
|
+
if (key === void 0) {
|
12241
|
+
key = PRIMARY_KEY;
|
12242
|
+
}
|
12243
|
+
|
12244
|
+
!Object.keys(CONTEXTS).includes(key) ? process.env.NODE_ENV !== "production" ? invariant(false, "Invalid key " + key) : invariant(false) : void 0;
|
12245
|
+
return CONTEXTS[key];
|
12246
|
+
}
|
12247
|
+
function useWeb3React(key) {
|
12248
|
+
return React.useContext(getWeb3ReactContext(key));
|
12249
|
+
}
|
12250
|
+
|
12202
12251
|
var pubsub = {exports: {}};
|
12203
12252
|
|
12204
12253
|
/**
|
@@ -13440,6 +13489,8 @@ var Web3ContextProvider = function Web3ContextProvider(props) {
|
|
13440
13489
|
|
13441
13490
|
var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
13442
13491
|
var children = _ref.children;
|
13492
|
+
var test = useWeb3React();
|
13493
|
+
console.log(test);
|
13443
13494
|
|
13444
13495
|
var _useState = React.useState(WEB3_CONTEXT_STATUS_NEW),
|
13445
13496
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -13465,9 +13516,11 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
|
13465
13516
|
|
13466
13517
|
var afterInitFunctionList = usePlaceholder('web3/afterInit');
|
13467
13518
|
React.useEffect(function () {
|
13519
|
+
console.log(wallet, wallet && wallet.ethereum);
|
13468
13520
|
setState(function (s) {
|
13469
13521
|
return _objectSpread2(_objectSpread2({}, s), {}, {
|
13470
|
-
wallet: wallet
|
13522
|
+
wallet: wallet,
|
13523
|
+
connectionStatus: wallet && wallet.ethereum ? CONNECTED : s.connectionStatus || NOT_CONNECTED
|
13471
13524
|
});
|
13472
13525
|
});
|
13473
13526
|
}, [wallet]);
|
@@ -13529,7 +13582,16 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
|
13529
13582
|
|
13530
13583
|
var values = _objectSpread2(_objectSpread2(_objectSpread2({}, methods), state), {}, {
|
13531
13584
|
ethosEvents: PubSub,
|
13532
|
-
context: context
|
13585
|
+
context: context,
|
13586
|
+
disconnect: function disconnect() {
|
13587
|
+
wallet && wallet.reset();
|
13588
|
+
setState(function (s) {
|
13589
|
+
return _objectSpread2(_objectSpread2({}, s), {}, {
|
13590
|
+
wallet: wallet,
|
13591
|
+
connectionStatus: NOT_CONNECTED
|
13592
|
+
});
|
13593
|
+
});
|
13594
|
+
}
|
13533
13595
|
});
|
13534
13596
|
|
13535
13597
|
return /*#__PURE__*/React__default["default"].createElement(Web3Context.Provider, {
|
package/dist/index.esm.js
CHANGED
@@ -795,7 +795,7 @@ function sendAsync(provider, method) {
|
|
795
795
|
_context.prev = 0;
|
796
796
|
_context.next = 3;
|
797
797
|
return (provider.sendAsync || provider.send).call(provider, {
|
798
|
-
|
798
|
+
jsonrpc: '2.0',
|
799
799
|
method: method,
|
800
800
|
params: params,
|
801
801
|
id: new Date().getTime()
|
@@ -11330,7 +11330,7 @@ nhp.Node;
|
|
11330
11330
|
nhp.TextNode;
|
11331
11331
|
nhp.NodeType;
|
11332
11332
|
|
11333
|
-
var url =
|
11333
|
+
var url = 'https://etherscan.io/gastracker/';
|
11334
11334
|
function gasCalculator(_x) {
|
11335
11335
|
return _gasCalculator.apply(this, arguments);
|
11336
11336
|
}
|
@@ -11355,7 +11355,7 @@ function _gasCalculator() {
|
|
11355
11355
|
break;
|
11356
11356
|
}
|
11357
11357
|
|
11358
|
-
return _context2.abrupt("return",
|
11358
|
+
return _context2.abrupt("return", '1.500000009');
|
11359
11359
|
|
11360
11360
|
case 7:
|
11361
11361
|
_context2.next = 9;
|
@@ -11367,7 +11367,7 @@ function _gasCalculator() {
|
|
11367
11367
|
switch (_context.prev = _context.next) {
|
11368
11368
|
case 0:
|
11369
11369
|
backup = function backup() {
|
11370
|
-
return ok(
|
11370
|
+
return ok('2000000000');
|
11371
11371
|
};
|
11372
11372
|
|
11373
11373
|
_context.prev = 1;
|
@@ -11382,7 +11382,7 @@ function _gasCalculator() {
|
|
11382
11382
|
|
11383
11383
|
case 8:
|
11384
11384
|
_context.t2 = _context.sent;
|
11385
|
-
_context.t3 = (0, _context.t1)(_context.t2).querySelectorAll(
|
11385
|
+
_context.t3 = (0, _context.t1)(_context.t2).querySelectorAll('#spanHighPrice')[0].innerHTML.trim();
|
11386
11386
|
gas = (0, _context.t0)(_context.t3);
|
11387
11387
|
return _context.abrupt("return", ok(numberToString(parseInt(numberToString(gas * 1.3)))));
|
11388
11388
|
|
@@ -11459,7 +11459,7 @@ function sendBlockchainTransaction(provider, fromOrPlainPrivateKey, to, data, va
|
|
11459
11459
|
_context2.prev = 0;
|
11460
11460
|
tx = {};
|
11461
11461
|
_context2.next = 4;
|
11462
|
-
return sendAsync(provider, 'eth_getTransactionCount', address,
|
11462
|
+
return sendAsync(provider, 'eth_getTransactionCount', address, 'latest');
|
11463
11463
|
|
11464
11464
|
case 4:
|
11465
11465
|
nonce = _context2.sent;
|
@@ -11592,7 +11592,7 @@ function sendBlockchainTransaction(provider, fromOrPlainPrivateKey, to, data, va
|
|
11592
11592
|
|
11593
11593
|
case 72:
|
11594
11594
|
transactionHash = _context2.sent;
|
11595
|
-
console.log(new Date().toUTCString(),
|
11595
|
+
console.log(new Date().toUTCString(), 'Transaction!', getEtherscanAddress('tx/' + transactionHash, tx.chainId));
|
11596
11596
|
|
11597
11597
|
timeout = /*#__PURE__*/function () {
|
11598
11598
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
@@ -11934,7 +11934,7 @@ function _blockchainCall() {
|
|
11934
11934
|
_context.prev = 0;
|
11935
11935
|
_context.t0 = web3.utils;
|
11936
11936
|
_context.next = 4;
|
11937
|
-
return sendAsync(method._parent.currentProvider,
|
11937
|
+
return sendAsync(method._parent.currentProvider, 'eth_getCode', address, 'latest');
|
11938
11938
|
|
11939
11939
|
case 4:
|
11940
11940
|
_context.t1 = _context.sent;
|
@@ -11943,27 +11943,26 @@ function _blockchainCall() {
|
|
11943
11943
|
if (!key) {
|
11944
11944
|
setTimeout(set);
|
11945
11945
|
}
|
11946
|
-
|
11947
11946
|
(global.compiledContracts = global.compiledContracts || {})[key] = {
|
11948
11947
|
name: method._parent.name,
|
11949
11948
|
abi: method._parent.abi
|
11950
11949
|
};
|
11951
|
-
_context.next =
|
11950
|
+
_context.next = 13;
|
11952
11951
|
break;
|
11953
11952
|
|
11954
|
-
case
|
11955
|
-
_context.prev =
|
11953
|
+
case 11:
|
11954
|
+
_context.prev = 11;
|
11956
11955
|
_context.t2 = _context["catch"](0);
|
11957
11956
|
|
11958
|
-
case
|
11957
|
+
case 13:
|
11959
11958
|
return _context.abrupt("return", ok());
|
11960
11959
|
|
11961
|
-
case
|
11960
|
+
case 14:
|
11962
11961
|
case "end":
|
11963
11962
|
return _context.stop();
|
11964
11963
|
}
|
11965
11964
|
}
|
11966
|
-
}, _callee, null, [[0,
|
11965
|
+
}, _callee, null, [[0, 11]]);
|
11967
11966
|
}));
|
11968
11967
|
|
11969
11968
|
return function set() {
|
@@ -12190,6 +12189,56 @@ function _loadTokenInfos() {
|
|
12190
12189
|
return _loadTokenInfos.apply(this, arguments);
|
12191
12190
|
}
|
12192
12191
|
|
12192
|
+
var isProduction = process.env.NODE_ENV === 'production';
|
12193
|
+
var prefix = 'Invariant failed';
|
12194
|
+
function invariant(condition, message) {
|
12195
|
+
if (condition) {
|
12196
|
+
return;
|
12197
|
+
}
|
12198
|
+
if (isProduction) {
|
12199
|
+
throw new Error(prefix);
|
12200
|
+
}
|
12201
|
+
var provided = typeof message === 'function' ? message() : message;
|
12202
|
+
var value = provided ? prefix + ": " + provided : prefix;
|
12203
|
+
throw new Error(value);
|
12204
|
+
}
|
12205
|
+
|
12206
|
+
var ConnectorEvent;
|
12207
|
+
|
12208
|
+
(function (ConnectorEvent) {
|
12209
|
+
ConnectorEvent["Update"] = "Web3ReactUpdate";
|
12210
|
+
ConnectorEvent["Error"] = "Web3ReactError";
|
12211
|
+
ConnectorEvent["Deactivate"] = "Web3ReactDeactivate";
|
12212
|
+
})(ConnectorEvent || (ConnectorEvent = {}));
|
12213
|
+
|
12214
|
+
// A type of promise-like that resolves synchronously and supports only one observer
|
12215
|
+
typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = /*#__PURE__*/Symbol("Symbol.iterator")) : "@@iterator"; // Asynchronously iterate through an object's values
|
12216
|
+
typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = /*#__PURE__*/Symbol("Symbol.asyncIterator")) : "@@asyncIterator"; // Asynchronously iterate on a value using it's async iterator if present, or its synchronous iterator if missing
|
12217
|
+
var ActionType;
|
12218
|
+
|
12219
|
+
(function (ActionType) {
|
12220
|
+
ActionType[ActionType["ACTIVATE_CONNECTOR"] = 0] = "ACTIVATE_CONNECTOR";
|
12221
|
+
ActionType[ActionType["UPDATE"] = 1] = "UPDATE";
|
12222
|
+
ActionType[ActionType["UPDATE_FROM_ERROR"] = 2] = "UPDATE_FROM_ERROR";
|
12223
|
+
ActionType[ActionType["ERROR"] = 3] = "ERROR";
|
12224
|
+
ActionType[ActionType["ERROR_FROM_ACTIVATION"] = 4] = "ERROR_FROM_ACTIVATION";
|
12225
|
+
ActionType[ActionType["DEACTIVATE_CONNECTOR"] = 5] = "DEACTIVATE_CONNECTOR";
|
12226
|
+
})(ActionType || (ActionType = {}));
|
12227
|
+
|
12228
|
+
var PRIMARY_KEY = 'primary';
|
12229
|
+
var CONTEXTS = {};
|
12230
|
+
function getWeb3ReactContext(key) {
|
12231
|
+
if (key === void 0) {
|
12232
|
+
key = PRIMARY_KEY;
|
12233
|
+
}
|
12234
|
+
|
12235
|
+
!Object.keys(CONTEXTS).includes(key) ? process.env.NODE_ENV !== "production" ? invariant(false, "Invalid key " + key) : invariant(false) : void 0;
|
12236
|
+
return CONTEXTS[key];
|
12237
|
+
}
|
12238
|
+
function useWeb3React(key) {
|
12239
|
+
return useContext(getWeb3ReactContext(key));
|
12240
|
+
}
|
12241
|
+
|
12193
12242
|
var pubsub = {exports: {}};
|
12194
12243
|
|
12195
12244
|
/**
|
@@ -13431,6 +13480,8 @@ var Web3ContextProvider = function Web3ContextProvider(props) {
|
|
13431
13480
|
|
13432
13481
|
var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
13433
13482
|
var children = _ref.children;
|
13483
|
+
var test = useWeb3React();
|
13484
|
+
console.log(test);
|
13434
13485
|
|
13435
13486
|
var _useState = useState(WEB3_CONTEXT_STATUS_NEW),
|
13436
13487
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -13456,9 +13507,11 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
|
13456
13507
|
|
13457
13508
|
var afterInitFunctionList = usePlaceholder('web3/afterInit');
|
13458
13509
|
useEffect(function () {
|
13510
|
+
console.log(wallet, wallet && wallet.ethereum);
|
13459
13511
|
setState(function (s) {
|
13460
13512
|
return _objectSpread2(_objectSpread2({}, s), {}, {
|
13461
|
-
wallet: wallet
|
13513
|
+
wallet: wallet,
|
13514
|
+
connectionStatus: wallet && wallet.ethereum ? CONNECTED : s.connectionStatus || NOT_CONNECTED
|
13462
13515
|
});
|
13463
13516
|
});
|
13464
13517
|
}, [wallet]);
|
@@ -13520,7 +13573,16 @@ var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
|
|
13520
13573
|
|
13521
13574
|
var values = _objectSpread2(_objectSpread2(_objectSpread2({}, methods), state), {}, {
|
13522
13575
|
ethosEvents: PubSub,
|
13523
|
-
context: context
|
13576
|
+
context: context,
|
13577
|
+
disconnect: function disconnect() {
|
13578
|
+
wallet && wallet.reset();
|
13579
|
+
setState(function (s) {
|
13580
|
+
return _objectSpread2(_objectSpread2({}, s), {}, {
|
13581
|
+
wallet: wallet,
|
13582
|
+
connectionStatus: NOT_CONNECTED
|
13583
|
+
});
|
13584
|
+
});
|
13585
|
+
}
|
13524
13586
|
});
|
13525
13587
|
|
13526
13588
|
return /*#__PURE__*/React.createElement(Web3Context.Provider, {
|