Skip to content

Commit

Permalink
feat: Hide token market cap (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
janmichek committed Apr 2, 2024
1 parent 1c9b7e5 commit 1e4d0b1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
21 changes: 1 addition & 20 deletions src/components/TokenDetailsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,6 @@
{{ formatAePrice(tokenDetails.price) }} ({{ fiatPrice }})
</td>
</tr>
<tr
v-if="tokenDetails.marketCap"
class="token-details-panel__row">
<th class="token-details-panel__table-header">
Market cap
<hint-tooltip>
{{ tokensHints.marketCap }}
</hint-tooltip>
</th>
<td class="token-details-panel__data">
{{ marketCap }}
</td>
</tr>
<tr class="token-details-panel__row">
<th class="token-details-panel__table-header">
Total supply
Expand Down Expand Up @@ -151,7 +138,7 @@
<script setup>
import { storeToRefs } from 'pinia'
import { useMarketStatsStore } from '@/stores/marketStats'
import { formatAePrice, formatNullable, formatNumber } from '@/utils/format'
import { formatAePrice, formatNumber } from '@/utils/format'
import TokenSymbolIcon from '@/components/TokenSymbolIcon'
import { tokensHints } from '@/utils/hints/tokensHints'
Expand Down Expand Up @@ -180,12 +167,6 @@ const fiatPrice = computed(() =>
? `$${formatNumber(price.value * props.tokenDetails.price, null, null, 7)}`
: '---',
)
const marketCap = computed(() =>
props.tokenDetails.marketCap && price.value
? `$${formatNullable(formatNumber(props.tokenDetails.marketCap * price.value, 0, 2))}`
: '---',
)
</script>

<style scoped>
Expand Down
4 changes: 0 additions & 4 deletions src/utils/adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,6 @@ export function adaptTokenDetails(token, totalSupply = null, price = null) {
tokenDetails.totalSupply = (new BigNumber(totalSupply)).dividedBy(10 ** token.decimals).toNumber()
}

if (tokenDetails.totalSupply && price) {
tokenDetails.marketCap = (new BigNumber(tokenDetails.totalSupply)).multipliedBy(price).toNumber()
}

return tokenDetails
}

Expand Down
1 change: 0 additions & 1 deletion src/utils/hints/tokensHints.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export const tokensHints = {
smartContractId: 'Identifier of the smart contract that implements the AEX-9 fungible token standard.',
price: 'Price of the token in AE and USD.',
value: 'The total value of the tokens in USD. Prices of the tokens are sourced from Superhero DEX.',
marketCap: 'Total market value of the token calculated by multiplying the current price by the total circulating supply.',
totalSupply: 'Amount of tokens in circulation.',
decimals: 'The decimal granularity of each token.',
extensions: 'Extensions that are implemented for this token according to the creator of the smart contract.',
Expand Down

0 comments on commit 1e4d0b1

Please sign in to comment.