four-flap-meme-sdk 4.1.0 → 4.2.0

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.
Files changed (116) hide show
  1. package/dist/bundle/four-meme/core/sell-flow.js +6 -6
  2. package/dist/bundle/four-meme/pancake-proxy/helpers.d.ts +5 -38
  3. package/dist/bundle/four-meme/pancake-proxy/helpers.js +5 -228
  4. package/dist/bundle/four-meme/private/sell.js +3 -3
  5. package/dist/bundle/four-meme/swap-hop-helpers.d.ts +1 -5
  6. package/dist/bundle/four-meme/swap-hop-helpers.js +1 -63
  7. package/dist/bundle/four-meme/types/bundle-ops.d.ts +166 -0
  8. package/dist/bundle/four-meme/types/bundle-ops.js +4 -0
  9. package/dist/bundle/four-meme/types/buy-first.d.ts +1 -1
  10. package/dist/bundle/four-meme/types/config.d.ts +95 -0
  11. package/dist/bundle/four-meme/types/config.js +1 -0
  12. package/dist/bundle/four-meme/types/core-flow.d.ts +2 -1
  13. package/dist/bundle/four-meme/types/index.d.ts +5 -611
  14. package/dist/bundle/four-meme/types/pancake-proxy-types.d.ts +118 -0
  15. package/dist/bundle/four-meme/types/pancake-proxy-types.js +3 -0
  16. package/dist/bundle/four-meme/types/swap-types.d.ts +103 -0
  17. package/dist/bundle/four-meme/types/swap-types.js +1 -0
  18. package/dist/bundle/four-meme/types/transfer-ops.d.ts +134 -0
  19. package/dist/bundle/four-meme/types/transfer-ops.js +1 -0
  20. package/dist/chains/bsc/pancake/bundle-buy-first-multi-wallet.js +2 -2
  21. package/dist/chains/bsc/pancake/bundle-buy-first.js +2 -2
  22. package/dist/chains/bsc/pancake/hop-chain.d.ts +1 -18
  23. package/dist/chains/bsc/pancake/hop-chain.js +1 -229
  24. package/dist/chains/bsc/pancake/quote.d.ts +10 -2
  25. package/dist/chains/bsc/pancake/quote.js +14 -6
  26. package/dist/chains/bsc/pancake/quote.test.js +13 -1
  27. package/dist/chains/index.d.ts +3 -0
  28. package/dist/chains/index.js +4 -0
  29. package/dist/chains/robinhood/constants.d.ts +48 -0
  30. package/dist/chains/robinhood/constants.js +55 -0
  31. package/dist/chains/robinhood/index.d.ts +11 -0
  32. package/dist/chains/robinhood/index.js +9 -0
  33. package/dist/chains/robinhood/longetf/assets.d.ts +11 -0
  34. package/dist/chains/robinhood/longetf/assets.js +4 -0
  35. package/dist/chains/robinhood/longetf/encode.d.ts +41 -0
  36. package/dist/chains/robinhood/longetf/encode.js +116 -0
  37. package/dist/chains/robinhood/longetf/index.d.ts +3 -0
  38. package/dist/chains/robinhood/longetf/index.js +3 -0
  39. package/dist/chains/robinhood/longetf/launch.d.ts +49 -0
  40. package/dist/chains/robinhood/longetf/launch.js +64 -0
  41. package/dist/chains/robinhood/pons-v2/encode.d.ts +62 -0
  42. package/dist/chains/robinhood/pons-v2/encode.js +115 -0
  43. package/dist/chains/robinhood/pons-v2/index.d.ts +2 -0
  44. package/dist/chains/robinhood/pons-v2/index.js +2 -0
  45. package/dist/chains/robinhood/pons-v2/launch.d.ts +48 -0
  46. package/dist/chains/robinhood/pons-v2/launch.js +107 -0
  47. package/dist/chains/robinhood/robinhood.test.d.ts +1 -0
  48. package/dist/chains/robinhood/robinhood.test.js +103 -0
  49. package/dist/chains/robinhood/sign.d.ts +20 -0
  50. package/dist/chains/robinhood/sign.js +31 -0
  51. package/dist/chains/xlayer/eip7702/types-base.d.ts +44 -0
  52. package/dist/chains/xlayer/eip7702/types-base.js +4 -0
  53. package/dist/chains/xlayer/eip7702/types-bundle.d.ts +191 -0
  54. package/dist/chains/xlayer/eip7702/types-bundle.js +1 -0
  55. package/dist/chains/xlayer/eip7702/types-create.d.ts +222 -0
  56. package/dist/chains/xlayer/eip7702/types-create.js +1 -0
  57. package/dist/chains/xlayer/eip7702/types-transfer.d.ts +124 -0
  58. package/dist/chains/xlayer/eip7702/types-transfer.js +1 -0
  59. package/dist/chains/xlayer/eip7702/types.d.ts +4 -578
  60. package/dist/chains/xlayer/eip7702/types.js +0 -3
  61. package/dist/chains/xlayer/eoa/eoa-dex-types.d.ts +196 -0
  62. package/dist/chains/xlayer/eoa/eoa-dex-types.js +1 -0
  63. package/dist/chains/xlayer/eoa/eoa-swap-types.d.ts +283 -0
  64. package/dist/chains/xlayer/eoa/eoa-swap-types.js +1 -0
  65. package/dist/chains/xlayer/eoa/eoa-trade-types.d.ts +300 -0
  66. package/dist/chains/xlayer/eoa/eoa-trade-types.js +6 -0
  67. package/dist/chains/xlayer/eoa/eoa-types.d.ts +4 -774
  68. package/dist/chains/xlayer/eoa/eoa-types.js +0 -5
  69. package/dist/chains/xlayer/eoa/eoa-wash-volume.js +2 -13
  70. package/dist/chains/xlayer/eoa/hop-chain.d.ts +1 -1
  71. package/dist/chains/xlayer/eoa/hop-chain.js +4 -83
  72. package/dist/core/constants/addresses.d.ts +18 -0
  73. package/dist/core/constants/addresses.js +23 -0
  74. package/dist/core/constants/chains.d.ts +16 -0
  75. package/dist/core/constants/chains.js +20 -0
  76. package/dist/core/constants/gas.d.ts +8 -0
  77. package/dist/core/constants/gas.js +9 -0
  78. package/dist/core/constants/index.d.ts +2 -1
  79. package/dist/core/constants/index.js +2 -1
  80. package/dist/core/constants/slippage.d.ts +6 -0
  81. package/dist/core/constants/slippage.js +15 -0
  82. package/dist/domains/flap/portal-bundle-merkle/core-helpers.js +2 -2
  83. package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/helpers.d.ts +2 -43
  84. package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/helpers.js +8 -208
  85. package/dist/domains/flap/portal-bundle-merkle/private/helpers.js +2 -2
  86. package/dist/domains/flap/portal-bundle-merkle/private/sell.js +2 -2
  87. package/dist/domains/flap/portal-bundle-merkle/swap-helpers.d.ts +4 -24
  88. package/dist/domains/flap/portal-bundle-merkle/swap-helpers.js +12 -166
  89. package/dist/domains/flap/portal-bundle-merkle/types-bundle.d.ts +137 -0
  90. package/dist/domains/flap/portal-bundle-merkle/types-bundle.js +7 -0
  91. package/dist/domains/flap/portal-bundle-merkle/types-config.d.ts +118 -0
  92. package/dist/domains/flap/portal-bundle-merkle/types-config.js +4 -0
  93. package/dist/domains/flap/portal-bundle-merkle/types-pancake.d.ts +118 -0
  94. package/dist/domains/flap/portal-bundle-merkle/types-pancake.js +4 -0
  95. package/dist/domains/flap/portal-bundle-merkle/types-transfer.d.ts +70 -0
  96. package/dist/domains/flap/portal-bundle-merkle/types-transfer.js +1 -0
  97. package/dist/domains/flap/portal-bundle-merkle/types.d.ts +4 -441
  98. package/dist/domains/holders/internal/disperse.js +2 -18
  99. package/dist/domains/lp-inspect/inspect-helpers.d.ts +1 -0
  100. package/dist/domains/lp-inspect/inspect-helpers.js +3 -16
  101. package/dist/exports/root-foundations.d.ts +1 -1
  102. package/dist/exports/root-foundations.js +1 -1
  103. package/dist/exports/root-robinhood.d.ts +9 -0
  104. package/dist/exports/root-robinhood.js +7 -0
  105. package/dist/index.d.ts +1 -0
  106. package/dist/index.js +1 -0
  107. package/dist/utils/constants.d.ts +1 -1
  108. package/dist/utils/constants.js +1 -1
  109. package/dist/utils/hop-chains.d.ts +0 -3
  110. package/dist/utils/hop-chains.js +4 -5
  111. package/dist/utils/pancake-router-tx.d.ts +41 -0
  112. package/dist/utils/pancake-router-tx.js +174 -0
  113. package/dist/utils/swap-helpers.d.ts +6 -2
  114. package/dist/utils/swap-helpers.js +24 -4
  115. package/dist/utils/wallet.js +12 -12
  116. package/package.json +1 -1
