@instadapp/avocado-base 0.0.0-dev.d36b11d → 0.0.0-dev.d63c845
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/forwarder.json +1253 -149
- package/app.vue +7 -0
- package/assets/images/icons/arrow-left.svg +5 -0
- package/assets/images/icons/arrow-right.svg +5 -0
- package/assets/images/icons/avocado.svg +4 -0
- package/assets/images/icons/bridge-2.svg +3 -0
- package/assets/images/icons/bridge.svg +7 -0
- package/assets/images/icons/calendar.svg +8 -0
- package/assets/images/icons/change-threshold.svg +4 -0
- package/assets/images/icons/check-circle.svg +4 -0
- package/assets/images/icons/chevron-down.svg +4 -0
- package/assets/images/icons/clipboard.svg +7 -0
- package/assets/images/icons/clock-circle.svg +5 -0
- package/assets/images/icons/copy.svg +5 -0
- package/assets/images/icons/cross-transfer.svg +7 -0
- package/assets/images/icons/dapp.svg +4 -0
- package/assets/images/icons/deploy.svg +12 -0
- package/assets/images/icons/error-circle.svg +6 -0
- package/assets/images/icons/exclamation-circle.svg +13 -0
- package/assets/images/icons/exclamation-octagon.svg +13 -0
- package/assets/images/icons/exclamation-triangle.svg +5 -0
- package/assets/images/icons/external-link.svg +6 -0
- package/assets/images/icons/eye.svg +4 -0
- package/assets/images/icons/flowers.svg +8 -0
- package/assets/images/icons/gas-emoji.svg +193 -0
- package/assets/images/icons/gas.svg +14 -0
- package/assets/images/icons/gift.svg +153 -0
- package/assets/images/icons/globe.svg +110 -0
- package/assets/images/icons/hamburger.svg +6 -0
- package/assets/images/icons/instadapp-pro.svg +4 -0
- package/assets/images/icons/logout.svg +3 -0
- package/assets/images/icons/moon.svg +3 -0
- package/assets/images/icons/multi-send.svg +7 -0
- package/assets/images/icons/network.svg +13 -0
- package/assets/images/icons/options.svg +5 -0
- package/assets/images/icons/permit-sign.svg +11 -0
- package/assets/images/icons/plus-circle.svg +6 -0
- package/assets/images/icons/plus.svg +5 -0
- package/assets/images/icons/power-off-bg.svg +24 -0
- package/assets/images/icons/power-off.svg +19 -0
- package/assets/images/icons/power-on.svg +19 -0
- package/assets/images/icons/qr.svg +20 -0
- package/assets/images/icons/question-circle.svg +14 -0
- package/assets/images/icons/refresh.svg +6 -0
- package/assets/images/icons/reject-proposal.svg +6 -0
- package/assets/images/icons/search.svg +12 -0
- package/assets/images/icons/sun.svg +3 -0
- package/assets/images/icons/transfer.svg +5 -0
- package/assets/images/icons/trash-2.svg +8 -0
- package/assets/images/icons/upgrade.svg +4 -0
- package/assets/images/icons/wave.svg +214 -0
- package/assets/images/icons/x.svg +5 -0
- package/components/ActionLogo.vue +38 -0
- package/components/ActionMetadata.vue +73 -0
- package/components/ChainLogo.vue +1 -1
- package/components/CopyClipboard.vue +64 -0
- package/components/metadata/Bridge.vue +39 -0
- package/components/metadata/CrossTransfer.vue +67 -0
- package/components/metadata/GasTopup.vue +33 -0
- package/components/metadata/Permit2.vue +37 -0
- package/components/metadata/Swap.vue +67 -0
- package/components/metadata/Transfer.vue +46 -0
- package/components.d.ts +13 -0
- package/contracts/Forwarder.ts +856 -2
- package/contracts/factories/Forwarder__factory.ts +816 -16
- package/nuxt.config.ts +17 -1
- package/package.json +6 -3
- package/utils/avocado.ts +2 -0
- package/utils/bignumber.ts +20 -0
- package/utils/formatter.ts +1 -1
- package/utils/helper.ts +7 -0
- package/utils/metadata.ts +314 -148
- package/utils/network.ts +18 -3
- package/utils/services.ts +14 -0
- package/utils/utils.d.ts +127 -107
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
const props = defineProps<{
|
|
4
|
+
metadata: any;
|
|
5
|
+
chain_id: number | string
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const compact = inject('compact');
|
|
9
|
+
|
|
10
|
+
const buyToken = asyncComputed(() =>
|
|
11
|
+
fetchTokenByAddress(props.metadata?.buyToken, props?.chain_id)
|
|
12
|
+
);
|
|
13
|
+
const sellToken = asyncComputed(() =>
|
|
14
|
+
fetchTokenByAddress(props.metadata?.sellToken, props?.chain_id)
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const sellAmountFormatted = computed(() =>
|
|
18
|
+
formatDecimal(
|
|
19
|
+
fromWei(props.metadata?.sellAmount, sellToken?.value?.decimals).toFixed()
|
|
20
|
+
)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const buyAmountFormatted = computed(() =>
|
|
24
|
+
formatDecimal(
|
|
25
|
+
fromWei(props.metadata?.buyAmount, buyToken?.value?.decimals).toFixed()
|
|
26
|
+
)
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const formatProtocol = (protocol: string) => {
|
|
30
|
+
return (
|
|
31
|
+
new Map([
|
|
32
|
+
["1inch-v5", "1inch"],
|
|
33
|
+
["0x-v1", "0x"],
|
|
34
|
+
["paraswap-v5", "Paraswap"],
|
|
35
|
+
["kyber-v1", "Kyber Network"],
|
|
36
|
+
]).get(protocol) || protocol
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div v-if="!sellToken || !buyToken" class="rounded-5 w-24 h-4 loading-box" />
|
|
45
|
+
<div
|
|
46
|
+
class="flex items-center gap-5"
|
|
47
|
+
v-else
|
|
48
|
+
>
|
|
49
|
+
<span v-if="!compact" class="capitalize text-xs sm:text-sm">{{ metadata.type }}</span>
|
|
50
|
+
<span class="inline-flex gap-2.5 items-center">
|
|
51
|
+
<img width="20" height="20" class="w-5 h-5" :src="sellToken?.logo_url" />
|
|
52
|
+
{{ sellAmountFormatted }}
|
|
53
|
+
<span class="uppercase">{{ sellToken?.symbol }}</span>
|
|
54
|
+
<SvgoRefresh class="w-4 h-4 text-slate-400 mx-2" />
|
|
55
|
+
<img width="20" height="20" class="w-5 h-5" :src="buyToken?.logo_url" />
|
|
56
|
+
{{ buyAmountFormatted }}
|
|
57
|
+
<span class="uppercase">{{ buyToken?.symbol }}</span>
|
|
58
|
+
<span
|
|
59
|
+
class="capitalize hidden sm:flex items-center gap-2.5"
|
|
60
|
+
v-if="metadata.protocol && !compact"
|
|
61
|
+
>
|
|
62
|
+
On <ProtocolLogo class="w-5 h-5" :name="metadata.protocol" />
|
|
63
|
+
{{ formatProtocol(metadata.protocol) }}
|
|
64
|
+
</span>
|
|
65
|
+
</span>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
|
|
3
|
+
const props = defineProps<{
|
|
4
|
+
metadata: any;
|
|
5
|
+
chain_id: number | string
|
|
6
|
+
}>();
|
|
7
|
+
|
|
8
|
+
const compact = inject('compact');
|
|
9
|
+
|
|
10
|
+
const token = asyncComputed(() => {
|
|
11
|
+
if (!props?.chain_id) return null;
|
|
12
|
+
|
|
13
|
+
return fetchTokenByAddress(
|
|
14
|
+
props.metadata?.token,
|
|
15
|
+
props?.chain_id
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const formattedAmount = computed(() =>
|
|
20
|
+
formatDecimal(
|
|
21
|
+
fromWei(props.metadata?.amount, token?.value?.decimals).toFixed()
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div v-if="!token" class="rounded-5 w-24 h-4 loading-box" />
|
|
28
|
+
<div class="flex items-center gap-5" v-else>
|
|
29
|
+
<span v-if="!compact" class="capitalize text-xs sm:text-sm">{{ metadata.type }}</span>
|
|
30
|
+
<span class="inline-flex gap-2.5 items-center">
|
|
31
|
+
{{ formattedAmount }}
|
|
32
|
+
<span class="uppercase">{{ token?.symbol }}</span>
|
|
33
|
+
<img width="20" height="20" class="w-5 h-5" :src="token?.logo_url" />
|
|
34
|
+
<SvgoArrowRight class="w-4 h-4 text-slate-400 mx-2" />
|
|
35
|
+
<NuxtLink
|
|
36
|
+
class="text-primary"
|
|
37
|
+
target="_blank"
|
|
38
|
+
external
|
|
39
|
+
:to="
|
|
40
|
+
getExplorerUrl(chain_id, `/address/${metadata.receiver}`)
|
|
41
|
+
"
|
|
42
|
+
>{{ shortenHash(metadata.receiver) }}
|
|
43
|
+
</NuxtLink>
|
|
44
|
+
</span>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
package/components.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// Generated by unplugin-vue-components
|
|
5
|
+
// Read more: https://github.com/vuejs/core/pull/3399
|
|
6
|
+
export {}
|
|
7
|
+
|
|
8
|
+
declare module 'vue' {
|
|
9
|
+
export interface GlobalComponents {
|
|
10
|
+
RouterLink: typeof import('vue-router')['RouterLink']
|
|
11
|
+
RouterView: typeof import('vue-router')['RouterView']
|
|
12
|
+
}
|
|
13
|
+
}
|