From 624d3e742ccf7e676d163fb149be99d636c21a94 Mon Sep 17 00:00:00 2001 From: JoowonYun Date: Fri, 3 Jun 2022 14:57:55 +0900 Subject: [PATCH 1/2] refactor: remove fcd --- src/forms/Result.tsx | 4 ++-- src/hooks/useNetwork.ts | 1 - src/types/network.d.ts | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/forms/Result.tsx b/src/forms/Result.tsx index 950417de..6252fefd 100644 --- a/src/forms/Result.tsx +++ b/src/forms/Result.tsx @@ -73,7 +73,7 @@ const Result = ({ response, error, onFailure, parserKey }: ResultProps) => { }, [network, txInfo]) const [status, setStatus] = useState(STATUS.LOADING) - const { fcd } = useNetwork() + const { lcd } = useNetwork() const retryCount = useRef(0) @@ -92,7 +92,7 @@ const Result = ({ response, error, onFailure, parserKey }: ResultProps) => { return } try { - const { data: res } = await axios.get(`${fcd}/v1/tx/${txHash}`, { + const { data: res } = await axios.get(`${lcd}/v1/tx/${txHash}`, { cache: { ignoreCache: true }, }) if (isDestroyed) { diff --git a/src/hooks/useNetwork.ts b/src/hooks/useNetwork.ts index 3319975e..12dd4821 100644 --- a/src/hooks/useNetwork.ts +++ b/src/hooks/useNetwork.ts @@ -11,7 +11,6 @@ const useNetwork = () => { ...network, ...terraswapNetworks[network.name], getFinderUrl, - fcd: network.lcd?.replace("lcd", "fcd"), } } diff --git a/src/types/network.d.ts b/src/types/network.d.ts index 6c1e1ac0..ebb319c4 100644 --- a/src/types/network.d.ts +++ b/src/types/network.d.ts @@ -17,7 +17,6 @@ interface NetworkConfig { swap: string /** Graphql server URL */ mantle: string - stats: string /** LCDClientConfig */ lcd: LCDClientConfig /** Fixed fee */ @@ -31,5 +30,4 @@ interface ExtNetworkConfig { name: string chainID: string lcd: string - fcd: string } From de71bc6707d3bd86848f1c6bf7d586675c820058 Mon Sep 17 00:00:00 2001 From: JoowonYun Date: Fri, 3 Jun 2022 14:58:06 +0900 Subject: [PATCH 2/2] fix: temp fee --- src/constants/networks.ts | 7 ++----- src/forms/SwapForm.tsx | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/constants/networks.ts b/src/constants/networks.ts index f744b206..9dbec945 100644 --- a/src/constants/networks.ts +++ b/src/constants/networks.ts @@ -13,7 +13,6 @@ interface TerraswapNetwork { amount: string gas: string } - stats: string } export const AVAILABLE_CHAIN_ID_LIST = ["phoenix-1", "pisco-1"] @@ -25,8 +24,7 @@ const terraswapNetworks: Record = { process.env.REACT_APP_MAINNET_SERVICE_URL || "https://api.terraswap.io/", dashboard: process.env.REACT_APP_MAINNET_DASHBOARD_URL, router: "terra13ehuhysn5mqjeaheeuew2gjs785f6k7jm8vfsqg3jhtpkwppcmzqcu7chk", - fee: { gasPrice: "0.15", amount: "1518", gas: "2000000" }, - stats: "https://phoenix-fcd.terra.dev/", + fee: { gasPrice: "0.15", amount: "1518", gas: "500000" }, }, testnet: { factory: "terra1jha5avc92uerwp9qzx3flvwnyxs3zax2rrm6jkcedy2qvzwd2k7qk7yxcl", @@ -35,8 +33,7 @@ const terraswapNetworks: Record = { "https://api-pisco.terraswap.io/", dashboard: process.env.REACT_APP_TESTNET_DASHBOARD_URL, router: "terra1xp6xe6uwqrspumrkazdg90876ns4h78yw03vfxghhcy03yexcrcsdaqvc8", - fee: { gasPrice: "0.15", amount: "1518", gas: "2000000" }, - stats: "https://pisco-fcd.terra.dev/", + fee: { gasPrice: "0.15", amount: "1518", gas: "500000" }, }, } diff --git a/src/forms/SwapForm.tsx b/src/forms/SwapForm.tsx index 0d8aed0c..7da14b0d 100644 --- a/src/forms/SwapForm.tsx +++ b/src/forms/SwapForm.tsx @@ -801,6 +801,7 @@ const SwapForm = ({ type, tabs }: { type: Type; tabs: TabViewProps }) => { ) txOptions.fee = signMsg.auth_info.fee + setValue(Key.feeValue, txOptions.fee.amount.get(feeAddress)?.amount.toString() || "") const extensionResult = await terraExtensionPost(txOptions)