@lumiapassport/ui-kit 1.17.15 → 1.17.16
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +100 -195
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +98 -192
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/iframe/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<meta http-equiv="X-Content-Type-Options" content="nosniff" />
|
|
16
16
|
<meta http-equiv="Referrer-Policy" content="strict-origin-when-cross-origin" />
|
|
17
17
|
|
|
18
|
-
<title>Lumia Passport Secure Wallet - iframe version 1.17.
|
|
18
|
+
<title>Lumia Passport Secure Wallet - iframe version 1.17.16</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -4406,7 +4406,7 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
4406
4406
|
};
|
|
4407
4407
|
|
|
4408
4408
|
// src/iframe/main.ts
|
|
4409
|
-
var IFRAME_VERSION = "1.17.
|
|
4409
|
+
var IFRAME_VERSION = "1.17.16";
|
|
4410
4410
|
var IframeWallet = class {
|
|
4411
4411
|
constructor() {
|
|
4412
4412
|
console.log("=".repeat(60));
|
package/dist/index.cjs
CHANGED
|
@@ -1063,13 +1063,11 @@ var init_BalanceFeedProvider2 = __esm({
|
|
|
1063
1063
|
});
|
|
1064
1064
|
|
|
1065
1065
|
// src/internal/clients/account/constants.ts
|
|
1066
|
-
var PAYMASTER_VERIFICATION_GAS_LIMIT, PAYMASTER_POSTOP_GAS_LIMIT,
|
|
1066
|
+
var PAYMASTER_VERIFICATION_GAS_LIMIT, PAYMASTER_POSTOP_GAS_LIMIT, SALT_ZERO, SALT_ZERO_UINT256, COMPAT_CREATE_ABI, executeAbi, entryPointDepositAbi;
|
|
1067
1067
|
var init_constants2 = __esm({
|
|
1068
1068
|
"src/internal/clients/account/constants.ts"() {
|
|
1069
1069
|
PAYMASTER_VERIFICATION_GAS_LIMIT = "0x249f0";
|
|
1070
1070
|
PAYMASTER_POSTOP_GAS_LIMIT = "0x186a0";
|
|
1071
|
-
MAX_BUNDLER_VERIFICATION_GAS = 5000000n;
|
|
1072
|
-
PAYMASTER_VERIFICATION_GAS = 150000n;
|
|
1073
1071
|
SALT_ZERO = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
1074
1072
|
SALT_ZERO_UINT256 = 0n;
|
|
1075
1073
|
COMPAT_CREATE_ABI = [
|
|
@@ -1141,9 +1139,6 @@ var init_abis = __esm({
|
|
|
1141
1139
|
});
|
|
1142
1140
|
|
|
1143
1141
|
// src/internal/clients/account/helpers.ts
|
|
1144
|
-
function fromBigIntToHex(value) {
|
|
1145
|
-
return `0x${value.toString(16)}`;
|
|
1146
|
-
}
|
|
1147
1142
|
function normalizeSignature(signature) {
|
|
1148
1143
|
const sig = signature.slice(2);
|
|
1149
1144
|
const r = sig.slice(0, 64);
|
|
@@ -1312,7 +1307,7 @@ var init_package = __esm({
|
|
|
1312
1307
|
"package.json"() {
|
|
1313
1308
|
package_default = {
|
|
1314
1309
|
name: "@lumiapassport/ui-kit",
|
|
1315
|
-
version: "1.17.
|
|
1310
|
+
version: "1.17.16",
|
|
1316
1311
|
description: "React UI components and hooks for Mbark Wallet authentication and Account Abstraction",
|
|
1317
1312
|
type: "module",
|
|
1318
1313
|
main: "./dist/index.cjs",
|
|
@@ -3980,58 +3975,18 @@ async function sendUserOperation(session, params) {
|
|
|
3980
3975
|
{ client: chainPublicClient, bundlerUrl, chainConfig }
|
|
3981
3976
|
);
|
|
3982
3977
|
}
|
|
3983
|
-
const ensureGenerousDefaults = () => {
|
|
3984
|
-
const minCallGas = 0x7a120n;
|
|
3985
|
-
const minVerificationGas = 0x989680n;
|
|
3986
|
-
const minPreVerificationGas = 0x30d40n;
|
|
3987
|
-
if (BigInt(userOp.callGasLimit || "0x0") < minCallGas) {
|
|
3988
|
-
userOp.callGasLimit = fromBigIntToHex(minCallGas);
|
|
3989
|
-
}
|
|
3990
|
-
if (BigInt(userOp.verificationGasLimit || "0x0") < minVerificationGas) {
|
|
3991
|
-
userOp.verificationGasLimit = fromBigIntToHex(minVerificationGas);
|
|
3992
|
-
}
|
|
3993
|
-
if (BigInt(userOp.preVerificationGas || "0x0") < minPreVerificationGas) {
|
|
3994
|
-
userOp.preVerificationGas = fromBigIntToHex(minPreVerificationGas);
|
|
3995
|
-
}
|
|
3996
|
-
};
|
|
3997
|
-
const enforceCaps = (usePaymaster) => {
|
|
3998
|
-
const maxBundlerVerifGas = MAX_BUNDLER_VERIFICATION_GAS;
|
|
3999
|
-
const maxCallGas = 0x7a120n;
|
|
4000
|
-
const maxAccountVerifGas = usePaymaster ? maxBundlerVerifGas - PAYMASTER_VERIFICATION_GAS : maxBundlerVerifGas;
|
|
4001
|
-
const verGas = BigInt(userOp.verificationGasLimit || "0x0");
|
|
4002
|
-
if (verGas > maxAccountVerifGas) {
|
|
4003
|
-
userOp.verificationGasLimit = fromBigIntToHex(maxAccountVerifGas);
|
|
4004
|
-
}
|
|
4005
|
-
const callGas = BigInt(userOp.callGasLimit || "0x0");
|
|
4006
|
-
if (callGas > maxCallGas) {
|
|
4007
|
-
userOp.callGasLimit = fromBigIntToHex(maxCallGas);
|
|
4008
|
-
}
|
|
4009
|
-
};
|
|
4010
3978
|
try {
|
|
4011
3979
|
const gasEst = await (0, import_bundler.estimateUserOperationGas)(
|
|
4012
3980
|
{ ...userOp, signature: `0x${"00".repeat(65)}` },
|
|
4013
3981
|
{ chainId: chainConfig.id, retryWithoutFactory: true }
|
|
4014
3982
|
);
|
|
3983
|
+
console.log("[Account] Gas estimation from bundler:", { callGasLimit: gasEst.callGasLimit, verificationGasLimit: gasEst.verificationGasLimit, preVerificationGas: gasEst.preVerificationGas });
|
|
4015
3984
|
userOp.callGasLimit = gasEst.callGasLimit;
|
|
4016
3985
|
userOp.verificationGasLimit = gasEst.verificationGasLimit;
|
|
4017
3986
|
userOp.preVerificationGas = gasEst.preVerificationGas;
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
ensureGenerousDefaults();
|
|
4022
|
-
enforceCaps(session.usePaymaster);
|
|
4023
|
-
}
|
|
4024
|
-
const isContractCall = !!userOp.callData && userOp.callData !== "0x";
|
|
4025
|
-
if (isContractCall) {
|
|
4026
|
-
const currentVer = BigInt(userOp.verificationGasLimit || "0x0");
|
|
4027
|
-
const call = BigInt(userOp.callGasLimit || "0x0");
|
|
4028
|
-
const postOp = 150000n;
|
|
4029
|
-
const safety10k = 10000n;
|
|
4030
|
-
let buffer = call + postOp + safety10k;
|
|
4031
|
-
buffer += buffer / 63n;
|
|
4032
|
-
const newVer = currentVer + buffer;
|
|
4033
|
-
userOp.verificationGasLimit = fromBigIntToHex(newVer);
|
|
4034
|
-
enforceCaps(session.usePaymaster);
|
|
3987
|
+
} catch (e) {
|
|
3988
|
+
console.log("[Account] Gas estimation failed:", e);
|
|
3989
|
+
throw new Error(`Gas estimation failed: ${e}`);
|
|
4035
3990
|
}
|
|
4036
3991
|
if (session.usePaymaster && chainConfig.paymasterAddress) {
|
|
4037
3992
|
userOp.paymaster = chainConfig.paymasterAddress;
|
|
@@ -4378,27 +4333,12 @@ async function prepareUserOperation(session, params) {
|
|
|
4378
4333
|
userOp.paymasterVerificationGasLimit = PAYMASTER_VERIFICATION_GAS_LIMIT2;
|
|
4379
4334
|
userOp.paymasterPostOpGasLimit = PAYMASTER_POSTOP_GAS_LIMIT2;
|
|
4380
4335
|
}
|
|
4381
|
-
const enforceCaps = (usePaymaster) => {
|
|
4382
|
-
try {
|
|
4383
|
-
const envCaps = typeof import_meta !== "undefined" && import_meta.env || {};
|
|
4384
|
-
const maxBundlerVerifGas = envCaps.VITE_MAX_VERIFICATION_GAS ? BigInt(envCaps.VITE_MAX_VERIFICATION_GAS) : MAX_BUNDLER_VERIFICATION_GAS2;
|
|
4385
|
-
const maxCallGas = envCaps.VITE_MAX_CALL_GAS_LIMIT ? BigInt(envCaps.VITE_MAX_CALL_GAS_LIMIT) : null;
|
|
4386
|
-
const toHex2 = (v) => `0x${v.toString(16)}`;
|
|
4387
|
-
const maxAccountVerifGas = usePaymaster ? maxBundlerVerifGas - PAYMASTER_VERIFICATION_GAS2 : maxBundlerVerifGas;
|
|
4388
|
-
const verGas = BigInt(userOp.verificationGasLimit || "0x0");
|
|
4389
|
-
if (verGas > maxAccountVerifGas) userOp.verificationGasLimit = toHex2(maxAccountVerifGas);
|
|
4390
|
-
const callGas = BigInt(userOp.callGasLimit || "0x0");
|
|
4391
|
-
if (maxCallGas && callGas > maxCallGas) userOp.callGasLimit = toHex2(maxCallGas);
|
|
4392
|
-
} catch {
|
|
4393
|
-
}
|
|
4394
|
-
};
|
|
4395
4336
|
try {
|
|
4396
4337
|
const gasEst = await (0, import_bundler2.estimateUserOperationGas)(userOp, { chainId, retryWithoutFactory: true });
|
|
4397
4338
|
console.log("[Account] Gas estimation from bundler:", { callGasLimit: gasEst.callGasLimit, verificationGasLimit: gasEst.verificationGasLimit, preVerificationGas: gasEst.preVerificationGas });
|
|
4398
4339
|
userOp.callGasLimit = gasEst.callGasLimit;
|
|
4399
4340
|
userOp.verificationGasLimit = gasEst.verificationGasLimit;
|
|
4400
4341
|
userOp.preVerificationGas = gasEst.preVerificationGas;
|
|
4401
|
-
enforceCaps(session.usePaymaster);
|
|
4402
4342
|
} catch (e) {
|
|
4403
4343
|
console.log("[Account] Gas estimation failed:", e);
|
|
4404
4344
|
throw new Error(`Gas estimation failed: ${e}`);
|
|
@@ -4548,20 +4488,6 @@ async function sendUserOperation2(session, params) {
|
|
|
4548
4488
|
userOp.paymasterVerificationGasLimit = PAYMASTER_VERIFICATION_GAS_LIMIT2;
|
|
4549
4489
|
userOp.paymasterPostOpGasLimit = PAYMASTER_POSTOP_GAS_LIMIT2;
|
|
4550
4490
|
}
|
|
4551
|
-
const enforceCaps = (usePaymaster) => {
|
|
4552
|
-
try {
|
|
4553
|
-
const envCaps = typeof import_meta !== "undefined" && import_meta.env || {};
|
|
4554
|
-
const maxBundlerVerifGas = envCaps.VITE_MAX_VERIFICATION_GAS ? BigInt(envCaps.VITE_MAX_VERIFICATION_GAS) : MAX_BUNDLER_VERIFICATION_GAS2;
|
|
4555
|
-
const maxCallGas = envCaps.VITE_MAX_CALL_GAS_LIMIT ? BigInt(envCaps.VITE_MAX_CALL_GAS_LIMIT) : null;
|
|
4556
|
-
const toHex2 = (v) => `0x${v.toString(16)}`;
|
|
4557
|
-
const maxAccountVerifGas = usePaymaster ? maxBundlerVerifGas - PAYMASTER_VERIFICATION_GAS2 : maxBundlerVerifGas;
|
|
4558
|
-
const verGas = BigInt(userOp.verificationGasLimit || "0x0");
|
|
4559
|
-
if (verGas > maxAccountVerifGas) userOp.verificationGasLimit = toHex2(maxAccountVerifGas);
|
|
4560
|
-
const callGas = BigInt(userOp.callGasLimit || "0x0");
|
|
4561
|
-
if (maxCallGas && callGas > maxCallGas) userOp.callGasLimit = toHex2(maxCallGas);
|
|
4562
|
-
} catch {
|
|
4563
|
-
}
|
|
4564
|
-
};
|
|
4565
4491
|
try {
|
|
4566
4492
|
const gasEst = await (0, import_bundler2.estimateUserOperationGas)(userOp, {
|
|
4567
4493
|
chainId,
|
|
@@ -4571,7 +4497,6 @@ async function sendUserOperation2(session, params) {
|
|
|
4571
4497
|
userOp.callGasLimit = gasEst.callGasLimit;
|
|
4572
4498
|
userOp.verificationGasLimit = gasEst.verificationGasLimit;
|
|
4573
4499
|
userOp.preVerificationGas = gasEst.preVerificationGas;
|
|
4574
|
-
enforceCaps(session.usePaymaster);
|
|
4575
4500
|
} catch (e) {
|
|
4576
4501
|
console.log("[Account] Gas estimation failed:", e);
|
|
4577
4502
|
throw new Error(`Gas estimation failed: ${e}`);
|
|
@@ -4712,7 +4637,7 @@ async function signTypedData(session, params) {
|
|
|
4712
4637
|
}
|
|
4713
4638
|
return signature;
|
|
4714
4639
|
}
|
|
4715
|
-
var import_bundler2, import_read6, import_viem6, import_account_abstraction2, import_accounts3,
|
|
4640
|
+
var import_bundler2, import_read6, import_viem6, import_account_abstraction2, import_accounts3, PAYMASTER_VERIFICATION_GAS_LIMIT2, PAYMASTER_POSTOP_GAS_LIMIT2;
|
|
4716
4641
|
var init_account = __esm({
|
|
4717
4642
|
"src/internal/clients/account.ts"() {
|
|
4718
4643
|
init_constants2();
|
|
@@ -4727,11 +4652,8 @@ var init_account = __esm({
|
|
|
4727
4652
|
init_deposit_for_smart_account();
|
|
4728
4653
|
init_deploy_account();
|
|
4729
4654
|
init_register_smart_account_address();
|
|
4730
|
-
import_meta = {};
|
|
4731
4655
|
PAYMASTER_VERIFICATION_GAS_LIMIT2 = "0x249f0";
|
|
4732
4656
|
PAYMASTER_POSTOP_GAS_LIMIT2 = "0x186a0";
|
|
4733
|
-
MAX_BUNDLER_VERIFICATION_GAS2 = 5000000n;
|
|
4734
|
-
PAYMASTER_VERIFICATION_GAS2 = 150000n;
|
|
4735
4657
|
}
|
|
4736
4658
|
});
|
|
4737
4659
|
|
|
@@ -19797,6 +19719,92 @@ var init_LumiaLogo2 = __esm({
|
|
|
19797
19719
|
}
|
|
19798
19720
|
});
|
|
19799
19721
|
|
|
19722
|
+
// src/clients/bundler/getUserOperationReceipt.ts
|
|
19723
|
+
async function getUserOperationReceipt(userOpHash, chainId) {
|
|
19724
|
+
const targetChainId = chainId ?? requireActiveChainId();
|
|
19725
|
+
const chainConfig = (0, import_read14.getChainConfig)(targetChainId);
|
|
19726
|
+
if (!chainConfig) {
|
|
19727
|
+
throw new Error(`Chain ${targetChainId} is not supported`);
|
|
19728
|
+
}
|
|
19729
|
+
if (!chainConfig.bundlerUrl) {
|
|
19730
|
+
throw new Error(`Chain ${targetChainId} has no bundlerUrl configured`);
|
|
19731
|
+
}
|
|
19732
|
+
if (!userOpHash) {
|
|
19733
|
+
throw new Error("Operation hash is required");
|
|
19734
|
+
}
|
|
19735
|
+
try {
|
|
19736
|
+
const result = await (0, import_core.bundlerRpc)("eth_getUserOperationReceipt", [userOpHash], chainConfig.bundlerUrl);
|
|
19737
|
+
if (!result) {
|
|
19738
|
+
return null;
|
|
19739
|
+
}
|
|
19740
|
+
console.log("[getUserOperationReceipt] Receipt:", JSON.stringify(result, null, 2));
|
|
19741
|
+
return {
|
|
19742
|
+
userOpHash: result.userOpHash,
|
|
19743
|
+
entryPoint: result.entryPoint,
|
|
19744
|
+
sender: result.sender,
|
|
19745
|
+
nonce: result.nonce,
|
|
19746
|
+
success: result.success,
|
|
19747
|
+
actualGasCost: result.actualGasCost,
|
|
19748
|
+
actualGasUsed: result.actualGasUsed,
|
|
19749
|
+
paymaster: result.paymaster,
|
|
19750
|
+
receipt: result.receipt,
|
|
19751
|
+
logs: result.logs,
|
|
19752
|
+
reason: result.reason
|
|
19753
|
+
};
|
|
19754
|
+
} catch (error) {
|
|
19755
|
+
console.warn("[getUserOperationReceipt] Failed to get receipt:", error);
|
|
19756
|
+
return null;
|
|
19757
|
+
}
|
|
19758
|
+
}
|
|
19759
|
+
var import_core, import_read14;
|
|
19760
|
+
var init_getUserOperationReceipt = __esm({
|
|
19761
|
+
"src/clients/bundler/getUserOperationReceipt.ts"() {
|
|
19762
|
+
import_core = require("@lumiapassport/core");
|
|
19763
|
+
import_read14 = require("@lumiapassport/core/read");
|
|
19764
|
+
init_LumiaPassportSessionContext();
|
|
19765
|
+
}
|
|
19766
|
+
});
|
|
19767
|
+
|
|
19768
|
+
// src/clients/bundler/getUserOperationByHash.ts
|
|
19769
|
+
async function getUserOperationByHash(userOpHash, chainId) {
|
|
19770
|
+
const targetChainId = chainId ?? requireActiveChainId();
|
|
19771
|
+
const chainConfig = (0, import_read15.getChainConfig)(targetChainId);
|
|
19772
|
+
if (!chainConfig) {
|
|
19773
|
+
throw new Error(`Chain ${targetChainId} is not supported`);
|
|
19774
|
+
}
|
|
19775
|
+
if (!chainConfig.bundlerUrl) {
|
|
19776
|
+
throw new Error(`Chain ${targetChainId} has no bundlerUrl configured`);
|
|
19777
|
+
}
|
|
19778
|
+
if (!userOpHash) {
|
|
19779
|
+
throw new Error("Operation hash is required");
|
|
19780
|
+
}
|
|
19781
|
+
try {
|
|
19782
|
+
const result = await (0, import_core2.bundlerRpc)("eth_getUserOperationByHash", [userOpHash], chainConfig.bundlerUrl);
|
|
19783
|
+
if (!result) {
|
|
19784
|
+
return null;
|
|
19785
|
+
}
|
|
19786
|
+
console.log("[getUserOperationByHash] Receipt:", JSON.stringify(result, null, 2));
|
|
19787
|
+
return {
|
|
19788
|
+
entryPoint: result.entryPoint,
|
|
19789
|
+
userOperation: result.userOperation,
|
|
19790
|
+
transactionHash: result.transactionHash,
|
|
19791
|
+
blockNumber: result.blockNumber,
|
|
19792
|
+
blockHash: result.blockHash
|
|
19793
|
+
};
|
|
19794
|
+
} catch (error) {
|
|
19795
|
+
console.warn("[getUserOperationByHash] Failed to get user operation:", error);
|
|
19796
|
+
return null;
|
|
19797
|
+
}
|
|
19798
|
+
}
|
|
19799
|
+
var import_core2, import_read15;
|
|
19800
|
+
var init_getUserOperationByHash = __esm({
|
|
19801
|
+
"src/clients/bundler/getUserOperationByHash.ts"() {
|
|
19802
|
+
import_core2 = require("@lumiapassport/core");
|
|
19803
|
+
import_read15 = require("@lumiapassport/core/read");
|
|
19804
|
+
init_LumiaPassportSessionContext();
|
|
19805
|
+
}
|
|
19806
|
+
});
|
|
19807
|
+
|
|
19800
19808
|
// src/internal/components/Address.tsx
|
|
19801
19809
|
function toExplorerAddressUrl(address, chain) {
|
|
19802
19810
|
const base2 = chain?.blockExplorers?.default?.url;
|
|
@@ -19870,7 +19878,8 @@ var init_UserOpStatus = __esm({
|
|
|
19870
19878
|
"src/internal/components/UserOpStatus.tsx"() {
|
|
19871
19879
|
import_lucide_react64 = require("lucide-react");
|
|
19872
19880
|
React10 = __toESM(require("react"), 1);
|
|
19873
|
-
|
|
19881
|
+
init_getUserOperationReceipt();
|
|
19882
|
+
init_getUserOperationByHash();
|
|
19874
19883
|
init_cn();
|
|
19875
19884
|
init_Address();
|
|
19876
19885
|
init_badge();
|
|
@@ -19879,6 +19888,7 @@ var init_UserOpStatus = __esm({
|
|
|
19879
19888
|
UserOpStatus = ({
|
|
19880
19889
|
userOpHash,
|
|
19881
19890
|
chain,
|
|
19891
|
+
chainId,
|
|
19882
19892
|
className,
|
|
19883
19893
|
pollMs = 1e3,
|
|
19884
19894
|
maxPollTimeMs = 6e4,
|
|
@@ -19899,24 +19909,6 @@ var init_UserOpStatus = __esm({
|
|
|
19899
19909
|
const mempool = useExternalState ? externalState.mempool ?? null : internalMempool;
|
|
19900
19910
|
const error = useExternalState ? externalState.error ?? null : internalError;
|
|
19901
19911
|
const refreshing = useExternalState ? externalState.isPolling ?? false : internalRefreshing;
|
|
19902
|
-
const rpc = React10.useCallback(async (method, params) => {
|
|
19903
|
-
const body = { jsonrpc: "2.0", id: 1, method, params };
|
|
19904
|
-
const res = await fetch(getBundlerUrl(), {
|
|
19905
|
-
method: "POST",
|
|
19906
|
-
headers: { "content-type": "application/json" },
|
|
19907
|
-
body: JSON.stringify(body)
|
|
19908
|
-
});
|
|
19909
|
-
const json = await res.json();
|
|
19910
|
-
if (json.error) throw new Error(json.error.message || JSON.stringify(json.error));
|
|
19911
|
-
return json.result;
|
|
19912
|
-
}, []);
|
|
19913
|
-
const extractMempoolInfo = React10.useCallback((m) => {
|
|
19914
|
-
if (!m) return null;
|
|
19915
|
-
const entryPoint = m.entryPoint || m?.userOperation?.entryPoint || null;
|
|
19916
|
-
const sender = m.sender || m?.userOperation?.sender || null;
|
|
19917
|
-
if (!entryPoint && !sender) return null;
|
|
19918
|
-
return { entryPoint, sender };
|
|
19919
|
-
}, []);
|
|
19920
19912
|
const tick = React10.useCallback(async () => {
|
|
19921
19913
|
if (useExternalState) return;
|
|
19922
19914
|
const elapsed = Date.now() - startTimeRef.current;
|
|
@@ -19932,7 +19924,7 @@ var init_UserOpStatus = __esm({
|
|
|
19932
19924
|
try {
|
|
19933
19925
|
setInternalRefreshing(true);
|
|
19934
19926
|
setInternalError(null);
|
|
19935
|
-
const r = await
|
|
19927
|
+
const r = await getUserOperationReceipt(userOpHash, chainId);
|
|
19936
19928
|
if (r) {
|
|
19937
19929
|
setInternalReceipt(r);
|
|
19938
19930
|
setInternalMempool(null);
|
|
@@ -19942,7 +19934,7 @@ var init_UserOpStatus = __esm({
|
|
|
19942
19934
|
}
|
|
19943
19935
|
return;
|
|
19944
19936
|
}
|
|
19945
|
-
const m = await
|
|
19937
|
+
const m = await getUserOperationByHash(userOpHash, chainId);
|
|
19946
19938
|
if (m === null) {
|
|
19947
19939
|
setRejected(true);
|
|
19948
19940
|
setInternalMempool(null);
|
|
@@ -19952,15 +19944,14 @@ var init_UserOpStatus = __esm({
|
|
|
19952
19944
|
}
|
|
19953
19945
|
return;
|
|
19954
19946
|
}
|
|
19955
|
-
|
|
19956
|
-
setInternalMempool(info);
|
|
19947
|
+
setInternalMempool(m ? { entryPoint: m.entryPoint, sender: m.userOperation?.sender } : null);
|
|
19957
19948
|
} catch (e) {
|
|
19958
19949
|
setInternalError(e?.message || String(e));
|
|
19959
19950
|
} finally {
|
|
19960
19951
|
setInternalRefreshing(false);
|
|
19961
19952
|
setAttempt((x) => x + 1);
|
|
19962
19953
|
}
|
|
19963
|
-
}, [
|
|
19954
|
+
}, [userOpHash, chainId, maxPollTimeMs, useExternalState]);
|
|
19964
19955
|
React10.useEffect(() => {
|
|
19965
19956
|
if (useExternalState) return;
|
|
19966
19957
|
console.log("[UserOpStatus] Initializing polling for UserOp hash:", userOpHash);
|
|
@@ -20569,92 +20560,6 @@ var init_useLogout = __esm({
|
|
|
20569
20560
|
}
|
|
20570
20561
|
});
|
|
20571
20562
|
|
|
20572
|
-
// src/clients/bundler/getUserOperationByHash.ts
|
|
20573
|
-
async function getUserOperationByHash(userOpHash, chainId) {
|
|
20574
|
-
const targetChainId = chainId ?? requireActiveChainId();
|
|
20575
|
-
const chainConfig = (0, import_read14.getChainConfig)(targetChainId);
|
|
20576
|
-
if (!chainConfig) {
|
|
20577
|
-
throw new Error(`Chain ${targetChainId} is not supported`);
|
|
20578
|
-
}
|
|
20579
|
-
if (!chainConfig.bundlerUrl) {
|
|
20580
|
-
throw new Error(`Chain ${targetChainId} has no bundlerUrl configured`);
|
|
20581
|
-
}
|
|
20582
|
-
if (!userOpHash) {
|
|
20583
|
-
throw new Error("Operation hash is required");
|
|
20584
|
-
}
|
|
20585
|
-
try {
|
|
20586
|
-
const result = await (0, import_core.bundlerRpc)("eth_getUserOperationByHash", [userOpHash], chainConfig.bundlerUrl);
|
|
20587
|
-
if (!result) {
|
|
20588
|
-
return null;
|
|
20589
|
-
}
|
|
20590
|
-
console.log("[getUserOperationByHash] Receipt:", JSON.stringify(result, null, 2));
|
|
20591
|
-
return {
|
|
20592
|
-
entryPoint: result.entryPoint,
|
|
20593
|
-
userOperation: result.userOperation,
|
|
20594
|
-
transactionHash: result.transactionHash,
|
|
20595
|
-
blockNumber: result.blockNumber,
|
|
20596
|
-
blockHash: result.blockHash
|
|
20597
|
-
};
|
|
20598
|
-
} catch (error) {
|
|
20599
|
-
console.warn("[getUserOperationByHash] Failed to get user operation:", error);
|
|
20600
|
-
return null;
|
|
20601
|
-
}
|
|
20602
|
-
}
|
|
20603
|
-
var import_core, import_read14;
|
|
20604
|
-
var init_getUserOperationByHash = __esm({
|
|
20605
|
-
"src/clients/bundler/getUserOperationByHash.ts"() {
|
|
20606
|
-
import_core = require("@lumiapassport/core");
|
|
20607
|
-
import_read14 = require("@lumiapassport/core/read");
|
|
20608
|
-
init_LumiaPassportSessionContext();
|
|
20609
|
-
}
|
|
20610
|
-
});
|
|
20611
|
-
|
|
20612
|
-
// src/clients/bundler/getUserOperationReceipt.ts
|
|
20613
|
-
async function getUserOperationReceipt(userOpHash, chainId) {
|
|
20614
|
-
const targetChainId = chainId ?? requireActiveChainId();
|
|
20615
|
-
const chainConfig = (0, import_read15.getChainConfig)(targetChainId);
|
|
20616
|
-
if (!chainConfig) {
|
|
20617
|
-
throw new Error(`Chain ${targetChainId} is not supported`);
|
|
20618
|
-
}
|
|
20619
|
-
if (!chainConfig.bundlerUrl) {
|
|
20620
|
-
throw new Error(`Chain ${targetChainId} has no bundlerUrl configured`);
|
|
20621
|
-
}
|
|
20622
|
-
if (!userOpHash) {
|
|
20623
|
-
throw new Error("Operation hash is required");
|
|
20624
|
-
}
|
|
20625
|
-
try {
|
|
20626
|
-
const result = await (0, import_core2.bundlerRpc)("eth_getUserOperationReceipt", [userOpHash], chainConfig.bundlerUrl);
|
|
20627
|
-
if (!result) {
|
|
20628
|
-
return null;
|
|
20629
|
-
}
|
|
20630
|
-
console.log("[getUserOperationReceipt] Receipt:", JSON.stringify(result, null, 2));
|
|
20631
|
-
return {
|
|
20632
|
-
userOpHash: result.userOpHash,
|
|
20633
|
-
entryPoint: result.entryPoint,
|
|
20634
|
-
sender: result.sender,
|
|
20635
|
-
nonce: result.nonce,
|
|
20636
|
-
success: result.success,
|
|
20637
|
-
actualGasCost: result.actualGasCost,
|
|
20638
|
-
actualGasUsed: result.actualGasUsed,
|
|
20639
|
-
paymaster: result.paymaster,
|
|
20640
|
-
receipt: result.receipt,
|
|
20641
|
-
logs: result.logs,
|
|
20642
|
-
reason: result.reason
|
|
20643
|
-
};
|
|
20644
|
-
} catch (error) {
|
|
20645
|
-
console.warn("[getUserOperationReceipt] Failed to get receipt:", error);
|
|
20646
|
-
return null;
|
|
20647
|
-
}
|
|
20648
|
-
}
|
|
20649
|
-
var import_core2, import_read15;
|
|
20650
|
-
var init_getUserOperationReceipt = __esm({
|
|
20651
|
-
"src/clients/bundler/getUserOperationReceipt.ts"() {
|
|
20652
|
-
import_core2 = require("@lumiapassport/core");
|
|
20653
|
-
import_read15 = require("@lumiapassport/core/read");
|
|
20654
|
-
init_LumiaPassportSessionContext();
|
|
20655
|
-
}
|
|
20656
|
-
});
|
|
20657
|
-
|
|
20658
20563
|
// src/clients/bundler/waitForUserOperationReceipt.ts
|
|
20659
20564
|
async function waitForUserOperationReceipt(userOpHash, options) {
|
|
20660
20565
|
const pollIntervalMs = options?.pollIntervalMs ?? 1e3;
|