@lumiapassport/ui-kit 1.7.0 → 1.8.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/README.md +29 -10
- package/dist/iframe/index.html +1 -1
- package/dist/iframe/main.js +14 -5
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +26 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -399,19 +399,38 @@ function SignatureExample() {
|
|
|
399
399
|
}
|
|
400
400
|
```
|
|
401
401
|
|
|
402
|
-
**Important Notes:**
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
**Important Notes about ERC-4337 Smart Accounts:**
|
|
403
|
+
|
|
404
|
+
In Account Abstraction (ERC-4337), there are **two addresses**:
|
|
405
|
+
1. **Owner Address (EOA)** - The address that signs messages/transactions
|
|
406
|
+
2. **Smart Account Address** - The contract wallet address
|
|
407
|
+
|
|
408
|
+
⚠️ **Critical:** The signature is created by the **owner address** (EOA), NOT the smart account address!
|
|
409
|
+
|
|
410
|
+
**Compatibility with existing protocols:**
|
|
411
|
+
- ✅ **Works:** Protocols that verify signatures off-chain (e.g., your backend verifies the owner EOA signature)
|
|
412
|
+
- ⚠️ **May not work:** Protocols designed for EOA wallets that store and verify against `msg.sender` or wallet address
|
|
413
|
+
- Example: Uniswap Permit2, some NFT marketplaces
|
|
414
|
+
- These protocols expect the signer address to match the wallet address
|
|
415
|
+
- With smart accounts: signer = owner EOA, wallet = smart account contract
|
|
416
|
+
- **Solution:** Use ERC-1271 signature validation in your smart contracts (allows contracts to validate signatures)
|
|
417
|
+
|
|
418
|
+
**Domain Configuration:**
|
|
419
|
+
- In production, use your actual `verifyingContract` address (not zero address!)
|
|
405
420
|
- The `domain` parameters must match exactly between frontend and smart contract
|
|
421
|
+
- The `chainId` should match the network you're deploying to
|
|
422
|
+
|
|
423
|
+
**Technical Details:**
|
|
406
424
|
- Shows a MetaMask-like confirmation modal with structured message preview
|
|
407
425
|
- All BigInt values are supported in the message
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
-
|
|
412
|
-
-
|
|
413
|
-
- DAO voting signatures
|
|
414
|
-
-
|
|
426
|
+
- Signature can be verified using `viem.recoverTypedDataAddress()` - will return owner EOA address
|
|
427
|
+
|
|
428
|
+
**When to use signTypedData:**
|
|
429
|
+
- ✅ Custom backend signature verification (you control the verification logic)
|
|
430
|
+
- ✅ Gasless transactions with meta-transaction relayers
|
|
431
|
+
- ✅ DAO voting and governance (off-chain signatures)
|
|
432
|
+
- ✅ Custom smart contracts with ERC-1271 support
|
|
433
|
+
- ⚠️ Be cautious with protocols designed exclusively for EOA wallets
|
|
415
434
|
|
|
416
435
|
### prepareUserOperation - Prepare for Backend Submission
|
|
417
436
|
|
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.8.0</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -1085,6 +1085,7 @@ async function uploadShareToVault(encryptedShare, accessToken) {
|
|
|
1085
1085
|
"Authorization": `Bearer ${token}`,
|
|
1086
1086
|
"Idempotency-Key": idempotencyKey
|
|
1087
1087
|
},
|
|
1088
|
+
credentials: "include",
|
|
1088
1089
|
body: JSON.stringify(encryptedShare)
|
|
1089
1090
|
});
|
|
1090
1091
|
if (!response.ok) {
|
|
@@ -1109,7 +1110,8 @@ async function downloadShareFromVault(accessToken) {
|
|
|
1109
1110
|
"Authorization": `Bearer ${token}`,
|
|
1110
1111
|
"X-Client-Device-Id": "lumia-ui-kit",
|
|
1111
1112
|
"X-Client-Device-Name": "Lumia UI Kit"
|
|
1112
|
-
}
|
|
1113
|
+
},
|
|
1114
|
+
credentials: "include"
|
|
1113
1115
|
});
|
|
1114
1116
|
if (!response.ok) {
|
|
1115
1117
|
if (response.status === 404) {
|
|
@@ -2629,7 +2631,9 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
2629
2631
|
return cached.data;
|
|
2630
2632
|
}
|
|
2631
2633
|
try {
|
|
2632
|
-
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata
|
|
2634
|
+
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata`, {
|
|
2635
|
+
credentials: "include"
|
|
2636
|
+
});
|
|
2633
2637
|
if (!response.ok) {
|
|
2634
2638
|
console.warn(`[iframe][Sign] Failed to fetch project metadata: ${response.status}`);
|
|
2635
2639
|
return null;
|
|
@@ -3187,7 +3191,9 @@ var AuthorizationManager = class {
|
|
|
3187
3191
|
return cached.data;
|
|
3188
3192
|
}
|
|
3189
3193
|
try {
|
|
3190
|
-
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata
|
|
3194
|
+
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata`, {
|
|
3195
|
+
credentials: "include"
|
|
3196
|
+
});
|
|
3191
3197
|
if (!response.ok) {
|
|
3192
3198
|
console.warn(`[iframe][Auth] Failed to fetch project metadata: ${response.status}`);
|
|
3193
3199
|
return null;
|
|
@@ -3607,7 +3613,8 @@ var GoogleDriveProvider = class {
|
|
|
3607
3613
|
const searchResponse = await fetch(
|
|
3608
3614
|
`https://www.googleapis.com/drive/v3/files?q=name='${folderName}' and mimeType='application/vnd.google-apps.folder' and trashed=false`,
|
|
3609
3615
|
{
|
|
3610
|
-
headers: { Authorization: `Bearer ${this.accessToken}` }
|
|
3616
|
+
headers: { Authorization: `Bearer ${this.accessToken}` },
|
|
3617
|
+
credentials: "include"
|
|
3611
3618
|
}
|
|
3612
3619
|
);
|
|
3613
3620
|
if (!searchResponse.ok) {
|
|
@@ -3623,6 +3630,7 @@ var GoogleDriveProvider = class {
|
|
|
3623
3630
|
Authorization: `Bearer ${this.accessToken}`,
|
|
3624
3631
|
"Content-Type": "application/json"
|
|
3625
3632
|
},
|
|
3633
|
+
credentials: "include",
|
|
3626
3634
|
body: JSON.stringify({
|
|
3627
3635
|
name: folderName,
|
|
3628
3636
|
mimeType: "application/vnd.google-apps.folder"
|
|
@@ -3646,6 +3654,7 @@ var GoogleDriveProvider = class {
|
|
|
3646
3654
|
headers: {
|
|
3647
3655
|
Authorization: `Bearer ${this.accessToken}`
|
|
3648
3656
|
},
|
|
3657
|
+
credentials: "include",
|
|
3649
3658
|
body: form
|
|
3650
3659
|
}
|
|
3651
3660
|
);
|
|
@@ -3921,7 +3930,7 @@ var BackupManager = class {
|
|
|
3921
3930
|
};
|
|
3922
3931
|
|
|
3923
3932
|
// src/iframe/main.ts
|
|
3924
|
-
var IFRAME_VERSION = "1.
|
|
3933
|
+
var IFRAME_VERSION = "1.8.0";
|
|
3925
3934
|
var IframeWallet = class {
|
|
3926
3935
|
constructor() {
|
|
3927
3936
|
console.log("=".repeat(60));
|