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.
- package/dist/bundle/four-meme/core/sell-flow.js +6 -6
- package/dist/bundle/four-meme/pancake-proxy/helpers.d.ts +5 -38
- package/dist/bundle/four-meme/pancake-proxy/helpers.js +5 -228
- package/dist/bundle/four-meme/private/sell.js +3 -3
- package/dist/bundle/four-meme/swap-hop-helpers.d.ts +1 -5
- package/dist/bundle/four-meme/swap-hop-helpers.js +1 -63
- package/dist/bundle/four-meme/types/bundle-ops.d.ts +166 -0
- package/dist/bundle/four-meme/types/bundle-ops.js +4 -0
- package/dist/bundle/four-meme/types/buy-first.d.ts +1 -1
- package/dist/bundle/four-meme/types/config.d.ts +95 -0
- package/dist/bundle/four-meme/types/config.js +1 -0
- package/dist/bundle/four-meme/types/core-flow.d.ts +2 -1
- package/dist/bundle/four-meme/types/index.d.ts +5 -611
- package/dist/bundle/four-meme/types/pancake-proxy-types.d.ts +118 -0
- package/dist/bundle/four-meme/types/pancake-proxy-types.js +3 -0
- package/dist/bundle/four-meme/types/swap-types.d.ts +103 -0
- package/dist/bundle/four-meme/types/swap-types.js +1 -0
- package/dist/bundle/four-meme/types/transfer-ops.d.ts +134 -0
- package/dist/bundle/four-meme/types/transfer-ops.js +1 -0
- package/dist/chains/bsc/pancake/bundle-buy-first-multi-wallet.js +2 -2
- package/dist/chains/bsc/pancake/bundle-buy-first.js +2 -2
- package/dist/chains/bsc/pancake/hop-chain.d.ts +1 -18
- package/dist/chains/bsc/pancake/hop-chain.js +1 -229
- package/dist/chains/bsc/pancake/quote.d.ts +10 -2
- package/dist/chains/bsc/pancake/quote.js +14 -6
- package/dist/chains/bsc/pancake/quote.test.js +13 -1
- package/dist/chains/index.d.ts +3 -0
- package/dist/chains/index.js +4 -0
- package/dist/chains/robinhood/constants.d.ts +48 -0
- package/dist/chains/robinhood/constants.js +55 -0
- package/dist/chains/robinhood/index.d.ts +11 -0
- package/dist/chains/robinhood/index.js +9 -0
- package/dist/chains/robinhood/longetf/assets.d.ts +11 -0
- package/dist/chains/robinhood/longetf/assets.js +4 -0
- package/dist/chains/robinhood/longetf/encode.d.ts +41 -0
- package/dist/chains/robinhood/longetf/encode.js +116 -0
- package/dist/chains/robinhood/longetf/index.d.ts +3 -0
- package/dist/chains/robinhood/longetf/index.js +3 -0
- package/dist/chains/robinhood/longetf/launch.d.ts +49 -0
- package/dist/chains/robinhood/longetf/launch.js +64 -0
- package/dist/chains/robinhood/pons-v2/encode.d.ts +62 -0
- package/dist/chains/robinhood/pons-v2/encode.js +115 -0
- package/dist/chains/robinhood/pons-v2/index.d.ts +2 -0
- package/dist/chains/robinhood/pons-v2/index.js +2 -0
- package/dist/chains/robinhood/pons-v2/launch.d.ts +48 -0
- package/dist/chains/robinhood/pons-v2/launch.js +107 -0
- package/dist/chains/robinhood/robinhood.test.d.ts +1 -0
- package/dist/chains/robinhood/robinhood.test.js +103 -0
- package/dist/chains/robinhood/sign.d.ts +20 -0
- package/dist/chains/robinhood/sign.js +31 -0
- package/dist/chains/xlayer/eip7702/types-base.d.ts +44 -0
- package/dist/chains/xlayer/eip7702/types-base.js +4 -0
- package/dist/chains/xlayer/eip7702/types-bundle.d.ts +191 -0
- package/dist/chains/xlayer/eip7702/types-bundle.js +1 -0
- package/dist/chains/xlayer/eip7702/types-create.d.ts +222 -0
- package/dist/chains/xlayer/eip7702/types-create.js +1 -0
- package/dist/chains/xlayer/eip7702/types-transfer.d.ts +124 -0
- package/dist/chains/xlayer/eip7702/types-transfer.js +1 -0
- package/dist/chains/xlayer/eip7702/types.d.ts +4 -578
- package/dist/chains/xlayer/eip7702/types.js +0 -3
- package/dist/chains/xlayer/eoa/eoa-dex-types.d.ts +196 -0
- package/dist/chains/xlayer/eoa/eoa-dex-types.js +1 -0
- package/dist/chains/xlayer/eoa/eoa-swap-types.d.ts +283 -0
- package/dist/chains/xlayer/eoa/eoa-swap-types.js +1 -0
- package/dist/chains/xlayer/eoa/eoa-trade-types.d.ts +300 -0
- package/dist/chains/xlayer/eoa/eoa-trade-types.js +6 -0
- package/dist/chains/xlayer/eoa/eoa-types.d.ts +4 -774
- package/dist/chains/xlayer/eoa/eoa-types.js +0 -5
- package/dist/chains/xlayer/eoa/eoa-wash-volume.js +2 -13
- package/dist/chains/xlayer/eoa/hop-chain.d.ts +1 -1
- package/dist/chains/xlayer/eoa/hop-chain.js +4 -83
- package/dist/core/constants/addresses.d.ts +18 -0
- package/dist/core/constants/addresses.js +23 -0
- package/dist/core/constants/chains.d.ts +16 -0
- package/dist/core/constants/chains.js +20 -0
- package/dist/core/constants/gas.d.ts +8 -0
- package/dist/core/constants/gas.js +9 -0
- package/dist/core/constants/index.d.ts +2 -1
- package/dist/core/constants/index.js +2 -1
- package/dist/core/constants/slippage.d.ts +6 -0
- package/dist/core/constants/slippage.js +15 -0
- package/dist/domains/flap/portal-bundle-merkle/core-helpers.js +2 -2
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/helpers.d.ts +2 -43
- package/dist/domains/flap/portal-bundle-merkle/pancake-proxy/helpers.js +8 -208
- package/dist/domains/flap/portal-bundle-merkle/private/helpers.js +2 -2
- package/dist/domains/flap/portal-bundle-merkle/private/sell.js +2 -2
- package/dist/domains/flap/portal-bundle-merkle/swap-helpers.d.ts +4 -24
- package/dist/domains/flap/portal-bundle-merkle/swap-helpers.js +12 -166
- package/dist/domains/flap/portal-bundle-merkle/types-bundle.d.ts +137 -0
- package/dist/domains/flap/portal-bundle-merkle/types-bundle.js +7 -0
- package/dist/domains/flap/portal-bundle-merkle/types-config.d.ts +118 -0
- package/dist/domains/flap/portal-bundle-merkle/types-config.js +4 -0
- package/dist/domains/flap/portal-bundle-merkle/types-pancake.d.ts +118 -0
- package/dist/domains/flap/portal-bundle-merkle/types-pancake.js +4 -0
- package/dist/domains/flap/portal-bundle-merkle/types-transfer.d.ts +70 -0
- package/dist/domains/flap/portal-bundle-merkle/types-transfer.js +1 -0
- package/dist/domains/flap/portal-bundle-merkle/types.d.ts +4 -441
- package/dist/domains/holders/internal/disperse.js +2 -18
- package/dist/domains/lp-inspect/inspect-helpers.d.ts +1 -0
- package/dist/domains/lp-inspect/inspect-helpers.js +3 -16
- package/dist/exports/root-foundations.d.ts +1 -1
- package/dist/exports/root-foundations.js +1 -1
- package/dist/exports/root-robinhood.d.ts +9 -0
- package/dist/exports/root-robinhood.js +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/hop-chains.d.ts +0 -3
- package/dist/utils/hop-chains.js +4 -5
- package/dist/utils/pancake-router-tx.d.ts +41 -0
- package/dist/utils/pancake-router-tx.js +174 -0
- package/dist/utils/swap-helpers.d.ts +6 -2
- package/dist/utils/swap-helpers.js +24 -4
- package/dist/utils/wallet.js +12 -12
- package/package.json +1 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import type { EIP7702Config, GeneratedWallet, TradeType, UserType } from './types-base.js';
|
|
2
|
+
export interface BundleBuyParams {
|
|
3
|
+
/** 主钱包(发起交易,支付 gas) */
|
|
4
|
+
mainPrivateKey: string;
|
|
5
|
+
/** 买入钱包私钥列表 */
|
|
6
|
+
privateKeys: string[];
|
|
7
|
+
/** 每个钱包的买入金额 (OKB) */
|
|
8
|
+
buyAmounts: string[];
|
|
9
|
+
/** 代币地址 */
|
|
10
|
+
tokenAddress: string;
|
|
11
|
+
/** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */
|
|
12
|
+
tradeType?: TradeType;
|
|
13
|
+
/** 路由地址(可选,根据 tradeType 自动选择) */
|
|
14
|
+
routerAddress?: string;
|
|
15
|
+
/** V3 费率(可选,默认 2500,仅 V3 使用) */
|
|
16
|
+
fee?: number;
|
|
17
|
+
/** 用户类型(影响利润率) */
|
|
18
|
+
userType?: UserType;
|
|
19
|
+
/** 配置 */
|
|
20
|
+
config?: EIP7702Config;
|
|
21
|
+
}
|
|
22
|
+
export interface BundleBuyResult {
|
|
23
|
+
/** 签名后的交易 */
|
|
24
|
+
signedTransaction: string;
|
|
25
|
+
/** 交易哈希(发送后) */
|
|
26
|
+
txHash?: string;
|
|
27
|
+
/** 元数据 */
|
|
28
|
+
metadata: {
|
|
29
|
+
totalBuyAmount: string;
|
|
30
|
+
walletCount: number;
|
|
31
|
+
profitAmount: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface BundleSellParams {
|
|
35
|
+
/** 主钱包(发起交易,支付 gas) */
|
|
36
|
+
mainPrivateKey: string;
|
|
37
|
+
/** 卖出钱包私钥列表 */
|
|
38
|
+
privateKeys: string[];
|
|
39
|
+
/** 卖出数量(代币单位)或百分比 */
|
|
40
|
+
sellAmounts?: string[];
|
|
41
|
+
/** 卖出百分比(0-100) */
|
|
42
|
+
sellPercent?: number;
|
|
43
|
+
/** 代币地址 */
|
|
44
|
+
tokenAddress: string;
|
|
45
|
+
/** 代币精度 */
|
|
46
|
+
tokenDecimals?: number;
|
|
47
|
+
/** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */
|
|
48
|
+
tradeType?: TradeType;
|
|
49
|
+
/** 路由地址(可选,根据 tradeType 自动选择) */
|
|
50
|
+
routerAddress?: string;
|
|
51
|
+
/** V3 费率(可选,默认 2500,仅 V3 使用) */
|
|
52
|
+
fee?: number;
|
|
53
|
+
/** 用户类型(影响利润率) */
|
|
54
|
+
userType?: UserType;
|
|
55
|
+
/** 配置 */
|
|
56
|
+
config?: EIP7702Config;
|
|
57
|
+
}
|
|
58
|
+
export interface BundleSellResult {
|
|
59
|
+
/** 签名后的交易 */
|
|
60
|
+
signedTransaction: string;
|
|
61
|
+
/** 交易哈希(发送后) */
|
|
62
|
+
txHash?: string;
|
|
63
|
+
/** 元数据 */
|
|
64
|
+
metadata: {
|
|
65
|
+
/** 总卖出代币数量 */
|
|
66
|
+
totalSellAmount: string;
|
|
67
|
+
/** 参与卖出的钱包数量 */
|
|
68
|
+
walletCount: number;
|
|
69
|
+
/** 预估卖出获得的 OKB 数量 */
|
|
70
|
+
estimatedOkbOut: string;
|
|
71
|
+
/** 利润金额(OKB) */
|
|
72
|
+
profitAmount: string;
|
|
73
|
+
/** 利润接收地址 */
|
|
74
|
+
profitRecipient: string;
|
|
75
|
+
/** 用户类型 */
|
|
76
|
+
userType: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export interface BundleApproveParams {
|
|
80
|
+
/** 主钱包(发起交易,支付 gas) */
|
|
81
|
+
mainPrivateKey: string;
|
|
82
|
+
/** 需要授权的钱包私钥列表 */
|
|
83
|
+
privateKeys: string[];
|
|
84
|
+
/** 代币地址 */
|
|
85
|
+
tokenAddress: string;
|
|
86
|
+
/** 授权给的地址(spender) */
|
|
87
|
+
spenderAddress: string;
|
|
88
|
+
/** 授权金额(可选,默认 MaxUint256) */
|
|
89
|
+
amount?: bigint;
|
|
90
|
+
/** 配置 */
|
|
91
|
+
config?: EIP7702Config;
|
|
92
|
+
}
|
|
93
|
+
export interface BundleApproveResult {
|
|
94
|
+
/** 签名后的交易 */
|
|
95
|
+
signedTransaction: string;
|
|
96
|
+
/** 交易哈希(发送后) */
|
|
97
|
+
txHash?: string;
|
|
98
|
+
/** 元数据 */
|
|
99
|
+
metadata: {
|
|
100
|
+
walletCount: number;
|
|
101
|
+
tokenAddress: string;
|
|
102
|
+
spenderAddress: string;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export interface BundleSwapParams {
|
|
106
|
+
/** 卖出钱包私钥 */
|
|
107
|
+
sellerPrivateKey: string;
|
|
108
|
+
/** 买入钱包私钥 */
|
|
109
|
+
buyerPrivateKey: string;
|
|
110
|
+
/** 代币地址 */
|
|
111
|
+
tokenAddress: string;
|
|
112
|
+
/** 代币精度 */
|
|
113
|
+
tokenDecimals?: number;
|
|
114
|
+
/** 卖出数量(代币单位) */
|
|
115
|
+
sellAmount: string;
|
|
116
|
+
/** 中间跳转次数 */
|
|
117
|
+
hopCount?: number;
|
|
118
|
+
/** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */
|
|
119
|
+
tradeType?: TradeType;
|
|
120
|
+
/** 路由地址(可选,根据 tradeType 自动选择) */
|
|
121
|
+
routerAddress?: string;
|
|
122
|
+
/** V3 费率(可选,默认 2500,仅 V3 使用) */
|
|
123
|
+
fee?: number;
|
|
124
|
+
/** 用户类型(影响利润率) */
|
|
125
|
+
userType?: UserType;
|
|
126
|
+
/**
|
|
127
|
+
* 是否使用资金利用率模式(默认 false)
|
|
128
|
+
* - false(普通模式): 卖家卖出 OKB 留在卖家账户,买家用自己预存的 OKB 买入
|
|
129
|
+
* - true(资金利用率模式): 卖家卖出的 OKB 通过多跳转账给买家,买家用收到的 OKB 买入
|
|
130
|
+
*/
|
|
131
|
+
useFundUtilization?: boolean;
|
|
132
|
+
/** 配置 */
|
|
133
|
+
config?: EIP7702Config;
|
|
134
|
+
}
|
|
135
|
+
export interface BundleBatchSwapParams {
|
|
136
|
+
/** 卖出钱包私钥 */
|
|
137
|
+
sellerPrivateKey: string;
|
|
138
|
+
/** 买入钱包私钥列表 */
|
|
139
|
+
buyerPrivateKeys: string[];
|
|
140
|
+
/** 每个买入钱包的分配比例(百分比) */
|
|
141
|
+
buyerRatios?: number[];
|
|
142
|
+
/** 代币地址 */
|
|
143
|
+
tokenAddress: string;
|
|
144
|
+
/** 代币精度 */
|
|
145
|
+
tokenDecimals?: number;
|
|
146
|
+
/** 卖出数量(代币单位) */
|
|
147
|
+
sellAmount: string;
|
|
148
|
+
/** 中间跳转次数 */
|
|
149
|
+
hopCount?: number;
|
|
150
|
+
/** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */
|
|
151
|
+
tradeType?: TradeType;
|
|
152
|
+
/** 路由地址(可选,根据 tradeType 自动选择) */
|
|
153
|
+
routerAddress?: string;
|
|
154
|
+
/** V3 费率(可选,默认 2500,仅 V3 使用) */
|
|
155
|
+
fee?: number;
|
|
156
|
+
/** 用户类型(影响利润率) */
|
|
157
|
+
userType?: UserType;
|
|
158
|
+
/**
|
|
159
|
+
* 是否使用资金利用率模式(默认 false)
|
|
160
|
+
* - false(普通模式): 卖家卖出 OKB 留在卖家账户,买家用自己预存的 OKB 买入
|
|
161
|
+
* - true(资金利用率模式): 卖家卖出的 OKB 通过多跳转账给买家,买家用收到的 OKB 买入
|
|
162
|
+
*/
|
|
163
|
+
useFundUtilization?: boolean;
|
|
164
|
+
/** 配置 */
|
|
165
|
+
config?: EIP7702Config;
|
|
166
|
+
}
|
|
167
|
+
export interface BundleSwapResult {
|
|
168
|
+
/** 签名后的交易 */
|
|
169
|
+
signedTransaction: string;
|
|
170
|
+
/** 交易哈希(发送后) */
|
|
171
|
+
txHash?: string;
|
|
172
|
+
/** 中间钱包(临时生成) */
|
|
173
|
+
hopWallets?: GeneratedWallet[];
|
|
174
|
+
/** 元数据 */
|
|
175
|
+
metadata: {
|
|
176
|
+
sellerAddress: string;
|
|
177
|
+
buyerAddresses: string[];
|
|
178
|
+
sellAmount: string;
|
|
179
|
+
/** 预估卖出获得的 OKB 数量 */
|
|
180
|
+
estimatedOkbOut?: string;
|
|
181
|
+
estimatedBuyAmount: string;
|
|
182
|
+
/** 利润金额(OKB) */
|
|
183
|
+
profitAmount: string;
|
|
184
|
+
/** 利润接收地址 */
|
|
185
|
+
profitRecipient?: string;
|
|
186
|
+
/** 用户类型 */
|
|
187
|
+
userType?: string;
|
|
188
|
+
/** 是否使用资金利用率模式 */
|
|
189
|
+
useFundUtilization?: boolean;
|
|
190
|
+
};
|
|
191
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import type { EIP7702Config, TradeType, UserType } from './types-base.js';
|
|
2
|
+
export interface TokenInfo {
|
|
3
|
+
/** 代币名称 */
|
|
4
|
+
name: string;
|
|
5
|
+
/** 代币符号 */
|
|
6
|
+
symbol: string;
|
|
7
|
+
/** 代币元数据 (IPFS URI 等) */
|
|
8
|
+
meta: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CreateTokenParams {
|
|
11
|
+
/** 代币信息 */
|
|
12
|
+
tokenInfo: TokenInfo;
|
|
13
|
+
/** 预计算的代币地址(可选) */
|
|
14
|
+
tokenAddress?: string;
|
|
15
|
+
/** 毕业阈值 (1-255, 默认 1) */
|
|
16
|
+
dexThresh?: number;
|
|
17
|
+
/** 盐值 (bytes32, 默认 0x0) */
|
|
18
|
+
salt?: string;
|
|
19
|
+
/** 税率 (0-100, 默认 0) */
|
|
20
|
+
taxRate?: number;
|
|
21
|
+
/** 迁移器类型 (默认 0) */
|
|
22
|
+
migratorType?: number;
|
|
23
|
+
/** 报价代币地址 (默认零地址=原生代币) */
|
|
24
|
+
quoteToken?: string;
|
|
25
|
+
/** 报价代币数量 (默认 0) */
|
|
26
|
+
quoteAmt?: bigint;
|
|
27
|
+
/** 受益人地址 (默认发起者) */
|
|
28
|
+
beneficiary?: string;
|
|
29
|
+
/** 许可数据 (默认 0x) */
|
|
30
|
+
permitData?: string;
|
|
31
|
+
/** 扩展 ID (bytes32, V3/V4 使用) */
|
|
32
|
+
extensionID?: string;
|
|
33
|
+
/** 扩展数据 (V3/V4 使用) */
|
|
34
|
+
extensionData?: string;
|
|
35
|
+
/** DEX ID (V4 使用) */
|
|
36
|
+
dexId?: number;
|
|
37
|
+
/** LP 费率配置 (V4 使用, 0=0.25%, 1=0.01%, 2=1%) */
|
|
38
|
+
lpFeeProfile?: number;
|
|
39
|
+
/** Tax Token V2 高级税收配置(V5 使用,taxRate > 0 时启用) */
|
|
40
|
+
taxV2Config?: {
|
|
41
|
+
taxDuration: number;
|
|
42
|
+
antiFarmerDuration: number;
|
|
43
|
+
mktBps: number;
|
|
44
|
+
deflationBps: number;
|
|
45
|
+
dividendBps: number;
|
|
46
|
+
lpBps: number;
|
|
47
|
+
minimumShareBalance?: number;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface BundleCreateBuyParams extends CreateTokenParams {
|
|
51
|
+
/** 开发者钱包私钥(发起者,发币) */
|
|
52
|
+
devPrivateKey: string;
|
|
53
|
+
/** 买入钱包私钥列表 */
|
|
54
|
+
buyerPrivateKeys: string[];
|
|
55
|
+
/** 每个买入钱包的金额 (OKB) */
|
|
56
|
+
buyAmounts: string[];
|
|
57
|
+
/** 用户类型(影响利润率) */
|
|
58
|
+
userType?: 'v0' | 'v1' | 'default';
|
|
59
|
+
/** 配置 */
|
|
60
|
+
config?: EIP7702Config;
|
|
61
|
+
}
|
|
62
|
+
export interface BundleCreateBuyResult {
|
|
63
|
+
/** 签名后的交易 */
|
|
64
|
+
signedTransaction: string;
|
|
65
|
+
/** 预计算的代币地址 */
|
|
66
|
+
tokenAddress: string;
|
|
67
|
+
/** 元数据 */
|
|
68
|
+
metadata: {
|
|
69
|
+
devAddress: string;
|
|
70
|
+
buyerCount: number;
|
|
71
|
+
totalBuyAmount: string;
|
|
72
|
+
profitAmount: string;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface BundleCreateToDexParams extends CreateTokenParams {
|
|
76
|
+
/** Payer 私钥(支付 gas,发起交易) */
|
|
77
|
+
payerPrivateKey: string;
|
|
78
|
+
/** 内盘买入钱包私钥列表 */
|
|
79
|
+
curveBuyerPrivateKeys: string[];
|
|
80
|
+
/** 内盘买入金额 (OKB) */
|
|
81
|
+
curveBuyAmounts: string[];
|
|
82
|
+
/** 是否启用外盘买入 */
|
|
83
|
+
enableDexBuy?: boolean;
|
|
84
|
+
/** 外盘买入钱包私钥列表 */
|
|
85
|
+
dexBuyerPrivateKeys?: string[];
|
|
86
|
+
/** 外盘买入金额 (OKB) */
|
|
87
|
+
dexBuyAmounts?: string[];
|
|
88
|
+
/** 用户类型(影响利润率) */
|
|
89
|
+
userType?: 'v0' | 'v1' | 'default';
|
|
90
|
+
/** 配置 */
|
|
91
|
+
config?: EIP7702Config;
|
|
92
|
+
}
|
|
93
|
+
export interface BundleCreateToDexResult {
|
|
94
|
+
/** 签名后的交易 */
|
|
95
|
+
signedTransaction: string;
|
|
96
|
+
/** 预计算的代币地址 */
|
|
97
|
+
tokenAddress: string;
|
|
98
|
+
/** 元数据 */
|
|
99
|
+
metadata: {
|
|
100
|
+
payerAddress: string;
|
|
101
|
+
curveBuyerCount: number;
|
|
102
|
+
curveTotalBuyAmount: string;
|
|
103
|
+
enableDexBuy: boolean;
|
|
104
|
+
dexBuyerCount: number;
|
|
105
|
+
dexTotalBuyAmount: string;
|
|
106
|
+
profitAmount: string;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export interface BundleMultiSwapParams {
|
|
110
|
+
/** Payer 钱包私钥(支付 Gas 费) */
|
|
111
|
+
mainPrivateKey: string;
|
|
112
|
+
/** 卖出钱包私钥列表 */
|
|
113
|
+
sellerPrivateKeys: string[];
|
|
114
|
+
/** 买入钱包私钥列表 */
|
|
115
|
+
buyerPrivateKeys: string[];
|
|
116
|
+
/** 买入总金额 (OKB) */
|
|
117
|
+
totalBuyAmount: string;
|
|
118
|
+
/** 代币地址 */
|
|
119
|
+
tokenAddress: string;
|
|
120
|
+
/** 代币精度 */
|
|
121
|
+
tokenDecimals?: number;
|
|
122
|
+
/** 卖出百分比(1-100,默认 100) */
|
|
123
|
+
sellPercent?: number;
|
|
124
|
+
/** 交易类型:FLAP 内盘 / V2 / V3(默认 V3) */
|
|
125
|
+
tradeType?: TradeType;
|
|
126
|
+
/** 路由地址(可选,根据 tradeType 自动选择) */
|
|
127
|
+
routerAddress?: string;
|
|
128
|
+
/** V3 费率(可选,默认 2500,仅 V3 使用) */
|
|
129
|
+
fee?: number;
|
|
130
|
+
/** 用户类型(影响利润率) */
|
|
131
|
+
userType?: UserType;
|
|
132
|
+
/** 配置 */
|
|
133
|
+
config?: EIP7702Config;
|
|
134
|
+
}
|
|
135
|
+
export interface BundleMultiSwapResult {
|
|
136
|
+
/** 签名后的交易 */
|
|
137
|
+
signedTransaction: string;
|
|
138
|
+
/** 元数据 */
|
|
139
|
+
metadata: {
|
|
140
|
+
payerAddress: string;
|
|
141
|
+
sellerAddresses: string[];
|
|
142
|
+
buyerAddresses: string[];
|
|
143
|
+
sellerCount: number;
|
|
144
|
+
buyerCount: number;
|
|
145
|
+
totalBuyAmount: string;
|
|
146
|
+
totalSellAmount: string;
|
|
147
|
+
profitAmount: string;
|
|
148
|
+
profitRecipient: string;
|
|
149
|
+
userType: string;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export interface BundleApproveMultiSpendersParams {
|
|
153
|
+
/** 主钱包(发起交易,支付 gas) */
|
|
154
|
+
mainPrivateKey: string;
|
|
155
|
+
/** 需要授权的钱包私钥列表 */
|
|
156
|
+
privateKeys: string[];
|
|
157
|
+
/** 代币地址 */
|
|
158
|
+
tokenAddress: string;
|
|
159
|
+
/** 授权给的地址列表(多个 spender) */
|
|
160
|
+
spenderAddresses: string[];
|
|
161
|
+
/** 授权金额(可选,默认 MaxUint256) */
|
|
162
|
+
amount?: bigint;
|
|
163
|
+
/** 配置 */
|
|
164
|
+
config?: EIP7702Config;
|
|
165
|
+
}
|
|
166
|
+
export interface BundleApproveMultiSpendersResult {
|
|
167
|
+
/** 签名后的交易 */
|
|
168
|
+
signedTransaction: string;
|
|
169
|
+
/** 元数据 */
|
|
170
|
+
metadata: {
|
|
171
|
+
walletCount: number;
|
|
172
|
+
tokenAddress: string;
|
|
173
|
+
spenderAddresses: string[];
|
|
174
|
+
totalApproveCalls: number;
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
export type AmountMode = 'average' | 'random' | 'custom';
|
|
178
|
+
export interface BundleGraduateBuyParams {
|
|
179
|
+
/** 代币地址 */
|
|
180
|
+
tokenAddress: string;
|
|
181
|
+
/** 买入钱包私钥列表 */
|
|
182
|
+
privateKeys: string[];
|
|
183
|
+
/** Payer 私钥(支付 gas) */
|
|
184
|
+
payerPrivateKey: string;
|
|
185
|
+
/** 金额分配模式 */
|
|
186
|
+
amountMode: AmountMode;
|
|
187
|
+
/** 总买入金额 (average 模式) */
|
|
188
|
+
totalBuyAmount?: number;
|
|
189
|
+
/** 最小金额 (random 模式) */
|
|
190
|
+
minAmount?: number;
|
|
191
|
+
/** 最大金额 (random 模式) */
|
|
192
|
+
maxAmount?: number;
|
|
193
|
+
/** 钱包金额映射 (custom 模式) */
|
|
194
|
+
walletAmounts?: Record<string, number>;
|
|
195
|
+
/** 是否启用外盘买入 */
|
|
196
|
+
enableDexBuy?: boolean;
|
|
197
|
+
/** 扩展数据(V3/V4 代币使用) */
|
|
198
|
+
extensionData?: string;
|
|
199
|
+
/** 前端传递的内盘买家地址 */
|
|
200
|
+
curveAddresses?: string[];
|
|
201
|
+
/** 前端传递的外盘买家地址 */
|
|
202
|
+
dexAddresses?: string[];
|
|
203
|
+
/** 毕业金额(OKB) */
|
|
204
|
+
graduationAmount?: number;
|
|
205
|
+
/** 用户类型(影响利润率) */
|
|
206
|
+
userType?: 'v0' | 'v1' | 'default';
|
|
207
|
+
/** 配置 */
|
|
208
|
+
config?: EIP7702Config;
|
|
209
|
+
}
|
|
210
|
+
export interface BundleGraduateBuyResult {
|
|
211
|
+
/** 签名后的交易 */
|
|
212
|
+
signedTransaction: string;
|
|
213
|
+
/** 元数据 */
|
|
214
|
+
metadata: {
|
|
215
|
+
tokenAddress: string;
|
|
216
|
+
curveCount: number;
|
|
217
|
+
dexCount: number;
|
|
218
|
+
curveTotalAmount: string;
|
|
219
|
+
dexTotalAmount: string;
|
|
220
|
+
profitAmount: string;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { EIP7702Config, GeneratedWallet } from './types-base.js';
|
|
2
|
+
export interface MultiHopTransferParams {
|
|
3
|
+
/** 主钱包(发起交易,支付 gas) */
|
|
4
|
+
mainPrivateKey: string;
|
|
5
|
+
/** 跳转次数(自动生成中间钱包) */
|
|
6
|
+
hopCount: number;
|
|
7
|
+
/** 最终接收者地址 */
|
|
8
|
+
receiverAddress: string;
|
|
9
|
+
/** 转账金额 (OKB) */
|
|
10
|
+
amount: string;
|
|
11
|
+
/** 配置 */
|
|
12
|
+
config?: EIP7702Config;
|
|
13
|
+
}
|
|
14
|
+
export interface MultiHopTransferResult {
|
|
15
|
+
/** 签名后的交易 */
|
|
16
|
+
signedTransaction: string;
|
|
17
|
+
/** 交易哈希(发送后) */
|
|
18
|
+
txHash?: string;
|
|
19
|
+
/** 中间钱包(临时生成) */
|
|
20
|
+
hopWallets: GeneratedWallet[];
|
|
21
|
+
/** 元数据 */
|
|
22
|
+
metadata: {
|
|
23
|
+
senderAddress: string;
|
|
24
|
+
receiverAddress: string;
|
|
25
|
+
amount: string;
|
|
26
|
+
hopCount: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface DisperseParams {
|
|
30
|
+
/** 主钱包(资金来源) */
|
|
31
|
+
mainPrivateKey: string;
|
|
32
|
+
/** 接收地址列表 */
|
|
33
|
+
recipients: string[];
|
|
34
|
+
/** 每个地址的金额 (OKB) */
|
|
35
|
+
amounts: string[];
|
|
36
|
+
/** 中间跳转次数(可选) */
|
|
37
|
+
hopCount?: number;
|
|
38
|
+
/** 配置 */
|
|
39
|
+
config?: EIP7702Config;
|
|
40
|
+
}
|
|
41
|
+
export interface DisperseResult {
|
|
42
|
+
/** 签名后的交易 */
|
|
43
|
+
signedTransaction: string;
|
|
44
|
+
/** 交易哈希(发送后) */
|
|
45
|
+
txHash?: string;
|
|
46
|
+
/** 中间钱包(临时生成) */
|
|
47
|
+
hopWallets?: GeneratedWallet[];
|
|
48
|
+
/** 元数据 */
|
|
49
|
+
metadata: {
|
|
50
|
+
senderAddress: string;
|
|
51
|
+
recipientCount: number;
|
|
52
|
+
totalAmount: string;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface SweepParams {
|
|
56
|
+
/** 目标钱包(归集目的地) */
|
|
57
|
+
targetPrivateKey: string;
|
|
58
|
+
/** 源钱包私钥列表 */
|
|
59
|
+
sourcePrivateKeys: string[];
|
|
60
|
+
/** 是否保留 gas(可选) */
|
|
61
|
+
reserveGas?: boolean;
|
|
62
|
+
/** 配置 */
|
|
63
|
+
config?: EIP7702Config;
|
|
64
|
+
}
|
|
65
|
+
export interface SweepResult {
|
|
66
|
+
/** 签名后的交易 */
|
|
67
|
+
signedTransaction: string;
|
|
68
|
+
/** 交易哈希(发送后) */
|
|
69
|
+
txHash?: string;
|
|
70
|
+
/** 元数据 */
|
|
71
|
+
metadata: {
|
|
72
|
+
targetAddress: string;
|
|
73
|
+
sourceCount: number;
|
|
74
|
+
totalAmount: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface MakeVolumeParams {
|
|
78
|
+
/** 参与钱包私钥列表 */
|
|
79
|
+
privateKeys: string[];
|
|
80
|
+
/** 代币地址 */
|
|
81
|
+
tokenAddress: string;
|
|
82
|
+
/** 代币精度 */
|
|
83
|
+
tokenDecimals?: number;
|
|
84
|
+
/** 每轮买入金额 (OKB) */
|
|
85
|
+
buyAmountPerRound: string;
|
|
86
|
+
/** 轮数 */
|
|
87
|
+
rounds: number;
|
|
88
|
+
/** 轮间间隔(毫秒) */
|
|
89
|
+
intervalMs?: number;
|
|
90
|
+
/** 路由地址(可选) */
|
|
91
|
+
routerAddress?: string;
|
|
92
|
+
/** V3 费率(可选,默认 2500) */
|
|
93
|
+
fee?: number;
|
|
94
|
+
/** 进度回调 */
|
|
95
|
+
onProgress?: (progress: VolumeProgress) => void;
|
|
96
|
+
/** 配置 */
|
|
97
|
+
config?: EIP7702Config;
|
|
98
|
+
}
|
|
99
|
+
export interface VolumeProgress {
|
|
100
|
+
currentRound: number;
|
|
101
|
+
totalRounds: number;
|
|
102
|
+
status: 'buying' | 'selling' | 'waiting' | 'completed' | 'failed';
|
|
103
|
+
txHash?: string;
|
|
104
|
+
error?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface MakeVolumeResult {
|
|
107
|
+
/** 是否成功 */
|
|
108
|
+
success: boolean;
|
|
109
|
+
/** 完成的轮数 */
|
|
110
|
+
completedRounds: number;
|
|
111
|
+
/** 总买入金额 */
|
|
112
|
+
totalBuyAmount: string;
|
|
113
|
+
/** 总利润 */
|
|
114
|
+
totalProfit: string;
|
|
115
|
+
/** 错误信息 */
|
|
116
|
+
errors: string[];
|
|
117
|
+
}
|
|
118
|
+
export interface ExecuteResult {
|
|
119
|
+
success: boolean;
|
|
120
|
+
txHash?: string;
|
|
121
|
+
error?: string;
|
|
122
|
+
gasUsed?: bigint;
|
|
123
|
+
blockNumber?: number;
|
|
124
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|