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,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,
|
|
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';
|