From 3d11924300b93466a00c3a0c22f9feb5da6b21ae Mon Sep 17 00:00:00 2001 From: Aleksandr Kraiz Date: Thu, 12 May 2022 21:09:26 +0400 Subject: [PATCH] Added shortName to config --- src/config/chains.json | 17 +++++++++++++---- src/config/schemas/pureChainSchema.ts | 1 + src/services/OrionBlockchain/index.ts | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/config/chains.json b/src/config/chains.json index 607eb63..f243fc5 100644 --- a/src/config/chains.json +++ b/src/config/chains.json @@ -2,7 +2,8 @@ "1": { "chainId": "1", "explorer": "https://etherscan.io/", - "label": "Ethereum", + "label": "Ethereum Mainnet", + "shortName": "ETH", "code": "eth", "rpc": "https://trade.orionprotocol.io/rpc", "baseCurrencyName": "ETH" @@ -11,6 +12,7 @@ "chainId": "56", "explorer": "https://bscscan.com/", "label": "Binance Smart Chain", + "shortName": "BSC", "code": "bsc", "rpc": "https://bsc-dataseed.binance.org/", "baseCurrencyName": "BNB" @@ -19,6 +21,7 @@ "chainId": "97", "explorer": "https://testnet.bscscan.com/", "label": "Binance Smart Chain Testnet", + "shortName": "BSC-Testent", "code": "bsc", "rpc": "https://bsc-stage.node.orionprotocol.io/", "baseCurrencyName": "BNB" @@ -27,6 +30,7 @@ "chainId": "3", "explorer": "https://ropsten.etherscan.io/", "label": "Ropsten", + "shortName": "ETH-Ropsten", "code": "eth", "rpc": "https://testing.orionprotocol.io/eth-ropsten/rpc", "baseCurrencyName": "ETH" @@ -35,6 +39,7 @@ "chainId": "4002", "explorer": "https://testnet.ftmscan.com/", "label": "Fantom Testnet", + "shortName": "FTM-Testnet", "code": "ftm", "rpc": "https://testing.orionprotocol.io/ftm-testnet/rpc", "baseCurrencyName": "FTM" @@ -42,14 +47,16 @@ "250": { "chainId": "250", "explorer": "https://ftmscan.com/", - "label": "Fantom", + "label": "Fantom Mainnet", + "shortName": "FTM", "code": "ftm", "rpc": "https://rpcapi.fantom.network/", "baseCurrencyName": "FTM" }, "137": { "chainId": "137", - "label": "Polygon", + "label": "Polygon Mainnet", + "shortName": "Polygon", "code": "poly", "baseCurrencyName": "MATIC", "rpc": "https://polygon-rpc.com/", @@ -57,7 +64,8 @@ }, "80001": { "chainId": "80001", - "label": "Polygon Testnet", + "label": "Polygon Mumbai", + "shortName": "Polygon Mumbai", "code": "poly", "baseCurrencyName": "MATIC", "rpc": "https://rpc-mumbai.matic.today", @@ -66,6 +74,7 @@ "0": { "chainId": "0", "explorer": "https://brokenscan.io/", + "shortName": "BROKEN", "label": "BrokenChain", "code": "bkn", "rpc": "https://brokenscan.io/rpc", diff --git a/src/config/schemas/pureChainSchema.ts b/src/config/schemas/pureChainSchema.ts index a83aef3..7d86751 100644 --- a/src/config/schemas/pureChainSchema.ts +++ b/src/config/schemas/pureChainSchema.ts @@ -4,6 +4,7 @@ import { SupportedChainId } from '../../types'; export const pureChainInfoPayloadSchema = z.object({ chainId: z.nativeEnum(SupportedChainId), label: z.string(), + shortName: z.string(), code: z.string(), explorer: z.string(), rpc: z.string(), diff --git a/src/services/OrionBlockchain/index.ts b/src/services/OrionBlockchain/index.ts index d75fc2f..77c935e 100644 --- a/src/services/OrionBlockchain/index.ts +++ b/src/services/OrionBlockchain/index.ts @@ -103,7 +103,7 @@ class OrionBlockchain { private getQueueLength = () => fetchWithValidation( `https://${this.apiUrl}/api/queueLength`, - z.number().int() + z.number().int(), ); get internal() {