@ethereansos/interfaces-core 0.4.18 → 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 CHANGED
@@ -12198,6 +12198,56 @@ function _loadTokenInfos() {
12198
12198
  return _loadTokenInfos.apply(this, arguments);
12199
12199
  }
12200
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
+
12201
12251
  var pubsub = {exports: {}};
12202
12252
 
12203
12253
  /**
@@ -13439,6 +13489,8 @@ var Web3ContextProvider = function Web3ContextProvider(props) {
13439
13489
 
13440
13490
  var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
13441
13491
  var children = _ref.children;
13492
+ var test = useWeb3React();
13493
+ console.log(test);
13442
13494
 
13443
13495
  var _useState = React.useState(WEB3_CONTEXT_STATUS_NEW),
13444
13496
  _useState2 = _slicedToArray(_useState, 2),
package/dist/index.esm.js CHANGED
@@ -12189,6 +12189,56 @@ function _loadTokenInfos() {
12189
12189
  return _loadTokenInfos.apply(this, arguments);
12190
12190
  }
12191
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
+
12192
12242
  var pubsub = {exports: {}};
12193
12243
 
12194
12244
  /**
@@ -13430,6 +13480,8 @@ var Web3ContextProvider = function Web3ContextProvider(props) {
13430
13480
 
13431
13481
  var Web3ContextInitializer = function Web3ContextInitializer(_ref) {
13432
13482
  var children = _ref.children;
13483
+ var test = useWeb3React();
13484
+ console.log(test);
13433
13485
 
13434
13486
  var _useState = useState(WEB3_CONTEXT_STATUS_NEW),
13435
13487
  _useState2 = _slicedToArray(_useState, 2),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethereansos/interfaces-core",
3
- "version": "0.4.18",
3
+ "version": "0.4.19",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",