four-flap-meme-sdk 2.2.4 → 2.2.6

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.
@@ -76,8 +76,9 @@ export async function createTokenWithBundleBuyMerkle(params) {
76
76
  const signedCreateTx = await devWallet.signTransaction(createTxRequest);
77
77
  signedTxs.push(signedCreateTx);
78
78
  const buyers = createWallets(privateKeys.slice(1), provider);
79
- // 发币+捆绑买:默认不刮利润,避免跟买缩水与 Dev 钱包多 3 笔多跳导致 BlockRazor 模拟失败
80
- const extractProfit = config.extractProfitOnLaunch === true ? shouldExtractProfit(config) : false;
79
+ // 发币+捆绑买:默认刮利润(与 emitservice isAddressRevenue 末笔校验、BSC 白名单 slice(-3) 对齐)
80
+ // 仅当显式 extractProfitOnLaunch: false 时关闭(需后端同步放宽校验)
81
+ const extractProfit = config.extractProfitOnLaunch === false ? false : shouldExtractProfit(config);
81
82
  const { fundsList, originalAmounts, totalBuyAmount, totalProfit } = analyzeBuyFunds(buyAmounts, config, extractProfit);
82
83
  const maxFundsIndex = findMaxIndex(originalAmounts);
83
84
  const gasLimits = buildGasLimitList(buyers.length, config);
@@ -56,8 +56,8 @@ export type FlapSignConfig = {
56
56
  bribeAmount?: number;
57
57
  profitMode?: FlapProfitMode;
58
58
  /**
59
- * 发币+捆绑买是否刮利润(默认 false)。
60
- * true 时跟买金额会缩水并可能追加利润多跳,易导致 BlockRazor 捆绑模拟失败。
59
+ * 发币+捆绑买是否刮利润(默认 true,与 emitservice 提交校验对齐)。
60
+ * 设为 false 时不追加利润多跳,需后端允许末笔为 Portal 买入。
61
61
  */
62
62
  extractProfitOnLaunch?: boolean;
63
63
  };
@@ -10,7 +10,8 @@ export declare function predictVanityTokenAddress(salt: string, portal: string,
10
10
  * BSC/MONAD 默认使用 NORMAL 实现(非税版)
11
11
  * @param taxedV5 - 是否使用 V5 高级税代币实现 (mkt/deflation/dividend/lp)
12
12
  */
13
- export declare function predictVanityTokenAddressByChain(chain: 'BSC' | 'BASE' | 'XLAYER' | 'MORPH' | 'MONAD', salt: string, taxed?: boolean, taxedV5?: boolean): string;
13
+ export declare function predictVanityTokenAddressByChain(chain: 'BSC' | 'BASE' | 'XLAYER' | 'MORPH' | 'MONAD', salt: string, taxed?: boolean, taxedV5?: boolean, // ✅ V5 高级税代币标识 (mkt/deflation/dividend/lp)
14
+ taxedV3?: boolean): string;
14
15
  /**
15
16
  * 寻找满足后缀的 salt(默认 8888)
16
17
  * 注意:该方法为同步 CPU 搜索,谨慎设置迭代限制
@@ -41,6 +42,7 @@ export declare function findSaltEndingByChain(opts: {
41
42
  seed?: string;
42
43
  taxed?: boolean;
43
44
  taxedV5?: boolean;
45
+ taxedV3?: boolean;
44
46
  }): Promise<{
45
47
  salt: string;
46
48
  address: string;
@@ -19,13 +19,14 @@ export function predictVanityTokenAddress(salt, portal, tokenImpl) {
19
19
  * BSC/MONAD 默认使用 NORMAL 实现(非税版)
20
20
  * @param taxedV5 - 是否使用 V5 高级税代币实现 (mkt/deflation/dividend/lp)
21
21
  */
22
- export function predictVanityTokenAddressByChain(chain, salt, taxed = false, taxedV5 = false) {
22
+ export function predictVanityTokenAddressByChain(chain, salt, taxed = false, taxedV5 = false, // ✅ V5 高级税代币标识 (mkt/deflation/dividend/lp)
23
+ taxedV3 = false) {
23
24
  // 使用 Flap 平台的原始 Portal 地址(用于 CREATE2)
24
25
  const portal = FLAP_ORIGINAL_PORTAL_ADDRESSES[chain];
25
26
  let tokenImpl;
26
27
  if (chain === 'BSC') {
27
- if (taxedV5) {
28
- // ✅ V5 高级税代币使用新的实现地址
28
+ if (taxedV5 || taxedV3) {
29
+ // ✅ V5 高级税代币(含 vault)使用新的实现地址
29
30
  tokenImpl = FLAP_TOKEN_IMPL_ADDRESSES.BSC_TAXED_V5;
30
31
  }
31
32
  else {
@@ -77,8 +78,8 @@ export async function findSaltEndingByChain(opts) {
77
78
  const portal = FLAP_ORIGINAL_PORTAL_ADDRESSES[opts.chain];
78
79
  let tokenImpl;
79
80
  if (opts.chain === 'BSC') {
80
- if (opts.taxedV5) {
81
- // ✅ V5 高级税代币使用新的实现地址
81
+ if (opts.taxedV5 || opts.taxedV3) {
82
+ // ✅ V5 高级税代币(含 vault)使用新的实现地址
82
83
  tokenImpl = FLAP_TOKEN_IMPL_ADDRESSES.BSC_TAXED_V5;
83
84
  }
84
85
  else {
@@ -95,8 +96,8 @@ export async function findSaltEndingByChain(opts) {
95
96
  if (!portal || !tokenImpl) {
96
97
  throw new Error(`Flap Protocol not fully deployed on ${opts.chain}`);
97
98
  }
98
- // ✅ 如果未指定后缀,根据链自动选择正确的后缀
99
- const suffix = opts.suffix ?? getVanitySuffix(opts.chain, opts.taxed);
99
+ // ✅ 如果未指定后缀,根据链自动选择正确的后缀(税代币 / V5 / V3 vault 均使用 tax 后缀)
100
+ const suffix = opts.suffix ?? getVanitySuffix(opts.chain, opts.taxed || opts.taxedV5 || opts.taxedV3);
100
101
  return findSaltEnding({
101
102
  portal,
102
103
  tokenImpl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "four-flap-meme-sdk",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "SDK for Flap bonding curve and four.meme TokenManager",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",