Skip to content

Commit

Permalink
Merge pull request #6098 from kodadot/fix/readd-dot
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwao authored May 25, 2023
2 parents 73f794c + 9d7e448 commit 80509de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 3 additions & 6 deletions components/balance/MultipleBalances.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
:key="key"
class="is-size-7">
<div v-for="(detail, token) in chain" :key="token" class="balance-row">
<div>{{ key.toUpperCase() }}</div>
<div class="is-capitalized">{{ key }}</div>
<div class="has-text-right">
{{ detail?.balance }}
</div>
Expand Down Expand Up @@ -60,6 +60,7 @@ const identityStore = useIdentityStore()
const { multiBalances, multiBalanceAssets } = storeToRefs(identityStore)

const mapToPrefix = {
polkadot: 'dot',
kusama: 'ksm',
basilisk: 'bsx',
statemine: 'stmn',
Expand All @@ -85,11 +86,7 @@ function calculateUsd(amount: string, token = 'KSM') {

return calculateExactUsdFromToken(
amountToNumber,
Number(
token === 'KSM'
? fiatStore.getCurrentKSMValue
: fiatStore.getCurrentBSXValue
)
Number(fiatStore.getCurrentTokenValue(token))
)
}

Expand Down
6 changes: 4 additions & 2 deletions stores/identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const DEFAULT_BALANCE_STATE = {
stmn: '0',
glmr: '0',
movr: '0',
dot: '0',
}

export interface IdentityMap {
Expand All @@ -28,15 +29,15 @@ type ChangeAddressRequest = {
apiUrl?: string
}

type ChainType = 'kusama' | 'basilisk' | 'statemine'
type ChainType = 'polkadot' | 'kusama' | 'basilisk' | 'statemine'
type ChainDetail = {
balance: string
nativeBalance: string
usd: string
selected: boolean
address: string
}
type ChainToken = Partial<Record<'ksm' | 'bsx', ChainDetail>>
type ChainToken = Partial<Record<'dot' | 'ksm' | 'bsx', ChainDetail>>

interface MultiBalances {
address: string
Expand Down Expand Up @@ -87,6 +88,7 @@ export const useIdentityStore = defineStore('identity', {
multiBalanceAssets: [
{ chain: 'kusama' },
{ chain: 'statemine' },
{ chain: 'polkadot', token: 'DOT' },
{ chain: 'basilisk', token: 'BSX' },
{ chain: 'basilisk', token: 'KSM', tokenId: getKusamaAssetId('bsx') },
],
Expand Down

0 comments on commit 80509de

Please sign in to comment.