Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/namadillo/src/atoms/integrations/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,11 @@ export const getRestApiAddressByIndex = (chain: Chain, index = 0): string => {
return randomRestApi.address;
};

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

export const getChannelFromIbcInfo = (
Expand Down