@bounded-sh/client 0.0.27 → 0.0.29

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.
@@ -43,37 +43,42 @@ export declare function signInAnonymously(): Promise<User | null>;
43
43
  */
44
44
  export declare function loginWithPrivy(options?: LoginOptions): Promise<User | null>;
45
45
  /**
46
- * @deprecated Inline app-origin OTP is retired. Use
47
- * `loginWithRedirect({ redirectUri, methods: ["email"] })` so the credential is
48
- * entered on the Bounded hosted issuer.
46
+ * Send a 6-digit login code to `email` (Bounded Better Auth). Step 1 of the
47
+ * inline email flow — build your own email/code UI for full control over the
48
+ * look, or just call `login()` for the built-in modal. Works on web AND React
49
+ * Native (no DOM needed). Prefer `loginWithRedirect()`/`loginWithPopup()` if you
50
+ * want the credential entered on Bounded's hosted page instead.
49
51
  */
50
52
  export declare function sendEmailOtp(email: string): Promise<{
51
53
  ok: true;
52
54
  expiresInSeconds?: number;
53
55
  }>;
54
56
  /**
55
- * @deprecated Inline app-origin text OTP is retired. Use hosted login with
56
- * `provider: "text"` or `methods: ["text"]` when text OTP is enabled.
57
+ * Send a 6-digit login code by text message. Requires the configured Bounded
58
+ * auth issuer to have text OTP explicitly enabled and SMS delivery configured.
59
+ * Works on web AND React Native.
57
60
  */
58
61
  export declare function sendTextOtp(phoneNumber: string): Promise<{
59
62
  ok: true;
60
63
  expiresInSeconds?: number;
61
64
  }>;
62
65
  /**
63
- * @deprecated Inline app-origin OTP is retired. Finish hosted login with
64
- * `completeLoginFromRedirect()` on web; React Native `loginWithRedirect()`
65
- * resolves inline.
66
+ * Verify the `code` for `email`, establish the session, and return the user.
67
+ * Step 2 of the inline email flow. Coexists with signInAnonymously()/wallets.
66
68
  */
67
69
  export declare function verifyEmailOtp(email: string, code: string): Promise<User | null>;
68
70
  /**
69
- * @deprecated Inline app-origin text OTP is retired. Finish hosted login with
70
- * `completeLoginFromRedirect()` on web; React Native `loginWithRedirect()`
71
- * resolves inline.
71
+ * Verify the text-message `code`, establish the session, and return the user.
72
+ * Phone-only users have no `user.email`; use `user.id` for app identity.
72
73
  */
73
74
  export declare function verifyTextOtp(phoneNumber: string, code: string): Promise<User | null>;
74
75
  /**
75
- * @deprecated Inline app-origin guest upgrade is retired. Send the user through
76
- * hosted login and transfer guest-owned data explicitly.
76
+ * UPGRADE the current anonymous (guest) session by linking an email — Firebase
77
+ * `linkWithCredential` parity. Send the code first with `sendEmailOtp(email)`,
78
+ * then call `linkEmail(email, code)`. If the email is brand-new the guest's
79
+ * `@user.id` (and its data) is preserved; if the email already exists the user
80
+ * just signs into it (no merge). Requires an active guest session, and the issuer
81
+ * refuses if the wallet is already linked. Browser/React-Native only.
77
82
  */
78
83
  export declare function linkEmail(email: string, code: string): Promise<User | null>;
79
84
  export declare function login(options?: LoginOptions): Promise<User | null>;
@@ -1,22 +1,33 @@
1
1
  import type { AuthProvider, User, TransactionResult, SolTransaction, EVMTransaction, SetOptions } from '@bounded-sh/core';
2
- import type { Transaction, VersionedTransaction } from '@solana/web3.js';
3
- /** @deprecated Inline app-origin OTP is retired. Use loginWithRedirect(). */
2
+ import { Transaction, VersionedTransaction } from '@solana/web3.js';
3
+ /** Send a login code to `email`. Step 1 of the inline email-OTP flow. */
4
4
  export declare function sendEmailOtp(email: string): Promise<{
5
5
  ok: true;
6
6
  expiresInSeconds?: number;
7
7
  }>;
8
- /** @deprecated Inline app-origin text OTP is retired. Use loginWithRedirect(). */
8
+ /** Send a login code by text message. Requires the Bounded issuer to have text OTP explicitly enabled and SMS configured. */
9
9
  export declare function sendTextOtp(phoneNumber: string): Promise<{
10
10
  ok: true;
11
11
  expiresInSeconds?: number;
12
12
  }>;
13
- /** @deprecated Inline app-origin OTP is retired. Use hosted loginWithRedirect(). */
13
+ /**
14
+ * Verify the code for `email` and establish the session. Step 2 of the flow.
15
+ * Stores the Bounded id token (the realtime bearer) and sets the current user.
16
+ */
14
17
  export declare function verifyEmailOtp(email: string, otp: string): Promise<User>;
15
- /** @deprecated Inline app-origin text OTP is retired. Use hosted loginWithRedirect(). */
18
+ /**
19
+ * Verify the text-message code for `phoneNumber` and establish the session.
20
+ * Phone-only users have `user.email === null`; use `user.id` for ownership.
21
+ */
16
22
  export declare function verifyTextOtp(phoneNumber: string, otp: string): Promise<User>;
17
23
  /**
18
- * @deprecated Inline app-origin guest upgrade is retired. Use hosted login and
19
- * transfer guest-owned data explicitly.
24
+ * UPGRADE an anonymous (guest) session by LINKING an email credential — Firebase
25
+ * `linkWithCredential` parity. The guest's `guestToken` is sent to the auth issuer
26
+ * which, IF the email is brand-new, makes the new account ADOPT the guest's id so
27
+ * `@user.id` is preserved and the guest's data carries over. If the email already
28
+ * exists, the user just signs into it (stays separate; `linked:false`). On success
29
+ * the upgraded session replaces the guest session and the user is no longer
30
+ * anonymous. `guestToken` is captured by the caller BEFORE switching auth methods.
20
31
  */
21
32
  export declare function linkEmailWithGuest(email: string, otp: string, guestToken: string): Promise<{
22
33
  user: User;
@@ -29,7 +40,7 @@ export declare class EmailAuthProvider implements AuthProvider {
29
40
  logout(): Promise<void>;
30
41
  signMessage(_message: string): Promise<string>;
31
42
  runTransaction(_evm?: EVMTransaction, _sol?: SolTransaction, _options?: SetOptions): Promise<TransactionResult>;
32
- signTransaction(_transaction: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
43
+ signTransaction(_t: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
33
44
  signAndSubmitTransaction(): Promise<string>;
34
45
  getNativeMethods(): Promise<any>;
35
46
  }