four-flap-meme-sdk 2.0.0 → 2.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/__tests__/subpath-exports.test.js +64 -0
- package/dist/chains/bsc/iro.d.ts +5 -0
- package/dist/chains/bsc/iro.js +4 -0
- package/dist/chains/eni/flat-aliases.d.ts +10 -0
- package/dist/chains/eni/flat-aliases.js +8 -0
- package/dist/chains/eni/index.d.ts +1 -0
- package/dist/chains/eni/index.js +1 -0
- package/dist/chains/index.d.ts +13 -0
- package/dist/chains/index.js +13 -0
- package/dist/chains/xlayer/eip7702/flat-aliases.d.ts +13 -0
- package/dist/chains/xlayer/eip7702/flat-aliases.js +10 -0
- package/dist/chains/xlayer/eip7702/index.d.ts +1 -0
- package/dist/chains/xlayer/eip7702/index.js +1 -0
- package/dist/chains/xlayer/index.d.ts +3 -2
- package/dist/chains/xlayer/index.js +4 -7
- package/dist/flap/index.d.ts +10 -0
- package/dist/flap/index.js +8 -0
- package/dist/merkle/index.d.ts +12 -0
- package/dist/merkle/index.js +11 -0
- package/dist/shared/constants/index.d.ts +2 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/vanity/index.d.ts +5 -0
- package/dist/vanity/index.js +5 -0
- package/package.json +93 -2
- package/dist/chains/bsc/four/disperse.d.ts +0 -12
- package/dist/chains/bsc/four/disperse.js +0 -470
- package/dist/chains/bsc/four/pairwise.d.ts +0 -7
- package/dist/chains/bsc/four/pairwise.js +0 -308
- package/dist/chains/bsc/four/submit/blockrazor.d.ts +0 -18
- package/dist/chains/bsc/four/submit/blockrazor.js +0 -86
- package/dist/chains/bsc/four/submit/direct.d.ts +0 -66
- package/dist/chains/bsc/four/submit/direct.js +0 -452
- package/dist/chains/bsc/four/submit/helpers.d.ts +0 -18
- package/dist/chains/bsc/four/submit/helpers.js +0 -57
- package/dist/chains/bsc/four/submit/index.d.ts +0 -12
- package/dist/chains/bsc/four/submit/index.js +0 -11
- package/dist/chains/bsc/four/submit/merkle.d.ts +0 -18
- package/dist/chains/bsc/four/submit/merkle.js +0 -74
- package/dist/chains/bsc/four/submit/types.d.ts +0 -143
- package/dist/chains/bsc/four/swap/index.d.ts +0 -32
- package/dist/chains/bsc/four/swap/index.js +0 -829
- package/dist/chains/bsc/four/swap/types.d.ts +0 -70
- package/dist/chains/bsc/four/swap/types.js +0 -1
- package/dist/chains/bsc/four/sweep.d.ts +0 -13
- package/dist/chains/bsc/four/sweep.js +0 -788
- package/dist/chains/bsc/four/utils/index.d.ts +0 -20
- package/dist/chains/bsc/four/utils/index.js +0 -1558
- package/dist/chains/bsc/four/utils/types.d.ts +0 -1
- package/dist/chains/bsc/four/utils/types.js +0 -1
- package/dist/chains/bsc/pancake/bundle-buy-first/index.d.ts +0 -8
- package/dist/chains/bsc/pancake/bundle-buy-first/index.js +0 -907
- package/dist/chains/bsc/pancake/bundle-buy-first/types.d.ts +0 -73
- package/dist/chains/bsc/pancake/bundle-buy-first/types.js +0 -1
- package/dist/chains/bsc/pancake/bundle-swap/helpers.d.ts +0 -102
- package/dist/chains/bsc/pancake/bundle-swap/helpers.js +0 -572
- package/dist/chains/bsc/pancake/bundle-swap/index.d.ts +0 -50
- package/dist/chains/bsc/pancake/bundle-swap/index.js +0 -1066
- package/dist/chains/bsc/pancake/bundle-swap/types.d.ts +0 -202
- package/dist/chains/bsc/pancake/bundle-swap/types.js +0 -3
- package/dist/chains/xlayer/eip7702/bundle-swap/index.d.ts +0 -72
- package/dist/chains/xlayer/eip7702/bundle-swap/index.js +0 -921
- package/dist/chains/xlayer/eip7702/bundle-swap/types.d.ts +0 -65
- package/dist/chains/xlayer/eip7702/bundle-swap/types.js +0 -1
- package/dist/chains/xlayer/eip7702/multi-hop-transfer/index.d.ts +0 -128
- package/dist/chains/xlayer/eip7702/multi-hop-transfer/index.js +0 -857
- package/dist/chains/xlayer/eip7702/multi-hop-transfer/types.d.ts +0 -85
- package/dist/chains/xlayer/eip7702/multi-hop-transfer/types.js +0 -1
- package/dist/chains/xlayer/eip7702/volume/index.d.ts +0 -96
- package/dist/chains/xlayer/eip7702/volume/index.js +0 -793
- package/dist/chains/xlayer/eip7702/volume/types.d.ts +0 -124
- package/dist/chains/xlayer/eip7702/volume/types.js +0 -1
- package/dist/chains/xlayer/eoa/types-core.d.ts +0 -363
- package/dist/chains/xlayer/eoa/types-core.js +0 -53
- package/dist/chains/xlayer/eoa/types-create.d.ts +0 -413
- package/dist/chains/xlayer/eoa/types-create.js +0 -9
- package/dist/chains/xlayer/eoa/types-volume.d.ts +0 -209
- package/dist/chains/xlayer/eoa/types-volume.js +0 -13
- package/dist/dex/direct-router/index.d.ts +0 -70
- package/dist/dex/direct-router/index.js +0 -1410
- package/dist/dex/direct-router/types.d.ts +0 -81
- package/dist/dex/direct-router/types.js +0 -1
- package/dist/shared/abis/TaxToken.json +0 -969
- package/dist/shared/abis/TokenManager.json +0 -836
- package/dist/shared/abis/TokenManager2.json +0 -136
- package/dist/shared/abis/TokenManagerHelper3.json +0 -993
- package/dist/shared/abis 2/TaxToken.json +0 -105
- package/dist/shared/abis 2/TokenManager.json +0 -836
- package/dist/shared/abis 2/TokenManager2.json +0 -60
- package/dist/shared/abis 2/TokenManagerHelper3.json +0 -993
- package/dist/shared/abis 2/common.d.ts +0 -85
- package/dist/shared/abis 2/common.js +0 -254
- package/dist/shared/abis 2/index.d.ts +0 -8
- package/dist/shared/abis 2/index.js +0 -8
- package/dist/shared/clients 2/blockrazor.d.ts +0 -314
- package/dist/shared/clients 2/blockrazor.js +0 -596
- package/dist/shared/clients 2/club48.d.ts +0 -154
- package/dist/shared/clients 2/club48.js +0 -331
- package/dist/shared/clients 2/emitservice.d.ts +0 -47
- package/dist/shared/clients 2/emitservice.js +0 -44
- package/dist/shared/clients 2/four.d.ts +0 -132
- package/dist/shared/clients 2/four.js +0 -281
- package/dist/shared/clients 2/merkle.d.ts +0 -210
- package/dist/shared/clients 2/merkle.js +0 -400
- package/dist/shared/flap/__tests__/curve.test.d.ts +0 -1
- package/dist/shared/flap/__tests__/curve.test.js +0 -85
- package/dist/shared/flap/portal/index.d.ts +0 -12
- package/dist/shared/flap/portal/index.js +0 -11
- package/dist/shared/flap/portal/portal.d.ts +0 -47
- package/dist/shared/flap/portal/portal.js +0 -218
- package/dist/shared/flap/portal/types.d.ts +0 -227
- package/dist/shared/flap/portal/types.js +0 -80
- package/dist/shared/flap/portal/writer.d.ts +0 -121
- package/dist/shared/flap/portal/writer.js +0 -265
- package/dist/shared/flap/portal-bundle-merkle/core/index.d.ts +0 -18
- package/dist/shared/flap/portal-bundle-merkle/core/index.js +0 -938
- package/dist/shared/flap/portal-bundle-merkle/core/types.d.ts +0 -1
- package/dist/shared/flap/portal-bundle-merkle/core/types.js +0 -1
- package/dist/shared/flap/portal-bundle-merkle/swap/index.d.ts +0 -42
- package/dist/shared/flap/portal-bundle-merkle/swap/index.js +0 -1448
- package/dist/shared/flap/portal-bundle-merkle/swap/types.d.ts +0 -84
- package/dist/shared/flap/portal-bundle-merkle/swap/types.js +0 -1
- package/dist/shared/flap/portal-bundle-merkle/utils/index.d.ts +0 -17
- package/dist/shared/flap/portal-bundle-merkle/utils/index.js +0 -1024
- package/dist/shared/flap/portal-bundle-merkle/utils/types.d.ts +0 -16
- package/dist/shared/flap/portal-bundle-merkle/utils/types.js +0 -1
- package/dist/shared/flap/portal-bundle-merkle/utils-helpers.d.ts +0 -100
- package/dist/shared/flap/portal-bundle-merkle/utils-helpers.js +0 -133
- package/dist/shared/flap 2/__tests__/curve.test.d.ts +0 -1
- package/dist/shared/flap 2/__tests__/curve.test.js +0 -85
- package/dist/shared/flap 2/abi.d.ts +0 -4
- package/dist/shared/flap 2/abi.js +0 -4
- package/dist/shared/flap 2/constants.d.ts +0 -128
- package/dist/shared/flap 2/constants.js +0 -143
- package/dist/shared/flap 2/curve.d.ts +0 -33
- package/dist/shared/flap 2/curve.js +0 -84
- package/dist/shared/flap 2/errors.d.ts +0 -37
- package/dist/shared/flap 2/errors.js +0 -114
- package/dist/shared/flap 2/index.d.ts +0 -22
- package/dist/shared/flap 2/index.js +0 -33
- package/dist/shared/flap 2/ipfs.d.ts +0 -21
- package/dist/shared/flap 2/ipfs.js +0 -38
- package/dist/shared/flap 2/meta.d.ts +0 -30
- package/dist/shared/flap 2/meta.js +0 -195
- package/dist/shared/flap 2/permit.d.ts +0 -16
- package/dist/shared/flap 2/permit.js +0 -67
- package/dist/shared/flap 2/pinata.d.ts +0 -40
- package/dist/shared/flap 2/pinata.js +0 -106
- package/dist/shared/flap 2/portal-bundle-merkle/config.d.ts +0 -79
- package/dist/shared/flap 2/portal-bundle-merkle/config.js +0 -133
- package/dist/shared/flap 2/portal-bundle-merkle/core.d.ts +0 -18
- package/dist/shared/flap 2/portal-bundle-merkle/core.js +0 -938
- package/dist/shared/flap 2/portal-bundle-merkle/create-to-dex.d.ts +0 -125
- package/dist/shared/flap 2/portal-bundle-merkle/create-to-dex.js +0 -665
- package/dist/shared/flap 2/portal-bundle-merkle/curve-to-dex.d.ts +0 -88
- package/dist/shared/flap 2/portal-bundle-merkle/curve-to-dex.js +0 -446
- package/dist/shared/flap 2/portal-bundle-merkle/index.d.ts +0 -14
- package/dist/shared/flap 2/portal-bundle-merkle/index.js +0 -26
- package/dist/shared/flap 2/portal-bundle-merkle/pancake-proxy.d.ts +0 -28
- package/dist/shared/flap 2/portal-bundle-merkle/pancake-proxy.js +0 -701
- package/dist/shared/flap 2/portal-bundle-merkle/private.d.ts +0 -17
- package/dist/shared/flap 2/portal-bundle-merkle/private.js +0 -549
- package/dist/shared/flap 2/portal-bundle-merkle/swap-buy-first.d.ts +0 -65
- package/dist/shared/flap 2/portal-bundle-merkle/swap-buy-first.js +0 -831
- package/dist/shared/flap 2/portal-bundle-merkle/swap.d.ts +0 -201
- package/dist/shared/flap 2/portal-bundle-merkle/swap.js +0 -1359
- package/dist/shared/flap 2/portal-bundle-merkle/types.d.ts +0 -358
- package/dist/shared/flap 2/portal-bundle-merkle/types.js +0 -1
- package/dist/shared/flap 2/portal-bundle-merkle/utils.d.ts +0 -89
- package/dist/shared/flap 2/portal-bundle-merkle/utils.js +0 -963
- package/dist/shared/flap 2/portal-bundle.d.ts +0 -119
- package/dist/shared/flap 2/portal-bundle.js +0 -584
- package/dist/shared/flap 2/portal.d.ts +0 -392
- package/dist/shared/flap 2/portal.js +0 -559
- package/dist/shared/flap 2/vanity.d.ts +0 -48
- package/dist/shared/flap 2/vanity.js +0 -110
- package/dist/shared/flap 2/vault.d.ts +0 -240
- package/dist/shared/flap 2/vault.js +0 -366
- package/dist/shared/four 2/index.d.ts +0 -7
- package/dist/shared/four 2/index.js +0 -22
- package/dist/shared/four 2/tax-token.d.ts +0 -176
- package/dist/shared/four 2/tax-token.js +0 -302
- package/dist/shared/index 2.js +0 -10
- package/dist/shared/index.d 2.ts +0 -10
- package/dist/types/distribute.d.ts +0 -72
- package/dist/types/distribute.js +0 -1
- package/dist/types 2/errors.d.ts +0 -27
- package/dist/types 2/errors.js +0 -34
- package/dist/utils/__tests__/errors.test.d.ts +0 -1
- package/dist/utils/__tests__/errors.test.js +0 -76
- package/dist/utils/airdrop-sweep-types.d.ts +0 -1
- package/dist/utils/airdrop-sweep-types.js +0 -1
- package/dist/utils/erc20/index.d.ts +0 -242
- package/dist/utils/erc20/index.js +0 -645
- package/dist/utils/erc20/types.d.ts +0 -77
- package/dist/utils/erc20/types.js +0 -1
- package/dist/utils/erc20-types.d.ts +0 -1
- package/dist/utils/erc20-types.js +0 -1
- package/dist/utils/holders-maker/helpers.d.ts +0 -43
- package/dist/utils/holders-maker/helpers.js +0 -371
- package/dist/utils/holders-maker/index.d.ts +0 -26
- package/dist/utils/holders-maker/index.js +0 -218
- package/dist/utils/holders-maker/types.d.ts +0 -72
- package/dist/utils/holders-maker/types.js +0 -4
- package/dist/utils/holders-maker-types.d.ts +0 -1
- package/dist/utils/holders-maker-types.js +0 -1
- package/dist/utils/lp-inspect/index.d.ts +0 -44
- package/dist/utils/lp-inspect/index.js +0 -937
- package/dist/utils/lp-inspect/types.d.ts +0 -100
- package/dist/utils/lp-inspect/types.js +0 -1
- package/dist/utils/lp-inspect-types.d.ts +0 -1
- package/dist/utils/lp-inspect-types.js +0 -1
- package/dist/utils/private-sale-types.d.ts +0 -1
- package/dist/utils/private-sale-types.js +0 -1
- package/dist/utils/quote-helpers/index.d.ts +0 -107
- package/dist/utils/quote-helpers/index.js +0 -346
- package/dist/utils/quote-helpers/types.d.ts +0 -16
- package/dist/utils/quote-helpers/types.js +0 -1
- package/dist/utils/quote-helpers-types.d.ts +0 -1
- package/dist/utils/quote-helpers-types.js +0 -1
- /package/dist/{chains/bsc/four/submit/types.js → __tests__/subpath-exports.test.d.ts} +0 -0
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 公共 ABI 定义
|
|
3
|
-
*
|
|
4
|
-
* 将重复的 ABI 提取到这里,统一管理
|
|
5
|
-
*/
|
|
6
|
-
/** 完整 ERC20 ABI */
|
|
7
|
-
export declare const ERC20_ABI: string[];
|
|
8
|
-
/** 精简 ERC20 ABI(余额查询 + decimals) */
|
|
9
|
-
export declare const ERC20_BALANCE_ABI: string[];
|
|
10
|
-
/** ERC20 授权相关 ABI */
|
|
11
|
-
export declare const ERC20_ALLOWANCE_ABI: string[];
|
|
12
|
-
export declare const MULTICALL3_ABI: string[];
|
|
13
|
-
/** V2 Router 完整 ABI */
|
|
14
|
-
export declare const V2_ROUTER_ABI: string[];
|
|
15
|
-
/** V2 Router 精简 ABI(只用于报价) */
|
|
16
|
-
export declare const V2_ROUTER_QUOTE_ABI: string[];
|
|
17
|
-
/** V3 SwapRouter02 ABI(新版,deadline 在 multicall 中传递) */
|
|
18
|
-
export declare const V3_ROUTER02_ABI: (string | {
|
|
19
|
-
inputs: {
|
|
20
|
-
components: {
|
|
21
|
-
name: string;
|
|
22
|
-
type: string;
|
|
23
|
-
}[];
|
|
24
|
-
name: string;
|
|
25
|
-
type: string;
|
|
26
|
-
}[];
|
|
27
|
-
name: string;
|
|
28
|
-
outputs: {
|
|
29
|
-
name: string;
|
|
30
|
-
type: string;
|
|
31
|
-
}[];
|
|
32
|
-
stateMutability: string;
|
|
33
|
-
type: string;
|
|
34
|
-
})[];
|
|
35
|
-
/** V3 SwapRouter 旧版 ABI(deadline 在 struct 内部) */
|
|
36
|
-
export declare const V3_ROUTER_LEGACY_ABI: (string | {
|
|
37
|
-
inputs: {
|
|
38
|
-
components: {
|
|
39
|
-
name: string;
|
|
40
|
-
type: string;
|
|
41
|
-
}[];
|
|
42
|
-
name: string;
|
|
43
|
-
type: string;
|
|
44
|
-
}[];
|
|
45
|
-
name: string;
|
|
46
|
-
outputs: {
|
|
47
|
-
name: string;
|
|
48
|
-
type: string;
|
|
49
|
-
}[];
|
|
50
|
-
stateMutability: string;
|
|
51
|
-
type: string;
|
|
52
|
-
})[];
|
|
53
|
-
/**
|
|
54
|
-
* SwapRouter02 的 V2 方法 ABI
|
|
55
|
-
*
|
|
56
|
-
* 注意:SwapRouter02 的 V2 方法只有 token-to-token 交换
|
|
57
|
-
* 没有 swapExactETHForTokens / swapExactTokensForETH
|
|
58
|
-
* 必须通过 multicall 组合 wrapETH/unwrapWETH9 来处理原生代币
|
|
59
|
-
*/
|
|
60
|
-
export declare const SWAP_ROUTER02_V2_ABI: string[];
|
|
61
|
-
/** V3 QuoterV2 ABI */
|
|
62
|
-
export declare const V3_QUOTER_ABI: {
|
|
63
|
-
inputs: {
|
|
64
|
-
components: {
|
|
65
|
-
name: string;
|
|
66
|
-
type: string;
|
|
67
|
-
}[];
|
|
68
|
-
name: string;
|
|
69
|
-
type: string;
|
|
70
|
-
}[];
|
|
71
|
-
name: string;
|
|
72
|
-
outputs: {
|
|
73
|
-
name: string;
|
|
74
|
-
type: string;
|
|
75
|
-
}[];
|
|
76
|
-
stateMutability: string;
|
|
77
|
-
type: string;
|
|
78
|
-
}[];
|
|
79
|
-
export declare const V2_FACTORY_ABI: string[];
|
|
80
|
-
export declare const V2_PAIR_ABI: string[];
|
|
81
|
-
export declare const V3_FACTORY_ABI: string[];
|
|
82
|
-
export declare const V3_POOL_ABI: string[];
|
|
83
|
-
export declare const FLAP_PORTAL_ABI: string[];
|
|
84
|
-
export declare const TM2_ABI: string[];
|
|
85
|
-
export declare const HELPER3_ABI: string[];
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 公共 ABI 定义
|
|
3
|
-
*
|
|
4
|
-
* 将重复的 ABI 提取到这里,统一管理
|
|
5
|
-
*/
|
|
6
|
-
// ============================================================================
|
|
7
|
-
// ERC20 ABI
|
|
8
|
-
// ============================================================================
|
|
9
|
-
/** 完整 ERC20 ABI */
|
|
10
|
-
export const ERC20_ABI = [
|
|
11
|
-
'function approve(address spender, uint256 amount) external returns (bool)',
|
|
12
|
-
'function allowance(address owner, address spender) external view returns (uint256)',
|
|
13
|
-
'function balanceOf(address account) external view returns (uint256)',
|
|
14
|
-
'function decimals() external view returns (uint8)',
|
|
15
|
-
'function name() external view returns (string)',
|
|
16
|
-
'function symbol() external view returns (string)',
|
|
17
|
-
'function totalSupply() external view returns (uint256)',
|
|
18
|
-
'function transfer(address to, uint256 amount) external returns (bool)',
|
|
19
|
-
'function transferFrom(address from, address to, uint256 amount) external returns (bool)',
|
|
20
|
-
];
|
|
21
|
-
/** 精简 ERC20 ABI(余额查询 + decimals) */
|
|
22
|
-
export const ERC20_BALANCE_ABI = [
|
|
23
|
-
'function balanceOf(address account) external view returns (uint256)',
|
|
24
|
-
'function decimals() external view returns (uint8)',
|
|
25
|
-
];
|
|
26
|
-
/** ERC20 授权相关 ABI */
|
|
27
|
-
export const ERC20_ALLOWANCE_ABI = [
|
|
28
|
-
'function allowance(address owner, address spender) external view returns (uint256)',
|
|
29
|
-
'function approve(address spender, uint256 amount) external returns (bool)',
|
|
30
|
-
'function decimals() external view returns (uint8)',
|
|
31
|
-
];
|
|
32
|
-
// ============================================================================
|
|
33
|
-
// Multicall3 ABI
|
|
34
|
-
// ============================================================================
|
|
35
|
-
export const MULTICALL3_ABI = [
|
|
36
|
-
// ✅ 标记为 view,确保 ethers.js v6 使用 call 而不是 sendTransaction
|
|
37
|
-
'function aggregate3(tuple(address target, bool allowFailure, bytes callData)[] calls) view returns (tuple(bool success, bytes returnData)[])',
|
|
38
|
-
'function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)',
|
|
39
|
-
'function getEthBalance(address addr) view returns (uint256 balance)',
|
|
40
|
-
];
|
|
41
|
-
// ============================================================================
|
|
42
|
-
// PancakeSwap / Uniswap V2 Router ABI
|
|
43
|
-
// ============================================================================
|
|
44
|
-
/** V2 Router 完整 ABI */
|
|
45
|
-
export const V2_ROUTER_ABI = [
|
|
46
|
-
// BNB/ETH → Token (买入)
|
|
47
|
-
'function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts)',
|
|
48
|
-
'function swapExactETHForTokensSupportingFeeOnTransferTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable',
|
|
49
|
-
// Token → BNB/ETH (卖出)
|
|
50
|
-
'function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)',
|
|
51
|
-
'function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external',
|
|
52
|
-
// Token → Token
|
|
53
|
-
'function swapExactTokensForTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts)',
|
|
54
|
-
'function swapExactTokensForTokensSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external',
|
|
55
|
-
// 报价
|
|
56
|
-
'function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts)',
|
|
57
|
-
'function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts)',
|
|
58
|
-
// Factory
|
|
59
|
-
'function factory() external view returns (address)',
|
|
60
|
-
];
|
|
61
|
-
/** V2 Router 精简 ABI(只用于报价) */
|
|
62
|
-
export const V2_ROUTER_QUOTE_ABI = [
|
|
63
|
-
'function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts)',
|
|
64
|
-
];
|
|
65
|
-
// ============================================================================
|
|
66
|
-
// PancakeSwap / Uniswap V3 Router ABI (SwapRouter02)
|
|
67
|
-
// ============================================================================
|
|
68
|
-
/** V3 SwapRouter02 ABI(新版,deadline 在 multicall 中传递) */
|
|
69
|
-
export const V3_ROUTER02_ABI = [
|
|
70
|
-
// exactInputSingle - 单跳,不含 deadline
|
|
71
|
-
{
|
|
72
|
-
"inputs": [{
|
|
73
|
-
"components": [
|
|
74
|
-
{ "name": "tokenIn", "type": "address" },
|
|
75
|
-
{ "name": "tokenOut", "type": "address" },
|
|
76
|
-
{ "name": "fee", "type": "uint24" },
|
|
77
|
-
{ "name": "recipient", "type": "address" },
|
|
78
|
-
{ "name": "amountIn", "type": "uint256" },
|
|
79
|
-
{ "name": "amountOutMinimum", "type": "uint256" },
|
|
80
|
-
{ "name": "sqrtPriceLimitX96", "type": "uint160" }
|
|
81
|
-
],
|
|
82
|
-
"name": "params",
|
|
83
|
-
"type": "tuple"
|
|
84
|
-
}],
|
|
85
|
-
"name": "exactInputSingle",
|
|
86
|
-
"outputs": [{ "name": "amountOut", "type": "uint256" }],
|
|
87
|
-
"stateMutability": "payable",
|
|
88
|
-
"type": "function"
|
|
89
|
-
},
|
|
90
|
-
// exactInput - 多跳,不含 deadline
|
|
91
|
-
{
|
|
92
|
-
"inputs": [{
|
|
93
|
-
"components": [
|
|
94
|
-
{ "name": "path", "type": "bytes" },
|
|
95
|
-
{ "name": "recipient", "type": "address" },
|
|
96
|
-
{ "name": "amountIn", "type": "uint256" },
|
|
97
|
-
{ "name": "amountOutMinimum", "type": "uint256" }
|
|
98
|
-
],
|
|
99
|
-
"name": "params",
|
|
100
|
-
"type": "tuple"
|
|
101
|
-
}],
|
|
102
|
-
"name": "exactInput",
|
|
103
|
-
"outputs": [{ "name": "amountOut", "type": "uint256" }],
|
|
104
|
-
"stateMutability": "payable",
|
|
105
|
-
"type": "function"
|
|
106
|
-
},
|
|
107
|
-
// multicall - 带 deadline 版本
|
|
108
|
-
'function multicall(uint256 deadline, bytes[] calldata data) external payable returns (bytes[] memory results)',
|
|
109
|
-
'function refundETH() external payable',
|
|
110
|
-
'function unwrapWETH9(uint256 amountMinimum, address recipient) external payable',
|
|
111
|
-
];
|
|
112
|
-
/** V3 SwapRouter 旧版 ABI(deadline 在 struct 内部) */
|
|
113
|
-
export const V3_ROUTER_LEGACY_ABI = [
|
|
114
|
-
// exactInputSingle - 包含 deadline
|
|
115
|
-
{
|
|
116
|
-
"inputs": [{
|
|
117
|
-
"components": [
|
|
118
|
-
{ "name": "tokenIn", "type": "address" },
|
|
119
|
-
{ "name": "tokenOut", "type": "address" },
|
|
120
|
-
{ "name": "fee", "type": "uint24" },
|
|
121
|
-
{ "name": "recipient", "type": "address" },
|
|
122
|
-
{ "name": "deadline", "type": "uint256" },
|
|
123
|
-
{ "name": "amountIn", "type": "uint256" },
|
|
124
|
-
{ "name": "amountOutMinimum", "type": "uint256" },
|
|
125
|
-
{ "name": "sqrtPriceLimitX96", "type": "uint160" }
|
|
126
|
-
],
|
|
127
|
-
"name": "params",
|
|
128
|
-
"type": "tuple"
|
|
129
|
-
}],
|
|
130
|
-
"name": "exactInputSingle",
|
|
131
|
-
"outputs": [{ "name": "amountOut", "type": "uint256" }],
|
|
132
|
-
"stateMutability": "payable",
|
|
133
|
-
"type": "function"
|
|
134
|
-
},
|
|
135
|
-
// multicall - 不带 deadline 版本
|
|
136
|
-
'function multicall(bytes[] calldata data) external payable returns (bytes[] memory results)',
|
|
137
|
-
'function refundETH() external payable',
|
|
138
|
-
'function unwrapWETH9(uint256 amountMinimum, address recipient) external payable',
|
|
139
|
-
];
|
|
140
|
-
// ============================================================================
|
|
141
|
-
// SwapRouter02 V2 方法 ABI (PotatoSwap/DYORSwap 等)
|
|
142
|
-
// ============================================================================
|
|
143
|
-
/**
|
|
144
|
-
* SwapRouter02 的 V2 方法 ABI
|
|
145
|
-
*
|
|
146
|
-
* 注意:SwapRouter02 的 V2 方法只有 token-to-token 交换
|
|
147
|
-
* 没有 swapExactETHForTokens / swapExactTokensForETH
|
|
148
|
-
* 必须通过 multicall 组合 wrapETH/unwrapWETH9 来处理原生代币
|
|
149
|
-
*/
|
|
150
|
-
export const SWAP_ROUTER02_V2_ABI = [
|
|
151
|
-
// V2 交换方法(只有 token-to-token)
|
|
152
|
-
'function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to) external payable returns (uint256 amountOut)',
|
|
153
|
-
'function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] calldata path, address to) external payable returns (uint256 amountIn)',
|
|
154
|
-
// Multicall - 多种重载
|
|
155
|
-
'function multicall(uint256 deadline, bytes[] calldata data) external payable returns (bytes[] memory results)',
|
|
156
|
-
'function multicall(bytes32 previousBlockhash, bytes[] calldata data) external payable returns (bytes[] memory results)',
|
|
157
|
-
'function multicall(bytes[] calldata data) external payable returns (bytes[] memory results)',
|
|
158
|
-
// 辅助方法 - ETH/WETH 转换
|
|
159
|
-
'function wrapETH(uint256 value) external payable',
|
|
160
|
-
'function unwrapWETH9(uint256 amountMinimum, address recipient) external payable',
|
|
161
|
-
'function unwrapWETH9(uint256 amountMinimum) external payable',
|
|
162
|
-
'function refundETH() external payable',
|
|
163
|
-
// 代币操作
|
|
164
|
-
'function pull(address token, uint256 value) external payable',
|
|
165
|
-
'function sweepToken(address token, uint256 amountMinimum, address recipient) external payable',
|
|
166
|
-
'function sweepToken(address token, uint256 amountMinimum) external payable',
|
|
167
|
-
];
|
|
168
|
-
// ============================================================================
|
|
169
|
-
// V3 Quoter ABI
|
|
170
|
-
// ============================================================================
|
|
171
|
-
/** V3 QuoterV2 ABI */
|
|
172
|
-
export const V3_QUOTER_ABI = [
|
|
173
|
-
{
|
|
174
|
-
"inputs": [{
|
|
175
|
-
"components": [
|
|
176
|
-
{ "name": "tokenIn", "type": "address" },
|
|
177
|
-
{ "name": "tokenOut", "type": "address" },
|
|
178
|
-
{ "name": "amountIn", "type": "uint256" },
|
|
179
|
-
{ "name": "fee", "type": "uint24" },
|
|
180
|
-
{ "name": "sqrtPriceLimitX96", "type": "uint160" }
|
|
181
|
-
],
|
|
182
|
-
"name": "params",
|
|
183
|
-
"type": "tuple"
|
|
184
|
-
}],
|
|
185
|
-
"name": "quoteExactInputSingle",
|
|
186
|
-
"outputs": [
|
|
187
|
-
{ "name": "amountOut", "type": "uint256" },
|
|
188
|
-
{ "name": "sqrtPriceX96After", "type": "uint160" },
|
|
189
|
-
{ "name": "initializedTicksCrossed", "type": "uint32" },
|
|
190
|
-
{ "name": "gasEstimate", "type": "uint256" }
|
|
191
|
-
],
|
|
192
|
-
"stateMutability": "nonpayable",
|
|
193
|
-
"type": "function"
|
|
194
|
-
}
|
|
195
|
-
];
|
|
196
|
-
// ============================================================================
|
|
197
|
-
// Uniswap V2 Factory & Pair ABI
|
|
198
|
-
// ============================================================================
|
|
199
|
-
export const V2_FACTORY_ABI = [
|
|
200
|
-
'function getPair(address tokenA, address tokenB) external view returns (address pair)',
|
|
201
|
-
];
|
|
202
|
-
export const V2_PAIR_ABI = [
|
|
203
|
-
'function token0() external view returns (address)',
|
|
204
|
-
'function token1() external view returns (address)',
|
|
205
|
-
'function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)',
|
|
206
|
-
];
|
|
207
|
-
// ============================================================================
|
|
208
|
-
// Uniswap V3 Factory & Pool ABI
|
|
209
|
-
// ============================================================================
|
|
210
|
-
export const V3_FACTORY_ABI = [
|
|
211
|
-
'function getPool(address tokenA, address tokenB, uint24 fee) external view returns (address pool)',
|
|
212
|
-
];
|
|
213
|
-
export const V3_POOL_ABI = [
|
|
214
|
-
'function token0() external view returns (address)',
|
|
215
|
-
'function token1() external view returns (address)',
|
|
216
|
-
'function fee() external view returns (uint24)',
|
|
217
|
-
'function slot0() external view returns (uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)',
|
|
218
|
-
];
|
|
219
|
-
// ============================================================================
|
|
220
|
-
// Flap Portal ABI
|
|
221
|
-
// ============================================================================
|
|
222
|
-
export const FLAP_PORTAL_ABI = [
|
|
223
|
-
// 创建代币
|
|
224
|
-
'function newToken(string name, string symbol, string meta) external payable returns (address)',
|
|
225
|
-
'function newTokenV2((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint16 taxRate,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData)) external payable returns (address)',
|
|
226
|
-
'function newTokenV3((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint16 taxRate,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData)) external payable returns (address)',
|
|
227
|
-
// ✅ V4:支持 dexId / lpFeeProfile(与 portal-bundle-merkle/core.ts 的 newTokenV4.populateTransaction 对齐)
|
|
228
|
-
'function newTokenV4((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint16 taxRate,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData,uint8 dexId,uint8 lpFeeProfile)) external payable returns (address)',
|
|
229
|
-
// ✅ V5:Tax Token V2 高级税收分配
|
|
230
|
-
'function newTokenV5((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint16 taxRate,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData,uint8 dexId,uint8 lpFeeProfile,uint64 taxDuration,uint64 antiFarmerDuration,uint16 mktBps,uint16 deflationBps,uint16 dividendBps,uint16 lpBps,uint256 minimumShareBalance)) external payable returns (address)',
|
|
231
|
-
// 交易
|
|
232
|
-
'function swapExactInput((address inputToken,address outputToken,uint256 inputAmount,uint256 minOutputAmount,bytes permitData)) external payable returns (uint256)',
|
|
233
|
-
// ✅ V3:支持 extensionData(注意:这里的 V3 指“扩展交易接口版本”,不是“外盘 V3 池子”)
|
|
234
|
-
'function swapExactInputV3((address inputToken,address outputToken,uint256 inputAmount,uint256 minOutputAmount,bytes permitData,bytes extensionData)) external payable returns (uint256)',
|
|
235
|
-
'function quoteExactInput((address inputToken,address outputToken,uint256 inputAmount)) external view returns (uint256)',
|
|
236
|
-
// 旧版兼容
|
|
237
|
-
'function buy(address token, uint256 minReceived) external payable returns (uint256)',
|
|
238
|
-
'function sell(address token, uint256 sellAmount, uint256 minReceived) external returns (uint256)',
|
|
239
|
-
];
|
|
240
|
-
// ============================================================================
|
|
241
|
-
// Four TokenManager ABI
|
|
242
|
-
// ============================================================================
|
|
243
|
-
export const TM2_ABI = [
|
|
244
|
-
// 新版方法(Four.meme TokenManager2)
|
|
245
|
-
'function buyTokenAMAP(uint256 origin, address token, address to, uint256 funds, uint256 minAmount) external payable',
|
|
246
|
-
'function sellToken(uint256 origin, address token, uint256 amount, uint256 minFunds) external',
|
|
247
|
-
// 旧版兼容方法
|
|
248
|
-
'function buy(address token, uint256 minReceived) external payable returns (uint256)',
|
|
249
|
-
'function sell(address token, uint256 sellAmount, uint256 minReceived) external returns (uint256)',
|
|
250
|
-
'function trySell(address token, uint256 sellAmount) external view returns (uint256)',
|
|
251
|
-
];
|
|
252
|
-
export const HELPER3_ABI = [
|
|
253
|
-
'function getTokenInfo(address token) external view returns (tuple(address addr, string name, string symbol, uint8 decimals, uint256 totalSupply, uint256 balance, uint256 price, uint256 marketCap))',
|
|
254
|
-
];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated 请从 'four-flap-meme-sdk' 或 'src/abis/' 导入 ABI
|
|
3
|
-
*
|
|
4
|
-
* 此文件保留为向后兼容的重新导出层。
|
|
5
|
-
* ABI 已统一迁移至 src/abis/。
|
|
6
|
-
*/
|
|
7
|
-
export { TokenManager, TokenManager2, TokenManagerHelper3, TaxToken, } from '../../abis/contracts/index.js';
|
|
8
|
-
export * from '../../abis/common.js';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated 请从 'four-flap-meme-sdk' 或 'src/abis/' 导入 ABI
|
|
3
|
-
*
|
|
4
|
-
* 此文件保留为向后兼容的重新导出层。
|
|
5
|
-
* ABI 已统一迁移至 src/abis/。
|
|
6
|
-
*/
|
|
7
|
-
export { TokenManager, TokenManager2, TokenManagerHelper3, TaxToken, } from '../../abis/contracts/index.js';
|
|
8
|
-
export * from '../../abis/common.js';
|
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BlockRazor Bundle Service 客户端
|
|
3
|
-
*
|
|
4
|
-
* 提供基于 BlockRazor 的 MEV 保护和捆绑交易服务
|
|
5
|
-
*
|
|
6
|
-
* 官方文档: https://blockrazor.gitbook.io/blockrazor/bsc/block-builder/send-bundle
|
|
7
|
-
*
|
|
8
|
-
* 特点:
|
|
9
|
-
* - 支持 BSC 链的 Bundle 提交
|
|
10
|
-
* - 激励机制:向 Builder EOA 转账 BNB 可提高优先级
|
|
11
|
-
* - 支持 Bundle 合并提高打包率
|
|
12
|
-
*
|
|
13
|
-
* 使用示例:
|
|
14
|
-
* ```typescript
|
|
15
|
-
* import { BlockRazorClient } from 'four-flap-meme-sdk';
|
|
16
|
-
*
|
|
17
|
-
* const client = new BlockRazorClient({
|
|
18
|
-
* apiKey: 'your-api-key',
|
|
19
|
-
* chainId: 56
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* const result = await client.sendBundle({
|
|
23
|
-
* transactions: [tx1, tx2, tx3],
|
|
24
|
-
* blockOffset: 10
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
import { JsonRpcProvider, Wallet, TransactionLike, ethers } from 'ethers';
|
|
29
|
-
/**
|
|
30
|
-
* BlockRazor Builder EOA 地址
|
|
31
|
-
* 向此地址转账 BNB 可提高 Bundle 优先级
|
|
32
|
-
* 来源: https://blockrazor.gitbook.io/blockrazor/bsc/block-builder/send-bundle
|
|
33
|
-
*/
|
|
34
|
-
export declare const BLOCKRAZOR_BUILDER_EOA = "0x1266C6bE60392A8Ff346E8d5ECCd3E69dD9c5F20";
|
|
35
|
-
/**
|
|
36
|
-
* BlockRazor 客户端配置
|
|
37
|
-
*/
|
|
38
|
-
export interface BlockRazorConfig {
|
|
39
|
-
/** API Key(可选,根据 Tier 等级需要) */
|
|
40
|
-
apiKey?: string;
|
|
41
|
-
/** 链 ID: 56=BSC */
|
|
42
|
-
chainId: 56;
|
|
43
|
-
/** 自定义 RPC URL(可选) */
|
|
44
|
-
customRpcUrl?: string;
|
|
45
|
-
/** 自定义 Builder RPC URL(可选,用于发送 Bundle) */
|
|
46
|
-
builderRpcUrl?: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* BlockRazor Bundle 参数(原始格式)
|
|
50
|
-
* 参考: https://blockrazor.gitbook.io/blockrazor/bsc/block-builder/send-bundle
|
|
51
|
-
*/
|
|
52
|
-
export interface BlockRazorBundleParams {
|
|
53
|
-
/** 已签名的交易数组(原始交易字符串) */
|
|
54
|
-
txs: string[];
|
|
55
|
-
/** 最大有效区块号(默认: 当前区块 + 100) */
|
|
56
|
-
maxBlockNumber?: number;
|
|
57
|
-
/** 最小有效时间戳(秒) */
|
|
58
|
-
minTimestamp?: number;
|
|
59
|
-
/** 最大有效时间戳(秒) */
|
|
60
|
-
maxTimestamp?: number;
|
|
61
|
-
/** 允许 revert 的交易哈希列表 */
|
|
62
|
-
revertingTxHashes?: string[];
|
|
63
|
-
/** 是否禁止 Bundle 合并(默认 false,允许合并可提高打包率) */
|
|
64
|
-
noMerge?: boolean;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* 发送 Bundle 的选项(高级接口)
|
|
68
|
-
*/
|
|
69
|
-
export interface SendBundleOptions {
|
|
70
|
-
/** 已签名的交易数组 */
|
|
71
|
-
transactions: string[];
|
|
72
|
-
/** 区块偏移量(默认 10,即当前区块 + 10) */
|
|
73
|
-
blockOffset?: number;
|
|
74
|
-
/** 最大区块偏移量(默认 100) */
|
|
75
|
-
maxBlockOffset?: number;
|
|
76
|
-
/** 最小时间戳 */
|
|
77
|
-
minTimestamp?: number;
|
|
78
|
-
/** 最大时间戳 */
|
|
79
|
-
maxTimestamp?: number;
|
|
80
|
-
/** 允许 revert 的交易哈希列表 */
|
|
81
|
-
revertingTxHashes?: string[];
|
|
82
|
-
/** 是否禁止 Bundle 合并 */
|
|
83
|
-
noMerge?: boolean;
|
|
84
|
-
/** 是否启用自动重试(默认 false) */
|
|
85
|
-
autoRetry?: boolean;
|
|
86
|
-
/** 最大重试次数(默认 3) */
|
|
87
|
-
maxRetries?: number;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Bundle 发送结果
|
|
91
|
-
*/
|
|
92
|
-
export interface BundleResult {
|
|
93
|
-
/** Bundle Hash */
|
|
94
|
-
bundleHash: string;
|
|
95
|
-
/** 交易哈希列表 */
|
|
96
|
-
txHashes: string[];
|
|
97
|
-
/** 最大有效区块号 */
|
|
98
|
-
maxBlockNumber: number;
|
|
99
|
-
/** 交易数量 */
|
|
100
|
-
txCount: number;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* 交易确认结果
|
|
104
|
-
*/
|
|
105
|
-
export interface TransactionResult {
|
|
106
|
-
/** 交易索引 */
|
|
107
|
-
index: number;
|
|
108
|
-
/** 交易哈希 */
|
|
109
|
-
hash: string;
|
|
110
|
-
/** 是否成功 */
|
|
111
|
-
success: boolean;
|
|
112
|
-
/** 区块号 */
|
|
113
|
-
blockNumber?: number;
|
|
114
|
-
/** Gas 使用量 */
|
|
115
|
-
gasUsed?: string;
|
|
116
|
-
/** 有效 Gas Price */
|
|
117
|
-
effectiveGasPrice?: string;
|
|
118
|
-
/** Gas 费用(BNB) */
|
|
119
|
-
gasCost?: string;
|
|
120
|
-
/** 错误信息 */
|
|
121
|
-
error?: string;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* 激励交易参数
|
|
125
|
-
*/
|
|
126
|
-
export interface IncentiveTransactionParams {
|
|
127
|
-
/** 发送者钱包 */
|
|
128
|
-
wallet: Wallet;
|
|
129
|
-
/** 激励金额(BNB) */
|
|
130
|
-
amount: string;
|
|
131
|
-
/** Nonce(可选,自动获取) */
|
|
132
|
-
nonce?: number;
|
|
133
|
-
/** Gas Price(可选,自动获取) */
|
|
134
|
-
gasPrice?: bigint;
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* BlockRazor 客户端
|
|
138
|
-
*/
|
|
139
|
-
export declare class BlockRazorClient {
|
|
140
|
-
private provider;
|
|
141
|
-
private chainId;
|
|
142
|
-
private apiKey?;
|
|
143
|
-
private builderUrl;
|
|
144
|
-
private blockNumberCache;
|
|
145
|
-
private static BLOCK_CACHE_TTL_MS;
|
|
146
|
-
constructor(config: BlockRazorConfig);
|
|
147
|
-
/**
|
|
148
|
-
* 获取 Provider
|
|
149
|
-
*/
|
|
150
|
-
getProvider(): JsonRpcProvider;
|
|
151
|
-
/**
|
|
152
|
-
* 获取 Builder URL
|
|
153
|
-
*/
|
|
154
|
-
getBuilderUrl(): string;
|
|
155
|
-
/**
|
|
156
|
-
* 获取当前区块号(带缓存)
|
|
157
|
-
*/
|
|
158
|
-
getBlockNumber(forceRefresh?: boolean): Promise<number>;
|
|
159
|
-
/**
|
|
160
|
-
* 获取 Gas 价格信息
|
|
161
|
-
*/
|
|
162
|
-
getFeeData(): Promise<ethers.FeeData>;
|
|
163
|
-
/**
|
|
164
|
-
* 构建激励交易(向 BlockRazor Builder EOA 转账 BNB)
|
|
165
|
-
*
|
|
166
|
-
* 根据文档:向 Builder EOA 转账更多 BNB 可提高 Bundle 优先级
|
|
167
|
-
*
|
|
168
|
-
* @param params 激励交易参数
|
|
169
|
-
* @returns 已签名的交易
|
|
170
|
-
*/
|
|
171
|
-
buildIncentiveTransaction(params: IncentiveTransactionParams): Promise<string>;
|
|
172
|
-
/**
|
|
173
|
-
* 发送捆绑交易(底层方法)
|
|
174
|
-
*
|
|
175
|
-
* ✅ 使用 fetch 直接发送请求,支持 Authorization 头
|
|
176
|
-
*
|
|
177
|
-
* @param params Bundle 参数
|
|
178
|
-
* @returns Bundle Hash
|
|
179
|
-
*/
|
|
180
|
-
sendBundleRaw(params: BlockRazorBundleParams): Promise<string>;
|
|
181
|
-
/**
|
|
182
|
-
* 发送捆绑交易(高级方法)
|
|
183
|
-
*
|
|
184
|
-
* @param options 发送选项
|
|
185
|
-
* @returns Bundle 结果
|
|
186
|
-
*/
|
|
187
|
-
sendBundle(options: SendBundleOptions): Promise<BundleResult>;
|
|
188
|
-
/**
|
|
189
|
-
* 发送带激励的 Bundle(自动添加激励交易)
|
|
190
|
-
*
|
|
191
|
-
* @param options 发送选项
|
|
192
|
-
* @param incentive 激励参数
|
|
193
|
-
* @returns Bundle 结果
|
|
194
|
-
*/
|
|
195
|
-
sendBundleWithIncentive(options: SendBundleOptions, incentive: {
|
|
196
|
-
wallet: Wallet;
|
|
197
|
-
amount: string;
|
|
198
|
-
}): Promise<BundleResult>;
|
|
199
|
-
/**
|
|
200
|
-
* 等待 Bundle 中的交易确认
|
|
201
|
-
*
|
|
202
|
-
* @param txHashes 交易哈希列表
|
|
203
|
-
* @param confirmations 确认数(默认 1)
|
|
204
|
-
* @param timeout 超时时间(毫秒,默认 120000)
|
|
205
|
-
* @returns 交易结果列表
|
|
206
|
-
*/
|
|
207
|
-
waitForBundleConfirmation(txHashes: string[], confirmations?: number, timeout?: number): Promise<TransactionResult[]>;
|
|
208
|
-
/**
|
|
209
|
-
* 签名交易批次
|
|
210
|
-
*
|
|
211
|
-
* @param wallet 钱包
|
|
212
|
-
* @param transactions 交易列表
|
|
213
|
-
* @param options 可选参数
|
|
214
|
-
* @returns 已签名的交易数组
|
|
215
|
-
*/
|
|
216
|
-
signTransactions(wallet: Wallet, transactions: TransactionLike[], options?: {
|
|
217
|
-
startNonce?: number;
|
|
218
|
-
gasPrice?: bigint;
|
|
219
|
-
gasPriceMultiplier?: number;
|
|
220
|
-
}): Promise<string[]>;
|
|
221
|
-
/**
|
|
222
|
-
* 检查交易是否已包含在区块中
|
|
223
|
-
*/
|
|
224
|
-
isTransactionIncluded(txHash: string): Promise<boolean>;
|
|
225
|
-
/**
|
|
226
|
-
* 并行广播交易(非捆绑)
|
|
227
|
-
*
|
|
228
|
-
* 所有交易同时广播,适合不同钱包的独立交易
|
|
229
|
-
* ⚠️ 注意:同一钱包的多笔交易(连续 nonce)不建议并行广播,可能导致后续交易延迟确认
|
|
230
|
-
*
|
|
231
|
-
* @param signedTransactions 已签名的交易数组
|
|
232
|
-
* @param options 可选配置
|
|
233
|
-
* @returns 广播结果
|
|
234
|
-
*/
|
|
235
|
-
broadcastTransactionsParallel(signedTransactions: string[], options?: {
|
|
236
|
-
/** 自定义 Provider(可选) */
|
|
237
|
-
provider?: JsonRpcProvider;
|
|
238
|
-
/** 并发限制(默认 10) */
|
|
239
|
-
concurrencyLimit?: number;
|
|
240
|
-
}): Promise<{
|
|
241
|
-
success: boolean;
|
|
242
|
-
txHashes: string[];
|
|
243
|
-
errors: Array<{
|
|
244
|
-
index: number;
|
|
245
|
-
error: string;
|
|
246
|
-
}>;
|
|
247
|
-
}>;
|
|
248
|
-
/**
|
|
249
|
-
* 顺序广播交易(非捆绑)
|
|
250
|
-
*
|
|
251
|
-
* 按顺序逐笔广播,可选等待确认后再广播下一笔
|
|
252
|
-
* ✅ 适合同一钱包的多笔交易(连续 nonce),确保交易按顺序上链
|
|
253
|
-
*
|
|
254
|
-
* @param signedTransactions 已签名的交易数组
|
|
255
|
-
* @param options 可选配置
|
|
256
|
-
* @returns 广播结果
|
|
257
|
-
*/
|
|
258
|
-
broadcastTransactionsSequential(signedTransactions: string[], options?: {
|
|
259
|
-
/** 自定义 Provider(可选) */
|
|
260
|
-
provider?: JsonRpcProvider;
|
|
261
|
-
/** 是否等待每笔交易确认后再广播下一笔(默认 false,只等待广播成功) */
|
|
262
|
-
waitConfirmation?: boolean;
|
|
263
|
-
/** 确认超时时间(毫秒,默认 60000) */
|
|
264
|
-
confirmationTimeout?: number;
|
|
265
|
-
/** 广播间隔(毫秒,默认 100) */
|
|
266
|
-
broadcastDelay?: number;
|
|
267
|
-
}): Promise<{
|
|
268
|
-
success: boolean;
|
|
269
|
-
txHashes: string[];
|
|
270
|
-
errors: Array<{
|
|
271
|
-
index: number;
|
|
272
|
-
error: string;
|
|
273
|
-
}>;
|
|
274
|
-
}>;
|
|
275
|
-
/**
|
|
276
|
-
* 智能广播交易(自动选择并行或顺序)
|
|
277
|
-
*
|
|
278
|
-
* 根据交易的发送者地址自动决定广播策略:
|
|
279
|
-
* - 如果所有交易来自不同钱包:并行广播
|
|
280
|
-
* - 如果存在同一钱包的多笔交易:顺序广播
|
|
281
|
-
*
|
|
282
|
-
* @param signedTransactions 已签名的交易数组
|
|
283
|
-
* @param options 可选配置
|
|
284
|
-
* @returns 广播结果
|
|
285
|
-
*/
|
|
286
|
-
broadcastTransactionsSmart(signedTransactions: string[], options?: {
|
|
287
|
-
/** 自定义 Provider(可选) */
|
|
288
|
-
provider?: JsonRpcProvider;
|
|
289
|
-
/** 是否等待确认(顺序模式时生效,默认 false) */
|
|
290
|
-
waitConfirmation?: boolean;
|
|
291
|
-
/** 确认超时时间(毫秒,默认 60000) */
|
|
292
|
-
confirmationTimeout?: number;
|
|
293
|
-
}): Promise<{
|
|
294
|
-
success: boolean;
|
|
295
|
-
txHashes: string[];
|
|
296
|
-
errors: Array<{
|
|
297
|
-
index: number;
|
|
298
|
-
error: string;
|
|
299
|
-
}>;
|
|
300
|
-
mode: 'parallel' | 'sequential';
|
|
301
|
-
}>;
|
|
302
|
-
/**
|
|
303
|
-
* 获取客户端信息
|
|
304
|
-
*/
|
|
305
|
-
getClientInfo(): {
|
|
306
|
-
chainId: number;
|
|
307
|
-
builderEOA: string;
|
|
308
|
-
minGasPriceGwei: number;
|
|
309
|
-
};
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* 创建 BlockRazor 客户端的便捷函数
|
|
313
|
-
*/
|
|
314
|
-
export declare function createBlockRazorClient(apiKey?: string): BlockRazorClient;
|