This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://codeakk.medium.com/hex-development-data-a1b1822446fa | |
// https://togosh.medium.com/hex-developer-guide-3b018a943a55 | |
// https://etherscan.io/apis | |
test(); | |
async function test(){ | |
var { circulatingHEX, stakedHEX, totalTshares, penaltiesHEX } = await getGlobalInfo(); | |
console.log("Circulating Supply: " + Number(circulatingHEX).toLocaleString(undefined, {minimumFractionDigits:0, maximumFractionDigits:0})); | |
console.log("Staked Supply: " + Number(stakedHEX).toLocaleString(undefined, {minimumFractionDigits:0, maximumFractionDigits:0})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//"dependencies": { | |
// "fetch-retry": "^5.0.1", | |
// "node-fetch": "^3.0.0" | |
// } | |
// Get all historical stake data by HEX day | |
//// Created for Jose (https://www.reddit.com/user/hex_crypto_bull/) | |
//Three CSV tables: | |
//- issued_cds (stakeStarts) // Desired: hex_staked>0 and shares>0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var priceURL = "https://api.etherscan.io/api?module=stats&action=ethprice&apikey=YourApiKeyToken" | |
var gasURL = "https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=YourApiKeyToken"; | |
test(); | |
async function test(){ | |
var price = await getEthereumPrice(); | |
await sleep(5000); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://codeakk.medium.com/hex-development-data-a1b1822446fa | |
// https://togosh.medium.com/hex-developer-guide-3b018a943a55 | |
// https://thegraph.com/legacy-explorer/subgraph/uniswap/uniswap-v2 | |
// https://thegraph.com/legacy-explorer/subgraph/uniswap/uniswap-v3 | |
// https://etherscan.io/apis | |
// NOTE: REPLACE XXXXXXXX with Etherscan API Key | |
test(); | |
async function test(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://exchangeratesapi.io/ - Replace XXXXXXXXXXXXX with API Key | |
////////////////////////////////////////////////////////// | |
// SERVER | |
const schedule = require('node-schedule'); | |
io = require('socket.io')(httpServer) | |
var jobCurrencyRates = schedule.scheduleJob("0 */3 * * *", function() { | |
getCurrencyData(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://codeakk.medium.com/hex-development-data-a1b1822446fa | |
// https://togosh.medium.com/hex-developer-guide-3b018a943a55 | |
// https://github.com/jonbern/fetch-retry | |
// https://github.com/node-fetch/node-fetch/blob/main/README.md#custom-highwatermark | |
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)); | |
var fetchRetry = require('fetch-retry')(fetch, { | |
retryOn: async function(attempt, error, response) { | |
if (attempt > 3) { return false; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://codeakk.medium.com/hex-development-data-a1b1822446fa | |
// https://togosh.medium.com/hex-developer-guide-3b018a943a55 | |
// https://thegraph.com/legacy-explorer/subgraph/uniswap/uniswap-v2 | |
// https://thegraph.com/legacy-explorer/subgraph/uniswap/uniswap-v3 | |
test(); | |
async function test(){ | |
console.log("=== Uniswap V2"); | |
var { liquidityUV2_HEXUSDC, liquidityUV2_USDC } = await getUniswapV2HEXUSDC_Polling(); await sleep(1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://codeakk.medium.com/hex-development-data-a1b1822446fa | |
// https://togosh.medium.com/hex-developer-guide-3b018a943a55 | |
// https://etherscan.io/apis | |
test(); | |
async function test(){ | |
var currentDay = await getCurrentDay(); | |
console.log("Current Day: " + Number(currentDay).toLocaleString(undefined, {minimumFractionDigits:0, maximumFractionDigits:0})); | |
} |
NewerOlder