better backend comms

This commit is contained in:
johba 2025-09-24 09:41:28 +02:00
parent d0e8623cf9
commit 02a057622c
17 changed files with 1054 additions and 134 deletions

View file

@ -16,9 +16,9 @@
<chart-complete></chart-complete>
<div class="hold-stake-wrapper">
<f-card class="inner-border">
<template v-if="wallet.account.chainId && !chainsArray.includes(wallet.account.chainId)">
Chain not supported
</template>
<template v-if="!isChainSupported">
Chain not supported
</template>
<template v-else-if="status !== 'connected'">
<f-button @click="showPanel = true" size="large" block
>Connect Wallet</f-button
@ -80,6 +80,7 @@ import { useWallet } from "@/composables/useWallet";
import FCard from "@/components/fcomponents/FCard.vue";
import IconInfo from "@/components/icons/IconInfo.vue";
import FButton from "@/components/fcomponents/FButton.vue";
import { DEFAULT_CHAIN_ID } from "@/config";
// todo interface positions
import { usePositions } from "@/composables/usePositions";
@ -90,8 +91,8 @@ import { compactNumber, InsertCommaNumber } from "@/utils/helper";
const { myActivePositions, tresholdValue, activePositions } = usePositions();
const stats = useStatCollection();
const chains = useChains();
const wallet = useWallet();
const chains = useChains();
function calculateAverageTaxRate(data: any): number {
console.log("data", data);
@ -104,10 +105,10 @@ function calculateAverageTaxRate(data: any): number {
return averageTaxRate * 100;
}
const chainsArray = computed(() => chains.value.map((chain) => chain.id));
const averageTaxRate = computed(() => calculateAverageTaxRate(activePositions.value));
const supportedChainIds = computed(() => chains.value.map((chain) => chain.id));
const currentChainId = computed(() => wallet.account.chainId ?? DEFAULT_CHAIN_ID);
const isChainSupported = computed(() => supportedChainIds.value.includes(currentChainId.value));
onMounted(async () => {});
</script>