@lumiapassport/ui-kit 1.8.1 → 1.9.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/dist/index.cjs CHANGED
@@ -2077,6 +2077,7 @@ async function verifyEmailLinkCode(email, code) {
2077
2077
  if (!hasValidToken) throw new Error("No authentication token available");
2078
2078
  const response = await (0, import_auth3.authenticatedFetch)(`${getTssUrl3()}/api/auth/link/email/verify-code`, {
2079
2079
  method: "POST",
2080
+ credentials: "include",
2080
2081
  body: JSON.stringify({ email, code })
2081
2082
  });
2082
2083
  if (!response.ok) {
@@ -5626,6 +5627,34 @@ async function signTypedData(session, params) {
5626
5627
  }
5627
5628
  return signature;
5628
5629
  }
5630
+ async function deployAccount(session, feeType = "economy", options) {
5631
+ if (!options?.force) {
5632
+ try {
5633
+ const code = await publicClient.getCode({
5634
+ address: session.smartAccountAddress
5635
+ });
5636
+ const isDeployed = code && code !== "0x" && code.length > 2;
5637
+ if (isDeployed) {
5638
+ console.log("[deployAccount] Account already deployed, skipping deployment");
5639
+ return null;
5640
+ }
5641
+ console.log("[deployAccount] Account not deployed, initiating deployment");
5642
+ } catch (error) {
5643
+ console.warn("[deployAccount] Failed to check deployment status, proceeding with deployment:", error);
5644
+ }
5645
+ }
5646
+ return sendUserOperation(
5647
+ session,
5648
+ "0x0000000000000000000000000000000000000000",
5649
+ // to: burn address
5650
+ "0",
5651
+ // value: 0 (no funds)
5652
+ "0x",
5653
+ // data: empty (no contract call)
5654
+ feeType,
5655
+ "v0.7"
5656
+ );
5657
+ }
5629
5658
  var import_viem3, import_account_abstraction2, import_accounts, import_bundler, import_meta, PAYMASTER_VERIFICATION_GAS_LIMIT, PAYMASTER_POSTOP_GAS_LIMIT, MAX_BUNDLER_VERIFICATION_GAS, PAYMASTER_VERIFICATION_GAS, executeAbi;
5630
5659
  var init_account = __esm({
5631
5660
  "src/internal/clients/account.ts"() {
@@ -5706,6 +5735,7 @@ __export(clients_exports, {
5706
5735
  createAccountSession: () => createAccountSession,
5707
5736
  createAkClient: () => createAkClient,
5708
5737
  createLumiaClient: () => createLumiaClient,
5738
+ deployAccount: () => deployAccount,
5709
5739
  depositForLumiaAccount: () => depositForLumiaAccount,
5710
5740
  depositForSmartAccount: () => depositForSmartAccount,
5711
5741
  getBundlerClient: () => getBundlerClient,
@@ -5751,6 +5781,7 @@ __export(index_exports, {
5751
5781
  ThemeToggle: () => ThemeToggle,
5752
5782
  TransactionsList: () => TransactionsList,
5753
5783
  UserOpStatus: () => UserOpStatus,
5784
+ deployAccount: () => deployAccount,
5754
5785
  getUserProfile: () => getUserProfile,
5755
5786
  lumiaBeam: () => lumiaBeam,
5756
5787
  prepareUserOperation: () => prepareUserOperation,
@@ -7908,7 +7939,6 @@ var UserOpStatus = ({
7908
7939
  const res = await fetch(getBundlerUrl(), {
7909
7940
  method: "POST",
7910
7941
  headers: { "content-type": "application/json" },
7911
- credentials: "include",
7912
7942
  body: JSON.stringify(body)
7913
7943
  });
7914
7944
  const json = await res.json();
@@ -8674,7 +8704,7 @@ function useLumiaPassportLinkedProfiles() {
8674
8704
  // package.json
8675
8705
  var package_default = {
8676
8706
  name: "@lumiapassport/ui-kit",
8677
- version: "1.8.1",
8707
+ version: "1.9.1",
8678
8708
  description: "React UI components and hooks for Lumia Passport authentication and Account Abstraction",
8679
8709
  type: "module",
8680
8710
  main: "./dist/index.cjs",
@@ -9936,7 +9966,6 @@ function useUserOpStatus(options = {}) {
9936
9966
  const res = await fetch(getBundlerUrl(), {
9937
9967
  method: "POST",
9938
9968
  headers: { "content-type": "application/json" },
9939
- credentials: "include",
9940
9969
  body: JSON.stringify(body)
9941
9970
  });
9942
9971
  const json = await res.json();
@@ -10239,6 +10268,7 @@ function useSmartAccountTransactions() {
10239
10268
  ThemeToggle,
10240
10269
  TransactionsList,
10241
10270
  UserOpStatus,
10271
+ deployAccount,
10242
10272
  getUserProfile,
10243
10273
  lumiaBeam,
10244
10274
  prepareUserOperation,