@instadapp/avocado-base 0.0.0-dev.d831e20 → 0.0.0-dev.dcb4af3

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.
Files changed (45) hide show
  1. package/.github/workflows/npm-publish-dev.yml +2 -5
  2. package/.vscode/settings.json +67 -0
  3. package/abi/avoFactoryProxy.json +1 -1
  4. package/abi/forwarder.json +1 -1
  5. package/abi/multisigAgnosticForwarder.json +937 -0
  6. package/abi/multisigForwarder.json +697 -0
  7. package/app.vue +5 -5
  8. package/assets/images/icons/check.svg +3 -0
  9. package/assets/images/icons/copy.svg +9 -2
  10. package/assets/images/icons/hammer.svg +5 -0
  11. package/assets/images/icons/info-2.svg +12 -0
  12. package/assets/images/icons/reject-proposal.svg +3 -3
  13. package/assets/images/icons/stars.svg +4 -0
  14. package/assets/images/icons/trash-2.svg +5 -5
  15. package/components/ActionLogo.vue +33 -29
  16. package/components/ActionMetadata.vue +44 -29
  17. package/components/Address.vue +74 -0
  18. package/components/AuthorityAvatar.vue +39 -0
  19. package/components/ChainLogo.vue +18 -563
  20. package/components/CopyClipboard.vue +42 -0
  21. package/components/metadata/Bridge.vue +33 -14
  22. package/components/metadata/CrossTransfer.vue +37 -28
  23. package/components/metadata/GasTopup.vue +17 -12
  24. package/components/metadata/Permit2.vue +14 -10
  25. package/components/metadata/Signers.vue +19 -0
  26. package/components/metadata/Swap.vue +45 -46
  27. package/components/metadata/Transfer.vue +28 -25
  28. package/contracts/MultisigAgnosticForwarder.ts +1423 -0
  29. package/contracts/MultisigForwarder.ts +859 -0
  30. package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2135 -0
  31. package/contracts/factories/MultisigForwarder__factory.ts +721 -0
  32. package/contracts/factories/index.ts +2 -0
  33. package/contracts/index.ts +4 -0
  34. package/eslint.config.mjs +34 -0
  35. package/nuxt.config.ts +21 -12
  36. package/package.json +16 -14
  37. package/server/utils/index.ts +4 -4
  38. package/utils/avocado.ts +17 -17
  39. package/utils/bignumber.ts +47 -36
  40. package/utils/formatter.ts +55 -61
  41. package/utils/helper.ts +34 -30
  42. package/utils/metadata.ts +431 -310
  43. package/utils/network.ts +569 -186
  44. package/utils/services.ts +15 -10
  45. package/utils/utils.d.ts +122 -104
@@ -0,0 +1,3 @@
1
+ <svg width="16" height="11" viewBox="0 0 16 11" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M15 1L5.375 10L1 5.90909" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>
@@ -1,5 +1,12 @@
1
1
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none"
2
2
  xmlns="http://www.w3.org/2000/svg">
