four-flap-meme-sdk 1.7.28 → 1.7.29

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.
@@ -34,9 +34,15 @@ function buildFlapBuyCalls(wallets, buyAmounts, tokenAddress) {
34
34
  const amount = buyAmounts[i];
35
35
  if (amount <= 0n)
36
36
  continue;
37
- // 通过 executeBatch 让钱包调用 Flap Portal buy 函数
38
- // 这样代币会发送到调用者(钱包地址)
39
- const portalCallData = portalInterface.encodeFunctionData('buy', [tokenAddress]);
37
+ // 修复:使用 swapExactInput 代替 buy 函数,与 bundle-create.ts 保持一致
38
+ // buy(token) 是旧 API,swapExactInput 是新的标准 API
39
+ const portalCallData = portalInterface.encodeFunctionData('swapExactInput', [{
40
+ inputToken: ethers.ZeroAddress, // 0x0 = OKB (原生代币)
41
+ outputToken: tokenAddress,
42
+ inputAmount: amount,
43
+ minOutputAmount: 0n, // 无滑点保护
44
+ permitData: '0x',
45
+ }]);
40
46
  const batchCalls = [{
41
47
  target: FLAP_PORTAL_ADDRESS,
42
48
  value: amount,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.7.28",
3
+ "version": "1.7.29",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",