@instadapp/avocado-base 0.0.0-dev.a3a46f8 → 0.0.0-dev.a52088d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,50 +1,48 @@
1
1
  <script setup lang="ts">
2
-
3
2
  const props = defineProps<{
4
- metadata: any;
3
+ metadata: any
5
4
  chain_id: number | string
6
- }>();
5
+ }>()
7
6
 
8
- const compact = inject('compact');
9
- const tokens = inject<ITokenPrice[]>('tokens');
7
+ const compact = inject('compact')
8
+ const tokens = inject<ITokenPrice[]>('tokens')
10
9
 
11
10
  const token = asyncComputed(() => {
12
- if (!props?.chain_id) return null;
11
+ if (!props?.chain_id)
12
+ return null
13
13
 
14
- if (Array.isArray(tokens) && !tokens.length) return null;
14
+ if (Array.isArray(tokens) && !tokens.length)
15
+ return null
15
16
 
16
17
  return fetchTokenByAddress(
17
18
  props.metadata?.token,
18
19
  props?.chain_id,
19
- tokens
20
- );
21
- });
20
+ tokens,
21
+ )
22
+ })
22
23
 
23
24
  const formattedAmount = computed(() =>
24
25
  formatDecimal(
25
- fromWei(props.metadata?.amount, token?.value?.decimals).toFixed()
26
- )
27
- );
26
+ fromWei(props.metadata?.amount, token?.value?.decimals).toFixed(),
27
+ ),
28
+ )
28
29
  </script>
29
30
 
30
31
  <template>
31
32
  <div v-if="!token" class="rounded-5 w-24 h-4 loading-box" />
32
- <div class="flex items-center gap-5" v-else>
33
+ <div v-else class="flex items-center gap-5">
33
34
  <span v-if="!compact" class="capitalize text-xs sm:text-sm">{{ metadata.type }}</span>
34
35
  <span class="inline-flex gap-2.5 items-center">
35
- {{ formattedAmount }}
36
- <span class="uppercase">{{ token?.symbol }}</span>
37
- <img width="20" height="20" class="w-5 h-5" :src="token?.logo_url" />
38
- <SvgoArrowRight class="w-4 h-4 text-slate-400 mx-2" />
39
- <NuxtLink
40
- class="text-primary"
41
- target="_blank"
42
- external
43
- :to="
44
- getExplorerUrl(chain_id, `/address/${metadata.receiver}`)
45
- "
46
- >{{ shortenHash(metadata.receiver) }}
47
- </NuxtLink>
36
+ <span class="w-[8em]">
37
+ {{ formattedAmount }}
38
+ <span class="uppercase">{{ token?.symbol }}</span>
39
+ </span>
40
+ <img width="20" height="20" class="w-5 h-5" :src="token?.logo_url">
41
+ <SvgoArrowRight class="w-4 h-4 text-slate-400" />
42
+ <Address
43
+ :to="getExplorerUrl(chain_id, `/address/${metadata.receiver}`)"
44
+ :address="metadata.receiver"
45
+ />
48
46
  </span>
49
47
  </div>
50
48
  </template>