3
- <path class="copy-path" d="M14.1145 9.94827C14.1816 8.8779 14.2168 7.76883 14.2168 6.63246C14.2168 6.17207 14.211 5.71616 14.1997 5.26549C14.1917 4.94654 14.0882 4.63658 13.8994 4.37941C13.185 3.40646 12.6153 2.80088 11.6777 2.07698C11.4181 1.87657 11.0995 1.76786 10.7717 1.76072C10.4455 1.75361 10.105 1.75 9.74121 1.75C8.63995 1.75 7.75104 1.78308 6.8319 1.84613C6.04346 1.90021 5.41726 2.5279 5.36787 3.31665C5.30084 4.38702 5.26562 5.49608 5.26562 6.63246C5.26562 7.76883 5.30085 8.8779 5.36787 9.94827C5.41726 10.737 6.04346 11.3647 6.8319 11.4188C7.75104 11.4818 8.63995 11.5149 9.74121 11.5149C10.8425 11.5149 11.7314 11.4818 12.6505 11.4188C13.439 11.3647 14.0652 10.737 14.1145 9.94827Z" stroke="#94A3B8" stroke-width="2"/>
4
- <path class="copy-path" d="M10.6341 12.6834C10.7011 11.613 10.7363 10.5039 10.7363 9.36756C10.7363 8.90717 10.7306 8.45126 10.7192 8.00059C10.7112 7.68165 10.6078 7.37169 10.4189 7.11452C9.70458 6.14157 9.13488 5.53599 8.19725 4.81209C7.93767 4.61167 7.61907 4.50297 7.29121 4.49582C6.96506 4.48872 6.62448 4.48511 6.26074 4.48511C5.15949 4.48511 4.27057 4.51819 3.35143 4.58123C2.56299 4.63531 1.9368 5.26301 1.88741 6.05176C1.82038 7.12213 1.78516 8.23119 1.78516 9.36756C1.78516 10.5039 1.82038 11.613 1.88741 12.6834C1.9368 13.4721 2.56299 14.0998 3.35143 14.1539C4.27057 14.2169 5.15949 14.25 6.26074 14.25C7.362 14.25 8.25091 14.2169 9.17005 14.1539C9.95849 14.0998 10.5847 13.4721 10.6341 12.6834Z" stroke="#94A3B8" stroke-width="2"/>
3
+ <g clip-path="url(#clip0_854_51869)">
4
+ <path d="M13.3333 6H7.33333C6.59695 6 6 6.59695 6 7.33333V13.3333C6 14.0697 6.59695 14.6667 7.33333 14.6667H13.3333C14.0697 14.6667 14.6667 14.0697 14.6667 13.3333V7.33333C14.6667 6.59695 14.0697 6 13.3333 6Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M3.33301 10.0002H2.66634C2.31272 10.0002 1.97358 9.85969 1.72353 9.60964C1.47348 9.35959 1.33301 9.02045 1.33301 8.66683V2.66683C1.33301 2.31321 1.47348 1.97407 1.72353 1.72402C1.97358 1.47397 2.31272 1.3335 2.66634 1.3335H8.66634C9.01996 1.3335 9.3591 1.47397 9.60915 1.72402C9.8592 1.97407 9.99967 2.31321 9.99967 2.66683V3.3335" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6
+ </g>
7
+ <defs>
8
+ <clipPath id="clip0_854_51869">
9
+ <rect width="16" height="16" fill="white"/>
10
+ </clipPath>
11
+ </defs>
5
12
  </svg>
