@ethereansos/interfaces-core 0.4.101 → 0.4.104

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -50355,14 +50355,15 @@ function fromDecimals(number, decimals, skipFormat) {
50355
50355
  return '0';
50356
50356
  }
50357
50357
 
50358
+ number = numberToString(number).split('.')[0];
50358
50359
  var symbol = toEthereumSymbol(decimals);
50359
50360
 
50360
50361
  if (symbol) {
50361
- var result = web3Utils.fromWei(numberToString(number), symbol);
50362
+ var result = web3Utils.fromWei(number, symbol);
50362
50363
  return skipFormat === true ? result : formatMoney(result);
50363
50364
  }
50364
50365
 
50365
- var nts = parseFloat(numberToString(number / (decimals < 2 ? 1 : Math.pow(10, decimals)))); // TODO verify if is expected that is rounded to 2 decimals
50366
+ var nts = parseFloat(numberToString(parseFloat(number) / (decimals < 2 ? 1 : Math.pow(10, decimals)))); // TODO verify if is expected that is rounded to 2 decimals
50366
50367
 
50367
50368
  return skipFormat === true ? numberToString(nts) : formatMoney(nts);
50368
50369
  }
@@ -63751,6 +63752,56 @@ const gBase64 = {
63751
63752
  extendBuiltins: extendBuiltins,
63752
63753
  };
63753
63754
 
