diff --git a/apps/namadillo/package.json b/apps/namadillo/package.json
index a1a1598b1b..8293bcb772 100644
--- a/apps/namadillo/package.json
+++ b/apps/namadillo/package.json
@@ -10,7 +10,7 @@
"@chain-registry/client": "^1.53.5",
"@cosmjs/encoding": "^0.32.3",
"@keplr-wallet/types": "^0.12.136",
- "@namada/chain-registry": "^1.5.1",
+ "@namada/chain-registry": "^1.5.2",
"@namada/indexer-client": "4.0.5",
"@namada/sdk-multicore": "0.22.0",
"@tailwindcss/container-queries": "^0.1.1",
diff --git a/apps/namadillo/src/App/AccountOverview/EstimateShieldingRewardsCard.tsx b/apps/namadillo/src/App/AccountOverview/EstimateShieldingRewardsCard.tsx
index c5b4f6d482..4ad12d18d2 100644
--- a/apps/namadillo/src/App/AccountOverview/EstimateShieldingRewardsCard.tsx
+++ b/apps/namadillo/src/App/AccountOverview/EstimateShieldingRewardsCard.tsx
@@ -3,7 +3,6 @@ import { ModalContainer } from "App/Common/ModalContainer";
import { NamCurrency } from "App/Common/NamCurrency";
import { MaspRewardCalculator } from "App/Sidebars/MaspRewardCalculator";
import { cachedShieldedRewardsAtom } from "atoms/balance";
-import { applicationFeaturesAtom } from "atoms/settings";
import clsx from "clsx";
import { useAtomValue } from "jotai";
import { useState } from "react";
@@ -12,7 +11,6 @@ import { FaCalculator } from "react-icons/fa6";
export const EstimateShieldingRewardsCard = (): JSX.Element => {
const shieldedRewards = useAtomValue(cachedShieldedRewardsAtom);
const [isModalOpen, setIsModalOpen] = useState(false);
- const features = useAtomValue(applicationFeaturesAtom);
const handleCloseModal = (): void => {
setIsModalOpen(false);
@@ -47,18 +45,16 @@ export const EstimateShieldingRewardsCard = (): JSX.Element => {
}
- {features.shieldingRewardsEnabled && (
-
Shield
@@ -128,12 +138,6 @@ const TransparentTokensTable = ({
url: `${routes.transfer}?${params.asset}=${address}&${params.shielded}=0`,
icon:
,
},
- {
- url: `${routes.ibcWithdraw}?${params.asset}=${address}`,
- icon: (
-
- ),
- },
].map(({ url, icon }) => (
{
@@ -69,7 +63,6 @@ export const MainRoutes = (): JSX.Element => {
>
{/* Home */}
} />
-
{/* Staking */}
} />
{
path={routes.stakingBondingRedelegate}
element={}
/>
-
+ {/* Receive */}
+ } />
{/* Governance */}
} />
{
} />
} />
- {/* Masp */}
- {features.maspEnabled && (
- }>
- } />
- } />
-
- )}
-
- {/* Ibc Transfers */}
- {features.ibcTransfersEnabled && (
- }>
- } />
- } />
-
- )}
-
{features.ibcTransfersEnabled && (
}>
} />
)}
-
- {/* Transfer */}
- {(features.maspEnabled || features.namTransfersEnabled) && (
-
}>
-
} />
-
- )}
+ {/* Transfer - All transfer types now handled by TransferLayout */}
+
}>
+
} />
+
} />
+
} />
+
} />
+
} />
+
{/* Transaction History */}
{(features.namTransfersEnabled || features.ibcTransfersEnabled) && (
@@ -130,7 +109,6 @@ export const MainRoutes = (): JSX.Element => {
/>
)}
-
{/* Other */}
} />
} />
diff --git a/apps/namadillo/src/App/Common/SelectModal.tsx b/apps/namadillo/src/App/Common/SelectModal.tsx
index 47f40bcc44..a453f784f5 100644
--- a/apps/namadillo/src/App/Common/SelectModal.tsx
+++ b/apps/namadillo/src/App/Common/SelectModal.tsx
@@ -31,7 +31,7 @@ export const SelectModal = ({
)}
{...props}
>
-
+
- {children}
+ {children}
diff --git a/apps/namadillo/src/App/Common/SidebarMenuItem.tsx b/apps/namadillo/src/App/Common/SidebarMenuItem.tsx
index aa080184f7..fedcef554f 100644
--- a/apps/namadillo/src/App/Common/SidebarMenuItem.tsx
+++ b/apps/namadillo/src/App/Common/SidebarMenuItem.tsx
@@ -24,7 +24,7 @@ export const SidebarMenuItem = ({ url, children }: Props): JSX.Element => {
to={url}
className={({ isActive }) =>
clsx(className, {
- "text-yellow font-bold": isActive,
+ "text-yellow font-bold pointer-events-none select-none": isActive,
})
}
>
diff --git a/apps/namadillo/src/App/Common/TransactionFee.tsx b/apps/namadillo/src/App/Common/TransactionFee.tsx
index 868d7bcfa8..58983e3417 100644
--- a/apps/namadillo/src/App/Common/TransactionFee.tsx
+++ b/apps/namadillo/src/App/Common/TransactionFee.tsx
@@ -11,8 +11,10 @@ export const TransactionFee = ({
symbol,
}: TransactionFeeProps): JSX.Element => {
return (
-
-
Fee:
+
+
+ Transaction Fee
+
-
Fee Options:
+
Fees:
diff --git a/apps/namadillo/src/App/Common/UnshieldAssetsModal.tsx b/apps/namadillo/src/App/Common/UnshieldAssetsModal.tsx
index 6cd521f7e2..5bc3c6d6ae 100644
--- a/apps/namadillo/src/App/Common/UnshieldAssetsModal.tsx
+++ b/apps/namadillo/src/App/Common/UnshieldAssetsModal.tsx
@@ -39,7 +39,7 @@ export const UnshieldAssetsModal = ({
)})
),
- onClick: () => goTo(routes.unshield),
+ onClick: () => goTo(routes.maspUnshield),
children:
"Unshield assets from your Namada shielded to transparent account",
},
diff --git a/apps/namadillo/src/App/Ibc/IbcShieldAll.tsx b/apps/namadillo/src/App/Ibc/IbcShieldAll.tsx
index c5ce10bb61..c45fa300b7 100644
--- a/apps/namadillo/src/App/Ibc/IbcShieldAll.tsx
+++ b/apps/namadillo/src/App/Ibc/IbcShieldAll.tsx
@@ -2,7 +2,6 @@ import { Chain } from "@chain-registry/types";
import { Panel } from "@namada/components";
import { useAssetAmount } from "hooks/useAssetAmount";
import { useWalletManager } from "hooks/useWalletManager";
-import { wallets } from "integrations";
import { KeplrWalletManager } from "integrations/Keplr";
import { useState } from "react";
import { Asset } from "types";
@@ -41,7 +40,6 @@ export const IbcShieldAll: React.FC = () => {
{connected && !isSuccess && (
{
- const navigate = useNavigate();
+interface IbcTransferProps {
+ sourceAddress: string;
+ setSourceAddress: (address?: string) => void;
+ destinationAddress: string;
+ setDestinationAddress: (address?: string) => void;
+ keplrWalletManager: KeplrWalletManager;
+ assetSelectorModalOpen?: boolean;
+ setAssetSelectorModalOpen?: (open: boolean) => void;
+}
+
+export const IbcTransfer = ({
+ sourceAddress,
+ setSourceAddress,
+ destinationAddress,
+ setDestinationAddress,
+ keplrWalletManager,
+ assetSelectorModalOpen,
+ setAssetSelectorModalOpen,
+}: IbcTransferProps): JSX.Element => {
+ // COMPONENT STATE
const [completedAt, setCompletedAt] = useState();
-
- const availableChains = useMemo(getAvailableChains, []);
-
- // Global & Atom states
+ const [sourceChannel, setSourceChannel] = useState("");
+ const [destinationChannel, setDestinationChannel] = useState("");
+ const [selectedAssetWithAmount, setSelectedAssetWithAmount] = useState<
+ AssetWithAmountAndChain | undefined
+ >();
+ const [amount, setAmount] = useAtom(transferAmountAtom);
+ const [txHash, setTxHash] = useState();
+ // ERROR & STATUS STATE
+ const [generalErrorMessage, setGeneralErrorMessage] = useState("");
+ const [currentStatus, setCurrentStatus] = useState();
+ // GLOBAL STATE
+ const navigate = useNavigate();
const defaultAccounts = useAtomValue(allDefaultAccountsAtom);
-
- // Wallet & Registry
- const {
- registry,
- walletAddress: sourceAddress,
- connectToChainId,
- } = useWalletManager(keplr);
- const namadaChainRegistry = useAtomValue(namadaChainRegistryAtom);
- const chainRegistry = namadaChainRegistry.data;
-
- // IBC Channels & Balances
+ const { registry } = useWalletManager(keplrWalletManager);
const {
data: ibcChannels,
isError: unknownIbcChannels,
isLoading: isLoadingIbcChannels,
} = useAtomValue(ibcChannelsFamily(registry?.chain.chain_name));
-
- const { data: userAssets, isLoading: isLoadingBalances } = useAtomValue(
+ const { data: userAssets } = useAtomValue(
assetBalanceAtomFamily({
chain: registry?.chain,
walletAddress: sourceAddress,
})
);
-
const { trackEvent } = useFathomTracker();
- const [shielded, setShielded] = useState(true);
- const [selectedAssetBase, setSelectedAssetBase] = useUrlState(params.asset);
- const [amount, setAmount] = useState();
- const [generalErrorMessage, setGeneralErrorMessage] = useState("");
- const [sourceChannel, setSourceChannel] = useState("");
- const [destinationChannel, setDestinationChannel] = useState("");
- const [currentProgress, setCurrentProgress] = useState();
- const [txHash, setTxHash] = useState();
-
- const availableDisplayAmount = mapUndefined((baseDenom) => {
- return userAssets ? userAssets[baseDenom]?.amount : undefined;
- }, selectedAssetBase);
-
- const selectedAsset =
- selectedAssetBase ? userAssets?.[selectedAssetBase]?.asset : undefined;
-
- const availableAssets = useMemo(() => {
- if (!userAssets || !registry) return undefined;
-
- const output: Record = {};
-
- Object.entries(userAssets).forEach(([key, { asset }]) => {
- if (
- SUPPORTED_ASSETS_MAP.get(registry.chain.chain_name)?.includes(
- asset.symbol
- )
- ) {
- output[key] = { ...userAssets[key] };
- }
- });
-
- return output;
- }, [Object.keys(userAssets || {}).join(""), registry?.chain.chain_name]);
-
- // Manage the history of transactions
const { storeTransaction } = useTransactionActions();
- // Utils for IBC transfers
const { transferToNamada, gasConfig } = useIbcTransaction({
registry,
sourceAddress,
sourceChannel,
destinationChannel,
- shielded,
- selectedAsset,
+ shielded: isShieldedAddress(destinationAddress ?? ""),
+ selectedAsset: selectedAssetWithAmount?.asset,
});
+ // DERIVED VALUES
+ const shielded = isShieldedAddress(destinationAddress ?? "");
+ const availableDisplayAmount = mapUndefined((baseDenom) => {
+ return userAssets ? userAssets[baseDenom]?.amount : undefined;
+ }, selectedAssetWithAmount?.asset?.address);
const namadaAddress = useMemo(() => {
return (
defaultAccounts.data?.find(
@@ -121,15 +91,12 @@ export const IbcTransfer = (): JSX.Element => {
)?.address || ""
);
}, [defaultAccounts, shielded]);
-
const requiresIbcChannels = Boolean(
!isLoadingIbcChannels &&
(unknownIbcChannels ||
(shielded && ibcChannels && !ibcChannels?.namadaChannel))
);
- useEffect(() => setSelectedAssetBase(undefined), [registry]);
-
// Set source and destination channels based on IBC channels data
useEffect(() => {
setSourceChannel(ibcChannels?.ibcChannel || "");
@@ -159,12 +126,12 @@ export const IbcTransfer = (): JSX.Element => {
try {
invariant(registry?.chain, "Error: Chain not selected");
setGeneralErrorMessage("");
- setCurrentProgress("Submitting...");
+ setCurrentStatus("Submitting...");
const result = await transferToNamada.mutateAsync({
- destinationAddress,
- displayAmount,
+ destinationAddress: destinationAddress ?? "",
+ displayAmount: new BigNumber(displayAmount ?? "0"),
memo,
- onUpdateStatus: setCurrentProgress,
+ onUpdateStatus: setCurrentStatus,
});
storeTransaction(result);
setTxHash(result.hash);
@@ -173,20 +140,8 @@ export const IbcTransfer = (): JSX.Element => {
);
} catch (err) {
setGeneralErrorMessage(err + "");
- setCurrentProgress(undefined);
- }
- };
-
- const onChangeWallet = (): void => {
- if (registry) {
- connectToChainId(registry.chain.chain_id);
- return;
+ setCurrentStatus(undefined);
}
- connectToChainId(defaultChainId);
- };
-
- const onChangeChain = (chain: Chain): void => {
- connectToChainId(chain.chain_id);
};
return (
@@ -194,34 +149,22 @@ export const IbcTransfer = (): JSX.Element => {
- {!completedAt && }
{
transferToNamada.isSuccess
}
completedAt={completedAt}
- ibcTransfer={"deposit"}
- currentStatus={currentProgress}
+ currentStatus={currentStatus ?? ""}
requiresIbcChannels={requiresIbcChannels}
- ibcOptions={{
+ ibcChannels={{
sourceChannel,
- onChangeSourceChannel: setSourceChannel,
destinationChannel,
+ onChangeSourceChannel: setSourceChannel,
onChangeDestinationChannel: setDestinationChannel,
}}
errorMessage={generalErrorMessage || transferToNamada.error?.message}
onSubmitTransfer={onSubmitTransfer}
onComplete={() => {
- txHash &&
+ if (txHash) {
+ setAmount(undefined);
navigate(generatePath(routes.transaction, { hash: txHash }));
+ }
}}
+ keplrWalletManager={keplrWalletManager}
+ assetSelectorModalOpen={assetSelectorModalOpen}
+ setAssetSelectorModalOpen={setAssetSelectorModalOpen}
/>
);
diff --git a/apps/namadillo/src/App/Ibc/IbcTransfersLayout.tsx b/apps/namadillo/src/App/Ibc/IbcTransfersLayout.tsx
deleted file mode 100644
index b802168b04..0000000000
--- a/apps/namadillo/src/App/Ibc/IbcTransfersLayout.tsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { Panel } from "@namada/components";
-import { NavigationFooter } from "App/AccountOverview/NavigationFooter";
-import { ConnectPanel } from "App/Common/ConnectPanel";
-import { PageWithSidebar } from "App/Common/PageWithSidebar";
-import { Sidebar } from "App/Layout/Sidebar";
-import { useUserHasAccount } from "hooks/useIsAuthenticated";
-import { Outlet } from "react-router-dom";
-import { LearnAboutIbc } from "./LearnAboutIbc";
-
-export const IbcTransfersLayout = (): JSX.Element => {
- const userHasAccount = useUserHasAccount();
-
- if (!userHasAccount) {
- return
;
- }
-
- const renderOutletContent = (): JSX.Element => (
-
-
-
- );
-
- return (
-
-
- {renderOutletContent()}
-
-
-
-
-
-
- );
-};
diff --git a/apps/namadillo/src/App/Ibc/IbcWithdraw.tsx b/apps/namadillo/src/App/Ibc/IbcWithdraw.tsx
index c32bbbbf0c..b5c623406f 100644
--- a/apps/namadillo/src/App/Ibc/IbcWithdraw.tsx
+++ b/apps/namadillo/src/App/Ibc/IbcWithdraw.tsx
@@ -1,12 +1,10 @@
-import { Chain } from "@chain-registry/types";
import { IbcTransferProps } from "@namada/sdk-multicore";
import { AccountType } from "@namada/types";
import { mapUndefined } from "@namada/utils";
-import { params, routes } from "App/routes";
-import {
- OnSubmitTransferParams,
- TransferModule,
-} from "App/Transfer/TransferModule";
+import { routes } from "App/routes";
+import { isShieldedAddress } from "App/Transfer/common";
+import { TransferModule } from "App/Transfer/TransferModule";
+import { OnSubmitTransferParams } from "App/Transfer/types";
import {
allDefaultAccountsAtom,
defaultAccountAtom,
@@ -17,110 +15,105 @@ import {
namadaTransparentAssetsAtom,
} from "atoms/balance";
import { chainAtom } from "atoms/chain";
-import {
- getChainRegistryByChainName,
- ibcChannelsFamily,
- namadaChainRegistryAtom,
-} from "atoms/integrations";
+import { ibcChannelsFamily } from "atoms/integrations";
import { ledgerStatusDataAtom } from "atoms/ledger";
-import { createIbcTxAtom } from "atoms/transfer/atoms";
+import { createIbcTxAtom, transferAmountAtom } from "atoms/transfer/atoms";
import {
clearDisposableSigner,
persistDisposableSigner,
} from "atoms/transfer/services";
import BigNumber from "bignumber.js";
-import * as osmosis from "chain-registry/mainnet/osmosis";
import { useFathomTracker } from "hooks/useFathomTracker";
-import { useRequiresNewShieldedSync } from "hooks/useRequiresNewShieldedSync";
import { useTransaction } from "hooks/useTransaction";
import { useTransactionActions } from "hooks/useTransactionActions";
-import { useUrlState } from "hooks/useUrlState";
import { useWalletManager } from "hooks/useWalletManager";
-import { wallets } from "integrations";
import { KeplrWalletManager } from "integrations/Keplr";
import invariant from "invariant";
import { useAtom, useAtomValue } from "jotai";
import { TransactionPair } from "lib/query";
import { useEffect, useState } from "react";
import { generatePath, useNavigate } from "react-router-dom";
-import { Asset, IbcTransferTransactionData, TransferStep } from "types";
import {
- isNamadaAsset,
+ Asset,
+ AssetWithAmountAndChain,
+ IbcTransferTransactionData,
+ TransferStep,
+} from "types";
+import {
toBaseAmount,
toDisplayAmount,
useTransactionEventListener,
} from "utils";
-import { IbcTabNavigation } from "./IbcTabNavigation";
import { IbcTopHeader } from "./IbcTopHeader";
-const defaultChainId = "cosmoshub-4";
-const keplr = new KeplrWalletManager();
-
-export const IbcWithdraw = (): JSX.Element => {
- const defaultAccounts = useAtomValue(allDefaultAccountsAtom);
- const shieldedAccount = defaultAccounts.data?.find(
- (account) => account.type === AccountType.ShieldedKeys
- );
- const transparentAccount = useAtomValue(defaultAccountAtom);
- const namadaChain = useAtomValue(chainAtom);
- const [ledgerStatus, setLedgerStatusStop] = useAtom(ledgerStatusDataAtom);
- const namadaChainRegistry = useAtomValue(namadaChainRegistryAtom);
- const chain = namadaChainRegistry.data?.chain;
-
- const requiresNewShieldedSync = useRequiresNewShieldedSync();
- const [generalErrorMessage, setGeneralErrorMessage] = useState("");
- const [selectedAssetAddress, setSelectedAssetAddress] = useUrlState(
- params.asset
- );
- const [shielded, setShielded] = useState
(!requiresNewShieldedSync);
+interface IbcWithdrawProps {
+ sourceAddress: string;
+ setSourceAddress: (address?: string) => void;
+ destinationAddress: string;
+ setDestinationAddress: (address?: string) => void;
+ keplrWalletManager: KeplrWalletManager;
+ assetSelectorModalOpen: boolean | undefined;
+ setAssetSelectorModalOpen: (open: boolean) => void;
+}
+
+export const IbcWithdraw = ({
+ sourceAddress,
+ setSourceAddress,
+ destinationAddress,
+ setDestinationAddress,
+ keplrWalletManager,
+ assetSelectorModalOpen,
+ setAssetSelectorModalOpen,
+}: IbcWithdrawProps): JSX.Element => {
+ // COMPONENT STATE
+ const [selectedAssetWithAmount, setSelectedAssetWithAmount] = useState<
+ AssetWithAmountAndChain | undefined
+ >();
const [refundTarget, setRefundTarget] = useState();
- const [amount, setAmount] = useState();
+ const [amount, setAmount] = useAtom(transferAmountAtom);
const [customAddress, setCustomAddress] = useState("");
const [sourceChannel, setSourceChannel] = useState("");
- const [currentStatus, setCurrentStatus] = useState("");
- const [statusExplanation, setStatusExplanation] = useState("");
const [completedAt, setCompletedAt] = useState();
const [txHash, setTxHash] = useState();
- const [destinationChain, setDestinationChain] = useState();
+ // ERROR & STATUS STATE
+ const [currentStatus, setCurrentStatus] = useState("");
+ const [statusExplanation, setStatusExplanation] = useState("");
+ const [generalErrorMessage, setGeneralErrorMessage] = useState("");
+ // GLOBAL STATE
+ const defaultAccounts = useAtomValue(allDefaultAccountsAtom);
+ const {
+ walletAddress: keplrAddress,
+ chainId,
+ registry,
+ } = useWalletManager(keplrWalletManager);
+ const transparentAccount = useAtomValue(defaultAccountAtom);
+ const namadaChain = useAtomValue(chainAtom);
+ const [ledgerStatus, setLedgerStatusStop] = useAtom(ledgerStatusDataAtom);
const { refetch: genDisposableSigner } = useAtomValue(disposableSignerAtom);
- const alias = shieldedAccount?.alias ?? transparentAccount.data?.alias;
-
- const { data: availableAssets, isLoading: isLoadingAssets } = useAtomValue(
- shielded ? namadaShieldedAssetsAtom : namadaTransparentAssetsAtom
- );
-
const { storeTransaction } = useTransactionActions();
const { trackEvent } = useFathomTracker();
const navigate = useNavigate();
-
+ // DERIVED VALUES
+ const shieldedAccount = defaultAccounts.data?.find(
+ (account) => account.type === AccountType.ShieldedKeys
+ );
+ const alias = shieldedAccount?.alias ?? transparentAccount.data?.alias;
+ const shielded = isShieldedAddress(sourceAddress ?? "");
+ const { data: availableAssets } = useAtomValue(
+ shielded ? namadaShieldedAssetsAtom : namadaTransparentAssetsAtom
+ );
const ledgerAccountInfo = ledgerStatus && {
deviceConnected: ledgerStatus.connected,
errorMessage: ledgerStatus.errorMessage,
};
-
const availableAmount = mapUndefined(
(address) => availableAssets?.[address]?.amount,
- selectedAssetAddress
+ selectedAssetWithAmount?.asset.address
);
-
const selectedAsset =
- selectedAssetAddress ? availableAssets?.[selectedAssetAddress] : undefined;
-
- const {
- walletAddress: keplrAddress,
- connectToChainId,
- chainId,
- registry,
- loadWalletAddress,
- } = useWalletManager(keplr);
-
- const onChangeWallet = (): void => {
- if (registry) {
- connectToChainId(registry.chain.chain_id);
- return;
- }
- connectToChainId(defaultChainId);
- };
+ selectedAssetWithAmount?.asset.address ?
+ availableAssets?.[selectedAssetWithAmount?.asset.address]
+ : undefined;
useTransactionEventListener(
["IbcWithdraw.Success", "ShieldedIbcWithdraw.Success"],
@@ -145,62 +138,21 @@ export const IbcWithdraw = (): JSX.Element => {
const redirectToTimeline = (): void => {
if (txHash) {
+ setAmount(undefined);
navigate(generatePath(routes.transaction, { hash: txHash }));
}
};
- const updateDestinationChainAndAddress = async (
- chain: Chain | undefined
- ): Promise => {
- setDestinationChain(chain);
- if (customAddress) {
- setCustomAddress("");
- }
- if (chain) {
- await connectToChainId(chain.chain_id);
- await loadWalletAddress(chain.chain_id);
- }
- };
-
const {
data: ibcChannels,
isError: unknownIbcChannels,
isLoading: isLoadingIbcChannels,
- } = useAtomValue(ibcChannelsFamily(destinationChain?.chain_name));
+ } = useAtomValue(ibcChannelsFamily(registry?.chain.chain_name));
useEffect(() => {
setSourceChannel(ibcChannels?.namadaChannel || "");
}, [ibcChannels]);
- // Search for original chain. We don't want to enable users to transfer Namada assets
- // to other chains different than the original one. Ex: OSMO should only be withdrew to Osmosis,
- // ATOM to Cosmoshub, etc.
- useEffect(() => {
- (async () => {
- if (!selectedAsset) {
- await updateDestinationChainAndAddress(undefined);
- return;
- }
-
- let chain: Chain | undefined;
-
- if (isNamadaAsset(selectedAsset.asset)) {
- chain = osmosis.chain; // for now, NAM uses the osmosis chain
- } else if (selectedAsset.asset.traces) {
- const trace = selectedAsset.asset.traces.find(
- (trace) => trace.type === "ibc"
- );
-
- if (trace) {
- const chainName = trace.counterparty.chain_name;
- chain = getChainRegistryByChainName(chainName)?.chain;
- }
- }
-
- await updateDestinationChainAndAddress(chain);
- })();
- }, [selectedAsset]);
-
const {
execute: performWithdraw,
feeProps,
@@ -325,8 +277,12 @@ export const IbcWithdraw = (): JSX.Element => {
invariant(keplrAddress, "No address is selected");
invariant(shieldedAccount, "No shielded account is found");
invariant(transparentAccount.data, "No transparent account is found");
+ invariant(destinationAddress, "No destination address is set");
- const amountInBaseDenom = toBaseAmount(selectedAsset.asset, displayAmount);
+ const amountInBaseDenom = toBaseAmount(
+ selectedAsset.asset,
+ BigNumber(displayAmount ?? 0)
+ );
const source =
shielded ?
shieldedAccount.pseudoExtendedKey!
@@ -370,45 +326,26 @@ export const IbcWithdraw = (): JSX.Element => {
- {!completedAt && }
{
- if (requiresNewShieldedSync) {
- setShielded(false);
- } else {
- setShielded(isShielded);
- }
- },
+ selectedAssetWithAmount,
amount,
- onChangeAmount: setAmount,
ledgerAccountInfo,
+ onChangeAddress: setSourceAddress,
+ onChangeSelectedAsset: setSelectedAssetWithAmount,
+ onChangeAmount: setAmount,
}}
destination={{
- wallet: wallets.keplr,
- walletAddress: keplrAddress,
- availableWallets: [wallets.keplr],
- enableCustomAddress: true,
customAddress,
- onChangeCustomAddress: setCustomAddress,
- chain: destinationChain,
- onChangeWallet,
+ address: destinationAddress,
+ onChangeAddress:
+ customAddress ?
+ (address) => setCustomAddress(address ?? "")
+ : setDestinationAddress,
isShieldedAddress: false,
}}
- isShieldedTx={shielded}
errorMessage={generalErrorMessage || error?.message || ""}
currentStatus={currentStatus}
currentStatusExplanation={statusExplanation}
@@ -418,9 +355,8 @@ export const IbcWithdraw = (): JSX.Element => {
* from the confirmation event from target chain */
isSuccess
}
- ibcTransfer={"withdraw"}
requiresIbcChannels={requiresIbcChannels}
- ibcOptions={{
+ ibcChannels={{
sourceChannel,
onChangeSourceChannel: setSourceChannel,
}}
@@ -428,7 +364,9 @@ export const IbcWithdraw = (): JSX.Element => {
feeProps={feeProps}
onComplete={redirectToTimeline}
completedAt={completedAt}
- isSyncingMasp={requiresNewShieldedSync}
+ keplrWalletManager={keplrWalletManager}
+ assetSelectorModalOpen={assetSelectorModalOpen}
+ setAssetSelectorModalOpen={setAssetSelectorModalOpen}
/>
);
diff --git a/apps/namadillo/src/App/Ibc/ShieldAllIntro.tsx b/apps/namadillo/src/App/Ibc/ShieldAllIntro.tsx
index 5f08e6bc85..8d79b46153 100644
--- a/apps/namadillo/src/App/Ibc/ShieldAllIntro.tsx
+++ b/apps/namadillo/src/App/Ibc/ShieldAllIntro.tsx
@@ -44,7 +44,7 @@ export const ShieldAllIntro = ({
{displayChainModal && (
setDisplayChainModal(false)}
/>
diff --git a/apps/namadillo/src/App/Ibc/ShieldAllPanel.tsx b/apps/namadillo/src/App/Ibc/ShieldAllPanel.tsx
index 090c4c43a1..dcbaffb429 100644
--- a/apps/namadillo/src/App/Ibc/ShieldAllPanel.tsx
+++ b/apps/namadillo/src/App/Ibc/ShieldAllPanel.tsx
@@ -7,12 +7,7 @@ import {
import svgImg from "App/Assets/ShieldedParty.svg";
import { SelectedWallet } from "App/Transfer/SelectedWallet";
import { useEffect, useMemo, useState } from "react";
-import {
- Asset,
- AssetWithAmount,
- ChainRegistryEntry,
- WalletProvider,
-} from "types";
+import { Asset, AssetWithAmount, ChainRegistryEntry } from "types";
import {
SelectableAddressWithAssetAndAmount,
ShieldAllAssetList,
@@ -22,7 +17,6 @@ import ibcTransferImageBlack from "./assets/ibc-transfer-black.png";
type ShieldAllPanelProps = {
registry: ChainRegistryEntry;
- wallet: WalletProvider;
walletAddress: string;
isLoading: boolean;
assetList: AssetWithAmount[];
@@ -30,7 +24,6 @@ type ShieldAllPanelProps = {
};
export const ShieldAllPanel = ({
- wallet,
walletAddress,
isLoading,
assetList,
@@ -95,7 +88,6 @@ export const ShieldAllPanel = ({
Review and confirm assets to shield
{
return (
);
diff --git a/apps/namadillo/src/App/Icons/ShieldIcon.tsx b/apps/namadillo/src/App/Icons/ShieldIcon.tsx
index 219e0579fb..ff4d61078c 100644
--- a/apps/namadillo/src/App/Icons/ShieldIcon.tsx
+++ b/apps/namadillo/src/App/Icons/ShieldIcon.tsx
@@ -11,13 +11,13 @@ export const ShieldIcon = (): JSX.Element => {
cx="8.82703"
cy="9.20715"
r="7.45715"
- stroke="white"
+ stroke="currentColor"
strokeWidth="2"
/>
-
-
-
-
+
+
+
+
);
};
diff --git a/apps/namadillo/src/App/Icons/TransferIcon.tsx b/apps/namadillo/src/App/Icons/TransferIcon.tsx
new file mode 100644
index 0000000000..36021f998d
--- /dev/null
+++ b/apps/namadillo/src/App/Icons/TransferIcon.tsx
@@ -0,0 +1,27 @@
+export const TransferIcon = (): JSX.Element => {
+ return (
+
+ );
+};
diff --git a/apps/namadillo/src/App/Layout/Navigation.tsx b/apps/namadillo/src/App/Layout/Navigation.tsx
index 21e6230e82..c2965de050 100644
--- a/apps/namadillo/src/App/Layout/Navigation.tsx
+++ b/apps/namadillo/src/App/Layout/Navigation.tsx
@@ -1,4 +1,7 @@
import { SidebarMenuItem } from "App/Common/SidebarMenuItem";
+import { ReceiveIcon } from "App/Icons/ReceiveIcon";
+import { ShieldIcon } from "App/Icons/ShieldIcon";
+import { TransferIcon } from "App/Icons/TransferIcon";
import { routes } from "App/routes";
import { applicationFeaturesAtom } from "atoms/settings";
import { useAtomValue } from "jotai";
@@ -6,9 +9,8 @@ import { AiFillHome } from "react-icons/ai";
import { BsDiscord, BsTwitterX } from "react-icons/bs";
import { FaVoteYea } from "react-icons/fa";
import { FaBug } from "react-icons/fa6";
-import { GoHistory, GoStack } from "react-icons/go";
-import { IoSwapHorizontal } from "react-icons/io5";
-import { TbVectorTriangle } from "react-icons/tb";
+import { GoStack } from "react-icons/go";
+import { MdOutlineKeyboardBackspace } from "react-icons/md";
import { Link } from "react-router-dom";
import { DISCORD_URL, TWITTER_URL } from "urls";
@@ -32,21 +34,26 @@ export const Navigation = (): JSX.Element => {
url: routes.governance,
},
{
- label: "IBC Transfer",
- icon: ,
- url: features.ibcTransfersEnabled ? routes.ibc : undefined,
+ label: "Shield",
+ icon: ,
+ url: routes.maspShield,
},
{
label: "Transfer",
- icon: ,
+ icon: ,
url:
features.maspEnabled || features.namTransfersEnabled ?
routes.transfer
: undefined,
},
+ {
+ label: "Receive",
+ icon: ,
+ url: routes.receive,
+ },
{
label: "History",
- icon: ,
+ icon: ,
url:
features.namTransfersEnabled || features.ibcTransfersEnabled ?
routes.history
@@ -57,14 +64,27 @@ export const Navigation = (): JSX.Element => {
return (
- {menuItems.map((item) => (
- -
-
- {item.icon}
- {item.label}
-
-
- ))}
+ {menuItems.map((item) => {
+ const shieldingRoute = item.label === "Shield";
+ const historyRoute = item.label === "History";
+ return (
+ -
+ {shieldingRoute && (
+ <>
+
+ Move Assets
+ >
+ )}
+
+ {item.icon}
+ {item.label}
+
+ {historyRoute && (
+
+ )}
+
+ );
+ })}