@instadapp/avocado-base 0.0.0-dev.e9aa00c → 0.0.0-dev.ebef45a

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>
@@ -1,9 +1,21 @@
1
1
  <script setup lang="ts">
2
+ import * as XXH from 'xxhashjs';
3
+
2
4
  defineProps<{
3
5
  address: string
4
6
  }>();
5
7
 
6
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
+ }
7
19
  </script>
8
20
 
9
21
  <template>
@@ -1,201 +1,5 @@
1
1
  <template>
2
- <svg v-if="chain == 137" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
3
- <rect width="22" height="22" x="1" y="1" :fill="generateID('polygon', true)" rx="11" />
4
- <path fill="#fff"
5
- d="M15.086 9.927a.791.791 0 0 0-.752 0L12.58 10.97l-1.191.665-1.723 1.045a.791.791 0 0 1-.752 0l-1.347-.823a.773.773 0 0 1-.376-.665V9.61c0-.253.125-.506.376-.664l1.347-.792a.791.791 0 0 1 .752 0l1.347.823c.22.127.376.38.376.665v1.045l1.19-.697V8.914a.782.782 0 0 0-.375-.665L9.697 6.762a.791.791 0 0 0-.752 0L6.376 8.28A.697.697 0 0 0 6 8.914v2.975c0 .254.125.507.376.665l2.538 1.488c.22.126.501.126.752 0l1.723-1.013 1.19-.697 1.724-1.012a.791.791 0 0 1 .752 0l1.347.79c.22.128.376.38.376.666v1.582a.782.782 0 0 1-.376.665l-1.316.791a.791.791 0 0 1-.752 0l-1.347-.791a.773.773 0 0 1-.376-.665v-1.013l-1.19.697v1.044c0 .253.125.507.375.665l2.538 1.487c.22.127.502.127.752 0l2.538-1.487a.773.773 0 0 0 .376-.665V12.08a.782.782 0 0 0-.376-.665l-2.538-1.487Z" />
6
- <rect v-if="stroke" :class="strokeClass" width="22" height="22" x="1" y="1" rx="11" />
7
- <defs>
8
- <linearGradient :id="generateID('polygon')" x1="12" x2="12" y1="2" y2="22" gradientUnits="userSpaceOnUse">
9
- <stop stop-color="#A177FA" />
10
- <stop offset="1" stop-color="#7A4ADD" />
11
- </linearGradient>
12
- </defs>
13
- </svg>
14
- <svg v-else-if="chain == 42161" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
15
- <rect width="22" height="22" x="1" y="1" :fill="generateID('arb', true)" rx="11" />
16
- <path fill="#28A0F0"
17
- d="m12.031 13.969 1.704 2.673 1.574-.912-2.238-3.526-1.04 1.765ZM16.743 14.658v-.73l-2.445-3.808-.907 1.539 2.36 3.817.853-.495a.378.378 0 0 0 .14-.275v-.048Z" />
18
- <path fill="#fff"
19
- d="m6.5 15.347 1.205.694 4.01-6.43-.68-.018c-.58-.008-1.205.142-1.492.61l-2.277 3.53L6.5 14.91v.437ZM14.023 9.61l-1.793.007-4.058 6.696 1.418.817.386-.654 4.047-6.865Z" />
20
- <path fill="#96BEDC"
21
- d="M17.5 9.602a1.143 1.143 0 0 0-.536-.919l-4.46-2.564a1.16 1.16 0 0 0-1.022 0c-.037.019-4.336 2.512-4.336 2.512a1.146 1.146 0 0 0-.646.968v5.31l.766-1.176-.007-4.098a.377.377 0 0 1 .158-.285 2599 2599 0 0 1 4.406-2.552.388.388 0 0 1 .337-.002l4.401 2.532c.104.066.17.179.175.302v5.076a.37.37 0 0 1-.131.275l-.854.494-.44.255-1.574.912-1.595.925a.387.387 0 0 1-.272-.005l-1.888-1.086-.386.654 1.697.977a43.674 43.674 0 0 0 .27.15c.12.059.293.093.45.093.143 0 .283-.026.415-.078l4.635-2.685c.266-.206.423-.517.437-.854V9.602Z" />
22
- <rect v-if="stroke" :class="strokeClass" width="22" height="22" x="1" y="1" rx="11" />
23
- <defs>
24
- <linearGradient :id="generateID('arb')" x1="12" x2="12" y1="2" y2="22" gradientUnits="userSpaceOnUse">
25
- <stop stop-color="#495775" />
26
- <stop offset="1" stop-color="#2D374B" />
27
- </linearGradient>
28
- </defs>
29
- </svg>
30
-
31
- <svg v-else-if="chain == 43114" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
32
- <rect width="22" height="22" x="1" y="1" :fill="generateID('avax', true)" rx="11" />
33
- <path fill="#fff" fill-rule="evenodd"
34
- d="M12.447 6.96c-.259-.447-.67-.447-.93 0l-4.696 8.27c-.258.453-.047.812.47.812H9.65c.476-.03.905-.283 1.164-.682l2.839-4.92a1.545 1.545 0 0 0 0-1.346l-.847-1.487-.358-.647Zm3.121 5.443c-.259-.447-.676-.447-.934 0l-1.64 2.827c-.253.447-.042.811.47.811h3.244c.518 0 .73-.364.47-.81l-1.61-2.828Z"
35
- clip-rule="evenodd" />
36
- <rect v-if="stroke" :class="strokeClass" width="22" height="22" x="1" y="1" rx="11" />
37
- <defs>
38
- <linearGradient :id="generateID('avax')" x1="12" x2="12" y1="2" y2="22" gradientUnits="userSpaceOnUse">
39
- <stop stop-color="#FF8585" />
40
- <stop offset="1" stop-color="#EB5757" />
41
- </linearGradient>
42
- </defs>
43
- </svg>
44
-
45
- <svg v-else-if="chain == 1" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
46
- <rect width="22" height="22" x="1" y="1" :fill="generateID('eth', true)" rx="11" />
47
- <path fill="#fff" d="M8 12.111 11.998 6v.003L12 6l3.998 6.11.002.001-3.998 2.177h-.002L8 12.111Z" />
48
- <path fill="#fff" d="M11.998 17.997V18L8 12.81l3.998 2.176H12L16 12.81 12 18l-.002-.003Z" />
49
- <rect v-if="stroke" :class="strokeClass" width="22" height="22" x="1" y="1" rx="11" />
50
- <defs>
51
- <linearGradient :id="generateID('eth')" x1="12" x2="12" y1="2" y2="22" gradientUnits="userSpaceOnUse">
52
- <stop stop-color="#8E90FF" />
53
- <stop offset="1" stop-color="#5D5FEF" />
54
- </linearGradient>
55
- </defs>
56
- </svg>
57
-
58
- <svg v-else-if="chain == 10" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
59
- <rect width="22" height="22" x="1" y="1" :fill="generateID('opt', true)" rx="11" />
60
- <path fill="#fff"
61
- d="M9.084 14.656c-.596 0-1.084-.14-1.464-.42-.376-.284-.564-.692-.564-1.216 0-.112.012-.244.036-.404a24.3 24.3 0 0 1 .276-1.3c.34-1.376 1.22-2.064 2.636-2.064.384 0 .732.064 1.036.196a1.532 1.532 0 0 1 .984 1.472c0 .104-.012.236-.036.396-.076.444-.164.88-.272 1.3-.176.684-.476 1.2-.908 1.54-.428.336-1.004.5-1.724.5Zm.108-1.08c.28 0 .516-.084.712-.248.2-.164.344-.416.428-.76.116-.472.204-.88.264-1.232.02-.104.032-.212.032-.324 0-.456-.236-.684-.712-.684a1.1 1.1 0 0 0-.72.248c-.196.164-.336.416-.42.76-.092.336-.18.744-.272 1.232-.02.1-.032.204-.032.316-.004.464.24.692.72.692ZM12.372 14.584c-.056 0-.096-.016-.128-.052-.024-.04-.032-.084-.024-.136l1.036-4.88a.2.2 0 0 1 .084-.136.22.22 0 0 1 .144-.052h1.996c.556 0 1 .116 1.336.344.34.232.512.564.512 1 0 .124-.016.256-.044.392-.124.576-.376 1-.76 1.276-.376.276-.892.412-1.548.412h-1.012l-.344 1.644a.215.215 0 0 1-.084.136.22.22 0 0 1-.144.052h-1.02Zm2.656-2.868a.886.886 0 0 0 .548-.172.822.822 0 0 0 .316-.496c.016-.084.024-.16.024-.224 0-.144-.044-.256-.128-.332-.084-.08-.232-.12-.436-.12h-.9l-.284 1.344h.86Z" />
62
- <rect v-if="stroke" :class="strokeClass" width="22" height="22" x="1" y="1" rx="11" />
63
- <defs>
64
- <linearGradient :id="generateID('opt')" x1="12" x2="12" y1="2" y2="22" gradientUnits="userSpaceOnUse">
65
- <stop stop-color="#FF697A" />
66
- <stop offset="1" stop-color="#FF0420" />
67
- </linearGradient>
68
- </defs>
69
- </svg>
70
-
71
- <svg v-else-if="chain == 100" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
72
- <rect width="22" height="22" x="1" y="1" :fill="generateID('gnosis', true)" rx="11" />
73
- <g fill="#fff" clip-path="url(#clip0_1_911)">
74
- <path
75
- d="M9.527 12.833c.345 0 .681-.115.953-.325L8.293 10.32c-.527.68-.4 1.662.28 2.19.276.207.61.322.954.322ZM16.032 11.271c0-.345-.115-.681-.325-.953l-2.187 2.187a1.559 1.559 0 0 0 2.512-1.234Z" />
76
- <path
77
- d="m17.134 8.89-.968.968a2.204 2.204 0 0 1-3.103 3.104L12 14.024l-1.06-1.06a2.204 2.204 0 0 1-3.104-3.103l-.496-.497-.47-.473A6 6 0 1 0 18 12a5.985 5.985 0 0 0-.866-3.11Z" />
78
- <path
79
- d="M16.34 7.859a5.997 5.997 0 0 0-9.1.49L12 13.114l4.76-4.763a5.804 5.804 0 0 0-.42-.491ZM12 6.785c1.402 0 2.708.541 3.69 1.528L12 12.003l-3.69-3.69A5.157 5.157 0 0 1 12 6.785Z" />
80
- </g>
81
- <rect v-if="stroke" :class="strokeClass" width="22" height="22" x="1" y="1" rx="11" />
82
- <defs>
83
- <linearGradient :id="generateID('gnosis')" x1="12" x2="12" y1="2" y2="22" gradientUnits="userSpaceOnUse">
84
- <stop stop-color="#2BA889" />
85
- <stop offset="1" stop-color="#04795C" />
86
- </linearGradient>
87
- <clipPath id="clip0_1_911">
88
- <path fill="#fff" d="M6 6h12v12H6z" />
89
- </clipPath>
90
- </defs>
91
- </svg>
92
-
93
- <svg v-else-if="chain == 56" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
94
- <rect width="22" height="22" x="1" y="1" :fill="generateID('bsc', true)" rx="11" />
95
- <path fill="#fff"
96
- d="M13.13 15.965v1.346L11.983 18l-1.113-.69v-1.345l1.113.69 1.145-.69ZM7 11.31l1.113.69v2.308l1.916 1.173v1.346L7 14.997V11.31Zm9.967 0v3.693l-3.061 1.83v-1.346l1.916-1.174v-2.307l1.145-.696ZM13.9 9.481l1.146.69v1.345l-1.917 1.174v2.34l-1.113.69-1.107-.69v-2.346l-1.987-1.173v-1.346l1.145-.69 1.917 1.174L13.9 9.48Zm-4.978 2.997 1.113.69v1.345l-1.113-.69v-1.345Zm6.124 0v1.346l-1.113.69v-1.346l1.113-.69Zm-6.933-4.17 1.145.69-1.145.689v1.345L7 10.342V8.998l1.113-.69Zm7.742 0 1.145.69v1.345l-1.146.69V9.686l-1.112-.69 1.112-.69Zm-3.871 0 1.145.69-1.145.689-1.113-.69 1.113-.69Zm0-2.308 3.062 1.83-1.113.689-1.917-1.173-1.954 1.173-1.113-.69L11.984 6Z" />
97
- <rect v-if="stroke" :class="strokeClass" width="22" height="22" x="1" y="1" rx="11" />
98
- <defs>
99
- <linearGradient :id="generateID('bsc')" x1="12" x2="12" y1="2" y2="22" gradientUnits="userSpaceOnUse">
100
- <stop stop-color="#FFD97C" />
101
- <stop offset="1" stop-color="#F3BA2F" />
102
- </linearGradient>
103
- </defs>
104
- </svg>
105
- <svg v-else-if="chain == 1101" width="24" height="24" viewBox="0 0 24 24" fill="none"
106
- xmlns="http://www.w3.org/2000/svg">
107
- <rect x="1" y="1" width="22" height="22" rx="11" :fill="generateID('zkevm', true)" />
108
- <g clip-path="url(#clip0_0_68)">
109
- <path
110
- d="M16.4587 8.44406L12.8483 6.35851C12.5897 6.21032 12.2968 6.13235 11.9988 6.13235C11.7007 6.13235 11.4079 6.21032 11.1493 6.35851L7.53885 8.44406C7.28051 8.59322 7.06599 8.80775 6.91687 9.06611C6.76774 9.32446 6.68927 9.61753 6.68934 9.91583V14.0954C6.6915 14.3916 6.77102 14.682 6.92004 14.9379C7.06905 15.1939 7.28237 15.4064 7.53885 15.5545L11.1493 17.64C11.4076 17.7891 11.7005 17.8676 11.9988 17.8676C12.297 17.8676 12.59 17.7891 12.8483 17.64L16.4587 15.5545C16.7171 15.4053 16.9316 15.1908 17.0807 14.9324C17.2298 14.6741 17.3083 14.381 17.3082 14.0827V9.90309C17.3061 9.60696 17.2265 9.31652 17.0775 9.06058C16.9285 8.80467 16.7152 8.59213 16.4587 8.44406ZM7.53885 9.91583C7.53864 9.7665 7.57778 9.61975 7.65234 9.49037C7.72693 9.36098 7.83428 9.25356 7.9636 9.1789L11.574 7.09546C11.703 7.02038 11.8496 6.98082 11.9988 6.98082C12.148 6.98082 12.2946 7.02038 12.4235 7.09546L16.034 9.1789C16.1614 9.25247 16.2676 9.3579 16.3421 9.48485C16.4165 9.6118 16.4567 9.75594 16.4587 9.90309V10.3278C16.4576 10.6585 16.3256 10.9753 16.0916 11.2089C15.8576 11.4425 15.5406 11.5739 15.2099 11.5745H8.78763C8.33748 11.5734 7.89916 11.7188 7.53885 11.9886V9.91583ZM16.4587 14.0827C16.4589 14.232 16.4198 14.3788 16.3452 14.5082C16.2706 14.6375 16.1633 14.745 16.034 14.8196L12.4235 16.9031C12.2944 16.9776 12.1479 17.0169 11.9988 17.0169C11.8497 17.0169 11.7032 16.9776 11.574 16.9031L7.9636 14.8196C7.83613 14.7461 7.72997 14.6406 7.65551 14.5137C7.58105 14.3867 7.54084 14.2426 7.53885 14.0954V13.6707C7.53998 13.34 7.67196 13.0233 7.90597 12.7896C8.13999 12.556 8.45697 12.4246 8.78763 12.424H15.2099C15.6601 12.4251 16.0984 12.2797 16.4587 12.0099V14.0827Z"
111
- fill="white" />
112
- <path
113
- d="M10.026 9.70346H10.85V10.9374H11.6995V9.70346C11.6995 9.47816 11.61 9.26208 11.4507 9.10276C11.2914 8.94345 11.0753 8.85395 10.85 8.85395H10.026C9.80068 8.85395 9.58461 8.94345 9.42528 9.10276C9.26597 9.26208 9.17647 9.47816 9.17647 9.70346V10.9374H10.026V9.70346Z"
114
- fill="white" />
115
- <path
116
- d="M10.85 14.295H10.026V13.0611H9.17647V14.295C9.17647 14.5203 9.26597 14.7364 9.42528 14.8957C9.58461 15.055 9.80068 15.1445 10.026 15.1445H10.85C11.0753 15.1445 11.2914 15.055 11.4507 14.8957C11.61 14.7364 11.6995 14.5203 11.6995 14.295V13.0611H10.85V14.295Z"
117
- fill="white" />
118
- <path
119
- d="M13.3707 9.70346H14.1968V10.9374H15.0463V9.70346C15.0463 9.47816 14.9568 9.26208 14.7975 9.10276C14.6382 8.94345 14.4221 8.85395 14.1968 8.85395H13.3707C13.1454 8.85395 12.9293 8.94345 12.77 9.10276C12.6106 9.26208 12.5211 9.47816 12.5211 9.70346V10.9374H13.3707V9.70346Z"
120
- fill="white" />
121
- <path
122
- d="M14.1968 14.295H13.3707V13.0611H12.5211V14.295C12.5211 14.5203 12.6106 14.7364 12.77 14.8957C12.9293 15.055 13.1454 15.1445 13.3707 15.1445H14.1968C14.4221 15.1445 14.6382 15.055 14.7975 14.8957C14.9568 14.7364 15.0463 14.5203 15.0463 14.295V13.0611H14.1968V14.295Z"
123
- fill="white" />
124
- </g>
125
- <rect x="1" y="1" width="22" height="22" rx="11" v-if="stroke" :class="strokeClass" />
126
- <defs>
127
- <linearGradient :id="generateID('zkevm')" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse">
128
- <stop stop-color="#A177FA" />
129
- <stop offset="1" stop-color="#7A4ADD" />
130
- </linearGradient>
131
- <clipPath id="clip0_0_68">
132
- <rect width="12" height="12" fill="white" transform="translate(6 6)" />
133
- </clipPath>
134
- </defs>
135
- </svg>
136
-
137
- <svg v-else-if="chain == 1313161554" width="24" height="24" viewBox="0 0 24 24" fill="none"
138
- xmlns="http://www.w3.org/2000/svg">
139
- <rect x="1" y="1" width="22" height="22" rx="11" :fill="generateID('aurora', true)" />
140
- <path
141
- d="M11.9961 7.26624C12.4182 7.26624 12.8014 7.505 12.9902 7.88257L16.1114 14.1291C16.3835 14.6788 16.1614 15.3451 15.6116 15.6172C15.4561 15.6949 15.2894 15.7338 15.1173 15.7338H8.87486C8.26395 15.7338 7.76411 15.234 7.76411 14.6233C7.76411 14.4511 7.80299 14.279 7.88074 14.1291L11.0019 7.88257C11.1908 7.49944 11.574 7.26069 11.9961 7.26624ZM11.9961 6.5C11.2852 6.5 10.6354 6.89978 10.3188 7.53831L7.19763 13.7848C6.73667 14.7121 7.10877 15.8337 8.03624 16.3001C8.29727 16.4278 8.58607 16.5 8.87486 16.5H15.1228C16.1558 16.5 17 15.6616 17 14.6288C17 14.3401 16.9334 14.0514 16.8001 13.7904L13.6733 7.53831C13.3567 6.89978 12.707 6.5 11.9961 6.5Z"
142
- fill="white" />
143
- <rect x="1" y="1" width="22" height="22" rx="11" stroke-width="2" v-if="stroke" :class="strokeClass" />
144
- <defs>
145
- <linearGradient :id="generateID('aurora')" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse">
146
- <stop stop-color="#8EEF6B" />
147
- <stop offset="1" stop-color="#70D44B" />
148
- </linearGradient>
149
- </defs>
150
- </svg>
151
-
152
- <svg v-else-if="chain == 250" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
153
- <rect x="1" y="1" width="22" height="22" rx="11" :fill="generateID('fantom', true)" />
154
- <path fill-rule="evenodd" clip-rule="evenodd"
155
- d="M12.75 10.0625L15 8.75V11.375L12.75 10.0625ZM15 15.6875L12 17.4375L9 15.6875V12.625L12 14.375L15 12.625V15.6875ZM9 8.75L11.25 10.0625L9 11.375V8.75ZM12.375 10.6875L14.625 12L12.375 13.3125V10.6875ZM11.625 13.3125L9.375 12L11.625 10.6875V13.3125ZM14.625 8.125L12 9.625L9.375 8.125L12 6.5625L14.625 8.125ZM8.25 7.875V16.0625L12 18.1875L15.75 16.0625V7.875L12 5.75L8.25 7.875Z"
156
- fill="white" />
157
- <rect x="1" y="1" width="22" height="22" rx="11" stroke-width="2" v-if="stroke" :class="strokeClass" />
158
- <defs>
159
- <linearGradient :id="generateID('fantom')" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse">
160
- <stop stop-color="#51D3FF" />
161
- <stop offset="1" stop-color="#13B5EC" />
162
- </linearGradient>
163
- </defs>
164
- </svg>
165
-
166
- <svg v-else-if="chain == 634 || chain == 63400" width="24" height="24" viewBox="0 0 24 24" fill="none"
167
- xmlns="http://www.w3.org/2000/svg">
168
- <rect x="1" y="1" width="22" height="22" rx="11" :fill="generateID('avo', true)" />
169
- <path
170
- d="M11.9999 17.4052C11.9999 17.7497 12.2787 18.0322 12.6197 17.997C15.6422 17.6854 18 15.1194 18 12C18 8.88061 15.6422 6.31462 12.6197 6.00299C12.2787 5.96765 11.9999 6.25038 11.9999 6.59486V8.25799C11.9999 8.60246 12.2806 8.87521 12.6167 8.94319C14.0353 9.2307 15.1035 10.4899 15.1035 12C15.1035 13.5101 14.0353 14.7693 12.6167 15.0569C12.2806 15.1248 11.9999 15.3978 11.9999 15.7421V17.4052ZM10.1378 7.12664C10.1378 6.70254 9.7247 6.4036 9.34642 6.59132C7.36369 7.57527 6 9.62756 6 12C6 14.3725 7.36369 16.4248 9.34642 17.4087C9.7247 17.5964 10.1378 17.2975 10.1378 16.8734V7.12685V7.12664Z"
171
- fill="white" />
172
- <rect x="1" y="1" width="22" height="22" rx="11" stroke="black" stroke-width="2" v-if="stroke" :class="strokeClass" />
173
- <defs>
174
- <linearGradient :id="generateID('avo')" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse">
175
- <stop stop-color="#6ED578" />
176
- <stop offset="1" stop-color="#4CA054" />
177
- </linearGradient>
178
- </defs>
179
- </svg>
180
-
181
- <svg v-else-if="chain == 8453" width="24" height="24" viewBox="0 0 24 24" fill="none"
182
- xmlns="http://www.w3.org/2000/svg">
183
- <rect x="1" y="1" width="22" height="22" rx="11" :fill="generateID('base', true)" />
184
- <path
185
- d="M11.9896 18C15.3091 18 18 15.3137 18 12C18 8.68628 15.3091 6 11.9896 6C8.84021 6 6.2566 8.41794 6 11.4956H13.9445V12.5043H6C6.2566 15.582 8.84021 18 11.9896 18Z"
186
- fill="white" />
187
- <rect v-if="stroke" :class="strokeClass" x="1" y="1" width="22" height="22" rx="11" stroke="#111827"
188
- stroke-width="2" />
189
- <defs>
190
- <linearGradient :id="generateID('base')" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse">
191
- <stop stop-color="#427FFF" />
192
- <stop offset="1" stop-color="#0052FF" />
193
- </linearGradient>
194
- </defs>
195
- </svg>
196
-
197
-
198
- <template v-else>
2
+ <template v-if="isNetworkNotAvailable">
199
3
  <svg v-bind="$attrs" class="dark:hidden block" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">
