shifting download all away from RM API to GH API
This commit is contained in:
parent
39e29f7519
commit
506a37fed6
233
index.html
233
index.html
@ -390,6 +390,52 @@
|
||||
`)
|
||||
})
|
||||
let dappsList = [
|
||||
{
|
||||
"name": "Blockbook",
|
||||
"description": "A blockchain explorer for FLO",
|
||||
"icon": html`<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M11.5 9C10.12 9 9 10.12 9 11.5s1.12 2.5 2.5 2.5 2.5-1.12 2.5-2.5S12.88 9 11.5 9zM20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3.21 14.21l-2.91-2.91c-.69.44-1.51.7-2.39.7C9.01 16 7 13.99 7 11.5S9.01 7 11.5 7 16 9.01 16 11.5c0 .88-.26 1.69-.7 2.39l2.91 2.9-1.42 1.42z"/></svg>`,
|
||||
"appLink": "https://blockbook.ranchimall.net/",
|
||||
"moreLink": "#/dapps/blockbook",
|
||||
"tags": [
|
||||
"blockbook",
|
||||
"flo",
|
||||
"blockchain"
|
||||
],
|
||||
"category": "blockchain-explorer",
|
||||
"allowDownload": false,
|
||||
"repoHash": "1d5cc442744f429fba5ad97ada001bfed2556d0ec7e1443b4ededb65f6ba5c61",
|
||||
"repoLink": "https://github.com/ranchimall/blockbook"
|
||||
},
|
||||
{
|
||||
"name": "Blockchain Bonds",
|
||||
"description": "Monitor Bitcoin bonds performance",
|
||||
"icon": html`<svg class="icon" width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M75.9466 56.32C74.2933 62.9333 64 59.5733 60.8 58.6667L63.7333 47.04C67.04 48 77.6533 49.3867 75.9466 56.32ZM59.36 64.64L56.16 77.4933C60.1066 78.5067 72.32 82.4 74.1333 75.1467C76.0533 67.5733 63.3066 65.6 59.36 64.64ZM115.733 76.9067C108.587 105.493 79.68 122.88 51.0933 115.733C22.5066 108.587 5.13597 79.68 12.2666 51.0933C19.4133 22.5067 48.32 5.14133 76.9066 12.2667C105.44 19.4133 122.827 48.32 115.733 76.9067ZM75.7866 42.9333L78.1866 33.3333L72.32 32L69.9733 41.2267C68.4266 40.8533 66.88 40.48 65.28 40.16L67.6266 30.72L61.8133 29.3333L59.4133 38.88C58.1333 38.56 56.8533 38.2933 55.68 37.9733L47.6266 35.9467L46.0266 42.1867C46.0266 42.1867 50.4 43.2 50.2933 43.2533C52.6933 43.84 53.12 45.3333 53.0133 46.6667L46.4533 72.96C46.1866 73.7067 45.3333 74.6667 43.7866 74.4C43.84 74.4533 39.52 73.3333 39.52 73.3333L36.64 80L44.2133 81.92C45.6533 82.2933 47.04 82.6667 48.4266 82.9867L45.9733 92.6933L51.84 94.1867L54.24 84.5333C55.84 84.96 57.3866 85.3333 58.88 85.76L56.48 95.3067L62.3466 96.8L64.8 87.0933C74.6666 88.96 82.24 88.2133 85.3333 79.2C88 72 85.3333 67.7333 80 65.0133C83.84 64 86.72 61.6 87.52 56.3733C88.5866 49.28 83.1466 45.4933 75.7866 42.9333Z" fill="#FFBF5E"></path> </svg>`,
|
||||
"appLink": "https://ranchimall.github.io/blockchainbonds",
|
||||
"moreLink": "#/dapps/blockchain-bonds",
|
||||
"tags": [
|
||||
"bitcoin",
|
||||
"bonds",
|
||||
"blockchain"
|
||||
],
|
||||
"category": "finance",
|
||||
"appHash": "5a8795102c2914a2bbf7c4755de288062e1fddfdfa9eef22a52b8f86f92e3fb3",
|
||||
"repoHash": "807eeae3644cee213b324c56f0079ffdfeb128f5e69584ea3ff47df41f53db05"
|
||||
},
|
||||
{
|
||||
"name": "Bob's Fund",
|
||||
"description": "A 20 year Bitcoin fund with 100% profit sharing",
|
||||
"icon": html`<svg class="icon" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><rect fill="none" height="24" width="24"/><g><path d="M19.83,7.5l-2.27-2.27c0.07-0.42,0.18-0.81,0.32-1.15C17.96,3.9,18,3.71,18,3.5C18,2.67,17.33,2,16.5,2 c-1.64,0-3.09,0.79-4,2l-5,0C4.46,4,2,6.46,2,9.5S4.5,21,4.5,21l5.5,0v-2h2v2l5.5,0l1.68-5.59L22,14.47V7.5H19.83z M13,9H8V7h5V9z M16,11c-0.55,0-1-0.45-1-1c0-0.55,0.45-1,1-1s1,0.45,1,1C17,10.55,16.55,11,16,11z"/></g></svg>`,
|
||||
"appLink": "https://ranchimall.github.io/bobsfund",
|
||||
"moreLink": "#/dapps/bobs-fund",
|
||||
"tags": [
|
||||
"fund",
|
||||
"bobs",
|
||||
"bitcoin"
|
||||
],
|
||||
"category": "finance",
|
||||
"appHash": "012c2ef05a0d2d0d551b068cad4aadc2a80c1019d741110f4f94da1bae742825",
|
||||
"repoHash": "3ea01907b09693cf11fa190100d2522bc645077f407775c54853cc5db9867dfb"
|
||||
},
|
||||
{
|
||||
"name": "BTC Mortgage",
|
||||
"description": "Borrow or Lend USD against Bitcoin",
|
||||
@ -403,7 +449,7 @@
|
||||
"borrow"
|
||||
],
|
||||
"category": "finance",
|
||||
"repoHash": "197f0c491e8cabf866603d03c437f9b96ad5b58ce55de2f6bc0d39a633fdf5e1",
|
||||
"repoHash": "996c8ff61eef8f9a9d1b6e290fd6ebe683044f64f09f86c76025298b74f82932",
|
||||
"appHash": "8a0cc53e479a1c7fb205b38d53a61b670f1b809c82ef1e5bcfddb39b5488d473"
|
||||
},
|
||||
{
|
||||
@ -417,7 +463,7 @@
|
||||
"wallet"
|
||||
],
|
||||
"category": "wallet",
|
||||
"repoHash": "15908cd7e375d577132d22309a8d85f801dcb9c6b838ddc8ee2d6da590c6a0fc",
|
||||
"repoHash": "28de47f70ab8e4e424baf127e195ece192735810a8acfa3345c265cb3f9b095c",
|
||||
"appHash": "37d7002211272d841b93803c69e79351758bc89c348167805b216ecfd85a5289"
|
||||
},
|
||||
{
|
||||
@ -432,7 +478,7 @@
|
||||
"certification"
|
||||
],
|
||||
"category": "identity",
|
||||
"repoHash": "99f2b66dcd62b2156b4f64cd4eab8a4efc182284fe13cdb8e2a9876d865c0123",
|
||||
"repoHash": "8dd4e065038eee5450ec537a377519940a5e43a9436dac9d24b1101d7be09d7a",
|
||||
"appHash": "563a97cc5be968d5ffc1511925766bc624df5ae3f71dca5ef48a5030ebe3b5ba"
|
||||
},
|
||||
{
|
||||
@ -447,7 +493,7 @@
|
||||
"content"
|
||||
],
|
||||
"category": "content",
|
||||
"repoHash": "debdda5bd18f0f4d06876967de5f6dd55f514b9048ec978d435acdbe720a5ff8",
|
||||
"repoHash": "faea71e27b0f39038e642358796ea5b53c83894aec1704e823400e30cd3932f9",
|
||||
"appHash": "78834ea328f5f3ed247c76cf92086f711dc7e56a14d2e4548d7ef36f358d3380"
|
||||
},
|
||||
{
|
||||
@ -463,7 +509,7 @@
|
||||
"rupee"
|
||||
],
|
||||
"category": "finance",
|
||||
"repoHash": "a5dbba6043d82ae04e99a8a522f4ab2d1ba2a2779cdcf4f28c1da2b2acf11df6",
|
||||
"repoHash": "a76df3ee4c7c1e3de7a278f5968a9fb4dc2da7b5b3f6483ec1768564d6673af0",
|
||||
"appHash": "1af17ee38d4b6c7c0ae4ca08fe526899c05fe56074ccac633183e400e039c9f2"
|
||||
},
|
||||
{
|
||||
@ -478,7 +524,7 @@
|
||||
"flo"
|
||||
],
|
||||
"category": "wallet",
|
||||
"repoHash": "6e647729eb0f179045f764d08c44d61178bb84e36e327d026c34a701a9875132",
|
||||
"repoHash": "faffb85ab277cce6ae9dd718056eebf66a79acb809315ad2430a8689b3f98637",
|
||||
"appHash": "2f55bd07e27cf2e869854b41883b733b9cd6eb6e4809f6a92e66d62d747a2f91"
|
||||
},
|
||||
{
|
||||
@ -493,7 +539,7 @@
|
||||
"smart contracts"
|
||||
],
|
||||
"category": "blockchain-explorer",
|
||||
"repoHash": "cb84c51f35d03e224b4a76d1a27dd19a75f4ac9b785e059696c16206557cfee3",
|
||||
"repoHash": "371ed1fc9e29a89a795f69c552ed78ebe1bd1f97fa9edb14552157e7b4122f05",
|
||||
"appHash": "0d81003141a2b586bd2272a64341e118b70746da35ef7d66662c282173c1752e"
|
||||
},
|
||||
{
|
||||
@ -507,7 +553,7 @@
|
||||
"wallet"
|
||||
],
|
||||
"category": "wallet",
|
||||
"repoHash": "a6ba8112b57a033cc0124aa3f1761e27b2066226b6604d035e8596d2c662b6b6",
|
||||
"repoHash": "f3a8bb4c3b8e2e7db8bd7af9bfa8043402ce38042f2068758080577225622e7b",
|
||||
"appHash": "b1ec2cca4c2e083dc9154608224d9b254fb9c4635743b59ccec6363828ca8a39"
|
||||
},
|
||||
{
|
||||
@ -522,9 +568,27 @@
|
||||
"rupee"
|
||||
],
|
||||
"category": "wallet",
|
||||
"repoHash": "8cc4313d43468138f26cf13a776876fc21560714d8e5eb1217599af585105a8f",
|
||||
"repoHash": "2080bcc32a390556eb51f3f405f29aca755b8b8d3871e7838f520e0ac82902a4",
|
||||
"appHash": "255b4d1c89974fdd59463d92e84cf8fee3d095be9f1e17f6ff8e1ee52bc24a58"
|
||||
},
|
||||
{
|
||||
"name": "ICO Exchange",
|
||||
"description": "An exchange for ICO token trading",
|
||||
"icon": html`<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><g><path d="M0,0h24v24H0V0z" fill="none"/><path d="M20,2H4C2.9,2,2,2.9,2,4v16c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M7,17H5v-2h2V17z M7,13H5v-2h2V13z M7,9H5 V7h2V9z M11,17H9v-2h2V17z M11,13H9v-2h2V13z M11,9H9V7h2V9z M15,17h-2v-2h2V17z M15,13h-2v-2h2V13z M15,9h-2V7h2V9z M19,17h-2v-2h2V17z M19,13h-2v-2h2V13z M19,9h-2V7h2V9z"/></g></svg>`,
|
||||
"appLink": "https://ranchimall.net/exchange",
|
||||
"moreLink": "#/dapps/ico-exchange",
|
||||
"tags": [
|
||||
"exchange",
|
||||
"ICO",
|
||||
"RMT",
|
||||
"RanchiMall",
|
||||
"tokens"
|
||||
],
|
||||
"category": "finance",
|
||||
"allowDownload": false,
|
||||
"repoHash": "bcd943193b9a76991e8d1ebd4bd88a30ece97f69efe80c37f3c5a733c76a2b6b",
|
||||
"repoLink": "https://github.com/ranchimall/flo-exchange"
|
||||
},
|
||||
{
|
||||
"name": "KYC",
|
||||
"description": "An app to verify your identity",
|
||||
@ -536,7 +600,7 @@
|
||||
"identity"
|
||||
],
|
||||
"category": "identity",
|
||||
"repoHash": "247423654e501dab943296ab9a55e60bf4204164aee469f401cecf0b53290671",
|
||||
"repoHash": "ff88183ab2cb23bb8cb952ea8c4b45e2aac9c20da51e2443eda076f1af762052",
|
||||
"appHash": "4d683316fdc512b375bfc529d5a9aa7eb291ade7460bdf080db6450dc3fb430e"
|
||||
},
|
||||
{
|
||||
@ -551,7 +615,7 @@
|
||||
"logsheets"
|
||||
],
|
||||
"category": "content",
|
||||
"repoHash": "5c04711bbeaede85010e26d281a0a246a6f7f104e07a7bfcc5bc5208908647b6",
|
||||
"repoHash": "c17313a043d157cf66c6196d12154355fef08e0287402a2f4d96acbb40aae9a4",
|
||||
"appHash": "1650c9888e9b418507d41af3ba76ee14753cfa0faa4f9753dff46fcd2a44047d"
|
||||
},
|
||||
{
|
||||
@ -569,7 +633,7 @@
|
||||
"multisig"
|
||||
],
|
||||
"category": "social",
|
||||
"repoHash": "8713c516c826f10a5258a0962c87e3a26bd54f25d9034d7d2b7dbb7a33e4e914",
|
||||
"repoHash": "e0d3b9335c587355bcb125d7a57fb934aebc4f8b87758bfc29221ea349448e3b",
|
||||
"appHash": "188174ab439516d25fe3ba30b18ca7fae07277f97c6df019331b8300d1f68c14"
|
||||
},
|
||||
{
|
||||
@ -584,7 +648,7 @@
|
||||
"content"
|
||||
],
|
||||
"category": "content",
|
||||
"repoHash": "840823abe525a8be560d58e45af2499de6f45eaf973ce69a500b1df31ca295be",
|
||||
"repoHash": "d1391ee455d51bd340a1d542353ed6fa15793e84c172c754fc15d8727cde8a20",
|
||||
"appHash": "d63d7fbd5ba8795977a30178ee426705ec41f58ce26a5fd0c6e281492a012766"
|
||||
},
|
||||
{
|
||||
@ -599,7 +663,7 @@
|
||||
"ribc"
|
||||
],
|
||||
"category": "management",
|
||||
"repoHash": "9e0e44c5d50d7a0f28fb0f8ac4a168b5a1ec93a6e29e41503e1a6a579c567ed8",
|
||||
"repoHash": "e26a9b73724b82f9d2bc3660299278fc062473b2ff813f5dba8753e5a40a650f",
|
||||
"appHash": "ad5145d8526868fe5358ce00d64fc98b1f3f2b02b5e2ee482ef7068a044055ef"
|
||||
},
|
||||
{
|
||||
@ -614,72 +678,9 @@
|
||||
"taproot"
|
||||
],
|
||||
"category": "wallet",
|
||||
"repoHash": "592bdad38e1b45e41247f054de33b9d71c58d4178d70ca03c22f1def7c97e2c0",
|
||||
"repoHash": "1ce9876835b9640b16962dcf31194338df3fceb26b76f2eb5594207f80e00ae7",
|
||||
"appHash": "ecad64071b9c4026e94d4e57e76ade152b63f2619d44025f6a7f4f9f31184bc2",
|
||||
automatedChecking: true
|
||||
},
|
||||
{
|
||||
"name": "Blockchain Bonds",
|
||||
"description": "Monitor Bitcoin bonds performance",
|
||||
"icon": html`<svg class="icon" width="128" height="128" viewBox="0 0 128 128" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M75.9466 56.32C74.2933 62.9333 64 59.5733 60.8 58.6667L63.7333 47.04C67.04 48 77.6533 49.3867 75.9466 56.32ZM59.36 64.64L56.16 77.4933C60.1066 78.5067 72.32 82.4 74.1333 75.1467C76.0533 67.5733 63.3066 65.6 59.36 64.64ZM115.733 76.9067C108.587 105.493 79.68 122.88 51.0933 115.733C22.5066 108.587 5.13597 79.68 12.2666 51.0933C19.4133 22.5067 48.32 5.14133 76.9066 12.2667C105.44 19.4133 122.827 48.32 115.733 76.9067ZM75.7866 42.9333L78.1866 33.3333L72.32 32L69.9733 41.2267C68.4266 40.8533 66.88 40.48 65.28 40.16L67.6266 30.72L61.8133 29.3333L59.4133 38.88C58.1333 38.56 56.8533 38.2933 55.68 37.9733L47.6266 35.9467L46.0266 42.1867C46.0266 42.1867 50.4 43.2 50.2933 43.2533C52.6933 43.84 53.12 45.3333 53.0133 46.6667L46.4533 72.96C46.1866 73.7067 45.3333 74.6667 43.7866 74.4C43.84 74.4533 39.52 73.3333 39.52 73.3333L36.64 80L44.2133 81.92C45.6533 82.2933 47.04 82.6667 48.4266 82.9867L45.9733 92.6933L51.84 94.1867L54.24 84.5333C55.84 84.96 57.3866 85.3333 58.88 85.76L56.48 95.3067L62.3466 96.8L64.8 87.0933C74.6666 88.96 82.24 88.2133 85.3333 79.2C88 72 85.3333 67.7333 80 65.0133C83.84 64 86.72 61.6 87.52 56.3733C88.5866 49.28 83.1466 45.4933 75.7866 42.9333Z" fill="#FFBF5E"></path> </svg>`,
|
||||
"appLink": "https://ranchimall.github.io/blockchainbonds",
|
||||
"moreLink": "#/dapps/blockchain-bonds",
|
||||
"tags": [
|
||||
"bitcoin",
|
||||
"bonds",
|
||||
"blockchain"
|
||||
],
|
||||
"category": "finance",
|
||||
"appHash": "5a8795102c2914a2bbf7c4755de288062e1fddfdfa9eef22a52b8f86f92e3fb3",
|
||||
"repoHash": "661ebe8b28bcf0a14ffe3a485e44dbc65cceab77d1de3bf8f6b2bccfdb1d57b5"
|
||||
},
|
||||
{
|
||||
"name": "Bob's Fund",
|
||||
"description": "A 20 year Bitcoin fund with 100% profit sharing",
|
||||
"icon": html`<svg class="icon" xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><rect fill="none" height="24" width="24"/><g><path d="M19.83,7.5l-2.27-2.27c0.07-0.42,0.18-0.81,0.32-1.15C17.96,3.9,18,3.71,18,3.5C18,2.67,17.33,2,16.5,2 c-1.64,0-3.09,0.79-4,2l-5,0C4.46,4,2,6.46,2,9.5S4.5,21,4.5,21l5.5,0v-2h2v2l5.5,0l1.68-5.59L22,14.47V7.5H19.83z M13,9H8V7h5V9z M16,11c-0.55,0-1-0.45-1-1c0-0.55,0.45-1,1-1s1,0.45,1,1C17,10.55,16.55,11,16,11z"/></g></svg>`,
|
||||
"appLink": "https://ranchimall.github.io/bobsfund",
|
||||
"moreLink": "#/dapps/bobs-fund",
|
||||
"tags": [
|
||||
"fund",
|
||||
"bobs",
|
||||
"bitcoin"
|
||||
],
|
||||
"category": "finance",
|
||||
"appHash": "012c2ef05a0d2d0d551b068cad4aadc2a80c1019d741110f4f94da1bae742825",
|
||||
"repoHash": "b5b466e8b3e818ad8c95710edc9a770e4964b0ed74cb32366edec646a8f3372d"
|
||||
},
|
||||
{
|
||||
"name": "Blockbook",
|
||||
"description": "A blockchain explorer for FLO",
|
||||
"icon": html`<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><path d="M0 0h24v24H0z" fill="none"/><path d="M11.5 9C10.12 9 9 10.12 9 11.5s1.12 2.5 2.5 2.5 2.5-1.12 2.5-2.5S12.88 9 11.5 9zM20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3.21 14.21l-2.91-2.91c-.69.44-1.51.7-2.39.7C9.01 16 7 13.99 7 11.5S9.01 7 11.5 7 16 9.01 16 11.5c0 .88-.26 1.69-.7 2.39l2.91 2.9-1.42 1.42z"/></svg>`,
|
||||
"appLink": "https://blockbook.ranchimall.net/",
|
||||
"moreLink": "#/dapps/blockbook",
|
||||
"tags": [
|
||||
"blockbook",
|
||||
"flo",
|
||||
"blockchain"
|
||||
],
|
||||
"category": "blockchain-explorer",
|
||||
"allowDownload": false,
|
||||
"repoHash": "1d5cc442744f429fba5ad97ada001bfed2556d0ec7e1443b4ededb65f6ba5c61",
|
||||
"repoLink": "https://github.com/ranchimall/blockbook"
|
||||
}, {
|
||||
"name": "ICO Exchange",
|
||||
"description": "An exchange for ICO token trading",
|
||||
"icon": html`<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px"><g><path d="M0,0h24v24H0V0z" fill="none"/><path d="M20,2H4C2.9,2,2,2.9,2,4v16c0,1.1,0.9,2,2,2h16c1.1,0,2-0.9,2-2V4C22,2.9,21.1,2,20,2z M7,17H5v-2h2V17z M7,13H5v-2h2V13z M7,9H5 V7h2V9z M11,17H9v-2h2V17z M11,13H9v-2h2V13z M11,9H9V7h2V9z M15,17h-2v-2h2V17z M15,13h-2v-2h2V13z M15,9h-2V7h2V9z M19,17h-2v-2h2V17z M19,13h-2v-2h2V13z M19,9h-2V7h2V9z"/></g></svg>`,
|
||||
"appLink": "https://ranchimall.net/exchange",
|
||||
"moreLink": "#/dapps/ico-exchange",
|
||||
"tags": [
|
||||
"exchange",
|
||||
"ICO",
|
||||
"RMT",
|
||||
"RanchiMall",
|
||||
"tokens",
|
||||
],
|
||||
"category": "finance",
|
||||
"allowDownload": false,
|
||||
"repoHash": "bcd943193b9a76991e8d1ebd4bd88a30ece97f69efe80c37f3c5a733c76a2b6b",
|
||||
"repoLink": "https://github.com/ranchimall/flo-exchange"
|
||||
"automatedChecking": true
|
||||
}
|
||||
].sort((a, b) => a.name.localeCompare(b.name));
|
||||
|
||||
@ -855,9 +856,9 @@
|
||||
<sm-input id="dapp_search_input" type="search" placeholder="Search Dapps" oninput=${searchDapps} value=${query}>
|
||||
<svg slot="icon" class="icon" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"> <path d="M0 0h24v24H0V0z" fill="none"></path> <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"> </path> </svg>
|
||||
</sm-input>
|
||||
<button id="download_all_button" class="button button--colored margin-left-auto" onclick=${downloadAllDapps}>
|
||||
<a id="download_all_button" class="button button--colored margin-left-auto" href="https://github.com/ranchimall/dappbundle/archive/refs/heads/master.zip">
|
||||
Download all
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
<sm-chips id="category_selector" onchange=${handleFilterCategory}>
|
||||
${['all', 'blockchain-explorer', 'content', 'finance', 'identity', 'management', 'social', 'wallet'].map((value, index) => html`
|
||||
@ -898,48 +899,6 @@
|
||||
);
|
||||
})
|
||||
}
|
||||
async function downloadAllDapps() {
|
||||
const downloadAllButton = getRef('download_all_button')
|
||||
const downloadAllButtonContent = downloadAllButton.innerHTML
|
||||
downloadAllButton.innerHTML = 'Downloading...<sm-spinner></sm-spinner>'
|
||||
pseudoDisable(downloadAllButton, true)
|
||||
const verificationPromises = dappsList
|
||||
.filter(({ allowDownload = true }) => allowDownload) // remove dapps that don't allow download
|
||||
.map(({ appLink }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const appRepoName = appLink.split('/').pop()
|
||||
getRepoHash(appRepoName).then(latestHash => {
|
||||
const { repoHash: knownHash } = dappsList.find(dapp => dapp.appLink === appLink)
|
||||
if (latestHash !== knownHash) {
|
||||
notify(`The dapp '${appRepoName}' has failed integrity check. Dapp won't be downloaded.`, 'error')
|
||||
reject()
|
||||
} else {
|
||||
resolve(`https://github.com/ranchimall/${appRepoName}`)
|
||||
}
|
||||
}).catch(e => {
|
||||
console.error(e)
|
||||
notify('There was an error while trying to download the dapp. Please try again later.', 'error', {
|
||||
timeout: 10000,
|
||||
})
|
||||
reject()
|
||||
})
|
||||
})
|
||||
})
|
||||
try {
|
||||
let downloadLinks = await Promise.allSettled(verificationPromises)
|
||||
downloadLinks = downloadLinks.filter(({ status }) => status === 'fulfilled').map(({ value }) => value)
|
||||
await downloadReposZipped(downloadLinks)
|
||||
notify('All verified dapps have been downloaded', 'success')
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
notify('There was an error while trying to download the dapps. Please try again later.', 'error', {
|
||||
timeout: 10000,
|
||||
})
|
||||
} finally {
|
||||
downloadAllButton.innerHTML = downloadAllButtonContent
|
||||
pseudoDisable(downloadAllButton, false)
|
||||
}
|
||||
}
|
||||
function addProtocolToUrl(url) {
|
||||
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
||||
url = 'https://' + url;
|
||||
@ -1229,7 +1188,8 @@
|
||||
})
|
||||
})
|
||||
|
||||
async function getRepoHash(repoName = 'messenger') {
|
||||
async function getRepoHash(repoName) {
|
||||
if (!repoName) return null
|
||||
const response = await fetch(`https://api.github.com/repos/ranchimall/${repoName}/contents/`)
|
||||
const json = await response.json()
|
||||
const combinedSHA = json.reduce((acc, { sha }) => acc + sha, '')
|
||||
@ -1249,6 +1209,9 @@
|
||||
*/
|
||||
async function getLinkContentHash(link) {
|
||||
try {
|
||||
if (!link) return null
|
||||
if (!Array.isArray(link))
|
||||
link = [link]
|
||||
const data = JSON.stringify({ urls: link })
|
||||
return await (await fetch('https://integrity-api.ranchimall.net/hash', {
|
||||
headers: {
|
||||
@ -1262,28 +1225,6 @@
|
||||
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>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user