four-flap-meme-sdk 1.5.60 → 1.5.61
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/xlayer/dex.js +9 -6
- package/package.json +1 -1
package/dist/xlayer/dex.js
CHANGED
|
@@ -249,10 +249,11 @@ export class DexExecutor {
|
|
|
249
249
|
});
|
|
250
250
|
// 执行 handleOps
|
|
251
251
|
const provider = this.aaManager.getProvider();
|
|
252
|
-
const
|
|
252
|
+
const entryPointAddress = this.aaManager.getEntryPointAddress(); // ✅ 直接使用地址,避免 ENS
|
|
253
253
|
const feeData = await provider.getFeeData();
|
|
254
254
|
// 使用新 Contract 实例避免 TypeScript 类型问题
|
|
255
|
-
const entryPointWithSigner = new Contract(
|
|
255
|
+
const entryPointWithSigner = new Contract(entryPointAddress, // ✅ 直接使用地址字符串,避免 getAddress() 触发 ENS
|
|
256
|
+
['function handleOps((address sender,uint256 nonce,bytes initCode,bytes callData,uint256 callGasLimit,uint256 verificationGasLimit,uint256 preVerificationGas,uint256 maxFeePerGas,uint256 maxPriorityFeePerGas,bytes paymasterAndData,bytes signature)[] ops, address payable beneficiary) external'], wallet);
|
|
256
257
|
const tx = await entryPointWithSigner.handleOps([signedOp.userOp], wallet.address, { gasPrice: feeData.gasPrice ?? 100000000n });
|
|
257
258
|
const receipt = await tx.wait();
|
|
258
259
|
return {
|
|
@@ -270,7 +271,7 @@ export class DexExecutor {
|
|
|
270
271
|
const wallet = createWallet(privateKey, this.config);
|
|
271
272
|
const accountInfo = await this.aaManager.getAccountInfo(wallet.address);
|
|
272
273
|
const provider = this.aaManager.getProvider();
|
|
273
|
-
const
|
|
274
|
+
const entryPointAddress = this.aaManager.getEntryPointAddress(); // ✅ 直接使用地址,避免 ENS
|
|
274
275
|
const feeData = await provider.getFeeData();
|
|
275
276
|
const path = [tokenAddress, this.wokb];
|
|
276
277
|
const deadline = this.getDeadline();
|
|
@@ -307,7 +308,8 @@ export class DexExecutor {
|
|
|
307
308
|
const signedSwap = await this.aaManager.signUserOp(swapOp.userOp, wallet);
|
|
308
309
|
ops.push(signedSwap.userOp);
|
|
309
310
|
// 执行(使用新 Contract 实例避免 TypeScript 类型问题)
|
|
310
|
-
const entryPointWithSigner = new Contract(
|
|
311
|
+
const entryPointWithSigner = new Contract(entryPointAddress, // ✅ 直接使用地址字符串,避免 getAddress() 触发 ENS
|
|
312
|
+
['function handleOps((address sender,uint256 nonce,bytes initCode,bytes callData,uint256 callGasLimit,uint256 verificationGasLimit,uint256 preVerificationGas,uint256 maxFeePerGas,uint256 maxPriorityFeePerGas,bytes paymasterAndData,bytes signature)[] ops, address payable beneficiary) external'], wallet);
|
|
311
313
|
const tx = await entryPointWithSigner.handleOps(ops, wallet.address, { gasPrice: feeData.gasPrice ?? 100000000n });
|
|
312
314
|
const receipt = await tx.wait();
|
|
313
315
|
return {
|
|
@@ -326,7 +328,7 @@ export class DexExecutor {
|
|
|
326
328
|
const wallet = createWallet(privateKey, this.config);
|
|
327
329
|
const accountInfo = await this.aaManager.getAccountInfo(wallet.address);
|
|
328
330
|
const provider = this.aaManager.getProvider();
|
|
329
|
-
const
|
|
331
|
+
const entryPointAddress = this.aaManager.getEntryPointAddress(); // ✅ 直接使用地址,避免 ENS
|
|
330
332
|
const feeData = await provider.getFeeData();
|
|
331
333
|
const token = new Contract(quoteTokenAddress, ERC20_ABI, provider);
|
|
332
334
|
const allowance = await token.allowance(accountInfo.sender, this.routerAddress);
|
|
@@ -358,7 +360,8 @@ export class DexExecutor {
|
|
|
358
360
|
});
|
|
359
361
|
const signedSwap = await this.aaManager.signUserOp(swapOp.userOp, wallet);
|
|
360
362
|
ops.push(signedSwap.userOp);
|
|
361
|
-
const entryPointWithSigner = new Contract(
|
|
363
|
+
const entryPointWithSigner = new Contract(entryPointAddress, // ✅ 直接使用地址字符串,避免 getAddress() 触发 ENS
|
|
364
|
+
['function handleOps((address sender,uint256 nonce,bytes initCode,bytes callData,uint256 callGasLimit,uint256 verificationGasLimit,uint256 preVerificationGas,uint256 maxFeePerGas,uint256 maxPriorityFeePerGas,bytes paymasterAndData,bytes signature)[] ops, address payable beneficiary) external'], wallet);
|
|
362
365
|
const tx = await entryPointWithSigner.handleOps(ops, wallet.address, { gasPrice: feeData.gasPrice ?? 100000000n });
|
|
363
366
|
const receipt = await tx.wait();
|
|
364
367
|
return {
|