@lumiapassport/ui-kit 1.15.7 → 1.15.9

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,12 @@ 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
- };
3871
+ if (session.usePaymaster && LUMIA_PAYMASTER_ADDRESS) {
3872
+ userOp.paymaster = LUMIA_PAYMASTER_ADDRESS;
3873
+ userOp.paymasterData = "0x";
3874
+ userOp.paymasterVerificationGasLimit = PAYMASTER_VERIFICATION_GAS_LIMIT;
3875
+ userOp.paymasterPostOpGasLimit = PAYMASTER_POSTOP_GAS_LIMIT;
3876
+ }
3880
3877
  const enforceCaps = (usePaymaster) => {
3881
3878
  try {
3882
3879
  const envCaps = typeof import.meta !== "undefined" && import.meta.env || {};
@@ -3891,44 +3888,16 @@ async function sendUserOperation(session, callTarget, amountWei, innerData = "0x
3891
3888
  } catch {
3892
3889
  }
3893
3890
  };
3894
- let estimated = false;
3895
3891
  try {
3896
3892
  const gasEst = await estimateUserOperationGas(userOp);
3897
3893
  console.log("[Account] Gas estimation from bundler:", { callGasLimit: gasEst.callGasLimit, verificationGasLimit: gasEst.verificationGasLimit, preVerificationGas: gasEst.preVerificationGas });
3898
3894
  userOp.callGasLimit = gasEst.callGasLimit;
3899
3895
  userOp.verificationGasLimit = gasEst.verificationGasLimit;
3900
3896
  userOp.preVerificationGas = gasEst.preVerificationGas;
3901
- ensureGenerousDefaults();
3902
3897
  enforceCaps(session.usePaymaster);
3903
- estimated = true;
3904
- console.log("[Account] Gas after caps:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
3905
3898
  } 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 {
3926
- }
3927
- if (session.usePaymaster && LUMIA_PAYMASTER_ADDRESS) {
3928
- userOp.paymaster = LUMIA_PAYMASTER_ADDRESS;
3929
- userOp.paymasterData = "0x";
3930
- userOp.paymasterVerificationGasLimit = PAYMASTER_VERIFICATION_GAS_LIMIT;
3931
- userOp.paymasterPostOpGasLimit = PAYMASTER_POSTOP_GAS_LIMIT;
3899
+ console.log("[Account] Gas estimation failed:", e);
3900
+ throw new Error(`Gas estimation failed: ${e}`);
3932
3901
  }
3933
3902
  const signUserOp = async (nonce2) => {
3934
3903
  userOp.nonce = nonce2;
@@ -4057,15 +4026,12 @@ 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
- };
4029
+ if (session.usePaymaster && LUMIA_PAYMASTER_ADDRESS) {
4030
+ userOp.paymaster = LUMIA_PAYMASTER_ADDRESS;
4031
+ userOp.paymasterData = "0x";
4032
+ userOp.paymasterVerificationGasLimit = PAYMASTER_VERIFICATION_GAS_LIMIT;
4033
+ userOp.paymasterPostOpGasLimit = PAYMASTER_POSTOP_GAS_LIMIT;
4034
+ }
4069
4035
  const enforceCaps = (usePaymaster) => {
4070
4036
  try {
4071
4037
  const envCaps = typeof import.meta !== "undefined" && import.meta.env || {};
@@ -4080,44 +4046,16 @@ async function prepareUserOperation(session, callTarget, amountWei, innerData =
4080
4046
  } catch {
4081
4047
  }
4082
4048
  };
4083
- let estimated = false;
4084
4049
  try {
4085
4050
  const gasEst = await estimateUserOperationGas(userOp);
4086
4051
  console.log("[Account] Gas estimation from bundler:", { callGasLimit: gasEst.callGasLimit, verificationGasLimit: gasEst.verificationGasLimit, preVerificationGas: gasEst.preVerificationGas });
4087
4052
  userOp.callGasLimit = gasEst.callGasLimit;
4088
4053
  userOp.verificationGasLimit = gasEst.verificationGasLimit;
4089
4054
  userOp.preVerificationGas = gasEst.preVerificationGas;
4090
- ensureGenerousDefaults();
4091
4055
  enforceCaps(session.usePaymaster);
4092
- estimated = true;
4093
- console.log("[Account] Gas after caps:", { callGasLimit: userOp.callGasLimit, verificationGasLimit: userOp.verificationGasLimit, preVerificationGas: userOp.preVerificationGas });
4094
4056
  } 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 {
4115
- }
4116
- if (session.usePaymaster && LUMIA_PAYMASTER_ADDRESS) {
4117
- userOp.paymaster = LUMIA_PAYMASTER_ADDRESS;
4118
- userOp.paymasterData = "0x";
4119
- userOp.paymasterVerificationGasLimit = PAYMASTER_VERIFICATION_GAS_LIMIT;
4120
- userOp.paymasterPostOpGasLimit = PAYMASTER_POSTOP_GAS_LIMIT;
4057
+ console.log("[Account] Gas estimation failed:", e);
4058
+ throw new Error(`Gas estimation failed: ${e}`);
4121
4059
  }
4122
4060
  userOp.nonce = nonce;
4123
4061
  let opHash;
@@ -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.9",
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",