@@ -0,0 +1,95 @@
1
+ import type { GeneratedWallet } from '../../../utils/wallet.js';
2
+ import type { AmountLike } from '../../types/index.js';
3
+ export type { AmountLike };
4
+ export type FourSignConfig = {
5
+ rpcUrl: string;
6
+ fourApiUrl?: string;
7
+ club48Endpoint?: string;
8
+ club48ExplorerEndpoint?: string;
9
+ txType?: 0 | 2;
10
+ gasLimit?: number | bigint;
11
+ gasLimitMultiplier?: number;
12
+ gasPriceMultiplierPercent?: number;
13
+ minGasPriceGwei?: number;
14
+ chainId?: number;
15
+ prefer21000ForNative?: boolean;
16
+ checkBnbForErc20NoHop?: boolean;
17
+ estimateGas?: boolean;
18
+ customSubmitFn?: (signedTxs: string[]) => Promise<string>;
19
+ spPrivateKey?: string;
20
+ spMode?: 'none' | 'timestampPersonalSign' | 'concatTxHash' | 'rawTimestamp';
21
+ spVMode?: '27_28' | '0_1';
22
+ bribeAmount?: number;
23
+ };
24
+ export type FourBundleMerkleConfig = {
25
+ apiKey: string;
26
+ customRpcUrl?: string;
27
+ fourApiUrl?: string;
28
+ bundleBlockOffset?: number;
29
+ minBlockOffset?: number;
30
+ autoRetryBundle?: boolean;
31
+ maxBundleRetries?: number;
32
+ txType?: 0 | 2;
33
+ gasLimit?: number | bigint;
34
+ gasLimitMultiplier?: number;
35
+ gasPriceMultiplierPercent?: number;
36
+ minGasPriceGwei?: number;
37
+ waitForConfirmation?: boolean;
38
+ waitTimeoutMs?: number;
39
+ chainId?: number;
40
+ prefer21000ForNative?: boolean;
41
+ checkBnbForErc20NoHop?: boolean;
42
+ skipSubmit?: boolean;
43
+ /** BlockRazor 贿赂金额(BNB),与 `FourSignConfig` 对齐 */
44
+ bribeAmount?: number;
45
+ };
46
+ export type MerkleTransactionStatus = {
47
+ index: number;
48
+ hash: string;
49
+ success: boolean;
50
+ blockNumber?: number;
51
+ gasUsed?: string;
52
+ effectiveGasPrice?: string;
53
+ gasCost?: string;
54
+ error?: string;
55
+ };
56
+ export type MerkleBundleStatus = {
57
+ bundleHash: string;
58
+ txHashes: string[];
59
+ results: MerkleTransactionStatus[];
60
+ successCount: number;
61
+ totalGasUsed: bigint;
62
+ targetBlock: number;
63
+ };
64
+ /** Merkle 结果 metadata 字段值(各方法返回的键不固定,值类型统一收窄) */
65
+ export type MerkleResultMetadataValue = string | number | boolean | string[] | undefined;
66
+ /** 元数据(如利润信息等) */
67
+ export type MerkleResultMetadata = Record<string, MerkleResultMetadataValue>;
68
+ /**
69
+ * 统一的 Merkle 方法返回类型
70
+ * SDK 不再内部提交,只返回签名交易和元数据
71
+ */
72
+ export type MerkleSignedResult = {
73
+ /** 已签名的交易数组(发送到服务器进行提交) */
74
+ signedTransactions: string[];
75
+ /** 创建代币时返回的代币地址(仅 create 方法使用) */
76
+ tokenAddress?: string;
77
+ /** ✅ 转账多跳中间钱包(disperse/sweep 使用,按接收者分组)- 兼容旧版 string[][] 和新版 GeneratedWallet[][] */
78
+ hopWallets?: (string | GeneratedWallet)[][];
79
+ /** ✅ 利润多跳中间钱包 */
80
+ profitHopWallets?: GeneratedWallet[];
81
+ /** 元数据(如利润信息等) */
82
+ metadata?: MerkleResultMetadata;
83
+ /** 交易哈希数组(内部提交时返回) */
84
+ txHashes?: string[];
85
+ };
86
+ /** 代币池子类型 */
87
+ export type TokenPoolType = 'flap' | 'four' | 'v2' | 'v3';
88
+ /** 报价代币类型(池子的计价代币) */
89
+ export type QuoteTokenType = 'native' | 'usdt' | 'usdc';
90
+ /**
91
+ * 用户类型(用于利润费率)
92
+ * - v0: 万分之6 (6 bps = 0.06%)
93
+ * - v1: 万分之5 (5 bps = 0.05%)
94
+ */
95
+ export type UserType = 'v0' | 'v1';
@@ -0,0 +1 @@
1
+ export {};
@@ -1,7 +1,8 @@
1
1
  import type { Wallet, JsonRpcProvider } from 'ethers';
2
2
  import type { NonceManager } from '../../../utils/bundle-helpers.js';
3
3
  import type { GeneratedWallet } from '../../../utils/wallet.js';
4
- import type { FourBundleMerkleConfig, FourCreateWithBundleBuySignParams, FourSignConfig, MerkleResultMetadata } from './index.js';
4
+ import type { FourBundleMerkleConfig, FourSignConfig, MerkleResultMetadata } from './config.js';
5
+ import type { FourCreateWithBundleBuySignParams } from './bundle-ops.js';
5
6
  export type FourAnyConfig = FourBundleMerkleConfig | FourSignConfig;
6
7
  export type ProfitMode = {
7
8
  type: 'individual';