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

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,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 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 StarsSVG from '../assets/images/icons/stars.svg'
8
+ import Trash2SVG from '../assets/images/icons/trash-2.svg'
9
+ import ChangeThresholdSVG from '../assets/images/icons/change-threshold.svg'
10
+ import DappSVG from '../assets/images/icons/dapp.svg'
11
+ import DeploySVG from '../assets/images/icons/deploy.svg'
12
+ import GasSVG from '../assets/images/icons/gas.svg'
13
+ import InstadappProSVG from '../assets/images/icons/instadapp-pro.svg'
14
+ import PermitSignSVG from '../assets/images/icons/permit-sign.svg'
15
+ import RejectProposalSVG from '../assets/images/icons/reject-proposal.svg'
16
+ import UpgradeSVG from '../assets/images/icons/upgrade.svg'
17
+ import HammerSVG from '../assets/images/icons/hammer.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'"/>
26
+ <RefreshSVG class="text-primary" v-if="action === 'swap'" />
27
+ <BridgeSVG class="text-primary" v-else-if="action === 'bridge'" />
28
+ <CrossTransferSVG class="text-primary" v-else-if="action === 'cross-transfer'" />
29
+ <TransferSVG class="text-primary" v-else-if="action === 'transfer'" />
30
+ <PlusCircleSVG class="text-primary" v-else-if="action === 'add-signers' || (action === 'auth' && !remove)" />
31
+ <Trash2SVG class="text-[#EB5757]" v-else-if="action === 'remove-signers' || (action === 'auth' && remove)" />
32
+ <RejectProposalSVG class="text-[#EB5757]" v-else-if="action === 'rejection'" />
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'" />
38
42
  </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
 
@@ -19,15 +20,23 @@ provide('compact', props.compact);
19
20
  <MetadataCrossTransfer v-if="metadata.type === 'cross-transfer'" :metadata="metadata" :chain_id="chain_id" />
20
21
  <MetadataGasTopup v-if="metadata.type === 'gas-topup'" :metadata="metadata" :chain_id="chain_id" />
21
22
  <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" />
23
+ <MetadataBridge v-if="metadata.type === 'bridge' || metadata.type === 'bridge-v2'" :metadata="metadata" :chain_id="chain_id" />
23
24
  <MetadataPermit2 v-if="metadata.type === 'permit2'" :metadata="metadata" :chain_id="chain_id" />
24
25
 
26
+ <div v-if="metadata.type === 'mass'">
27
+ Chain Agnostic Payments
28
+ </div>
29
+
30
+ <div class="text-left w-fit capitalize" v-if="metadata.type === 'import'">
31
+ Import from {{ metadata.protocol }} ({{ (formatUsd(fromWei(metadata.valueInUsd, 10))) }})
32
+ </div>
33
+
25
34
  <div v-if="metadata.type === 'upgrade'" class="self-start">
26
35
  Wallet upgraded to {{ metadata?.version }}
27
36
  </div>
28
37
  <div v-if="metadata.type === 'dapp'" class="self-start flex items-center gap-2 text-primary">
29
38
  <a :href="metadata?.url" target="_blank" rel="noopener noreferrer">{{
30
- metadata?.name
39
+ metadata?.name || metadata?.url
31
40
  }}</a>
32
41
  <SvgoExternalLink />
33
42
  </div>
@@ -36,38 +45,38 @@ provide('compact', props.compact);
36
45
  </div>
37
46
  <div v-if="metadata.type === 'auth'" class="self-start capitalize flex gap-3">
38
47
  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>
48
+ <a class="text-primary break-all" :href="getExplorerUrl(metadata.chainId, `/address/${metadata.address}`)"
49
+ target="_blank">
50
+ {{ shortenHash(metadata.address) }}
51
+ </a>
52
+ <div class="flex gap-3">
53
+ <ChainLogo class="w-5 h-5" :chain="metadata.chainId" />
54
+ {{ chainIdToName(metadata.chainId) }}
55
+ </div>
56
+ </div>
57
+ <div v-if="metadata.type === 'tx-builder'" class="self-start capitalize flex gap-3">
58
+ <span v-if="!compact">
59
+ Transaction Builder
60
+ </span> ({{ metadata?.actionCount }} {{ toBN(metadata?.actionCount).lt(2) ? 'action' : 'actions' }})
50
61
  </div>
51
62
  <div v-if="metadata.type === 'instadapp-pro'" class="self-start capitalize flex gap-3">
52
63
  Instadapp Pro |
53
64
  {{ metadata?.castDetails }}
54
65
  </div>
55
66
 
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>
67
+ <MetadataSigners v-if="metadata.type === 'add-signers' || metadata.type === 'remove-signers'" :metadata="metadata"
68
+ :compact="compact" />
59
69
 
60
- <div v-if="metadata.type === 'change-threshold'" class="text-left w-fit" >
61
- Change Threshold to {{ metadata.count }}
70
+ <div v-if="metadata.type === 'change-threshold'" class="text-left w-fit">
71
+ Change Threshold to {{ metadata.count }}
62
72
  </div>
63
73
 
64
74
  <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) }}
75
+ content: metadata.id,
76
+ maxWidth: 'none',
77
+ interactive: true,
78
+ }" v-if="metadata.type === 'rejection'" class="text-left w-fit">
79
+ {{ shortenHash(metadata.id) }}
71
80
  </div>
72
81
  </div>
73
- </template>
82
+ </template>
@@ -0,0 +1,37 @@
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 :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
+ <g fill="currentColor" :clip-path="`url(#${randomId})`">
27
+ <rect width="30" height="30" fill-opacity=".4" rx="15" />
28
+ <ellipse cx="15.004" cy="26.399" rx="11.4" ry="6.6" />
29
+ <circle cx="15" cy="12.75" r="5.4" />
30
+ </g>
31
+ <defs>
32
+ <clipPath :id="randomId">
33
+ <rect width="30" height="30" fill="#fff" rx="15" />
34
+ </clipPath>
35
+ </defs>
36
+ </svg>
37
+ </template>