@lumiapassport/ui-kit 1.15.7 → 1.15.8

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.js CHANGED
@@ -3868,15 +3868,6 @@ async function sendUserOperation(session, callTarget, amountWei, innerData = "0x
3868
3868
  feeType
3869
3869
  );
3870
3870
  }
3871
- const ensureGenerousDefaults = () => {
3872
- const toHex2 = (v) => `0x${v.toString(16)}`;
3873
- const minCallGas = 0x7a120n;
3874
- const minVerificationGas = 0x989680n;
3875
- const minPreVerificationGas = 0x30d40n;
3876
- if (BigInt(userOp.callGasLimit || "0x0") < minCallGas) userOp.callGasLimit = toHex2(minCallGas);
3877
- if (BigInt(userOp.verificationGasLimit || "0x0") < minVerificationGas) userOp.verificationGasLimit = toHex2(minVerificationGas);
3878
- if (BigInt(userOp.preVerificationGas || "0x0") < minPreVerificationGas) userOp.preVerificationGas = toHex2(minPreVerificationGas);
3879
- };
3880
3871
  const enforceCaps = (usePaymaster) => {
3881
3872
  try {
3882
3873
  const envCaps = typeof import.meta !== "undefined" && import.meta.env || {};
@@ -3891,38 +3882,16 @@ async function sendUserOperation(session, callTarget, amountWei, innerData = "0x
3891
3882
  } catch {
3892
3883
  }
3893
3884
  };
3894
- let estimated = false;
3895
3885
  try {
3896
3886
  const gasEst = await estimateUserOperationGas(userOp);
3897
3887
  console.log("[Account] Gas estimation from bundler:", { callGasLimit: gasEst.callGasLimit, verificationGasLimit: gasEst.verificationGasLimit, preVerificationGas: gasEst.preVerificationGas });
3898
3888
  userOp.callGasLimit = gasEst.callGasLimit;
3899
3889
  userOp.verificationGasLimit = gasEst.verificationGasLimit;
3900
3890
  userOp.preVerificationGas = gasEst.preVerificationGas;
3901
- ensureGenerousDefaults();
3902
3891
  enforceCaps(session.usePaymaster);
3903
- estimated = true;
3904
- console.log("[Account] Gas after caps:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
3905
3892
  } catch (e) {
3906
- console.log("[Account] Gas estimation failed, using defaults:", e);
3907
- ensureGenerousDefaults();
3908
- enforceCaps(session.usePaymaster);
3909
- console.log("[Account] Gas after defaults:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
3910
- }
3911
- try {
3912
- const toHex2 = (v) => `0x${v.toString(16)}`;
3913
- const isContractCall = !!userOp.callData && userOp.callData !== "0x";
3914
- if (isContractCall) {
3915
- const currentVer = BigInt(userOp.verificationGasLimit || "0x0");
3916
- const call = BigInt(userOp.callGasLimit || "0x0");
3917
- const postOp = 150000n;
3918
- const safety10k = 10000n;
3919
- let buffer = call + postOp + safety10k;
3920
- buffer += buffer / 63n;
3921
- const newVer = currentVer + buffer;
3922
- userOp.verificationGasLimit = toHex2(newVer);
3923
- enforceCaps(session.usePaymaster);
3924
- }
3925
- } catch {
3893
+ console.log("[Account] Gas estimation failed:", e);
3894
+ throw new Error(`Gas estimation failed: ${e}`);
3926
3895
  }
3927
3896
  if (session.usePaymaster && LUMIA_PAYMASTER_ADDRESS) {
3928
3897
  userOp.paymaster = LUMIA_PAYMASTER_ADDRESS;
@@ -4057,15 +4026,6 @@ async function prepareUserOperation(session, callTarget, amountWei, innerData =
4057
4026
  feeType
4058
4027
  );
4059
4028
  }
4060
- const ensureGenerousDefaults = () => {
4061
- const toHex2 = (v) => `0x${v.toString(16)}`;
4062
- const minCallGas = 0x7a120n;
4063
- const minVerificationGas = 0x989680n;
4064
- const minPreVerificationGas = 0x30d40n;
4065
- if (BigInt(userOp.callGasLimit || "0x0") < minCallGas) userOp.callGasLimit = toHex2(minCallGas);
4066
- if (BigInt(userOp.verificationGasLimit || "0x0") < minVerificationGas) userOp.verificationGasLimit = toHex2(minVerificationGas);
4067
- if (BigInt(userOp.preVerificationGas || "0x0") < minPreVerificationGas) userOp.preVerificationGas = toHex2(minPreVerificationGas);
4068
- };
4069
4029
  const enforceCaps = (usePaymaster) => {
4070
4030
  try {
4071
4031
  const envCaps = typeof import.meta !== "undefined" && import.meta.env || {};
@@ -4080,38 +4040,16 @@ async function prepareUserOperation(session, callTarget, amountWei, innerData =
4080
4040
  } catch {
4081
4041
  }
4082
4042
  };
4083
- let estimated = false;
4084
4043
  try {
4085
4044
  const gasEst = await estimateUserOperationGas(userOp);
4086
4045
  console.log("[Account] Gas estimation from bundler:", { callGasLimit: gasEst.callGasLimit, verificationGasLimit: gasEst.verificationGasLimit, preVerificationGas: gasEst.preVerificationGas });
4087
4046
  userOp.callGasLimit = gasEst.callGasLimit;
4088
4047
  userOp.verificationGasLimit = gasEst.verificationGasLimit;
4089
4048
  userOp.preVerificationGas = gasEst.preVerificationGas;
4090
- ensureGenerousDefaults();
4091
4049
  enforceCaps(session.usePaymaster);
4092
- estimated = true;
4093
- console.log("[Account] Gas after caps:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
4094
4050
  } catch (e) {
4095
- console.log("[Account] Gas estimation failed, using defaults:", e);
4096
- ensureGenerousDefaults();
4097
- enforceCaps(session.usePaymaster);
4098
- console.log("[Account] Gas after defaults:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
4099
- }
4100
- try {
4101
- const toHex2 = (v) => `0x${v.toString(16)}`;
4102
- const isContractCall = !!userOp.callData && userOp.callData !== "0x";
4103
- if (isContractCall) {
4104
- const currentVer = BigInt(userOp.verificationGasLimit || "0x0");
4105
- const call = BigInt(userOp.callGasLimit || "0x0");
4106
- const postOp = 150000n;
4107
- const safety10k = 10000n;
4108
- let buffer = call + postOp + safety10k;
4109
- buffer += buffer / 63n;
4110
- const newVer = currentVer + buffer;
4111
- userOp.verificationGasLimit = toHex2(newVer);
4112
- enforceCaps(session.usePaymaster);
4113
- }
4114
- } catch {
4051
+ console.log("[Account] Gas estimation failed:", e);
4052
+ throw new Error(`Gas estimation failed: ${e}`);
4115
4053
  }
4116
4054
  if (session.usePaymaster && LUMIA_PAYMASTER_ADDRESS) {
4117
4055
  userOp.paymaster = LUMIA_PAYMASTER_ADDRESS;
@@ -5563,7 +5501,7 @@ function Header() {
5563
5501
  // package.json
5564
5502
  var package_default = {
5565
5503
  name: "@lumiapassport/ui-kit",
5566
- version: "1.15.7",
5504
+ version: "1.15.8",
5567
5505
  description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
5568
5506
  type: "module",
5569
5507
  main: "./dist/index.cjs",