@@ -0,0 +1,5 @@
1
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none"
2
+ xmlns="http://www.w3.org/2000/svg">
3
+ <path d="M16.0678 8.64793L17.2102 9.79039C17.4404 10.0205 17.4334 10.4006 17.1947 10.6393L14.169 13.6651C13.9302 13.9038 13.5501 13.9108 13.32 13.6806L12.0532 12.4139C11.8231 12.1837 11.83 11.8036 12.0687 11.5649C12.6078 11.0259 12.9103 10.7041 12.4882 9.98816C12.128 9.37711 10.7867 8.04387 9.9829 8.84766L9.026 9.80457C8.79152 10.0391 8.42065 10.0499 8.18946 9.83216C8.18527 9.82822 8.18113 9.8242 8.17704 9.82011C7.60427 9.24734 6.86936 8.69159 6.39943 8.03122C6.20623 7.75971 6.27917 7.35876 6.56293 7.14058C7.13082 6.70394 7.83604 6.05667 7.51626 5.73688C7.00756 5.22819 6.64232 4.84336 6.00502 4.36291C4.84749 3.49024 2.98873 2.86307 1.68669 2.5009C1.49898 2.44869 1.54877 2.11407 1.74553 2.11091C1.74865 2.11086 1.74938 2.1109 1.7525 2.11067C1.8512 2.10361 5.1158 1.87459 7.10771 2.35491C8.41273 2.66961 9.17363 2.87223 10.3122 3.56383C11.7706 4.44979 12.9611 5.54124 13.3465 6.69684C13.732 7.85244 12.8562 8.45813 13.6146 8.8618C14.0693 9.10386 14.6271 9.08774 15.0305 8.72253C15.3277 8.4534 15.7944 8.37456 16.0678 8.64793Z" fill="currentColor"/>
4
+ <path d="M8.17704 9.82011C8.18113 9.8242 8.18527 9.82822 8.18946 9.83216M8.17704 9.82011L8.18946 9.83216M8.17704 9.82011C7.60427 9.24734 6.86936 8.69159 6.39943 8.03122M8.18946 9.83216C8.42065 10.0499 8.79152 10.0391 9.026 9.80457L9.9829 8.84766C10.7867 8.04387 12.128 9.37711 12.4882 9.98816C12.9103 10.7041 12.6078 11.0259 12.0687 11.5649C11.83 11.8036 11.8231 12.1837 12.0532 12.4139L13.32 13.6806C13.5501 13.9108 13.9302 13.9038 14.169 13.6651L17.1947 10.6393C17.4334 10.4006 17.4404 10.0205 17.2102 9.79039L16.0678 8.64793C15.7944 8.37456 15.3277 8.4534 15.0305 8.72253C14.6271 9.08774 14.0693 9.10386 13.6146 8.8618C12.8562 8.45813 13.732 7.85244 13.3465 6.69684C12.9611 5.54124 11.7706 4.44979 10.3122 3.56383C9.17363 2.87223 8.41273 2.66961 7.10771 2.35492C5.1158 1.87459 1.8512 2.10361 1.7525 2.11067C1.74938 2.1109 1.74865 2.11086 1.74553 2.11091C1.54877 2.11407 1.49898 2.44869 1.68669 2.5009C2.98873 2.86307 4.84749 3.49024 6.00502 4.36291C6.64232 4.84336 7.00756 5.22819 7.51626 5.73688C7.83604 6.05667 7.13082 6.70394 6.56293 7.14058C6.27917 7.35876 6.20623 7.75971 6.39943 8.03122M8.18946 9.83216L2.8021 15.2195C2.47839 15.5432 1.97213 15.6105 1.60516 15.3369C1.46424 15.2318 1.32499 15.1183 1.2164 15.0097C1.1078 14.9011 0.994378 14.7619 0.889279 14.621C0.615587 14.254 0.682904 13.7477 1.00661 13.424L6.39943 8.03122" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
5
+ </svg>
@@ -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,6 +1,6 @@
1
1
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none"
2
2
  xmlns="http://www.w3.org/2000/svg">
3
- <path d="M11.8555 8.14404L8.14316 11.8564" stroke="#EB5757" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
- <path d="M8.14453 8.14404L11.8568 11.8564" stroke="#EB5757" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
- <rect x="3.75" y="3.75" width="12.5" height="12.5" rx="6.25" stroke="#EB5757" stroke-width="1.5"/>
3
+ <path d="M11.8555 8.14404L8.14316 11.8564" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ <path d="M8.14453 8.14404L11.8568 11.8564" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <rect x="3.75" y="3.75" width="12.5" height="12.5" rx="6.25" stroke="currentColor" stroke-width="1.5"/>
6
6
  </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M11.3112 1.14526L12.8087 5.19216L16.8556 6.68965L12.8087 8.18714L11.3112 12.234L9.8137 8.18714L5.76681 6.68965L9.8137 5.19216L11.3112 1.14526Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M4.38071 10.3859L5.68884 12.312L7.61493 13.6201L5.68884 14.9283L4.38071 16.8544L3.07258 14.9283L1.14648 13.6201L3.07258 12.312L4.38071 10.3859Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
+ </svg>
@@ -1,8 +1,8 @@
1
1
  <svg width="20" height="20" viewBox="0 0 20 20" fill="none"
2
2
  xmlns="http://www.w3.org/2000/svg">
