@instadapp/avocado-base 0.0.0-dev.e2f5814 → 0.0.0-dev.e5c0876

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.
@@ -0,0 +1,12 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_13856_490518)">
3
+ <path d="M7 -6.11959e-07C3.13401 -9.49935e-07 9.49935e-07 3.13401 6.11959e-07 7C2.73984e-07 10.866 3.13401 14 7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 -2.73984e-07 7 -6.11959e-07Z" fill="currentColor"/>
4
+ <path d="M7.00391 9.72217L7.00391 7.38883" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M7.00391 4.27783L6.99391 4.27783" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0_13856_490518">
9
+ <rect width="14" height="14" fill="white" transform="translate(14 14) rotate(-180)"/>
10
+ </clipPath>
11
+ </defs>
12
+ </svg>
@@ -13,6 +13,7 @@ import InstadappProSVG from '~/assets/images/icons/instadapp-pro.svg'
13
13
  import PermitSignSVG from '~/assets/images/icons/permit-sign.svg'
14
14
  import RejectProposalSVG from '~/assets/images/icons/reject-proposal.svg'
15
15
  import UpgradeSVG from '~/assets/images/icons/upgrade.svg'
16
+ import HammerSVG from '~/assets/images/icons/hammer.svg'
16
17
 
17
18
  defineProps<{
18
19
  action: MetadataTypes
@@ -35,4 +36,5 @@ defineProps<{
35
36
  <InstadappProSVG v-else-if="action === 'instadapp-pro'"/>
36
37
  <PermitSignSVG v-else-if="action === 'permit2'"/>
37
38
  <UpgradeSVG v-else-if="action === 'upgrade'"/>
39
+ <HammerSVG v-else-if="action === 'tx-builder'"/>
38
40
  </template>
@@ -1,5 +1,4 @@
1
1
  <script lang="ts" setup>
2
-
3
2
  const props = defineProps<{
4
3
  metadata: {
5
4
  type: MetadataTypes
@@ -7,9 +6,11 @@ const props = defineProps<{
7
6
  };
8
7
  chain_id: number | string;
9
8
  compact?: boolean;
9
+ tokens?: ITokenPrice[];
10
10
  }>();
11
11
 
12
12
  provide('compact', props.compact);
13
+ provide('tokens', props.tokens);
13
14
 
14
15
  </script>
15
16
 
@@ -22,12 +23,16 @@ provide('compact', props.compact);
22
23
  <MetadataBridge v-if="metadata.type === 'bridge'" :metadata="metadata" :chain_id="chain_id" />
23
24
  <MetadataPermit2 v-if="metadata.type === 'permit2'" :metadata="metadata" :chain_id="chain_id" />
24
25
 
26
+ <div class="text-left w-fit capitalize" v-if="metadata.type === 'import'">
27
+ Import from {{ metadata.protocol }} ({{ (formatUsd(fromWei(metadata.valueInUsd, 10))) }})
28
+ </div>
29
+
25
30
  <div v-if="metadata.type === 'upgrade'" class="self-start">
26
31
  Wallet upgraded to {{ metadata?.version }}
27
32
  </div>
28
33
  <div v-if="metadata.type === 'dapp'" class="self-start flex items-center gap-2 text-primary">
29
34
  <a :href="metadata?.url" target="_blank" rel="noopener noreferrer">{{
30
- metadata?.name
35
+ metadata?.name || metadata?.url
31
36
  }}</a>
32
37
  <SvgoExternalLink />
33
38
  </div>
@@ -36,38 +41,38 @@ provide('compact', props.compact);
36
41
  </div>
37
42
  <div v-if="metadata.type === 'auth'" class="self-start capitalize flex gap-3">
38
43
  Authority {{ metadata.remove ? 'Removed' : 'Added' }}:
39
- <a
40
- class="text-primary break-all"
41
- :href="getExplorerUrl(metadata.chainId, `/address/${metadata.address}`)"
42
- target="_blank"
43
- >
44
- {{ shortenHash(metadata.address) }}
45
- </a>
46
- <div class="flex gap-3">
47
- <ChainLogo class="w-5 h-5" :chain="metadata.chainId"/>
48
- {{ chainIdToName(metadata.chainId) }}
49
- </div>
44
+ <a class="text-primary break-all" :href="getExplorerUrl(metadata.chainId, `/address/${metadata.address}`)"
45
+ target="_blank">
46
+ {{ shortenHash(metadata.address) }}
47
+ </a>
48
+ <div class="flex gap-3">
49
+ <ChainLogo class="w-5 h-5" :chain="metadata.chainId" />
50
+ {{ chainIdToName(metadata.chainId) }}
51
+ </div>
52
+ </div>
53
+ <div v-if="metadata.type === 'tx-builder'" class="self-start capitalize flex gap-3">
54
+ <span v-if="!compact">
55
+ Transaction Builder
56
+ </span> ({{ metadata?.actionCount }} {{ toBN(metadata?.actionCount).lt(2) ? 'action' : 'actions' }})
50
57
  </div>
51
58
  <div v-if="metadata.type === 'instadapp-pro'" class="self-start capitalize flex gap-3">
52
59
  Instadapp Pro |
53
60
  {{ metadata?.castDetails }}
54
61
  </div>
55
62
 
56
- <div v-if="metadata.type === 'add-signers' || metadata.type === 'remove-signers'" class="text-left w-fit" v-tippy="formatMultipleAddresses(metadata.addresses, false)" >
57
- {{ formatMultipleAddresses(metadata.addresses) }}
58
- </div>
63
+ <MetadataSigners v-if="metadata.type === 'add-signers' || metadata.type === 'remove-signers'" :metadata="metadata"
64
+ :compact="compact" />
59
65
 
60
- <div v-if="metadata.type === 'change-threshold'" class="text-left w-fit" >
61
- Change Threshold to {{ metadata.count }}
66
+ <div v-if="metadata.type === 'change-threshold'" class="text-left w-fit">
67
+ Change Threshold to {{ metadata.count }}
62
68
  </div>
63
69
 
64
70
  <div v-tippy="{
65
- content: metadata.id,
66
- maxWidth: 'none',
67
- interactive: true,
68
- }"
69
- v-if="metadata.type === 'rejection'" class="text-left w-fit">
70
- {{ shortenHash(metadata.id) }}
71
+ content: metadata.id,
72
+ maxWidth: 'none',
73
+ interactive: true,
74
+ }" v-if="metadata.type === 'rejection'" class="text-left w-fit">
75
+ {{ shortenHash(metadata.id) }}
71
76
  </div>
72
77
  </div>
73
- </template>
78
+ </template>
@@ -0,0 +1,38 @@
1
+ <script setup lang="ts">
2
+ import * as XXH from 'xxhashjs';
3
+
4
+ defineProps<{
5
+ address: string
6
+ }>();
7
+
8
+ const randomId = Math.random().toString(36).substr(2, 9);
9
+
10
+ function generateColor(address: string): string {
11
+ const hash = XXH.h32(address, 0xABCD).toNumber()
12
+
13
+ const hue = hash % 360
14
+ const saturation = 80 + (hash % 30)
15
+ const lightness = 70 + (hash % 20)
16
+
17
+ return `hsl(${hue}, ${saturation}%, ${lightness}%)`
18
+ }
19
+ </script>
20
+
21
+ <template>
22
+ <svg
23
+ :style="{
24
+ color: generateColor(address),
25
+ }" width="30" height="30" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 30 30"
26
+ >
27
+ <g fill="currentColor" :clip-path="`url(#${randomId})`">
28
+ <rect width="30" height="30" fill-opacity=".4" rx="15" />
29
+ <ellipse cx="15.004" cy="26.399" rx="11.4" ry="6.6" />
30
+ <circle cx="15" cy="12.75" r="5.4" />
31
+ </g>
32
+ <defs>
33
+ <clipPath :id="randomId">
34
+ <rect width="30" height="30" fill="#fff" rx="15" />
35
+ </clipPath>
36
+ </defs>
37
+ </svg>
38
+ </template>