four-flap-meme-sdk 1.5.39 → 1.5.40

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.
@@ -1420,16 +1420,15 @@ export class BundleExecutor {
1420
1420
  * ```
1421
1421
  */
1422
1422
  async bundlePreApprove(params) {
1423
- const { tokenAddress, privateKeys, spender = FLAP_PORTAL, signOnly = false, config } = params;
1423
+ const { tokenAddress, privateKeys, spender = FLAP_PORTAL, signOnly = false, config, payerPrivateKey } = params;
1424
1424
  const sharedProvider = this.aaManager.getProvider();
1425
1425
  const wallets = privateKeys.map((pk) => new Wallet(pk, sharedProvider));
1426
- const bundlerSigner = wallets[0];
1426
+ // 如果提供了 payerPrivateKey,使用它作为 bundlerSigner(特别是 signOnly 模式下,payer 可能是单独的账号)
1427
+ // 否则默认使用第一个 owner
1428
+ const bundlerSigner = payerPrivateKey
1429
+ ? new Wallet(payerPrivateKey, sharedProvider)
1430
+ : wallets[0];
1427
1431
  const beneficiary = bundlerSigner.address;
1428
- console.log('=== XLayer Bundle Pre-Approve ===');
1429
- console.log('token:', tokenAddress);
1430
- console.log('spender:', spender);
1431
- console.log('owners:', wallets.length);
1432
- console.log('signOnly:', signOnly);
1433
1432
  // 1. 批量获取账户信息
1434
1433
  const accountInfos = await this.aaManager.getMultipleAccountInfo(wallets.map((w) => w.address));
1435
1434
  const senders = accountInfos.map((ai) => ai.sender);
@@ -714,6 +714,8 @@ export interface BundlePreApproveParams {
714
714
  signOnly?: boolean;
715
715
  /** 配置覆盖 */
716
716
  config?: Partial<XLayerConfig>;
717
+ /** Payer 私钥(signOnly=true 时必传,用于支付 gas) */
718
+ payerPrivateKey?: string;
717
719
  }
718
720
  /**
719
721
  * 预授权结果
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.5.39",
3
+ "version": "1.5.40",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",