@lumiapassport/ui-kit 1.7.0 → 1.8.1
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 +11 -4
- package/dist/iframe/main.js.map +1 -1
- package/dist/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -5
- 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.1</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
|
@@ -2629,7 +2629,9 @@ var SigningManager = class extends TokenRefreshApiClient {
|
|
|
2629
2629
|
return cached.data;
|
|
2630
2630
|
}
|
|
2631
2631
|
try {
|
|
2632
|
-
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata
|
|
2632
|
+
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata`, {
|
|
2633
|
+
credentials: "include"
|
|
2634
|
+
});
|
|
2633
2635
|
if (!response.ok) {
|
|
2634
2636
|
console.warn(`[iframe][Sign] Failed to fetch project metadata: ${response.status}`);
|
|
2635
2637
|
return null;
|
|
@@ -3187,7 +3189,9 @@ var AuthorizationManager = class {
|
|
|
3187
3189
|
return cached.data;
|
|
3188
3190
|
}
|
|
3189
3191
|
try {
|
|
3190
|
-
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata
|
|
3192
|
+
const response = await fetch(`${this.METADATA_API_URL}/${projectId}/metadata`, {
|
|
3193
|
+
credentials: "include"
|
|
3194
|
+
});
|
|
3191
3195
|
if (!response.ok) {
|
|
3192
3196
|
console.warn(`[iframe][Auth] Failed to fetch project metadata: ${response.status}`);
|
|
3193
3197
|
return null;
|
|
@@ -3607,7 +3611,8 @@ var GoogleDriveProvider = class {
|
|
|
3607
3611
|
const searchResponse = await fetch(
|
|
3608
3612
|
`https://www.googleapis.com/drive/v3/files?q=name='${folderName}' and mimeType='application/vnd.google-apps.folder' and trashed=false`,
|
|
3609
3613
|
{
|
|
3610
|
-
headers: { Authorization: `Bearer ${this.accessToken}` }
|
|
3614
|
+
headers: { Authorization: `Bearer ${this.accessToken}` },
|
|
3615
|
+
credentials: "include"
|
|
3611
3616
|
}
|
|
3612
3617
|
);
|
|
3613
3618
|
if (!searchResponse.ok) {
|
|
@@ -3623,6 +3628,7 @@ var GoogleDriveProvider = class {
|
|
|
3623
3628
|
Authorization: `Bearer ${this.accessToken}`,
|
|
3624
3629
|
"Content-Type": "application/json"
|
|
3625
3630
|
},
|
|
3631
|
+
credentials: "include",
|
|
3626
3632
|
body: JSON.stringify({
|
|
3627
3633
|
name: folderName,
|
|
3628
3634
|
mimeType: "application/vnd.google-apps.folder"
|
|
@@ -3646,6 +3652,7 @@ var GoogleDriveProvider = class {
|
|
|
3646
3652
|
headers: {
|
|
3647
3653
|
Authorization: `Bearer ${this.accessToken}`
|
|
3648
3654
|
},
|
|
3655
|
+
credentials: "include",
|
|
3649
3656
|
body: form
|
|
3650
3657
|
}
|
|
3651
3658
|
);
|
|
@@ -3921,7 +3928,7 @@ var BackupManager = class {
|
|
|
3921
3928
|
};
|
|
3922
3929
|
|
|
3923
3930
|
// src/iframe/main.ts
|
|
3924
|
-
var IFRAME_VERSION = "1.
|
|
3931
|
+
var IFRAME_VERSION = "1.8.1";
|
|
3925
3932
|
var IframeWallet = class {
|
|
3926
3933
|
constructor() {
|
|
3927
3934
|
console.log("=".repeat(60));
|