@instadapp/avocado-base 0.0.88 → 0.0.92
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/components/metadata/Swap.vue +22 -29
- package/package.json +1 -1
- package/utils/network.ts +19 -0
- package/utils/utils.d.ts +2 -1
|
@@ -8,17 +8,15 @@ const props = defineProps<{
|
|
|
8
8
|
const compact = inject('compact');
|
|
9
9
|
const tokens = inject<ITokenPrice[]>('tokens');
|
|
10
10
|
|
|
11
|
-
const buyToken = asyncComputed(() =>
|
|
12
|
-
{
|
|
11
|
+
const buyToken = asyncComputed(() => {
|
|
13
12
|
if (Array.isArray(tokens) && !tokens.length) return null;
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return fetchTokenByAddress(props.metadata?.buyToken, props?.chain_id, tokens)
|
|
14
|
+
}
|
|
16
15
|
);
|
|
17
|
-
const sellToken = asyncComputed(() =>
|
|
18
|
-
{
|
|
16
|
+
const sellToken = asyncComputed(() => {
|
|
19
17
|
if (Array.isArray(tokens) && !tokens.length) return null;
|
|
20
|
-
return
|
|
21
|
-
|
|
18
|
+
return fetchTokenByAddress(props.metadata?.sellToken, props?.chain_id, tokens)
|
|
19
|
+
}
|
|
22
20
|
);
|
|
23
21
|
|
|
24
22
|
const sellAmountFormatted = computed(() =>
|
|
@@ -49,26 +47,21 @@ const formatProtocol = (protocol: string) => {
|
|
|
49
47
|
|
|
50
48
|
<template>
|
|
51
49
|
<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>
|
|
50
|
+
<div class="flex items-center gap-5" v-else>
|
|
51
|
+
<span v-if="!compact" class="capitalize text-xs sm:text-sm">{{ metadata.type }}</span>
|
|
52
|
+
<span class="inline-flex gap-2.5 items-center">
|
|
53
|
+
<img width="20" height="20" class="w-5 h-5" :src="sellToken?.logo_url" />
|
|
54
|
+
{{ sellAmountFormatted }}
|
|
55
|
+
<span class="uppercase">{{ sellToken?.symbol }}</span>
|
|
56
|
+
<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" />
|
|
58
|
+
~ {{ buyAmountFormatted }}
|
|
59
|
+
<span class="uppercase">{{ buyToken?.symbol }}</span>
|
|
60
|
+
<span class="capitalize hidden sm:flex items-center gap-2.5" v-if="metadata.protocol && !compact">
|
|
61
|
+
On
|
|
62
|
+
<ProtocolLogo class="w-5 h-5" :name="metadata.protocol" />
|
|
63
|
+
{{ formatProtocol(metadata.protocol) }}
|
|
72
64
|
</span>
|
|
73
|
-
</
|
|
65
|
+
</span>
|
|
66
|
+
</div>
|
|
74
67
|
</template>
|
package/package.json
CHANGED
package/utils/network.ts
CHANGED
|
@@ -354,6 +354,25 @@ export const networks: Network[] = [
|
|
|
354
354
|
},
|
|
355
355
|
},
|
|
356
356
|
},
|
|
357
|
+
{
|
|
358
|
+
name: "Manta Pacific",
|
|
359
|
+
chainId: 169,
|
|
360
|
+
explorerUrl: "https://manta-pacific.l2scan.co",
|
|
361
|
+
params: {
|
|
362
|
+
rpcUrls: ["https://pacific-rpc.manta.network/http"],
|
|
363
|
+
chainName: "Manta Pacific",
|
|
364
|
+
nativeCurrency: {
|
|
365
|
+
name: "Ethereum",
|
|
366
|
+
symbol: "ETH",
|
|
367
|
+
decimals: 18,
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
color: "#78d64b",
|
|
371
|
+
fakeTransactionHash: "0x3fB128aA5AC254C8539996B11C587E521AE0d3ab",
|
|
372
|
+
get serverRpcUrl() {
|
|
373
|
+
return process.env?.MANTA_RPC_URL || this.params.rpcUrls[0];
|
|
374
|
+
},
|
|
375
|
+
},
|
|
357
376
|
{
|
|
358
377
|
name: AVO_PROD_CHAIN_NAME,
|
|
359
378
|
chainId: AVO_PROD_CHAIN_ID,
|