update getRewardsFor function
This commit is contained in:
+25
-19
@@ -39,24 +39,29 @@ export const useUniswapStore = defineStore("uniswap", {
|
||||
},
|
||||
|
||||
async quoteExactInputSingle(amount) {
|
||||
console.log("quoteExactInputSingle");
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
var amountEthBase = await memeBurnerStore.getAmountETHBase(amount);
|
||||
console.log("123", {
|
||||
token1: this.poolData.token1,
|
||||
token0: this.poolData.token0,
|
||||
fee: this.poolData.fee,
|
||||
amountEthBase,
|
||||
pricelimit: 0, //sqrtPriceLimitX96
|
||||
});
|
||||
const quotedAmountOut = await this.quoateV3Contract.read.quoteExactInputSingle([
|
||||
this.poolData.token1,
|
||||
this.poolData.token0,
|
||||
this.poolData.fee,
|
||||
amountEthBase,
|
||||
0, //sqrtPriceLimitX96
|
||||
]);
|
||||
return quotedAmountOut;
|
||||
try {
|
||||
console.log("quoteExactInputSingle");
|
||||
const memeBurnerStore = useMemeburnerStore();
|
||||
var amountEthBase = await memeBurnerStore.getAmountETHBase(amount);
|
||||
console.log("amountEthBase", amountEthBase);
|
||||
console.log("123", {
|
||||
token0: this.poolData.token0,
|
||||
token1: this.poolData.token1,
|
||||
fee: this.poolData.fee,
|
||||
amountEthBase: amountEthBase,
|
||||
pricelimit: 0, //sqrtPriceLimitX96
|
||||
});
|
||||
const quotedAmountOut = await this.quoateV3Contract.read.quoteExactInputSingle([
|
||||
this.poolData.token0, //bloodline
|
||||
this.poolData.token1, //weth
|
||||
this.poolData.fee,
|
||||
amountEthBase,
|
||||
0, //sqrtPriceLimitX96
|
||||
]);
|
||||
return {result: true, amount: quotedAmountOut};
|
||||
} catch (error) {
|
||||
return { result: false, amount: null };
|
||||
}
|
||||
},
|
||||
async getPoolData() {
|
||||
console.log("getPoolData");
|
||||
@@ -80,7 +85,8 @@ export const useUniswapStore = defineStore("uniswap", {
|
||||
});
|
||||
this.poolData.token0 = data[0].result;
|
||||
this.poolData.token1 = data[1].result;
|
||||
this.poolData.fee = data[2].result;
|
||||
this.poolData.fee = data[2].result;
|
||||
console.log("this.poolData", this.poolData);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user