pinpet-sdk 2.1.27 → 2.1.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.
@@ -15579,9 +15579,9 @@ const MIN_STOP_LOSS_PERCENT$1 = 40; // 4.0%
15579
15579
 
15580
15580
  // Maximum number of candidate indices to include in close_insert_indices
15581
15581
  // This represents: 1 main position + N nodes before + N nodes after
15582
- // Must be an odd number >= 1 (e.g., 21 = 1 main + 10 before + 10 after)
15583
- // The contract accepts up to 20, we use 21 to provide more flexibility
15584
- const MAX_CANDIDATE_INDICES$3 = 31;
15582
+ // Must be an odd number >= 1 (e.g., 41 = 1 main + 20 before + 20 after)
15583
+ // The contract accepts up to 41
15584
+ const MAX_CANDIDATE_INDICES$3 = 19;
15585
15585
 
15586
15586
 
15587
15587
  /**
@@ -16471,7 +16471,7 @@ class TradingModule$1 {
16471
16471
 
16472
16472
  var trading = TradingModule$1;
16473
16473
 
16474
- const { ComputeBudgetProgram, PublicKey: PublicKey$5, Transaction: Transaction$2, Keypair, SystemProgram: SystemProgram$2, SYSVAR_RENT_PUBKEY: SYSVAR_RENT_PUBKEY$1, VersionedTransaction, TransactionMessage } = require$$0__default["default"];
16474
+ const { ComputeBudgetProgram, PublicKey: PublicKey$5, Transaction: Transaction$2, Keypair, SystemProgram: SystemProgram$2, SYSVAR_RENT_PUBKEY: SYSVAR_RENT_PUBKEY$1 } = require$$0__default["default"];
16475
16475
  const { TOKEN_PROGRAM_ID: TOKEN_PROGRAM_ID$1, getAssociatedTokenAddress: getAssociatedTokenAddress$1, createAssociatedTokenAccountInstruction, ASSOCIATED_TOKEN_PROGRAM_ID: ASSOCIATED_TOKEN_PROGRAM_ID$1 } = cjs$3;
16476
16476
  const anchor$3 = require$$0__default$3["default"];
16477
16477
  // 统一使用 buffer 包,所有平台一致
@@ -16708,13 +16708,8 @@ class TokenModule$1 {
16708
16708
  }
16709
16709
 
16710
16710
  /**
16711
- * Create token and buy in one transaction (使用 VersionedTransaction v0)
16712
- * 将 create 和 buy 两个指令合并到一个 v0 交易中,一次签名提交
16713
- *
16714
- * 注意:返回的 transaction 是 VersionedTransaction 类型(非 Legacy Transaction)
16715
- * - feePayer 和 recentBlockhash 已在 SDK 端设置,网站端不需要再设置
16716
- * - 签名方式:先 transaction.sign([mintKeypair]),再 phantom.signTransaction(tx)
16717
- * - 发送方式:connection.sendRawTransaction(signedTx.serialize())
16711
+ * Create token and buy in one transaction
16712
+ * 将 create 和 buy 两个指令合并到一个交易中,一次签名提交
16718
16713
  *
16719
16714
  * @param {Object} params - Creation and buy parameters
16720
16715
  * @param {Keypair} params.mint - Token mint keypair
@@ -16734,20 +16729,7 @@ class TokenModule$1 {
16734
16729
  *
16735
16730
  * @param {Object} options - Optional parameters
16736
16731
  * @param {number} options.computeUnits - Compute units limit, default 1800000
16737
- * @returns {Promise<Object>} Object containing VersionedTransaction, signers, accounts and blockhashInfo
16738
- *
16739
- * @example
16740
- * // Node.js 环境
16741
- * const result = await sdk.token.createAndBuy({...});
16742
- * result.transaction.sign([wallet, ...result.signers]);
16743
- * const sig = await connection.sendRawTransaction(result.transaction.serialize());
16744
- *
16745
- * @example
16746
- * // 浏览器 Phantom 环境
16747
- * const result = await sdk.token.createAndBuy({...});
16748
- * result.transaction.sign(result.signers); // mint keypair 先签名
16749
- * const signed = await phantom.signTransaction(result.transaction); // Phantom 追加 payer 签名
16750
- * const sig = await connection.sendRawTransaction(signed.serialize());
16732
+ * @returns {Promise<Object>} Object containing transaction, signers and account info
16751
16733
  */