3
- <path d="M4.64453 7.21045H15.3588" stroke="#EB5757" stroke-width="1.5" stroke-linecap="round"/>
4
- <path d="M13.8495 7.21045H6.14754L6.09242 8.20701C5.98681 10.1164 6.07654 12.0315 6.36021 13.9227C6.48391 14.7473 7.19233 15.3574 8.02623 15.3574H11.9708C12.8047 15.3574 13.5131 14.7473 13.6368 13.9227C13.9205 12.0315 14.0102 10.1164 13.9046 8.207L13.8495 7.21045Z" stroke="#EB5757" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
- <path d="M7.85938 7.21039V6.7825C7.85938 6.21509 8.08478 5.67091 8.486 5.26969C8.88722 4.86847 9.4314 4.64307 9.99881 4.64307C10.5662 4.64307 11.1104 4.86847 11.5116 5.26969C11.9128 5.67091 12.1382 6.21509 12.1382 6.7825V7.21039" stroke="#EB5757" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6
- <path d="M8.71484 9.50195V13.0487" stroke="#EB5757" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
7
- <path d="M11.2852 9.50195V13.0487" stroke="#EB5757" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ <path d="M4.64453 7.21045H15.3588" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
4
+ <path d="M13.8495 7.21045H6.14754L6.09242 8.20701C5.98681 10.1164 6.07654 12.0315 6.36021 13.9227C6.48391 14.7473 7.19233 15.3574 8.02623 15.3574H11.9708C12.8047 15.3574 13.5131 14.7473 13.6368 13.9227C13.9205 12.0315 14.0102 10.1164 13.9046 8.207L13.8495 7.21045Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
+ <path d="M7.85938 7.21039V6.7825C7.85938 6.21509 8.08478 5.67091 8.486 5.26969C8.88722 4.86847 9.4314 4.64307 9.99881 4.64307C10.5662 4.64307 11.1104 4.86847 11.5116 5.26969C11.9128 5.67091 12.1382 6.21509 12.1382 6.7825V7.21039" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6
+ <path d="M8.71484 9.50195V13.0487" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
7
+ <path d="M11.2852 9.50195V13.0487" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
8
8
  </svg>
@@ -1,18 +1,20 @@
1
1
  <script setup lang="ts">
2
- import RefreshSVG from '~/assets/images/icons/refresh.svg'
3
- import BridgeSVG from '~/assets/images/icons/bridge.svg'
4
- import CrossTransferSVG from '~/assets/images/icons/cross-transfer.svg'
5
- import TransferSVG from '~/assets/images/icons/transfer.svg'
6
- import PlusCircleSVG from '~/assets/images/icons/plus-circle.svg'
7
- import Trash2SVG from '~/assets/images/icons/trash-2.svg'
8
- import ChangeThresholdSVG from '~/assets/images/icons/change-threshold.svg'
9
- import DappSVG from '~/assets/images/icons/dapp.svg'
10
- import DeploySVG from '~/assets/images/icons/deploy.svg'
11
- import GasSVG from '~/assets/images/icons/gas.svg'
12
- import InstadappProSVG from '~/assets/images/icons/instadapp-pro.svg'
13
- import PermitSignSVG from '~/assets/images/icons/permit-sign.svg'
14
- import RejectProposalSVG from '~/assets/images/icons/reject-proposal.svg'
15
- import UpgradeSVG from '~/assets/images/icons/upgrade.svg'
2
+ import BridgeSVG from '../assets/images/icons/bridge.svg'
3
+ import ChangeThresholdSVG from '../assets/images/icons/change-threshold.svg'
4
+ import CrossTransferSVG from '../assets/images/icons/cross-transfer.svg'
5
+ import DappSVG from '../assets/images/icons/dapp.svg'
6
+ import DeploySVG from '../assets/images/icons/deploy.svg'
7
+ import GasSVG from '../assets/images/icons/gas.svg'
8
+ import HammerSVG from '../assets/images/icons/hammer.svg'
9
+ import InstadappProSVG from '../assets/images/icons/instadapp-pro.svg'
10
+ import PermitSignSVG from '../assets/images/icons/permit-sign.svg'
11
+ import PlusCircleSVG from '../assets/images/icons/plus-circle.svg'
12
+ import RefreshSVG from '../assets/images/icons/refresh.svg'
13
+ import RejectProposalSVG from '../assets/images/icons/reject-proposal.svg'
14
+ import StarsSVG from '../assets/images/icons/stars.svg'
15
+ import TransferSVG from '../assets/images/icons/transfer.svg'
16
+ import Trash2SVG from '../assets/images/icons/trash-2.svg'
17
+ import UpgradeSVG from '../assets/images/icons/upgrade.svg'
16
18
 
