From d23e9c8b199645193b323def6f010a5c5fbf6ff2 Mon Sep 17 00:00:00 2001 From: plubber Date: Tue, 5 Sep 2023 14:59:47 -0400 Subject: [PATCH 01/14] feat: disable gov on certain chains --- src/data/queries/gov.ts | 11 ++++++----- src/types/chains.ts | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/data/queries/gov.ts b/src/data/queries/gov.ts index ad6c8670d..b5e301127 100644 --- a/src/data/queries/gov.ts +++ b/src/data/queries/gov.ts @@ -6,8 +6,9 @@ import { AccAddress, Proposal, Vote } from "@terra-money/feather.js" import { Color } from "types/components" import { queryKey, RefetchOptions } from "../query" import { useInterchainLCDClientGovOverride } from "./lcdClient" -import { useNetwork } from "data/wallet" +import { useNetworkWithFeature } from "data/wallet" import axios from "axios" +import { ChainFeature } from "types/chains" export const useVotingParams = (chain: string) => { const lcd = useInterchainLCDClientGovOverride() @@ -116,7 +117,7 @@ export interface ProposalResult46 { /* proposals */ export const useProposals = (status: ProposalStatus) => { - const networks = useNetwork() + const networks = useNetworkWithFeature(ChainFeature.GOVERNANCE) return useQueries( Object.values(networks ?? {}).map(({ lcd, version, chainID }) => { @@ -231,7 +232,7 @@ export const useProposalStatusItem = (status: ProposalStatus) => { /* proposal */ export const useProposal = (id: string, chain: string) => { - const networks = useNetwork() + const networks = useNetworkWithFeature(ChainFeature.GOVERNANCE) return useQuery( [queryKey.gov.proposal, id, networks[chain]], async () => { @@ -305,7 +306,7 @@ export interface ProposalDeposit { /* proposal: deposits */ export const useDeposits = (id: string, chain: string) => { - const networks = useNetwork() + const networks = useNetworkWithFeature(ChainFeature.GOVERNANCE) return useQuery( [queryKey.gov.deposits, id, chain], async () => { @@ -376,5 +377,5 @@ export const useGetVoteOptionItem = () => { /* helpers */ export const useParseProposalType = (content?: ProposalResult["content"]) => { const type = content?.["@type"] - return type ? sentenceCase(last(type.split(".")) ?? "") : "Unknowm proposal" + return type ? sentenceCase(last(type.split(".")) ?? "") : "Unknown proposal" } diff --git a/src/types/chains.ts b/src/types/chains.ts index 55f2fe7cf..c6ab90830 100644 --- a/src/types/chains.ts +++ b/src/types/chains.ts @@ -1,3 +1,4 @@ export enum ChainFeature { STAKING = "staking", + GOVERNANCE = "governance", } From b6cb58be99cf9c6c72cee0ebad2b9508e2871ca8 Mon Sep 17 00:00:00 2001 From: Alessandro Candeago <54709706+alecande11@users.noreply.github.com> Date: Thu, 7 Sep 2023 12:12:15 +0200 Subject: [PATCH 02/14] Check for updates --- .gitignore | 5 ++- package.json | 4 +- src/app/App.tsx | 2 + src/app/update/UpdateNotification.module.scss | 26 +++++++++++++ src/app/update/UpdateNotification.tsx | 38 +++++++++++++++++++ 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 src/app/update/UpdateNotification.module.scss create mode 100644 src/app/update/UpdateNotification.tsx diff --git a/.gitignore b/.gitignore index 36e0c100e..5e91e7087 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,7 @@ yarn-error.log* .prettierrc -.vscode \ No newline at end of file +.vscode + +# commit hash used for update detection +public/commit_hash \ No newline at end of file diff --git a/package.json b/package.json index ecfaed7ae..9c6820b2d 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "version": "7.3.2", "license": "MIT", "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", + "start": "echo \"$CF_PAGES_COMMIT_SHA\" > public/commit_hash && react-scripts start", + "build": "echo \"$CF_PAGES_COMMIT_SHA\" > public/commit_hash && react-scripts build", "test": "react-scripts test", "prepare": "husky install", "pre-commit": "lint-staged", diff --git a/src/app/App.tsx b/src/app/App.tsx index 9b2d589d2..1c9c27668 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -34,6 +34,7 @@ import Wallet from "pages/wallet/Wallet" import NavButton from "./sections/NavButton" import NetworkStatus from "components/display/NetworkStatus" import EnableCoinType from "./sections/EnableCoinType" +import UpdateNotification from "./update/UpdateNotification" const App = () => { const { element: routes } = useNav() @@ -81,6 +82,7 @@ const App = () => { + ) } diff --git a/src/app/update/UpdateNotification.module.scss b/src/app/update/UpdateNotification.module.scss new file mode 100644 index 000000000..1c549e132 --- /dev/null +++ b/src/app/update/UpdateNotification.module.scss @@ -0,0 +1,26 @@ +@import "mixins"; + +.notification { + z-index: 1000; + position: absolute; + bottom: 1.2rem; + left: 50%; + transform: translate(-50%, 0); + background-color: var(--bg); + padding: 0.5rem 1.4rem; + border-radius: 1rem; + //font-size: var(--font-size-small); + white-space: nowrap; + // same shadow as send/receive/buy buttons + box-shadow: inset 0px 1.5px 0px 0px rgb(255 255 255 / 8%), + 0px 4px 24px 0px rgb(36 36 40 / 30%); + + button { + color: var(--button-primary-bg); + margin-left: 1rem; + + &:hover { + text-decoration: underline; + } + } +} diff --git a/src/app/update/UpdateNotification.tsx b/src/app/update/UpdateNotification.tsx new file mode 100644 index 000000000..44a124b84 --- /dev/null +++ b/src/app/update/UpdateNotification.tsx @@ -0,0 +1,38 @@ +import { RefetchOptions } from "data/query" +import { useQuery } from "react-query" +import styles from "./UpdateNotification.module.scss" +import { useTranslation } from "react-i18next" +import axios from "axios" + +const useIsUpdateAvailable = () => { + return useQuery( + [], + async () => { + // fetch commit_hash file created at build time + const { data: commit_hash } = await axios.get("/commit_hash") + // compare the latest commit_hash (just fetched) with the current commit_hash + // if they are different there is an update available + console.log("fetched:" + commit_hash) + console.log("current:" + process.env.CF_PAGES_COMMIT_SHA) + return commit_hash !== process.env.CF_PAGES_COMMIT_SHA + }, + { ...RefetchOptions.DEFAULT } + ) +} + +export default function UpdateNotification() { + const { t } = useTranslation() + const { data } = useIsUpdateAvailable() + + // no update available or request still in progress + // (comment out next line to test) + if (!data) return null + + // update available + return ( +
+ {t("There is a new version available")} + +
+ ) +} From f7ee6709898cba0cfeaac5ec1b6a7df6e22142be Mon Sep 17 00:00:00 2001 From: Alessandro Candeago <54709706+alecande11@users.noreply.github.com> Date: Thu, 7 Sep 2023 13:53:58 +0200 Subject: [PATCH 03/14] Use only fetchaed value --- src/app/update/UpdateNotification.tsx | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/app/update/UpdateNotification.tsx b/src/app/update/UpdateNotification.tsx index 44a124b84..60fab1927 100644 --- a/src/app/update/UpdateNotification.tsx +++ b/src/app/update/UpdateNotification.tsx @@ -3,30 +3,36 @@ import { useQuery } from "react-query" import styles from "./UpdateNotification.module.scss" import { useTranslation } from "react-i18next" import axios from "axios" +import { useEffect, useRef, useState } from "react" -const useIsUpdateAvailable = () => { +const useCommithash = (disabled: boolean) => { return useQuery( [], async () => { // fetch commit_hash file created at build time const { data: commit_hash } = await axios.get("/commit_hash") - // compare the latest commit_hash (just fetched) with the current commit_hash - // if they are different there is an update available - console.log("fetched:" + commit_hash) - console.log("current:" + process.env.CF_PAGES_COMMIT_SHA) - return commit_hash !== process.env.CF_PAGES_COMMIT_SHA + return commit_hash }, - { ...RefetchOptions.DEFAULT } + { ...RefetchOptions.DEFAULT, enabled: !disabled } ) } export default function UpdateNotification() { + const old_commit_hash = useRef() const { t } = useTranslation() - const { data } = useIsUpdateAvailable() + const [showNotification, setShownotification] = useState(false) + const { data: commit_hash } = useCommithash(showNotification) + + useEffect(() => { + if (showNotification) return + if (!old_commit_hash.current) old_commit_hash.current = commit_hash + + setShownotification(old_commit_hash.current !== commit_hash) + }, [commit_hash, showNotification]) // no update available or request still in progress // (comment out next line to test) - if (!data) return null + if (!showNotification) return null // update available return ( From 9a56bec9da86310b01185e9e68e95acccec81e7f Mon Sep 17 00:00:00 2001 From: plubber Date: Thu, 7 Sep 2023 11:17:24 -0400 Subject: [PATCH 04/14] fix: rename gov chain feature --- src/data/queries/gov.ts | 6 +++--- src/types/chains.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data/queries/gov.ts b/src/data/queries/gov.ts index b5e301127..15f96c12a 100644 --- a/src/data/queries/gov.ts +++ b/src/data/queries/gov.ts @@ -117,7 +117,7 @@ export interface ProposalResult46 { /* proposals */ export const useProposals = (status: ProposalStatus) => { - const networks = useNetworkWithFeature(ChainFeature.GOVERNANCE) + const networks = useNetworkWithFeature(ChainFeature.GOV) return useQueries( Object.values(networks ?? {}).map(({ lcd, version, chainID }) => { @@ -232,7 +232,7 @@ export const useProposalStatusItem = (status: ProposalStatus) => { /* proposal */ export const useProposal = (id: string, chain: string) => { - const networks = useNetworkWithFeature(ChainFeature.GOVERNANCE) + const networks = useNetworkWithFeature(ChainFeature.GOV) return useQuery( [queryKey.gov.proposal, id, networks[chain]], async () => { @@ -306,7 +306,7 @@ export interface ProposalDeposit { /* proposal: deposits */ export const useDeposits = (id: string, chain: string) => { - const networks = useNetworkWithFeature(ChainFeature.GOVERNANCE) + const networks = useNetworkWithFeature(ChainFeature.GOV) return useQuery( [queryKey.gov.deposits, id, chain], async () => { diff --git a/src/types/chains.ts b/src/types/chains.ts index c6ab90830..09f95d86c 100644 --- a/src/types/chains.ts +++ b/src/types/chains.ts @@ -1,4 +1,4 @@ export enum ChainFeature { STAKING = "staking", - GOVERNANCE = "governance", + GOV = "gov", } From c4fbb3e099efb2d53aad090830205dc3eb25e27e Mon Sep 17 00:00:00 2001 From: plubber <51789398+ericHgorski@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:14:09 -0400 Subject: [PATCH 05/14] fix: chain menu dupes (#519) --- src/pages/wallet/SendPage.tsx | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/pages/wallet/SendPage.tsx b/src/pages/wallet/SendPage.tsx index ee9eb34ad..6487ea7ad 100644 --- a/src/pages/wallet/SendPage.tsx +++ b/src/pages/wallet/SendPage.tsx @@ -128,17 +128,19 @@ const SendPage = () => { const defaultAsset = route?.denom || filteredAssets[0].denom - const availableChains = useMemo( - () => - availableAssets - .find(({ denom }) => denom === (asset ?? defaultAsset)) - ?.chains.sort((a, b) => { - if (networks[a]?.prefix === "terra") return -1 - if (networks[b]?.prefix === "terra") return 1 - return 0 - }), - [asset, availableAssets, defaultAsset, networks] - ) + const availableChains = useMemo(() => { + const chainsFromAsset = availableAssets.find( + ({ denom }) => denom === (asset ?? defaultAsset) + )?.chains + + const uniqueChains = Array.from(new Set(chainsFromAsset)) + + return uniqueChains.sort((a, b) => { + if (networks[a]?.prefix === "terra") return -1 + if (networks[b]?.prefix === "terra") return 1 + return 0 + }) + }, [asset, availableAssets, defaultAsset, networks]) const token = balances.find( ({ denom, chain }) => From 5530fcf9b285f6ed072eaf0fb17b96e525bdf4b3 Mon Sep 17 00:00:00 2001 From: plubber <51789398+ericHgorski@users.noreply.github.com> Date: Wed, 13 Sep 2023 10:14:37 -0400 Subject: [PATCH 06/14] fix: carbon gas fee estimation (#513) * feat: carbon gas fee estimation --- src/app/sections/LatestTx.tsx | 1 + src/config/constants.ts | 1 + src/data/queries/tx.ts | 27 +++++++++++++++++++++++++++ src/data/query.ts | 2 +- src/pages/history/HistoryItem.tsx | 1 + src/txs/Tx.tsx | 15 +++++++++++++-- 6 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/app/sections/LatestTx.tsx b/src/app/sections/LatestTx.tsx index 8e0dc6c1b..61084e2cc 100644 --- a/src/app/sections/LatestTx.tsx +++ b/src/app/sections/LatestTx.tsx @@ -113,6 +113,7 @@ const TxIndicator = ({ txhash }: { txhash: string }) => { const ruleset = createActionRuleSet(networkName) const logMatcher = createLogMatcherForActions(ruleset) const getCanonicalMsgs = (txInfo: TxInfo) => { + // @ts-ignore const matchedMsg = getTxCanonicalMsgs(txInfo, logMatcher) return matchedMsg ? matchedMsg diff --git a/src/config/constants.ts b/src/config/constants.ts index 0415fdefb..fb0ee2bda 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -22,6 +22,7 @@ export const DOCUMENTATION = export const SETUP = "https://setup.station.money/" export const MARS_TEST_EXPLORER = "https://testnet-explorer.marsprotocol.io" export const MARS_EXPLORER = "https://explorer.marsprotocol.io" +export const CARBON_API = "https://api.carbon.network/" /* website: stake */ export const TERRA_VALIDATORS = diff --git a/src/data/queries/tx.ts b/src/data/queries/tx.ts index d40b7f273..f6986f354 100644 --- a/src/data/queries/tx.ts +++ b/src/data/queries/tx.ts @@ -2,6 +2,9 @@ import { QueryKey, useQuery, useQueryClient } from "react-query" import { atom, useSetRecoilState } from "recoil" import { queryKey } from "../query" import { useInterchainLCDClient } from "./lcdClient" +import axios from "axios" +import { RefetchOptions } from "../query" +import { CARBON_API } from "config/constants" interface LatestTx { txhash: string @@ -45,3 +48,27 @@ export const useTxInfo = ({ txhash, queryKeys, chainID }: LatestTx) => { } ) } + +export const useCarbonFees = () => { + return useQuery( + [queryKey.tx.fees], + async () => { + const [{ data: gasPrices }, { data: gasCosts }] = await Promise.all([ + axios.get("carbon/fee/v1/gas_prices", { baseURL: CARBON_API }), + axios.get("carbon/fee/v1/gas_costs", { baseURL: CARBON_API }), + ]) + const prices = gasPrices.min_gas_prices.reduce((acc: any, p: any) => { + acc[p.denom] = p.gas_price + return acc + }, {}) + + const costs = gasCosts.msg_gas_costs.reduce((acc: any, p: any) => { + acc[p.msg_type] = p.gas_cost + return acc + }, {}) + + return { prices, costs } + }, + { ...RefetchOptions.INFINITY } + ) +} diff --git a/src/data/query.ts b/src/data/query.ts index 2fe66a149..375958989 100644 --- a/src/data/query.ts +++ b/src/data/query.ts @@ -81,7 +81,7 @@ export const queryKey = mirror({ unbondings: "", pool: "", }, - tx: { txInfo: "", create: "" }, + tx: { txInfo: "", create: "", fees: "" }, wasm: { contractInfo: "", contractQuery: "" }, interchain: { staking: { diff --git a/src/pages/history/HistoryItem.tsx b/src/pages/history/HistoryItem.tsx index db5c32fbb..123bbf663 100644 --- a/src/pages/history/HistoryItem.tsx +++ b/src/pages/history/HistoryItem.tsx @@ -48,6 +48,7 @@ const HistoryItem = ({ const ruleset = createActionRuleSet(networkName) const logMatcher = createLogMatcherForActions(ruleset) const getCanonicalMsgs = (txInfo: TxInfo) => { + // @ts-ignore const matchedMsg = getTxCanonicalMsgs(txInfo, logMatcher) return matchedMsg ? matchedMsg diff --git a/src/txs/Tx.tsx b/src/txs/Tx.tsx index 82859ec71..b061709d0 100644 --- a/src/txs/Tx.tsx +++ b/src/txs/Tx.tsx @@ -35,6 +35,7 @@ import ConnectWallet from "app/sections/ConnectWallet" import useToPostMultisigTx from "pages/multisig/utils/useToPostMultisigTx" import { isWallet, useAuth } from "auth" import { PasswordError } from "auth/scripts/keystore" +import { useCarbonFees } from "data/queries/tx" import { toInput, CoinInput, calcTaxes, parseError } from "./utils" import styles from "./Tx.module.scss" @@ -108,6 +109,8 @@ function Tx(props: Props) { const shouldTax = isClassic && getShouldTax(token, isClassic) const { data: taxRate = "0", ...taxRateState } = useTaxRate(!shouldTax) const { data: taxCap = "0", ...taxCapState } = useTaxCap(token) + const { data: carbonFees } = useCarbonFees() + const taxState = combineState(taxRateState, taxCapState) const taxes = isClassic ? calcTaxes( @@ -138,6 +141,12 @@ function Tx(props: Props) { if (!(wallet || connectedWallet)) return 0 if (!simulationTx || !simulationTx.msgs.length) return 0 try { + if (chain.startsWith("carbon-")) { + return Number( + carbonFees?.costs[key.msgs?.[0] ?? ""] ?? + carbonFees?.costs["default_fee"] + ) + } const unsignedTx = await lcd.tx.create([{ address: key.address }], { ...simulationTx, gasAdjustment: key.gasAdjustment, @@ -163,14 +172,16 @@ function Tx(props: Props) { const getGasAmount = useCallback( (denom: CoinDenom) => { - const gasPrice = networks[chain]?.gasPrices[denom] + const gasPrice = chain?.startsWith("carbon-") + ? carbonFees?.prices[denom] + : networks[chain]?.gasPrices[denom] if (isNil(estimatedGas) || !gasPrice) return "0" return new BigNumber(estimatedGas) .times(gasPrice) .integerValue(BigNumber.ROUND_CEIL) .toString() }, - [estimatedGas, chain, networks] + [estimatedGas, chain, networks, carbonFees] ) const gasAmount = getGasAmount(gasDenom) From e8530f27e7d952d2b75a86898359e66b4108ab24 Mon Sep 17 00:00:00 2001 From: plubber <51789398+ericHgorski@users.noreply.github.com> Date: Thu, 14 Sep 2023 10:33:13 -0400 Subject: [PATCH 07/14] hook form refactor and v3 prep (St 778) (#522) * feat: react version upgrade --------- Co-authored-by: Michael Merz --- package-lock.json | 355 ++++++++++-------- package.json | 22 +- src/app/components/Overlay.tsx | 4 +- .../create/CreateMultisigWalletForm.tsx | 4 +- src/auth/scripts/validate.ts | 6 +- src/components/display/Tag.tsx | 2 +- src/components/form/FormHelp.tsx | 4 +- src/components/form/Input.tsx | 13 +- src/components/form/Select.tsx | 2 +- src/components/form/Submit.tsx | 4 +- src/components/general/Button.tsx | 2 +- src/components/general/LinkButton.tsx | 4 +- src/components/general/Pre.tsx | 2 +- src/components/layout/Card.tsx | 4 +- src/components/layout/Grid.tsx | 2 +- src/components/layout/Page.tsx | 2 +- src/components/layout/PaginationButtons.tsx | 4 +- src/components/layout/Table.tsx | 4 +- src/components/layout/Tabs.tsx | 2 +- src/components/token/TokenCard.tsx | 2 +- src/index.tsx | 1 + .../charts/components/ChartContainer.tsx | 6 +- src/pages/gov/ProposalVotes.tsx | 4 +- src/pages/multisig/PostMultisigTxForm.tsx | 3 +- src/pages/multisig/SignMultisigTxForm.tsx | 3 +- src/pages/wallet/IbcSendBackTx.tsx | 2 +- src/txs/gov/DepositForm.tsx | 2 +- src/txs/gov/SubmitProposalForm.tsx | 8 +- src/txs/stake/QuickStakeForm.tsx | 2 +- src/txs/stake/StakeForm.tsx | 5 +- src/txs/swap/SingleSwapContext.tsx | 2 +- src/txs/swap/TFMSwapForm.tsx | 11 +- src/txs/swap/components/ExpectedPrice.tsx | 2 +- src/txs/swap/useSwapUtils.ts | 2 +- 34 files changed, 273 insertions(+), 224 deletions(-) diff --git a/package-lock.json b/package-lock.json index df2cbf495..043ddc9f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -24,13 +24,13 @@ "@terra-money/terra-utils": "^1.0.9", "@terra-money/terra.js": "^3.1.9", "@terra-money/terra.proto": "^2.0.0", - "@terra-money/wallet-kit": "^1.0.12", + "@terra-money/wallet-kit": "^1.0.15", "@tippyjs/react": "^4.2.6", "axios": "^0.27.2", "bech32": "^2.0.0", "bignumber.js": "^9.0.2", "buffer": "^6.0.3", - "classnames": "^2.3.1", + "classnames": "^2.3.2", "crypto-js": "^4.1.1", "date-fns": "^2.28.0", "i18next": "^21.8.14", @@ -41,17 +41,17 @@ "lottie-react": "^2.3.1", "numeral": "^2.0.6", "prettier": "^2.6.2", - "qrcode.react": "^3.0.2", + "qrcode.react": "^3.1.0", "qs": "^6.11.0", "ramda": "^0.28.0", - "react": "^17.0.2", + "react": "^18.2.0", "react-copy-to-clipboard": "^5.1.0", - "react-dom": "^17.0.2", - "react-hook-form": "7.22.5", + "react-dom": "^18.2.0", + "react-hook-form": "^7.29.0", "react-i18next": "^11.18.1", "react-modal": "^3.15.1", - "react-query": "^3.39.0", - "react-router-dom": "^6.3.0", + "react-query": "^3.39.3", + "react-router-dom": "^6.15.0", "recharts": "^2.1.16", "recoil": "^0.7.2", "sass": "^1.52.1", @@ -61,8 +61,6 @@ "xss": "1.0.11" }, "devDependencies": { - "@emotion/react": "^11.9.0", - "@emotion/styled": "^11.8.1", "@types/crypto-js": "^4.1.1", "@types/jest": "^27.5.1", "@types/node": "^17.0.35", @@ -70,9 +68,9 @@ "@types/qrcode.react": "^1.0.2", "@types/qs": "^6.9.7", "@types/ramda": "^0.28.13", - "@types/react": "^18.0.9", + "@types/react": "^18.2.21", "@types/react-copy-to-clipboard": "^5.0.2", - "@types/react-dom": "^18.0.5", + "@types/react-dom": "^18.2.7", "@types/react-modal": "^3.13.1", "@types/react-router-dom": "^5.3.3", "@types/secp256k1": "^4.0.3", @@ -2001,11 +1999,11 @@ } }, "node_modules/@babel/runtime": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.18.3.tgz", - "integrity": "sha512-38Y8f7YUhce/K7RMwTp7m0uCumpv9hZkitCbBClqQIow1qSbCvGkcegKOXpEWCQLfWmevgRiWokZ1GkpfhbZug==", + "version": "7.22.11", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.11.tgz", + "integrity": "sha512-ee7jVNlWN09+KftVOu9n7S8gQzD/Z6hN/I8VBRXW4P1+Xe7kJGXMwu8vds4aGIMHZnNbdpSWCfZZtinytpcAvA==", "dependencies": { - "regenerator-runtime": "^0.13.4" + "regenerator-runtime": "^0.14.0" }, "engines": { "node": ">=6.9.0" @@ -2024,6 +2022,11 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/runtime/node_modules/regenerator-runtime": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + }, "node_modules/@babel/template": { "version": "7.16.7", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", @@ -2195,7 +2198,8 @@ "version": "11.9.2", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.9.2.tgz", "integrity": "sha512-Pr/7HGH6H6yKgnVFNEj2MVlreu3ADqftqjqwUvDy/OJzKFgxKeTQ+eeUf20FOTuHVkDON2iNa25rAXVYtWJCjw==", - "devOptional": true, + "optional": true, + "peer": true, "dependencies": { "@babel/helper-module-imports": "^7.12.13", "@babel/plugin-syntax-jsx": "^7.12.13", @@ -2240,7 +2244,8 @@ "version": "0.8.0", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.8.0.tgz", "integrity": "sha512-kBJtf7PH6aWwZ6fka3zQ0p6SBYzx4fl1LoZXE2RrnYST9Xljm7WfKJrU4g/Xr3Beg72MLrp1AWNUmuYJTL7Cow==", - "devOptional": true + "optional": true, + "peer": true }, "node_modules/@emotion/is-prop-valid": { "version": "1.2.0", @@ -2259,13 +2264,15 @@ "version": "0.7.5", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.5.tgz", "integrity": "sha512-igX9a37DR2ZPGYtV6suZ6whr8pTFtyHL3K/oLUotxpSVO2ASaprmAe2Dkq7tBo7CRY7MMDrAa9nuQP9/YG8FxQ==", - "devOptional": true + "optional": true, + "peer": true }, "node_modules/@emotion/react": { "version": "11.9.0", "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.9.0.tgz", "integrity": "sha512-lBVSF5d0ceKtfKCDQJveNAtkC7ayxpVlgOohLgXqRwqWr9bOf4TZAFFyIcNngnV6xK6X4x2ZeXq7vliHkoVkxQ==", - "devOptional": true, + "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.13.10", "@emotion/babel-plugin": "^11.7.1", @@ -2292,7 +2299,8 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.0.3.tgz", "integrity": "sha512-2mSSvgLfyV3q+iVh3YWgNlUc2a9ZlDU7DjuP5MjK3AXRR0dYigCrP99aeFtaB2L/hjfEZdSThn5dsZ0ufqbvsA==", - "devOptional": true, + "optional": true, + "peer": true, "dependencies": { "@emotion/hash": "^0.8.0", "@emotion/memoize": "^0.7.4", @@ -2310,7 +2318,8 @@ "version": "11.8.1", "resolved": "https://registry.npmjs.org/@emotion/styled/-/styled-11.8.1.tgz", "integrity": "sha512-OghEVAYBZMpEquHZwuelXcRjRJQOVayvbmNR0zr174NHdmMgrNkLC6TljKC5h9lZLkN5WGrdUcrKlOJ4phhoTQ==", - "devOptional": true, + "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.13.10", "@emotion/babel-plugin": "^11.7.1", @@ -2336,7 +2345,8 @@ "version": "0.7.5", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.7.5.tgz", "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==", - "devOptional": true + "optional": true, + "peer": true }, "node_modules/@emotion/utils": { "version": "1.2.0", @@ -2347,7 +2357,8 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz", "integrity": "sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA==", - "devOptional": true + "optional": true, + "peer": true }, "node_modules/@eslint/eslintrc": { "version": "0.4.3", @@ -4107,6 +4118,43 @@ "resolved": "https://registry.npmjs.org/@ledgerhq/logs/-/logs-6.10.0.tgz", "integrity": "sha512-lLseUPEhSFUXYTKj6q7s2O3s2vW2ebgA11vMAlKodXGf5AFw4zUoEbTz9CoFOC9jS6xY4Qr8BmRnxP/odT4Uuw==" }, + "node_modules/@mui/base": { + "version": "5.0.0-alpha.90", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.90.tgz", + "integrity": "sha512-hNKwzr+RkiuGsGrakz8Q2i5ezr4Dz4b4Qsdipt9SiMrhuFAra/i501VSaEIzwec9LC4G+vtW4fE7yJBB0XaAYw==", + "dependencies": { + "@babel/runtime": "^7.17.2", + "@emotion/is-prop-valid": "^1.1.3", + "@mui/types": "^7.1.4", + "@mui/utils": "^5.9.1", + "@popperjs/core": "^2.11.5", + "clsx": "^1.2.1", + "prop-types": "^15.8.1", + "react-is": "^18.2.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mui" + }, + "peerDependencies": { + "@types/react": "^17.0.0 || ^18.0.0", + "react": "^17.0.0 || ^18.0.0", + "react-dom": "^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/base/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + }, "node_modules/@mui/icons-material": { "version": "5.8.2", "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.8.2.tgz", @@ -4175,38 +4223,6 @@ } } }, - "node_modules/@mui/material/node_modules/@mui/base": { - "version": "5.0.0-alpha.90", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.90.tgz", - "integrity": "sha512-hNKwzr+RkiuGsGrakz8Q2i5ezr4Dz4b4Qsdipt9SiMrhuFAra/i501VSaEIzwec9LC4G+vtW4fE7yJBB0XaAYw==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@emotion/is-prop-valid": "^1.1.3", - "@mui/types": "^7.1.4", - "@mui/utils": "^5.9.1", - "@popperjs/core": "^2.11.5", - "clsx": "^1.2.1", - "prop-types": "^15.8.1", - "react-is": "^18.2.0" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/@mui/material/node_modules/@mui/system": { "version": "5.10.0", "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.0.tgz", @@ -4303,14 +4319,32 @@ } } }, - "node_modules/@mui/material/node_modules/@mui/utils": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.9.3.tgz", - "integrity": "sha512-l0N5bcrenE9hnwZ/jPecpIRqsDFHkPXoFUcmkgysaJwVZzJ3yQkGXB47eqmXX5yyGrSc6HksbbqXEaUya+siew==", + "node_modules/@mui/material/node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" + }, + "node_modules/@mui/types": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.1.5.tgz", + "integrity": "sha512-HnRXrxgHJYJcT8ZDdDCQIlqk0s0skOKD7eWs9mJgBUu70hyW4iA6Kiv3yspJR474RFH8hysKR65VVSzUSzkuwA==", + "peerDependencies": { + "@types/react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@mui/utils": { + "version": "5.14.7", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.7.tgz", + "integrity": "sha512-RtheP/aBoPogVdi8vj8Vo2IFnRa4mZVmnD0RGlVZ49yF60rZs+xP4/KbpIrTr83xVs34QmHQ2aQ+IX7I0a0dDw==", "dependencies": { - "@babel/runtime": "^7.17.2", + "@babel/runtime": "^7.22.10", "@types/prop-types": "^15.7.5", - "@types/react-is": "^16.7.1 || ^17.0.0", + "@types/react-is": "^18.2.1", "prop-types": "^15.8.1", "react-is": "^18.2.0" }, @@ -4325,24 +4359,11 @@ "react": "^17.0.0 || ^18.0.0" } }, - "node_modules/@mui/material/node_modules/react-is": { + "node_modules/@mui/utils/node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, - "node_modules/@mui/types": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.1.5.tgz", - "integrity": "sha512-HnRXrxgHJYJcT8ZDdDCQIlqk0s0skOKD7eWs9mJgBUu70hyW4iA6Kiv3yspJR474RFH8hysKR65VVSzUSzkuwA==", - "peerDependencies": { - "@types/react": "*" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/@noble/hashes": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", @@ -4488,6 +4509,14 @@ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" }, + "node_modules/@remix-run/router": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.8.0.tgz", + "integrity": "sha512-mrfKqIHnSZRyIzBcanNJmVQELTnX+qagEDlcKO90RgRBVOZGSGvZKeDihTRfWcqoDn5N/NkUcwWTccnpN18Tfg==", + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/@rollup/plugin-node-resolve": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-7.1.3.tgz", @@ -5093,9 +5122,9 @@ } }, "node_modules/@terra-money/station-connector": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@terra-money/station-connector/-/station-connector-1.0.12.tgz", - "integrity": "sha512-SJZHqn4EvhAHqBSFJrTE9rvgti+CQ7sGr7MESbAErg7PMrenvfGxLRq/RmPvudAoB0cpGAwXK2CinDfvIbVnhQ==", + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@terra-money/station-connector/-/station-connector-1.0.15.tgz", + "integrity": "sha512-iCLXPPmQXyP8egOi7FA3U5MuEeMMrVnUaRiCUrBLuh4QNPCmJar082ilKDEavgkczKXNIqEGCAAT0LVrky/TPA==", "dependencies": { "bech32": "^2.0.0" }, @@ -5109,12 +5138,12 @@ } }, "node_modules/@terra-money/station-wallet": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@terra-money/station-wallet/-/station-wallet-1.0.12.tgz", - "integrity": "sha512-phZM4iC7J0pqXMjJsEW2twYgIz/RXiyUAromLZZFTdUhSQV/a8ADR4gP94PpXw0DW++22O9McYTjzEPgU8TFEg==", + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@terra-money/station-wallet/-/station-wallet-1.0.15.tgz", + "integrity": "sha512-izfM7rfWru5KAb4iWytYOWAJTwARWNxEixYO21KRQ9mfPwN0qrpHCyinItmQmzMdReCNPtbxHP1CUfMJnxGKWA==", "dependencies": { - "@terra-money/station-connector": "^1.0.12", - "@terra-money/wallet-interface": "^1.0.12" + "@terra-money/station-connector": "^1.0.15", + "@terra-money/wallet-interface": "^1.0.15" }, "engines": { "node": ">=16" @@ -5211,9 +5240,9 @@ } }, "node_modules/@terra-money/wallet-interface": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@terra-money/wallet-interface/-/wallet-interface-1.0.12.tgz", - "integrity": "sha512-WOcD39oTiCOagv9C/Y3Qff+rElsqn3fRSe8vGyhbG0Y7R+3ZzShMnpqKoch3diuD/EdaesYpKoRNv3KPrvq3Yw==", + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@terra-money/wallet-interface/-/wallet-interface-1.0.15.tgz", + "integrity": "sha512-PBlqxxojL1ufxNoL/jpNMa0LHvQDQ+4r3fmaOPv1smQAaMIxFraw46DQg8XTp7GpMQfCazbM0Kx5+xhmC4gl7Q==", "engines": { "node": ">=16" }, @@ -5222,12 +5251,12 @@ } }, "node_modules/@terra-money/wallet-kit": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/@terra-money/wallet-kit/-/wallet-kit-1.0.12.tgz", - "integrity": "sha512-jEhgn2ojFJKNxeJf8Uq6nUDwQghDKl1Z8OERtf4eg/aOC5OMeBH/HUxHEVxomelMNFRoZbFBep5Q/NLE8GKmdQ==", + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/@terra-money/wallet-kit/-/wallet-kit-1.0.15.tgz", + "integrity": "sha512-zYUcLJUEyOypKOYmRnBKkYFKZL2eRpsujo00vMXLpusH9Abw0KIZk2l0HaT2DgJOfWRwtiCpA/g7sZJyhfKBTA==", "dependencies": { - "@terra-money/station-wallet": "^1.0.12", - "@terra-money/wallet-interface": "^1.0.12" + "@terra-money/station-wallet": "^1.0.15", + "@terra-money/wallet-interface": "^1.0.15" }, "engines": { "node": ">=16" @@ -5235,7 +5264,7 @@ "peerDependencies": { "@terra-money/feather.js": "^1.0.8", "axios": "^0.27.2", - "react": "^17.0.2" + "react": "^18.2.0" } }, "node_modules/@tippyjs/react": { @@ -5513,9 +5542,9 @@ } }, "node_modules/@types/react": { - "version": "18.0.10", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.0.10.tgz", - "integrity": "sha512-dIugadZuIPrRzvIEevIu7A1smqOAjkSMv8qOfwPt9Ve6i6JT/FQcCHyk2qIAxwsQNKZt5/oGR0T4z9h2dXRAkg==", + "version": "18.2.21", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.21.tgz", + "integrity": "sha512-neFKG/sBAwGxHgXiIxnbm3/AAVQ/cMRS93hvBpg8xYRbeQSPVABp9U2bRnPf0iI4+Ucdv3plSxKK+3CW2ENJxA==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -5532,18 +5561,18 @@ } }, "node_modules/@types/react-dom": { - "version": "18.0.5", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.5.tgz", - "integrity": "sha512-OWPWTUrY/NIrjsAPkAk1wW9LZeIjSvkXRhclsFO8CZcZGCOg2G0YZy4ft+rOyYxy8B7ui5iZzi9OkDebZ7/QSA==", + "version": "18.2.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.7.tgz", + "integrity": "sha512-GRaAEriuT4zp9N4p1i8BDBYmEyfo+xQ3yHjJU4eiK5NDa1RmUZG+unZABUTK4/Ox/M+GaHwb6Ow8rUITrtjszA==", "dev": true, "dependencies": { "@types/react": "*" } }, "node_modules/@types/react-is": { - "version": "17.0.3", - "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.3.tgz", - "integrity": "sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==", + "version": "18.2.1", + "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-18.2.1.tgz", + "integrity": "sha512-wyUkmaaSZEzFZivD8F2ftSyAfk6L+DfFliVj/mYdOXbVjRcS87fQJLTnhk6dRZPuJjI+9g6RZJO4PNCngUrmyw==", "dependencies": { "@types/react": "*" } @@ -7072,7 +7101,8 @@ "version": "2.8.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.8.0.tgz", "integrity": "sha512-SEP5kJpfGYqYKpBrj5XU3ahw5p5GOHJ0U5ssOSQ/WBVdwkD2Dzlce95exQTs3jOVWPPKLBN2rlEWkCK7dSmLvg==", - "devOptional": true, + "optional": true, + "peer": true, "dependencies": { "@babel/runtime": "^7.7.2", "cosmiconfig": "^6.0.0", @@ -8262,9 +8292,9 @@ } }, "node_modules/classnames": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz", - "integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", + "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" }, "node_modules/clean-css": { "version": "4.2.4", @@ -8845,7 +8875,8 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", - "devOptional": true, + "optional": true, + "peer": true, "dependencies": { "@types/parse-json": "^4.0.0", "import-fresh": "^3.1.0", @@ -12074,9 +12105,12 @@ "dev": true }, "node_modules/fast-equals": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-2.0.4.tgz", - "integrity": "sha512-caj/ZmjHljPrZtbzJ3kfH5ia/k4mTJe/qSiXAGzxZWRZgsgDV0cvNaQULqUX8t0/JVlzzEdYOwCN5DmzTxoD4w==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.0.1.tgz", + "integrity": "sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==", + "engines": { + "node": ">=6.0.0" + } }, "node_modules/fast-glob": { "version": "3.2.11", @@ -12298,7 +12332,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "devOptional": true + "optional": true, + "peer": true }, "node_modules/find-up": { "version": "4.1.0", @@ -13251,14 +13286,6 @@ "integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==", "dev": true }, - "node_modules/history": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/history/-/history-5.3.0.tgz", - "integrity": "sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==", - "dependencies": { - "@babel/runtime": "^7.7.6" - } - }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -21287,9 +21314,9 @@ } }, "node_modules/qrcode.react": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.0.2.tgz", - "integrity": "sha512-8F3SGxSkNb3fMIHdlseqjFjLbsPrF3WvF/1MOboSUUHytT537W8f/FtbdA3XFIHDrc+TrRBjTI/QLmwhAIGWWw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-3.1.0.tgz", + "integrity": "sha512-oyF+Urr3oAMUG/OiOuONL3HXM+53wvuH3mtIWQrYmsXoAq0DkvZp2RYUWFSMFtbdOpuS++9v+WAkzNVkMlNW6Q==", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } @@ -21452,12 +21479,11 @@ } }, "node_modules/react": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", - "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", + "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" + "loose-envify": "^1.1.0" }, "engines": { "node": ">=0.10.0" @@ -21633,16 +21659,15 @@ } }, "node_modules/react-dom": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-17.0.2.tgz", - "integrity": "sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", "dependencies": { "loose-envify": "^1.1.0", - "object-assign": "^4.1.1", - "scheduler": "^0.20.2" + "scheduler": "^0.23.0" }, "peerDependencies": { - "react": "17.0.2" + "react": "^18.2.0" } }, "node_modules/react-error-overlay": { @@ -21652,9 +21677,9 @@ "dev": true }, "node_modules/react-hook-form": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.22.5.tgz", - "integrity": "sha512-Q2zaeQFXdVQ8l3hcywhltH+Nzj4vo50wMVujHDVN/1Xy9IOaSZJwYBXA2CYTpK6rq41fnXviw3jTLb04c7Gu9Q==", + "version": "7.46.1", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.46.1.tgz", + "integrity": "sha512-0GfI31LRTBd5tqbXMGXT1Rdsv3rnvy0FjEk8Gn9/4tp6+s77T7DPZuGEpBRXOauL+NhyGT5iaXzdIM2R6F/E+w==", "engines": { "node": ">=12.22.0" }, @@ -21663,7 +21688,7 @@ "url": "https://opencollective.com/react-hook-form" }, "peerDependencies": { - "react": "^16.8.0 || ^17" + "react": "^16.8.0 || ^17 || ^18" } }, "node_modules/react-i18next": { @@ -21717,9 +21742,9 @@ } }, "node_modules/react-query": { - "version": "3.39.1", - "resolved": "https://registry.npmjs.org/react-query/-/react-query-3.39.1.tgz", - "integrity": "sha512-qYKT1bavdDiQZbngWZyPotlBVzcBjDYEJg5RQLBa++5Ix5jjfbEYJmHSZRZD+USVHUSvl/ey9Hu+QfF1QAK80A==", + "version": "3.39.3", + "resolved": "https://registry.npmjs.org/react-query/-/react-query-3.39.3.tgz", + "integrity": "sha512-nLfLz7GiohKTJDuT4us4X3h/8unOh+00MLb2yJoGTPjxKs2bc1iDhkNx2bd5MKklXnOD3NrVZ+J2UXujA5In4g==", "dependencies": { "@babel/runtime": "^7.5.5", "broadcast-channel": "^3.4.1", @@ -21763,23 +21788,29 @@ } }, "node_modules/react-router": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.3.0.tgz", - "integrity": "sha512-7Wh1DzVQ+tlFjkeo+ujvjSqSJmkt1+8JO+T5xklPlgrh70y7ogx75ODRW0ThWhY7S+6yEDks8TYrtQe/aoboBQ==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.15.0.tgz", + "integrity": "sha512-NIytlzvzLwJkCQj2HLefmeakxxWHWAP+02EGqWEZy+DgfHHKQMUoBBjUQLOtFInBMhWtb3hiUy6MfFgwLjXhqg==", "dependencies": { - "history": "^5.2.0" + "@remix-run/router": "1.8.0" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { "react": ">=16.8" } }, "node_modules/react-router-dom": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.3.0.tgz", - "integrity": "sha512-uaJj7LKytRxZNQV8+RbzJWnJ8K2nPsOOEuX7aQstlMZKQT0164C+X2w6bnkqU3sjtLvpd5ojrezAyfZ1+0sStw==", + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.15.0.tgz", + "integrity": "sha512-aR42t0fs7brintwBGAv2+mGlCtgtFQeOzK0BM1/OiqEzRejOZtpMZepvgkscpMUnKb8YO84G7s3LsHnnDNonbQ==", "dependencies": { - "history": "^5.2.0", - "react-router": "6.3.0" + "@remix-run/router": "1.8.0", + "react-router": "6.15.0" + }, + "engines": { + "node": ">=14.0.0" }, "peerDependencies": { "react": ">=16.8", @@ -22006,11 +22037,11 @@ } }, "node_modules/react-smooth": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-2.0.1.tgz", - "integrity": "sha512-Own9TA0GPPf3as4vSwFhDouVfXP15ie/wIHklhyKBH5AN6NFtdk0UpHBnonV11BtqDkAWlt40MOUc+5srmW7NA==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/react-smooth/-/react-smooth-2.0.3.tgz", + "integrity": "sha512-yl4y3XiMorss7ayF5QnBiSprig0+qFHui8uh7Hgg46QX5O+aRMRKlfGGNGLHno35JkQSvSYY8eCWkBfHfrSHfg==", "dependencies": { - "fast-equals": "^2.0.0", + "fast-equals": "^5.0.0", "react-transition-group": "2.9.0" }, "peerDependencies": { @@ -22043,9 +22074,9 @@ } }, "node_modules/react-transition-group": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.2.tgz", - "integrity": "sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg==", + "version": "4.4.5", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", + "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", @@ -22257,7 +22288,8 @@ "node_modules/regenerator-runtime": { "version": "0.13.9", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", + "dev": true }, "node_modules/regenerator-transform": { "version": "0.15.0", @@ -23290,12 +23322,11 @@ } }, "node_modules/scheduler": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.20.2.tgz", - "integrity": "sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==", + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", + "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", "dependencies": { - "loose-envify": "^1.1.0", - "object-assign": "^4.1.1" + "loose-envify": "^1.1.0" } }, "node_modules/schema-utils": { diff --git a/package.json b/package.json index ecfaed7ae..f7b1dac85 100644 --- a/package.json +++ b/package.json @@ -34,13 +34,13 @@ "@terra-money/terra-utils": "^1.0.9", "@terra-money/terra.js": "^3.1.9", "@terra-money/terra.proto": "^2.0.0", - "@terra-money/wallet-kit": "^1.0.12", + "@terra-money/wallet-kit": "^1.0.15", "@tippyjs/react": "^4.2.6", "axios": "^0.27.2", "bech32": "^2.0.0", "bignumber.js": "^9.0.2", "buffer": "^6.0.3", - "classnames": "^2.3.1", + "classnames": "^2.3.2", "crypto-js": "^4.1.1", "date-fns": "^2.28.0", "i18next": "^21.8.14", @@ -51,17 +51,17 @@ "lottie-react": "^2.3.1", "numeral": "^2.0.6", "prettier": "^2.6.2", - "qrcode.react": "^3.0.2", + "qrcode.react": "^3.1.0", "qs": "^6.11.0", "ramda": "^0.28.0", - "react": "^17.0.2", + "react": "^18.2.0", "react-copy-to-clipboard": "^5.1.0", - "react-dom": "^17.0.2", - "react-hook-form": "7.22.5", + "react-dom": "^18.2.0", + "react-hook-form": "^7.29.0", "react-i18next": "^11.18.1", "react-modal": "^3.15.1", - "react-query": "^3.39.0", - "react-router-dom": "^6.3.0", + "react-query": "^3.39.3", + "react-router-dom": "^6.15.0", "recharts": "^2.1.16", "recoil": "^0.7.2", "sass": "^1.52.1", @@ -71,8 +71,6 @@ "xss": "1.0.11" }, "devDependencies": { - "@emotion/react": "^11.9.0", - "@emotion/styled": "^11.8.1", "@types/crypto-js": "^4.1.1", "@types/jest": "^27.5.1", "@types/node": "^17.0.35", @@ -80,9 +78,9 @@ "@types/qrcode.react": "^1.0.2", "@types/qs": "^6.9.7", "@types/ramda": "^0.28.13", - "@types/react": "^18.0.9", + "@types/react": "^18.2.21", "@types/react-copy-to-clipboard": "^5.0.2", - "@types/react-dom": "^18.0.5", + "@types/react-dom": "^18.2.7", "@types/react-modal": "^3.13.1", "@types/react-router-dom": "^5.3.3", "@types/secp256k1": "^4.0.3", diff --git a/src/app/components/Overlay.tsx b/src/app/components/Overlay.tsx index b8e0e0021..91b34d3a9 100644 --- a/src/app/components/Overlay.tsx +++ b/src/app/components/Overlay.tsx @@ -2,11 +2,13 @@ import classNames from "classnames" import { PropsWithChildren } from "react" import styles from "./Overlay.module.scss" +const cx = classNames.bind(styles) + const Overlay = ({ children, className, }: PropsWithChildren<{ className?: string }>) => { - return
{children}
+ return
{children}
} export default Overlay diff --git a/src/auth/modules/create/CreateMultisigWalletForm.tsx b/src/auth/modules/create/CreateMultisigWalletForm.tsx index e50a54e5d..3f4ede273 100644 --- a/src/auth/modules/create/CreateMultisigWalletForm.tsx +++ b/src/auth/modules/create/CreateMultisigWalletForm.tsx @@ -13,7 +13,7 @@ import { Grid } from "components/layout" import { Form, FormGroup, FormItem } from "components/form" import { FormError, FormWarning } from "components/form" import { Input, Submit, Paste } from "components/form" -import validate from "../../scripts/validate" +import validate from "auth/scripts/validate" interface Values { addresses: { value: AccAddress }[] @@ -125,7 +125,7 @@ const CreateMultisigWalletForm = ({ onCreated }: Props) => { diff --git a/src/auth/scripts/validate.ts b/src/auth/scripts/validate.ts index 87516669a..3de97a87c 100644 --- a/src/auth/scripts/validate.ts +++ b/src/auth/scripts/validate.ts @@ -1,3 +1,4 @@ +import { AccAddress } from "@terra-money/feather.js" import { getStoredWallet } from "./keystore" import wordlist from "bip39/src/wordlists/english.json" @@ -21,7 +22,10 @@ const validate = { } }, }, - + accAddress: { + address: (address: string) => + AccAddress.validate(address) || "Invalid address", + }, password: { required: (password: string) => !!password.length || "Password is required", length: (password: string) => diff --git a/src/components/display/Tag.tsx b/src/components/display/Tag.tsx index a5c2d6e2a..b372e68e4 100644 --- a/src/components/display/Tag.tsx +++ b/src/components/display/Tag.tsx @@ -12,7 +12,7 @@ interface Props { } const Tag = ({ color, small, children }: PropsWithChildren) => { - const className = classNames(styles.tag, `bg-${color}`, cx({ small })) + const className = cx(styles.tag, `bg-${color}`, { small }) return {children} } diff --git a/src/components/form/FormHelp.tsx b/src/components/form/FormHelp.tsx index 36ca4e4bf..40526dfcc 100644 --- a/src/components/form/FormHelp.tsx +++ b/src/components/form/FormHelp.tsx @@ -4,10 +4,12 @@ import InfoIcon from "@mui/icons-material/Info" import { Flex } from "../layout" import styles from "./FormHelp.module.scss" +const cx = classNames.bind(styles) + const Component = (props: PropsWithChildren<{ className: string }>) => { const { children, className } = props return ( -
+
diff --git a/src/components/form/Input.tsx b/src/components/form/Input.tsx index 34dca40d2..9801ac83f 100644 --- a/src/components/form/Input.tsx +++ b/src/components/form/Input.tsx @@ -40,9 +40,7 @@ const Input = forwardRef( {token && ( {({ symbol }) => ( - - {symbol} - + {symbol} )} )} @@ -50,7 +48,7 @@ const Input = forwardRef( {actionButton && ( - )} - > - - - } - /> - ) - } - - return ( - - {render()} - - ) -} - -export default LunaPrice diff --git a/src/pages/gov/GovernanceParams.tsx b/src/pages/gov/GovernanceParams.tsx index a27100e91..444c75bd8 100644 --- a/src/pages/gov/GovernanceParams.tsx +++ b/src/pages/gov/GovernanceParams.tsx @@ -3,7 +3,7 @@ import { intervalToDuration } from "date-fns" import { useDepositParams } from "data/queries/gov" import { useVotingParams } from "data/queries/gov" import { Card } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import DataList from "./components/DataList" import styles from "./GovernanceParams.module.scss" import { useNetwork } from "data/wallet" @@ -23,9 +23,9 @@ const GovernanceParams = ({ chain }: { chain: string }) => { { title: t("Minimum deposit"), content: minDeposit && ( - ), }, diff --git a/src/pages/gov/ProposalDepositors.tsx b/src/pages/gov/ProposalDepositors.tsx index 1afae7266..d4609c725 100644 --- a/src/pages/gov/ProposalDepositors.tsx +++ b/src/pages/gov/ProposalDepositors.tsx @@ -3,7 +3,7 @@ import { getAmount } from "utils/coin" import { useDeposits } from "data/queries/gov" import { FinderLink } from "components/general" import { Card, Table } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import { useNetwork } from "data/wallet" // FIXME: Pagination (Client) @@ -29,7 +29,7 @@ const ProposalDepositors = ({ id, chain }: { id: string; chain: string }) => { title: t("Amount"), dataIndex: "amount", render: (amount) => ( - diff --git a/src/pages/gov/ProposalDeposits.tsx b/src/pages/gov/ProposalDeposits.tsx index 4d77e0f45..f6ebc2912 100644 --- a/src/pages/gov/ProposalDeposits.tsx +++ b/src/pages/gov/ProposalDeposits.tsx @@ -6,7 +6,7 @@ import { combineState } from "data/query" import { useProposal } from "data/queries/gov" import { useDeposits, useDepositParams } from "data/queries/gov" import { Card } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import { DateTimeRenderer } from "components/display" import Orb from "./components/Orb" import styles from "./ProposalDeposits.module.scss" @@ -51,7 +51,9 @@ const ProposalDeposits = ({ id, chain, card }: Props) => { const contents = [ { title: t("Deposited"), - content: , + content: ( + + ), }, { title: t("Deposit end time"), diff --git a/src/pages/gov/ProposalSummary.tsx b/src/pages/gov/ProposalSummary.tsx index 688aa3970..f4b012289 100644 --- a/src/pages/gov/ProposalSummary.tsx +++ b/src/pages/gov/ProposalSummary.tsx @@ -1,6 +1,6 @@ import { FinderLink } from "components/general" import { Col, Card } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import { ProposalResult } from "data/queries/gov" import DataList from "./components/DataList" @@ -14,7 +14,9 @@ const ProposalSummary = ({ proposal }: { proposal: ProposalResult }) => { title: capitalize(key), content: key === "amount" ? ( - content.map((coin: CoinData) => ) + content.map((coin: CoinData) => ( + + )) ) : key === "recipient" ? ( {content} ) : key === "changes" ? ( diff --git a/src/pages/history/HistoryItem.tsx b/src/pages/history/HistoryItem.tsx index 123bbf663..626f0ae03 100644 --- a/src/pages/history/HistoryItem.tsx +++ b/src/pages/history/HistoryItem.tsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next" import { FinderLink } from "components/general" import { Card } from "components/layout" import { Dl, DateTimeRenderer } from "components/display" -import { ReadMultiple } from "components/token" +import { ReadToken } from "components/token" import HistoryMessage from "./HistoryMessage" import styles from "./HistoryItem.module.scss" import DateRangeIcon from "@mui/icons-material/DateRange" @@ -28,7 +28,9 @@ const HistoryItem = ({ tx: { body: { memo }, auth_info: { - fee: { amount: fee }, + fee: { + amount: [fee], + }, signer_infos, }, }, @@ -40,7 +42,7 @@ const HistoryItem = ({ const networkName = useNetworkName() const data = [ - { title: t("Fee"), content: }, + { title: t("Fee"), content: }, { title: t("Memo"), content: memo }, { title: t("Log"), content: !success && raw_log }, ] diff --git a/src/pages/stake/StakedDonut.tsx b/src/pages/stake/StakedDonut.tsx index 7cf59cc89..0ec94fbec 100644 --- a/src/pages/stake/StakedDonut.tsx +++ b/src/pages/stake/StakedDonut.tsx @@ -12,7 +12,7 @@ import { import { useStakeChartData } from "data/queries/staking" import PaymentsOutlinedIcon from "@mui/icons-material/PaymentsOutlined" import { useThemeState } from "data/settings/Theme" -import { Read } from "components/token" +import { Read, ReadToken } from "components/token" import { useCurrency } from "data/settings/Currency" const StakedDonut = ({ chain }: { chain?: string }) => { @@ -64,25 +64,22 @@ const StakedDonut = ({ chain }: { chain?: string }) => { const RenderTooltip = (props: { payload?: any }) => { const { payload } = props + if (!payload?.length) return null + const { denom, amount, value, name, moniker } = payload[0].payload return (
-
{payload[0]?.payload.name || payload[0]?.payload.moniker}
+
{name || moniker}

Balance:

- +

Value:

- {" "} - {currency.symbol} + {currency.symbol}

diff --git a/src/pages/stake/StakingDetailsCompact.tsx b/src/pages/stake/StakingDetailsCompact.tsx index 806324572..a5072e5ea 100644 --- a/src/pages/stake/StakingDetailsCompact.tsx +++ b/src/pages/stake/StakingDetailsCompact.tsx @@ -11,7 +11,7 @@ import { } from "data/queries/staking" import { useAlliance, useAllianceDelegations } from "data/queries/alliance" import { combineState } from "data/query" -import { Read } from "components/token" +import { ReadToken } from "components/token" import { ChainFeature } from "types/chains" const cx = classNames.bind(styles) @@ -102,9 +102,10 @@ const StakingDetailsCompact = ({

{token.name}

- {" "} {token.symbol} diff --git a/src/pages/stake/ValidatorActions.tsx b/src/pages/stake/ValidatorActions.tsx index b228d4bea..169ebc2a6 100644 --- a/src/pages/stake/ValidatorActions.tsx +++ b/src/pages/stake/ValidatorActions.tsx @@ -10,7 +10,7 @@ import { getAvailableStakeActions } from "data/queries/staking" import { calcRewardsValues, useRewards } from "data/queries/distribution" import { LinkButton } from "components/general" import { Col, Card, ExtraActions, Grid } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import { StakeAction } from "txs/stake/StakeForm" import styles from "./ValidatorActions.module.scss" import { useNetworkWithFeature } from "data/wallet" @@ -22,7 +22,7 @@ const ValidatorActions = ({ destination }: { destination: ValAddress }) => { const networks = useNetworkWithFeature(ChainFeature.STAKING) const chain = useMemo(() => { const prefix = ValAddress.getPrefix(destination) - return Object.values(networks ?? {}).find(({ prefix: p }) => p === prefix) + return Object.values(networks).find(({ prefix: p }) => p === prefix) }, [networks, destination]) const { data: delegation, ...delegationState } = useDelegation(destination) const { data: delegations, ...delegationsState } = useDelegations( @@ -46,9 +46,9 @@ const ValidatorActions = ({ destination }: { destination: ValAddress }) => { return (

- @@ -93,9 +93,9 @@ const ValidatorActions = ({ destination }: { destination: ValAddress }) => { return (
- {" "} diff --git a/src/pages/stake/components/StakedCard.tsx b/src/pages/stake/components/StakedCard.tsx index e28581ede..4c588ee19 100644 --- a/src/pages/stake/components/StakedCard.tsx +++ b/src/pages/stake/components/StakedCard.tsx @@ -2,7 +2,7 @@ import { useTranslation } from "react-i18next" import { PropsWithChildren } from "react" import { Grid, Card, Flex } from "components/layout" import { Props as CardProps } from "components/layout/Card" -import { Read } from "components/token" +import { Read, ReadToken } from "components/token" import styles from "./StakedCard.module.scss" import { useCurrency } from "data/settings/Currency" @@ -43,11 +43,11 @@ const StakedCard = (props: PropsWithChildren) => { {hideAmount ? ( "" ) : Number(amount) > 0 ? ( - ) : ( diff --git a/src/pages/stake/delegations/ChainDelegations.tsx b/src/pages/stake/delegations/ChainDelegations.tsx index 25c2a828f..fdc545c89 100644 --- a/src/pages/stake/delegations/ChainDelegations.tsx +++ b/src/pages/stake/delegations/ChainDelegations.tsx @@ -7,7 +7,7 @@ import { AccAddress, Coin } from "@terra-money/feather.js" import { ValidatorLink } from "components/general" import { ModalButton } from "components/feedback" import { Table } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import StakedCard from "../components/StakedCard" import { getMaxHeightStyle } from "utils/style" import styles from "../CardModal.module.scss" @@ -59,8 +59,10 @@ const ChainDelegations = ({ chain }: { chain: string }) => { price: newPriceHolder + (balance.amount.toNumber() * (prices[token]?.price || 0)) / - 10 ** decimals, - amount: newAmountHolder + balance.amount.toNumber() / 10 ** decimals, + Math.pow(10, decimals), + amount: + newAmountHolder + + balance.amount.toNumber() / Math.pow(10, decimals), } } @@ -112,7 +114,7 @@ const ChainDelegations = ({ chain }: { chain: string }) => { { title: t("Delegated"), dataIndex: "balance", - render: (balance: Coin) => , + render: (balance: Coin) => , align: "right", }, ]} diff --git a/src/pages/stake/delegations/Delegations.tsx b/src/pages/stake/delegations/Delegations.tsx index a5a31e089..58074e21c 100644 --- a/src/pages/stake/delegations/Delegations.tsx +++ b/src/pages/stake/delegations/Delegations.tsx @@ -7,7 +7,7 @@ import { useInterchainDelegations } from "data/queries/staking" import { StakingAssetLink } from "components/general" import { ModalButton } from "components/feedback" import { Table } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import StakedCard from "../components/StakedCard" import { useNativeDenoms } from "data/token" import styles from "../CardModal.module.scss" @@ -77,7 +77,7 @@ const Delegations = () => { let tokenPrice = prices[token]?.price ?? 0 totalTokensAmount += amount - return acc + (amount * tokenPrice) / 10 ** decimals + return acc + (amount * tokenPrice) / Math.pow(10, decimals) }, 0) return ( @@ -129,7 +129,7 @@ const Delegations = () => { { title: t("Delegated"), dataIndex: "balance", - render: (balance: Coin) => , + render: (balance: Coin) => , align: "right", }, ]} diff --git a/src/pages/stake/rewards/ChainRewards.tsx b/src/pages/stake/rewards/ChainRewards.tsx index 23a3a2607..d7467614b 100644 --- a/src/pages/stake/rewards/ChainRewards.tsx +++ b/src/pages/stake/rewards/ChainRewards.tsx @@ -72,11 +72,12 @@ const ChainRewards = ({ chain }: { chain: string }) => { for (const { amount, denom } of totalChainRewardsList.toArray()) { const { token, decimals } = readNativeDenom(denom) const tokenPrice = exchangeRates[token]?.price ?? 0 - const tokensValue = (amount.toNumber() * tokenPrice) / 10 ** decimals + const tokensValue = + (amount.toNumber() * tokenPrice) / Math.pow(10, decimals) tokensPrice += tokensValue if (denom === selectedChainDenom) { - tokensAmount += amount.toNumber() / 10 ** decimals + tokensAmount += amount.toNumber() / Math.pow(10, decimals) } } diff --git a/src/pages/stake/unbondings/ChainUnbondings.tsx b/src/pages/stake/unbondings/ChainUnbondings.tsx index 36923162f..6f5916ab4 100644 --- a/src/pages/stake/unbondings/ChainUnbondings.tsx +++ b/src/pages/stake/unbondings/ChainUnbondings.tsx @@ -11,7 +11,7 @@ import { getMaxHeightStyle } from "utils/style" import { ValidatorLink } from "components/general" import { ModalButton } from "components/feedback" import { Table } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import { DateTimeRenderer, TooltipIcon } from "components/display" import StakedCard from "../components/StakedCard" import styles from "../CardModal.module.scss" @@ -55,8 +55,8 @@ const ChainUnbondings = ({ chain }: { chain: string }) => { return { price: newPriceHolder + - (balance * (prices[token]?.price || 0)) / 10 ** decimals, - amount: newAmountHolder + balance / 10 ** decimals, + (balance * (prices[token]?.price || 0)) / Math.pow(10, decimals), + amount: newAmountHolder + balance / Math.pow(10, decimals), } }, { price: 0, amount: 0 } @@ -108,7 +108,7 @@ const ChainUnbondings = ({ chain }: { chain: string }) => { title: t("Amount"), dataIndex: "initial_balance", render: (amount: Dec, { validator_address }) => ( - diff --git a/src/pages/stake/unbondings/Unbondings.tsx b/src/pages/stake/unbondings/Unbondings.tsx index 7b19cbac3..56c95277a 100644 --- a/src/pages/stake/unbondings/Unbondings.tsx +++ b/src/pages/stake/unbondings/Unbondings.tsx @@ -10,7 +10,7 @@ import { import { ValidatorLink } from "components/general" import { ModalButton } from "components/feedback" import { Table } from "components/layout" -import { Read } from "components/token" +import { ReadToken } from "components/token" import { DateTimeRenderer, TooltipIcon } from "components/display" import StakedCard from "../components/StakedCard" import { UnbondingDelegation } from "@terra-money/feather.js" @@ -48,7 +48,9 @@ const Unbondings = () => { const denom = getDenomFromAddress(networks, unbonding.delegator_address) const { token, decimals } = readNativeDenom(denom) - return acc + (balance * (prices[token]?.price || 0)) / 10 ** decimals + return ( + acc + (balance * (prices[token]?.price || 0)) / Math.pow(10, decimals) + ) }, 0) const list = flattenUnbondings(unbondings) @@ -94,7 +96,7 @@ const Unbondings = () => { title: t("Amount"), dataIndex: "initial_balance", render: (amount: Dec, { validator_address }) => ( - diff --git a/src/pages/wallet/Asset.tsx b/src/pages/wallet/Asset.tsx index b61837c94..627f48a4b 100644 --- a/src/pages/wallet/Asset.tsx +++ b/src/pages/wallet/Asset.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next" import { WithFetching } from "components/feedback" -import { Read, TokenIcon } from "components/token" +import { Read, ReadToken, TokenIcon } from "components/token" import { useExchangeRates } from "data/queries/coingecko" import { combineState } from "data/query" import { useCurrency } from "data/settings/Currency" @@ -68,14 +68,7 @@ const Asset = (props: Props) => {

{currency.symbol}{" "} {coinPrice ? ( - + ) : ( )} @@ -97,18 +90,15 @@ const Asset = (props: Props) => { {t("Failed to query balance")} ) : ( - )} )} {" "} - {symbol}

diff --git a/src/pages/wallet/AssetChain.tsx b/src/pages/wallet/AssetChain.tsx index c55a43a73..cb99335fd 100644 --- a/src/pages/wallet/AssetChain.tsx +++ b/src/pages/wallet/AssetChain.tsx @@ -1,5 +1,5 @@ import { WithFetching } from "components/feedback" -import { Read, TokenIcon } from "components/token" +import { Read, ReadToken, TokenIcon } from "components/token" import { useExchangeRates } from "data/queries/coingecko" import { useCurrency } from "data/settings/Currency" import { useNetwork, useNetworkName } from "data/wallet" @@ -16,15 +16,15 @@ export interface Props { chain: string balance: string symbol: string - decimals: number token: string denom: string path?: string[] ibcDenom?: string + decimals?: number } const AssetChain = (props: Props) => { - const { chain, symbol, balance, decimals, token, path, ibcDenom, denom } = + const { chain, symbol, balance, token, path, ibcDenom, denom, decimals } = props const currency = useCurrency() const { data: prices, ...pricesState } = useExchangeRates() @@ -110,12 +110,10 @@ const AssetChain = (props: Props) => { {currency.symbol}{" "} {price ? ( ) : ( @@ -129,12 +127,12 @@ const AssetChain = (props: Props) => { {wrong ? ( {t("Failed to query balance")} ) : ( - )} diff --git a/src/pages/wallet/AssetPage.tsx b/src/pages/wallet/AssetPage.tsx index afaf4f306..fbb04ff13 100644 --- a/src/pages/wallet/AssetPage.tsx +++ b/src/pages/wallet/AssetPage.tsx @@ -117,15 +117,15 @@ const AssetPage = () => {
{token === "uluna" && symbol !== "LUNC" && - isTerraChain(b.chain) && } + isTerraChain(b.chain) && }
))} @@ -145,9 +145,9 @@ const AssetPage = () => { symbol={symbol} balance={b.amount} chain={b.chain} + decimals={decimals} token={token} denom={b.denom} - decimals={decimals} path={ unknownIBCDenoms[[b.denom, b.chain].join("*")]?.chains } diff --git a/src/pages/wallet/IbcSendBackTx.tsx b/src/pages/wallet/IbcSendBackTx.tsx index b00352ce5..d2593df1b 100644 --- a/src/pages/wallet/IbcSendBackTx.tsx +++ b/src/pages/wallet/IbcSendBackTx.tsx @@ -196,7 +196,7 @@ function IbcSendBackTx({ token, chainID }: Props) { new MsgTransfer( port, channel, - new Coin(IBCdenom, input * 10 ** decimals), + new Coin(IBCdenom, input * Math.pow(10, decimals)), addresses[chains[step]], addresses[chains[step + 1]], undefined, diff --git a/src/pages/wallet/NetWorth.tsx b/src/pages/wallet/NetWorth.tsx index 85b415a44..e8dd5540a 100644 --- a/src/pages/wallet/NetWorth.tsx +++ b/src/pages/wallet/NetWorth.tsx @@ -47,7 +47,7 @@ const NetWorth = () => { acc + (parseInt(amount) * (symbol?.endsWith("...") ? 0 : prices?.[token]?.price ?? 0)) / - 10 ** decimals + Math.pow(10, decimals) ) }, 0) @@ -64,7 +64,6 @@ const NetWorth = () => { decimals={0} fixed={2} denom="" - token="" />
diff --git a/src/pages/wallet/TransferPage.tsx b/src/pages/wallet/TransferPage.tsx index f93d8ba2d..09945f961 100644 --- a/src/pages/wallet/TransferPage.tsx +++ b/src/pages/wallet/TransferPage.tsx @@ -34,7 +34,7 @@ interface TxValues { destinationChain?: string // chainID address?: AccAddress // hidden input input?: number - decimals?: number + decimals: number } interface AssetType { @@ -104,7 +104,7 @@ const TransferPage = () => { address: destinationAddress, asset, } = watch() - const amount = toAmount(input, { decimals: decimals ?? 6 }) + const amount = toAmount(input, { decimals }) const availableChains = useMemo( () => availableAssets diff --git a/src/pages/wallet/Vesting.tsx b/src/pages/wallet/Vesting.tsx index 2725c7d5f..01a3bcd7e 100644 --- a/src/pages/wallet/Vesting.tsx +++ b/src/pages/wallet/Vesting.tsx @@ -6,9 +6,9 @@ import { import VestingScheduleTable from "./VestingScheduleTable" import { useTranslation } from "react-i18next" import styles from "./Vesting.module.scss" -import { Read } from "components/token" +import { ReadToken } from "components/token" -const Vesting = () => { +const Vesting = ({ denom }: { denom: Denom }) => { const { t } = useTranslation() const { data } = useAccount() @@ -23,11 +23,11 @@ const Vesting = () => {
{t("Vested")}
- +
{t("Total")}
- +
diff --git a/src/txs/Tx.tsx b/src/txs/Tx.tsx index b061709d0..864c85465 100644 --- a/src/txs/Tx.tsx +++ b/src/txs/Tx.tsx @@ -30,7 +30,7 @@ import { Flex, Grid } from "components/layout" import { FormError, Submit, Select, Input, FormItem } from "components/form" import { Modal } from "components/feedback" import { Details } from "components/display" -import { Read } from "components/token" +import { ReadToken } from "components/token" import ConnectWallet from "app/sections/ConnectWallet" import useToPostMultisigTx from "pages/multisig/utils/useToPostMultisigTx" import { isWallet, useAuth } from "auth" @@ -194,7 +194,6 @@ function Tx(props: Props) { ? (Number(balance) - Number(gasFee.amount)).toFixed(0) : balance } - const max = !gasFee.amount ? undefined : isDenom(token) @@ -339,11 +338,7 @@ function Tx(props: Props) { fontSize="inherit" className={styles.icon} /> - + ) @@ -373,47 +368,26 @@ function Tx(props: Props) { > {availableGasDenoms.map((denom) => ( ))} )} -
- {gasFee.amount && ( - - )} -
+
{gasFee.amount && }
{balanceAfterTx && ( <>
{t("Balance")}
- +
{t("Balance after tx")}
-
diff --git a/src/txs/gov/DepositForm.tsx b/src/txs/gov/DepositForm.tsx index 4a44d2753..2c5b160ee 100644 --- a/src/txs/gov/DepositForm.tsx +++ b/src/txs/gov/DepositForm.tsx @@ -12,6 +12,7 @@ import validate from "../validate" import Tx from "../Tx" import { useInterchainAddresses } from "auth/hooks/useAddress" import { useNetwork } from "data/wallet" +import { useNativeDenoms } from "data/token" interface TxValues { input: number @@ -22,6 +23,7 @@ const DepositForm = () => { const { id, chain } = useProposalId() const addresses = useInterchainAddresses() const networks = useNetwork() + const readNativeDenom = useNativeDenoms() const bankBalance = useBankBalance() const balance = @@ -33,7 +35,9 @@ const DepositForm = () => { const { register, trigger, watch, setValue, handleSubmit, formState } = form const { errors } = formState const { input } = watch() - const amount = toAmount(input) + const token = networks[chain].baseAsset + const decimals = readNativeDenom(token ?? "").decimals + const amount = toAmount(input, { decimals }) /* tx */ const createTx = useCallback( @@ -67,7 +71,7 @@ const DepositForm = () => { ) const tx = { - token: networks[chain].baseAsset, + token, amount, balance, estimationTxValues, @@ -89,9 +93,9 @@ const DepositForm = () => { { const { t } = useTranslation() const addresses = useInterchainAddresses() const networks = useNetwork() - const readNetiveDenom = useNativeDenoms() + const readNativeDenom = useNativeDenoms() const bankBalance = useBankBalance() - const balance = - bankBalance.find((b) => b.denom === networks[chain].baseAsset)?.amount ?? - "0" + const token = networks[chain].baseAsset + const decimals = readNativeDenom(token ?? "").decimals + const balance = bankBalance.find((b) => b.denom === token)?.amount ?? "0" /* tx context */ - const defaultCoinItem = { denom: networks[chain].baseAsset } + const defaultCoinItem = { denom: token } const { data: communityPool, ...communityPoolState } = useCommunityPool(chain) const { data: depositParams, ...depositParamsState } = useDepositParams(chain) const state = combineState(communityPoolState, depositParamsState) //if(!depositParams || communityPool) return null const minDeposit = depositParams - ? getAmount(depositParams.min_deposit, networks[chain].baseAsset) + ? getAmount(depositParams.min_deposit, token) : 0 /* form */ const form = useForm({ mode: "onChange", - defaultValues: { input: toInput(minDeposit), coins: [defaultCoinItem] }, + defaultValues: { + input: toInput(minDeposit, decimals), + coins: [defaultCoinItem], + }, }) const { register, trigger, control, watch, setValue, handleSubmit } = form const { errors } = form.formState const { input, ...values } = watch() - const amount = toAmount(input) + const amount = toAmount(input, { decimals }) + const { fields, append, remove } = useFieldArray({ control, name: "changes", @@ -121,8 +125,8 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { /* update input */ useEffect(() => { - setValue("input", toInput(minDeposit)) - }, [minDeposit, setValue]) + setValue("input", toInput(minDeposit, decimals)) + }, [minDeposit, setValue, decimals]) /* effect: ParameterChangeProposal */ const shouldAppendChange = @@ -136,15 +140,13 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { const createTx = useCallback( ({ input, title, description, ...values }: TxValues) => { if (!addresses) return - const amount = toAmount(input) - const deposit = has(amount) - ? new Coins({ [networks[chain].baseAsset]: amount }) - : [] + const amount = toAmount(input, { decimals }) + const deposit = has(amount) ? new Coins({ [token]: amount }) : [] const getContent = () => { if (values.type === ProposalType.SPEND) { const { input, denom, recipient } = values.spend - const coins = new Coins({ [denom]: toAmount(input) }) + const coins = new Coins({ [denom]: toAmount(input, { decimals }) }) return new CommunityPoolSpendProposal( title, description, @@ -180,7 +182,7 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { ] return { msgs, chainID: chain ?? "" } }, - [addresses, chain, networks] + [addresses, chain, token, decimals] ) /* fee */ @@ -189,9 +191,9 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { type: ProposalType.TEXT, title: ESTIMATE.TITLE, description: ESTIMATE.DESCRIPTION, - input: toInput(balance), + input: toInput(balance, decimals), }), - [balance] + [balance, decimals] ) const onChangeMax = useCallback( @@ -203,9 +205,11 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { ) const tx = { - token: networks[chain].baseAsset, + baseDenom: token, + token, amount, balance, + decimals, estimationTxValues, createTx, onChangeMax, @@ -243,7 +247,7 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { { @@ -385,7 +389,7 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { .filter(({ denom }) => isDenomTerraNative(denom)) .map(({ denom }) => ( ))} @@ -453,7 +457,7 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { })} placeholder={t( `We're proposing to spend 100,000 ${ - readNetiveDenom(networks[chain].baseAsset).symbol + readNativeDenom(networks[chain].baseAsset).symbol } from the Community Pool to fund the creation of public goods for the ${ networks[chain].name } ecosystem` @@ -465,12 +469,12 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { label={ {t("Initial deposit")} ({t("optional")}) @@ -483,8 +487,8 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { {...register("input", { valueAsNumber: true, validate: validate.input( - toInput(max.amount), - undefined, + toInput(max.amount, decimals), + decimals, "Initial deposit", true ), @@ -493,7 +497,6 @@ const SubmitProposalForm = ({ chain }: { chain: string }) => { token={networks[chain].baseAsset} onFocus={max.reset} inputMode="decimal" - placeholder={getPlaceholder()} /> diff --git a/src/txs/stake/QuickStakeForm.tsx b/src/txs/stake/QuickStakeForm.tsx index 8f22d080b..9be1d2dbd 100644 --- a/src/txs/stake/QuickStakeForm.tsx +++ b/src/txs/stake/QuickStakeForm.tsx @@ -228,7 +228,7 @@ const QuickStakeForm = (props: Props) => { const token = action === QuickStakeAction.DELEGATE ? denom : "" const tx = { - decimals: readNativeDenom(denom)?.decimals, + decimals: asset.decimals, token, amount, balance, diff --git a/src/txs/stake/StakeForm.tsx b/src/txs/stake/StakeForm.tsx index 6f62886ac..fb7b59f3b 100644 --- a/src/txs/stake/StakeForm.tsx +++ b/src/txs/stake/StakeForm.tsx @@ -119,14 +119,15 @@ const StakeForm = (props: Props) => { const { register, trigger, watch, setValue, handleSubmit, formState } = form const { errors } = formState const { source, input } = watch() - const amount = toAmount(input) + const { decimals } = readNativeDenom(denom) + const amount = toAmount(input, { decimals }) /* tx */ const createTx = useCallback( ({ input, source }: TxValues) => { if (!address) return - const amount = toAmount(input) + const amount = toAmount(input, { decimals }) const coin = new Coin(denom, amount) if (tab === StakeAction.REDELEGATE) { @@ -152,7 +153,7 @@ const StakeForm = (props: Props) => { return { msgs, chainID } }, - [address, destination, tab, denom, chainID, isAlliance] + [address, destination, decimals, tab, denom, chainID, isAlliance] ) /* fee */ @@ -180,10 +181,9 @@ const StakeForm = (props: Props) => { [setValue, trigger] ) - const token = tab === StakeAction.DELEGATE ? denom : "" const tx = { - decimals: readNativeDenom(token)?.decimals, - token, + decimals, + token: denom, amount, balance, initialGasDenom, @@ -287,7 +287,10 @@ const StakeForm = (props: Props) => { {
{t("Minimum received")}
-
diff --git a/src/txs/swap/TFMSwapForm.tsx b/src/txs/swap/TFMSwapForm.tsx index 681a9b50b..95004023c 100644 --- a/src/txs/swap/TFMSwapForm.tsx +++ b/src/txs/swap/TFMSwapForm.tsx @@ -19,7 +19,7 @@ import { queryTFMRoute, queryTFMSwap, TFM_ROUTER } from "data/external/tfm" /* components */ import { Form, FormArrow, FormError, FormWarning } from "components/form" import { Checkbox } from "components/form" -import { Read } from "components/token" +import { ReadToken } from "components/token" /* tx modules */ import { getPlaceholder, toInput } from "../utils" @@ -291,7 +291,7 @@ const TFMSwapForm = ({ chainID }: { chainID: string }) => { valueAsNumber: true, validate: validate.input( toInput(max.amount, offerDecimals), - offerDecimals + offerDecimals ?? 6 ), })} inputMode="decimal" @@ -315,10 +315,11 @@ const TFMSwapForm = ({ chainID }: { chainID: string }) => { addonAfter={ {simulatedValue ? ( - ) : (

diff --git a/src/txs/swap/components/ExpectedPrice.tsx b/src/txs/swap/components/ExpectedPrice.tsx index b810fa84c..67d2ce35b 100644 --- a/src/txs/swap/components/ExpectedPrice.tsx +++ b/src/txs/swap/components/ExpectedPrice.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next" import { toPrice } from "utils/num" -import { Read } from "components/token" +import { Read, ReadToken } from "components/token" import { PayloadOnchain, PayloadTerraswap } from "../useSwapUtils" import { PayloadRouteswap } from "../useSwapUtils" import { SwapMode } from "../useSwapUtils" @@ -55,11 +55,7 @@ const ExpectedPrice = ({ mode, input, ...props }: Props) => { {renderExpectedPrice()}

{t("Trading fee")}
-
- {!isLoading && ( - - )} -
+
{!isLoading && }
) } @@ -82,9 +78,9 @@ const ExpectedPrice = ({ mode, input, ...props }: Props) => {
{t("Minimum received")}
{!isLoading && ( - )} diff --git a/src/txs/swap/components/Price.tsx b/src/txs/swap/components/Price.tsx index 21a37c33b..3979524d1 100644 --- a/src/txs/swap/components/Price.tsx +++ b/src/txs/swap/components/Price.tsx @@ -11,13 +11,13 @@ const Price = ({ price, offerAsset, askAsset, className }: Props) => { return price > 1 ? ( - ={" "} - + ={" "} + ) : ( - ={" "} - + ={" "} + ) } diff --git a/src/txs/validate.ts b/src/txs/validate.ts index 64458438c..90b25acdb 100644 --- a/src/txs/validate.ts +++ b/src/txs/validate.ts @@ -17,7 +17,7 @@ const lessThan = (max: number, label = "Amount", optional = false) => { } } -const decimal = (decimals = 6, label = "Amount", optional = false) => { +const decimal = (decimals: number, label = "Amount", optional = false) => { return (value = 0) => { return ( (optional && !value) || @@ -29,7 +29,7 @@ const decimal = (decimals = 6, label = "Amount", optional = false) => { const input = ( max: number, - decimals = 6, + decimals: number, label = "Amount", optional = false ) => { diff --git a/src/utils/chain.ts b/src/utils/chain.ts index a01a4c5df..bf79c39a0 100644 --- a/src/utils/chain.ts +++ b/src/utils/chain.ts @@ -26,7 +26,7 @@ export const useChainsByAssetValue = () => { value: (parseInt(amount) * (isNonWhitelisted ? 0 : prices?.[token]?.price ?? 0)) / - 10 ** decimals, + Math.pow(10, decimals), } }) From 952525d178d9ab5d19c64b9fe2ee72fb4010dd2d Mon Sep 17 00:00:00 2001 From: plubber <51789398+ericHgorski@users.noreply.github.com> Date: Wed, 13 Sep 2023 11:29:11 -0400 Subject: [PATCH 10/14] fix: add pool asset length check for map (#526) From e3228d7b1bd94a16021d398b862cbbeddb9efdc9 Mon Sep 17 00:00:00 2001 From: plubber <51789398+ericHgorski@users.noreply.github.com> Date: Wed, 13 Sep 2023 11:29:44 -0400 Subject: [PATCH 11/14] St 752 improve error hadnling (#527) * Display error messages * Improve error parsing * Fix user denied error * fix: typos --------- Co-authored-by: Alessandro Candeago <54709706+alecande11@users.noreply.github.com> Co-authored-by: Manuel Alessandro Collazo From 44a8d7c6246f37776a28e06039ccb52de7416c24 Mon Sep 17 00:00:00 2001 From: Michael Merz Date: Wed, 13 Sep 2023 12:06:33 -0400 Subject: [PATCH 12/14] chore: increment version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c520ad5eb..aa0449870 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "hompage": "https://station.money", "author": "Terra (https://station.money)", "repository": "github:terra-money/station", - "version": "7.3.2", + "version": "7.3.3", "license": "MIT", "scripts": { "start": "echo \"$CF_PAGES_COMMIT_SHA\" > public/commit_hash && react-scripts start", From eecf04f4f6dfb53040380f2327feb4771839181b Mon Sep 17 00:00:00 2001 From: Michael Merz Date: Fri, 15 Sep 2023 16:14:23 -0400 Subject: [PATCH 13/14] feat: set default swap to usdc/luna instead of luna/none. --- src/txs/swap/TFMSwapForm.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/txs/swap/TFMSwapForm.tsx b/src/txs/swap/TFMSwapForm.tsx index 95004023c..6c7e52d96 100644 --- a/src/txs/swap/TFMSwapForm.tsx +++ b/src/txs/swap/TFMSwapForm.tsx @@ -63,7 +63,11 @@ const TFMSwapForm = ({ chainID }: { chainID: string }) => { /* swap context */ const { options, findTokenItem, findDecimals } = useTFMSwap() - const initialOfferAsset = (state as Token) ?? "uluna" + const initialOfferAsset = + (state as Token) ?? + "ibc/B3504E092456BA618CC28AC671A71FB08C6CA0FD0BE7C8A5B5A3E2DD933CC9E4" + + const initialAskAsset = (state as Token) ?? "uluna" /* options */ const [showAll, setShowAll] = useState(false) @@ -87,7 +91,11 @@ const TFMSwapForm = ({ chainID }: { chainID: string }) => { /* form */ const form = useForm({ mode: "onChange", - defaultValues: { offerAsset: initialOfferAsset, slippageInput: 1 }, + defaultValues: { + offerAsset: initialOfferAsset, + askAsset: initialAskAsset, + slippageInput: 1, + }, }) const { register, trigger, watch, setValue, handleSubmit, formState } = form From d3bd5a97c69004851235e041159c6d5b2fbc9f8f Mon Sep 17 00:00:00 2001 From: Michael Merz Date: Wed, 20 Sep 2023 11:47:34 -0400 Subject: [PATCH 14/14] feat: increment version to align with sprint 26 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aa0449870..1aad62374 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "hompage": "https://station.money", "author": "Terra (https://station.money)", "repository": "github:terra-money/station", - "version": "7.3.3", + "version": "7.3.4", "license": "MIT", "scripts": { "start": "echo \"$CF_PAGES_COMMIT_SHA\" > public/commit_hash && react-scripts start",