Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Release release-20240923-145503 #76

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@leapwallet/cosmos-wallet-provider": "*",
"@leapwallet/cosmos-wallet-sdk": "*",
"@leapwallet/cosmos-wallet-store": "*",
"@leapwallet/elements-core": "1.4.1",
"@leapwallet/elements-hooks": "1.4.1",
"@leapwallet/elements-core": "1.6.0",
"@leapwallet/elements-hooks": "1.6.0",
"@leapwallet/leap-ui": "0.1.35",
"@leapwallet/name-matcha": "1.11.0",
"@leapwallet/parser-parfait": "0.7.0",
Expand Down Expand Up @@ -117,7 +117,6 @@
"@babel/preset-react": "7.16.7",
"@jest/globals": "29.5.0",
"@sentry/webpack-plugin": "1.20.0",
"@skip-router/core": "5.2.1",
"@types/chrome": "0.0.269",
"@types/crypto-js": "4.1.1",
"@types/dompurify": "3.0.5",
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/public/base_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "__NAME__",
"description": "__DESCRIPTION__",
"version": "0.14.7",
"version": "0.14.9",
"options_page": "index.html#/home",
"web_accessible_resources": [
{
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/public/compass/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Compass Wallet for Sei",
"description": "A crypto wallet for Sei Blockchain, brought to you by the Leap Wallet team.",
"version": "0.14.7",
"version": "0.14.8",
"options_page": "index.html#/home",
"web_accessible_resources": [
{
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/public/leap-cosmos/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "Leap Cosmos Wallet",
"description": "A crypto wallet for Cosmos blockchains.",
"version": "0.14.7",
"version": "0.14.9",
"options_page": "index.html#/home",
"web_accessible_resources": [
{
Expand Down
3 changes: 0 additions & 3 deletions apps/extension/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ import {
useInitCompassSeiEvmConfig,
useInitCustomChannelsStore,
useInitDefaultGasEstimates,
useInitDisabledCW20Tokens,
useInitDisabledNFTsCollections,
useInitEnabledCW20Tokens,
useInitEnabledNftsCollections,
useInitFeeDenoms,
useInitFractionalizedNftContracts,
useInitGasAdjustments,
useInitGasPriceSteps,
useInitIbcTraceStore,
useInitInteractedTokens,
useInitIteratedUriNftContracts,
useInitKadoBuyChains,
useInitNftChains,
Expand Down
6 changes: 3 additions & 3 deletions apps/extension/src/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ import { useInitAnalytics } from 'hooks/analytics/useInitAnalytics'
import useActiveWallet from 'hooks/settings/useActiveWallet'
import { useAirdropsData } from 'hooks/useAirdropsData'
import { AddEvmLedger, AddEvmTitle } from 'pages/onboarding/import/AddEvmLedger'
import { lazy, Suspense, useEffect } from 'react'
import React from 'react'
import React, { lazy, Suspense, useEffect } from 'react'
import { HashRouter, Route, Routes } from 'react-router-dom'
import { useRecoilValue } from 'recoil'
import { chainTagsStore } from 'stores/chain-infos-store'
import { denomsStore, rootDenomsStore } from 'stores/denoms-store-instance'
import { rootBalanceStore, rootStakeStore } from 'stores/root-store'
import { rootBalanceStore, rootStakeStore, rootStore } from 'stores/root-store'
import {
claimRewardsStore,
delegationsStore,
Expand Down Expand Up @@ -311,6 +310,7 @@ export default function AppRoutes(): JSX.Element {
unDelegationsStore={unDelegationsStore}
claimRewardsStore={claimRewardsStore}
rootBalanceStore={rootBalanceStore}
nmsStore={rootStore.nmsStore}
/>
</RequireAuth>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { observer } from 'mobx-react-lite'
import React, { useCallback, useEffect, useMemo } from 'react'
import { useNavigate } from 'react-router-dom'
import { Colors } from 'theme/colors'
import { isCompassWallet } from 'utils/isCompassWallet'

type AutoAdjustAmountSheetProps = {
onCancel: () => void
Expand Down Expand Up @@ -103,7 +104,7 @@ const OptionalAutoAdjustAmountSheet: React.FC<
</Buttons.Generic>

<Buttons.Generic
color={Colors.green600}
color={isCompassWallet() ? Colors.compassPrimary : Colors.green600}
size='normal'
className='w-full'
title='Proceed'
Expand Down Expand Up @@ -202,7 +203,7 @@ const CompulsoryAutoAdjustAmountSheet: React.FC<
</Buttons.Generic>

<Buttons.Generic
color={Colors.green600}
color={isCompassWallet() ? Colors.compassPrimary : Colors.green600}
size='normal'
className='w-full'
title='Proceed'
Expand Down
1 change: 0 additions & 1 deletion apps/extension/src/components/bottom-nav/BottomNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
Tag,
Wallet,
} from '@phosphor-icons/react'
import { CurrencyCircleDollar } from '@phosphor-icons/react/dist/ssr'
import classNames from 'classnames'
import { LEAPBOARD_URL } from 'config/constants'
import { useActiveChain } from 'hooks/settings/useActiveChain'
Expand Down
26 changes: 24 additions & 2 deletions apps/extension/src/components/gas-price-options/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ const GasPriceOptions = observer(
const chainInfo = chains[activeChain as SupportedChain]
const evmBalance = evmBalanceStore.evmBalanceForChain(activeChain)
let allTokens = rootBalanceStore.getSpendableBalancesForChain(activeChain)
const allTokensLoading = rootBalanceStore.getLoadingStatusForChain(activeChain)

allTokens = useMemo(() => {
if (
Expand All @@ -230,6 +231,26 @@ const GasPriceOptions = observer(
isSelectedTokenEvm,
])

const allTokensStatus = useMemo(() => {
if (
(isSeiEvmChain && isSelectedTokenEvm && !['done', 'unknown'].includes(addressLinkState)) ||
chainInfo?.evmOnlyChain
) {
if (evmBalance?.status === 'loading' || allTokensLoading) {
return 'loading'
}
return 'success'
}
return allTokensLoading ? 'loading' : 'success'
}, [
addressLinkState,
allTokensLoading,
chainInfo?.evmOnlyChain,
evmBalance?.status,
isSeiEvmChain,
isSelectedTokenEvm,
])

const { data: feeTokensList, isLoading: isFeeTokensListLoading } = useFeeTokens(
allTokens,
denoms,
Expand Down Expand Up @@ -394,7 +415,7 @@ const GasPriceOptions = observer(
useEffect(() => {
const gasPriceBN = new BigNumber(gasPriceOption.gasPrice.amount.toFloatApproximation())
// if the dapp has specified a fee granter or has set disableFeeCheck on SignOptions, the fees is being paid by the dapp we ignore the fee asset balance checks
if (disableBalanceCheck || gasPriceBN.isZero()) {
if (disableBalanceCheck || gasPriceBN.isZero() || allTokensStatus === 'loading') {
setError(null)
return
}
Expand Down Expand Up @@ -429,6 +450,7 @@ const GasPriceOptions = observer(

// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
allTokensStatus,
feeTokenAsset,
feeTokenData,
gasAdjustment,
Expand Down Expand Up @@ -568,7 +590,7 @@ const GasPriceOptions = observer(
feeTokenAsset,
allTokens,
//TODO: remove this
allTokensStatus: 'success',
allTokensStatus,
userHasSelectedToken,
setUserHasSelectedToken,
considerGasAdjustment: considerGasAdjustment,
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/src/components/radio-group/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import classNames from 'classnames'
import React, { CSSProperties, useCallback } from 'react'
import React, { CSSProperties } from 'react'

type RadioGroupProps = {
options: { title: string; subTitle?: string; value: string }[]
Expand Down
8 changes: 4 additions & 4 deletions apps/extension/src/content-scripts/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ function initEvm(leapEvm: Ethereum, isCompass: boolean) {
}
}

if (!window.ethereum) {
leapEvm.isMetaMask = true
window.ethereum = leapEvm
}
// if (!window.ethereum) {
// leapEvm.isMetaMask = true
// window.ethereum = leapEvm
// }

function announceProvider() {
window.dispatchEvent(
Expand Down
3 changes: 0 additions & 3 deletions apps/extension/src/extension-scripts/pending-swap-tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ async function getTxnStatus(args: { tx_hash: string; chain_id: string }) {
`https://api.skip.money/v1/tx/status?tx_hash=${args.tx_hash}&chain_id=${args.chain_id}`,
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
},
},
)

Expand Down
17 changes: 0 additions & 17 deletions apps/extension/src/extension-scripts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,23 +131,6 @@ export type Page =
| 'switch-ethereum-chain'
| 'suggest-ethereum-chain'

async function getPopup() {
if (popupIds.length === 0) {
return undefined
}
const window = await browser.windows.get(popupIds[0], { populate: true })
return [window]
}

function getPopupInWindows(windows: browser.Windows.Window[] | undefined) {
return windows
? windows.find((window) => {
if (!window.id) return false
return window.type === 'popup' && Object.values(popupIds).includes(window.id)
})
: undefined
}

export async function openPopup(page: Page, queryString?: string) {
let response
try {
Expand Down
3 changes: 1 addition & 2 deletions apps/extension/src/hooks/wallet/useWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import {
SupportedChain,
} from '@leapwallet/cosmos-wallet-sdk'
import getHDPath from '@leapwallet/cosmos-wallet-sdk/dist/browser/utils/get-hdpath'
import { KeyChain } from '@leapwallet/leap-keychain'
import { encrypt } from '@leapwallet/leap-keychain'
import { encrypt, KeyChain } from '@leapwallet/leap-keychain'
import { AGGREGATED_CHAIN_KEY } from 'config/constants'
import {
ACTIVE_CHAIN,
Expand Down
2 changes: 1 addition & 1 deletion apps/extension/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ axios.defaults.headers.common['x-requested-with'] = 'leap-client'
axios.defaults.timeout = 5000

setLeapapiBaseUrl(process.env.LEAP_WALLET_BACKEND_API_URL as string)
setBaseURL(process.env.LEAP_WALLET_BACKENT_API_URL as string)
setBaseURL(process.env.LEAP_WALLET_BACKEND_API_URL as string)
setNumiaBannerBearer(process.env.NUMIA_BANNER_BEARER ?? '')
setIsCompass(isCompassWallet())
setPlatformType(PLATFORM_TYPE.Extension)
Expand Down
1 change: 1 addition & 0 deletions apps/extension/src/pages/activity/PendingTx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ const PendingTx = observer(({ rootBalanceStore, rootStakeStore }: PendingTxProps
const { explorerTxnUrl: txnUrl } = useGetExplorerTxnUrl({
forceTxHash: txHash,
forceChain: activeChain,
forceNetwork: selectedNetwork,
})

const isSendTxn = txType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
UndelegationsStore,
ValidatorsStore,
} from '@leapwallet/cosmos-wallet-store'
import { useSkipAssets } from '@leapwallet/elements-hooks'
import { useAllSkipAssets } from '@leapwallet/elements-hooks'
import { CardDivider, Header, HeaderActionType } from '@leapwallet/leap-ui'
import {
Expand Down Expand Up @@ -68,7 +69,6 @@ import { imgOnError } from 'utils/imgOnError'
import { capitalize } from 'utils/strings'

import ChartSkeleton from '../chart-skeleton/ChartSkeleton'
import DefiList from '../defi-list'
import { TokensChart } from './token-chart'

type TokenCTAsProps = {
Expand Down Expand Up @@ -521,7 +521,7 @@ const TokensDetails = observer(
setShowStakeSelectSheet(true)
}}
isStakeDisabled={
activeStakingDenom.coinDenom !== denomInfo?.coinDenom ||
activeStakingDenom?.coinDenom !== denomInfo?.coinDenom ||
!!chainInfos[activeChain].evmOnlyChain
}
onReceiveClick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ export const ProposalDetails = observer(
return data
} catch (error: any) {
try {
const prefix = activeChainInfo?.chainId === 'govgen-1' ? '/govgen' : '/cosmos'
const data = await axiosWrapper(
{
baseURL: lcdUrl ?? '',
method: 'get',
url: `/cosmos/gov/v1beta1/proposals/${selectedProp}/votes/${address}`,
url: `${prefix}/gov/v1beta1/proposals/${selectedProp}/votes/${address}`,
},
1,
'proposals-votes',
Expand Down
1 change: 0 additions & 1 deletion apps/extension/src/pages/home/AddFromChainStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import mixpanel from 'mixpanel-browser'
import React, { useState } from 'react'
import { useNavigate } from 'react-router'
import { useSetRecoilState } from 'recoil'
import { chainInfoStore } from 'stores/chain-infos-store'
import { rootStore } from 'stores/root-store'
import { Colors } from 'theme/colors'
import { imgOnError } from 'utils/imgOnError'
Expand Down
1 change: 0 additions & 1 deletion apps/extension/src/pages/home/PendingSwapsSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ActivityCardContent, ActivityType } from '@leapwallet/cosmos-wallet-hooks'
import { SKIP_TXN_STATUS } from '@leapwallet/elements-core'
import { Buttons } from '@leapwallet/leap-ui'
import BottomModal from 'components/bottom-modal'
import { ActivityCard } from 'pages/activity/components/ActivityCard'
import React, { Dispatch, SetStateAction } from 'react'
Expand Down
3 changes: 2 additions & 1 deletion apps/extension/src/pages/home/SelectChain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ export const ListChains = observer(
if (
(isCompassWallet() && chain.chainName === 'cosmos') ||
!chain.active ||
(onPage === 'AddCollection' && ['omniflix', 'stargaze'].includes(chain.chainName))
(onPage === 'AddCollection' &&
['omniflix', 'stargaze', 'forma'].includes(chain.chainName))
) {
return false
}
Expand Down
20 changes: 9 additions & 11 deletions apps/extension/src/pages/home/components/HomeButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,15 @@ export function HomeButtons({ setShowReceiveSheet }: HomeButtonsProps) {
) : null}

{/* NFTs Button */}
{!chain?.evmOnlyChain ? (
<ClickableIcon
label='NFTs'
icon={
<div className='bg-white-100 h-5 w-5 rounded-full flex items-center justify-center'>
<Star size={12} weight='fill' className='text-black-100' />
</div>
}
onClick={() => handleNftsClick()}
/>
) : null}
<ClickableIcon
label='NFTs'
icon={
<div className='bg-white-100 h-5 w-5 rounded-full flex items-center justify-center'>
<Star size={12} weight='fill' className='text-black-100' />
</div>
}
onClick={() => handleNftsClick()}
/>
</div>
)
}
5 changes: 3 additions & 2 deletions apps/extension/src/pages/nfts-v2/NFTs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NftPage } from '@leapwallet/cosmos-wallet-hooks'
import { NftPage, useAddress } from '@leapwallet/cosmos-wallet-hooks'
import { PageName } from 'config/analytics'
import { usePageView } from 'hooks/analytics/usePageView'
import React, { useState } from 'react'
Expand All @@ -16,11 +16,12 @@ import {
export default function NFTs() {
usePageView(PageName.NFT)

const address = useAddress()
const [activePage, setActivePage] = useState<NftPage>('ShowNfts')
const value = { activePage, setActivePage }

return (
<NftContextProvider value={value}>
<NftContextProvider value={value} key={address}>
{activePage === 'ShowNfts' && (
<ShowNfts nftStore={nftStore} chainTagsStore={chainTagsStore} />
)}
Expand Down
7 changes: 6 additions & 1 deletion apps/extension/src/pages/nfts-v2/components/CantSeeNfts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ export function CantSeeNfts({ openAddCollectionSheet, className }: CantSeeNftsPr
account: `https://omniflix.market/account/${activeWallet?.addresses.omniflix}/nfts`,
}

return [stargaze, omniflix]
const forma = {
title: 'Forma',
account: `https://modularium.art/my-collection`,
}

return [stargaze, omniflix, forma]
}, [
activeWallet?.addresses.omniflix,
activeWallet?.addresses.seiTestnet2,
Expand Down
Loading
Loading