17
19
  defineProps<{
18
20
  action: MetadataTypes
@@ -21,18 +23,20 @@ defineProps<{
21
23
  </script>
22
24
 
23
25
  <template>
24
- <RefreshSVG class="text-primary" v-if="action === 'swap'"/>
25
- <BridgeSVG class="text-primary" v-else-if="action === 'bridge'"/>
26
- <CrossTransferSVG class="text-primary" v-else-if="action === 'cross-transfer'"/>
27
- <TransferSVG class="text-primary" v-else-if="action === 'transfer'"/>
28
- <PlusCircleSVG class="text-primary" v-else-if="action === 'add-signers' || (action === 'auth' && !remove)"/>
29
- <Trash2SVG v-else-if="action === 'remove-signers' || (action === 'auth' && remove)"/>
30
- <ChangeThresholdSVG v-else-if="action === 'change-threshold'"/>
31
- <DappSVG v-else-if="action === 'dapp'"/>
32
- <DeploySVG v-else-if="action === 'deploy'"/>
33
- <GasSVG v-else-if="action === 'gas-topup'"/>
34
- <InstadappProSVG v-else-if="action === 'instadapp-pro'"/>
35
- <PermitSignSVG v-else-if="action === 'permit2'"/>
36
- <RejectProposalSVG v-else-if="action === 'rejection'"/>
37
- <UpgradeSVG v-else-if="action === 'upgrade'"/>
38
- </template>
26
+ <RefreshSVG v-if="action === 'swap'" class="text-primary" />
27
+ <BridgeSVG v-else-if="action === 'bridge'" class="text-primary" />
28
+ <CrossTransferSVG v-else-if="action === 'cross-transfer'" class="text-primary" />
29
+ <TransferSVG v-else-if="action === 'transfer'" class="text-primary" />
30
+ <PlusCircleSVG v-else-if="action === 'add-signers' || (action === 'auth' && !remove)" class="text-primary" />
31
+ <Trash2SVG v-else-if="action === 'remove-signers' || (action === 'auth' && remove)" class="text-[#EB5757]" />
32
+ <RejectProposalSVG v-else-if="action === 'rejection'" class="text-[#EB5757]" />
33
+ <ChangeThresholdSVG v-else-if="action === 'change-threshold'" />
34
+ <DappSVG v-else-if="action === 'dapp'" />
35
+ <DeploySVG v-else-if="action === 'deploy'" />
36
+ <GasSVG v-else-if="action === 'gas-topup'" />
37
+ <InstadappProSVG v-else-if="action === 'instadapp-pro'" />
38
+ <PermitSignSVG v-else-if="action === 'permit2'" />
39
+ <UpgradeSVG v-else-if="action === 'upgrade'" />
40
+ <HammerSVG v-else-if="action === 'tx-builder'" />
41
+ <StarsSVG v-else-if="action === 'mass'" />
42
+ </template>
@@ -1,16 +1,16 @@
1
1
  <script lang="ts" setup>
2
-
3
2
  const props = defineProps<{
4
3
  metadata: {
5
4
  type: MetadataTypes
6
5
  [key: string]: any
7
- };
8
- chain_id: number | string;
9
- compact?: boolean;
10
- }>();
11
-
12
- provide('compact', props.compact);
6
+ }
7
+ chain_id: number | string
8
+ compact?: boolean
9
+ tokens?: ITokenPrice[]
10
+ }>()
13
11
 
12
+ provide('compact', props.compact)
13
+ provide('tokens', props.tokens)
14
14
  </script>
15
15
 
16
16
  <template>
@@ -19,15 +19,23 @@ provide('compact', props.compact);
19
19
  <MetadataCrossTransfer v-if="metadata.type === 'cross-transfer'" :metadata="metadata" :chain_id="chain_id" />
20
20
  <MetadataGasTopup v-if="metadata.type === 'gas-topup'" :metadata="metadata" :chain_id="chain_id" />
