@1llet.xyz/erc4337-gasless-sdk 0.4.49 → 0.4.51

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/index.mjs CHANGED
@@ -399,7 +399,7 @@ var BundlerClient = class {
399
399
  return result.result;
400
400
  }
401
401
  async estimateGas(userOp) {
402
- return await this.call("eth_estimateUserOperationGas", [
402
+ const result = await this.call("eth_estimateUserOperationGas", [
403
403
  {
404
404
  sender: userOp.sender,
405
405
  nonce: userOp.nonce ? "0x" + userOp.nonce.toString(16) : "0x0",
@@ -410,6 +410,14 @@ var BundlerClient = class {
410
410
  },
411
411
  this.entryPointAddress
412
412
  ]);
413
+ return {
414
+ callGasLimit: result.callGasLimit,
415
+ verificationGasLimit: result.verificationGasLimit,
416
+ preVerificationGas: result.preVerificationGas,
417
+ maxFeePerGas: result.maxFeePerGas,
418
+ maxPriorityFeePerGas: result.maxPriorityFeePerGas,
419
+ paymasterAndData: result.paymasterAndData
420
+ };
413
421
  }
414
422
  async sendUserOperation(userOp) {
415
423
  return await this.call("eth_sendUserOperation", [
@@ -584,6 +592,7 @@ var UserOpBuilder = class {
584
592
  preVerificationGas: BigInt(gasEstimate.preVerificationGas),
585
593
  maxFeePerGas: BigInt(gasEstimate.maxFeePerGas),
586
594
  maxPriorityFeePerGas: BigInt(gasEstimate.maxPriorityFeePerGas),
595
+ paymasterAndData: gasEstimate.paymasterAndData || partialOp.paymasterAndData,
587
596
  signature: "0x"
588
597
  };
589
598
  }
@@ -608,6 +617,7 @@ var UserOpBuilder = class {
608
617
  preVerificationGas: BigInt(gasEstimate.preVerificationGas),
609
618
  maxFeePerGas: BigInt(gasEstimate.maxFeePerGas),
610
619
  maxPriorityFeePerGas: BigInt(gasEstimate.maxPriorityFeePerGas),
620
+ paymasterAndData: gasEstimate.paymasterAndData || partialOp.paymasterAndData,
611
621
  signature: "0x"
612
622
  };
613
623
  }
@@ -1971,7 +1981,7 @@ async function executeCCTPBridge(sourceChain, amount, crossChainConfig, facilita
1971
1981
  const amountBigInt = BigInt(Math.floor(parseFloat(amount) * 1e6));
1972
1982
  const feeRaw = calculateFee();
1973
1983
  const fee = BigInt(Math.floor(feeRaw * 1e6));
1974
- const minRequired = fee * BigInt(2);
1984
+ const minRequired = fee;
1975
1985
  if (amountBigInt <= minRequired) {
1976
1986
  return {
1977
1987
  success: false,
@@ -2027,8 +2037,8 @@ async function executeCCTPBridge(sourceChain, amount, crossChainConfig, facilita
2027
2037
  abi: tokenMessengerAbi,
2028
2038
  functionName: "depositForBurn",
2029
2039
  args: [
2030
- amountBigInt - fee * BigInt(2),
2031
- // Deduct 0.02 USDC Fee (2x Base Fee)
2040
+ amountBigInt - fee,
2041
+ // Deduct 0.02 USDC Fee
2032
2042
  crossChainConfig.destinationDomain,
2033
2043
  mintRecipient,
2034
2044
  networkConfig.usdc,