@instadapp/avocado-base 0.0.0-dev.55b5da9 → 0.0.0-dev.608fae8
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.
- package/abi/multisigForwarder.json +697 -0
- package/assets/images/icons/info-2.svg +12 -0
- package/components/ActionMetadata.vue +5 -4
- package/components/AuthorityAvatar.vue +38 -0
- package/components/ChainLogo.vue +14 -556
- package/components/metadata/Bridge.vue +21 -5
- package/components/metadata/Signers.vue +63 -0
- package/contracts/MultisigForwarder.ts +859 -0
- package/contracts/factories/MultisigForwarder__factory.ts +721 -0
- package/contracts/factories/index.ts +1 -0
- package/contracts/index.ts +2 -0
- package/package.json +5 -3
- package/utils/helper.ts +2 -1
- package/utils/metadata.ts +35 -17
- package/utils/network.ts +151 -83
- package/utils/utils.d.ts +6 -5
|
@@ -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,
|
|
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="
|
|
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="
|
|
44
|
+
<img width="20" height="20" class="w-5 h-5" :src="fromToken.logo_url" />
|
|
34
45
|
{{ bridgeAmountFormatted }}
|
|
35
|
-
<span class="uppercase">{{
|
|
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>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { Tippy } from 'vue-tippy'
|
|
3
|
+
import Info2 from '~/assets/images/icons/info-2.svg'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
metadata: {
|
|
7
|
+
type: MetadataTypes,
|
|
8
|
+
[key: string]: any
|
|
9
|
+
};
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
}>();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="font-medium">
|
|
16
|
+
<div v-if="!compact || metadata.addresses.length < 3" class="flex gap-[14px] flex-wrap items-end">
|
|
17
|
+
<p v-if="!compact" class="text-xs"> {{ formatTxType(metadata.type) }} </p>
|
|
18
|
+
<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">
|
|
19
|
+
<AuthorityAvatar :address="address" class="w-[18px] h-[18px]" />
|
|
20
|
+
<Tippy max-width="none" interactive>
|
|
21
|
+
<template #default>
|
|
22
|
+
<p class="text-xs leading-5 text-slate-500 dark:text-slate-400">
|
|
23
|
+
{{ shortenHash(address, compact ? 2 : 4) }}
|
|
24
|
+
</p>
|
|
25
|
+
</template>
|
|
26
|
+
<template #content>
|
|
27
|
+
{{ address }}
|
|
28
|
+
</template>
|
|
29
|
+
</Tippy>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-else class="flex gap-2 flex-wrap items-center">
|
|
33
|
+
<div v-for="address of [metadata.addresses[0], metadata.addresses[1]].filter(Boolean)" :key="address" class="flex gap-2 rounded-full bg-slate-100 dark:bg-slate-800 justify-start items-center px-2 py-1.5">
|
|
34
|
+
<AuthorityAvatar :address="address" class="w-[18px] h-[18px]" />
|
|
35
|
+
|
|
36
|
+
<Tippy max-width="none" interactive>
|
|
37
|
+
<template #default>
|
|
38
|
+
<p class="text-xs leading-5 text-slate-400">
|
|
39
|
+
{{ shortenHash(address, 2) }}
|
|
40
|
+
</p>
|
|
41
|
+
</template>
|
|
42
|
+
<template #content>
|
|
43
|
+
{{ address }}
|
|
44
|
+
</template>
|
|
45
|
+
</Tippy>
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<Tippy max-width="none" interactive tag="button" content-tag="div" content-class="content-wrapper">
|
|
49
|
+
<template #default>
|
|
50
|
+
<Info2 class="w-[16px] h-[16px] text-slate-500 rounded-full" />
|
|
51
|
+
</template>
|
|
52
|
+
<template #content>
|
|
53
|
+
<ul class="flex flex-col gap-2.5">
|
|
54
|
+
<li v-for="address in metadata.addresses" :key="address" class="flex text-xs text-slate-400 items-center gap-2.5">
|
|
55
|
+
<AuthorityAvatar class="shrink-0 w-5 h-5" :address="address" />
|
|
56
|
+
{{ address }}
|
|
57
|
+
</li>
|
|
58
|
+
</ul>
|
|
59
|
+
</template>
|
|
60
|
+
</Tippy>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|