21
21
  <MetadataSwap v-if="metadata.type === 'swap'" :metadata="metadata" :chain_id="chain_id" />
22
- <MetadataBridge v-if="metadata.type === 'bridge'" :metadata="metadata" :chain_id="chain_id" />
22
+ <MetadataBridge v-if="metadata.type === 'bridge' || metadata.type === 'bridge-v2'" :metadata="metadata" :chain_id="chain_id" />
23
23
  <MetadataPermit2 v-if="metadata.type === 'permit2'" :metadata="metadata" :chain_id="chain_id" />
24
24
 
25
+ <div v-if="metadata.type === 'mass'">
26
+ Chain Agnostic Payments
27
+ </div>
28
+
29
+ <div v-if="metadata.type === 'import'" class="text-left w-fit capitalize">
30
+ Import from {{ metadata.protocol }} ({{ (formatUsd(fromWei(metadata.valueInUsd, 10))) }})
31
+ </div>
32
+
25
33
  <div v-if="metadata.type === 'upgrade'" class="self-start">
26
34
  Wallet upgraded to {{ metadata?.version }}
27
35
  </div>
28
36
  <div v-if="metadata.type === 'dapp'" class="self-start flex items-center gap-2 text-primary">
29
37
  <a :href="metadata?.url" target="_blank" rel="noopener noreferrer">{{
30
- metadata?.name
38
+ metadata?.name || metadata?.url
31
39
  }}</a>
32
40
  <SvgoExternalLink />
33
41
  </div>
@@ -36,38 +44,45 @@ provide('compact', props.compact);
36
44
  </div>
37
45
  <div v-if="metadata.type === 'auth'" class="self-start capitalize flex gap-3">
38
46
  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>
47
+ <a
48
+ class="text-primary break-all" :href="getExplorerUrl(metadata.chainId, `/address/${metadata.address}`)"
49
+ target="_blank"
50
+ >
51
+ {{ shortenHash(metadata.address) }}
52
+ </a>
53
+ <div class="flex gap-3">
54
+ <ChainLogo class="w-5 h-5" :chain="metadata.chainId" />
55
+ {{ chainIdToName(metadata.chainId) }}
56
+ </div>
57
+ </div>
58
+ <div v-if="metadata.type === 'tx-builder'" class="self-start capitalize flex gap-3">
59
+ <span v-if="!compact">
60
+ Transaction Builder
61
+ </span> ({{ metadata?.actionCount }} {{ toBN(metadata?.actionCount).lt(2) ? 'action' : 'actions' }})
50
62
  </div>
51
63
  <div v-if="metadata.type === 'instadapp-pro'" class="self-start capitalize flex gap-3">
52
64
  Instadapp Pro |
53
65
  {{ metadata?.castDetails }}
54
66
  </div>
55
67
 
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>
68
+ <MetadataSigners
69
+ v-if="metadata.type === 'add-signers' || metadata.type === 'remove-signers'"
70
+ :chain_id="chain_id" :metadata="metadata"
71
+ :compact="compact"
72
+ />
59
73
 
60
- <div v-if="metadata.type === 'change-threshold'" class="text-left w-fit" >
61
- Change Threshold to {{ metadata.count }}
74
+ <div v-if="metadata.type === 'change-threshold'" class="text-left w-fit">
75
+ Change Threshold to {{ metadata.count }}
62
76
  </div>
63
77
 
64
- <div v-tippy="{
78
+ <div
79
+ v-if="metadata.type === 'rejection'" v-tippy="{
65
80
  content: metadata.id,
66
81
  maxWidth: 'none',
67
82
  interactive: true,
68
- }"
69
- v-if="metadata.type === 'rejection'" class="text-left w-fit">
70
- {{ shortenHash(metadata.id) }}
83
+ }" class="text-left w-fit"
84
+ >
85
+ {{ shortenHash(metadata.id) }}
71
86
  </div>
72
87
  </div>
73
88
  </template>
