Free javascript Hosting


fresh.js

Uploaded on Jan 30 2022 08:28 by hargun

import fetch from "node-fetch";
var tokenbyrank = ['49','417','590','1041','1124','1312','1425','1634','1704','1719','1889','2415','772','900','2343','1612','80','967','2497','157','1968','1386','703','2431','1228','821','855','1003','1230','1323','1653','2219','44','2152','648','1544','1768','630','295','1282','2396','1056','1401','982','2271','501','2045','793','1517','1348','2051','2329','885','33','1655','1870','2443','1849','1802','2410','1832','1271','1840','2384','1128','101','980','1526','2351','2034','1804','775','109','1508','1051','1687','935','1899','1090','626','1416','2120','1984','1504','142','408','696','358','551','1857','6','487','1576','587','123','2356','2382','1042','3','1991','1058','1344','1730','1584','1150','754','2217','791','569','1548','1305','2321','2119','1921','402','1820','1556','804','1221','665','1384','1107','113','32','514','1713','2229','1689','2257','1493','1424','817','1163','1891','926','433','1417','2147','403','497','751','857','2139','1274','362','1260','932','883','2239','1405','2181','911','2136','2087','628','1054','2124','2258','276','2366','1879','1261','179','1481','1266','245','2114','2151','2001','1881','1629','1469','814','624','1882','1527','2328','1061','1774','1484','1454','339','2476','2319','62','53','1479','2121','2206','801','1898','856','19','1759','1745','662','565','1264','2298','1864','105','506','533','1590','2286','1249','2018','884','1505','204','71','2416','7','1625','2200','227','1512','1489','2055','388','1688','839','830','391','2424','1133','278','896','2060','1990','1178','996','606','107','2278','2438','952','2232','1648','96','820','2251','2128','1510','2407','570','1199','141','2276','1445','2093','2164','2123','248','1635','1705','1026','784','474','2335','243','512','867','1900','1807','610','288','1378','322','1471','1233','1016','410','31','249','321','1732','1456','785','219','2112','115','965','871','1682','2324','277','1726','1931','992','1758','1913','1972','2150','705','730','678','1047','2127','1727','1553','2015','1179','1001','2460','2341','351','2315','873','908','2042','45','1778','117','1869','1063','2094','1315','1139','2201','456','1023','1383','2317','1571','522','12','1369','1930','1044','1427','2498','1545','1211','600','1760','1557','1015','1965','1210','2470','1794','1608','169','1102','136','367','1919','2371','66','2079','1772','2107','1362','1543','1691','659','327','2211','447','2280','1464','42','2250','1826','774','2108','2256','1327','1257','1149','933','2183','298','343','753','698','651','374','972','99','2043','207','2288','1923','1500','235','495','1361','1245','161','285','114','89','1610','197','1715','2320','1349','1994','876','940','1604','1524','524','1337','2345','140','1717','562','1844','1111','222','1421','2222','1241','2182','577','213','1478','1039','1843','1045','1300','1676','2411','323','1468','854','2170','1259','2090','329','289','864','1734','1877','547','1888','763','1313','782','1723','1967','2145','1096','663','1762','1263','595','54','550','582','2412','1783','263','835','2029','1073','1895','2054','1097','121','2369','1949','2487','2373','439','645','307','571','641','1284','2492','430','2318','1611','1708','2327','1082','1151','199','2302','1678','2174','584','508','1410','1430','1890','91','1218','891','969','2106','275','1459','103','927','1372','350','693','1515','681','1752','2237','488','715','560','2277','1509','2316','1152','2162','2191','717','1523','2361','221','1675','2285','2110','97','2297','529','211','317','1158','2337','1220','131','851','613','1095','1909','1161','2464','1360','335','1896','1168','682','1231','1845','366','2153','1744','2163','655','1886','2472','2160','2360','1335','1932','852','486','1947','16','382','722','1227','1418','1075','292','922','346','833','1962','236','229','1341','1062','2355','50','239','1907','1191','737','2005','112','670','766','234','48','2398','1189','72','2146','202','1790','420','2126','458','502','74','2066','1031','2213','2137','233','2041','320','283','2333','1205','2273','748','1382','652','937','1137','1333','153','934','1788','1206','444','660','368','2296','294','1398','302','647','442','767','262','629','1848','407','1217','1451','13','22','489','1374','2132','1997','1144','1703','1138','459','704','1476','949','2259','2125','1426','405','841','490','515','1816','1487','1977','414','2294','173','1613','1012','479','898','690','1010','1583','995','2344','649','2275','1850','1132','827','1085','1987','241','139','968','1127','1207','1996','2331','1706','1782','1908','1954','2300','2012','500','52','2198','928','482','1519','65','1801','1000','666','706','1973','61','1018','67','792','1827','2353','2303','602','2386','917','251','1301','77','1002','617','1938','1219','985','1623','714','242','1621','728','2092','51','1885','889','947','1793','230','799','2484','1645','653','1354','1649','546','1283','1078','816','2359','1025','445','478','421','1697','2479','2417','688','1071','1651','1575','1739','812','58','970','2099','397','1180','25','2143','603','1202','1825','1412','168','1616','832','2023','2391','2434','279','806','468','1265','1528','409','377','951','164','2499','2409','1944','2456','1765','378','961','2272','1671','386','4','147','2140','1751','2184','1912','1013','119','1633','1537','1148','1112','2459','1466','1371','400','924','2117','1143','1906','1902','1819','1395','270','2189','1110','1473','1190','450','1847','605','865','866','2091','1729','1172','434','255','134','247','2291','463','1267','1463','2205','1176','657','2071','2115','634','1795','1363','625','780','671','2284','315','2155','1539','1419','1008','1694','872','1566','543','2089','2453','534','1534','1289','581','380','758','2426','332','942','2188','566','1320','1662','2263','2019','491','1806','1297','614','1389','507','1167','2354','597','1506','1876','789','154','553','2478','1880','1239','411','492','11','990','2235','79','668','300','2482','906','914','1467','1072','1960','313','393','1334','1080','513','1929','2310','133','2169','1966','2135','762','143','1905','1868','1093','530','144','1169','842','162','1831','615','1740','259','667','128','314','395','2002','1381','863','196','1809','592','1574','304','1531','2038','1243','1246','40','418','499','2014','894','352','1767','1351','1388','2408','517','2267','1817','208','2462','1810','110','1007','156','846','1193','1851','2469','853','2176','1187','588','1582','1660','794','1428','1046','807','83','1948','30','1280','126','2058','1253','376','2480','1839','1593','1055','2486','34','1431','384','87','218','897','953','2004','2037','1317','269','2076','1262','2130','1122','837','63','916','910','1874','1375','2435','177','811','325','2378','1485','2299','1203','2220','1939','2234','1964','1068','574','342','1391','843','469','1971','2047','1995','1499','966','2428','2451','47','200','1310','2095','1390','1970','2030','1811','1175','1328','1170','354','1521','1236','805','619','1959','2261','27','1229','1287','1855','85','1270','878','1340','14','1513','2226','950','1338','461','1918','2197','673','768','2111','1164','750','2330','1860','301','485','41','1156','1784','166','1204','1006','1350','2370','1258','1699','1622','1278','733','1999','1981','1438','2491','1815','2423','1318','1702','544','567','2365','744','1005','2209','422','1162','55','1402','1757','887','609','401','1550','2312','1597','2083','1292','939','265','1924','552','1904','379','2379','888','1853','2309','1030','1577','2166','1983','765','2375','838','1803','1441','1173','882','1549','392','2311','2429','1060','423','860','1195','840','1738','2165','1714','387','2027','523','1630','735','1272','593','94','361','773','206','35','17','973','2007','963','779','752','1866','555','818','1126','8','1894','993','2247','511','296','1530','1121','918','1038','1394','1829','127','635','845','1720','2457','1498','2072','1166','347','59','1365','1858','2116','1627','2067','39','457','1376','1559','1600','2266','1155','540','426','429','1892','1214','813','1123','1792','2437','1177','299','790','108','1979','680','2238','398','2154','1034','907','244','187','675','494','783','1116','531','1033','716','1735','1915','1059','1052','28','654','1324','1238','2052','1406','1370','2249','1032','280','746','2224','201','1872','1830','2488','632','2016','69','1480','1491','877','1640','2193','1883','2400','640','1644','1171','1222','2156','1777','2381','372','2033','1393','1105','1721','650','2383','719','631','1503','15','1036','1174','1359','1594','145','509','646','84','1570','741','1165','844','2334','226','454','2380','1993','427','1037','436','1773','1711','1250','923','1298','1074','1309','2405','2203','190','664','1275','1747','875','1605','2186','1291','2357','1077','1910','1749','519','1755','1796','2086','1353','644','1871','757','899','1308','1392','1525','2008','556','443','312','1618','240','70','1677','1304','1316','2009','75','1617','470','1646','1415','2167','2306','21','1183','1477','1564','1067','2442','987','559','2096','1472','1343','1091','1223','2325','1846','496','2290','1022','188','802','256','2395','695','1797','819','2122','2454','2039','1787','1856','1667','2323','1224','1226','1969','158','18','764','862','1887','1665','2475','1808','2241','23','396','338','979','1449','111','2022','1934','1240','787','697','194','1443','198','2420','1652','1683','2281','712','1961','1558','2161','2100','2040','890','1542','2105','1185','1541','905','1049','306','1685','1237','2036','2101','847','2053','2265','165','273','337','956','861','691','2078','159','684','176','1104','138','536','215','1198','2144','589','2449','1488','1248','672','1731','2020','800','2439','1273','404','2397','2026','330','238','2348','1560','941','1805','1352','1501','1314','561','525','1135','913','390','2421','729','1014','1','1841','2264','172','137','1753','2441','694','912','1589','2326','2339','2349','432','297','568','1835','1799','1822','2013','1863','596','2046','1950','1048','2173','2210','732','455','2118','1632','1833','604','440','20','1599','848','2404','2489','1669','2445','718','1673','1050','1647','2432','1098','2171','43','1414','2419','1626','2308','1192','2088','449','310','124','76','1573','86','2069','549','2070','2402','1235','2433','2179','1642','1607','2388','1859','575','1791','598','1290','1637','415','1657','2080','2414','1439','564','674','622','356','1580','1737','1409','2374','548','1094','1387','1724','1852','1679','1209','2059','1403','1429','1958','1986','1347','1628','178','462','2085','1837','823','293','2035','539','1364','984','2336','2322','642','1247','1434','2177','1117','130','446','2129','1160','585','870','1746','1911','2307','1325','1024','554','46','2063','893','116','2372','10','1131','1536','611','214','2081','769','1011','381','68','2240','266','2216','1119','2448','1053','2314','261','348','476','1656','326','152','1197','1358','2260','579','1130','1893','399','282','797','777','1366','1201','1064','1775','150','340','2221','1004','413','1397','1707','516','1288','336','1771','955','921','1743','573','309','2228','1497','1779','727','526','1709','2199','2178','1114','333','612','274','2172','915','1998','1492','880','1447','2430','90','2458','1141','1453','224','2368','2225','1718','1643','2485','2452','736','181','1299','1664','869','416','2403','938','1631','448','1937','2255','1555','1420','2340','658','2000','576','1914','452','460','2084','2215','781','796','1255','2138','365','331','1867','1736','2003','92','1818','209','437','1367','148','1641','904','778','183','281','1609','1861','756','1602','254','976','60','994','2254','1380','2175','135','1269','475','521','903','1330','2490','745','359','594','2313','2446','944','1020','2017','936','2418','687','2142','1194','760','260','441','1496','1242','383','464','290','375','2461','786','1465','1572','2011','451','2103','373','2401','1547','2032','195','1321','1146','2481','1225','931','1436','465','303','170','1115','205','1293','2204','2212','1581','1668','1585','505','1306','2061','2062','1814','2422','2057','246','425','305','364','1554','1385','471','803','2180','988','1552','623','2268','1742','1157','1586','731','1444','580','1470','1953','1109','948','217','1942','2389','669','1404','711','2248','1400','1457','1268','831','2463','1440','1873','2425','2149','2392','2077','1200','182','909','739','1897','895','945','129','1106','2364','849','104','1490','394','2450','2413','868','102','1756','825','2269','964','1186','2195','344','1956','2279','1538','1620','2048','689','2141','2305','191','1134','2065','607','2338','1277','353','1244','2073','1483','1215','171','1442','749','1452','743','1092','1446','2387','1636','1935','2363','2444','685','472','1579','1153','2031','824','1285','1252','2082','1957','1989','2185','679','2064','1565','453','2131','616','2358','1399','2301','1650','1069','1761','2455','1639','809','2049','620','747','977','349','1684','2028','477','334','81','537','2097','1129','1460','1974','1357','2245','1716','1901','518','1624','618','677','2159','919','203','1563','829','1294','319','1101','527','2190','1945','419','385','2350','2025','1592','2289','118','1812','1065','958','892','510','1666','627','1520','2075','1368','355','2495','2056','1329','2385','1976','1413','2148','311','1692','1113','406','1281','702','974','1862','1690','189','1154','1933','1540','1988','1569','2192','1813','578','1448','2283','228','1568','363','1396','1326','1084','78','1028','1339','1836','1303','184','2376','1486','2483','1256','986','954','761','2104','1159','2347','1725','1522','264','483','798','1355','357','64','2467','504','710','2262','709','583','738','1658','360','770','1982','1587','1079','1943','699','308','2496','473','2157','2068','1764','2253','1181','1516','2465','56','428','822','2214','1208','1701','2473','480','1823','192','713','520','1728','2393','2233','2390','957','9','2236','389','1296','438','286','1408','2427','1591','1922','1433','983','686','37','1838','638','1865','1118','545','1789','1029','1824','1356','2102','639','2440','998','541','1766','1066','1776','1800','412','1661','1142','174','1659','2109','1940','1455','1770','788','962','886','2436','535','180','1332','324','771','1598','1411','1615','1693','1946','2474','795','73','237','929','1606','720','1495','231','1532','930','1680','902','2243','1529','493','258','1927','2500','2006','467','93','2477','29','132','503','1307','1140','2202','1432','601','1088','2493','2246','1941','1322','1108','532','1276','1975','1700','88','223','1741','185','424','1681','591','708','563','1748','1295','1654','1076','1925','1854','225','1136','2293','826','1083','943','1474','1331','253','1461','1903','1507','700','1750','2394','155','808','1785','1514','1769','1057','1145','1926','2218','146','542','1346','959','1302','318','341','82','1878','1828','316','1780','920','484','676','656','257','1821','1928','1663','1920','1842','122','2098','1234','481','755','2187','960','874','2021','1212','272','2274','98','759','1462','725','1884','2447','1763','558','2244','683','2196','1286','815','1670','2158','1985','1578','2295','271','1533','1342','220','721','707','1601','1423','2133','1494','1188','287','1511','1422','1458','2471','1435','1754','2','252','633','608','2050','1196','1482','881','2223','186','149','1535','925','1955','1319','498','167','2292','5','1027','291','636','1875','284','1009','1254','1087','1698','1213','1040','2113','2332','991','2282','1377','776','2208','586','1916','431','1603','828','1781','2010','692','36','2168','1951','1978','1614','1551','1019','1502','850','38','106','371','1980','100','232','1184','971','859','2352','2406','726','1311','1588','2270','997','1567','643','528','1035','370','120','834','345','268','1710','740','1089','879','1182','2227','1336','2024','57','999','836','175','1518','1722','1638','989','2231','1017','599','1437','1712','1345','2207','1086','701','1686','2399','901','1099','1936','466','2230','1963','734','1952','1992','1407','661','95','24','2346','267','1733','2466','160','2242','1786','2304','1562','1147','125','2342','2044','26','723','742','810','724','981','212','1696','1279','1125','1103','1695','1120','1373','1917','2494','1379','538','163','151','2194','1798','328','2377','1674','1043','1475','572','1561','2252','1216','621','193','1834','1021','1619','2468','637','210','1596','435','1100','2287','975','216','858','1070','557','978','369','1672','2074','2362','250','2134','1595','1450','1546','1081','1232','2367','946','1251'];
var tokenid = []
var sellPriceAmount = []
var sellPriceCurrency = []

