Skip to content

Commit

Permalink
Release/7.3.0 rc 1 (#223)
Browse files Browse the repository at this point in the history
* wip: back button manage wallet pages

* fix chain list overlapping (#184)

* Fix for non-persistent service worker

* fix: vesting token component

* fix: send button disable

* feat: back buttons manage pages

* fix: property undefined chainID error

* fix: convert object error

* fixed styling for some back arrows including Manage Wallets modal and extension Pages

* removed commented out icons

* fix: non-whitelisted tokens

* fix: build error

* Show signbytes content

* fix: tokens with :

* Update SignBytes design

* Fix/send bank denom (#201)

* feat: fix send bank token on same chain

* feat: wallet switch close modal (#202)

* feat: wallet switch close modal

* fix: navigate back to wallet upon wallet switch

* chore: merge main (#206)

* fix: lunc display (#204)

* fix: decouple ibc lunc from luna

* fix: ibc luna (#205)

* fix: ibc luna

* chore: merge main (#211)

* fix: lunc display (#204)

* fix: decouple ibc lunc from luna

* fix: ibc luna (#205)

* fix: ibc luna

* fix: luna send (#207)

* fix: LUNC & LUNA decoupling on testnet, mainnet, localterra
* fix: Error message upon failed price endpoint response
* fix: Vesting token display

---------

Co-authored-by: Michael Merz <mwmerz@protonmail.com>

---------

Co-authored-by: Michael Merz <mwmerz@protonmail.com>

* Show disabled network name and icon (#214)

* Use new IBC channels (#217)

* Use new IBC channels (for direct chain-to-chain transfers)

* cleanup imports

* Remove axelar tokens warning

* fix ibc path detection for multi-hop ibc denoms

* fix send back feature

* ST-580: add dev mode on extension (#216)

* Add dev settings on the extension

* remove reference to contract page

* fix auto-merge error

* Fix asset list (#219)

* fix ibc lunc

* fix LUNC detection

* fix undefined chainID

* same changes as web

* fix: main merge conflict (#221)

* fix: lunc display (#204)

* fix: decouple ibc lunc from luna

* fix: ibc luna (#205)

* fix: ibc luna

* fix: luna send (#207)

* fix: LUNC & LUNA decoupling on testnet, mainnet, localterra
* fix: Error message upon failed price endpoint response
* fix: Vesting token display

---------

Co-authored-by: Michael Merz <mwmerz@protonmail.com>

---------

Co-authored-by: Michael Merz <mwmerz@protonmail.com>

* Update dependencies (#213)

* Update feather.js, remove wallet-provider

* fix: remove log

* remove unused imports

---------

Co-authored-by: Manuel Alessandro Collazo <collazo.manuel6@gmail.com>

* Fix/improve persistent worker (#212)

* remove reconnect listener, restore alarm

* fix: light theme. bg color for mobile and full page (#222)

* feat: St 543 implement amplitude (#218)

* wip: amplitude tracking revisions

* feat: track latest tx event

* fix: add versioning to amplitude client

* fix: versioning

---------

Co-authored-by: Michael Merz <mwmerz@protonmail.com>

* fix: testnet finder links (#225)

* fix ibc token denoms (#226)

* fix lock wallet crash (#230)

* ST-596: fix ics20 send back (#229)

* Fix ICS20 send back

* fix ICS20 denom calculation

* Copy SendBack page from web

* fix gas adjustment for ibc transfers

* fix ics20 gas error (#231)

* fix ics20 gas error

* lower gas adjustment

* fix kujira factory IBC tokens (#233)

* fix kujira factory IBC tokens

* fix send back and use prefix to detect kujira

* chore: update version (#238)

---------

Co-authored-by: Manuel Alessandro Collazo <collazo.manuel6@gmail.com>
Co-authored-by: Alessandro Candeago <54709706+alecande11@users.noreply.github.com>
Co-authored-by: Terence Lim <terencelimz@gmail.com>
Co-authored-by: Joshua <joshua.brigati@gmail.com>
Co-authored-by: plubber <51789398+ericHgorski@users.noreply.github.com>
  • Loading branch information
6 people authored Jul 12, 2023
1 parent 2932923 commit 8f41438
Show file tree
Hide file tree
Showing 109 changed files with 1,300 additions and 1,345 deletions.
983 changes: 227 additions & 756 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@
"analyze": "source-map-explorer 'build/static/js/*.js'"
},
"dependencies": {
"@amplitude/analytics-browser": "^2.1.2",
"@anchor-protocol/anchor.js": "^5.1.1",
"@ledgerhq/hw-transport-web-ble": "^6.27.1",
"@mui/icons-material": "^5.8.0",
"@mui/material": "^5.9.1",
"@sentry/react": "^7.53.1",
"@terra-money/feather.js": "^1.0.6",
"@terra-money/feather.js": "^1.0.8",
"@terra-money/ledger-station-js": "^1.3.7",
"@terra-money/log-finder-ruleset": "^3.0.3",
"@terra-money/msg-reader": "^3.0.1",
"@terra-money/terra-utils": "^1.0.9",
"@terra-money/terra.js": "^3.1.9",
"@terra-money/terra.proto": "^2.0.0",
"@terra-money/use-wallet": "^4.0.0-beta.3",
"@terra-money/wallet-provider": "^4.0.0-beta.3",
"@tippyjs/react": "^4.2.6",
"axios": "^0.27.2",
"bech32": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion public/firefox.manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Station Wallet",
"version": "7.2.10.2",
"version": "7.3.0.1",
"background": {
"scripts": ["background.js"],
"persistent": true
Expand Down
2 changes: 1 addition & 1 deletion public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Station Wallet",
"version": "7.2.10.2",
"version": "7.3.0.1",
"background": {
"service_worker": "background.js",
"type": "module"
Expand Down
1 change: 1 addition & 0 deletions scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ const capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1)
// Invoke alarm periodically to keep service worker persistent
browser.alarms.create("keep-alive-alarm", {
periodInMinutes: 0.25,
delayInMinutes: 0.25,
})

browser.alarms.onAlarm.addListener((alarm) => {
Expand Down
19 changes: 0 additions & 19 deletions scripts/contentScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,25 +211,6 @@ async function setupStreams() {

extensionStream.pipe(pageStream)
pageStream.pipe(extensionStream)

extensionPort.onDisconnect.addListener((port) => {
reconnectStream(pageStream)
})
}

async function reconnectStream(pageStream) {
const extensionPort = extension.runtime.connect({
name: "TerraStationExtension",
})

const extensionStream = new PortStream(extensionPort)

extensionStream.pipe(pageStream)
pageStream.pipe(extensionStream)

extensionPort.onDisconnect.addListener((port) => {
reconnectStream(pageStream)
})
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/app/InitChains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const InitChains = ({ children }: PropsWithChildren<{}>) => {
.get("/denoms.json", { baseURL: STATION_ASSETS })
.then(({ data }) => setWhitelist(data))
axios
.get("/ibc.json", { baseURL: STATION_ASSETS })
.get("/ibc_tokens.json", { baseURL: STATION_ASSETS })
.then(({ data }) => setIbcDenoms(data))
axios
.get("/station/coins.json", { baseURL: ASSETS })
Expand Down
23 changes: 13 additions & 10 deletions src/app/InitNetworks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useCustomChains, useCustomLCDs } from "utils/localStorage"
import { useValidNetworks } from "data/queries/tendermint"
import { WithFetching } from "components/feedback"
import { combineState } from "data/query"
import { InterchainNetworks } from "types/network"

export const [useNetworks, NetworksProvider] = createContext<{
networks: InterchainNetworks
Expand Down Expand Up @@ -52,12 +53,14 @@ const InitNetworks = ({ children }: PropsWithChildren<{}>) => {
}, [])

const testBase = networks
? Object.values({
...networks.mainnet,
...networks.testnet,
...networks.classic,
}).map((chain) => {
const lcd = customLCDs[chain.chainID] ?? chain.lcd
? Object.values(
{
...networks.mainnet,
...networks.testnet,
...networks.classic,
} ?? {}
).map((chain) => {
const lcd = customLCDs[chain?.chainID] ?? chain.lcd
return { ...chain, lcd }
})
: []
Expand All @@ -81,16 +84,16 @@ const InitNetworks = ({ children }: PropsWithChildren<{}>) => {
networksLoading: validationState.isLoading,
filterEnabledNetworks: (networks) =>
Object.fromEntries(
Object.entries(networks).filter(
Object.entries(networks ?? {}).filter(
([chainID]) =>
chainID === "localterra" || validNetworks.includes(chainID)
)
) ?? {}
),
filterDisabledNetworks: (networks) =>
Object.fromEntries(
Object.entries(networks).filter(
Object.entries(networks ?? {}).filter(
([chainID]) => !validNetworks.includes(chainID)
)
) ?? {}
),
}}
>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/AddressTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const AddressTable = (props: Props) => {

const addressData = useMemo(
() =>
Object.keys(addresses)
Object.keys(addresses ?? {})
.map((key) => ({
address: addresses?.[key],
chainName: getChainNamefromID(key, networks) ?? key,
Expand Down
2 changes: 1 addition & 1 deletion src/app/containers/TxMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const TerraAddress = ({ children: address }: { children: string }) => {
const addresses = useInterchainAddresses()

const name = useMemo(() => {
if (addresses && Object.values(addresses).includes(address))
if (addresses && Object.values(addresses ?? {}).includes(address))
return "my wallet" // Do not translate this
if (!(contracts && tokens)) return
const contract = contracts[address] ?? tokens[address]
Expand Down
25 changes: 25 additions & 0 deletions src/app/sections/AdvancedSettings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { useDevMode } from "utils/localStorage"
import SettingsSelectorToggle from "components/layout/SettingsSelectorToggle"
import { FlexColumn, GasAdjustment } from "components/layout"
import { TooltipIcon } from "components/display"
import { DevModeTooltip } from "./DevModeTooltips"

const AdvancedSettings = () => {
const { devMode, changeDevMode } = useDevMode()
const options = [
{ value: "devMode", selected: devMode, label: "Developer Mode" },
]

return (
<FlexColumn gap={10}>
<SettingsSelectorToggle
onChange={changeDevMode}
extra={<TooltipIcon content={<DevModeTooltip />} />}
options={options}
/>
<GasAdjustment />
</FlexColumn>
)
}

export default AdvancedSettings
15 changes: 0 additions & 15 deletions src/app/sections/ConnectWallet.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useTranslation } from "react-i18next"
import UsbIcon from "@mui/icons-material/Usb"
import { useWallet } from "@terra-money/wallet-provider"
import { STATION } from "config/constants"
import { RenderButton } from "types/components"
import { useAddress } from "data/wallet"
Expand All @@ -20,8 +19,6 @@ interface Props {
const ConnectWallet = ({ renderButton }: Props) => {
const { t } = useTranslation()

const { connect, availableConnections, availableInstallations } = useWallet()

const { available } = useAuth()

const address = useAddress()
Expand All @@ -34,23 +31,11 @@ const ConnectWallet = ({ renderButton }: Props) => {
)

const list = [
...availableConnections
.filter(({ type }) => type !== "READONLY")
.map(({ type, identifier, name, icon }) => ({
src: icon,
children: name,
onClick: () => connect(type, identifier),
})),
{
icon: <UsbIcon />,
to: "/auth/ledger",
children: t("Access with ledger"),
},
...availableInstallations.map(({ name, icon, url }) => ({
src: icon,
children: t(`Install ${name}`),
href: url,
})),
]

return (
Expand Down
10 changes: 5 additions & 5 deletions src/app/sections/Connected.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import QrCodeIcon from "@mui/icons-material/QrCode"
import UsbIcon from "@mui/icons-material/Usb"
import BluetoothIcon from "@mui/icons-material/Bluetooth"
import { truncate } from "@terra-money/terra-utils"
import { useWallet } from "@terra-money/wallet-provider"
import { useAddress } from "data/wallet"
import { useTnsName } from "data/external/tns"
import { Button, Copy } from "components/general"
Expand All @@ -23,7 +22,6 @@ import AddressTable from "app/components/AddressTable"

const Connected = () => {
const { t } = useTranslation()
const { disconnect } = useWallet()
const address = useAddress()
const { wallet, getLedgerKey } = useAuth()
const { data: name } = useTnsName(address ?? "")
Expand All @@ -34,9 +32,11 @@ const Connected = () => {

if (!address) return null

const footer = wallet
? { to: "/auth", onClick: closePopover, children: t("Manage wallets") }
: { onClick: disconnect, children: t("Disconnect") }
const footer = {
to: "/auth",
onClick: closePopover,
children: t("Manage wallets"),
}

return (
<Popover
Expand Down
26 changes: 26 additions & 0 deletions src/app/sections/DevModeTooltips.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { useTranslation } from "react-i18next"

export const DevModeTooltip = () => {
const { t } = useTranslation()

return (
<article>
<h1>{t("Developer mode enables the following")}:</h1>
<ul>
<li>{t("Copy token addresses from your wallet")}</li>
</ul>
</article>
)
}
export const GasAdjustmentTooltip = () => {
const { t } = useTranslation()
return (
<article>
<p>
{t(
"Set a gas adjustment coefficient in case none is specified by the chain"
)}
</p>
</article>
)
}
2 changes: 1 addition & 1 deletion src/app/sections/LCDSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const LCDSetting = () => {
/>
</FormItem>

<FormItem label={t("Chain")} error={errors.chainID?.message}>
<FormItem label={t("Chain")} error={errors?.chainID?.message}>
<ChainSelector
chainsList={networksList}
value={chainID}
Expand Down
2 changes: 1 addition & 1 deletion src/app/sections/LanguageSetting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const LanguageSetting = () => {

return (
<SettingsSelector
options={Object.values(Languages)}
options={Object.values(Languages ?? {})}
value={i18n.language}
onChange={(language) => i18n.changeLanguage(language)}
/>
Expand Down
9 changes: 9 additions & 0 deletions src/app/sections/LatestTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { Modal, LoadingCircular } from "components/feedback"
import { Flex } from "components/layout"
import TxMessage from "../containers/TxMessage"
import styles from "./LatestTx.module.scss"
import { createAmplitudeClient } from "utils/analytics/setupAmplitude"
import { AnalyticsEvent } from "utils/analytics"

const { createActionRuleSet, getTxCanonicalMsgs, createLogMatcherForActions } =
ruleset
Expand All @@ -33,6 +35,7 @@ const TxIndicator = ({ txhash }: { txhash: string }) => {
const { t } = useTranslation()
const navigate = useNavigate()
const animation = useThemeAnimation()
const amplitude = createAmplitudeClient()

const [latestTx, setLatestTx] = useRecoilState(latestTxState)
const [minimized, setMinimized] = useState(false)
Expand All @@ -56,6 +59,12 @@ const TxIndicator = ({ txhash }: { txhash: string }) => {
if (status === Status.SUCCESS) onSuccess?.()
}, [status, onSuccess])

useEffect(() => {
if (status !== Status.LOADING) {
amplitude.trackEvent(AnalyticsEvent.TRANSACTION, { status })
}
}, [status, amplitude])

/* render component */
const icon = {
[Status.LOADING]: <LoadingCircular size={36} thickness={2} />,
Expand Down
4 changes: 4 additions & 0 deletions src/app/sections/Preferences.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
.button__container {
width: 100%;
}

.advanced {
margin-top: 30px;
}
Loading

0 comments on commit 8f41438

Please sign in to comment.