@lumiapassport/ui-kit 1.6.0 → 1.6.2
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 +41 -0
- package/dist/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -299,6 +299,47 @@ function TransactionExample() {
|
|
|
299
299
|
}
|
|
300
300
|
```
|
|
301
301
|
|
|
302
|
+
### sendUserOperation - Direct Transaction Submission
|
|
303
|
+
|
|
304
|
+
For direct control without using the React hook, you can use `sendUserOperation` function:
|
|
305
|
+
|
|
306
|
+
```tsx
|
|
307
|
+
import { sendUserOperation, useLumiaPassportSession } from '@lumiapassport/ui-kit';
|
|
308
|
+
|
|
309
|
+
function DirectTransactionExample() {
|
|
310
|
+
const { session } = useLumiaPassportSession();
|
|
311
|
+
|
|
312
|
+
const handleSend = async () => {
|
|
313
|
+
if (!session) {
|
|
314
|
+
console.error('No active session');
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
try {
|
|
319
|
+
// Send transaction directly with full control
|
|
320
|
+
const userOpHash = await sendUserOperation(
|
|
321
|
+
session, // Required: session from useLumiaPassportSession
|
|
322
|
+
'0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', // to address
|
|
323
|
+
'1000000000000000000', // value in wei (1 ETH)
|
|
324
|
+
'0x', // data (optional contract call)
|
|
325
|
+
'standard', // fee type: 'economy' | 'standard' | 'fast'
|
|
326
|
+
'v0.7' // EntryPoint version
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
console.log('Transaction submitted:', userOpHash);
|
|
330
|
+
} catch (error) {
|
|
331
|
+
console.error('Transaction failed:', error);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
return <button onClick={handleSend}>Send Transaction</button>;
|
|
336
|
+
}
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**When to use:**
|
|
340
|
+
- ✅ Use `useSendTransaction()` hook for React components (automatic session management)
|
|
341
|
+
- ✅ Use `sendUserOperation()` function for custom logic, utility functions, or non-React code
|
|
342
|
+
|
|
302
343
|
### prepareUserOperation - Prepare for Backend Submission
|
|
303
344
|
|
|
304
345
|
```tsx
|
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.6.
|
|
18
|
+
<title>Lumia Passport Secure Wallet - iframe version 1.6.2</title>
|
|
19
19
|
|
|
20
20
|
<!-- Styles will be injected by build process -->
|
|
21
21
|
<style>
|
package/dist/iframe/main.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -8536,7 +8536,7 @@ function useLumiaPassportLinkedProfiles() {
|
|
|
8536
8536
|
// package.json
|
|
8537
8537
|
var package_default = {
|
|
8538
8538
|
name: "@lumiapassport/ui-kit",
|
|
8539
|
-
version: "1.6.
|
|
8539
|
+
version: "1.6.2",
|
|
8540
8540
|
description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
|
|
8541
8541
|
type: "module",
|
|
8542
8542
|
main: "./dist/index.cjs",
|