@lumiapassport/ui-kit 1.17.5 → 1.17.7

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 CHANGED
@@ -674,8 +674,15 @@ function BackendSubmissionExample() {
674
674
 
675
675
  ```typescript
676
676
  import { getUserOperationReceipt, sendUserOperationRaw } from '@lumiapassport/core'
677
+ import { getChainConfig } from '@lumiapassport/core/read'
677
678
  import { recoverAddress } from 'viem'
678
679
 
680
+ const CHAIN_ID = 2030232745 // Lumia Testnet
681
+
682
+ // Get chain config for bundler URL
683
+ const chainConfig = getChainConfig(CHAIN_ID)
684
+ if (!chainConfig) throw new Error('Unsupported chain')
685
+
679
686
  // Receive from frontend
680
687
  const { userOp, userOpHash, ownerAddress } = await request.json()
681
688
 
@@ -689,13 +696,17 @@ if (recoveredAddress.toLowerCase() !== ownerAddress.toLowerCase()) {
689
696
  throw new Error('Invalid signature')
690
697
  }
691
698
 
692
- // Submit to bundler - returns userOpHash
693
- const submittedUserOpHash = await sendUserOperationRaw(userOp)
699
+ // Submit to bundler - REQUIRES chainId parameter
700
+ const submittedUserOpHash = await sendUserOperationRaw(userOp, { chainId: CHAIN_ID })
694
701
 
695
702
  // Poll for receipt to get transaction hash and status
696
- const waitForReceipt = async (userOpHash: string, maxAttempts = 60, delayMs = 1000) => {
703
+ const waitForReceipt = async (hash: string, maxAttempts = 60, delayMs = 1000) => {
697
704
  for (let i = 0; i < maxAttempts; i++) {
698
- const receipt = await getUserOperationReceipt(userOpHash as `0x${string}`)
705
+ // REQUIRES bundlerUrl parameter
706
+ const receipt = await getUserOperationReceipt(
707
+ hash as `0x${string}`,
708
+ chainConfig.bundlerUrl
709
+ )
699
710
  if (receipt) {
700
711
  return {
701
712
  success: receipt.success,
@@ -716,6 +727,13 @@ return {
716
727
  }
717
728
  ```
718
729
 
730
+ **Network Configuration:**
731
+
732
+ | Network | Chain ID | Bundler URL |
733
+ |---------|----------|-------------|
734
+ | Lumia Testnet (Beam) | 2030232745 | https://api.lumiapassport.com/rundler |
735
+ | Lumia Mainnet (Prism) | 994873017 | https://api.lumiapassport.com/rundler-prism |
736
+
719
737
  ### useLumiaPassportOpen - Programmatic LumiaPassport Dialog Control
720
738
 
721
739
  Control the Lumia Passport dialog programmatically.
@@ -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.5</title>
18
+ <title>Lumia Passport Secure Wallet - iframe version 1.17.7</title>
19
19
 
20
20
  <!-- Styles will be injected by build process -->
21
21
  <style>
@@ -4411,7 +4411,7 @@ var SigningManager = class extends TokenRefreshApiClient {
4411
4411
  };
4412
4412
 
4413
4413
  // src/iframe/main.ts
4414
- var IFRAME_VERSION = "1.17.5";
4414
+ var IFRAME_VERSION = "1.17.7";
4415
4415
  var IframeWallet = class {
4416
4416
  constructor() {
4417
4417
  console.log("=".repeat(60));
package/dist/index.cjs CHANGED
@@ -1267,7 +1267,7 @@ var init_package = __esm({
1267
1267
  "package.json"() {
1268
1268
  package_default = {
1269
1269
  name: "@lumiapassport/ui-kit",
1270
- version: "1.17.5",
1270
+ version: "1.17.7",
1271
1271
  description: "React UI components and hooks for Mbark Wallet authentication and Account Abstraction",
1272
1272
  type: "module",
1273
1273
  main: "./dist/index.cjs",
@@ -2585,6 +2585,9 @@ var init_deposit_for_smart_account = __esm({
2585
2585
  async function sendUserOperation(session, params) {
2586
2586
  const chainId = params.chainId ?? requireActiveChainId();
2587
2587
  const chainConfig = (0, import_read3.getChainConfig)(chainId);
2588
+ if (!chainConfig) {
2589
+ throw new Error(`Chain ${chainId} is not supported`);
2590
+ }
2588
2591
  const chainPublicClient = (0, import_read3.createPublicClientForChain)(chainId);
2589
2592
  const bundlerUrl = chainConfig.bundlerUrl;
2590
2593
  const {
@@ -19557,6 +19560,9 @@ var init_useLogout = __esm({
19557
19560
  async function getUserOperationByHash(userOpHash, chainId) {
19558
19561
  const targetChainId = chainId ?? requireActiveChainId();
19559
19562
  const chainConfig = (0, import_read13.getChainConfig)(targetChainId);
19563
+ if (!chainConfig) {
19564
+ throw new Error(`Chain ${targetChainId} is not supported`);
19565
+ }
19560
19566
  if (!chainConfig.bundlerUrl) {
19561
19567
  throw new Error(`Chain ${targetChainId} has no bundlerUrl configured`);
19562
19568
  }
@@ -19594,6 +19600,9 @@ var init_getUserOperationByHash = __esm({
19594
19600
  async function getUserOperationReceipt(userOpHash, chainId) {
19595
19601
  const targetChainId = chainId ?? requireActiveChainId();
19596
19602
  const chainConfig = (0, import_read14.getChainConfig)(targetChainId);
19603
+ if (!chainConfig) {
19604
+ throw new Error(`Chain ${targetChainId} is not supported`);
19605
+ }
19597
19606
  if (!chainConfig.bundlerUrl) {
19598
19607
  throw new Error(`Chain ${targetChainId} has no bundlerUrl configured`);
19599
19608
  }