fix some bug for query verster value
This commit is contained in:
parent
bb052f7c70
commit
38e9e0bf80
@ -55,10 +55,11 @@ export class Vester {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
async claim() {
|
async claim() {
|
||||||
|
const userAddress = await this.bc.eoaProvider.getSigner().getAddress()
|
||||||
return this.execMethod({
|
return this.execMethod({
|
||||||
provider: this.bc.eoaProvider,
|
provider: this.bc.eoaProvider,
|
||||||
method: 'claim',
|
method: 'claim',
|
||||||
params: []
|
params: [userAddress]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -89,10 +90,11 @@ export class Vester {
|
|||||||
* 查询当前用户可以领取的CEC数量
|
* 查询当前用户可以领取的CEC数量
|
||||||
*/
|
*/
|
||||||
async queryClaimable() {
|
async queryClaimable() {
|
||||||
|
const userAddress = await this.bc.eoaProvider.getSigner().getAddress()
|
||||||
return this.queryMethod({
|
return this.queryMethod({
|
||||||
provider: this.bc.eoaProvider,
|
provider: this.bc.eoaProvider,
|
||||||
method: 'claimable',
|
method: 'claimable',
|
||||||
params: []
|
params: [userAddress]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div>CEC disarm</div>
|
<div>CEC disarm</div>
|
||||||
<p>{{ cecInfoData.CecDisarm }}</p>
|
<p>{{ priceCalculated(cecInfoData.CecDisarm) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div>CEC collection</div>
|
<div>CEC collection</div>
|
||||||
<p>{{ cecInfoData.CecCollection }}</p>
|
<p>{{ priceCalculated(cecInfoData.CecCollection) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
@ -60,7 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div>esCEC</div>
|
<div>esCEC</div>
|
||||||
<p>{{ cecInfoData.esCecBalance }}</p>
|
<p>{{ priceCalculated(cecInfoData.esCecBalance) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -71,7 +71,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div>esCEC Staking</div>
|
<div>esCEC Staking</div>
|
||||||
<p>{{ cecInfoData.esCecStaked }}</p>
|
<p>{{ priceCalculated(cecInfoData.esCecStaked) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -82,7 +82,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div>esCEC conversion</div>
|
<div>esCEC conversion</div>
|
||||||
<p>{{ cecInfoData.esCecConversion }}</p>
|
<p>{{ priceCalculated(cecInfoData.esCecConversion) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@ -93,7 +93,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div>esCEC collection</div>
|
<div>esCEC collection</div>
|
||||||
<p>{{ cecInfoData.esCecCollection }}</p>
|
<p>{{ priceCalculated(cecInfoData.esCecCollection) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
@ -182,8 +182,17 @@ const getCecData = async () => {
|
|||||||
cecInfoData.value.esCecBalance = BigInt(await bc.erc20.esCecBalanceOf(address)).toString()
|
cecInfoData.value.esCecBalance = BigInt(await bc.erc20.esCecBalanceOf(address)).toString()
|
||||||
cecInfoData.value.CecStaked = BigInt(await bc.staking.queryCECStaked()).toString()
|
cecInfoData.value.CecStaked = BigInt(await bc.staking.queryCECStaked()).toString()
|
||||||
cecInfoData.value.esCecStaked = BigInt(await bc.staking.queryEsCECStaked()).toString()
|
cecInfoData.value.esCecStaked = BigInt(await bc.staking.queryEsCECStaked()).toString()
|
||||||
// let ClaimableByCEC = await bc.staking.queryCumulativeByCEC()
|
cecInfoData.value.esCecConversion = BigInt(await bc.vester.queryVested()).toString()
|
||||||
// let ClaimableByEsCEC = await bc.staking.queryClaimableByEsCEC()
|
// 锁定的cec 等于 转换中的esCec数量
|
||||||
|
cecInfoData.value.CecDisarm = cecInfoData.value.esCecConversion;
|
||||||
|
try {
|
||||||
|
cecInfoData.value.CecCollection = await bc.vester.queryClaimable()
|
||||||
|
const stakeCecCollection = await bc.staking.queryClaimableByCEC()
|
||||||
|
const stakeEsCecCollection = await bc.staking.queryClaimableByEsCEC()
|
||||||
|
cecInfoData.value.esCecCollection = (BigInt(stakeCecCollection) + BigInt(stakeEsCecCollection)).toString()
|
||||||
|
} catch (e) {
|
||||||
|
console.log('query claimable error', e)
|
||||||
|
}
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}, 2000);
|
}, 2000);
|
||||||
// let cec = await bc.staking.queryCECStaked()
|
// let cec = await bc.staking.queryCECStaked()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user