Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove fcd & temp fee #115

Merged
merged 2 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ interface TerraswapNetwork {
amount: string
gas: string
}
stats: string
}

export const AVAILABLE_CHAIN_ID_LIST = ["phoenix-1", "pisco-1"]
Expand All @@ -25,8 +24,7 @@ const terraswapNetworks: Record<string, TerraswapNetwork> = {
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",
Expand All @@ -35,8 +33,7 @@ const terraswapNetworks: Record<string, TerraswapNetwork> = {
"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" },
},
}

Expand Down
4 changes: 2 additions & 2 deletions src/forms/Result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const Result = ({ response, error, onFailure, parserKey }: ResultProps) => {
}, [network, txInfo])

const [status, setStatus] = useState<STATUS>(STATUS.LOADING)
const { fcd } = useNetwork()
const { lcd } = useNetwork()

const retryCount = useRef(0)

Expand All @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/forms/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 0 additions & 1 deletion src/hooks/useNetwork.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const useNetwork = () => {
...network,
...terraswapNetworks[network.name],
getFinderUrl,
fcd: network.lcd?.replace("lcd", "fcd"),
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/types/network.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ interface NetworkConfig {
swap: string
/** Graphql server URL */
mantle: string
stats: string
/** LCDClientConfig */
lcd: LCDClientConfig
/** Fixed fee */
Expand All @@ -31,5 +30,4 @@ interface ExtNetworkConfig {
name: string
chainID: string
lcd: string
fcd: string
}