diff --git a/_data/chains/1.json b/_data/chains/1.json index cb0bbb48..cf504990 100644 --- a/_data/chains/1.json +++ b/_data/chains/1.json @@ -15,5 +15,6 @@ "infoURL": "https://ethereum.org", "shortName": "eth", "chainId": 1, - "networkId": 1 + "networkId": 1, + "slip44": 60 } \ No newline at end of file diff --git a/_data/chains/100.json b/_data/chains/100.json index 07f656fb..ea7f9574 100644 --- a/_data/chains/100.json +++ b/_data/chains/100.json @@ -14,5 +14,6 @@ "infoURL": "https://forum.poa.network/c/xdai-chain", "shortName": "xdai", "chainId": 100, - "networkId": 100 -} \ No newline at end of file + "networkId": 100, + "slip44": 700 +} diff --git a/_data/chains/101.json b/_data/chains/101.json index 9f403b3a..ae18812f 100644 --- a/_data/chains/101.json +++ b/_data/chains/101.json @@ -14,5 +14,6 @@ "infoURL": "https://einc.io", "shortName": "eti", "chainId": 101, - "networkId": 1 + "networkId": 1, + "slip44": 464 } \ No newline at end of file diff --git a/_data/chains/11.json b/_data/chains/11.json index 8b7627c3..69f94b3e 100644 --- a/_data/chains/11.json +++ b/_data/chains/11.json @@ -14,5 +14,6 @@ "infoURL": "https://metadium.com", "shortName": "meta", "chainId": 11, - "networkId": 11 + "networkId": 11, + "slip44": 961 } \ No newline at end of file diff --git a/_data/chains/1313114.json b/_data/chains/1313114.json index 596ebee9..001999f8 100644 --- a/_data/chains/1313114.json +++ b/_data/chains/1313114.json @@ -14,5 +14,6 @@ "infoURL": "https://ether1.org", "shortName": "etho", "chainId": 1313114, - "networkId": 1313114 + "networkId": 1313114, + "slip44": 1313114 } \ No newline at end of file diff --git a/_data/chains/1620.json b/_data/chains/1620.json index 2d575149..4a752163 100644 --- a/_data/chains/1620.json +++ b/_data/chains/1620.json @@ -14,5 +14,6 @@ "infoURL": "https://atheios.com", "shortName": "ath", "chainId": 1620, - "networkId": 11235813 + "networkId": 11235813, + "slip44": 1620 } \ No newline at end of file diff --git a/_data/chains/1987.json b/_data/chains/1987.json index 4d0b5da8..417cd5e0 100644 --- a/_data/chains/1987.json +++ b/_data/chains/1987.json @@ -14,5 +14,6 @@ "infoURL": "https://egem.io", "shortName": "egem", "chainId": 1987, - "networkId": 1987 + "networkId": 1987, + "slip44": 1987 } \ No newline at end of file diff --git a/_data/chains/2.json b/_data/chains/2.json index 84197bc6..f50d9e2f 100644 --- a/_data/chains/2.json +++ b/_data/chains/2.json @@ -14,5 +14,6 @@ "infoURL": "https://expanse.tech", "shortName": "exp", "chainId": 2, - "networkId": 1 + "networkId": 1, + "slip44": 40 } \ No newline at end of file diff --git a/_data/chains/61.json b/_data/chains/61.json index 3da90515..88d0a2ba 100644 --- a/_data/chains/61.json +++ b/_data/chains/61.json @@ -14,5 +14,6 @@ "infoURL": "https://ethereumclassic.org", "shortName": "etc", "chainId": 61, - "networkId": 1 + "networkId": 1, + "slip44": 61 } \ No newline at end of file diff --git a/_data/chains/61717561.json b/_data/chains/61717561.json index 54967f15..d3f04865 100644 --- a/_data/chains/61717561.json +++ b/_data/chains/61717561.json @@ -17,5 +17,6 @@ "infoURL": "https://aquachain.github.io", "shortName": "aqua", "chainId": 61717561, - "networkId": 61717561 + "networkId": 61717561, + "slip44": 61717561 } \ No newline at end of file diff --git a/src/main/kotlin/org/ethereum/lists/chains/ChainChecker.kt b/src/main/kotlin/org/ethereum/lists/chains/ChainChecker.kt index 9339f6a8..24174b43 100644 --- a/src/main/kotlin/org/ethereum/lists/chains/ChainChecker.kt +++ b/src/main/kotlin/org/ethereum/lists/chains/ChainChecker.kt @@ -6,7 +6,7 @@ import org.kethereum.rpc.HttpEthereumRPC import java.io.File import java.math.BigInteger -val all_fields = listOf( +val mandatory_fields = listOf( "name", "shortName", "chain", @@ -18,6 +18,9 @@ val all_fields = listOf( "infoURL", "nativeCurrency" ) +val optionalFields = listOf( + "slip44" +) class FileNameMustMatchChainId : Exception("chainId must match the filename") class ExtensionMustBeJSON : Exception("filename extension must be json") @@ -41,12 +44,12 @@ fun checkChain(it: File, connectRPC: Boolean) { getNumber(jsonObject, "networkId") - val extraFields = jsonObject.map.keys.subtract(all_fields) + val extraFields = jsonObject.map.keys.subtract(mandatory_fields).subtract(optionalFields) if (extraFields.isNotEmpty()) { throw ShouldHaveNoExtraFields(extraFields) } - val missingFields = all_fields.subtract(jsonObject.map.keys) + val missingFields = mandatory_fields.subtract(jsonObject.map.keys) if (missingFields.isNotEmpty()) { throw ShouldHaveNoMissingFields(missingFields) }