diff --git a/src/renderer/entities/signatory/lib/utils.ts b/src/renderer/entities/signatory/lib/utils.ts index 4226f7711a..82eea09c97 100644 --- a/src/renderer/entities/signatory/lib/utils.ts +++ b/src/renderer/entities/signatory/lib/utils.ts @@ -9,6 +9,6 @@ function getSignatoryWallet(wallets: Wallet[], accountId: AccountId): Wallet | u return wallets.find((wallet) => { const hasMatch = wallet.accounts.some((account) => account.accountId === accountId); - return hasMatch && walletUtils.isValidSignSignatory(wallet); + return hasMatch && walletUtils.isValidSignatory(wallet); }); } diff --git a/src/renderer/pages/Operations/common/utils.ts b/src/renderer/pages/Operations/common/utils.ts index a7ee25f6a3..8da0481f78 100644 --- a/src/renderer/pages/Operations/common/utils.ts +++ b/src/renderer/pages/Operations/common/utils.ts @@ -83,7 +83,7 @@ export const getSignatoryAccounts = ( const isChainMatch = accountUtils.isChainIdMatch(a, chainId); const wallet = walletsMap.get(a.walletId); - return isChainMatch && walletUtils.isValidSignSignatory(wallet); + return isChainMatch && walletUtils.isValidSignatory(wallet); }); if (signatoryAccount) { @@ -236,7 +236,7 @@ export const getDelegationTracks = (tx: MultisigTransaction): string[] | undefin if (!coreTxs || coreTxs.length === 0) return; - return coreTxs.map((tx: Transaction) => tx.args.track.toString()); + return coreTxs.map((tx: Transaction) => tx.args.track?.toString()); }; export const getUndelegationData = async ( diff --git a/src/renderer/pages/Operations/components/ActionSteps/Confirmation.tsx b/src/renderer/pages/Operations/components/ActionSteps/Confirmation.tsx index 8b30807b2b..23c9e81396 100644 --- a/src/renderer/pages/Operations/components/ActionSteps/Confirmation.tsx +++ b/src/renderer/pages/Operations/components/ActionSteps/Confirmation.tsx @@ -37,7 +37,7 @@ export const Confirmation = ({ tx, account, chainConnection, signAccount, feeTx, const wallets = useUnit(walletModel.$wallets); const signerWallet = walletUtils.getWalletFilteredAccounts(wallets, { - walletFn: walletUtils.isValidSignSignatory, + walletFn: walletUtils.isValidSignatory, accountFn: (acc) => signAccount?.accountId === acc.accountId, }); diff --git a/src/renderer/pages/Operations/components/modals/RejectTx.tsx b/src/renderer/pages/Operations/components/modals/RejectTx.tsx index c0ec6035f7..10900d9f67 100644 --- a/src/renderer/pages/Operations/components/modals/RejectTx.tsx +++ b/src/renderer/pages/Operations/components/modals/RejectTx.tsx @@ -70,7 +70,7 @@ const RejectTxModal = ({ tx, account, connection, children }: Props) => { const asset = getAssetById(tx.transaction?.args.assetId, connection.assets); const signAccount = walletUtils.getWalletFilteredAccounts(wallets, { - walletFn: (wallet) => !walletUtils.isWatchOnly(wallet) && !walletUtils.isProxied(wallet), + walletFn: walletUtils.isValidSignatory, accountFn: (account) => account.accountId === tx.depositor, })?.accounts[0]; diff --git a/src/renderer/widgets/CreateWallet/model/signatory-model.ts b/src/renderer/widgets/CreateWallet/model/signatory-model.ts index d1de3fd0e3..345e8e638b 100644 --- a/src/renderer/widgets/CreateWallet/model/signatory-model.ts +++ b/src/renderer/widgets/CreateWallet/model/signatory-model.ts @@ -39,7 +39,7 @@ const $ownedSignatoriesWallets = combine( { wallets: walletModel.$wallets, signatories: $signatories }, ({ wallets, signatories }) => walletUtils.getWalletsFilteredAccounts(wallets, { - walletFn: (w) => !walletUtils.isWatchOnly(w) && !walletUtils.isMultisig(w), + walletFn: (w) => walletUtils.isValidSignatory(w), accountFn: (a) => signatories.some((s) => toAccountId(s.address) === a.accountId), }) || [], ); diff --git a/src/renderer/widgets/CreateWallet/ui/MultisigWallet/components/SelectSignatories.tsx b/src/renderer/widgets/CreateWallet/ui/MultisigWallet/components/SelectSignatories.tsx index 7c819cb135..21b4b07d77 100644 --- a/src/renderer/widgets/CreateWallet/ui/MultisigWallet/components/SelectSignatories.tsx +++ b/src/renderer/widgets/CreateWallet/ui/MultisigWallet/components/SelectSignatories.tsx @@ -25,7 +25,7 @@ export const SelectSignatories = () => { isOwnAccount={index === 0} signatoryName={value.name} signatoryAddress={value.address} - selectedWallet={value.walletId} + selectedWalletId={value.walletId} onDelete={signatoryModel.events.deleteSignatory} /> ))} diff --git a/src/renderer/widgets/CreateWallet/ui/MultisigWallet/components/Signatory.tsx b/src/renderer/widgets/CreateWallet/ui/MultisigWallet/components/Signatory.tsx index c5f8886263..18085b1e44 100644 --- a/src/renderer/widgets/CreateWallet/ui/MultisigWallet/components/Signatory.tsx +++ b/src/renderer/widgets/CreateWallet/ui/MultisigWallet/components/Signatory.tsx @@ -30,7 +30,7 @@ interface Props { signatoryName: string; signatoryAddress: string; signatoryIndex: number; - selectedWallet: string; + selectedWalletId: string; isOwnAccount?: boolean; onDelete?: (index: number) => void; } @@ -41,7 +41,7 @@ export const Signatory = ({ isOwnAccount = false, signatoryName, signatoryAddress, - selectedWallet, + selectedWalletId, }: Props) => { const { t } = useI18n(); const [query, setQuery] = useState(''); @@ -67,10 +67,7 @@ export const Signatory = ({ const ownAccountName = walletUtils.getWalletsFilteredAccounts(wallets, { - walletFn: (w) => - !walletUtils.isWatchOnly(w) && - !walletUtils.isMultisig(w) && - (!selectedWallet || w.id.toString() === selectedWallet), + walletFn: (w) => walletUtils.isValidSignatory(w) && (!selectedWalletId || w.id.toString() === selectedWalletId), accountFn: (a) => toAccountId(signatoryAddress) === a.accountId && accountUtils.isChainIdMatch(a, chain.value.chainId), })?.[0]?.name || ''; @@ -102,7 +99,11 @@ export const Signatory = ({ return acc.concat( wallet.accounts - .filter((account) => accountUtils.isChainAndCryptoMatch(account, chain.value)) + .filter( + (account) => + accountUtils.isChainAndCryptoMatch(account, chain.value) && + accountUtils.isNonBaseVaultAccount(account, wallet), + ) .map((account) => { const address = toAddress(account.accountId, { prefix: chain.value.addressPrefix }); @@ -128,7 +129,7 @@ export const Signatory = ({ { id: index.toString(), element: ( -
+
{t(GroupLabels[walletType as WalletFamily])} @@ -173,7 +174,7 @@ export const Signatory = ({ index: signatoryIndex, name: newName, address: signatoryAddress, - walletId: selectedWallet, + walletId: selectedWalletId, }); };