diff --git a/components/rmrk/Profile/ProfileAssetsList.vue b/components/rmrk/Profile/ProfileAssetsList.vue index 623c3f5275..a02bd796c5 100644 --- a/components/rmrk/Profile/ProfileAssetsList.vue +++ b/components/rmrk/Profile/ProfileAssetsList.vue @@ -84,7 +84,7 @@ const updatedBalanceFor = async (balance: Promise, index: number) => { const assetToUsdValue = (asset: AssetItem) => { if (asset.symbol === 'KSM') { let value = checkInvalidBalanceFilter(asset.balance) - value = roundTo(formatBalance(value, 12, ''), 4) + value = roundTo(formatBalance(value, 12, ''), 4).replace(',', '.') return calculateExactUsdFromToken( value, $store.getters['fiat/getCurrentKSMValue'] @@ -93,7 +93,9 @@ const assetToUsdValue = (asset: AssetItem) => { if (asset.symbol === 'BSX') { let value = checkInvalidBalanceFilter(asset.balance) value = checkInvalidBalanceFilter( - roundTo(formatBalance(value, 12, ''), 4).replace(',', '') + roundTo(formatBalance(value, 12, ''), 4) + .replace(',', '') + .replace(/\s/g, '') ) return calculateExactUsdFromToken( value, diff --git a/store/identity.ts b/store/identity.ts index 7912d30a48..b47550e3d3 100644 --- a/store/identity.ts +++ b/store/identity.ts @@ -75,8 +75,11 @@ async function subscribeTokens( cb: (value: BalanceMap) => void ): UnsubscribePromise { if (api.query.tokens) { + const version = await api.query.system + .lastRuntimeUpgrade() + .then((value) => unwrapOrNull(value)?.specVersion.toNumber()) const kusamaTokenId = await api.query.assetRegistry - .assetIds('KSM') + .assetIds(Number(version) > 82 ? 'Kusama' : 'KSM') .then((value) => unwrapOrNull(value as Option)) const realKusamaTokenId = kusamaTokenId ? '5' : '1' return api.query.tokens.accounts.multi( @@ -152,6 +155,7 @@ export const actions = { tokenSub() return } + onApiConnect(endpoint, async (api) => { try { if (balanceSub) {