From 66d6e483fc15f71727091c4f6c828cfbf46ae461 Mon Sep 17 00:00:00 2001 From: Thunnini Date: Tue, 20 Dec 2022 16:25:16 +0900 Subject: [PATCH] Add `CHAIN_ALLOWLIST` constant --- constants/icns.ts | 63 ++++++++++++++++++++++++++++++++++++ pages/verification/index.tsx | 6 ++-- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/constants/icns.ts b/constants/icns.ts index b4db594..5eac535 100644 --- a/constants/icns.ts +++ b/constants/icns.ts @@ -19,3 +19,66 @@ export const REGISTRAR_ADDRESS = export const RESOLVER_ADDRESS = process.env.NEXT_PUBLIC_ICNS_RESOLVER_CONTRACT_ADDRESS ?? "osmo1002awr7frr9wk44lc3vfzt0d2w6vz5z03ql6fszjsjy8vdcvk0sskruz3c"; + +export const CHAIN_ALLOWLIST = + process.env.NEXT_PUBLIC_CHAIN_ALLOWLIST || + [ + "acre_9052-1", + "ioz_168-1", + "akashnet-2", + "mantle-1", + "axelar-dojo-1", + "laozi-mainnet", + "bitcanna-1", + "bitsong-2b", + "bostrom", + "carbon-1", + "cerberus-chain-1", + "perun-1", + "cheqd-mainnet-1", + "chihuahua-1", + "comdex-1", + "commercio-3", + "cosmoshub-4", + "crescent-1", + "cudos-1", + "mainnet-3", + "dig-1", + "emoney-3", + "fetchhub-4", + "colosseum-1", + "gravity-bridge-3", + "ixo-4", + "irishub-1", + "jackal-1", + "juno-1", + "kava_2222-10", + "kichain-2", + "darchub", + "kaiyo-1", + "likecoin-mainnet-2", + "lum-network-1", + "odin-mainnet-freya", + "omniflixhub-1", + "Oraichain", + "osmosis-1", + "panacea-3", + "core-1", + "pio-mainnet-1", + "quicksilver-1", + "reb_1111-1", + "regen-1", + "titan-1", + "secret-4", + "sentinelhub-2", + "shentu-2.2", + "sifchain-1", + "sommelier-3", + "stafihub-1", + "stride-1", + "teritori-1", + "phoenix-1", + "tgrade-mainnet-1", + "umee-1", + "vidulum-1", + ].join(","); diff --git a/pages/verification/index.tsx b/pages/verification/index.tsx index 664fa57..a7cfde5 100644 --- a/pages/verification/index.tsx +++ b/pages/verification/index.tsx @@ -37,6 +37,7 @@ import { Bech32Address, ChainIdHelper } from "@keplr-wallet/cosmos"; import { AllChainsItem } from "../../components/chain-list/all-chains-item"; import { SearchInput } from "../../components/search-input"; import { + CHAIN_ALLOWLIST, MAIN_CHAIN_ID, REFERRAL_KEY, RESOLVER_ADDRESS, @@ -240,9 +241,8 @@ export default function VerificationPage() { const fetchChainList = async (wallet: KeplrWallet) => { const needAllowList = - process.env.NEXT_PUBLIC_CHAIN_ALLOWLIST != null && - process.env.NEXT_PUBLIC_CHAIN_ALLOWLIST.trim().length !== 0; - const chainAllowList = (process.env.NEXT_PUBLIC_CHAIN_ALLOWLIST || "") + CHAIN_ALLOWLIST != null && CHAIN_ALLOWLIST.trim().length !== 0; + const chainAllowList = (CHAIN_ALLOWLIST || "") .split(",") .map((str) => str.trim()) .filter((str) => str.length > 0)