diff --git a/package-lock.json b/package-lock.json index 86f75f12..29515d59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "xverse-web-extension", - "version": "0.48.3", + "version": "0.49.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "xverse-web-extension", - "version": "0.48.3", + "version": "0.49.0", "dependencies": { "@aryzing/superqs": "0.0.6", "@keystonehq/hw-transport-webusb": "0.5.1", diff --git a/package.json b/package.json index cea2b82d..c588bfb5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "xverse-web-extension", "description": "The Bitcoin Wallet for everyone", - "version": "0.48.3", + "version": "0.49.0", "private": true, "engines": { "node": "^18.18.2" diff --git a/src/app/components/batchPsbtSigning/index.tsx b/src/app/components/batchPsbtSigning/index.tsx index 926774be..368a5a39 100644 --- a/src/app/components/batchPsbtSigning/index.tsx +++ b/src/app/components/batchPsbtSigning/index.tsx @@ -190,6 +190,7 @@ function BatchPsbtSigning({ onSigned, psbts, onCancel, onPostSignDone }: Props) onSigned(signedPsbts); setIsLedgerModalVisible(false); + setIsKeystoneModalVisible(false); } catch (err) { setIsSigning(false); setIsSigningComplete(false); diff --git a/src/app/screens/sendBrc20OneStep/index.tsx b/src/app/screens/sendBrc20OneStep/index.tsx index fe679b2e..bdbe52d2 100644 --- a/src/app/screens/sendBrc20OneStep/index.tsx +++ b/src/app/screens/sendBrc20OneStep/index.tsx @@ -14,7 +14,7 @@ import { } from '@secretkeylabs/xverse-core'; import { isDangerFeedback, type InputFeedbackProps } from '@ui-library/inputFeedback'; import type { Brc20TransferEstimateFeesParams, ConfirmBrc20TransferState } from '@utils/brc20'; -import { isInOptions, replaceCommaByDot } from '@utils/helper'; +import { replaceCommaByDot } from '@utils/helper'; import { getFtTicker } from '@utils/tokens'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; diff --git a/src/app/screens/sendBtc/index.tsx b/src/app/screens/sendBtc/index.tsx index d64974ba..34c09be2 100644 --- a/src/app/screens/sendBtc/index.tsx +++ b/src/app/screens/sendBtc/index.tsx @@ -3,7 +3,6 @@ import useCancellableEffect from '@hooks/useCancellableEffect'; import useCanUserSwitchPaymentType from '@hooks/useCanUserSwitchPaymentType'; import useDebounce from '@hooks/useDebounce'; import { useResetUserFlow } from '@hooks/useResetUserFlow'; -import useSelectedAccount from '@hooks/useSelectedAccount'; import useTransactionContext from '@hooks/useTransactionContext'; import useWalletSelector from '@hooks/useWalletSelector'; import { @@ -12,7 +11,6 @@ import { type KeystoneTransport, type LedgerTransport, } from '@secretkeylabs/xverse-core'; -import { isInOptions } from '@utils/helper'; import { trackMixPanel } from '@utils/mixpanel'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -29,15 +27,12 @@ function SendBtcScreen() { const navigate = useNavigate(); const { t } = useTranslation('translation'); - const isInOption = isInOptions(); - useResetUserFlow('/send-btc'); const { selectedAccountType, btcPaymentAddressType } = useWalletSelector(); const [overridePaymentType, setOverridePaymentType] = useState(btcPaymentAddressType); const { data: btcFeeRate, isLoading: feeRatesLoading } = useBtcFeeRate(); - const selectedAccount = useSelectedAccount(); const transactionContext = useTransactionContext(overridePaymentType); const userCanSwitchPayType = useCanUserSwitchPaymentType(); @@ -119,10 +114,6 @@ function SendBtcScreen() { ); const handleCancel = () => { - if ((selectedAccountType === 'ledger' || selectedAccountType === 'keystone') && isInOption) { - window.close(); - return; - } navigate(`/coinDashboard/BTC`); }; diff --git a/src/app/screens/sendOrdinal/index.tsx b/src/app/screens/sendOrdinal/index.tsx index 4b5522ff..56b76ead 100644 --- a/src/app/screens/sendOrdinal/index.tsx +++ b/src/app/screens/sendOrdinal/index.tsx @@ -13,7 +13,7 @@ import { type LedgerTransport, } from '@secretkeylabs/xverse-core'; import { removeAccountAvatarAction } from '@stores/wallet/actions/actionCreators'; -import { isInOptions, isKeystoneAccount, isLedgerAccount } from '@utils/helper'; +import { isInOptions } from '@utils/helper'; import { trackMixPanel } from '@utils/mixpanel'; import RoutePaths from 'app/routes/paths'; import { useEffect, useState } from 'react'; @@ -120,11 +120,15 @@ function SendOrdinalScreen() { } const handleCancel = () => { - if ((isLedgerAccount(selectedAccount) || isKeystoneAccount(selectedAccount)) && isInOption) { - window.close(); - return; + if (isInOption) { + navigate( + isRareSat + ? `/nft-dashboard/rare-sats-bundle` + : `/nft-dashboard/ordinal-detail/${selectedOrdinal?.id}`, + ); + } else { + navigate(-1); } - navigate(-1); }; const handleBackButtonClick = () => { diff --git a/src/app/screens/sendRune/index.tsx b/src/app/screens/sendRune/index.tsx index 66796a92..f316cb18 100644 --- a/src/app/screens/sendRune/index.tsx +++ b/src/app/screens/sendRune/index.tsx @@ -12,7 +12,6 @@ import { type KeystoneTransport, type LedgerTransport, } from '@secretkeylabs/xverse-core'; -import { isInOptions, isKeystoneAccount, isLedgerAccount } from '@utils/helper'; import { trackMixPanel } from '@utils/mixpanel'; import { getFtBalance } from '@utils/tokens'; import BigNumber from 'bignumber.js'; @@ -25,7 +24,6 @@ import { Step, getPreviousStep } from './steps'; function SendRuneScreen() { const navigate = useNavigate(); - const isInOption = isInOptions(); useResetUserFlow('/send-rune'); @@ -129,10 +127,6 @@ function SendRuneScreen() { } const handleCancel = () => { - if ((isLedgerAccount(selectedAccount) || isKeystoneAccount(selectedAccount)) && isInOption) { - window.close(); - return; - } navigate( `/coinDashboard/FT?ftKey=${fungibleToken.principal}&protocol=${fungibleToken.protocol}`, ); diff --git a/src/app/screens/stacking/stackingProgress/stackingStatusTile.tsx b/src/app/screens/stacking/stackingProgress/stackingStatusTile.tsx index 344bbef0..2f1678e4 100644 --- a/src/app/screens/stacking/stackingProgress/stackingStatusTile.tsx +++ b/src/app/screens/stacking/stackingProgress/stackingStatusTile.tsx @@ -1,7 +1,7 @@ import TokenTicker from '@assets/img/dashboard/stx_icon.svg'; import useStackingData from '@hooks/queries/useStackingData'; import { type StackingState } from '@secretkeylabs/xverse-core'; -import { XVERSE_WEB_POOL_URL } from '@utils/constants'; +import { XVERSE_STACKING_URL } from '@utils/constants'; import { useTranslation } from 'react-i18next'; import { BoldText, @@ -34,7 +34,7 @@ function StackingStatusTile() { })(); const handleOnClick = () => { - window.open(XVERSE_WEB_POOL_URL); + window.open(XVERSE_STACKING_URL); }; return ( diff --git a/src/app/screens/stacking/startStacking/index.tsx b/src/app/screens/stacking/startStacking/index.tsx index 05abb92c..f2461dd4 100644 --- a/src/app/screens/stacking/startStacking/index.tsx +++ b/src/app/screens/stacking/startStacking/index.tsx @@ -2,7 +2,7 @@ import useStackingData from '@hooks/queries/useStackingData'; import type { Pool } from '@secretkeylabs/xverse-core'; import { microstacksToStx } from '@secretkeylabs/xverse-core'; import Button from '@ui-library/button'; -import { XVERSE_WEB_POOL_URL } from '@utils/constants'; +import { XVERSE_STACKING_URL } from '@utils/constants'; import BigNumber from 'bignumber.js'; import { useTranslation } from 'react-i18next'; import { useTheme } from 'styled-components'; @@ -32,7 +32,7 @@ function StartStacking() { }; const handleOnClick = () => { - window.open(XVERSE_WEB_POOL_URL); + window.open(XVERSE_STACKING_URL); }; return ( diff --git a/src/app/screens/swap/index.tsx b/src/app/screens/swap/index.tsx index 4c80ab37..6fa9ff8f 100644 --- a/src/app/screens/swap/index.tsx +++ b/src/app/screens/swap/index.tsx @@ -409,7 +409,7 @@ export default function SwapScreen() { fromStxTokenFiatValue: new BigNumber(sip10FromTokenInfoUSD?.tokenFiatRate ?? 0), }); - trackMixPanel(AnalyticsEvents.FetchSwapQuote, trackingPayload); + trackMixPanel(AnalyticsEvents.SignSwap, trackingPayload); }; const QuoteModal = ( diff --git a/src/app/utils/constants.ts b/src/app/utils/constants.ts index 6d087f40..4d7c19fc 100644 --- a/src/app/utils/constants.ts +++ b/src/app/utils/constants.ts @@ -16,7 +16,7 @@ export const BTC_TRANSACTION_TESTNET4_STATUS_URL = 'https://mempool.space/testne export const BTC_TRANSACTION_SIGNET_STATUS_URL = 'https://mempool.space/signet/tx/'; export const BTC_TRANSACTION_REGTEST_STATUS_URL = 'https://mempool.bitcoin.regtest.hiro.so/tx/'; export const TRANSACTION_STATUS_URL = 'https://explorer.stacks.co/txid/'; -export const XVERSE_WEB_POOL_URL = 'https://pool.xverse.app'; +export const XVERSE_STACKING_URL = 'https://wallet.xverse.app/earn/stacking'; export const XVERSE_EXPLORE_URL = 'https://wallet.xverse.app/explore'; export const XVERSE_POOL_ADDRESS = 'SPXVRSEH2BKSXAEJ00F1BY562P45D5ERPSKR4Q33'; diff --git a/src/common/utils/getSelectedAccount.ts b/src/common/utils/getSelectedAccount.ts index 853cd047..4489be9f 100644 --- a/src/common/utils/getSelectedAccount.ts +++ b/src/common/utils/getSelectedAccount.ts @@ -36,7 +36,14 @@ export function embellishAccountWithDetails( } if (account.accountType === 'ledger' || account.accountType === 'keystone') { - return { ...account, ...getAccountAddressDetails(account, 'native'), btcAddressType: 'native' }; + return { + ...account, + ...getAccountAddressDetails(account, 'native'), + btcAddressType: 'native', + // TODO vic: remove below 2 once we migrate to using Core which returns them in getAccountAddressDetails + btcXpub: account.btcAddresses.native?.xpub, + ordinalsXpub: account.btcAddresses.taproot.xpub, + }; } return {