From 3fc3b040a4190ced45679539921334dd8cc8acfb Mon Sep 17 00:00:00 2001 From: delivan Date: Mon, 19 Dec 2022 22:15:49 +0900 Subject: [PATCH] Update env variables --- constants/icns.ts | 6 ++++-- pages/verification/index.tsx | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/constants/icns.ts b/constants/icns.ts index ce08472..618aa9b 100644 --- a/constants/icns.ts +++ b/constants/icns.ts @@ -1,6 +1,8 @@ -export const MainChainId = "osmo-test-4"; +export const OSMOSIS_CHAIN_ID = + process.env.NEXT_PUBLIC_OSMOSIS_CHAIND_ID ?? "osmosis-test-4"; -export const REFERRAL_KEY = "icns-referral"; +export const REFERRAL_KEY = + process.env.NEXT_PUBLIC_REFERRAL_KEY ?? "icns-referral"; export const RPC_URL = process.env.NEXT_PUBLIC_OSMOSIS_RPC_URL ?? "https://rpc.testnet.osmosis.zone"; diff --git a/pages/verification/index.tsx b/pages/verification/index.tsx index d4049c0..09a529c 100644 --- a/pages/verification/index.tsx +++ b/pages/verification/index.tsx @@ -37,7 +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 { - MainChainId, + OSMOSIS_CHAIN_ID, REFERRAL_KEY, RESOLVER_ADDRESS, REST_URL, @@ -195,7 +195,7 @@ export default function VerificationPage(props: { blockList: string[] }) { ); if (keplrWallet) { - const key = await keplrWallet.getKey(MainChainId); + const key = await keplrWallet.getKey(OSMOSIS_CHAIN_ID); setIsOwner(ownerOfQueryResponse.data.owner === key.bech32Address); setNFTOwnerAddress(ownerOfQueryResponse.data.owner); } @@ -226,7 +226,7 @@ export default function VerificationPage(props: { blockList: string[] }) { if (keplr) { const keplrWallet = new KeplrWallet(keplr); - const key = await keplrWallet.getKey(MainChainId); + const key = await keplrWallet.getKey(OSMOSIS_CHAIN_ID); await fetchChainList(keplrWallet); setWallet(keplrWallet); @@ -301,14 +301,14 @@ export default function VerificationPage(props: { blockList: string[] }) { const checkAdr36 = async () => { if (twitterAuthInfo && wallet) { - const key = await wallet.getKey(MainChainId); + const key = await wallet.getKey(OSMOSIS_CHAIN_ID); const chainIds = Array.from(checkedItems).map((chain) => { return (chain as ChainItemType).chainId; }); return wallet.signICNSAdr36( - MainChainId, + OSMOSIS_CHAIN_ID, RESOLVER_ADDRESS, key.bech32Address, twitterAuthInfo.username, @@ -372,7 +372,7 @@ export default function VerificationPage(props: { blockList: string[] }) { } const chainInfo = { - chainId: MainChainId, + chainId: OSMOSIS_CHAIN_ID, rest: REST_URL, };