63755
+ function memoryFetch(_x, _x2) {
63756
+ return _memoryFetch.apply(this, arguments);
63757
+ }
63758
+
63759
+ function _memoryFetch() {
63760
+ _memoryFetch = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, type) {
63761
+ var element;
63762
+ return regeneratorRuntime.wrap(function _callee$(_context) {
63763
+ while (1) {
63764
+ switch (_context.prev = _context.next) {
63765
+ case 0:
63766
+ try {
63767
+ element = JSON.parse(window.localStorage.getItem(url));
63768
+ } catch (e) {}
63769
+
63770
+ if (!element) {
63771
+ _context.next = 3;
63772
+ break;
63773
+ }
63774
+
63775
+ return _context.abrupt("return", element);
63776
+
63777
+ case 3:
63778
+ _context.next = 5;
63779
+ return fetch(url);
63780
+
63781
+ case 5:
63782
+ element = _context.sent;
63783
+ _context.next = 8;
63784
+ return element[type || 'json']();
63785
+
63786
+ case 8:
63787
+ element = _context.sent;
63788
+
63789
+ try {
63790
+ window.localStorage.setItem(url, JSON.stringify(element));
63791
+ } catch (e) {}
63792
+
63793
+ return _context.abrupt("return", element);
63794
+
63795
+ case 11:
63796
+ case "end":
63797
+ return _context.stop();
63798
+ }
63799
+ }
63800
+ }, _callee);
63801
+ }));
63802
+ return _memoryFetch.apply(this, arguments);
63803
+ }
63804
+
63754
63805
  function cleanLink(linkToClean) {
63755
63806
  var cleanedLink = linkToClean;
63756
63807
 
@@ -63826,7 +63877,7 @@ function _tryRetrieveMetadata() {
63826
63877
  item.metadataLink = metadatas && metadatas[item.address] || item.metadataLink;
63827
63878
 
63828
63879
  if (!(item.metadataLink !== '')) {
63829
- _context.next = 44;
63880
+ _context.next = 42;
63830
63881
  break;
63831
63882
  }
63832
63883
 
@@ -63841,23 +63892,19 @@ function _tryRetrieveMetadata() {
63841
63892
  }
63842
63893
 
63843
63894
  _context.t1 = JSON.parse(gBase64.decode(item.metadataLink.substring('data:application/json;base64,'.length)));
63844
- _context.next = 33;
63895
+ _context.next = 31;
63845
63896
  break;
63846
63897
 
63847
63898
  case 28:
63848
63899
  _context.next = 30;
63849
- return fetch(cleanLink(formatLink({
63900
+ return memoryFetch(cleanLink(formatLink({
63850
63901
  context: context
63851
63902
  }, item.metadataLink)));
63852
63903
 
63853
63904
  case 30:
63854
- _context.next = 32;
63855
- return _context.sent.json();
63856
-
63857
- case 32:
63858
63905
  _context.t1 = _context.sent;
63859
63906
 
63860
- case 33:
63907
+ case 31:
63861
63908
  item.metadata = _context.t1;
63862
63909
 
63863
63910
  if (typeof item.metadata !== 'string') {
@@ -63873,11 +63920,11 @@ function _tryRetrieveMetadata() {
63873
63920
  item.description = item.description && item.description.split('\n\n').join(' ');
63874
63921
  }
63875
63922
 
63876
- _context.next = 43;
63923
+ _context.next = 41;
63877
63924
  break;
63878
63925
 
63879
- case 37:
63880
- _context.prev = 37;
63926
+ case 35:
63927
+ _context.prev = 35;
63881
63928
  _context.t2 = _context["catch"](23);
63882
63929
  delete item.image;
63883
63930
  item.image = getElementImage({
@@ -63886,18 +63933,18 @@ function _tryRetrieveMetadata() {
63886
63933
  item.metadataMessage = "Could not retrieve metadata, maybe due to CORS restriction policies for the link (<a href=\"".concat(item.metadataLink, "\" target=\"_blank\">").concat(item.metadataLink, "</a>), check it on <a href=\"").concat(item.collection ? context.openSeaItemLinkTemplate.format(item.collection.address, item.id) : context.openSeaCollectionLinkTemplate.format(item.address), "\" target=\"_blank\">Opensea</a>");
63887
63934
  console.error(item.metadataMessage);
63888
63935
 
63889
- case 43:
63936
+ case 41:
63890
63937
  clearMetadata = false;
63891
63938
 
63892
- case 44:
63893
- _context.next = 48;
63939
+ case 42:
63940
+ _context.next = 46;
63894
63941
  break;
63895
63942
 
63896
- case 46:
63897
- _context.prev = 46;
63943
+ case 44:
63944
+ _context.prev = 44;
63898
63945
  _context.t3 = _context["catch"](8);
63899
63946
 
63900
- case 48:
63947
+ case 46:
63901
63948
  clearMetadata && delete item.metadata;
63902
63949
  clearMetadata && (item.metadataLink = clearMetadata ? 'blank' : item.metadataLink);
63903
63950
 
@@ -63919,12 +63966,12 @@ function _tryRetrieveMetadata() {
63919
63966
 
63920
63967
  return _context.abrupt("return", item);
63921
63968
 
63922
- case 53:
63969
+ case 51:
63923
63970
  case "end":
63924
63971
  return _context.stop();
63925
63972
  }
63926
63973
  }
63927
- }, _callee, null, [[8, 46], [23, 37]]);
63974
+ }, _callee, null, [[8, 44], [23, 35]]);
63928
63975
  }));
63929
63976
  return _tryRetrieveMetadata.apply(this, arguments);
63930
63977
  }
@@ -64875,5 +64922,5 @@ var tokenPercentage = function tokenPercentage(amount, totalSupply) {
64875
64922
 
64876
64923
  var abi = new AbiCoder();
64877
64924
 
64878
- export { ADDRESS_ZERO, BASE64_REGEXP, BLOCK_SEARCH_SIZE, gBase64 as Base64, BaseContract, BigNumber, Contract, ContractFactory, CurrencyAmount, DFO_DEPLOYED_EVENT, Ether, FACTORY_ADDRESS, FeeAmount, FixedNumber, Fraction, FullMath, GlobalContextsProvider, InitContextProvider, LiquidityMath, MaxUint256, Multicall, NEW_DFO_DEPLOYED_EVENT, NativeCurrency, NoTickDataProvider, NonfungiblePositionManager, POOL_INIT_CODE_HASH, Payments, Percent, PluginsContextProvider, Pool, Position, PositionLibrary, Price, Rounding, Route, SelfPermit, Signer, SqrtPriceMath, Staker, SwapMath, SwapQuoter, SwapRouter, TICK_SPACINGS, Tick, TickLibrary, TickList, TickListDataProvider, TickMath, Token, Trade, TradeType, URL_REGEXP, VOID_BYTES32, VOID_ETHEREUM_ADDRESS, VoidSigner, WETH9, Wallet, Web3ContextProvider, Wordlist, abi, add, blockchainCall, checkCoverSize, computePoolAddress, computePriceImpact, index$2 as constants, createContract, deployMetadataLink, div, eliminateFloatingFinalZeroes, encodeRouteToPath, encodeSqrtRatioX96, ErrorCode as errors, ethers, PubSub as ethosEvents, extractComment, extractHTMLDescription, formatLink, formatMoney, formatMoneyUniV3, formatNumber, formatString, fromDecimals, generateAndCompileContract, generateFunctionalityMetadataLink, getAllContracts, getDefaultProvider, getEthereumPrice, getLogs, getNetworkElement, getRandomArrayElement, getRandomArrayIndex, SolidityUtilities as getSolidityUtilities, getSupportedSolidityVersion, getTokenPriceInDollarsOnUniswap, getTokenPriceInDollarsOnUniswapV3, getTokenPricesInDollarsOnCoingecko, hasEthereumAddress, isEthereumAddress, isSorted, loadBlockSearchTranches, loadContent, loadFunctionality, loadFunctionalityNames, loadMetadatas, loadOffChainWallets as loadOffchainWallets, logger, maxLiquidityForAmounts, methodSignatureMatch, mint, mostSignificantBit, mul, nearestUsableTick, newContract, normalizeValue, numberToString, packCollection, pragmaSolidityRule, priceToClosestTick, index as providers, refreshBalances, resetContracts, searchForCodeErrors, sendAsync, sendGeneratedProposal, shortenWord, sleep, solidityImportRule, sortedInsert, split, sqrt, toLines as stringToLines, sub, subIn256, swap, tickToPrice, toDecimals, toEthereumSymbol, toHex, toSubArrays, tokenPercentage, tradeComparator, transfer, truncatedWord, tryRetrieveMetadata, uploadMetadata, uploadToIPFS, useEthosContext, useInit, useIsUnmounted, useLoadUniswapPairs, useLocalStorage, usePlaceholder, usePlugins, usePrevious, useSinglePlaceholder, useWeb3, utils, validateAndParseAddress, validateDFOMetadata, version$1 as version, web3States, wordlists };
64925
+ export { ADDRESS_ZERO, BASE64_REGEXP, BLOCK_SEARCH_SIZE, gBase64 as Base64, BaseContract, BigNumber, Contract, ContractFactory, CurrencyAmount, DFO_DEPLOYED_EVENT, Ether, FACTORY_ADDRESS, FeeAmount, FixedNumber, Fraction, FullMath, GlobalContextsProvider, InitContextProvider, LiquidityMath, MaxUint256, Multicall, NEW_DFO_DEPLOYED_EVENT, NativeCurrency, NoTickDataProvider, NonfungiblePositionManager, POOL_INIT_CODE_HASH, Payments, Percent, PluginsContextProvider, Pool, Position, PositionLibrary, Price, Rounding, Route, SelfPermit, Signer, SqrtPriceMath, Staker, SwapMath, SwapQuoter, SwapRouter, TICK_SPACINGS, Tick, TickLibrary, TickList, TickListDataProvider, TickMath, Token, Trade, TradeType, URL_REGEXP, VOID_BYTES32, VOID_ETHEREUM_ADDRESS, VoidSigner, WETH9, Wallet, Web3ContextProvider, Wordlist, abi, add, blockchainCall, checkCoverSize, computePoolAddress, computePriceImpact, index$2 as constants, createContract, deployMetadataLink, div, eliminateFloatingFinalZeroes, encodeRouteToPath, encodeSqrtRatioX96, ErrorCode as errors, ethers, PubSub as ethosEvents, extractComment, extractHTMLDescription, formatLink, formatMoney, formatMoneyUniV3, formatNumber, formatString, fromDecimals, generateAndCompileContract, generateFunctionalityMetadataLink, getAllContracts, getDefaultProvider, getEthereumPrice, getLogs, getNetworkElement, getRandomArrayElement, getRandomArrayIndex, SolidityUtilities as getSolidityUtilities, getSupportedSolidityVersion, getTokenPriceInDollarsOnUniswap, getTokenPriceInDollarsOnUniswapV3, getTokenPricesInDollarsOnCoingecko, hasEthereumAddress, isEthereumAddress, isSorted, loadBlockSearchTranches, loadContent, loadFunctionality, loadFunctionalityNames, loadMetadatas, loadOffChainWallets as loadOffchainWallets, logger, maxLiquidityForAmounts, memoryFetch, methodSignatureMatch, mint, mostSignificantBit, mul, nearestUsableTick, newContract, normalizeValue, numberToString, packCollection, pragmaSolidityRule, priceToClosestTick, index as providers, refreshBalances, resetContracts, searchForCodeErrors, sendAsync, sendGeneratedProposal, shortenWord, sleep, solidityImportRule, sortedInsert, split, sqrt, toLines as stringToLines, sub, subIn256, swap, tickToPrice, toDecimals, toEthereumSymbol, toHex, toSubArrays, tokenPercentage, tradeComparator, transfer, truncatedWord, tryRetrieveMetadata, uploadMetadata, uploadToIPFS, useEthosContext, useInit, useIsUnmounted, useLoadUniswapPairs, useLocalStorage, usePlaceholder, usePlugins, usePrevious, useSinglePlaceholder, useWeb3, utils, validateAndParseAddress, validateDFOMetadata, version$1 as version, web3States, wordlists };
64879
64926
  //# sourceMappingURL=index.esm.js.map