Skip to content

Commit

Permalink
fix(xcm-chain-registry): ensure supportedNativeToken is defined befor…
Browse files Browse the repository at this point in the history
…e assignment
  • Loading branch information
snoopy1412 committed Nov 18, 2024
1 parent 7bc942f commit 6a2a9ce
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions src/utils/xcm-chain-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,24 +269,25 @@ export const getTokenList = ({
asset.symbol.toLowerCase() ===
fromChain.nativeToken.symbol.toLowerCase()
);

supportedNativeToken = {
...supportedNativeToken,
symbol: supportedNativeToken?.symbol || '',
decimals: supportedNativeToken?.decimals || 0,
paraID: Number(fromChain.id),
nativeChainID: fromChain.name.toLowerCase().replace(/\s/g, '-'),
reserveType: 'local' as ReserveType,
asset: 'Native' as AssetType,
xcmV1MultiLocation: JSON.stringify({
v1: {
parents: 1,
interior: {
x1: { parachain: fromChain.id }
if (supportedNativeToken) {
supportedNativeToken = {
...supportedNativeToken,
symbol: supportedNativeToken?.symbol || '',
decimals: supportedNativeToken?.decimals || 0,
paraID: Number(fromChain.id),
nativeChainID: fromChain.name.toLowerCase().replace(/\s/g, '-'),
reserveType: 'local' as ReserveType,
asset: 'Native' as AssetType,
xcmV1MultiLocation: JSON.stringify({
v1: {
parents: 1,
interior: {
x1: { parachain: fromChain.id }
}
}
}
})
};
})
};
}

const otherAssets =
fromChain.xcAssetsData
Expand Down

0 comments on commit 6a2a9ce

Please sign in to comment.