four-flap-meme-sdk 1.2.39 → 1.2.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.
@@ -28,6 +28,10 @@ export interface MerkleSubmitConfig {
28
28
  export interface SubmitBundleResult {
29
29
  /** 提交状态:true=成功,false=失败 */
30
30
  code: boolean;
31
+ /** 交易总数(无论成功与否都会返回) */
32
+ totalTransactions: number;
33
+ /** 固定利润点(单位:bps,千分比) */
34
+ profitRateBps: number;
31
35
  /** Bundle哈希(成功时返回) */
32
36
  bundleHash?: string;
33
37
  /** 交易哈希列表(成功时返回) */
@@ -4,6 +4,7 @@
4
4
  * 用于服务器端接收前端构建的签名交易后,提交到Merkle
5
5
  */
6
6
  import { MerkleClient } from '../../clients/merkle.js';
7
+ import { PROFIT_CONFIG } from '../../utils/constants.js';
7
8
  /**
8
9
  * 提交已签名的交易到Merkle(服务器端使用)
9
10
  *
@@ -38,12 +39,16 @@ export async function submitBundleToMerkle(signedTransactions, config) {
38
39
  if (!signedTransactions || signedTransactions.length === 0) {
39
40
  return {
40
41
  code: false,
42
+ totalTransactions: signedTransactions?.length ?? 0,
43
+ profitRateBps: PROFIT_CONFIG.RATE_BPS,
41
44
  error: 'signedTransactions cannot be empty'
42
45
  };
43
46
  }
44
47
  if (!config.apiKey) {
45
48
  return {
46
49
  code: false,
50
+ totalTransactions: signedTransactions.length,
51
+ profitRateBps: PROFIT_CONFIG.RATE_BPS,
47
52
  error: 'apiKey is required in config'
48
53
  };
49
54
  }
@@ -64,6 +69,8 @@ export async function submitBundleToMerkle(signedTransactions, config) {
64
69
  // ✅ 提交成功
65
70
  return {
66
71
  code: true,
72
+ totalTransactions: signedTransactions.length,
73
+ profitRateBps: PROFIT_CONFIG.RATE_BPS,
67
74
  bundleHash: bundleResult.bundleHash,
68
75
  txHashes: bundleResult.txHashes,
69
76
  targetBlock: bundleResult.targetBlock,
@@ -74,6 +81,8 @@ export async function submitBundleToMerkle(signedTransactions, config) {
74
81
  // ❌ 提交失败
75
82
  return {
76
83
  code: false,
84
+ totalTransactions: signedTransactions?.length ?? 0,
85
+ profitRateBps: PROFIT_CONFIG.RATE_BPS,
77
86
  error: error?.message || String(error)
78
87
  };
79
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "1.2.39",
3
+ "version": "1.2.40",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",