200
4
  <rect width="20" height="20" fill="#CBD5E1" rx="10" />
201
5
  <path fill="#fff" fill-rule="evenodd"
@@ -209,20 +13,17 @@
209
13
  clip-rule="evenodd" />
210
14
  </svg>
211
15
  </template>
16
+ <span v-else-if="stroke" class="outline stroke-color dark:outline-[#161E2D] outline-[#F8FAFC] outline-2 shrink-0 outline outline-offset-[-1.5px] rounded-full">
17
+ <img class="w-full h-full" :src="`https://cdn.instadapp.io/avocado/networks/${chain}.svg`"/>
18
+ </span>
19
+ <img v-else :src="`https://cdn.instadapp.io/avocado/networks/${chain}.svg`"/>
212
20
  </template>
213
21
 
214
22
  <script lang="ts" setup>
215
- defineProps<{
216
- chain: ChainId | number | string;
23
+ const props = defineProps<{
24
+ chain?: ChainId | number | string;
217
25
  stroke?: boolean;
218
26
  }>();
219
27
 
220
- const randomId = Math.random().toString(36).substr(2, 9);
221
-
222
- const generateID = (prefix: string, wrapURL = false) => {
223
- const merged = `${prefix}-${randomId}`;
224
- return wrapURL ? `url(#${merged})` : merged;
225
- };
226
-
227
- const strokeClass = "dark:stroke-gray-900 stroke-slate-50 stroke-2";
28
+ const isNetworkNotAvailable = computed(() => !networks.some((network) => String(network.chainId) === String(props.chain)))
228
29
  </script>
@@ -15,26 +15,42 @@ 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
- fromWei(props.metadata?.amount, toToken?.value?.decimals).toFixed()
31
+ fromWei(props.metadata?.amount, fromToken?.value?.decimals).toFixed()
21
32
  )
