Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions cosmos/mantra-dukong-evm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"chainId": "mantra-dukong-evm-1",
"chainName": "MANTRA Dukong Testnet (EVM Interoperable)",
"chainSymbolImageUrl": "https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/mantra-dukong/chain.png",
"rpc": "https://rpc.dukong.mantrachain.io",
"rest": "https://api.dukong.mantrachain.io",
"nodeProvider": {
"name": "MANTRA Chain Association",
"email": "security@mantrachain.io",
"website": "https://mantrachain.io/"
},
"bip44": {
"coinType": 60
},
"bech32Config": {
"bech32PrefixAccAddr": "mantra",
"bech32PrefixAccPub": "mantrapub",
"bech32PrefixValAddr": "mantravaloper",
"bech32PrefixValPub": "mantravaloperpub",
"bech32PrefixConsAddr": "mantravalcons",
"bech32PrefixConsPub": "mantravalconspub"
},
"currencies": [
{
"coinDenom": "OM",
"coinMinimalDenom": "uom",
"coinDecimals": 6,
"coinImageUrl": "https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/mantra-dukong/om.png"
}
],
"feeCurrencies": [
{
"coinDenom": "OM",
"coinMinimalDenom": "uom",
"coinDecimals": 6,
"coinImageUrl": "https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/mantra-dukong/om.png",
"gasPriceStep": {
"low": 0.01,
"average": 0.025,
"high": 0.03
}
}
],
"stakeCurrency": {
"coinDenom": "OM",
"coinMinimalDenom": "uom",
"coinDecimals": 6,
"coinImageUrl": "https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/mantra-dukong/om.png"
},
"features": [
"cosmwasm",
"eth-address-gen",
"eth-key-sign",
"eth-secp256k1-cosmos"
],
"evm": {
"chainId": 5887,
"rpc": "https://evm.dukong.mantrachain.io",
"websocket": "https://evm.dukong.mantrachain.io/ws"
},
"isTestnet": true
}
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ const main = async () => {
);
}

const chainIdentifier = libPath.parse(path).name;
let chainIdentifier = libPath.parse(path).name;
if (chainIdentifier === "mantra-dukong-evm") {
chainIdentifier = "mantra-dukong";
} else if (chainIdentifier === "mantra-evm") {
chainIdentifier = "mantra";
}

const validateImageUrl = (url: string): string => {
const baseURL = `https://raw.githubusercontent.com/chainapsis/keplr-chain-registry/main/images/${chainIdentifier}/`;
Expand Down
15 changes: 13 additions & 2 deletions src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ export const fileToChainInfo = (filePath: string) => {
return chainInfo;
};

const handleShadowChainId = (chainId: string): string => {
if (chainId === "mantra-dukong-evm-1") {
return "mantra-dukong-1";
} else if (chainId === "mantra-evm-1") {
return "mantra-1";
} else {
return chainId;
}
};

export const validateCosmosChainInfoFromPath = async (
path: string,
): Promise<ChainInfo> => {
Expand Down Expand Up @@ -94,9 +104,10 @@ export const validateCosmosChainInfo = async (
);
}

const chainId = handleShadowChainId(chainInfo.chainId);
// check RPC alive
await checkRPCConnectivity(
chainInfo.chainId,
chainId,
chainInfo.rpc,
(url) => new WebSocket(url),
);
Expand All @@ -117,7 +128,7 @@ export const validateCosmosChainInfo = async (
chainIdentifier !== "sommelier" &&
chainIdentifier !== "kyve"
) {
await checkRestConnectivity(chainInfo.chainId, chainInfo.rest);
await checkRestConnectivity(chainId, chainInfo.rest);
}

// check coinGecko vaild
Expand Down
Loading