Skip to content

Commit

Permalink
merge: remote-tracking branch 'origin/main' into refactor/firefox-cha…
Browse files Browse the repository at this point in the history
…nge-building
  • Loading branch information
kogeletey committed Jan 30, 2024
2 parents b5cc715 + 8e74e16 commit 3376789
Show file tree
Hide file tree
Showing 83 changed files with 542 additions and 385 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ body:
label: Version
description: What version of the extension are you running?
options:
- v0.56.0
- v0.55.0
- v0.54.0
- v0.53.1
- v0.53.0
Expand Down
1 change: 1 addition & 0 deletions background/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export type AssetMetadata = {
* legitimate asset.
*/
verified?: boolean
removed?: boolean
}

/**
Expand Down
14 changes: 4 additions & 10 deletions background/constants/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const CHAIN_ID_TO_0X_API_BASE: {
[POLYGON.chainID]: "polygon.api.0x.org",
[OPTIMISM.chainID]: "optimism.api.0x.org",
[GOERLI.chainID]: "goerli.api.0x.org",
// TODO: Add Swap API for Sepolia once 0x supports it.
[SEPOLIA.chainID]: "sepolia.api.0x.org",
[ARBITRUM_ONE.chainID]: "arbitrum.api.0x.org",
[AVALANCHE.chainID]: "avalanche.api.0x.org",
[BINANCE_SMART_CHAIN.chainID]: "bsc.api.0x.org",
Expand All @@ -197,15 +197,9 @@ export const NETWORKS_SUPPORTING_SWAPS = new Set(
)

export const ALCHEMY_SUPPORTED_CHAIN_IDS = new Set(
[
ETHEREUM,
POLYGON,
ARBITRUM_ONE,
OPTIMISM,
GOERLI,
SEPOLIA,
ARBITRUM_SEPOLIA,
].map((network) => network.chainID),
[ETHEREUM, POLYGON, ARBITRUM_ONE, OPTIMISM, GOERLI, SEPOLIA].map(
(network) => network.chainID,
),
)

export const FLASHBOTS_SUPPORTED_CHAIN_IDS = new Set([ETHEREUM.chainID])
Expand Down
6 changes: 5 additions & 1 deletion background/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,15 @@ export default class Main extends BaseService<never> {
this.store.dispatch(updateAccountName({ ...addressOnNetwork, name }))
},
)

this.nameService.emitter.on(
"resolvedAvatar",
async ({ from: { addressOnNetwork }, resolved: { avatar } }) => {
this.store.dispatch(
updateENSAvatar({ ...addressOnNetwork, avatar: avatar.toString() }),
updateENSAvatar({
...addressOnNetwork,
avatar: avatar.toString(),
}),
)
},
)
Expand Down
4 changes: 3 additions & 1 deletion background/redux-slices/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ const accountSlice = createSlice({
immerState,
{
payload: { address, network, avatar },
}: { payload: AddressOnNetwork & { avatar: URI } },
}: {
payload: AddressOnNetwork & { avatar: URI }
},
) => {
const normalizedAddress = normalizeEVMAddress(address)

Expand Down
6 changes: 4 additions & 2 deletions background/redux-slices/selectors/accountsSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ function getNetworkAccountTotalsByCategory(
}
}

const { name, avatarURL } = accountData.ens

return {
address,
network,
Expand All @@ -466,8 +468,8 @@ function getNetworkAccountTotalsByCategory(
signerId,
path,
accountSigner,
name: accountData.ens.name ?? accountData.defaultName,
avatarURL: accountData.ens.avatarURL ?? accountData.defaultAvatar,
name: name ?? accountData.defaultName,
avatarURL: avatarURL ?? accountData.defaultAvatar,
localizedTotalMainCurrencyAmount: formatCurrencyAmount(
mainCurrencySymbol,
getTotalBalance(accountData.balances, prices, mainCurrencySymbol),
Expand Down
3 changes: 0 additions & 3 deletions background/services/chain/taho-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ export default class TahoAlchemyProvider extends AlchemyProvider {
case 11155111: // Ethereum Sepolia
host = "eth-sepolia.g.alchemy.com/v2/"
break
case 421614: // Arbitrum Sepolia
host = "arb-sepolia.g.alchemy.com/v2/"
break
default:
return AlchemyProvider.getUrl(network, apiKey)
}
Expand Down
11 changes: 11 additions & 0 deletions background/services/indexing/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,17 @@ export class IndexingDatabase extends Dexie {
).filter((asset) => asset?.metadata?.removed !== true)
}

async getRemovedCustomAssetsByNetworks(
networks: EVMNetwork[],
): Promise<CustomAsset[]> {
return (
await this.customAssets
.where("homeNetwork.chainID")
.anyOf(networks.map((network) => network.chainID))
.toArray()
).filter((asset) => asset?.metadata?.removed === true)
}

async getCustomAssetByAddressAndNetwork(
network: EVMNetwork,
contractAddress: string,
Expand Down
13 changes: 12 additions & 1 deletion background/services/indexing/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import {
isBaselineTrustedAsset,
isUnverifiedAsset,
isTrustedAsset,
isSameAsset,
} from "../../redux-slices/utils/asset-utils"

// Transactions seen within this many blocks of the chain tip will schedule a
Expand Down Expand Up @@ -562,6 +563,10 @@ export default class IndexingService extends BaseService<Events> {
return acc
}, {})

const removedCustomAssets = await this.db.getRemovedCustomAssetsByNetworks([
addressNetwork.network,
])

// look up all assets and set balances
const unfilteredAccountBalances = await Promise.allSettled(
balances.map(async ({ smartContract: { contractAddress }, amount }) => {
Expand Down Expand Up @@ -603,7 +608,13 @@ export default class IndexingService extends BaseService<Events> {

const accountBalances = unfilteredAccountBalances.reduce<AccountBalance[]>(
(acc, current) => {
if (current.status === "fulfilled" && current.value) {
if (
current.status === "fulfilled" &&
current.value &&
!removedCustomAssets.some((asset) =>
isSameAsset(asset, current.value?.assetAmount.asset),
)
) {
return [...acc, current.value]
}
return acc
Expand Down
16 changes: 8 additions & 8 deletions e2e-tests/regular/transactions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test, expect } from "../utils"
import { account2 } from "../utils/onboarding"

test.describe("Transactions", () => {
test("User can send base asset (on Goerli testnet) @expensive", async ({
test("User can send base asset (on Sepolia testnet) @expensive", async ({
page: popup,
walletPageHelper,
transactionsHelper,
Expand Down Expand Up @@ -45,15 +45,15 @@ test.describe("Transactions", () => {
.click()

/**
* Switch to Goerli testnet.
* Switch to Sepolia testnet.
*/
await popup.getByTestId("top_menu_network_switcher").last().click()
await popup
.getByText(/^Ethereum Goerli$/)
.getByText(/^Ethereum Sepolia$/)
.last()
.click()
await walletPageHelper.assertCommonElements(
/^Ethereum Goerli$/,
/^Ethereum Sepolia$/,
true,
account2.name,
)
Expand Down Expand Up @@ -82,7 +82,7 @@ test.describe("Transactions", () => {
* isn't active.
*/
await transactionsHelper.assertUnfilledSendAssetScreen(
/^Ethereum Goerli$/,
/^Ethereum Sepolia$/,
account2.name,
"ETH",
"(\\d|,)+(\\.\\d{0,4})*",
Expand Down Expand Up @@ -118,7 +118,7 @@ test.describe("Transactions", () => {
* Check if "Transfer" has opened and verify elements on the page.
*/
await transactionsHelper.assertTransferScreen(
"Ethereum Goerli",
"Ethereum Sepolia",
"testertesting\\.eth",
"0x47745a7252e119431ccf973c0ebd4279638875a6",
"0x4774…875a6",
Expand Down Expand Up @@ -150,7 +150,7 @@ test.describe("Transactions", () => {
*/
await expect(popup.getByTestId("activity_list")).toHaveCount(1)
await assetsHelper.assertAssetDetailsPage(
/^Ethereum Goerli$/,
/^Ethereum Sepolia$/,
account2.name,
/^ETH$/,
/^(\d|,)+(\.\d{0,4})*$/,
Expand Down Expand Up @@ -207,7 +207,7 @@ test.describe("Transactions", () => {
* Verify elements on the activity screen
*/
await walletPageHelper.assertCommonElements(
/^Ethereum Goerli$/,
/^Ethereum Sepolia$/,
true,
account2.name,
)
Expand Down
2 changes: 1 addition & 1 deletion manifest/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Taho",
"version": "0.54.0",
"version": "0.56.0",
"description": "The community owned and operated Web3 wallet.",
"homepage_url": "https://taho.xyz",
"author": "https://taho.xyz",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tallyho/tally-extension",
"private": true,
"version": "0.54.0",
"version": "0.56.0",
"description": "Taho, the community owned and operated Web3 wallet.",
"main": "index.js",
"repository": "git@github.com:thesis/tally-extension.git",
Expand Down
6 changes: 5 additions & 1 deletion ui/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@
"networksBanner": "Not seeing NFTs from all your networks? Activate a network by switching to it on the Wallet tab.",
"filters": {
"title": "Filter collections",
"tooltip": "Filter",
"warning": "Changing filters here will affect your Portfolio page as well.",
"sortType": {
"priceDesc": "Floor price: Descending",
Expand Down Expand Up @@ -620,6 +621,7 @@
"connectedWebsitesSettings": {
"title": "Connected websites",
"disconnected": "Website disconnected",
"disconnectTooltip": "Disconnect website",
"ariaLabel": "Manage connected websites",
"emptyList": "Not connected to any websites"
},
Expand Down Expand Up @@ -804,6 +806,7 @@
},
"topMenu": {
"showCurrentDappConnection": "Show current website connection",
"currentDappConnection": "Current website connection",
"connectToWebsiteUsing": "Connect to website using:",
"setTahoAsDefault": "Set Taho as default",
"setOtherAsDefault": "Set MetaMask/other wallet as default",
Expand All @@ -818,6 +821,7 @@
"connectedDappInfo": {
"dAppTitle": "Account connected to",
"dappConnections": "Website connections",
"disconnectDapp": "Disconnect Dapp",
"guideline": {
"title": "How to connect to websites",
"step1": "Connect using Taho",
Expand Down Expand Up @@ -963,7 +967,7 @@
"submitSpamBtn": "Yes, report & delete",
"snackbar": "Ability deleted"
},
"filter": {
"filters": {
"title": "Filter Abilities",
"tooltip": "Filter",
"abilityState": {
Expand Down
7 changes: 4 additions & 3 deletions ui/_locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@
"bugReport": "Informe de errores",
"connectedWebsites": "Sitios Web a los que está conectado",
"connectedWebsitesSettings": {
"ariaLabel": "Administrar sitios web conectados",
"title": "Sitios web a los que está conectado",
"disconnected": "Sitios web desconectados",
"emptyList": "No está conectado a ningún sitio web",
"title": "Sitios web a los que está conectado"
"disconnectTooltip": "Desconectar sitios web",
"ariaLabel": "Administrar sitios web conectados",
"emptyList": "No está conectado a ningún sitio web"
},
"enableTestNetworks": "Habilitar redes de prueba",
"exportLogs": {
Expand Down
7 changes: 4 additions & 3 deletions ui/_locales/zh_Hant/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@
"bugReport": "問題回報",
"connectedWebsites": "已連結的網站",
"connectedWebsitesSettings": {
"ariaLabel": "管理已連結的網站",
"title": "已連結的網站",
"disconnected": "網站已斷開",
"emptyList": "尚未與任何網站連結",
"title": "已連結的網站"
"disconnectTooltip": "斷開網站連接",
"ariaLabel": "管理已連結的網站",
"emptyList": "尚未與任何網站連結"
},
"enableTestNetworks": "啟用測試網路",
"exportLogs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function WalletTypeHeader({
toggler={(toggle) => (
<SharedIcon
color="var(--green-40)"
customStyles="cursor: pointer;"
style={{ cursor: "pointer" }}
width={24}
onClick={() => toggle()}
icon="settings.svg"
Expand Down
2 changes: 1 addition & 1 deletion ui/components/Claim/ClaimSuccessModalContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function ClaimSuccessModalContent({
return (
<div className="wrap">
<div className="header_image" />
<div className="header_transaction">Transaction submited</div>
<div className="header_transaction">Transaction submitted</div>
<h1>Share 5% bonus link</h1>
<div className="subtitle">
{`Each time someone uses your bonus link, you'll get 5% of all the DOGGO
Expand Down
32 changes: 23 additions & 9 deletions ui/components/DAppConnection/ActiveDAppConnection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import React, { ReactElement, useCallback, useState } from "react"
import { useTranslation } from "react-i18next"
import { useBackgroundDispatch } from "../../hooks"
import TopMenuConnectedDAppInfo from "../TopMenu/TopMenuConnectedDAppInfo"
import SharedTooltip from "../Shared/SharedTooltip"

type Props = {
isConnectedToDApp: boolean
Expand Down Expand Up @@ -54,16 +55,29 @@ export default function ActiveDAppConnection({
isConnected={isConnectedToDApp}
/>
) : null}
<button
type="button"
aria-label={t("showCurrentDappConnection")}
className="connection_button"
onClick={() => {
setIsActiveDAppConnectionInfoOpen(!isActiveDAppConnectionInfoOpen)
}}
<SharedTooltip
type="dark"
width={160}
horizontalShift={160}
verticalShift={-15}
verticalPosition="bottom"
horizontalPosition="left"
IconComponent={() => (
<button
type="button"
aria-label={t("showCurrentDappConnection")}
className="connection_button"
onClick={() => {
setIsActiveDAppConnectionInfoOpen(!isActiveDAppConnectionInfoOpen)
}}
>
<div className="connection_img" />
</button>
)}
>
<div className="connection_img" />
</button>
{t("currentDappConnection")}
</SharedTooltip>

<style jsx>{`
.connection_button {
width: 32px;
Expand Down
6 changes: 1 addition & 5 deletions ui/components/DAppConnection/DAppConnectionInfoBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,7 @@ function DefaultConnectionPopover({ close }: PopoverProps): ReactElement {
onClick={animateThenClose}
color="var(--green-20)"
hoverColor="var(--white)"
customStyles={`
position: absolute;
top: 16px;
right: 16px;
`}
style={{ position: "absolute", top: 16, right: 16 }}
/>

<h3>{t("title")}</h3>
Expand Down
2 changes: 1 addition & 1 deletion ui/components/NFTs/Filters/NFTsFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default function NFTsFilters(): ReactElement {
display: flex;
flex-direction: column;
gap: 16px;
height: 456px;
height: 471px;
overflow-y: scroll;
padding: 0 24px 8px;
}
Expand Down
Loading

0 comments on commit 3376789

Please sign in to comment.