@instadapp/avocado-base 0.0.0-dev.a43ff53 → 0.0.0-dev.a52088d
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/.github/workflows/npm-publish-dev.yml +2 -5
- package/.vscode/settings.json +68 -0
- package/abi/multisigAgnosticForwarder.json +938 -0
- package/abi/multisigForwarder.json +697 -0
- package/assets/images/icons/check.svg +3 -0
- package/assets/images/icons/copy.svg +9 -2
- package/assets/images/icons/hammer.svg +5 -0
- package/assets/images/icons/info-2.svg +12 -0
- package/assets/images/icons/stars.svg +4 -0
- package/components/ActionLogo.vue +32 -28
- package/components/ActionMetadata.vue +45 -29
- package/components/Address.vue +74 -0
- package/components/AuthorityAvatar.vue +16 -5
- package/components/ChainLogo.vue +12 -218
- package/components/CopyClipboard.vue +16 -38
- package/components/metadata/Bridge.vue +1 -1
- package/components/metadata/CrossTransfer.vue +35 -30
- package/components/metadata/Signers.vue +12 -38
- package/components/metadata/Swap.vue +45 -53
- package/components/metadata/Transfer.vue +25 -27
- package/contracts/MultisigAgnosticForwarder.ts +1423 -0
- package/contracts/MultisigForwarder.ts +859 -0
- package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2135 -0
- package/contracts/factories/MultisigForwarder__factory.ts +721 -0
- package/contracts/factories/index.ts +2 -0
- package/contracts/index.ts +4 -0
- package/eslint.config.mjs +19 -0
- package/nuxt.config.ts +7 -2
- package/package.json +18 -13
- package/utils/formatter.ts +1 -1
- package/utils/helper.ts +0 -11
- package/utils/metadata.ts +216 -58
- package/utils/network.ts +477 -201
- package/utils/utils.d.ts +22 -7
|
@@ -1,56 +1,26 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import CopySVG from '
|
|
3
|
-
import
|
|
2
|
+
import CopySVG from '../assets/images/icons/copy.svg'
|
|
3
|
+
import CheckSVG from '../assets/images/icons/check-circle.svg'
|
|
4
4
|
|
|
5
5
|
defineProps<{
|
|
6
6
|
text: string
|
|
7
|
-
iconOnly?: boolean
|
|
8
|
-
successText?: string
|
|
9
7
|
}>()
|
|
10
8
|
const { copy, copied } = useClipboard()
|
|
11
|
-
const slots = useSlots()
|
|
12
9
|
</script>
|
|
13
10
|
|
|
14
11
|
<template>
|
|
15
|
-
<button
|
|
16
|
-
class="text-slate-400 font-semibold inline-flex items-center gap-2.5"
|
|
17
|
-
@click.stop="copy(text)"
|
|
18
|
-
>
|
|
19
|
-
<Transition mode="out-in" name="slide-left">
|
|
20
|
-
<span v-if="copied && !iconOnly"> {{ successText || 'Copied' }} </span>
|
|
21
|
-
<span v-else-if="slots.content">
|
|
22
|
-
<slot name="content" />
|
|
23
|
-
</span>
|
|
24
|
-
</Transition>
|
|
25
|
-
|
|
12
|
+
<button type="button" class="inline-flex copy-btn" @click.stop="copy(text)">
|
|
26
13
|
<Transition mode="out-in" name="slide">
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
class="w-4 h-4 shrink-0 dark:text-slate-900 text-white svg-circle"
|
|
30
|
-
/>
|
|
31
|
-
<slot v-else-if="slots.copy" name="copy" />
|
|
32
|
-
<slot v-else name="copy-icon">
|
|
33
|
-
<CopySVG />
|
|
34
|
-
</slot>
|
|
14
|
+
<CheckSVG v-if="copied" v-tippy="{ content: 'Copied!' }" class="svg-circle text-slate-850 size-[1em]" />
|
|
15
|
+
<CopySVG v-else v-tippy="{ content: 'Copy Address' }" class="text-slate-400 size-[1em]" />
|
|
35
16
|
</Transition>
|
|
36
17
|
</button>
|
|
37
18
|
</template>
|
|
38
19
|
|
|
39
20
|
<style scoped>
|
|
40
|
-
.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.slide-left-enter-from {
|
|
46
|
-
opacity: 0;
|
|
47
|
-
transform: translateX(30px);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.slide-left-leave-to {
|
|
51
|
-
opacity: 0;
|
|
52
|
-
transform: translateX(-30px);
|
|
53
|
-
}
|
|
21
|
+
.copy-btn:focus:not(:focus-visible) {
|
|
22
|
+
outline: none;
|
|
23
|
+
}
|
|
54
24
|
|
|
55
25
|
.slide-enter-active,
|
|
56
26
|
.slide-leave-active {
|
|
@@ -61,4 +31,12 @@ const slots = useSlots()
|
|
|
61
31
|
.slide-leave-to {
|
|
62
32
|
opacity: 0;
|
|
63
33
|
}
|
|
34
|
+
|
|
35
|
+
.svg-circle > path:first-child {
|
|
36
|
+
@apply stroke-gray-400 fill-gray-400;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.svg-circle.darker > path:first-child {
|
|
40
|
+
@apply fill-gray-700 stroke-none text-gray-500;
|
|
41
|
+
}
|
|
64
42
|
</style>
|
|
@@ -28,7 +28,7 @@ const isTokensSame = computed(() => {
|
|
|
28
28
|
|
|
29
29
|
const bridgeAmountFormatted = computed(() =>
|
|
30
30
|
formatDecimal(
|
|
31
|
-
fromWei(props.metadata?.amount,
|
|
31
|
+
fromWei(props.metadata?.amount, fromToken?.value?.decimals).toFixed()
|
|
32
32
|
)
|
|
33
33
|
);
|
|
34
34
|
</script>
|
|
@@ -1,42 +1,53 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
2
|
const props = defineProps<{
|
|
4
|
-
metadata: any
|
|
3
|
+
metadata: any
|
|
5
4
|
chain_id: number | string
|
|
6
|
-
}>()
|
|
5
|
+
}>()
|
|
7
6
|
|
|
8
|
-
const compact = inject('compact')
|
|
9
|
-
const tokens = inject<ITokenPrice[]>('tokens')
|
|
7
|
+
const compact = inject('compact')
|
|
8
|
+
const tokens = inject<ITokenPrice[]>('tokens')
|
|
10
9
|
|
|
11
10
|
const fromToken = asyncComputed(() => {
|
|
12
|
-
if (!props?.chain_id)
|
|
11
|
+
if (!props?.chain_id)
|
|
12
|
+
return null
|
|
13
13
|
|
|
14
|
-
if (Array.isArray(tokens) && !tokens.length)
|
|
14
|
+
if (Array.isArray(tokens) && !tokens.length)
|
|
15
|
+
return null
|
|
15
16
|
|
|
16
17
|
return fetchTokenByAddress(
|
|
17
18
|
props.metadata?.fromToken,
|
|
18
19
|
props?.chain_id,
|
|
19
|
-
tokens
|
|
20
|
-
)
|
|
21
|
-
})
|
|
20
|
+
tokens,
|
|
21
|
+
)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const toToken = asyncComputed(() => {
|
|
25
|
+
if (!props?.metadata?.toChainId)
|
|
26
|
+
return null
|
|
27
|
+
|
|
28
|
+
if (Array.isArray(tokens) && !tokens.length)
|
|
29
|
+
return null
|
|
22
30
|
|
|
23
|
-
|
|
31
|
+
return fetchTokenByAddress(props.metadata?.toToken, props?.metadata?.toChainId, tokens)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
const formattedToAmount = computed(() =>
|
|
24
35
|
formatDecimal(
|
|
25
|
-
fromWei(props.metadata?.amount,
|
|
26
|
-
)
|
|
27
|
-
)
|
|
36
|
+
fromWei(props.metadata?.amount, toToken?.value?.decimals).toFixed(),
|
|
37
|
+
),
|
|
38
|
+
)
|
|
28
39
|
</script>
|
|
29
40
|
|
|
30
41
|
<template>
|
|
31
|
-
<div class="h-[60px]"
|
|
42
|
+
<div v-if="!fromToken" class="h-[60px]">
|
|
32
43
|
<div class="rounded-5 w-24 h-4 loading-box" />
|
|
33
44
|
</div>
|
|
34
|
-
<div class="flex gap-5 flex-col"
|
|
45
|
+
<div v-else class="flex gap-5 flex-col">
|
|
35
46
|
<div class="flex items-center gap-5">
|
|
36
47
|
<span v-if="!compact" class="capitalize text-xs sm:text-sm">Cross-chain send</span>
|
|
37
48
|
<span class="inline-flex gap-2.5 items-center">
|
|
38
|
-
<img width="20" height="20" class="w-5 h-5" :src="fromToken?.logo_url"
|
|
39
|
-
{{
|
|
49
|
+
<img width="20" height="20" class="w-5 h-5" :src="fromToken?.logo_url">
|
|
50
|
+
{{ formattedToAmount }}
|
|
40
51
|
<span class="uppercase">{{ fromToken?.symbol }}</span>
|
|
41
52
|
</span>
|
|
42
53
|
</div>
|
|
@@ -51,18 +62,12 @@ const formattedFromAmount = computed(() =>
|
|
|
51
62
|
|
|
52
63
|
<span class="flex items-center gap-2.5">
|
|
53
64
|
<ChainLogo class="w-5" :chain="metadata?.toChainId" />
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
metadata?.toChainId,
|
|
61
|
-
`/address/${metadata.receiver}`
|
|
62
|
-
)
|
|
63
|
-
"
|
|
64
|
-
>{{ shortenHash(metadata.receiver) }}</a
|
|
65
|
-
>
|
|
65
|
+
<Address
|
|
66
|
+
:address="metadata.receiver" :to="getExplorerUrl(
|
|
67
|
+
metadata?.toChainId,
|
|
68
|
+
`/address/${metadata.receiver}`,
|
|
69
|
+
)"
|
|
70
|
+
/>
|
|
66
71
|
on
|
|
67
72
|
<span>{{ chainIdToName(metadata?.toChainId) }}</span>
|
|
68
73
|
</span>
|
|
@@ -1,45 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
defineProps<{
|
|
3
|
+
chain_id: number | string
|
|
4
4
|
metadata: {
|
|
5
|
-
type: MetadataTypes
|
|
5
|
+
type: MetadataTypes
|
|
6
6
|
[key: string]: any
|
|
7
|
-
}
|
|
8
|
-
compact?: boolean
|
|
9
|
-
}>()
|
|
7
|
+
}
|
|
8
|
+
compact?: boolean
|
|
9
|
+
}>()
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</p>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
<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]">
|
|
24
|
-
<AuthorityAvatar :address="address" class="w-[18px] h-[18px]" />
|
|
25
|
-
<p class="text-xs leading-5">
|
|
26
|
-
{{ shortenHash(address, 2) }}
|
|
27
|
-
</p>
|
|
28
|
-
</div>
|
|
29
|
-
...
|
|
30
|
-
<Tippy max-width="none" interactive tag="button" content-tag="div" content-class="content-wrapper">
|
|
31
|
-
<template #default>
|
|
32
|
-
<SvgoInfo2 class="w-[16px] h-[16px] text-slate-500 rounded-full" />
|
|
33
|
-
</template>
|
|
34
|
-
<template #content>
|
|
35
|
-
<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">
|
|
37
|
-
<AuthorityAvatar class="shrink-0 w-5 h-5" :address="address" />
|
|
38
|
-
{{ address }}
|
|
39
|
-
</li>
|
|
40
|
-
</ul>
|
|
41
|
-
</template>
|
|
42
|
-
</Tippy>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
13
|
+
<ul class="flex gap-2 flex-wrap">
|
|
14
|
+
<li v-for="address in metadata.addresses" :key="address" class="flex rounded-2xl gap-2 bg-gray-900 w-fit items-center py-1.5 px-2.5">
|
|
15
|
+
<AuthorityAvatar class="size-5" :address="address" />
|
|
16
|
+
<Address :address="address" />
|
|
17
|
+
</li>
|
|
18
|
+
</ul>
|
|
45
19
|
</template>
|
|
@@ -1,74 +1,66 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
2
|
const props = defineProps<{
|
|
4
|
-
metadata: any
|
|
3
|
+
metadata: any
|
|
5
4
|
chain_id: number | string
|
|
6
|
-
}>()
|
|
5
|
+
}>()
|
|
7
6
|
|
|
8
|
-
const compact = inject('compact')
|
|
9
|
-
const tokens = inject<ITokenPrice[]>('tokens')
|
|
7
|
+
const compact = inject('compact')
|
|
8
|
+
const tokens = inject<ITokenPrice[]>('tokens')
|
|
10
9
|
|
|
11
|
-
const buyToken = asyncComputed(() =>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
)
|
|
17
|
-
const sellToken = asyncComputed(() =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
)
|
|
10
|
+
const buyToken = asyncComputed(() => {
|
|
11
|
+
if (Array.isArray(tokens) && !tokens.length)
|
|
12
|
+
return null
|
|
13
|
+
return fetchTokenByAddress(props.metadata?.buyToken, props?.chain_id, tokens)
|
|
14
|
+
},
|
|
15
|
+
)
|
|
16
|
+
const sellToken = asyncComputed(() => {
|
|
17
|
+
if (Array.isArray(tokens) && !tokens.length)
|
|
18
|
+
return null
|
|
19
|
+
return fetchTokenByAddress(props.metadata?.sellToken, props?.chain_id, tokens)
|
|
20
|
+
},
|
|
21
|
+
)
|
|
23
22
|
|
|
24
23
|
const sellAmountFormatted = computed(() =>
|
|
25
24
|
formatDecimal(
|
|
26
|
-
fromWei(props.metadata?.sellAmount, sellToken?.value?.decimals).toFixed()
|
|
27
|
-
)
|
|
28
|
-
)
|
|
25
|
+
fromWei(props.metadata?.sellAmount, sellToken?.value?.decimals).toFixed(),
|
|
26
|
+
),
|
|
27
|
+
)
|
|
29
28
|
|
|
30
29
|
const buyAmountFormatted = computed(() =>
|
|
31
30
|
formatDecimal(
|
|
32
|
-
fromWei(props.metadata?.buyAmount, buyToken?.value?.decimals).toFixed()
|
|
33
|
-
)
|
|
34
|
-
)
|
|
31
|
+
fromWei(props.metadata?.buyAmount, buyToken?.value?.decimals).toFixed(),
|
|
32
|
+
),
|
|
33
|
+
)
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
function formatProtocol(protocol: string) {
|
|
37
36
|
return (
|
|
38
37
|
new Map([
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
38
|
+
['1inch-v5', '1inch'],
|
|
39
|
+
['0x-v1', '0x'],
|
|
40
|
+
['paraswap-v5', 'Paraswap'],
|
|
41
|
+
['kyber-v1', 'Kyber Network'],
|
|
43
42
|
]).get(protocol) || protocol
|
|
44
|
-
)
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
)
|
|
44
|
+
}
|
|
48
45
|
</script>
|
|
49
46
|
|
|
50
47
|
<template>
|
|
51
48
|
<div v-if="!sellToken || !buyToken" class="rounded-5 w-24 h-4 loading-box" />
|
|
52
|
-
<div
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<span class="
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
class="capitalize hidden sm:flex items-center gap-2.5"
|
|
67
|
-
v-if="metadata.protocol && !compact"
|
|
68
|
-
>
|
|
69
|
-
On <ProtocolLogo class="w-5 h-5" :name="metadata.protocol" />
|
|
70
|
-
{{ formatProtocol(metadata.protocol) }}
|
|
71
|
-
</span>
|
|
49
|
+
<div v-else class="flex items-center gap-5">
|
|
50
|
+
<span v-if="!compact" class="capitalize text-xs sm:text-sm">{{ metadata.type }}</span>
|
|
51
|
+
<span class="inline-flex gap-2.5 items-center">
|
|
52
|
+
<img width="20" height="20" class="w-5 h-5" :src="sellToken?.logo_url">
|
|
53
|
+
{{ sellAmountFormatted }}
|
|
54
|
+
<span class="uppercase">{{ sellToken?.symbol }}</span>
|
|
55
|
+
<SvgoRefresh class="w-4 h-4 text-slate-400 mx-2" />
|
|
56
|
+
<img width="20" height="20" class="w-5 h-5" :src="buyToken?.logo_url">
|
|
57
|
+
~ {{ buyAmountFormatted }}
|
|
58
|
+
<span class="uppercase">{{ buyToken?.symbol }}</span>
|
|
59
|
+
<span v-if="metadata.protocol && !compact" class="capitalize hidden sm:flex items-center gap-2.5">
|
|
60
|
+
On
|
|
61
|
+
<ProtocolLogo class="w-5 h-5" :name="metadata.protocol" />
|
|
62
|
+
{{ formatProtocol(metadata.protocol) }}
|
|
72
63
|
</span>
|
|
73
|
-
</
|
|
64
|
+
</span>
|
|
65
|
+
</div>
|
|
74
66
|
</template>
|
|
@@ -1,50 +1,48 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
2
|
const props = defineProps<{
|
|
4
|
-
metadata: any
|
|
3
|
+
metadata: any
|
|
5
4
|
chain_id: number | string
|
|
6
|
-
}>()
|
|
5
|
+
}>()
|
|
7
6
|
|
|
8
|
-
const compact = inject('compact')
|
|
9
|
-
const tokens = inject<ITokenPrice[]>('tokens')
|
|
7
|
+
const compact = inject('compact')
|
|
8
|
+
const tokens = inject<ITokenPrice[]>('tokens')
|
|
10
9
|
|
|
11
10
|
const token = asyncComputed(() => {
|
|
12
|
-
if (!props?.chain_id)
|
|
11
|
+
if (!props?.chain_id)
|
|
12
|
+
return null
|
|
13
13
|
|
|
14
|
-
if (Array.isArray(tokens) && !tokens.length)
|
|
14
|
+
if (Array.isArray(tokens) && !tokens.length)
|
|
15
|
+
return null
|
|
15
16
|
|
|
16
17
|
return fetchTokenByAddress(
|
|
17
18
|
props.metadata?.token,
|
|
18
19
|
props?.chain_id,
|
|
19
|
-
tokens
|
|
20
|
-
)
|
|
21
|
-
})
|
|
20
|
+
tokens,
|
|
21
|
+
)
|
|
22
|
+
})
|
|
22
23
|
|
|
23
24
|
const formattedAmount = computed(() =>
|
|
24
25
|
formatDecimal(
|
|
25
|
-
fromWei(props.metadata?.amount, token?.value?.decimals).toFixed()
|
|
26
|
-
)
|
|
27
|
-
)
|
|
26
|
+
fromWei(props.metadata?.amount, token?.value?.decimals).toFixed(),
|
|
27
|
+
),
|
|
28
|
+
)
|
|
28
29
|
</script>
|
|
29
30
|
|
|
30
31
|
<template>
|
|
31
32
|
<div v-if="!token" class="rounded-5 w-24 h-4 loading-box" />
|
|
32
|
-
<div class="flex items-center gap-5"
|
|
33
|
+
<div v-else class="flex items-center gap-5">
|
|
33
34
|
<span v-if="!compact" class="capitalize text-xs sm:text-sm">{{ metadata.type }}</span>
|
|
34
35
|
<span class="inline-flex gap-2.5 items-center">
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
:
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
>{{ shortenHash(metadata.receiver) }}
|
|
47
|
-
</NuxtLink>
|
|
36
|
+
<span class="w-[8em]">
|
|
37
|
+
{{ formattedAmount }}
|
|
38
|
+
<span class="uppercase">{{ token?.symbol }}</span>
|
|
39
|
+
</span>
|
|
40
|
+
<img width="20" height="20" class="w-5 h-5" :src="token?.logo_url">
|
|
41
|
+
<SvgoArrowRight class="w-4 h-4 text-slate-400" />
|
|
42
|
+
<Address
|
|
43
|
+
:to="getExplorerUrl(chain_id, `/address/${metadata.receiver}`)"
|
|
44
|
+
:address="metadata.receiver"
|
|
45
|
+
/>
|
|
48
46
|
</span>
|
|
49
47
|
</div>
|
|
50
48
|
</template>
|