@medialane/sdk 0.85.1 → 0.85.3

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.
@@ -1038,6 +1038,8 @@ type ApiAppSource = "MEDIALANE_STARKNET" | "MEDIALANE_IO" | "MEDIALANE_PORTAL" |
1038
1038
  type ApiChain = "STARKNET" | "ETHEREUM" | "SOLANA" | "BASE" | "BITCOIN";
1039
1039
  interface ApiUserWallet {
1040
1040
  walletAddress: string;
1041
+ email?: string | null;
1042
+ emailVerified?: boolean;
1041
1043
  }
1042
1044
  interface ApiCollectionClaim {
1043
1045
  id: string;
@@ -1374,7 +1376,11 @@ declare class ApiClient {
1374
1376
  appSource?: ApiAppSource;
1375
1377
  chain?: ApiChain;
1376
1378
  emailVerificationToken?: string;
1379
+ email?: string;
1380
+ accountToken?: string;
1377
1381
  }): Promise<ApiUserWallet>;
1382
+ /** Whether an email already has an account attached — used by io's onboarding to branch into an "already exists" message instead of creating a duplicate account. */
1383
+ checkEmailExists(email: string): Promise<boolean>;
1378
1384
  /**
1379
1385
  * Get the authenticated user's stored wallet address from the backend DB.
1380
1386
  * Returns null if the user has not completed onboarding yet.
@@ -1038,6 +1038,8 @@ type ApiAppSource = "MEDIALANE_STARKNET" | "MEDIALANE_IO" | "MEDIALANE_PORTAL" |
1038
1038
  type ApiChain = "STARKNET" | "ETHEREUM" | "SOLANA" | "BASE" | "BITCOIN";
1039
1039
  interface ApiUserWallet {
1040
1040
  walletAddress: string;
1041
+ email?: string | null;
1042
+ emailVerified?: boolean;
1041
1043
  }
1042
1044
  interface ApiCollectionClaim {
1043
1045
  id: string;
@@ -1374,7 +1376,11 @@ declare class ApiClient {
1374
1376
  appSource?: ApiAppSource;
1375
1377
  chain?: ApiChain;
1376
1378
  emailVerificationToken?: string;
1379
+ email?: string;
1380
+ accountToken?: string;
1377
1381
  }): Promise<ApiUserWallet>;
1382
+ /** Whether an email already has an account attached — used by io's onboarding to branch into an "already exists" message instead of creating a duplicate account. */
1383
+ checkEmailExists(email: string): Promise<boolean>;
1378
1384
  /**
1379
1385
  * Get the authenticated user's stored wallet address from the backend DB.
1380
1386
  * Returns null if the user has not completed onboarding yet.
@@ -706,12 +706,21 @@ var ApiClient = class {
706
706
  };
707
707
  if (options.chain) body.chain = options.chain;
708
708
  if (options.emailVerificationToken) body.emailVerificationToken = options.emailVerificationToken;
709
+ if (options.email) body.email = options.email;
710
+ if (options.accountToken) body.accountToken = options.accountToken;
709
711
  return this.request("/v1/users/me", {
710
712
  method: "POST",
711
713
  body: JSON.stringify(body),
712
714
  headers: this.bearer(clerkToken)
713
715
  });
714
716
  }
717
+ /** Whether an email already has an account attached — used by io's onboarding to branch into an "already exists" message instead of creating a duplicate account. */
718
+ async checkEmailExists(email) {
719
+ const { exists } = await this.get(
720
+ `/v1/auth/email/exists?email=${encodeURIComponent(email)}`
721
+ );
722
+ return exists;
723
+ }
715
724
  /**
716
725
  * Get the authenticated user's stored wallet address from the backend DB.
717
726
  * Returns null if the user has not completed onboarding yet.