diff --git a/components/forms/CreateTxForm/MsgForm/MsgTransferForm.tsx b/components/forms/CreateTxForm/MsgForm/MsgTransferForm.tsx index 895b7b4a..aa39f640 100644 --- a/components/forms/CreateTxForm/MsgForm/MsgTransferForm.tsx +++ b/components/forms/CreateTxForm/MsgForm/MsgTransferForm.tsx @@ -121,6 +121,25 @@ const MsgTransferForm = ({ senderAddress, setMsgGetter, deleteMsg }: MsgTransfer setMsgGetter({ isMsgValid, msg }); }, [chain.chainId, senderAddress, setMsgGetter, trimmedInputs]); + useEffect(() => { + if (!denom || !denom.startsWith("ibc/")) { + return; + } + + const foundDenom = chain.assets.find((asset) => asset.base === denom); + if (!foundDenom) { + return; + } + + const trace = foundDenom.traces?.[0]; + if (!trace) { + return; + } + + setSourcePort(trace.chain?.path?.split("/")?.[0] || "transfer"); + setSourceChannel(trace.chain?.channel_id || ""); + }, [chain.assets, denom]); + return (