vault balances UI
This commit is contained in:
27
src/components/TokenRow.vue
Normal file
27
src/components/TokenRow.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<template>
|
||||
<tr>
|
||||
<td><v-img v-if="imageSrc" :src="imageSrc"/></td>
|
||||
<td>{{token.symbol}}</td>
|
||||
<td class="d-none d-sm-table-cell">{{token.name||''}}</td>
|
||||
<td>{{fixed}}</td>
|
||||
<td><!-- todo actions --></td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {useStore} from "@/store/store";
|
||||
import {getToken} from "@/blockchain/token.js";
|
||||
import {FixedNumber} from "ethers";
|
||||
import {computed} from "vue";
|
||||
const s = useStore()
|
||||
const props = defineProps(['addr','amount'])
|
||||
const token = await getToken(props.addr)
|
||||
console.log('token', props.addr, token)
|
||||
const fixed = computed(()=>FixedNumber.fromValue(props.amount, token.decimals, {width:256, decimals: token.decimals}))
|
||||
const imageSrc = computed(()=>null )
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@use "src/styles/vars" as *;
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user