@ethereansos/interfaces-core 0.4.100 → 0.4.103
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs.js +86 -40
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +86 -41
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
@@ -23074,10 +23074,6 @@ function _createSuper(Derived) {
|
|
23074
23074
|
};
|
23075
23075
|
}
|
23076
23076
|
|
23077
|
-
function _readOnlyError(name) {
|
23078
|
-
throw new TypeError("\"" + name + "\" is read-only");
|
23079
|
-
}
|
23080
|
-
|
23081
23077
|
function _slicedToArray(arr, i) {
|
23082
23078
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
|
23083
23079
|
}
|
@@ -50359,14 +50355,15 @@ function fromDecimals(number, decimals, skipFormat) {
|
|
50359
50355
|
return '0';
|
50360
50356
|
}
|
50361
50357
|
|
50358
|
+
number = numberToString(number).split('.')[0];
|
50362
50359
|
var symbol = toEthereumSymbol(decimals);
|
50363
50360
|
|
50364
50361
|
if (symbol) {
|
50365
|
-
var result = web3Utils.fromWei(
|
50362
|
+
var result = web3Utils.fromWei(number, symbol);
|
50366
50363
|
return skipFormat === true ? result : formatMoney(result);
|
50367
50364
|
}
|
50368
50365
|
|
50369
|
-
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
|
50370
50367
|
|
50371
50368
|
return skipFormat === true ? numberToString(nts) : formatMoney(nts);
|
50372
50369
|
}
|
@@ -63755,6 +63752,56 @@ const gBase64 = {
|
|
63755
63752
|
extendBuiltins: extendBuiltins,
|
63756
63753
|
};
|
63757
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
|
+
|
63758
63805
|
function cleanLink(linkToClean) {
|
63759
63806
|
var cleanedLink = linkToClean;
|
63760
63807
|
|
@@ -63850,7 +63897,7 @@ function _tryRetrieveMetadata() {
|
|
63850
63897
|
|
63851
63898
|
case 28:
|
63852
63899
|
_context.next = 30;
|
63853
|
-
return
|
63900
|
+
return memoryFetch(cleanLink(formatLink({
|
63854
63901
|
context: context
|
63855
63902
|
}, item.metadataLink)));
|
63856
63903
|
|
@@ -64238,91 +64285,89 @@ function _getTokenPricesInDollarsOnCoingecko() {
|
|
64238
64285
|
response = {
|
64239
64286
|
data: {}
|
64240
64287
|
};
|
64241
|
-
_readOnlyError("tokenPrices");
|
64242
|
-
_readOnlyError("tokenPricesPromises");
|
64243
64288
|
tkns = [];
|
64244
64289
|
_iterator2 = _createForOfIteratorHelper(tokens);
|
64245
|
-
_context3.prev =
|
64290
|
+
_context3.prev = 5;
|
64246
64291
|
|
64247
64292
|
_iterator2.s();
|
64248
64293
|
|
64249
|
-
case
|
64294
|
+
case 7:
|
64250
64295
|
if ((_step2 = _iterator2.n()).done) {
|
64251
|
-
_context3.next =
|
64296
|
+
_context3.next = 29;
|
64252
64297
|
break;
|
64253
64298
|
}
|
64254
64299
|
|
64255
64300
|
token = _step2.value;
|
64256
64301
|
|
64257
64302
|
if (!(!token || token === VOID_ETHEREUM_ADDRESS)) {
|
64258
|
-
_context3.next =
|
64303
|
+
_context3.next = 14;
|
64259
64304
|
break;
|
64260
64305
|
}
|
64261
64306
|
|
64262
|
-
_context3.next =
|
64307
|
+
_context3.next = 12;
|
64263
64308
|
return getEthereumPrice({
|
64264
64309
|
context: context
|
64265
64310
|
});
|
64266
64311
|
|
64267
|
-
case
|
64312
|
+
case 12:
|
64268
64313
|
response.data[token] = _context3.sent;
|
64269
|
-
return _context3.abrupt("continue",
|
64314
|
+
return _context3.abrupt("continue", 27);
|
64270
64315
|
|
64271
|
-
case
|
64316
|
+
case 14:
|
64272
64317
|
if (!(tokenPrices[token] && tokenPrices[token].requestExpires > new Date().getTime() && tokenPrices[token].price !== 0)) {
|
64273
|
-
_context3.next =
|
64318
|
+
_context3.next = 18;
|
64274
64319
|
break;
|
64275
64320
|
}
|
64276
64321
|
|
64277
64322
|
response.data[token] = {
|
64278
64323
|
usd: tokenPrices[token].price
|
64279
64324
|
};
|
64280
|
-
_context3.next =
|
64325
|
+
_context3.next = 27;
|
64281
64326
|
break;
|
64282
64327
|
|
64283
|
-
case
|
64328
|
+
case 18:
|
64284
64329
|
if (!tokenPricesPromises[token]) {
|
64285
|
-
_context3.next =
|
64330
|
+
_context3.next = 26;
|
64286
64331
|
break;
|
64287
64332
|
}
|
64288
64333
|
|
64289
|
-
_context3.next =
|
64334
|
+
_context3.next = 21;
|
64290
64335
|
return tokenPricesPromises[token];
|
64291
64336
|
|
64292
|
-
case
|
64337
|
+
case 21:
|
64293
64338
|
_context3.t0 = token;
|
64294
64339
|
_context3.t1 = _context3.sent.data[_context3.t0].usd;
|
64295
64340
|
response.data[token] = {
|
64296
64341
|
usd: _context3.t1
|
64297
64342
|
};
|
64298
|
-
_context3.next =
|
64343
|
+
_context3.next = 27;
|
64299
64344
|
break;
|
64300
64345
|
|
64301
|
-
case
|
64346
|
+
case 26:
|
64302
64347
|
tkns.push(token);
|
64303
64348
|
|
64304
|
-
case
|
64305
|
-
_context3.next =
|
64349
|
+
case 27:
|
64350
|
+
_context3.next = 7;
|
64306
64351
|
break;
|
64307
64352
|
|
64308
|
-
case
|
64309
|
-
_context3.next =
|
64353
|
+
case 29:
|
64354
|
+
_context3.next = 34;
|
64310
64355
|
break;
|
64311
64356
|
|
64312
|
-
case
|
64313
|
-
_context3.prev =
|
64314
|
-
_context3.t2 = _context3["catch"](
|
64357
|
+
case 31:
|
64358
|
+
_context3.prev = 31;
|
64359
|
+
_context3.t2 = _context3["catch"](5);
|
64315
64360
|
|
64316
64361
|
_iterator2.e(_context3.t2);
|
64317
64362
|
|
64318
|
-
case
|
64319
|
-
_context3.prev =
|
64363
|
+
case 34:
|
64364
|
+
_context3.prev = 34;
|
64320
64365
|
|
64321
64366
|
_iterator2.f();
|
64322
64367
|
|
64323
|
-
return _context3.finish(
|
64368
|
+
return _context3.finish(34);
|
64324
64369
|
|
64325
|
-
case
|
64370
|
+
case 37:
|
64326
64371
|
prom = /*#__PURE__*/function () {
|
64327
64372
|
var _ref3 = _asyncToGenerator$1( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(t1, t2) {
|
64328
64373
|
var res;
|
@@ -64389,10 +64434,10 @@ function _getTokenPricesInDollarsOnCoingecko() {
|
|
64389
64434
|
tokenPricesPromises[token] = prom;
|
64390
64435
|
}
|
64391
64436
|
|
64392
|
-
_context3.next =
|
64437
|
+
_context3.next = 42;
|
64393
64438
|
return prom;
|
64394
64439
|
|
64395
|
-
case
|
64440
|
+
case 42:
|
64396
64441
|
prom = _context3.sent;
|
64397
64442
|
Object.entries(prom.data).forEach(function (it) {
|
64398
64443
|
return response.data[it[0]] = it[1];
|
@@ -64421,12 +64466,12 @@ function _getTokenPricesInDollarsOnCoingecko() {
|
|
64421
64466
|
|
64422
64467
|
return _context3.abrupt("return", response);
|
64423
64468
|
|
64424
|
-
case
|
64469
|
+
case 48:
|
64425
64470
|
case "end":
|
64426
64471
|
return _context3.stop();
|
64427
64472
|
}
|
64428
64473
|
}
|
64429
|
-
}, _callee3, null, [[
|
64474
|
+
}, _callee3, null, [[5, 31, 34, 37]]);
|
64430
64475
|
}));
|
64431
64476
|
return _getTokenPricesInDollarsOnCoingecko.apply(this, arguments);
|
64432
64477
|
}
|
@@ -64881,5 +64926,5 @@ var tokenPercentage = function tokenPercentage(amount, totalSupply) {
|
|
64881
64926
|
|
64882
64927
|
var abi = new AbiCoder();
|
64883
64928
|
|
64884
|
-
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 };
|
64929
|
+
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 };
|
64885
64930
|
//# sourceMappingURL=index.esm.js.map
|