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,73 +0,0 @@
|
|
|
1
|
-
import type { CommonBundleConfig } from '../../../../utils/bundle-helpers.js';
|
|
2
|
-
export interface PancakeBuyFirstSignConfig {
|
|
3
|
-
rpcUrl: string;
|
|
4
|
-
gasLimit?: number | bigint;
|
|
5
|
-
gasLimitMultiplier?: number;
|
|
6
|
-
minGasPriceGwei?: number;
|
|
7
|
-
maxGasPriceGwei?: number;
|
|
8
|
-
txType?: 0 | 2;
|
|
9
|
-
chainId?: number;
|
|
10
|
-
reserveGasBNB?: number;
|
|
11
|
-
skipQuoteOnError?: boolean;
|
|
12
|
-
userType?: UserType;
|
|
13
|
-
bribeAmount?: number;
|
|
14
|
-
v2RouterAddress?: string;
|
|
15
|
-
}
|
|
16
|
-
export type UserType = 'v0' | 'v1';
|
|
17
|
-
export type SwapRouteType = 'v2' | 'v3-single' | 'v3-multi';
|
|
18
|
-
export interface V2RouteParams {
|
|
19
|
-
routeType: 'v2';
|
|
20
|
-
v2Path: string[];
|
|
21
|
-
}
|
|
22
|
-
export interface V3SingleRouteParams {
|
|
23
|
-
routeType: 'v3-single';
|
|
24
|
-
v3TokenIn: string;
|
|
25
|
-
v3TokenOut: string;
|
|
26
|
-
v3Fee: number;
|
|
27
|
-
v2Path?: string[];
|
|
28
|
-
}
|
|
29
|
-
export interface V3MultiRouteParams {
|
|
30
|
-
routeType: 'v3-multi';
|
|
31
|
-
v3LpAddresses: string[];
|
|
32
|
-
v3ExactTokenIn: string;
|
|
33
|
-
v2Path?: string[];
|
|
34
|
-
}
|
|
35
|
-
export type RouteParams = V2RouteParams | V3SingleRouteParams | V3MultiRouteParams;
|
|
36
|
-
export interface PancakeBuyFirstConfig extends CommonBundleConfig {
|
|
37
|
-
apiKey: string;
|
|
38
|
-
customRpcUrl?: string;
|
|
39
|
-
bundleBlockOffset?: number;
|
|
40
|
-
reserveGasBNB?: number;
|
|
41
|
-
waitForConfirmation?: boolean;
|
|
42
|
-
waitTimeoutMs?: number;
|
|
43
|
-
}
|
|
44
|
-
export interface PancakeBundleBuyFirstSignParams {
|
|
45
|
-
buyerPrivateKey?: string;
|
|
46
|
-
buyerPrivateKeys?: string[];
|
|
47
|
-
sellerPrivateKey?: string;
|
|
48
|
-
sellerPrivateKeys?: string[];
|
|
49
|
-
tokenAddress: string;
|
|
50
|
-
routeParams: RouteParams;
|
|
51
|
-
buyerFunds?: string;
|
|
52
|
-
buyerFundsPercentage?: number;
|
|
53
|
-
config: PancakeBuyFirstSignConfig;
|
|
54
|
-
quoteToken?: string;
|
|
55
|
-
quoteTokenDecimals?: number;
|
|
56
|
-
startNonces?: number[];
|
|
57
|
-
buyCount?: number;
|
|
58
|
-
sellCount?: number;
|
|
59
|
-
taxRateBps?: number;
|
|
60
|
-
}
|
|
61
|
-
export interface PancakeBundleBuyFirstParams {
|
|
62
|
-
buyerPrivateKey: string;
|
|
63
|
-
sellerPrivateKey: string;
|
|
64
|
-
tokenAddress: string;
|
|
65
|
-
routeParams: RouteParams;
|
|
66
|
-
buyerFunds?: string;
|
|
67
|
-
buyerFundsPercentage?: number;
|
|
68
|
-
config: PancakeBuyFirstConfig;
|
|
69
|
-
}
|
|
70
|
-
/** ✅ Pancake BuyFirst 结果(简化版) */
|
|
71
|
-
export type PancakeBuyFirstResult = {
|
|
72
|
-
signedTransactions: string[];
|
|
73
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { ethers, Wallet, JsonRpcProvider } from 'ethers';
|
|
2
|
-
import { NonceManager } from '../../../../utils/bundle-helpers.js';
|
|
3
|
-
import { type GeneratedWallet } from '../../../../utils/wallet.js';
|
|
4
|
-
import type { PancakeSwapSignConfig, PancakeSwapConfig, PancakeContext, RouteParams, UserType, QuoteBNBResult, SwapUnsignedResult, BuyerBudget, NoncePlan } from './types.js';
|
|
5
|
-
type DisperseHopPath = {
|
|
6
|
-
targetAddress: string;
|
|
7
|
-
hopWallets: Wallet[];
|
|
8
|
-
hopWalletsInfo: GeneratedWallet[];
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* 生成分发多跳路径
|
|
12
|
-
*/
|
|
13
|
-
export declare function generateDisperseHopPaths(targetAddresses: string[], hopCount: number, provider: JsonRpcProvider): DisperseHopPath[];
|
|
14
|
-
/**
|
|
15
|
-
* 构建原生代币多跳转账链
|
|
16
|
-
*/
|
|
17
|
-
export declare function buildNativeHopChain(payer: Wallet, path: DisperseHopPath, finalAmount: bigint, gasPrice: bigint, chainId: number, txType: 0 | 2, payerNonce: number): Promise<string[]>;
|
|
18
|
-
/**
|
|
19
|
-
* 构建 ERC20 多跳转账链(需要配合 BNB 多跳使用)
|
|
20
|
-
*/
|
|
21
|
-
export declare function buildERC20HopChain(payer: Wallet, path: DisperseHopPath, erc20Address: string, erc20Amount: bigint, gasPrice: bigint, chainId: number, txType: 0 | 2, payerNonce: number): Promise<string[]>;
|
|
22
|
-
/**
|
|
23
|
-
* 构建 BNB 多跳转账链(为 ERC20 中间钱包预留 gas)
|
|
24
|
-
*/
|
|
25
|
-
export declare function buildBNBHopChainForERC20(payer: Wallet, path: DisperseHopPath, finalGasAmount: bigint, gasPrice: bigint, chainId: number, txType: 0 | 2, payerNonce: number): Promise<string[]>;
|
|
26
|
-
export declare function createPancakeContext(config: PancakeSwapSignConfig): PancakeContext;
|
|
27
|
-
type QuoteSellParams = {
|
|
28
|
-
routeParams: RouteParams;
|
|
29
|
-
sellAmountWei: bigint;
|
|
30
|
-
provider: ethers.JsonRpcProvider;
|
|
31
|
-
v2RouterAddress?: string;
|
|
32
|
-
};
|
|
33
|
-
export declare function quoteSellOutput({ routeParams, sellAmountWei, provider, v2RouterAddress }: QuoteSellParams): Promise<QuoteBNBResult>;
|
|
34
|
-
type BuildSwapParams = {
|
|
35
|
-
routeParams: RouteParams;
|
|
36
|
-
sellAmountWei: bigint;
|
|
37
|
-
buyAmountBNB: bigint;
|
|
38
|
-
buyer: Wallet;
|
|
39
|
-
seller: Wallet;
|
|
40
|
-
tokenAddress: string;
|
|
41
|
-
useNativeToken?: boolean;
|
|
42
|
-
v2RouterAddress?: string;
|
|
43
|
-
};
|
|
44
|
-
export declare function buildSwapTransactions({ routeParams, sellAmountWei, buyAmountBNB, buyer, seller, tokenAddress, useNativeToken, v2RouterAddress }: BuildSwapParams): Promise<SwapUnsignedResult>;
|
|
45
|
-
type BuyerBudgetParams = {
|
|
46
|
-
buyer: Wallet;
|
|
47
|
-
quotedBNBOut: bigint;
|
|
48
|
-
reserveGasBNB?: number;
|
|
49
|
-
useNativeToken?: boolean;
|
|
50
|
-
quoteToken?: string;
|
|
51
|
-
quoteTokenDecimals?: number;
|
|
52
|
-
provider?: ethers.JsonRpcProvider;
|
|
53
|
-
};
|
|
54
|
-
export declare function calculateBuyerBudget({ buyer, quotedBNBOut, reserveGasBNB, useNativeToken, quoteToken, quoteTokenDecimals, provider }: BuyerBudgetParams): Promise<BuyerBudget>;
|
|
55
|
-
type PlanNonceParams = {
|
|
56
|
-
seller: Wallet;
|
|
57
|
-
buyer: Wallet;
|
|
58
|
-
sameAddress: boolean;
|
|
59
|
-
approvalExists: boolean;
|
|
60
|
-
profitNeeded: boolean;
|
|
61
|
-
needBribeTx: boolean;
|
|
62
|
-
nonceManager: NonceManager;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* ✅ 从前端传入的 startNonces 构建 NoncePlan(用于性能优化)
|
|
66
|
-
* 顺序:[sellerBaseNonce, buyerNonce]
|
|
67
|
-
*/
|
|
68
|
-
export declare function buildNoncePlanFromNonces(startNonces: number[], sameAddress: boolean, approvalExists: boolean, profitNeeded: boolean, needBribeTx: boolean): NoncePlan;
|
|
69
|
-
/**
|
|
70
|
-
* ✅ 规划 nonce
|
|
71
|
-
* 交易顺序:贿赂 → 授权 → 卖出 → 买入 → 利润
|
|
72
|
-
* 贿赂和利润由卖方发送
|
|
73
|
-
*/
|
|
74
|
-
export declare function planNonces({ seller, buyer, sameAddress, approvalExists, profitNeeded, needBribeTx, nonceManager }: PlanNonceParams): Promise<NoncePlan>;
|
|
75
|
-
/**
|
|
76
|
-
* 根据 userType 计算利润率
|
|
77
|
-
*/
|
|
78
|
-
export declare function getProfitRateBps(userType?: UserType): number;
|
|
79
|
-
export declare function calculateProfitAmount(estimatedBNBOut: bigint, userType?: UserType): bigint;
|
|
80
|
-
/**
|
|
81
|
-
* ✅ 获取 ERC20 代币 → 原生代币(BNB)的报价
|
|
82
|
-
* 用于将 ERC20 利润转换为 BNB
|
|
83
|
-
* 使用共享的报价函数
|
|
84
|
-
*/
|
|
85
|
-
export declare function getERC20ToNativeQuote(provider: ethers.JsonRpcProvider, tokenAddress: string, tokenAmount: bigint, version?: 'v2' | 'v3', fee?: number): Promise<bigint>;
|
|
86
|
-
type BalanceValidationParams = {
|
|
87
|
-
sameAddress: boolean;
|
|
88
|
-
buyerBalance: bigint;
|
|
89
|
-
buyAmountBNB: bigint;
|
|
90
|
-
reserveGas: bigint;
|
|
91
|
-
gasLimit: bigint;
|
|
92
|
-
gasPrice: bigint;
|
|
93
|
-
useNativeToken?: boolean;
|
|
94
|
-
quoteTokenDecimals?: number;
|
|
95
|
-
provider?: ethers.JsonRpcProvider;
|
|
96
|
-
buyerAddress?: string;
|
|
97
|
-
};
|
|
98
|
-
export declare function validateFinalBalances({ sameAddress, buyerBalance, buyAmountBNB, reserveGas, gasLimit, gasPrice, useNativeToken, quoteTokenDecimals, provider, buyerAddress }: BalanceValidationParams): Promise<void>;
|
|
99
|
-
export declare function countTruthy(values: unknown[]): number;
|
|
100
|
-
export declare function getGasLimit(config: PancakeSwapSignConfig | PancakeSwapConfig, defaultGas?: number): bigint;
|
|
101
|
-
export declare function getGasPrice(provider: ethers.JsonRpcProvider, config: PancakeSwapSignConfig | PancakeSwapConfig): Promise<bigint>;
|
|
102
|
-
export {};
|