@instadapp/avocado-base 0.0.0-dev.424dd71 → 0.0.0-dev.4546ed9
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/assets/images/icons/check.svg +3 -0
- package/assets/images/icons/copy.svg +9 -2
- package/assets/images/icons/stars.svg +4 -0
- package/components/ActionLogo.vue +32 -30
- package/components/ActionMetadata.vue +30 -20
- package/components/Address.vue +74 -0
- package/components/AuthorityAvatar.vue +4 -5
- package/components/ChainLogo.vue +10 -17
- package/components/CopyClipboard.vue +16 -38
- package/components/metadata/CrossTransfer.vue +29 -32
- package/components/metadata/Signers.vue +11 -55
- package/components/metadata/Swap.vue +29 -30
- package/components/metadata/Transfer.vue +25 -27
- package/contracts/MultisigAgnosticForwarder.ts +1423 -0
- package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2135 -0
- package/contracts/factories/index.ts +1 -0
- package/contracts/index.ts +2 -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/metadata.ts +104 -8
- package/utils/network.ts +421 -265
- package/utils/utils.d.ts +14 -2
|
@@ -1,63 +1,62 @@
|
|
|
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 buyToken = asyncComputed(() => {
|
|
12
|
-
if (Array.isArray(tokens) && !tokens.length)
|
|
11
|
+
if (Array.isArray(tokens) && !tokens.length)
|
|
12
|
+
return null
|
|
13
13
|
return fetchTokenByAddress(props.metadata?.buyToken, props?.chain_id, tokens)
|
|
14
|
-
}
|
|
15
|
-
)
|
|
14
|
+
},
|
|
15
|
+
)
|
|
16
16
|
const sellToken = asyncComputed(() => {
|
|
17
|
-
if (Array.isArray(tokens) && !tokens.length)
|
|
17
|
+
if (Array.isArray(tokens) && !tokens.length)
|
|
18
|
+
return null
|
|
18
19
|
return fetchTokenByAddress(props.metadata?.sellToken, props?.chain_id, tokens)
|
|
19
|
-
}
|
|
20
|
-
)
|
|
20
|
+
},
|
|
21
|
+
)
|
|
21
22
|
|
|
22
23
|
const sellAmountFormatted = computed(() =>
|
|
23
24
|
formatDecimal(
|
|
24
|
-
fromWei(props.metadata?.sellAmount, sellToken?.value?.decimals).toFixed()
|
|
25
|
-
)
|
|
26
|
-
)
|
|
25
|
+
fromWei(props.metadata?.sellAmount, sellToken?.value?.decimals).toFixed(),
|
|
26
|
+
),
|
|
27
|
+
)
|
|
27
28
|
|
|
28
29
|
const buyAmountFormatted = computed(() =>
|
|
29
30
|
formatDecimal(
|
|
30
|
-
fromWei(props.metadata?.buyAmount, buyToken?.value?.decimals).toFixed()
|
|
31
|
-
)
|
|
32
|
-
)
|
|
31
|
+
fromWei(props.metadata?.buyAmount, buyToken?.value?.decimals).toFixed(),
|
|
32
|
+
),
|
|
33
|
+
)
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
function formatProtocol(protocol: string) {
|
|
35
36
|
return (
|
|
36
37
|
new Map([
|
|
37
|
-
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
40
|
-
[
|
|
38
|
+
['1inch-v5', '1inch'],
|
|
39
|
+
['0x-v1', '0x'],
|
|
40
|
+
['paraswap-v5', 'Paraswap'],
|
|
41
|
+
['kyber-v1', 'Kyber Network'],
|
|
41
42
|
]).get(protocol) || protocol
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
)
|
|
44
|
+
}
|
|
46
45
|
</script>
|
|
47
46
|
|
|
48
47
|
<template>
|
|
49
48
|
<div v-if="!sellToken || !buyToken" class="rounded-5 w-24 h-4 loading-box" />
|
|
50
|
-
<div class="flex items-center gap-5"
|
|
49
|
+
<div v-else class="flex items-center gap-5">
|
|
51
50
|
<span v-if="!compact" class="capitalize text-xs sm:text-sm">{{ metadata.type }}</span>
|
|
52
51
|
<span class="inline-flex gap-2.5 items-center">
|
|
53
|
-
<img width="20" height="20" class="w-5 h-5" :src="sellToken?.logo_url"
|
|
52
|
+
<img width="20" height="20" class="w-5 h-5" :src="sellToken?.logo_url">
|
|
54
53
|
{{ sellAmountFormatted }}
|
|
55
54
|
<span class="uppercase">{{ sellToken?.symbol }}</span>
|
|
56
55
|
<SvgoRefresh class="w-4 h-4 text-slate-400 mx-2" />
|
|
57
|
-
<img width="20" height="20" class="w-5 h-5" :src="buyToken?.logo_url"
|
|
56
|
+
<img width="20" height="20" class="w-5 h-5" :src="buyToken?.logo_url">
|
|
58
57
|
~ {{ buyAmountFormatted }}
|
|
59
58
|
<span class="uppercase">{{ buyToken?.symbol }}</span>
|
|
60
|
-
<span class="capitalize hidden sm:flex items-center gap-2.5"
|
|
59
|
+
<span v-if="metadata.protocol && !compact" class="capitalize hidden sm:flex items-center gap-2.5">
|
|
61
60
|
On
|
|
62
61
|
<ProtocolLogo class="w-5 h-5" :name="metadata.protocol" />
|
|
63
62
|
{{ formatProtocol(metadata.protocol) }}
|
|
@@ -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>
|