mirror of
https://github.com/Instadapp/chains.git
synced 2024-07-29 22:37:19 +00:00
parent
4fe1b852e2
commit
4ea7eef329
|
@ -38,23 +38,25 @@ private fun createOutputFiles() {
|
||||||
val chainJSONArray = JsonArray<JsonObject>()
|
val chainJSONArray = JsonArray<JsonObject>()
|
||||||
val miniChainJSONArray = JsonArray<JsonObject>()
|
val miniChainJSONArray = JsonArray<JsonObject>()
|
||||||
|
|
||||||
allChainFiles.forEach {
|
allChainFiles
|
||||||
val jsonObject = Klaxon().parseJsonObject(it.reader())
|
.map { Klaxon().parseJsonObject(it.reader()) }
|
||||||
chainJSONArray.add(jsonObject)
|
.sortedBy { (it["chainId"] as Number).toLong() }
|
||||||
fullJSONFile.writeText(chainJSONArray.toJsonString())
|
.forEach { jsonObject ->
|
||||||
prettyJSONFile.writeText(chainJSONArray.toJsonString(prettyPrint = true))
|
chainJSONArray.add(jsonObject)
|
||||||
|
fullJSONFile.writeText(chainJSONArray.toJsonString())
|
||||||
|
prettyJSONFile.writeText(chainJSONArray.toJsonString(prettyPrint = true))
|
||||||
|
|
||||||
val miniJSON = JsonObject()
|
val miniJSON = JsonObject()
|
||||||
listOf("name", "chainId", "shortName", "networkId", "nativeCurrency", "rpc", "faucets", "infoURL").forEach { field ->
|
listOf("name", "chainId", "shortName", "networkId", "nativeCurrency", "rpc", "faucets", "infoURL").forEach { field ->
|
||||||
jsonObject[field]?.let { content ->
|
jsonObject[field]?.let { content ->
|
||||||
miniJSON[field] = content
|
miniJSON[field] = content
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
miniChainJSONArray.add(miniJSON)
|
||||||
miniChainJSONArray.add(miniJSON)
|
|
||||||
|
|
||||||
miniJSONFile.writeText(miniChainJSONArray.toJsonString())
|
miniJSONFile.writeText(miniChainJSONArray.toJsonString())
|
||||||
prettyMiniJSONFile.writeText(miniChainJSONArray.toJsonString(prettyPrint = true))
|
prettyMiniJSONFile.writeText(miniChainJSONArray.toJsonString(prettyPrint = true))
|
||||||
}
|
}
|
||||||
|
|
||||||
File(buildPath, "index.html").writeText(
|
File(buildPath, "index.html").writeText(
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user