diff --git a/CHANGELOG.md b/CHANGELOG.md index f811b2c65..936f404a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Features -- [#116](https://github.com/alleslabs/celatone-frontend/pull/116) Supported Terra2.0 mainnet and testnet +- [#116](https://github.com/alleslabs/celatone-frontend/pull/116) Support Terra2.0 mainnet and testnet - [#94](https://github.com/alleslabs/celatone-frontend/pull/94) Add unsupported assets in contract details page - [#72](https://github.com/alleslabs/celatone-frontend/pull/72) Fix general wording and grammar - [#110](https://github.com/alleslabs/celatone-frontend/pull/110) Fix proposal detail rendering diff --git a/src/env.ts b/src/env.ts index 72b91df66..1e3ff1966 100644 --- a/src/env.ts +++ b/src/env.ts @@ -63,7 +63,7 @@ export const CELATONE_CONSTANTS: CelatoneConstants = { export const DUMMY_MNEMONIC = process.env.NEXT_PUBLIC_DUMMY_MNEMONIC; -export const SUPPORTED_CHAIN = process.env.NEXT_PUBLIC_SUPPORTED_CHAIN; +export const SELECTED_CHAIN = process.env.NEXT_PUBLIC_SELECTED_CHAIN; export const CELATONE_API_ENDPOINT = "https://celatone-api.alleslabs.dev"; diff --git a/src/lib/data/chain.ts b/src/lib/data/chain.ts index a26ea4fb4..3d847f214 100644 --- a/src/lib/data/chain.ts +++ b/src/lib/data/chain.ts @@ -1,4 +1,4 @@ -import { SUPPORTED_CHAIN } from "env"; +import { SELECTED_CHAIN } from "env"; import type { Option } from "lib/types"; interface Chain { @@ -18,13 +18,13 @@ export const OSMOSIS_CHAINS: Chain = { }; export const getSupportedChainNames = (): string[] => { - switch (SUPPORTED_CHAIN) { + switch (SELECTED_CHAIN) { case "terra": return Object.values(TERRA_CHAINS); case "osmosis": return Object.values(OSMOSIS_CHAINS); default: - throw new Error(`Unsupported chain: ${SUPPORTED_CHAIN}`); + throw new Error(`Unsupported chain: ${SELECTED_CHAIN}`); } }; @@ -42,7 +42,7 @@ export const getChainNameByNetwork = (network: string): string => { let chainName: Option; - switch (SUPPORTED_CHAIN) { + switch (SELECTED_CHAIN) { case "terra": chainName = TERRA_CHAINS[network]; break; @@ -50,12 +50,12 @@ export const getChainNameByNetwork = (network: string): string => { chainName = OSMOSIS_CHAINS[network]; break; default: - throw new Error(`Unsupported chain: ${SUPPORTED_CHAIN}`); + throw new Error(`Unsupported chain: ${SELECTED_CHAIN}`); } if (!chainName) throw new Error( - `Can't find chain name for network: ${network} and chain: ${SUPPORTED_CHAIN}` + `Can't find chain name for network: ${network} and chain: ${SELECTED_CHAIN}` ); return chainName; @@ -64,7 +64,7 @@ export const getChainNameByNetwork = (network: string): string => { export const getNetworkByChainName = (chainName: string): string => { let network: Option; - switch (SUPPORTED_CHAIN) { + switch (SELECTED_CHAIN) { case "terra": network = Object.keys(TERRA_CHAINS).find( (each) => TERRA_CHAINS[each as keyof Chain] === chainName @@ -76,12 +76,12 @@ export const getNetworkByChainName = (chainName: string): string => { ); break; default: - throw new Error(`Unsupported chain: ${SUPPORTED_CHAIN}`); + throw new Error(`Unsupported chain: ${SELECTED_CHAIN}`); } if (!network) throw new Error( - `Can't find network for chain name: ${chainName} and chain: ${SUPPORTED_CHAIN}` + `Can't find network for chain name: ${chainName} and chain: ${SELECTED_CHAIN}` ); return network; diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 20a11c51a..a8cdf3a2a 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -58,8 +58,17 @@ const MyApp = ({ Component, pageProps }: AppProps) => { assetLists={[...assets, terra2testnetAssets]} wallets={wallets} endpointOptions={{ + osmosis: { + rpc: ["https://rpc-osmosis.keplr.app/"], + rest: ["https://lcd-osmosis.keplr.app/"], + }, + osmosistestnet: { + rpc: ["https://rpc-test.osmosis.zone/"], + rest: ["https://lcd-test.osmosis.zone/"], + }, terra2: { rpc: ["https://terra-rpc.lavenderfive.com/"], + rest: ["https://phoenix-lcd.terra.dev/"], }, terra2testnet: { rpc: ["https://terra-testnet-rpc.polkachu.com/"],