diff --git a/.changeset/honest-wasps-itch.md b/.changeset/honest-wasps-itch.md new file mode 100644 index 0000000000..94fb1189c8 --- /dev/null +++ b/.changeset/honest-wasps-itch.md @@ -0,0 +1,5 @@ +--- +'minifront': patch +--- + +Hotfix IBC withdrawals diff --git a/apps/minifront/src/state/ibc-in/index.tsx b/apps/minifront/src/state/ibc-in/index.tsx index b92ac2800e..c1df59e271 100644 --- a/apps/minifront/src/state/ibc-in/index.tsx +++ b/apps/minifront/src/state/ibc-in/index.tsx @@ -203,18 +203,22 @@ async function execute( const transferToken = fromDisplayAmount(assetMetadata, coin.displayDenom, amount); - const { address: t_addr, encoding: encoding } = await penumbra - .service(ViewService) - .transparentAddress(new TransparentAddressRequest({})); - if (!t_addr) { - throw new Error('Error with generating IBC transparent address'); - } - // Temporary: detect USDC Noble inbound transfers, and use a transparent (t-addr) encoding // to ensure Bech32 encoding compatibility. if (transferToken.denom.includes('uusdc') && bech32ChainIds.includes(selectedChain.chainId)) { - // Set the reciever address to the t-addr encoding. - penumbraAddress = encoding; + // Set the receiver address to the t-addr encoding. + try { + const { address: t_addr, encoding: encoding } = await penumbra + .service(ViewService) + .transparentAddress(new TransparentAddressRequest({})); + if (!t_addr) { + throw new Error('Error with generating IBC transparent address'); + } + + penumbraAddress = encoding; + } catch (_) { + throw new Error('Error with generating IBC transparent address'); + } } const params: MsgTransfer = { diff --git a/apps/minifront/src/state/ibc-out.ts b/apps/minifront/src/state/ibc-out.ts index 396ab4e5b5..73ba822ae7 100644 --- a/apps/minifront/src/state/ibc-out.ts +++ b/apps/minifront/src/state/ibc-out.ts @@ -216,14 +216,6 @@ const getPlanRequest = async ({ const { timeoutHeight, timeoutTime } = await getTimeout(chain.channelId); - // Request transparent address from view service - const { address: t_addr } = await penumbra - .service(ViewService) - .transparentAddress(new TransparentAddressRequest({})); - if (!t_addr) { - throw new Error('Error with generating IBC transparent address'); - } - // IBC-related fields const denom = getMetadata(selection.balanceView).base; let useTransparentAddress = false; @@ -233,7 +225,19 @@ const getPlanRequest = async ({ if (denom.includes('uusdc') && bech32ChainIds.includes(chain.chainId)) { // Outbound IBC transfers timeout without setting either of these fields. useTransparentAddress = true; - returnAddress = t_addr; + + // Request transparent address from view service + try { + const { address: t_addr } = await penumbra + .service(ViewService) + .transparentAddress(new TransparentAddressRequest({})); + if (!t_addr) { + throw new Error('Error with generating IBC transparent address'); + } + returnAddress = t_addr; + } catch (e) { + throw new Error('Error with generating IBC transparent address'); + } } return new TransactionPlannerRequest({