质押cec 转化、取消转化
This commit is contained in:
parent
97b8e8ff8f
commit
ef0bcff811
@ -21,11 +21,11 @@
|
|||||||
<div class="text">
|
<div class="text">
|
||||||
<li>
|
<li>
|
||||||
<div>Conversion in progress</div>
|
<div>Conversion in progress</div>
|
||||||
<span>$0.57</span>
|
<span>{{ priceCalculated(stakingStore.cecInfoData.esCecConversion) }}</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div>Locked</div>
|
<div>Locked</div>
|
||||||
<span>$0.57</span>
|
<span>{{ priceCalculated(stakingStore.cecInfoData.esCecConversion) }}</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div>Convert remaining time</div>
|
<div>Convert remaining time</div>
|
||||||
@ -125,7 +125,7 @@ const collectionModal = () => {
|
|||||||
typeName: "es CEC",
|
typeName: "es CEC",
|
||||||
conversion: "Reveres conversion esCEC",
|
conversion: "Reveres conversion esCEC",
|
||||||
conversionName: "CEC",
|
conversionName: "CEC",
|
||||||
amount: stakingStore.cecInfoData.CecClaimable
|
// amount: stakingStore.cecInfoData.CecClaimable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div>CEC collection</div>
|
<div>CEC collection</div>
|
||||||
<p>{{ priceCalculated(cecInfoData.CecCollection) }}</p>
|
<p>{{ priceCalculated(cecInfoData.cecClaimAll) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
@ -129,6 +129,8 @@ import {BlockChain} from "@/components/chain/BlockChain";
|
|||||||
const localWalletStore = walletStore();
|
const localWalletStore = walletStore();
|
||||||
const stakingStore = useStakingStore();
|
const stakingStore = useStakingStore();
|
||||||
|
|
||||||
|
const timer = ref(null)
|
||||||
|
const count = ref()
|
||||||
const vipDialogVisible = ref(false);
|
const vipDialogVisible = ref(false);
|
||||||
const cecInfoData = ref({
|
const cecInfoData = ref({
|
||||||
cecBalance: BigInt("0"),
|
cecBalance: BigInt("0"),
|
||||||
@ -141,6 +143,7 @@ const cecInfoData = ref({
|
|||||||
esCecCollection: BigInt("0"),
|
esCecCollection: BigInt("0"),
|
||||||
totalCollection: BigInt("0"),
|
totalCollection: BigInt("0"),
|
||||||
CecClaimable: BigInt("0"),
|
CecClaimable: BigInt("0"),
|
||||||
|
cecClaimAll: BigInt("0"),
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -186,13 +189,15 @@ const getCecData = async () => {
|
|||||||
// 锁定的cec 等于 转换中的esCec数量
|
// 锁定的cec 等于 转换中的esCec数量
|
||||||
cecInfoData.value.CecDisarm = cecInfoData.value.esCecConversion;
|
cecInfoData.value.CecDisarm = cecInfoData.value.esCecConversion;
|
||||||
try {
|
try {
|
||||||
cecInfoData.value.CecClaimable = BigInt(await bc.vester.queryClaimable())
|
|
||||||
const stakeCecCollection = await bc.staking.queryClaimableByCEC();
|
const stakeCecCollection = await bc.staking.queryClaimableByCEC();
|
||||||
const stakeEsCecCollection = await bc.staking.queryClaimableByEsCEC();
|
const stakeEsCecCollection = await bc.staking.queryClaimableByEsCEC();
|
||||||
cecInfoData.value.CecCollection = BigInt(await bc.staking.queryClaimableByCEC());
|
cecInfoData.value.CecCollection = BigInt(await bc.staking.queryCumulativeByCEC());
|
||||||
cecInfoData.value.esCecCollection = BigInt(await bc.staking.queryClaimableByEsCEC());
|
cecInfoData.value.esCecCollection = BigInt(await bc.staking.queryCumulativeByEsCEC());
|
||||||
console.log("cecInfoData.value.esCecCollection", cecInfoData.value.esCecCollection);
|
cecInfoData.value.CecClaim = BigInt(await bc.staking.queryCumulativeByCEC());
|
||||||
cecInfoData.value.totalCollection = cecInfoData.value.esCecCollection + cecInfoData.value.CecCollection;
|
cecInfoData.value.esCecClaim = BigInt(await bc.staking.queryCumulativeByEsCEC());
|
||||||
|
cecInfoData.value.CecClaimable = BigInt(await bc.vester.queryClaimable())
|
||||||
|
cecInfoData.value.cecClaimAll = BigInt(await bc.vester.queryClaimabledAll())
|
||||||
|
cecInfoData.value.totalCollection = cecInfoData.value.CecClaim + cecInfoData.value.esCecClaim;
|
||||||
stakingStore.cecInfoData = cecInfoData.value;
|
stakingStore.cecInfoData = cecInfoData.value;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log("query claimable error", e);
|
console.log("query claimable error", e);
|
||||||
@ -205,6 +210,23 @@ const vipHandleClose = () => {
|
|||||||
vipDialogVisible.value = false;
|
vipDialogVisible.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getCode = () =>{
|
||||||
|
const TIME_COUNT = 5;
|
||||||
|
if (!timer.value) {
|
||||||
|
count.value = TIME_COUNT;
|
||||||
|
// this.show = false;
|
||||||
|
timer.value = setInterval(() => {
|
||||||
|
if (count.value > 0 && count.value <= TIME_COUNT) {
|
||||||
|
count.value--;
|
||||||
|
} else {
|
||||||
|
getCecData()
|
||||||
|
clearInterval(timer.value);
|
||||||
|
timer.value = null;
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
watch(localWalletStore, () => {
|
watch(localWalletStore, () => {
|
||||||
// console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token)
|
// console.log('localWalletStore.token',localWalletStore.address,localWalletStore.token)
|
||||||
// if(localWalletStore.token) {
|
// if(localWalletStore.token) {
|
||||||
@ -214,7 +236,7 @@ watch(localWalletStore, () => {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (localWalletStore.address) {
|
if (localWalletStore.address) {
|
||||||
getCecData();
|
getCode();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -119,7 +119,6 @@
|
|||||||
<img src="@/assets/img/staking/esCEC.png" alt="">
|
<img src="@/assets/img/staking/esCEC.png" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="amount">{{ priceCalculated(stakingStore.cecInfoData.esCecCollection) }}</div>
|
<div class="amount">{{ priceCalculated(stakingStore.cecInfoData.esCecCollection) }}</div>
|
||||||
<div>{{stakingStore.cecInfoData.esCecCollection}}</div>
|
|
||||||
<div class="btns">
|
<div class="btns">
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<span @click="esCecStakingText">Stake</span>
|
<span @click="esCecStakingText">Stake</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user