four-flap-meme-sdk 1.6.99 → 1.7.1
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.
|
@@ -9,16 +9,19 @@
|
|
|
9
9
|
import { ethers, Contract, Wallet } from 'ethers';
|
|
10
10
|
import { calculateSellAmount } from '../utils/swap-helpers.js';
|
|
11
11
|
import { NonceManager, getDeadline, buildProfitHopTransactions, PROFIT_HOP_COUNT } from '../utils/bundle-helpers.js';
|
|
12
|
-
import {
|
|
12
|
+
import { PROFIT_CONFIG, BLOCKRAZOR_BUILDER_EOA } from '../utils/constants.js';
|
|
13
13
|
import { quoteV2, quoteV3 } from '../utils/quote-helpers.js';
|
|
14
14
|
import { V2_ROUTER_ABI, V3_ROUTER02_ABI } from '../abis/common.js';
|
|
15
15
|
import { generateWallets } from '../utils/wallet.js';
|
|
16
|
+
// ✅ 从 XLayer 常量导入正确的路由地址
|
|
17
|
+
import { POTATOSWAP_V2_ROUTER, POTATOSWAP_SWAP_ROUTER02, WOKB as WOKB_CONST } from './constants.js';
|
|
16
18
|
// ==================== XLayer 专用常量 ====================
|
|
17
19
|
const XLAYER_CHAIN_ID = 196;
|
|
18
20
|
const XLAYER_CHAIN_NAME = 'XLAYER';
|
|
19
|
-
const WOKB_ADDRESS =
|
|
20
|
-
|
|
21
|
-
const
|
|
21
|
+
const WOKB_ADDRESS = ethers.getAddress(WOKB_CONST);
|
|
22
|
+
// ✅ 强制校验和,避免大小写错误导致的 bad address checksum
|
|
23
|
+
const POTATO_V2_ROUTER = ethers.getAddress(POTATOSWAP_V2_ROUTER);
|
|
24
|
+
const POTATO_V3_ROUTER = ethers.getAddress(POTATOSWAP_SWAP_ROUTER02); // ✅ SwapRouter02 用于 V3 交易
|
|
22
25
|
const NATIVE_TRANSFER_GAS_LIMIT = 21055n;
|
|
23
26
|
const ERC20_TRANSFER_GAS_LIMIT = 65000n;
|
|
24
27
|
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
|