diff --git a/src/renderer/shared/api/xcm/service/xcmService.ts b/src/renderer/shared/api/xcm/service/xcmService.ts index 32b02db87..6076f2efa 100644 --- a/src/renderer/shared/api/xcm/service/xcmService.ts +++ b/src/renderer/shared/api/xcm/service/xcmService.ts @@ -118,20 +118,29 @@ function getEstimatedRequiredDestWeight( return weight.gte(reserveWeight) ? weight : reserveWeight; } +function getFixedVersion(location: string) { + return { + // TODO: check Interlay transfer later + INTR: 'V2', + }[location]; +} + function getAssetLocation( api: ApiPromise, transferType: XcmTransferType, asset: AssetXCM, - assets: Record, + assetsConfig: Record, amount: BN, isArray = true, ): NonNullable | undefined { const type = getTypeName(api, transferType, isArray ? 'assets' : 'asset'); - const assetVersionType = getTypeVersion(api, type || ''); + const assetVersionType = getFixedVersion(asset.assetLocation) || getTypeVersion(api, type || ''); const PathMap: Record NonNullable | undefined> = { - relative: () => xcmUtils.getRelativeAssetLocation(assetVersionType, assets[asset.assetLocation].multiLocation), - absolute: () => xcmUtils.getAbsoluteAssetLocation(assetVersionType, assets[asset.assetLocation].multiLocation), + relative: () => + xcmUtils.getRelativeAssetLocation(assetVersionType, assetsConfig[asset.assetLocation].multiLocation), + absolute: () => + xcmUtils.getAbsoluteAssetLocation(assetVersionType, assetsConfig[asset.assetLocation].multiLocation), concrete: () => xcmUtils.getConcreteAssetLocation(assetVersionType, asset.assetLocationPath.path), };