Update index.html

This commit is contained in:
sairaj mote 2023-12-07 19:45:19 +05:30
parent 720ed0557b
commit 824d78fc95

View File

@ -65,7 +65,6 @@
</sm-popup>
<script src="scripts/components.min.js"></script>
<script src="https://unpkg.com/uhtml@3.0.1/es.js"></script>
<script>
const { html, svg, render: renderElem } = uhtml;
const uiGlobals = {}
@ -388,7 +387,7 @@
"borrow"
],
"category": "finance",
"hash": "197f0c491e8cabf866603d03c437f9b96ad5b58ce55de2f6bc0d39a633fdf5e2"
"hash": "197f0c491e8cabf866603d03c437f9b96ad5b58ce55de2f6bc0d39a633fdf5e1"
},
{
"name": "BTC Wallet",
@ -919,6 +918,49 @@
const hashHex = hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');
return hashHex;
}
/**
* @param { string | []} a single link or array of links
*/
async function getLinkContentHash(link) {
try {
const data = JSON.stringify({ url: link })
console.log(data)
return await (await fetch('https://integrity-api.ranchimall.net/hash', {
headers: {
"Content-Type": "application/json",
},
method: "POST",
mode: 'no-cors',
body: data
})).json()
} catch (e) {
console.error(e)
return null
}
}
async function downloadReposZipped(repoUrls) {
try {
const data = JSON.stringify({ urls: repoUrls })
const blob = await (await fetch('https://integrity-api.ranchimall.net/download-repos', {
headers: {
"Content-Type": "application/json",
},
method: "POST",
body: data
})).blob()
// download as zip
const a = document.createElement('a')
a.href = URL.createObjectURL(blob)
a.download = 'dapps.zip'
a.click()
URL.revokeObjectURL(a.href)
} catch (e) {
console.error(e)
return null
}
}
</script>
</body>