MCPcopy Create free account
hub / github.com/mempool/mempool / fetchGitHubContents

Function fetchGitHubContents

frontend/sync-assets.js:209–223  ·  view source on GitHub ↗
(repoPath, useAuth = false)

Source from the content-addressed store, hash-verified

207
208// Core: Fetch GitHub directory contents
209const fetchGitHubContents = async (repoPath, useAuth = false) => {
210 if (useAuth && config.githubToken) {
211 console.log(`${LOG_TAG} \tDownloading with authentication`);
212 }
213
214 const options = createGitHubOptions(repoPath);
215 const responseBody = await httpsRequest(options);
216 const contents = JSON.parse(responseBody.toString());
217
218 if (contents.message) {
219 throw new Error(contents.message);
220 }
221
222 return contents;
223};
224
225// Main: Download mining pool logos
226const downloadMiningPoolLogos = async () => {

Callers 3

downloadMiningPoolLogosFunction · 0.85
downloadPromoVideoFunction · 0.85

Calls 3

createGitHubOptionsFunction · 0.85
httpsRequestFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected