diff --git a/src/renderer/entities/wallet/lib/permission-utils.ts b/src/renderer/entities/wallet/lib/permission-utils.ts index 5739ee19e..066c201c4 100644 --- a/src/renderer/entities/wallet/lib/permission-utils.ts +++ b/src/renderer/entities/wallet/lib/permission-utils.ts @@ -44,6 +44,7 @@ function canStake(wallet: Wallet): boolean { function canCreateMultisigTx(wallet: Wallet): boolean { if (walletUtils.isWatchOnly(wallet)) return false; if (walletUtils.isMultisig(wallet)) return false; + if (walletUtils.isFlexibleMultisig(wallet)) return false; if (walletUtils.isProxied(wallet)) { const isAnyProxy = accountUtils.isAnyProxyType(wallet.accounts[0]); const isNonTransfer = accountUtils.isNonTransferProxyType(wallet.accounts[0]); @@ -56,6 +57,7 @@ function canCreateMultisigTx(wallet: Wallet): boolean { function canApproveMultisigTx(wallet: Wallet): boolean { if (walletUtils.isWatchOnly(wallet)) return false; if (walletUtils.isMultisig(wallet)) return false; + if (walletUtils.isFlexibleMultisig(wallet)) return false; if (walletUtils.isProxied(wallet)) { return false; @@ -72,6 +74,7 @@ function canApproveMultisigTx(wallet: Wallet): boolean { function canRejectMultisigTx(wallet: Wallet): boolean { if (walletUtils.isWatchOnly(wallet)) return false; if (walletUtils.isMultisig(wallet)) return false; + if (walletUtils.isFlexibleMultisig(wallet)) return false; if (walletUtils.isProxied(wallet)) { return false; diff --git a/src/renderer/entities/wallet/lib/wallet-utils.ts b/src/renderer/entities/wallet/lib/wallet-utils.ts index a83f821d3..c1137a372 100644 --- a/src/renderer/entities/wallet/lib/wallet-utils.ts +++ b/src/renderer/entities/wallet/lib/wallet-utils.ts @@ -1,5 +1,6 @@ import { type Account, + type FlexibleMultisigWallet, type ID, type MultiShardWallet, type MultisigWallet, @@ -20,6 +21,7 @@ export const walletUtils = { isMultiShard, isSingleShard, isMultisig, + isFlexibleMultisig, isWatchOnly, isNovaWallet, isWalletConnect, @@ -33,6 +35,7 @@ export const walletUtils = { getAccountBy, getAccountsBy, + getAllAccounts, getWalletFilteredAccounts, getWalletsFilteredAccounts, }; @@ -55,6 +58,10 @@ function isMultisig(wallet?: Wallet): wallet is MultisigWallet { return wallet?.type === WalletType.MULTISIG; } +function isFlexibleMultisig(wallet?: Wallet): wallet is FlexibleMultisigWallet { + return wallet?.type === WalletType.FLEXIBLE_MULTISIG; +} + function isWatchOnly(wallet?: Wallet): wallet is WatchOnlyWallet { return wallet?.type === WalletType.WATCH_ONLY; } @@ -111,6 +118,10 @@ function getAccountsBy(wallets: Wallet[], accountFn: (account: Account, wallet: }, []); } +function getAllAccounts(wallets: Wallet[]): Account[] { + return wallets.reduce((acc, wallet) => acc.concat(wallet.accounts), []); +} + function getAccountBy(wallets: Wallet[], accountFn: (account: Account, wallet: Wallet) => boolean): Account | null { for (const wallet of wallets) { const account = wallet.accounts.find((account) => accountFn(account, wallet)); diff --git a/src/renderer/entities/wallet/ui/Cards/WalletCardMd.tsx b/src/renderer/entities/wallet/ui/Cards/WalletCardMd.tsx index 78cb5c8dd..a1d2d0dae 100644 --- a/src/renderer/entities/wallet/ui/Cards/WalletCardMd.tsx +++ b/src/renderer/entities/wallet/ui/Cards/WalletCardMd.tsx @@ -36,7 +36,10 @@ export const WalletCardMd = ({ wallet, description, prefix, hideIcon, className, className, )} > -