@ethereansos/interfaces-core 0.4.107 → 0.4.108

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
@@ -48779,6 +48779,48 @@ var useEthosContext = function useEthosContext() {
48779
48779
  var Web3Context = /*#__PURE__*/React__default["default"].createContext('web3');
48780
48780
  var DEFAULT_BLOCK_INTERVAL = 15;
48781
48781
  var DEFAULT_BLOCK_INTERVAL_TIMEOUT = 40000;
48782
+ /**
48783
+ * WRAP CHAINS START
48784
+ **/
48785
+
48786
+ var ETH = useWallet.chains.getChainInformation(1).nativeCurrency;
48787
+ var WRAPPED_CHAINS = {
48788
+ 10: {
48789
+ id: 10,
48790
+ nativeCurrency: ETH,
48791
+ type: 'main',
48792
+ fullName: 'Optimism Mainnet',
48793
+ shortName: 'Optimism',
48794
+ explorerUrl: 'https://optimistic.etherscan.io',
48795
+ testnet: false
48796
+ }
48797
+ };
48798
+
48799
+ function wrap(methodName, funct, force) {
48800
+ var oldFunction = useWallet.chains[methodName];
48801
+
48802
+ useWallet.chains[methodName] = function (chainId) {
48803
+ var args = [].concat(Array.prototype.slice.call(arguments), [oldFunction]);
48804
+ return (WRAPPED_CHAINS[parseInt(chainId)] || force ? funct : oldFunction).apply(useWallet.chains, args);
48805
+ };
48806
+ }
48807
+
48808
+ wrap('isKnownChain', function () {
48809
+ return true;
48810
+ });
48811
+ wrap('getChainInformation', function (chainId) {
48812
+ return WRAPPED_CHAINS[parseInt(chainId)];
48813
+ });
48814
+ wrap('getKnownChainsIds', function (oldFunction) {
48815
+ return [].concat(_toConsumableArray(oldFunction()), _toConsumableArray(Object.keys(WRAPPED_CHAINS)));
48816
+ });
48817
+ wrap('getKnownChainInformation', function (oldFunction) {
48818
+ return [].concat(_toConsumableArray(oldFunction()), _toConsumableArray(Object.values(WRAPPED_CHAINS)));
48819
+ });
48820
+ /**
48821
+ * WRAP CHAINS END
48822
+ **/
48823
+
48782
48824
  var web3States = {
48783
48825
  NOT_CONNECTED: NOT_CONNECTED,
48784
48826
  CONNECTED: CONNECTED,