//getting Luna Price
var lunajsonvalue = await (await fetch('https://fcd.terra.dev/v1/market/swaprate/uluna')).json();
var lunavalue = lunajsonvalue[21].swaprate
var lunaprice = parseFloat((lunavalue)).toFixed(2)


var jsonvalue = await (await fetch('https://luart-marketplace-prices-indexer.2ue2d8tpif5rs.eu-central-1.cs.amazonlightsail.com/nft-collection-prices/terra1uv9w7aaq6lu2kn0asnvknlcgg2xd5ts57ss7qt')).json();
var jsonstring = JSON.stringify(jsonvalue)
for(var index = 0;index<jsonstring.split('tokenId":"').length;index++){
tokenid.push(jsonstring.split('tokenId":"')[index].split('"')[0])
sellPriceAmount.push(jsonstring.split('sellPriceAmount":')[index].split(',')[0])
sellPriceCurrency.push(jsonstring.split('sellPriceCurrency":"')[index].split('"')[0])
}

var rank = 2500
var iteration = 0;
var floortoken;
var floorvalue;
var floorprice;
var floorcurrency;
for(var x = 0;x<=rank;x++){
var index = tokenid.indexOf(tokenbyrank[x])
if(index>-1){
if(iteration == 0){
floortoken = tokenid[index]
floorprice = sellPriceAmount[index]
floorcurrency = sellPriceCurrency[index]
if(floorcurrency == 'LUNA'){
floorvalue = floorprice*lunaprice
}
iteration = 1
}else{
if(sellPriceCurrency[index] == 'LUNA'){
if(sellPriceAmount[index]*lunaprice < floorvalue){
floortoken = tokenid[index]
floorprice = sellPriceAmount[index]
floorcurrency = sellPriceCurrency[index]
floorvalue = floorprice*lunaprice
}
}else{
if(sellPriceAmount[index] < floorvalue){
floortoken = tokenid[index]
floorprice = sellPriceAmount[index]
floorcurrency = sellPriceCurrency[index]
floorvalue = floorprice
}
}
}
}


}
console.log("Token: "+ floortoken + " | Sell Price Amount: " + floorprice + " | Sell Price Currency " + floorcurrency)

Back to list