@instadapp/avocado-base 0.0.50 → 0.0.51

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.
@@ -15,6 +15,17 @@ const toToken = asyncComputed(() =>
15
15
  }
16
16
  );
17
17
 
18
+ const fromToken = asyncComputed(() =>
19
+ {
20
+ if (Array.isArray(tokens) && !tokens.length) return null;
21
+ return fetchTokenByAddress(props.metadata?.fromToken, props.chain_id, tokens)
22
+ }
23
+ );
24
+
25
+ const isTokensSame = computed(() => {
26
+ return toToken.value?.symbol === fromToken.value?.symbol
27
+ })
28
+
18
29
  const bridgeAmountFormatted = computed(() =>
19
30
  formatDecimal(
20
31
  fromWei(props.metadata?.amount, toToken?.value?.decimals).toFixed()
@@ -23,18 +34,23 @@ const bridgeAmountFormatted = computed(() =>
23
34
  </script>
24
35
 
25
36
  <template>
26
- <div v-if="!toToken" class="rounded-5 w-24 h-4 loading-box" />
37
+ <div v-if="!toToken || !fromToken" class="rounded-5 w-24 h-4 loading-box" />
27
38
  <div
28
39
  class="flex gap-5 items-center"
29
- v-if="metadata.type === 'bridge' && toToken"
40
+ v-if="toToken && fromToken"
30
41
  >
31
42
  <span v-if="!compact" class="capitalize text-xs sm:text-sm">{{ metadata.type }}</span>
32
43
  <span class="inline-flex gap-2.5 items-center">
33
- <img width="20" height="20" class="w-5 h-5" :src="toToken.logo_url" />
44
+ <img width="20" height="20" class="w-5 h-5" :src="fromToken.logo_url" />
34
45
  {{ bridgeAmountFormatted }}
35
- <span class="uppercase">{{ toToken?.symbol }}</span>
46
+ <span class="uppercase">{{ fromToken?.symbol }}</span>
36
47
  <SvgoBridge class="text-slate-400 w-4 h-4" />
48
+ <template v-if="!isTokensSame">
49
+ <img width="20" height="20" class="w-5 h-5" :src="toToken.logo_url" />
50
+ <span class="uppercase">{{ toToken?.symbol }}</span>
51
+ </template>
37
52
  <span class="flex items-center gap-2.5">
53
+ on
38
54
  <ChainLogo class="w-5" :chain="metadata.toChainId" />
39
55
  <span>{{ chainIdToName(metadata.toChainId) }}</span>
40
56
  </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/avocado-base",
3
- "version": "0.0.50",
3
+ "version": "0.0.51",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "global.d.ts",