Skip to content

Commit fa6dc95

Browse files
fix: incorrect inactive channel label (#2331)
1 parent da51e26 commit fa6dc95

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

apps/namadillo/src/atoms/integrations/functions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,11 @@ export const getRestApiAddressByIndex = (chain: Chain, index = 0): string => {
173173
return randomRestApi.address;
174174
};
175175

176+
// This only removes the "transfer/channel-X/" prefix from IBC denom traces
177+
// ex1: "transfer/channel-0/uatom" => "uatom"
178+
// ex2: "transfer/channel-1/transfer/channel-750/uusdc" => "transfer/channel-750/uusdc" - NOT SUPPORTED
176179
export const getDenomFromIbcTrace = (ibcAddress: string): string => {
177-
return ibcAddress.replaceAll(/(transfer\/|channel-\d+\/)*/gi, "");
180+
return ibcAddress.replace(/transfer\/channel-\d+\//i, "");
178181
};
179182

180183
export const getChannelFromIbcInfo = (

0 commit comments

Comments
 (0)