four-flap-meme-sdk 1.3.76 → 1.3.77

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.
@@ -43,6 +43,7 @@ async function quoteSellOutput({ routeParams, sellAmountWei, provider }) {
43
43
  const params = routeParams;
44
44
  const quoter = new Contract(PANCAKE_V3_QUOTER_ADDRESS, PANCAKE_V3_QUOTER_ABI, provider);
45
45
  try {
46
+ console.log(`📊 V3 报价参数: tokenIn=${params.v3TokenIn}, tokenOut=${params.v3TokenOut}, fee=${params.v3Fee}, amount=${ethers.formatEther(sellAmountWei)}`);
46
47
  const result = await quoter.quoteExactInputSingle.staticCall({
47
48
  tokenIn: params.v3TokenIn,
48
49
  tokenOut: params.v3TokenOut,
@@ -50,15 +51,19 @@ async function quoteSellOutput({ routeParams, sellAmountWei, provider }) {
50
51
  fee: params.v3Fee,
51
52
  sqrtPriceLimitX96: 0
52
53
  });
54
+ console.log(`✅ V3 报价成功: ${ethers.formatEther(result[0])}`);
53
55
  return { estimatedBNBOut: result[0] };
54
56
  }
55
- catch {
57
+ catch (v3Error) {
58
+ console.warn(`⚠️ V3 报价失败 (fee=${params.v3Fee}):`, v3Error);
56
59
  if (params.v2Path && params.v2Path.length >= 2) {
60
+ console.log(`🔄 尝试 V2 备选路径: ${params.v2Path.join(' -> ')}`);
57
61
  const v2Router = new Contract(PANCAKE_V2_ROUTER_ADDRESS, PANCAKE_V2_ROUTER_ABI, provider);
58
62
  const amounts = await v2Router.getAmountsOut(sellAmountWei, params.v2Path);
63
+ console.log(`✅ V2 备选报价成功: ${ethers.formatEther(amounts[amounts.length - 1])}`);
59
64
  return { estimatedBNBOut: amounts[amounts.length - 1] };
60
65
  }
61
- throw new Error('V3 QuoterV2 失败且未提供 v2Path 作为备选');
66
+ throw new Error(`V3 QuoterV2 失败 (fee=${params.v3Fee}) 且未提供 v2Path 作为备选。可能的原因: 1. V3 池子不存在 2. 费率档位错误 3. 流动性不足`);
62
67
  }
63
68
  }
64
69
  const params = routeParams;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.3.76",
3
+ "version": "1.3.77",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",