@@ -0,0 +1,74 @@
1
+ <script setup lang="ts">
2
+ import type { Address } from 'viem'
3
+
4
+ const props = defineProps<{
5
+ address: Address | string
6
+ hideContact?: boolean
7
+ hideCopy?: boolean
8
+ showFull?: boolean
9
+ to?: string
10
+ }>()
11
+
12
+ const nuxtApp = useNuxtApp()
13
+
14
+ console.log()
15
+
16
+ // @ts-expect-error
17
+ const contacts = computed(() => nuxtApp.$contacts?.value)
18
+
19
+ const contactName = computed(() => {
20
+ if (!contacts?.value)
21
+ return null
22
+
23
+ return contacts.value.find(
24
+ // @ts-expect-error
25
+ contract => contract.address?.toLowerCase() === props.address.toLowerCase(),
26
+ )?.name
27
+ })
28
+
29
+ function onMouseEnter() {
30
+ const elements = document.querySelectorAll(`[data-highlight-target="${props.address}"]`)
31
+
32
+ elements.forEach((element) => {
33
+ element.classList.add('address-active')
34
+ })
35
+ }
36
+
37
+ function onMouseLeave() {
38
+ const elements = document.querySelectorAll(`[data-highlight-target="${props.address}"]`)
39
+
40
+ elements.forEach((element) => {
41
+ element.classList.remove('address-active')
42
+ })
43
+ }
44
+
45
+ const NuxtLink = resolveComponent('NuxtLink')
46
+ </script>
47
+
48
+ <template>
49
+ <div class="flex items-center leading-[1.3339em]">
50
+ <Component
51
+ :is="props.to ? NuxtLink : 'span'"
52
+ v-tippy="{ content: showFull ? undefined : address, maxWidth: 'none', placement: 'bottom' }"
53
+ :external="props.to ? true : undefined"
54
+ :target="props.to ? '_blank' : undefined"
55
+ :to="props.to ? props.to : undefined"
56
+ :class="props.to ? 'text-primary' : ''"
57
+ class="px-1 border border-dashed border-opacity-0 -ml-1 border-yellow-500" :data-highlight-target="address"
58
+ @mouseenter="onMouseEnter" @mouseleave="onMouseLeave"
59
+ >
60
+ {{ showFull ? address : shortenHash(address) }}
61
+ </Component>
62
+ <span v-if="contactName && !hideContact" class="leading-[inherit]">
63
+ ({{ contactName }})
64
+ </span>
65
+ <CopyClipboard v-if="!hideCopy" class="ml-1.5" :text="address" />
66
+ </div>
67
+ </template>
68
+
69
+ <style>
70
+ .address-active {
71
+ @apply border-opacity-100 bg-yellow-500/10;
72
+ border-radius: 0.375rem;
73
+ }
74
+ </style>
@@ -0,0 +1,39 @@
1
+ <script setup lang="ts">
2
+ // @ts-expect-error
3
+ import * as XXH from 'xxhashjs'
4
+
5
+ defineProps<{
6
+ address: string
7
+ }>()
8
+
9
+ const randomId = Math.random().toString(36).substr(2, 9)
10
+
11
+ function generateColor(address: string): string {
12
+ const hash = XXH.h32(address, 0xABCD).toNumber()
13
+
14
+ const hue = hash % 360
15
+ const saturation = 80 + (hash % 30)
16
+ const lightness = 70 + (hash % 20)
17
+
18
+ return `hsl(${hue}, ${saturation}%, ${lightness}%)`
19
+ }
20
+ </script>
21
+
22
+ <template>
23
+ <svg
24
+ :style="{
25
+ color: generateColor(address),
26
+ }" width="30" height="30" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 30 30"
27
+ >
28
+ <g fill="currentColor" :clip-path="`url(#${randomId})`">
29
+ <rect width="30" height="30" fill-opacity=".4" rx="15" />
30
+ <ellipse cx="15.004" cy="26.399" rx="11.4" ry="6.6" />
31
+ <circle cx="15" cy="12.75" r="5.4" />
32
+ </g>
33
+ <defs>
34
+ <clipPath :id="randomId">
35
+ <rect width="30" height="30" fill="#fff" rx="15" />
36
+ </clipPath>
37
+ </defs>
38
+ </svg>
39
+ </template>