16752
16734
  async createAndBuy({
16753
16735
  mint,
@@ -16766,7 +16748,7 @@ class TokenModule$1 {
16766
16748
  }, options = {}) {
16767
16749
  const { computeUnits = 1800000 } = options;
16768
16750
 
16769
- console.log('Token Module - CreateAndBuy (VersionedTransaction):', {
16751
+ console.log('Token Module - CreateAndBuy:', {
16770
16752
  mint: mint.publicKey.toString(),
16771
16753
  name,
16772
16754
  symbol,
@@ -16802,6 +16784,7 @@ class TokenModule$1 {
16802
16784
  console.log('Step 2: Fetching fee recipient accounts from params...');
16803
16785
 
16804
16786
  // 直接从 SDK 配置中获取手续费接收账户(这些在 SDK 初始化时已经设置)
16787
+ // 避免使用 program.account.params.fetch() 因为可能有 provider 配置问题
16805
16788
  const feeRecipientAccount = this.sdk.feeRecipient;
16806
16789
  const baseFeeRecipientAccount = this.sdk.baseFeeRecipient;
16807
16790
 
@@ -16892,49 +16875,39 @@ class TokenModule$1 {
16892
16875
  })
16893
16876
  .instruction();
16894
16877
 
16895
- // 7. 收集所有指令
16896
- console.log('Step 6: Building VersionedTransaction (v0)...');
16897
- const instructions = [];
16878
+ // 7. 合并交易:create + buy
16879
+ console.log('Step 6: Merging create and buy transactions...');
16880
+ const transaction = new Transaction$2();
16898
16881
 
16899
16882
  // 设置计算单元限制
16900
16883
  const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
16901
16884
  units: computeUnits
16902
16885
  });
16903
- instructions.push(modifyComputeUnits);
16886
+ transaction.add(modifyComputeUnits);
16904
16887
 
16905
16888
  // 添加 create 交易的所有指令(跳过 create 中的计算单元指令)
16906
16889
  createResult.transaction.instructions.forEach(ix => {
16890
+ // 跳过 create 交易中的计算单元指令(我们已经添加了)
16907
16891
  if (ix.programId.equals(ComputeBudgetProgram.programId)) {
16908
16892
  return;
16909
16893
  }
16910
- instructions.push(ix);
16894
+ transaction.add(ix);
16911
16895
  });
16912
16896
 
16913
16897
  // 添加 ATA 创建指令(如果需要)
16914
16898
  if (createAtaIx) {
16915
- instructions.push(createAtaIx);
16899
+ transaction.add(createAtaIx);
16916
16900
  }
16917
16901
 
16918
- // 添加 buy 指令
16919
- instructions.push(buyIx);
16920
-
16921
- // 8. 获取最新 blockhash 并构建 VersionedTransaction
16922
- const blockhashResult = await this.sdk.connection.getLatestBlockhash('confirmed');
16923
-
16924
- const messageV0 = new TransactionMessage({
16925
- payerKey: payer,
16926
- recentBlockhash: blockhashResult.blockhash,
16927
- instructions: instructions,
16928
- }).compileToV0Message();
16929
-
16930
- const transaction = new VersionedTransaction(messageV0);
16902
+ // 添加 buy 指令
16903
+ transaction.add(buyIx);
16931
16904
 
16932
- console.log('CreateAndBuy VersionedTransaction built successfully:');
16933
- console.log(' Total instructions:', instructions.length);
16905
+ console.log('CreateAndBuy transaction built successfully:');
16906
+ console.log(' Total instructions:', transaction.instructions.length);
16934
16907
  console.log(' Compute units:', computeUnits);
16935
16908
  console.log(' Signers required:', [payer.toString(), mint.publicKey.toString()]);
16936
16909
 
16937
- // 9. 返回 VersionedTransaction
16910
+ // 8. 返回合并后的交易
16938
16911
  return {
16939
16912
  transaction,
16940
16913
  signers: [mint], // mint keypair 需要签名
@@ -16946,11 +16919,6 @@ class TokenModule$1 {
16946
16919
  cooldown: cooldownPDA,
16947
16920
  feeRecipientAccount,
16948
16921
  baseFeeRecipientAccount
16949
- },
16950
- // 返回 blockhash 信息供调用方确认交易使用
16951
- blockhashInfo: {
16952
- blockhash: blockhashResult.blockhash,
16953
- lastValidBlockHeight: blockhashResult.lastValidBlockHeight
16954
16922
  }
16955
16923
  };
16956
16924
  }
@@ -20253,9 +20253,9 @@ const MIN_STOP_LOSS_PERCENT$1 = 40; // 4.0%
20253
20253
 
20254
20254
  // Maximum number of candidate indices to include in close_insert_indices
20255
20255
  // This represents: 1 main position + N nodes before + N nodes after
20256
- // Must be an odd number >= 1 (e.g., 21 = 1 main + 10 before + 10 after)
20257
- // The contract accepts up to 20, we use 21 to provide more flexibility
20258
- const MAX_CANDIDATE_INDICES$3 = 31;
20256
+ // Must be an odd number >= 1 (e.g., 41 = 1 main + 20 before + 20 after)
20257
+ // The contract accepts up to 41
20258
+ const MAX_CANDIDATE_INDICES$3 = 19;
20259
20259
 
20260
20260
 
20261
20261
  /**
@@ -21142,7 +21142,7 @@ class TradingModule$1 {
21142
21142
 
21143
21143
  var trading = TradingModule$1;
21144
21144
 
21145
- const { ComputeBudgetProgram, PublicKey: PublicKey$5, Transaction: Transaction$2, Keypair, SystemProgram: SystemProgram$2, SYSVAR_RENT_PUBKEY: SYSVAR_RENT_PUBKEY$1, VersionedTransaction, TransactionMessage } = require$$2$1;
21145
+ const { ComputeBudgetProgram, PublicKey: PublicKey$5, Transaction: Transaction$2, Keypair, SystemProgram: SystemProgram$2, SYSVAR_RENT_PUBKEY: SYSVAR_RENT_PUBKEY$1 } = require$$2$1;
21146
21146
  const { TOKEN_PROGRAM_ID: TOKEN_PROGRAM_ID$1, getAssociatedTokenAddress: getAssociatedTokenAddress$1, createAssociatedTokenAccountInstruction, ASSOCIATED_TOKEN_PROGRAM_ID: ASSOCIATED_TOKEN_PROGRAM_ID$1 } = cjs$3;
21147
21147
  const anchor$3 = require$$0;
21148
21148
  // 统一使用 buffer 包,所有平台一致
@@ -21379,13 +21379,8 @@ class TokenModule$1 {
21379
21379
  }
21380
21380
 
21381
21381
  /**
21382
- * Create token and buy in one transaction (使用 VersionedTransaction v0)
21383
- * 将 create 和 buy 两个指令合并到一个 v0 交易中,一次签名提交
21384
- *
21385
- * 注意:返回的 transaction 是 VersionedTransaction 类型(非 Legacy Transaction)
21386
- * - feePayer 和 recentBlockhash 已在 SDK 端设置,网站端不需要再设置
21387
- * - 签名方式:先 transaction.sign([mintKeypair]),再 phantom.signTransaction(tx)
21388
- * - 发送方式:connection.sendRawTransaction(signedTx.serialize())
21382
+ * Create token and buy in one transaction
21383
+ * 将 create 和 buy 两个指令合并到一个交易中,一次签名提交
21389
21384
  *
21390
21385
  * @param {Object} params - Creation and buy parameters
21391
21386
  * @param {Keypair} params.mint - Token mint keypair
@@ -21405,20 +21400,7 @@ class TokenModule$1 {
21405
21400
  *
21406
21401
  * @param {Object} options - Optional parameters
21407
21402
  * @param {number} options.computeUnits - Compute units limit, default 1800000
21408
- * @returns {Promise<Object>} Object containing VersionedTransaction, signers, accounts and blockhashInfo
21409
- *
21410
- * @example
21411
- * // Node.js 环境
21412
- * const result = await sdk.token.createAndBuy({...});
21413
- * result.transaction.sign([wallet, ...result.signers]);
21414
- * const sig = await connection.sendRawTransaction(result.transaction.serialize());
21415
- *
21416
- * @example
21417
- * // 浏览器 Phantom 环境
21418
- * const result = await sdk.token.createAndBuy({...});
21419
- * result.transaction.sign(result.signers); // mint keypair 先签名
21420
- * const signed = await phantom.signTransaction(result.transaction); // Phantom 追加 payer 签名
21421
- * const sig = await connection.sendRawTransaction(signed.serialize());
21403
+ * @returns {Promise<Object>} Object containing transaction, signers and account info
21422
21404
  */
21423
21405
  async createAndBuy({
21424
21406
  mint,
@@ -21437,7 +21419,7 @@ class TokenModule$1 {
21437
21419
  }, options = {}) {
21438
21420
  const { computeUnits = 1800000 } = options;
21439
21421
 
21440
- console.log('Token Module - CreateAndBuy (VersionedTransaction):', {
21422
+ console.log('Token Module - CreateAndBuy:', {
21441
21423
  mint: mint.publicKey.toString(),
21442
21424
  name,
21443
21425
  symbol,
@@ -21473,6 +21455,7 @@ class TokenModule$1 {
21473
21455
  console.log('Step 2: Fetching fee recipient accounts from params...');
21474
21456
 
21475
21457
  // 直接从 SDK 配置中获取手续费接收账户(这些在 SDK 初始化时已经设置)
21458
+ // 避免使用 program.account.params.fetch() 因为可能有 provider 配置问题
21476
21459
  const feeRecipientAccount = this.sdk.feeRecipient;
21477
21460
  const baseFeeRecipientAccount = this.sdk.baseFeeRecipient;
21478
21461
 
@@ -21563,49 +21546,39 @@ class TokenModule$1 {
21563
21546
  })
21564
21547
  .instruction();
21565
21548
 
21566
- // 7. 收集所有指令
21567
- console.log('Step 6: Building VersionedTransaction (v0)...');
21568
- const instructions = [];
21549
+ // 7. 合并交易:create + buy
21550
+ console.log('Step 6: Merging create and buy transactions...');
21551
+ const transaction = new Transaction$2();
21569
21552
 
21570
21553
  // 设置计算单元限制
21571
21554
  const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
21572
21555
  units: computeUnits
21573
21556
  });
21574
- instructions.push(modifyComputeUnits);
21557
+ transaction.add(modifyComputeUnits);
21575
21558
 
21576
21559
  // 添加 create 交易的所有指令(跳过 create 中的计算单元指令)
21577
21560
  createResult.transaction.instructions.forEach(ix => {
21561
+ // 跳过 create 交易中的计算单元指令(我们已经添加了)
21578
21562
  if (ix.programId.equals(ComputeBudgetProgram.programId)) {
21579
21563
  return;
21580
21564
  }
21581
- instructions.push(ix);
21565
+ transaction.add(ix);
21582
21566
  });
21583
21567
 
21584
21568
  // 添加 ATA 创建指令(如果需要)
21585
21569
  if (createAtaIx) {
21586
- instructions.push(createAtaIx);
21570
+ transaction.add(createAtaIx);
21587
21571
  }
21588
21572
 
21589
- // 添加 buy 指令
21590
- instructions.push(buyIx);
21591
-
21592
- // 8. 获取最新 blockhash 并构建 VersionedTransaction
21593
- const blockhashResult = await this.sdk.connection.getLatestBlockhash('confirmed');
21594
-
21595
- const messageV0 = new TransactionMessage({
21596
- payerKey: payer,
21597
- recentBlockhash: blockhashResult.blockhash,
21598
- instructions: instructions,
21599
- }).compileToV0Message();
21600
-
21601
- const transaction = new VersionedTransaction(messageV0);
21573
+ // 添加 buy 指令
21574
+ transaction.add(buyIx);
21602
21575
 
21603
- console.log('CreateAndBuy VersionedTransaction built successfully:');
21604
- console.log(' Total instructions:', instructions.length);
21576
+ console.log('CreateAndBuy transaction built successfully:');
21577
+ console.log(' Total instructions:', transaction.instructions.length);
21605
21578
  console.log(' Compute units:', computeUnits);
21606
21579
  console.log(' Signers required:', [payer.toString(), mint.publicKey.toString()]);
21607
21580
 
21608
- // 9. 返回 VersionedTransaction
21581
+ // 8. 返回合并后的交易
21609
21582
  return {
21610
21583
  transaction,
21611
21584
  signers: [mint], // mint keypair 需要签名
@@ -21617,11 +21590,6 @@ class TokenModule$1 {
21617
21590
  cooldown: cooldownPDA,
21618
21591
  feeRecipientAccount,
21619
21592
  baseFeeRecipientAccount
21620
- },
21621
- // 返回 blockhash 信息供调用方确认交易使用
21622
- blockhashInfo: {
21623
- blockhash: blockhashResult.blockhash,
21624
- lastValidBlockHeight: blockhashResult.lastValidBlockHeight
21625
21593
  }
21626
21594
  };
21627
21595
  }
@@ -20261,9 +20261,9 @@
20261
20261
 
20262
20262
  // Maximum number of candidate indices to include in close_insert_indices
20263
20263
  // This represents: 1 main position + N nodes before + N nodes after
20264
- // Must be an odd number >= 1 (e.g., 21 = 1 main + 10 before + 10 after)
20265
- // The contract accepts up to 20, we use 21 to provide more flexibility
20266
- const MAX_CANDIDATE_INDICES$3 = 31;
20264
+ // Must be an odd number >= 1 (e.g., 41 = 1 main + 20 before + 20 after)
20265
+ // The contract accepts up to 41
20266
+ const MAX_CANDIDATE_INDICES$3 = 19;
20267
20267
 
20268
20268
 
20269
20269
  /**
@@ -21150,7 +21150,7 @@
21150
21150
 
21151
21151
  var trading = TradingModule$1;
21152
21152
 
21153
- const { ComputeBudgetProgram, PublicKey: PublicKey$5, Transaction: Transaction$2, Keypair, SystemProgram: SystemProgram$2, SYSVAR_RENT_PUBKEY: SYSVAR_RENT_PUBKEY$1, VersionedTransaction, TransactionMessage } = require$$0__default["default"];
21153
+ const { ComputeBudgetProgram, PublicKey: PublicKey$5, Transaction: Transaction$2, Keypair, SystemProgram: SystemProgram$2, SYSVAR_RENT_PUBKEY: SYSVAR_RENT_PUBKEY$1 } = require$$0__default["default"];
21154
21154
  const { TOKEN_PROGRAM_ID: TOKEN_PROGRAM_ID$1, getAssociatedTokenAddress: getAssociatedTokenAddress$1, createAssociatedTokenAccountInstruction, ASSOCIATED_TOKEN_PROGRAM_ID: ASSOCIATED_TOKEN_PROGRAM_ID$1 } = cjs$3;
21155
21155
  const anchor$3 = require$$0__default$1["default"];
21156
21156
  // 统一使用 buffer 包,所有平台一致
@@ -21387,13 +21387,8 @@
21387
21387
  }
21388
21388
 
21389
21389
  /**
21390
- * Create token and buy in one transaction (使用 VersionedTransaction v0)
21391
- * 将 create 和 buy 两个指令合并到一个 v0 交易中,一次签名提交
21392
- *
21393
- * 注意:返回的 transaction 是 VersionedTransaction 类型(非 Legacy Transaction)
21394
- * - feePayer 和 recentBlockhash 已在 SDK 端设置,网站端不需要再设置
21395
- * - 签名方式:先 transaction.sign([mintKeypair]),再 phantom.signTransaction(tx)
21396
- * - 发送方式:connection.sendRawTransaction(signedTx.serialize())
21390
+ * Create token and buy in one transaction
21391
+ * 将 create 和 buy 两个指令合并到一个交易中,一次签名提交
21397
21392
  *
21398
21393
  * @param {Object} params - Creation and buy parameters
21399
21394
  * @param {Keypair} params.mint - Token mint keypair
@@ -21413,20 +21408,7 @@
21413
21408
  *
21414
21409
  * @param {Object} options - Optional parameters
21415
21410
  * @param {number} options.computeUnits - Compute units limit, default 1800000
21416
- * @returns {Promise<Object>} Object containing VersionedTransaction, signers, accounts and blockhashInfo
21417
- *
21418
- * @example
21419
- * // Node.js 环境
21420
- * const result = await sdk.token.createAndBuy({...});
21421
- * result.transaction.sign([wallet, ...result.signers]);
21422
- * const sig = await connection.sendRawTransaction(result.transaction.serialize());
21423
- *
21424
- * @example
21425
- * // 浏览器 Phantom 环境
21426
- * const result = await sdk.token.createAndBuy({...});
21427
- * result.transaction.sign(result.signers); // mint keypair 先签名
21428
- * const signed = await phantom.signTransaction(result.transaction); // Phantom 追加 payer 签名
21429
- * const sig = await connection.sendRawTransaction(signed.serialize());
21411
+ * @returns {Promise<Object>} Object containing transaction, signers and account info
21430
21412
  */
21431
21413
  async createAndBuy({
21432
21414
  mint,
@@ -21445,7 +21427,7 @@
21445
21427
  }, options = {}) {
21446
21428
  const { computeUnits = 1800000 } = options;
21447
21429
 
21448
- console.log('Token Module - CreateAndBuy (VersionedTransaction):', {
21430
+ console.log('Token Module - CreateAndBuy:', {
21449
21431
  mint: mint.publicKey.toString(),
21450
21432
  name,
21451
21433
  symbol,
@@ -21481,6 +21463,7 @@
21481
21463
  console.log('Step 2: Fetching fee recipient accounts from params...');
21482
21464
 
21483
21465
  // 直接从 SDK 配置中获取手续费接收账户(这些在 SDK 初始化时已经设置)
21466
+ // 避免使用 program.account.params.fetch() 因为可能有 provider 配置问题
21484
21467
  const feeRecipientAccount = this.sdk.feeRecipient;
21485
21468
  const baseFeeRecipientAccount = this.sdk.baseFeeRecipient;
21486
21469
 
@@ -21571,49 +21554,39 @@
21571
21554
  })
21572
21555
  .instruction();
21573
21556
 
21574
- // 7. 收集所有指令
21575
- console.log('Step 6: Building VersionedTransaction (v0)...');
21576
- const instructions = [];
21557
+ // 7. 合并交易:create + buy
21558
+ console.log('Step 6: Merging create and buy transactions...');
21559
+ const transaction = new Transaction$2();
21577
21560
 
21578
21561
  // 设置计算单元限制
21579
21562
  const modifyComputeUnits = ComputeBudgetProgram.setComputeUnitLimit({
21580
21563
  units: computeUnits
21581
21564
  });
21582
- instructions.push(modifyComputeUnits);
21565
+ transaction.add(modifyComputeUnits);
21583
21566
 
21584
21567
  // 添加 create 交易的所有指令(跳过 create 中的计算单元指令)
21585
21568
  createResult.transaction.instructions.forEach(ix => {
21569
+ // 跳过 create 交易中的计算单元指令(我们已经添加了)
21586
21570
  if (ix.programId.equals(ComputeBudgetProgram.programId)) {
21587
21571
  return;
21588
21572
  }
21589
- instructions.push(ix);
21573
+ transaction.add(ix);
21590
21574
  });
21591
21575
 
21592
21576
  // 添加 ATA 创建指令(如果需要)
21593
21577
  if (createAtaIx) {
21594
- instructions.push(createAtaIx);
21578
+ transaction.add(createAtaIx);
21595
21579
  }
21596
21580
 
21597
- // 添加 buy 指令
21598
- instructions.push(buyIx);
21599
-
21600
- // 8. 获取最新 blockhash 并构建 VersionedTransaction
21601
- const blockhashResult = await this.sdk.connection.getLatestBlockhash('confirmed');
21602
-
21603
- const messageV0 = new TransactionMessage({
21604
- payerKey: payer,
21605
- recentBlockhash: blockhashResult.blockhash,
21606
- instructions: instructions,
21607
- }).compileToV0Message();
21608
-
21609
- const transaction = new VersionedTransaction(messageV0);
21581
+ // 添加 buy 指令
21582
+ transaction.add(buyIx);
21610
21583
 
21611
- console.log('CreateAndBuy VersionedTransaction built successfully:');
21612
- console.log(' Total instructions:', instructions.length);
21584
+ console.log('CreateAndBuy transaction built successfully:');
21585
+ console.log(' Total instructions:', transaction.instructions.length);
21613
21586
  console.log(' Compute units:', computeUnits);
21614
21587
  console.log(' Signers required:', [payer.toString(), mint.publicKey.toString()]);
21615
21588
 
21616
- // 9. 返回 VersionedTransaction
21589
+ // 8. 返回合并后的交易
21617
21590
  return {
21618
21591
  transaction,
21619
21592
  signers: [mint], // mint keypair 需要签名
@@ -21625,11 +21598,6 @@
21625
21598
  cooldown: cooldownPDA,
21626
21599
  feeRecipientAccount,
21627
21600
  baseFeeRecipientAccount
21628
- },
21629
- // 返回 blockhash 信息供调用方确认交易使用
21630
- blockhashInfo: {
21631
- blockhash: blockhashResult.blockhash,
21632
- lastValidBlockHeight: blockhashResult.lastValidBlockHeight
21633
21601
  }
21634
21602
  };
21635
21603
  }