22
33
  );
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>
@@ -1,6 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  import { Tippy } from 'vue-tippy'
3
- const props = defineProps<{
3
+ import Info2 from '~/assets/images/icons/info-2.svg'
4
+
5
+ defineProps<{
4
6
  metadata: {
5
7
  type: MetadataTypes,
6
8
  [key: string]: any
@@ -10,30 +12,30 @@ const props = defineProps<{
10
12
  </script>
11
13
 
12
14
  <template>
13
- <div>
15
+ <div class="font-medium">
14
16
  <div v-if="!compact || metadata.addresses.length < 3" class="flex gap-[14px] flex-wrap">
15
- <div v-for="address of metadata.addresses" :key="address" class="flex gap-[8px] rounded-full bg-slate-50 dark:bg-gray-850 justify-start items-center px-[8px] py-[6px]">
17
+ <div v-for="address of metadata.addresses" :key="address" class="flex gap-2 rounded-full bg-slate-100 dark:bg-slate-800 justify-start items-center px-2 py-1.5">
16
18
  <AuthorityAvatar :address="address" class="w-[18px] h-[18px]" />
17
- <p class="text-xs leading-5">
19
+ <p class="text-xs leading-5 text-slate-500 dark:text-slate-400">
18
20
  {{ shortenHash(address, compact ? 2 : 4) }}
19
21
  </p>
20
22
  </div>
21
23
  </div>
22
24
  <div v-else class="flex gap-2 flex-wrap items-center">
23
- <div v-for="address of [metadata.addresses[0], metadata.addresses[1]]" :key="address" class="flex gap-[8px] rounded-full bg-slate-50 dark:bg-gray-850 justify-start items-center px-[8px] py-[6px]">
25
+ <div v-for="address of [metadata.addresses[0], metadata.addresses[1]]" :key="address" class="flex gap-2 rounded-full bg-slate-100 dark:bg-slate-800 justify-start items-center px-2 py-1.5">
24
26
  <AuthorityAvatar :address="address" class="w-[18px] h-[18px]" />
25
- <p class="text-xs leading-5">
27
+ <p class="text-xs leading-5 text-slate-400">
26
28
  {{ shortenHash(address, 2) }}
27
29
  </p>
28
30
  </div>
29
31
  ...
30
32
  <Tippy max-width="none" interactive tag="button" content-tag="div" content-class="content-wrapper">
31
33
  <template #default>
32
- <SvgoInfo2 class="w-[16px] h-[16px] text-slate-500 rounded-full" />
34
+ <Info2 class="w-[16px] h-[16px] text-slate-500 rounded-full" />
33
35
  </template>
34
36
  <template #content>
35
37
  <ul class="flex flex-col gap-2.5">
36
- <li v-for="address in metadata.addresses" :key="address" class="flex text-xs items-center gap-2.5">
38
+ <li v-for="address in metadata.addresses" :key="address" class="flex text-xs text-slate-400 items-center gap-2.5">
37
39
  <AuthorityAvatar class="shrink-0 w-5 h-5" :address="address" />
38
40
  {{ address }}
39
41
  </li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/avocado-base",
3
- "version": "0.0.0-dev.e9aa00c",
3
+ "version": "0.0.0-dev.ebef45a",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "global.d.ts",
package/utils/helper.ts CHANGED
@@ -1,5 +1,3 @@
1
- import * as XXH from 'xxhashjs';
2
-
3
1
  export const indexSorter = (aIndex: number, bIndex: number) => {
4
2
  if (aIndex === -1 && bIndex === -1) {
5
3
  return 0; // fallback to other sorting criteria
@@ -62,12 +60,3 @@ export function formatMultipleAddresses(addresses: string[], shorten = true) {
62
60
  return formattedString
63
61
  }
64
62
 
65
- export function generateColor(address: string): string {
66
- const hash = XXH.h32(address, 0xABCD).toNumber()
67
-
68
- const hue = hash % 360
69
- const saturation = 80 + (hash % 30)
70
- const lightness = 70 + (hash % 20)
71
-
72
- return `hsl(${hue}, ${saturation}%, ${lightness}%)`
73
- }
package/utils/network.ts CHANGED
@@ -1,30 +1,18 @@
1
1
  import { ethers } from "ethers";
2
+ import {
3
+ AVO_PROD_CHAIN_NAME,
4
+ AVO_PROD_CHAIN_ID,
5
+ AVO_PROD_RPC_URL,
6
+ AVO_PROD_EXPLORER_URL,
7
+ AVO_STAGING_CHAIN_NAME,
8
+ AVO_STAGING_CHAIN_ID,
9
+ AVO_STAGING_RPC_URL,
10
+ AVO_STAGING_EXPLORER_URL,
11
+ } from './avocado'
2
12
 
3
13
  export const bridgeDisabledNetworks = [1101];
4
14
 
5
15
  export const networks: Network[] = [
6
- {
7
- name: "Ethereum",
8
- debankName: "eth",
9
- ankrName: "eth",
10
- zerionName: "ethereum",
11
- chainId: 1,
12
- explorerUrl: "https://etherscan.io",
13
- color: "#5D5FEF",
14
- get serverRpcUrl() {
15
- return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
16
- },
17
- balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
18
- usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
19
- params: {
20
- rpcUrls: ["https://rpc.ankr.com/eth"],
21
- nativeCurrency: {
22
- name: "Ethereum",
23
- symbol: "ETH",
24
- decimals: 18,
25
- },
26
- },
27
- },
28
16
  {
29
17
  name: "Polygon",
30
18
  debankName: "matic",
@@ -35,6 +23,7 @@ export const networks: Network[] = [
35
23
  balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
36
24
  usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
37
25
  explorerUrl: "https://polygonscan.com",
26
+ apiURL: 'https://api.polygonscan.com',
38
27
  get serverRpcUrl() {
39
28
  return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
40
29
  },
@@ -58,6 +47,7 @@ export const networks: Network[] = [
58
47
  usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
59
48
  balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
60
49
  explorerUrl: "https://arbiscan.io",
50
+ apiURL: 'https://api.arbiscan.io',
61
51
  get serverRpcUrl() {
62
52
  return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
63
53
  },
@@ -71,6 +61,50 @@ export const networks: Network[] = [
71
61
  rpcUrls: ["https://arb1.arbitrum.io/rpc"],
72
62
  },
73
63
  },
64
+ {
65
+ name: "Ethereum",
66
+ debankName: "eth",
67
+ ankrName: "eth",
68
+ zerionName: "ethereum",
69
+ chainId: 1,
70
+ explorerUrl: "https://etherscan.io",
71
+ apiURL: 'https://api.etherscan.io',
72
+ color: "#5D5FEF",
73
+ get serverRpcUrl() {
74
+ return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
75
+ },
76
+ balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
77
+ usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
78
+ params: {
79
+ rpcUrls: ["https://rpc.ankr.com/eth"],
80
+ nativeCurrency: {
81
+ name: "Ethereum",
82
+ symbol: "ETH",
83
+ decimals: 18,
84
+ },
85
+ },
86
+ },
87
+ {
88
+ name: 'Base',
89
+ chainId: 8453,
90
+ color: '#1E2024',
91
+ explorerUrl: 'https://basescan.org',
92
+ apiURL: 'https://api.basescan.org',
93
+ get serverRpcUrl() {
94
+ return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
95
+ },
96
+ usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
97
+ balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
98
+ params: {
99
+ rpcUrls: ['https://rpc.ankr.com/base'],
100
+ chainName: "Base",
101
+ nativeCurrency: {
102
+ name: "Ethereum",
103
+ symbol: "ETH",
104
+ decimals: 18,
105
+ },
106
+ }
107
+ },
74
108
  {
75
109
  name: "Optimism",
76
110
  debankName: "op",
@@ -78,6 +112,7 @@ export const networks: Network[] = [
78
112
  zerionName: "optimism",
79
113
  color: "#FF0420",
80
114
  chainId: 10,
115
+ apiURL: 'https://api-optimistic.etherscan.io',
81
116
  usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
82
117
  balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
83
118
  explorerUrl: "https://optimistic.etherscan.io",
@@ -95,26 +130,24 @@ export const networks: Network[] = [
95
130
  },
96
131
  },
97
132
  {
98
- name: "Avalanche",
99
- debankName: "avax",
100
- ankrName: "avalanche",
101
- zerionName: "avalanche",
102
- color: "#EB5757",
103
- chainId: 43114,
104
- usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
105
- balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
106
- explorerUrl: "https://snowtrace.io",
133
+ name: "Polygon zkEVM",
134
+ chainId: 1101,
135
+ color: "#8544f6",
136
+ explorerUrl: "https://zkevm.polygonscan.com",
137
+ apiURL: 'https://api-zkevm.polygonscan.com',
138
+ balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
139
+ usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
107
140
  get serverRpcUrl() {
108
- return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
141
+ return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
109
142
  },
110
143
  params: {
111
- chainName: "Avalanche Network",
144
+ chainName: "polygon zkEVM",
145
+ rpcUrls: ["https://zkevm-rpc.com"],
112
146
  nativeCurrency: {
113
- name: "Avalanche",
114
- symbol: "AVAX",
147
+ name: "Ethereum",
148
+ symbol: "ETH",
115
149
  decimals: 18,
116
150
  },
117
- rpcUrls: ["https://rpc.ankr.com/avalanche"],
118
151
  },
119
152
  },
120
153
  {
@@ -125,6 +158,7 @@ export const networks: Network[] = [
125
158
  color: "#F3BA2F",
126
159
  chainId: 56,
127
160
  explorerUrl: "https://bscscan.com",
161
+ apiURL: 'https://api.bscscan.com',
128
162
  usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
129
163
  balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
130
164
  get serverRpcUrl() {
@@ -140,6 +174,52 @@ export const networks: Network[] = [
140
174
  },
141
175
  },
142
176
  },
177
+ {
178
+ name: "Avalanche",
179
+ debankName: "avax",
180
+ ankrName: "avalanche",
181
+ zerionName: "avalanche",
182
+ color: "#EB5757",
183
+ chainId: 43114,
184
+ usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
185
+ balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
186
+ explorerUrl: "https://snowtrace.io",
187
+ apiURL: 'https://api.snowtrace.io',
188
+ get serverRpcUrl() {
189
+ return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
190
+ },
191
+ params: {
192
+ chainName: "Avalanche Network",
193
+ nativeCurrency: {
194
+ name: "Avalanche",
195
+ symbol: "AVAX",
196
+ decimals: 18,
197
+ },
198
+ rpcUrls: ["https://rpc.ankr.com/avalanche"],
199
+ },
200
+ },
201
+ {
202
+ name: "Fantom",
203
+ chainId: 250,
204
+ zerionName: "fantom",
205
+ explorerUrl: "https://ftmscan.com",
206
+ ankrName: "fantom",
207
+ color: "#1969ff",
208
+ get serverRpcUrl() {
209
+ return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
210
+ },
211
+ usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
212
+ balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
213
+ params: {
214
+ rpcUrls: ["https://rpc.ankr.com/fantom"],
215
+ chainName: "Fantom",
216
+ nativeCurrency: {
217
+ name: "Fantom",
218
+ symbol: "FTM",
219
+ decimals: 18,
220
+ },
221
+ },
222
+ },
143
223
  {
144
224
  name: "Gnosis",
145
225
  debankName: "xdai",
@@ -148,6 +228,7 @@ export const networks: Network[] = [
148
228
  chainId: 100,
149
229
  balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
150
230
  explorerUrl: "https://gnosisscan.io",
231
+ apiURL:'https://api.gnosisscan.io',
151
232
  usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
152
233
  get serverRpcUrl() {
153
234
  return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
@@ -162,26 +243,6 @@ export const networks: Network[] = [
162
243
  },
163
244
  },
164
245
  },
165
- {
166
- name: "Polygon zkEVM",
167
- chainId: 1101,
168
- color: "#8544f6",
169
- explorerUrl: "https://zkevm.polygonscan.com",
170
- balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
171
- usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
172
- get serverRpcUrl() {
173
- return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
174
- },
175
- params: {
176
- chainName: "polygon zkEVM",
177
- rpcUrls: ["https://zkevm-rpc.com"],
178
- nativeCurrency: {
179
- name: "Ethereum",
180
- symbol: "ETH",
181
- decimals: 18,
182
- },
183
- },
184
- },
185
246
  {
186
247
  name: "Aurora",
187
248
  chainId: 1313161554,
@@ -203,48 +264,6 @@ export const networks: Network[] = [
203
264
  },
204
265
  },
205
266
  },
206
- {
207
- name: "Fantom",
208
- chainId: 250,
209
- zerionName: "fantom",
210
- explorerUrl: "https://ftmscan.com",
211
- ankrName: "fantom",
212
- color: "#1969ff",
213
- get serverRpcUrl() {
214
- return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
215
- },
216
- usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
217
- balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
218
- params: {
219
- rpcUrls: ["https://rpc.ankr.com/fantom"],
220
- chainName: "Fantom",
221
- nativeCurrency: {
222
- name: "Fantom",
223
- symbol: "FTM",
224
- decimals: 18,
225
- },
226
- },
227
- },
228
- {
229
- name: 'Base',
230
- chainId: 8453,
231
- color: '#1E2024',
232
- explorerUrl: 'https://basescan.org',
233
- get serverRpcUrl() {
234
- return process.env?.BASE_RPC_URL || this.params.rpcUrls[0];
235
- },
236
- usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
237
- balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
238
- params: {
239
- rpcUrls: ['https://rpc.ankr.com/base'],
240
- chainName: "Base",
241
- nativeCurrency: {
242
- name: "Ethereum",
243
- symbol: "ETH",
244
- decimals: 18,
245
- },
246
- }
247
- },
248
267
  {
249
268
  name: AVO_PROD_CHAIN_NAME,
250
269
  chainId: AVO_PROD_CHAIN_ID,
package/utils/utils.d.ts CHANGED
@@ -34,6 +34,7 @@ declare global {
34
34
  balanceResolverAddress?: string;
35
35
  usdcAddress: string;
36
36
  explorerUrl: string;
37
+ apiURL?: string;
37
38
  params: {
38
39
  chainName?: string;
39
40
  iconUrls?: string[];