@bounded-sh/client 0.0.28 → 0.0.30
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/auth/index.d.ts +18 -13
- package/dist/auth/oidc-auth.d.ts +7 -1
- package/dist/auth/providers/email-auth-provider.d.ts +19 -8
- package/dist/index.js +549 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +550 -40
- package/dist/index.mjs.map +1 -1
- package/dist/index.native.js +549 -39
- package/dist/index.native.js.map +1 -1
- package/dist/index.native.mjs +550 -40
- package/dist/index.native.mjs.map +1 -1
- package/package.json +14 -14
package/dist/auth/index.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
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
|
-
*
|
|
56
|
-
*
|
|
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
|
-
*
|
|
64
|
-
*
|
|
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
|
-
*
|
|
70
|
-
*
|
|
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
|
-
*
|
|
76
|
-
*
|
|
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>;
|
package/dist/auth/oidc-auth.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { User } from '@bounded-sh/core';
|
|
2
2
|
export type HostedAuthMethod = 'email' | 'text' | 'phone' | 'google' | 'apple' | 'github' | (string & {});
|
|
3
3
|
export interface OidcLoginOptions {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Where the issuer returns the user after login. OPTIONAL on web — defaults to the
|
|
6
|
+
* CURRENT page (`window.location.origin + pathname`), so the user lands back where they
|
|
7
|
+
* started and `completeLoginFromRedirect()` finishes it. REQUIRED on React Native: pass
|
|
8
|
+
* the https universal link whose origin the app owner registered.
|
|
9
|
+
*/
|
|
10
|
+
redirectUri?: string;
|
|
5
11
|
/**
|
|
6
12
|
* Hosted-login methods to show. Omit to show every method enabled on the
|
|
7
13
|
* Bounded issuer. Include social provider ids directly, e.g.
|
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import type { AuthProvider, User, TransactionResult, SolTransaction, EVMTransaction, SetOptions } from '@bounded-sh/core';
|
|
2
|
-
import
|
|
3
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
19
|
-
*
|
|
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(
|
|
43
|
+
signTransaction(_t: Transaction | VersionedTransaction): Promise<Transaction | VersionedTransaction>;
|
|
33
44
|
signAndSubmitTransaction(): Promise<string>;
|
|
34
45
|
getNativeMethods(): Promise<any>;
|
|
35
46
|
}
|