four-flap-meme-sdk 1.1.89 → 1.1.90
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.
|
@@ -8,7 +8,7 @@ export const PORTAL_ABI = [
|
|
|
8
8
|
'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)',
|
|
9
9
|
'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)',
|
|
10
10
|
'function swapExactInput((address inputToken,address outputToken,uint256 inputAmount,uint256 minOutputAmount,bytes permitData)) external payable returns (uint256)',
|
|
11
|
-
'function quoteExactInput((address inputToken,address outputToken,uint256 inputAmount)) external returns (uint256)'
|
|
11
|
+
'function quoteExactInput((address inputToken,address outputToken,uint256 inputAmount)) external view returns (uint256)'
|
|
12
12
|
];
|
|
13
13
|
// 错误信息国际化
|
|
14
14
|
export const ERRORS = {
|
|
@@ -284,7 +284,8 @@ export async function batchSellWithBundleMerkle(params) {
|
|
|
284
284
|
// 并行获取所有报价
|
|
285
285
|
const quotedOutputs = await Promise.all(amountsWei.map(async (amount, index) => {
|
|
286
286
|
try {
|
|
287
|
-
|
|
287
|
+
// ✅ 使用 staticCall 调用 view 函数
|
|
288
|
+
const quoted = await portal.quoteExactInput.staticCall({
|
|
288
289
|
inputToken: tokenAddress,
|
|
289
290
|
outputToken: '0x0000000000000000000000000000000000000000',
|
|
290
291
|
inputAmount: amount
|
|
@@ -104,7 +104,8 @@ export async function flapPrivateSellMerkle(params) {
|
|
|
104
104
|
else {
|
|
105
105
|
// 自动获取报价
|
|
106
106
|
try {
|
|
107
|
-
|
|
107
|
+
// ✅ 使用 staticCall 调用 view 函数
|
|
108
|
+
quotedOutput = await portal.quoteExactInput.staticCall({
|
|
108
109
|
inputToken: tokenAddress,
|
|
109
110
|
outputToken: '0x0000000000000000000000000000000000000000',
|
|
110
111
|
inputAmount: amountWei
|
|
@@ -264,7 +265,9 @@ export async function flapBatchPrivateSellMerkle(params) {
|
|
|
264
265
|
// ✅ 自动获取报价以计算预期收益和利润
|
|
265
266
|
const portal = new ethers.Contract(portalAddr, PORTAL_ABI, provider);
|
|
266
267
|
// 并行获取所有报价
|
|
267
|
-
const quotedOutputs = await Promise.all(amountsWei.map(amount =>
|
|
268
|
+
const quotedOutputs = await Promise.all(amountsWei.map(amount =>
|
|
269
|
+
// ✅ 使用 staticCall 调用 view 函数
|
|
270
|
+
portal.quoteExactInput.staticCall({
|
|
268
271
|
inputToken: tokenAddress,
|
|
269
272
|
outputToken: '0x0000000000000000000000000000000000000000',
|
|
270
273
|
inputAmount: amount
|