@lumiapassport/ui-kit 1.14.26 → 1.15.0
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 +47 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +47 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
18
|
+
<title>Lumia Passport Secure Wallet - iframe version 1.15.0</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -4402,7 +4402,7 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
4402
4402
|
};
|
|
4403
4403
|
|
|
4404
4404
|
// src/iframe/main.ts
|
|
4405
|
-
var IFRAME_VERSION = "1.
|
|
4405
|
+
var IFRAME_VERSION = "1.15.0";
|
|
4406
4406
|
var IframeWallet = class {
|
|
4407
4407
|
constructor() {
|
|
4408
4408
|
console.log("=".repeat(60));
|
package/dist/index.cjs
CHANGED
|
@@ -3738,6 +3738,11 @@ async function createAccountSession(params = {}) {
|
|
|
3738
3738
|
}
|
|
3739
3739
|
const saltZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
3740
3740
|
const smartAccountAddress = await predictCompatAddress(ownerAddress, factoryAddress, saltZero);
|
|
3741
|
+
if (mpcUserId) {
|
|
3742
|
+
registerSmartAccountAddress(smartAccountAddress).catch((error) => {
|
|
3743
|
+
console.warn("[Account] Background Smart Account registration failed:", error);
|
|
3744
|
+
});
|
|
3745
|
+
}
|
|
3741
3746
|
return { ownerAddress, smartAccountAddress, factoryAddress, ownerPrivateKey, mpcUserId: privateKey ? void 0 : mpcUserId, usePaymaster, kind: "lumia", address: smartAccountAddress };
|
|
3742
3747
|
}
|
|
3743
3748
|
async function predictCompatAddress(owner, factory, salt) {
|
|
@@ -3749,6 +3754,47 @@ async function predictCompatAddress(owner, factory, salt) {
|
|
|
3749
3754
|
throw new Error(`Failed to predict account address: ${error}`);
|
|
3750
3755
|
}
|
|
3751
3756
|
}
|
|
3757
|
+
async function registerSmartAccountAddress(smartAccountAddress) {
|
|
3758
|
+
const { jwtTokenManager: jwtTokenManager4 } = await Promise.resolve().then(() => (init_auth(), auth_exports));
|
|
3759
|
+
const accessToken = jwtTokenManager4.getAccessToken();
|
|
3760
|
+
if (!accessToken) {
|
|
3761
|
+
console.warn("[Account] No access token available for Smart Account registration");
|
|
3762
|
+
return { success: true, smartAccountAddress, alreadySet: false };
|
|
3763
|
+
}
|
|
3764
|
+
const tssUrl = getTssUrl2();
|
|
3765
|
+
try {
|
|
3766
|
+
const response = await fetch(`${tssUrl}/api/tss/wallet/smart-account`, {
|
|
3767
|
+
method: "POST",
|
|
3768
|
+
headers: {
|
|
3769
|
+
"Authorization": `Bearer ${accessToken}`,
|
|
3770
|
+
"Content-Type": "application/json"
|
|
3771
|
+
},
|
|
3772
|
+
body: JSON.stringify({ smartAccountAddress })
|
|
3773
|
+
});
|
|
3774
|
+
if (!response.ok) {
|
|
3775
|
+
const errorData = await response.json().catch(() => ({}));
|
|
3776
|
+
if (response.status === 409) {
|
|
3777
|
+
console.warn("[Account] Smart Account address conflict:", errorData.error);
|
|
3778
|
+
return { success: true, smartAccountAddress, alreadySet: true };
|
|
3779
|
+
}
|
|
3780
|
+
if (response.status === 404) {
|
|
3781
|
+
console.warn("[Account] DKG not completed on server:", errorData.error);
|
|
3782
|
+
return { success: false, smartAccountAddress, alreadySet: false };
|
|
3783
|
+
}
|
|
3784
|
+
console.warn("[Account] Failed to register Smart Account:", errorData.error || response.statusText);
|
|
3785
|
+
return { success: false, smartAccountAddress, alreadySet: false };
|
|
3786
|
+
}
|
|
3787
|
+
const result = await response.json();
|
|
3788
|
+
console.log("[Account] Smart Account registered:", {
|
|
3789
|
+
address: result.smartAccountAddress,
|
|
3790
|
+
alreadySet: result.alreadySet
|
|
3791
|
+
});
|
|
3792
|
+
return result;
|
|
3793
|
+
} catch (error) {
|
|
3794
|
+
console.warn("[Account] Error registering Smart Account address:", error);
|
|
3795
|
+
return { success: false, smartAccountAddress, alreadySet: false };
|
|
3796
|
+
}
|
|
3797
|
+
}
|
|
3752
3798
|
async function sendUserOperation(session, callTarget, amountWei, innerData = "0x", feeType = "standard", entryPointVersion = "v0.7") {
|
|
3753
3799
|
const entryPointAddress = entryPointVersion === "v0.6" ? ENTRYPOINT_V06 : ENTRYPOINT_V07;
|
|
3754
3800
|
const amountWeiBigInt = BigInt(amountWei);
|
|
@@ -5507,7 +5553,7 @@ function Header() {
|
|
|
5507
5553
|
// package.json
|
|
5508
5554
|
var package_default = {
|
|
5509
5555
|
name: "@lumiapassport/ui-kit",
|
|
5510
|
-
version: "1.
|
|
5556
|
+
version: "1.15.0",
|
|
5511
5557
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
5512
5558
|
type: "module",
|
|
5513
5559
|
main: "./dist/index.cjs",
|