From 64e6d595dd831251671ba72f29fd59c373574039 Mon Sep 17 00:00:00 2001 From: Abdul Haseeb Date: Tue, 8 Aug 2023 11:18:25 +0500 Subject: [PATCH 1/8] updated ordinal tx functions --- package.json | 2 +- .../confirmBtcTransactionComponent/index.tsx | 30 +++++----- .../components/transactionSetting/editFee.tsx | 43 ++++++++------ .../components/transactionSetting/index.tsx | 4 ++ .../confirmOrdinalTransaction/index.tsx | 3 +- .../restoreFunds/restoreOrdinals/index.tsx | 58 ++++++++++--------- src/app/screens/sendOrdinal/index.tsx | 38 +++++------- 7 files changed, 94 insertions(+), 84 deletions(-) diff --git a/package.json b/package.json index f53a0e916..be8053324 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "@ledgerhq/hw-transport-webusb": "^6.27.13", "@react-spring/web": "^9.6.1", - "@secretkeylabs/xverse-core": "1.5.0", + "@secretkeylabs/xverse-core": "^1.5.0-4604b83", "@stacks/connect": "^6.10.2", "@stacks/encryption": "4.3.5", "@stacks/stacks-blockchain-api-types": "^6.1.1", diff --git a/src/app/components/confirmBtcTransactionComponent/index.tsx b/src/app/components/confirmBtcTransactionComponent/index.tsx index bfd0151e6..55b11cc14 100644 --- a/src/app/components/confirmBtcTransactionComponent/index.tsx +++ b/src/app/components/confirmBtcTransactionComponent/index.tsx @@ -15,7 +15,7 @@ import { Recipient, SignedBtcTx, signNonOrdinalBtcSendTransaction, - signOrdinalSendTransaction, + signOrdinalTransaction, } from '@secretkeylabs/xverse-core/transactions/btc'; import { BtcUtxoDataResponse, @@ -29,6 +29,7 @@ import RecipientComponent from '@components/recipientComponent'; import TransferFeeView from '@components/transferFeeView'; import { NumericFormat } from 'react-number-format'; import TransactionDetailComponent from '../transactionDetailComponent'; +import { Inscription } from '@secretkeylabs/xverse-core/types'; const OuterContainer = styled.div` display: flex; @@ -122,6 +123,7 @@ interface Props { isRestoreFundFlow?: boolean; nonOrdinalUtxos?: BtcUtxoDataResponse[]; isBtcSendBrowserTx?: boolean; + ordinal?: Inscription; currentFeeRate: BigNumber; setCurrentFee: (feeRate: BigNumber) => void; setCurrentFeeRate: (feeRate: BigNumber) => void; @@ -142,6 +144,7 @@ function ConfirmBtcTransactionComponent({ isRestoreFundFlow, nonOrdinalUtxos, isBtcSendBrowserTx, + ordinal, currentFeeRate, setCurrentFee, setCurrentFeeRate, @@ -152,9 +155,8 @@ function ConfirmBtcTransactionComponent({ const { t } = useTranslation('translation'); const isGalleryOpen: boolean = document.documentElement.clientWidth > 360; const [loading, setLoading] = useState(false); - const { btcAddress, selectedAccount, seedPhrase, network, btcFiatRate } = useSelector( - (state: StoreState) => state.walletState, - ); + const { btcAddress, selectedAccount, seedPhrase, network, btcFiatRate, ordinalsAddress } = + useSelector((state: StoreState) => state.walletState); const [showFeeSettings, setShowFeeSettings] = useState(false); const [error, setError] = useState(''); const [signedTx, setSignedTx] = useState(signedTxHex); @@ -207,18 +209,19 @@ function ConfirmBtcTransactionComponent({ data: ordinalData, error: ordinalError, mutate: ordinalMutate, - } = useMutation({ + } = useMutation({ mutationFn: async (txFee) => { - const signedTx = await signOrdinalSendTransaction( - recipients[0]?.address, - ordinalTxUtxo!, + if (!ordinal) return null; + const signedTx = await signOrdinalTransaction({ + recipientAddress: recipients[0]?.address, + ordinalsAddress, btcAddress, - Number(selectedAccount?.id), + accountIndex: Number(selectedAccount?.id), seedPhrase, - network.type, - [ordinalTxUtxo!], - new BigNumber(txFee), - ); + network: network.type, + ordinal, + fee: new BigNumber(txFee), + }); return signedTx; }, }); @@ -403,6 +406,7 @@ function ConfirmBtcTransactionComponent({ isRestoreFlow={isRestoreFundFlow} showFeeSettings={showFeeSettings} setShowFeeSettings={setShowFeeSettings} + ordinal={ordinal} /> diff --git a/src/app/components/transactionSetting/editFee.tsx b/src/app/components/transactionSetting/editFee.tsx index 0f65de981..46d7490b9 100644 --- a/src/app/components/transactionSetting/editFee.tsx +++ b/src/app/components/transactionSetting/editFee.tsx @@ -13,12 +13,13 @@ import { NumericFormat } from 'react-number-format'; import { getBtcFees, getBtcFeesForNonOrdinalBtcSend, - getBtcFeesForOrdinalSend, + getBtcFeesForOrdinalTransaction, Recipient, } from '@secretkeylabs/xverse-core/transactions/btc'; import { BtcUtxoDataResponse, ErrorCodes, UTXO } from '@secretkeylabs/xverse-core'; import useDebounce from '@hooks/useDebounce'; import useOrdinalsByAddress from '@hooks/useOrdinalsByAddress'; +import { Inscription } from '@secretkeylabs/xverse-core/types'; const Container = styled.div((props) => ({ display: 'flex', @@ -150,6 +151,8 @@ interface Props { ordinalTxUtxo?: UTXO; isRestoreFlow?: boolean; nonOrdinalUtxos?: BtcUtxoDataResponse[]; + ordinal?: Inscription; + isRecover?: boolean; error: string; setIsLoading: () => void; setIsNotLoading: () => void; @@ -166,6 +169,8 @@ function EditFee({ ordinalTxUtxo, isRestoreFlow, nonOrdinalUtxos, + ordinal, + isRecover, error, setIsLoading, setIsNotLoading, @@ -246,15 +251,17 @@ function EditFee({ setFeeRateInput(selectedFeeRate?.toString()); setTotalFee(modifiedFee.toString()); } - } else if (type === 'Ordinals' && btcRecipients && ordinalTxUtxo) { - const { fee: modifiedFee, selectedFeeRate } = await getBtcFeesForOrdinalSend( - btcRecipients[0].address, - ordinalTxUtxo, + } else if (type === 'Ordinals' && btcRecipients && ordinal) { + const { fee: modifiedFee, selectedFeeRate } = await getBtcFeesForOrdinalTransaction({ + recipientAddress: btcRecipients[0].address, btcAddress, - network.type, - ordinalsUtxos || [], - mode, - ); + ordinalsAddress, + network: network.type, + ordinal, + isRecover, + feeMode: mode, + }); + setFeeRateInput(selectedFeeRate?.toString()); setTotalFee(modifiedFee.toString()); } @@ -316,20 +323,22 @@ function EditFee({ } finally { setIsNotLoading(); } - } else if (type === 'Ordinals' && btcRecipients && ordinalTxUtxo) { + } else if (type === 'Ordinals' && btcRecipients && ordinal) { try { setIsLoading(); setError(''); - const { fee: modifiedFee, selectedFeeRate } = await getBtcFeesForOrdinalSend( - btcRecipients[0].address, - ordinalTxUtxo, + const { fee: modifiedFee, selectedFeeRate } = await getBtcFeesForOrdinalTransaction({ + recipientAddress: btcRecipients[0].address, btcAddress, - network.type, - ordinalsUtxos || [], - selectedOption, + ordinalsAddress, + network: network.type, + ordinal, + isRecover, + feeMode: selectedOption, feeRateInput, - ); + }); + setFeeRateInput(selectedFeeRate?.toString()); setTotalFee(modifiedFee.toString()); } catch (err: any) { diff --git a/src/app/components/transactionSetting/index.tsx b/src/app/components/transactionSetting/index.tsx index 2a3b6ffeb..f83d3e087 100644 --- a/src/app/components/transactionSetting/index.tsx +++ b/src/app/components/transactionSetting/index.tsx @@ -13,6 +13,7 @@ import { isCustomFeesAllowed, Recipient } from '@secretkeylabs/xverse-core/trans import { BtcUtxoDataResponse, UTXO } from '@secretkeylabs/xverse-core'; import EditNonce from './editNonce'; import EditFee from './editFee'; +import { Inscription } from '@secretkeylabs/xverse-core/types'; const ButtonContainer = styled.div((props) => ({ display: 'flex', @@ -64,6 +65,7 @@ interface Props { ordinalTxUtxo?: UTXO; isRestoreFlow?: boolean; nonOrdinalUtxos?: BtcUtxoDataResponse[]; + ordinal?: Inscription; showFeeSettings: boolean; setShowFeeSettings: (value: boolean) => void; } @@ -82,6 +84,7 @@ function TransactionSettingAlert({ ordinalTxUtxo, isRestoreFlow, nonOrdinalUtxos, + ordinal, showFeeSettings, setShowFeeSettings, }: Props) { @@ -173,6 +176,7 @@ function TransactionSettingAlert({ ordinalTxUtxo={ordinalTxUtxo} isRestoreFlow={isRestoreFlow} nonOrdinalUtxos={nonOrdinalUtxos} + ordinal={ordinal} /> ); } diff --git a/src/app/screens/confirmOrdinalTransaction/index.tsx b/src/app/screens/confirmOrdinalTransaction/index.tsx index ab69e8153..d8cb5aecb 100644 --- a/src/app/screens/confirmOrdinalTransaction/index.tsx +++ b/src/app/screens/confirmOrdinalTransaction/index.tsx @@ -94,7 +94,7 @@ function ConfirmOrdinalTransaction() { const btcClient = useBtcClient(); const [recipientAddress, setRecipientAddress] = useState(''); const location = useLocation(); - const { fee, feePerVByte, signedTxHex, ordinalUtxo } = location.state; + const { fee, feePerVByte, signedTxHex, ordinalUtxo, ordinal } = location.state; const { isLoading, @@ -198,6 +198,7 @@ function ConfirmOrdinalTransaction() { setCurrentFee={setCurrentFee} currentFeeRate={currentFeeRate} setCurrentFeeRate={setCurrentFeeRate} + ordinal={ordinal} > diff --git a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx index 06ee7a861..38a553d9a 100644 --- a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx +++ b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx @@ -1,13 +1,10 @@ import { useMutation } from '@tanstack/react-query'; -import { useEffect, useMemo, useState } from 'react'; +import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { BtcOrdinal, ErrorCodes, Inscription } from '@secretkeylabs/xverse-core/types'; import { getBtcFiatEquivalent } from '@secretkeylabs/xverse-core/currency'; -import { - SignedBtcTx, - signOrdinalSendTransaction, -} from '@secretkeylabs/xverse-core/transactions/btc'; +import { SignedBtcTx, signOrdinalTransaction } from '@secretkeylabs/xverse-core/transactions/btc'; import useWalletSelector from '@hooks/useWalletSelector'; import useOrdinalsByAddress from '@hooks/useOrdinalsByAddress'; import useOrdinalDataReducer from '@hooks/stores/useOrdinalReducer'; @@ -16,6 +13,7 @@ import styled from 'styled-components'; import ActionButton from '@components/button'; import BottomTabBar from '@components/tabBar'; import OrdinalRow from './oridnalRow'; +import useOrdinalsApi from '@hooks/useOrdinalsApi'; const RestoreFundTitle = styled.h1((props) => ({ ...props.theme.body_l, @@ -57,28 +55,28 @@ function RestoreOrdinals() { useWalletSelector(); const { setSelectedOrdinalDetails } = useOrdinalDataReducer(); const navigate = useNavigate(); + const { ordinals } = useOrdinalsByAddress(btcAddress); const [error, setError] = useState(''); const location = useLocation(); const isRestoreFundFlow = location.state?.isRestoreFundFlow; - - const ordinalsUtxos = useMemo(() => ordinals?.map((ord) => ord.utxo), [ordinals]); + const ordinalsApi = useOrdinalsApi(); const { isLoading, error: transactionError, mutateAsync, - } = useMutation({ + } = useMutation({ mutationFn: async (ordinal) => { - const tx = await signOrdinalSendTransaction( + const tx = await signOrdinalTransaction({ + recipientAddress: ordinalsAddress, ordinalsAddress, - ordinal.utxo, btcAddress, - Number(selectedAccount?.id), + accountIndex: Number(selectedAccount?.id), seedPhrase, - network.type, - ordinalsUtxos!, - ); + network: network.type, + ordinal, + }); return tx; }, }); @@ -102,20 +100,24 @@ function RestoreOrdinals() { }; const onClickTransfer = async (selectedOrdinal: BtcOrdinal, ordinalData: Inscription) => { - const signedTx = await mutateAsync(selectedOrdinal); - setSelectedOrdinalDetails(ordinalData); - navigate(`/confirm-ordinal-tx/${selectedOrdinal.id}`, { - state: { - signedTxHex: signedTx.signedTx, - recipientAddress: ordinalsAddress, - fee: signedTx.fee, - feePerVByte: signedTx.feePerVByte, - fiatFee: getBtcFiatEquivalent(signedTx.fee, btcFiatRate), - total: signedTx.total, - fiatTotal: getBtcFiatEquivalent(signedTx.total, btcFiatRate), - ordinalUtxo: selectedOrdinal.utxo, - }, - }); + if (selectedOrdinal) { + const selectedInscription: Inscription = await ordinalsApi.getInscription(selectedOrdinal.id); + const signedTx = await mutateAsync(selectedInscription); + setSelectedOrdinalDetails(ordinalData); + navigate(`/confirm-ordinal-tx/${selectedOrdinal.id}`, { + state: { + signedTxHex: signedTx.signedTx, + recipientAddress: ordinalsAddress, + fee: signedTx.fee, + feePerVByte: signedTx.feePerVByte, + fiatFee: getBtcFiatEquivalent(signedTx.fee, btcFiatRate), + total: signedTx.total, + fiatTotal: getBtcFiatEquivalent(signedTx.total, btcFiatRate), + ordinalUtxo: selectedOrdinal.utxo, + ordinal: selectedInscription, + }, + }); + } }; return ( diff --git a/src/app/screens/sendOrdinal/index.tsx b/src/app/screens/sendOrdinal/index.tsx index 09efd1cad..12316b9cb 100644 --- a/src/app/screens/sendOrdinal/index.tsx +++ b/src/app/screens/sendOrdinal/index.tsx @@ -4,17 +4,13 @@ import SendForm from '@components/sendForm'; import BottomBar from '@components/tabBar'; import TopRow from '@components/topRow'; import useNftDataSelector from '@hooks/stores/useNftDataSelector'; -import useBtcClient from '@hooks/useBtcClient'; import { useResetUserFlow } from '@hooks/useResetUserFlow'; import useTextOrdinalContent from '@hooks/useTextOrdinalContent'; import useWalletSelector from '@hooks/useWalletSelector'; import OrdinalImage from '@screens/ordinals/ordinalImage'; import { isOrdinalOwnedByAccount } from '@secretkeylabs/xverse-core/api'; import { getBtcFiatEquivalent } from '@secretkeylabs/xverse-core/currency'; -import { - SignedBtcTx, - signOrdinalSendTransaction, -} from '@secretkeylabs/xverse-core/transactions/btc'; +import { SignedBtcTx, signOrdinalTransaction } from '@secretkeylabs/xverse-core/transactions/btc'; import { ErrorCodes, ResponseError, UTXO } from '@secretkeylabs/xverse-core/types'; import { validateBtcAddress } from '@secretkeylabs/xverse-core/wallet'; import { useMutation } from '@tanstack/react-query'; @@ -102,7 +98,6 @@ function SendOrdinal() { const { t } = useTranslation('translation', { keyPrefix: 'SEND' }); const navigate = useNavigate(); const { selectedOrdinal } = useNftDataSelector(); - const btcClient = useBtcClient(); const location = useLocation(); const { network, ordinalsAddress, btcAddress, selectedAccount, seedPhrase, btcFiatRate } = useWalletSelector(); @@ -121,25 +116,19 @@ function SendOrdinal() { data, error: txError, mutate, - } = useMutation({ + } = useMutation({ mutationFn: async (recipient) => { - const addressUtxos = await btcClient.getUnspentUtxos(ordinalsAddress); - const ordUtxo = addressUtxos.find( - (utx) => `${utx.txid}:${utx.vout}` === selectedOrdinal?.output, - ); - setOrdinalUtxo(ordUtxo); - if (ordUtxo) { - const signedTx = await signOrdinalSendTransaction( - recipient, - ordUtxo, - btcAddress, - Number(selectedAccount?.id), - seedPhrase, - network.type, - [ordUtxo], - ); - return signedTx; - } + if (!selectedOrdinal) return null; + const signedTx = await signOrdinalTransaction({ + recipientAddress: recipient, + ordinalsAddress, + btcAddress, + accountIndex: Number(selectedAccount?.id), + seedPhrase, + network: network.type, + ordinal: selectedOrdinal, + }); + return signedTx; }, }); @@ -165,6 +154,7 @@ function SendOrdinal() { total: data.total, fiatTotal: getBtcFiatEquivalent(data.total, btcFiatRate), ordinalUtxo, + ordinal: selectedOrdinal, }, }); } From 23130e466806849768e3c3790c021d5c6a3f1a07 Mon Sep 17 00:00:00 2001 From: Abdul Haseeb Date: Tue, 8 Aug 2023 11:44:01 +0500 Subject: [PATCH 2/8] update package-lock file --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 8e5e16368..371841271 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@ledgerhq/hw-transport-webusb": "^6.27.13", "@react-spring/web": "^9.6.1", - "@secretkeylabs/xverse-core": "1.5.0", + "@secretkeylabs/xverse-core": "^1.5.0-4604b83", "@stacks/connect": "^6.10.2", "@stacks/encryption": "4.3.5", "@stacks/stacks-blockchain-api-types": "^6.1.1", From 36819e6481ca15ea0f5cf6c14e0945fbc9277dfd Mon Sep 17 00:00:00 2001 From: Abdul Haseeb Date: Fri, 18 Aug 2023 11:54:43 +0500 Subject: [PATCH 3/8] fix: function params --- src/app/components/confirmBtcTransactionComponent/index.tsx | 2 +- src/app/screens/restoreFunds/restoreOrdinals/index.tsx | 2 +- src/app/screens/sendOrdinal/index.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/components/confirmBtcTransactionComponent/index.tsx b/src/app/components/confirmBtcTransactionComponent/index.tsx index 06887b9d8..841c93a58 100644 --- a/src/app/components/confirmBtcTransactionComponent/index.tsx +++ b/src/app/components/confirmBtcTransactionComponent/index.tsx @@ -217,8 +217,8 @@ function ConfirmBtcTransactionComponent({ if (!ordinal) return null; const signedTx = await signOrdinalTransaction({ recipientAddress: recipients[0]?.address, - ordinalsAddress, btcAddress, + ordinalsAddress, accountIndex: Number(selectedAccount?.id), seedPhrase, network: network.type, diff --git a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx index 1d30bbe3c..65b00d19c 100644 --- a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx +++ b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx @@ -71,8 +71,8 @@ function RestoreOrdinals() { mutationFn: async (ordinal) => { const tx = await signOrdinalTransaction({ recipientAddress: ordinalsAddress, - ordinalsAddress, btcAddress, + ordinalsAddress, accountIndex: Number(selectedAccount?.id), seedPhrase, network: network.type, diff --git a/src/app/screens/sendOrdinal/index.tsx b/src/app/screens/sendOrdinal/index.tsx index 62e5a481a..d3a063962 100644 --- a/src/app/screens/sendOrdinal/index.tsx +++ b/src/app/screens/sendOrdinal/index.tsx @@ -123,8 +123,8 @@ function SendOrdinal() { if (!selectedOrdinal) return null; const signedTx = await signOrdinalTransaction({ recipientAddress: recipient, - ordinalsAddress, btcAddress, + ordinalsAddress, accountIndex: Number(selectedAccount?.id), seedPhrase, network: network.type, From 8fb464ef76416deeccee0a763b878c3da0741700 Mon Sep 17 00:00:00 2001 From: Abdul Haseeb Date: Fri, 18 Aug 2023 12:35:30 +0500 Subject: [PATCH 4/8] fix: pass recover flag --- src/app/screens/restoreFunds/restoreOrdinals/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx index 65b00d19c..226ce871f 100644 --- a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx +++ b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx @@ -77,6 +77,7 @@ function RestoreOrdinals() { seedPhrase, network: network.type, ordinal, + isRecover: true, }); return tx; }, From 1cd6b40b5ba372e8056f5ede8fb1c0bf6d7a05ec Mon Sep 17 00:00:00 2001 From: Abdul Haseeb Date: Tue, 22 Aug 2023 02:20:50 +0500 Subject: [PATCH 5/8] fix: recover ordinal flow in fees setting --- package.json | 2 +- src/app/components/confirmBtcTransactionComponent/index.tsx | 4 ++++ src/app/components/transactionSetting/editFee.tsx | 6 ++++-- src/app/components/transactionSetting/index.tsx | 3 +++ src/app/screens/confirmOrdinalTransaction/index.tsx | 4 +++- src/app/screens/restoreFunds/restoreOrdinals/index.tsx | 1 + 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 89fbb1328..1d1e84e84 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "@ledgerhq/hw-transport-webusb": "^6.27.13", "@react-spring/web": "^9.6.1", - "@secretkeylabs/xverse-core": "1.6.1", + "@secretkeylabs/xverse-core": "^1.6.1-5278e17", "@stacks/connect": "^6.10.2", "@stacks/encryption": "4.3.5", "@stacks/stacks-blockchain-api-types": "^6.1.1", diff --git a/src/app/components/confirmBtcTransactionComponent/index.tsx b/src/app/components/confirmBtcTransactionComponent/index.tsx index 841c93a58..d11d8d8c6 100644 --- a/src/app/components/confirmBtcTransactionComponent/index.tsx +++ b/src/app/components/confirmBtcTransactionComponent/index.tsx @@ -125,6 +125,7 @@ interface Props { nonOrdinalUtxos?: BtcUtxoDataResponse[]; isBtcSendBrowserTx?: boolean; ordinal?: Inscription; + isRestoreOrdinalFlow?: boolean; currentFeeRate: BigNumber; setCurrentFee: (feeRate: BigNumber) => void; setCurrentFeeRate: (feeRate: BigNumber) => void; @@ -146,6 +147,7 @@ function ConfirmBtcTransactionComponent({ nonOrdinalUtxos, isBtcSendBrowserTx, ordinal, + isRestoreOrdinalFlow = false, currentFeeRate, setCurrentFee, setCurrentFeeRate, @@ -224,6 +226,7 @@ function ConfirmBtcTransactionComponent({ network: network.type, ordinal, fee: new BigNumber(txFee), + isRecover: isRestoreOrdinalFlow, }); return signedTx; }, @@ -410,6 +413,7 @@ function ConfirmBtcTransactionComponent({ showFeeSettings={showFeeSettings} setShowFeeSettings={setShowFeeSettings} ordinal={ordinal} + isRestoreOrdinalFlow={isRestoreOrdinalFlow} /> diff --git a/src/app/components/transactionSetting/editFee.tsx b/src/app/components/transactionSetting/editFee.tsx index 46d7490b9..5fed85159 100644 --- a/src/app/components/transactionSetting/editFee.tsx +++ b/src/app/components/transactionSetting/editFee.tsx @@ -153,6 +153,7 @@ interface Props { nonOrdinalUtxos?: BtcUtxoDataResponse[]; ordinal?: Inscription; isRecover?: boolean; + isRestoreOrdinalFlow?: boolean; error: string; setIsLoading: () => void; setIsNotLoading: () => void; @@ -171,6 +172,7 @@ function EditFee({ nonOrdinalUtxos, ordinal, isRecover, + isRestoreOrdinalFlow = false, error, setIsLoading, setIsNotLoading, @@ -258,7 +260,7 @@ function EditFee({ ordinalsAddress, network: network.type, ordinal, - isRecover, + isRecover: isRestoreOrdinalFlow, feeMode: mode, }); @@ -334,7 +336,7 @@ function EditFee({ ordinalsAddress, network: network.type, ordinal, - isRecover, + isRecover: isRestoreOrdinalFlow, feeMode: selectedOption, feeRateInput, }); diff --git a/src/app/components/transactionSetting/index.tsx b/src/app/components/transactionSetting/index.tsx index f83d3e087..6dd504ea8 100644 --- a/src/app/components/transactionSetting/index.tsx +++ b/src/app/components/transactionSetting/index.tsx @@ -66,6 +66,7 @@ interface Props { isRestoreFlow?: boolean; nonOrdinalUtxos?: BtcUtxoDataResponse[]; ordinal?: Inscription; + isRestoreOrdinalFlow?: boolean; showFeeSettings: boolean; setShowFeeSettings: (value: boolean) => void; } @@ -85,6 +86,7 @@ function TransactionSettingAlert({ isRestoreFlow, nonOrdinalUtxos, ordinal, + isRestoreOrdinalFlow = false, showFeeSettings, setShowFeeSettings, }: Props) { @@ -177,6 +179,7 @@ function TransactionSettingAlert({ isRestoreFlow={isRestoreFlow} nonOrdinalUtxos={nonOrdinalUtxos} ordinal={ordinal} + isRestoreOrdinalFlow={isRestoreOrdinalFlow} /> ); } diff --git a/src/app/screens/confirmOrdinalTransaction/index.tsx b/src/app/screens/confirmOrdinalTransaction/index.tsx index d9aa80eed..694e7cf00 100644 --- a/src/app/screens/confirmOrdinalTransaction/index.tsx +++ b/src/app/screens/confirmOrdinalTransaction/index.tsx @@ -94,7 +94,8 @@ function ConfirmOrdinalTransaction() { const btcClient = useBtcClient(); const [recipientAddress, setRecipientAddress] = useState(''); const location = useLocation(); - const { fee, feePerVByte, signedTxHex, ordinalUtxo, ordinal } = location.state; + const { fee, feePerVByte, signedTxHex, ordinalUtxo, ordinal, isRestoreOrdinalFlow } = + location.state; const { isLoading, @@ -198,6 +199,7 @@ function ConfirmOrdinalTransaction() { currentFeeRate={currentFeeRate} setCurrentFeeRate={setCurrentFeeRate} ordinal={ordinal} + isRestoreOrdinalFlow={isRestoreOrdinalFlow} > diff --git a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx index 226ce871f..2f32f0631 100644 --- a/src/app/screens/restoreFunds/restoreOrdinals/index.tsx +++ b/src/app/screens/restoreFunds/restoreOrdinals/index.tsx @@ -117,6 +117,7 @@ function RestoreOrdinals() { fiatTotal: getBtcFiatEquivalent(signedTx.total, btcFiatRate), ordinalUtxo: selectedOrdinal.utxo, ordinal: selectedInscription, + isRestoreOrdinalFlow: true, }, }); } From 0e869c51a852097cf4aca1c29e04e59eae30ebdb Mon Sep 17 00:00:00 2001 From: Abdul Haseeb Date: Tue, 22 Aug 2023 02:34:02 +0500 Subject: [PATCH 6/8] update package lock --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 1c008a395..076b382bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@ledgerhq/hw-transport-webusb": "^6.27.13", "@phosphor-icons/react": "^2.0.10", "@react-spring/web": "^9.6.1", - "@secretkeylabs/xverse-core": "1.6.1", + "@secretkeylabs/xverse-core": "^1.6.1-5278e17", "@stacks/connect": "^6.10.2", "@stacks/encryption": "4.3.5", "@stacks/stacks-blockchain-api-types": "^6.1.1", From 808c60dab8119ae9dd91dcd29ed1b6e2be3e1d10 Mon Sep 17 00:00:00 2001 From: Abdul Haseeb Date: Wed, 30 Aug 2023 11:56:16 +0500 Subject: [PATCH 7/8] update packaga-lock --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 747647384..126e588ac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2204,9 +2204,9 @@ } }, "node_modules/@secretkeylabs/xverse-core": { - "version": "1.6.4-rc.2", - "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/1.6.4-rc.2/db385587f1254da2e938165d3dc7ed5cf133227c", - "integrity": "sha512-uoBirH++AsAN1lBk1RbgxPG6kUgMA1fqoV5zbZ1grJa0DG/YcoCnM+NFa7nzak0sEI/SuSqB570CZyzvvSFtsA==", + "version": "1.6.5", + "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/1.6.5/18b2bab0da12cf5926f9c92c0197bdc45778bd15", + "integrity": "sha512-Wg/tdY5aW8kmCPdbBeRbirvTtPPWJMZPlEtDzrVBbTdWBjqtQfD4qV1gKieQdwgN2oftNDcyYqyk4kKYbHeTUQ==", "license": "ISC", "dependencies": { "@bitcoinerlab/secp256k1": "^1.0.2", @@ -20245,9 +20245,9 @@ } }, "@secretkeylabs/xverse-core": { - "version": "1.6.4-rc.2", - "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/1.6.4-rc.2/db385587f1254da2e938165d3dc7ed5cf133227c", - "integrity": "sha512-uoBirH++AsAN1lBk1RbgxPG6kUgMA1fqoV5zbZ1grJa0DG/YcoCnM+NFa7nzak0sEI/SuSqB570CZyzvvSFtsA==", + "version": "1.6.5", + "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/1.6.5/18b2bab0da12cf5926f9c92c0197bdc45778bd15", + "integrity": "sha512-Wg/tdY5aW8kmCPdbBeRbirvTtPPWJMZPlEtDzrVBbTdWBjqtQfD4qV1gKieQdwgN2oftNDcyYqyk4kKYbHeTUQ==", "requires": { "@bitcoinerlab/secp256k1": "^1.0.2", "@noble/secp256k1": "^1.7.1", From ebc6c33faa631ac8413c51e5b6e4a07c15604b90 Mon Sep 17 00:00:00 2001 From: Abdul Haseeb Date: Wed, 13 Sep 2023 14:24:50 +0500 Subject: [PATCH 8/8] fix build --- package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 245076fe4..467a1d57f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2211,9 +2211,9 @@ } }, "node_modules/@secretkeylabs/xverse-core": { - "version": "1.6.4-rc.2", - "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/1.6.4-rc.2/db385587f1254da2e938165d3dc7ed5cf133227c", - "integrity": "sha512-uoBirH++AsAN1lBk1RbgxPG6kUgMA1fqoV5zbZ1grJa0DG/YcoCnM+NFa7nzak0sEI/SuSqB570CZyzvvSFtsA==", + "version": "1.7.2", + "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/1.7.2/b47baff054a70600b61da1dd8fcb03bb65b7da2f", + "integrity": "sha512-mmxLHkPZ3kZ+4zOrDI6Z3ietExlARpD0mLEhg0ioUayA5QUGnXAtbo7nESD4g6Rc+5cICmZir5qnAeAE7QxtEA==", "license": "ISC", "dependencies": { "@bitcoinerlab/secp256k1": "^1.0.2", @@ -20383,9 +20383,9 @@ } }, "@secretkeylabs/xverse-core": { - "version": "1.6.4-rc.2", - "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/1.6.4-rc.2/db385587f1254da2e938165d3dc7ed5cf133227c", - "integrity": "sha512-uoBirH++AsAN1lBk1RbgxPG6kUgMA1fqoV5zbZ1grJa0DG/YcoCnM+NFa7nzak0sEI/SuSqB570CZyzvvSFtsA==", + "version": "1.7.2", + "resolved": "https://npm.pkg.github.com/download/@secretkeylabs/xverse-core/1.7.2/b47baff054a70600b61da1dd8fcb03bb65b7da2f", + "integrity": "sha512-mmxLHkPZ3kZ+4zOrDI6Z3ietExlARpD0mLEhg0ioUayA5QUGnXAtbo7nESD4g6Rc+5cICmZir5qnAeAE7QxtEA==", "requires": { "@bitcoinerlab/secp256k1": "^1.0.2", "@noble/secp256k1": "^1.7.1",