@bounded-sh/client 0.0.56 → 0.0.58

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.
Files changed (68) hide show
  1. package/REACT_NATIVE.md +31 -8
  2. package/dist/auth/bounded-login-widget.d.ts +25 -0
  3. package/dist/auth/bounded-widget-modal.d.ts +33 -0
  4. package/dist/auth/index.d.ts +42 -0
  5. package/dist/auth/oidc-auth.d.ts +18 -0
  6. package/dist/auth/providers/wallet-login-finalize.d.ts +17 -0
  7. package/dist/auth/providers/wallet-standard-discovery.d.ts +23 -0
  8. package/dist/auth/providers/wallet-standard-tx.d.ts +7 -0
  9. package/dist/auth/turnkey-auth.d.ts +17 -0
  10. package/dist/auth/turnkey-signer-bridge.d.ts +32 -0
  11. package/dist/auth/turnkey-wallet-widget.d.ts +17 -0
  12. package/dist/{email-auth-provider-4Df8dFOh.js → email-auth-provider-BHtR1H_E.js} +2 -2
  13. package/dist/{email-auth-provider-4Df8dFOh.js.map → email-auth-provider-BHtR1H_E.js.map} +1 -1
  14. package/dist/{email-auth-provider-CZ-xYVln.js → email-auth-provider-BlJI-8w9.js} +2 -2
  15. package/dist/{email-auth-provider-CZ-xYVln.js.map → email-auth-provider-BlJI-8w9.js.map} +1 -1
  16. package/dist/{email-auth-provider-By6SL0YS.mjs → email-auth-provider-CX7foEhA.mjs} +2 -2
  17. package/dist/{email-auth-provider-By6SL0YS.mjs.map → email-auth-provider-CX7foEhA.mjs.map} +1 -1
  18. package/dist/{email-auth-provider-BqX-o_sJ.mjs → email-auth-provider-CfNSS8Du.mjs} +2 -2
  19. package/dist/{email-auth-provider-BqX-o_sJ.mjs.map → email-auth-provider-CfNSS8Du.mjs.map} +1 -1
  20. package/dist/{guest-auth-provider-DWcdRvLW.js → guest-auth-provider-BPXDJoEQ.js} +2 -2
  21. package/dist/{guest-auth-provider-DWcdRvLW.js.map → guest-auth-provider-BPXDJoEQ.js.map} +1 -1
  22. package/dist/{guest-auth-provider-D9A4SU4z.js → guest-auth-provider-BRjJV8Zq.js} +2 -2
  23. package/dist/{guest-auth-provider-D9A4SU4z.js.map → guest-auth-provider-BRjJV8Zq.js.map} +1 -1
  24. package/dist/{guest-auth-provider-Q2wbjdHM.mjs → guest-auth-provider-DJmuReVa.mjs} +2 -2
  25. package/dist/{guest-auth-provider-6bqnyX79.mjs.map → guest-auth-provider-DJmuReVa.mjs.map} +1 -1
  26. package/dist/{guest-auth-provider-6bqnyX79.mjs → guest-auth-provider-DxhZ5sWN.mjs} +2 -2
  27. package/dist/{guest-auth-provider-Q2wbjdHM.mjs.map → guest-auth-provider-DxhZ5sWN.mjs.map} +1 -1
  28. package/dist/{index--jrXqxte.mjs → index-DWodlTFG.mjs} +1575 -17
  29. package/dist/index-DWodlTFG.mjs.map +1 -0
  30. package/dist/{index-B_uRc6gn.js → index-MKE9tHpl.js} +1579 -16
  31. package/dist/index-MKE9tHpl.js.map +1 -0
  32. package/dist/index.d.ts +7 -1
  33. package/dist/index.js +6 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/index.mjs +1 -1
  36. package/dist/{index.native-CTVEq0VY.mjs → index.native-CQiw9baS.mjs} +83 -12
  37. package/dist/index.native-CQiw9baS.mjs.map +1 -0
  38. package/dist/{index.native-BqK-14S8.js → index.native-hu3o3zXU.js} +82 -10
  39. package/dist/index.native-hu3o3zXU.js.map +1 -0
  40. package/dist/index.native.d.ts +2 -0
  41. package/dist/index.native.js +2 -1
  42. package/dist/index.native.js.map +1 -1
  43. package/dist/index.native.mjs +1 -1
  44. package/dist/{injected-evm-wallet-provider-xZ01LIw2.js → injected-evm-wallet-provider-BOPzdm7E.js} +2 -2
  45. package/dist/{injected-evm-wallet-provider-xZ01LIw2.js.map → injected-evm-wallet-provider-BOPzdm7E.js.map} +1 -1
  46. package/dist/{injected-evm-wallet-provider-BCR37kRN.mjs → injected-evm-wallet-provider-CnJRLE8P.mjs} +2 -2
  47. package/dist/{injected-evm-wallet-provider-BCR37kRN.mjs.map → injected-evm-wallet-provider-CnJRLE8P.mjs.map} +1 -1
  48. package/dist/{injected-evm-wallet-provider-BZPmj8bC.mjs → injected-evm-wallet-provider-DCGnUedJ.mjs} +2 -2
  49. package/dist/{injected-evm-wallet-provider-BZPmj8bC.mjs.map → injected-evm-wallet-provider-DCGnUedJ.mjs.map} +1 -1
  50. package/dist/{injected-evm-wallet-provider-CXfQT5sm.js → injected-evm-wallet-provider-Xbt2CUPi.js} +2 -2
  51. package/dist/{injected-evm-wallet-provider-CXfQT5sm.js.map → injected-evm-wallet-provider-Xbt2CUPi.js.map} +1 -1
  52. package/dist/{injected-wallet-provider-eMZ8tjas.js → injected-wallet-provider-7ep-jcal.js} +2 -2
  53. package/dist/{injected-wallet-provider-eMZ8tjas.js.map → injected-wallet-provider-7ep-jcal.js.map} +1 -1
  54. package/dist/{injected-wallet-provider-ClI_h_fy.js → injected-wallet-provider-BUvN5Y6_.js} +2 -2
  55. package/dist/{injected-wallet-provider-ClI_h_fy.js.map → injected-wallet-provider-BUvN5Y6_.js.map} +1 -1
  56. package/dist/{injected-wallet-provider-1IRUHyB3.mjs → injected-wallet-provider-Bps6a9IP.mjs} +2 -2
  57. package/dist/{injected-wallet-provider-1IRUHyB3.mjs.map → injected-wallet-provider-Bps6a9IP.mjs.map} +1 -1
  58. package/dist/{injected-wallet-provider-DHQGI0Yl.mjs → injected-wallet-provider-Dg3MieTq.mjs} +2 -2
  59. package/dist/{injected-wallet-provider-DHQGI0Yl.mjs.map → injected-wallet-provider-Dg3MieTq.mjs.map} +1 -1
  60. package/dist/wallet-standard-tx-C1HJFLjC.js +30 -0
  61. package/dist/wallet-standard-tx-C1HJFLjC.js.map +1 -0
  62. package/dist/wallet-standard-tx-DBliTUWH.mjs +27 -0
  63. package/dist/wallet-standard-tx-DBliTUWH.mjs.map +1 -0
  64. package/package.json +9 -3
  65. package/dist/index--jrXqxte.mjs.map +0 -1
  66. package/dist/index-B_uRc6gn.js.map +0 -1
  67. package/dist/index.native-BqK-14S8.js.map +0 -1
  68. package/dist/index.native-CTVEq0VY.mjs.map +0 -1
package/REACT_NATIVE.md CHANGED
@@ -9,22 +9,45 @@ The SDK ships a dedicated React Native entry (`react-native` condition ->
9
9
  React Native has no `localStorage`, no `document`, and no reliable browser
10
10
  base64 helpers, so configure the SDK platform once at app startup:
11
11
 
12
+ > **Security: store login tokens ENCRYPTED, never in plaintext.** The SDK persists
13
+ > whatever adapter you give it, as-is - it adds no encryption of its own. A plain
14
+ > `createMMKV()` (or `AsyncStorage`) leaves the user's session tokens readable to
15
+ > anyone with device/backup/filesystem access. Back the store with the OS secure
16
+ > vault: an MMKV `encryptionKey` kept in the Keychain/Keystore (shown below), or a
17
+ > Keychain-backed adapter directly.
18
+
12
19
  ```ts
13
20
  import "react-native-get-random-values";
14
21
  import "react-native-url-polyfill/auto";
15
22
  import { setPlatform, ReactNativeSessionManager } from "@bounded-sh/client";
16
23
  import { createMMKV } from "react-native-mmkv";
24
+ import * as Keychain from "react-native-keychain";
17
25
  import { decode as atob, encode as btoa } from "base-64";
18
26
 
19
- const store = createMMKV();
20
- const storage = {
21
- getItem: (key: string) => store.getString(key) ?? null,
22
- setItem: (key: string, value: string) => store.set(key, value),
23
- removeItem: (key: string) => store.remove(key),
24
- };
27
+ // Load (or create) a random MMKV encryption key and keep it in the OS secure vault
28
+ // (Keychain on iOS / Keystore-backed on Android) - NEVER hardcode a key in source.
29
+ async function loadEncryptionKey(): Promise<string> {
30
+ const service = "sh.bounded.session";
31
+ const existing = await Keychain.getGenericPassword({ service });
32
+ if (existing) return existing.password;
33
+ const bytes = new Uint8Array(32);
34
+ crypto.getRandomValues(bytes); // from react-native-get-random-values, imported above
35
+ const key = btoa(String.fromCharCode(...bytes));
36
+ await Keychain.setGenericPassword("bounded", key, { service });
37
+ return key;
38
+ }
25
39
 
26
- setPlatform({ storage, sessionStorage: storage, atob, btoa, hasDOM: false });
27
- ReactNativeSessionManager.configure({ storage, atob });
40
+ // Call this once at startup BEFORE using the SDK (e.g. gate your app on it).
41
+ export async function configureBoundedStorage() {
42
+ const store = createMMKV({ id: "sh.bounded.session", encryptionKey: await loadEncryptionKey() });
43
+ const storage = {
44
+ getItem: (key: string) => store.getString(key) ?? null,
45
+ setItem: (key: string, value: string) => store.set(key, value),
46
+ removeItem: (key: string) => store.remove(key),
47
+ };
48
+ setPlatform({ storage, sessionStorage: storage, atob, btoa, hasDOM: false });
49
+ ReactNativeSessionManager.configure({ storage, atob });
50
+ }
28
51
  ```
29
52
 
30
53
  `setPlatform` fills general browser API gaps. `ReactNativeSessionManager.configure`
@@ -0,0 +1,25 @@
1
+ import type { User } from "@bounded-sh/core";
2
+ import type { HostedAuthMethod } from "./oidc-auth";
3
+ export interface BoundedWidgetOptions {
4
+ /** Which hosted methods to surface as buttons. Defaults to ['email','google']. */
5
+ methods?: readonly HostedAuthMethod[];
6
+ /** Show the "Continue with wallet" option. Defaults to auto (on if a wallet is
7
+ * detected or wallet-login is enabled in init config). */
8
+ wallet?: boolean;
9
+ redirectUri?: string;
10
+ title?: string;
11
+ subtitle?: string;
12
+ /**
13
+ * Login mode. Defaults to the app's init() `authMode` (usually "bounded"). In
14
+ * "turnkey" mode the email lane runs Turnkey-native OTP INLINE in the widget
15
+ * (no OIDC popup); social + wallet lanes are unchanged. The widget shape and
16
+ * look are identical in both modes.
17
+ */
18
+ authMode?: "bounded" | "turnkey";
19
+ }
20
+ /**
21
+ * Open the unified Bounded login widget and resolve with the signed-in `User`.
22
+ * Rejects with `Error("cancelled")` if the user dismisses it. `init()` must have
23
+ * run first; call from a user gesture so social/wallet popups are allowed.
24
+ */
25
+ export declare function openBoundedWidget(opts?: BoundedWidgetOptions): Promise<User>;
@@ -0,0 +1,33 @@
1
+ declare function hasDOM(): boolean;
2
+ export interface BoundedModal {
3
+ root: HTMLElement;
4
+ overlay: HTMLElement;
5
+ panel: HTMLElement;
6
+ content: HTMLElement;
7
+ iframe: HTMLIFrameElement | null;
8
+ iframeOrigin: string;
9
+ iframeReady: boolean;
10
+ onBackdrop: (() => void) | null;
11
+ onIframeMessage: ((d: Record<string, unknown>) => void) | null;
12
+ chain: Promise<unknown>;
13
+ fitObserver: ResizeObserver | null;
14
+ }
15
+ export declare function getModal(): BoundedModal;
16
+ export declare function modalIsMounted(): boolean;
17
+ export declare function showModal(m: BoundedModal): void;
18
+ export declare function hideModal(m: BoundedModal, after?: () => void): void;
19
+ export declare function setPanelHeight(m: BoundedModal, px: number): void;
20
+ /**
21
+ * Measure the currently mounted native content and tween the panel to fit it.
22
+ * Re-fits automatically when the card's intrinsic height changes - notably after
23
+ * the Newsreader/Schibsted web fonts swap in (which grows line boxes a few px
24
+ * after first paint) and on inline view swaps (email -> OTP code -> success).
25
+ */
26
+ export declare function fitPanelToContent(m: BoundedModal): void;
27
+ /** Switch the modal into NATIVE-content mode: detach any iframe, mount `node`. */
28
+ export declare function mountContent(m: BoundedModal, node: HTMLElement): void;
29
+ /** Get (or lazily create) the warm iframe for signer/hosted-page mode. */
30
+ export declare function ensureIframe(m: BoundedModal, url: string, origin: string): HTMLIFrameElement;
31
+ export declare function detachIframe(m: BoundedModal): void;
32
+ export declare function ensureFonts(): void;
33
+ export { hasDOM };
@@ -1,4 +1,5 @@
1
1
  import type { AuthProvider, User, ClientConfig } from "@bounded-sh/core";
2
+ import type { InjectedSolanaProvider } from "./providers/injected-wallet-types";
2
3
  /**
3
4
  * Clears the session if it was created by a different auth method.
4
5
  * Returns true if the session was cleared, false if the session is compatible.
@@ -16,6 +17,32 @@ export declare function clearIncompatibleSession(): boolean;
16
17
  * never want it — existing apps that don't opt in see ZERO behavior change.
17
18
  */
18
19
  export declare function isWalletLoginEnabled(config: Partial<ClientConfig>): boolean;
20
+ /**
21
+ * Whether the app explicitly turned the "connect wallet" lane OFF at init()
22
+ * (`walletLogin: false`). This is the hard opt-OUT the unified widget honors: it
23
+ * hides the wallet option entirely even when an injected wallet is detected and
24
+ * even if a per-call `openBoundedWidget({ wallet: true })` asked for it.
25
+ */
26
+ export declare function isWalletLoginDisabled(config: Partial<ClientConfig>): boolean;
27
+ /**
28
+ * Site policy: the app requires an email on file for every user (`requireEmail:
29
+ * true`). Native wallet login carries no email, so the unified widget suppresses
30
+ * the wallet lane when this is set - email/social (which yields an email) remain.
31
+ * This lets a policy deny wallet-only accounts without touching per-call options.
32
+ */
33
+ export declare function isEmailRequired(config: Partial<ClientConfig>): boolean;
34
+ /** The config passed to the last `init()`, or null before init. Read-only view
35
+ * for runtime surfaces (e.g. the unified login widget) that need wallet/rpc
36
+ * settings without re-plumbing them through every call. */
37
+ export declare function getInitConfig(): Partial<ClientConfig> | null;
38
+ /**
39
+ * Which LOGIN mode the app runs (default "bounded"). "turnkey" opts the app into
40
+ * Turnkey-native email OTP: the unified widget runs the code entry INLINE (no OIDC
41
+ * popup) via startTurnkeyEmailLogin(), and Bounded mints the session from Turnkey's
42
+ * verification. The value comes from init() config (`authMode`); a `openBoundedWidget`
43
+ * option can override it per call. Anything other than "turnkey" is "bounded".
44
+ */
45
+ export declare function resolveAuthMode(config: Partial<ClientConfig>): 'bounded' | 'turnkey';
19
46
  export { SOLANA_DEVNET_RPC_URL, SOLANA_MAINNET_RPC_URL, } from "./solana-rpc";
20
47
  export declare function getAuthProvider(config?: Partial<ClientConfig>): Promise<AuthProvider>;
21
48
  /** Per-call overrides forwarded to the active auth provider's modal. */
@@ -50,6 +77,21 @@ export declare function signInAnonymously(): Promise<User | null>;
50
77
  * (web localStorage / RN storage) and identity model. `init()` must have run first.
51
78
  */
52
79
  export declare function loginWithPrivy(options?: LoginOptions): Promise<User | null>;
80
+ /**
81
+ * Log in with an injected Solana WALLET (Phantom / Solflare / Backpack / any
82
+ * Wallet-Standard `window.solana`) as a co-equal RUNTIME route - selectable
83
+ * alongside `login()` / hosted `loginWithPopup()` / `signInAnonymously()` WITHOUT
84
+ * re-`init()`. This is the "Continue with wallet" choice the unified Bounded
85
+ * login widget offers: it NEVER touches Better Auth - the user's real wallet
86
+ * becomes `@user.address` and login is a SIWS signature.
87
+ *
88
+ * `getProvider` pins a specific discovered wallet (e.g. when the widget lists
89
+ * several); omit it to use Phantom-first discovery. Must be called from a user
90
+ * gesture so the wallet's connect prompt is allowed. `init()` must have run first.
91
+ */
92
+ export declare function loginWithWallet(options?: {
93
+ getProvider?: () => InjectedSolanaProvider | null | undefined;
94
+ }): Promise<User | null>;
53
95
  export declare function login(options?: LoginOptions): Promise<User | null>;
54
96
  export declare function getCurrentAuthMethod(): string | null;
55
97
  export interface LogoutOptions {
@@ -29,6 +29,12 @@ export interface OidcLoginOptions {
29
29
  * silently re-signed-in as the same one. `'select_account'` behaves the same.
30
30
  */
31
31
  prompt?: 'login' | 'select_account' | 'consent' | 'none' | (string & {});
32
+ /**
33
+ * Standard OIDC `login_hint` - prefill the identifier (e.g. the email the user
34
+ * already typed in the unified widget's card) so the hosted page can skip
35
+ * straight to the OTP step instead of asking for it again.
36
+ */
37
+ loginHint?: string;
32
38
  }
33
39
  export interface PopupLoginOptions extends OidcLoginOptions {
34
40
  width?: number;
@@ -60,3 +66,15 @@ export declare function loginWithPopup(opts: PopupLoginOptions): Promise<User>;
60
66
  /** Call this on the redirect_uri page when login was opened via loginWithPopup(): posts the
61
67
  * code back to the opener and closes. (For the redirect variant use completeLoginFromRedirect.) */
62
68
  export declare function completeLoginInPopup(openerOrigin: string): void;
69
+ export declare function establishInlineSession(data: {
70
+ idToken?: string;
71
+ id_token?: string;
72
+ accessToken?: string;
73
+ access_token?: string;
74
+ refreshToken?: string;
75
+ bounded_refresh_token?: string;
76
+ }): Promise<User>;
77
+ export declare function inlineAuthEndpoint(): Promise<{
78
+ base: string;
79
+ appId: string;
80
+ }>;
@@ -0,0 +1,17 @@
1
+ export interface WalletLoginFinalizeDeps {
2
+ /** The wallet address that just signed in (the identity the app should end up as). */
3
+ finalAddress: string;
4
+ /** Read the currently stored Bounded session (null if none). */
5
+ getSession: () => Promise<{
6
+ address?: string | null;
7
+ } | null>;
8
+ /** Mint + store a Bounded session for `finalAddress`. Rejects on failure. */
9
+ createSession: () => Promise<void>;
10
+ /** Drop any stored session (used to clear a stale/mismatched one on failure). */
11
+ clearSession: () => Promise<void> | void;
12
+ /** Called exactly once when the login is confirmed: set current user + resolve. */
13
+ onSuccess: () => void;
14
+ /** Called exactly once when the login must fail: reject with this error. */
15
+ onFailure: (error: unknown) => void;
16
+ }
17
+ export declare function finalizeWalletLogin(deps: WalletLoginFinalizeDeps): Promise<void>;
@@ -0,0 +1,23 @@
1
+ import type { Wallet } from "@wallet-standard/base";
2
+ import type { InjectedSolanaProvider } from "./injected-wallet-types";
3
+ export interface StandardWalletChoice {
4
+ name: string;
5
+ /** data: URI the wallet advertises, or undefined. */
6
+ icon?: string;
7
+ /** Adapt the registered wallet to the slim injected-provider shape. */
8
+ getProvider: () => InjectedSolanaProvider;
9
+ }
10
+ /**
11
+ * Adapt a Wallet Standard wallet to the slim `InjectedSolanaProvider` the SDK's
12
+ * wallet-login + signing path consumes. Connect resolves (and caches) the active
13
+ * account; sign* delegate to the wallet's own Solana features. Nothing is
14
+ * wallet-name specific.
15
+ */
16
+ export declare function standardWalletToInjectedProvider(wallet: Wallet): InjectedSolanaProvider;
17
+ /**
18
+ * Enumerate every Solana-capable wallet currently registered with the Wallet
19
+ * Standard, newest registrations included. Returns login-ready choices (name +
20
+ * icon + provider factory). Empty array off-browser or when no wallet is present;
21
+ * the widget then falls back to the legacy injected `window.solana` probe.
22
+ */
23
+ export declare function discoverStandardWallets(): StandardWalletChoice[];
@@ -0,0 +1,7 @@
1
+ import { Transaction, VersionedTransaction } from "@solana/web3.js";
2
+ /** Serialize an unsigned Transaction/VersionedTransaction to the wire bytes the
3
+ * wallet-standard sign features expect (legacy skips signature verification). */
4
+ export declare function serializeUnsignedTx(tx: Transaction | VersionedTransaction): Uint8Array;
5
+ /** Deserialize the signed bytes a wallet returns, round-tripping legacy or
6
+ * versioned transactions correctly. */
7
+ export declare function deserializeSignedTx(bytes: Uint8Array): Transaction | VersionedTransaction;
@@ -0,0 +1,17 @@
1
+ import type { User } from '@bounded-sh/core';
2
+ export interface TurnkeyEmailLoginHandle {
3
+ /** The email the code was sent to (echo, for the widget's "code sent to ..." line). */
4
+ email: string;
5
+ /**
6
+ * Complete login with the 6-digit code the user received. Seals the code to Turnkey,
7
+ * verifies it server-side, and resolves with the signed-in User. Rejects with a
8
+ * user-safe Error on an invalid/expired code (the handle stays usable for a retry).
9
+ */
10
+ verify(code: string): Promise<User>;
11
+ }
12
+ /**
13
+ * Begin authMode:"turnkey" login: ask Turnkey to email a one-time code to `email`.
14
+ * Resolves with a handle whose `verify(code)` finishes the login. Web-only (the sealing
15
+ * step needs the signer iframe); on React Native use loginWithRedirect() instead.
16
+ */
17
+ export declare function startTurnkeyEmailLogin(email: string): Promise<TurnkeyEmailLoginHandle>;
@@ -0,0 +1,32 @@
1
+ export interface TurnkeySignResult {
2
+ /** 64-byte ed25519 signature. */
3
+ signature: Uint8Array;
4
+ /** The signer's Solana address (base58). */
5
+ address: string;
6
+ /** The user's Turnkey sub-org id. */
7
+ subOrgId: string;
8
+ }
9
+ export interface TurnkeyWallet {
10
+ address: string;
11
+ subOrgId: string;
12
+ }
13
+ /**
14
+ * Get-or-create the user's non-custodial Turnkey wallet, resolving with its stable
15
+ * Solana address. On first use the popup enrolls a device passkey (Face ID / Touch ID)
16
+ * and creates the wallet (lazy) with no email code; if the wallet already exists it
17
+ * resolves immediately without a prompt. Call from a USER GESTURE.
18
+ *
19
+ * Use this to learn the fee-payer address BEFORE building a transaction to sign.
20
+ */
21
+ export declare function getOrCreateTurnkeyWallet(): Promise<TurnkeyWallet>;
22
+ /**
23
+ * Open the Bounded Turnkey signer popup and sign `message` (raw bytes) with the
24
+ * user's non-custodial Turnkey wallet, resolving with the ed25519 signature +
25
+ * the wallet address. MUST be called from a USER GESTURE (click/tap) or the
26
+ * browser blocks the popup.
27
+ *
28
+ * On the user's FIRST signature the popup transparently enrolls a device passkey
29
+ * (Face ID / Touch ID) and creates their wallet - no email code. Subsequent
30
+ * signatures are just a passkey approval.
31
+ */
32
+ export declare function signSolanaMessageViaTurnkey(message: Uint8Array): Promise<TurnkeySignResult>;
@@ -0,0 +1,17 @@
1
+ export interface WidgetExchange {
2
+ request: Record<string, unknown>;
3
+ onResult: (d: Record<string, unknown>) => {
4
+ done: true;
5
+ value: unknown;
6
+ } | {
7
+ done: false;
8
+ } | {
9
+ error: string;
10
+ };
11
+ }
12
+ /**
13
+ * Run one signer exchange through the in-app widget. Resolves when `onResult`
14
+ * accepts a result; falls back to `popupFallback` if the frame cannot run WebAuthn
15
+ * (Safari cross-origin create) or cannot be mounted.
16
+ */
17
+ export declare function runWidget<T>(url: string, signerOrigin: string, ex: WidgetExchange, popupFallback: () => Promise<T>): Promise<T>;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var core = require('@bounded-sh/core');
4
- var index = require('./index-B_uRc6gn.js');
4
+ var index = require('./index-MKE9tHpl.js');
5
5
  require('react');
6
6
 
7
7
  // Web uses localStorage (WebSessionManager); React Native uses the configured
@@ -99,4 +99,4 @@ const emailProviderSingleton = new EmailAuthProvider();
99
99
 
100
100
  exports.EmailAuthProvider = EmailAuthProvider;
101
101
  exports.emailProviderSingleton = emailProviderSingleton;
102
- //# sourceMappingURL=email-auth-provider-4Df8dFOh.js.map
102
+ //# sourceMappingURL=email-auth-provider-BHtR1H_E.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-auth-provider-4Df8dFOh.js","sources":["../.rollup-tmp/auth/providers/email-auth-provider.js"],"sourcesContent":["import { getActiveSessionManager } from '@bounded-sh/core';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { hasEmbeddedWallet, hasEmbeddedEvmWallet, embeddedSignAndSubmit, embeddedRunEvmTransaction, EMBEDDED_WALLET_UNSUPPORTED, } from '../crossmint-signer-bridge';\n// Web uses localStorage (WebSessionManager); React Native uses the configured\n// ReactNativeSessionManager. getActiveSessionManager() picks the right one by\n// whether the RN manager was configured (NOT `typeof window`, which is truthy on\n// RN too and would wrongly route to localStorage). Same selector the core\n// request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.\nconst sessionManager = getActiveSessionManager;\nconst NO_WALLET = 'Email login has no embedded wallet. Enable `\"auth\": { \"wallets\": true }` in ' +\n 'the app policy so email logins get a non-custodial Crossmint wallet ' +\n '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +\n 'provider (e.g. Phantom) for onchain actions.';\n// ---------------------------------------------------------------------------\n// token / session helpers\n// ---------------------------------------------------------------------------\nfunction decodeJwt(token) {\n try {\n let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n const pad = b64.length % 4;\n if (pad === 2)\n b64 += '==';\n else if (pad === 3)\n b64 += '=';\n // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).\n return JSON.parse(getPlatform().atob(b64));\n }\n catch (_a) {\n return {};\n }\n}\nfunction userFromIdToken(idToken, fallbackEmail) {\n const c = decodeJwt(idToken);\n const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';\n const email = (c.email || fallbackEmail || null);\n // Email logins have no wallet — address is null (the User type allows it).\n const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])\n ? c['custom:evmWalletAddress'].toLowerCase()\n : null;\n return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };\n}\n// ---------------------------------------------------------------------------\n// provider\n// ---------------------------------------------------------------------------\nexport class EmailAuthProvider {\n async login() {\n throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +\n 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');\n }\n async restoreSession() {\n const sm = sessionManager();\n const session = await sm.getSession();\n if (!session)\n return null;\n const idToken = sm.getIdToken();\n if (!idToken)\n return null;\n const user = userFromIdToken(idToken);\n setCurrentUser(user);\n return user;\n }\n async logout() {\n sessionManager().clearSession();\n setCurrentUser(null);\n }\n // Crossmint Solana smart wallets sign+submit atomically and cannot produce a\n // raw signature — signMessage/signTransaction are structurally unsupported\n // (throw the clear \"use signAndSubmitTransaction\" error when a wallet exists;\n // the no-wallet error otherwise). signAndSubmitTransaction routes through the\n // Bounded signer popup for wallets-enabled email logins.\n async signMessage(_message) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async runTransaction(evm, sol, options) {\n if (evm && sol)\n throw new Error('A transaction cannot target EVM and Solana at the same time.');\n if (!evm)\n throw new Error(NO_WALLET);\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)\n throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');\n if (!hasEmbeddedEvmWallet())\n throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');\n return embeddedRunEvmTransaction(evm);\n }\n async signTransaction(_t) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n if (!hasEmbeddedWallet())\n throw new Error(NO_WALLET);\n return embeddedSignAndSubmit(transaction);\n }\n async getNativeMethods() { return {}; }\n}\nconst emailProviderSingleton = new EmailAuthProvider();\nexport { emailProviderSingleton };\n"],"names":["getActiveSessionManager","getPlatform","setCurrentUser","hasEmbeddedWallet","EMBEDDED_WALLET_UNSUPPORTED","hasEmbeddedEvmWallet","embeddedRunEvmTransaction","embeddedSignAndSubmit"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAGA,4BAAuB;AAC9C,MAAM,SAAS,GAAG,8EAA8E;AAChG,IAAI,sEAAsE;AAC1E,IAAI,yEAAyE;AAC7E,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CA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AAI,CAACC,0BAAoB,EAAE;AACnC,YAAY,MAAM,IAAI,KAAK,CAAC,gHAAgH,CAAC;AAC7I,QAAQ,OAAOC,+BAAyB,CAAC,GAAG,CAAC;AAC7C,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,EAAE,EAAE;AAC9B,QAAQ,MAAM,IAAI,KAAK,CAACH,uBAAiB,EAAE,GAAGC,iCAA2B,GAAG,SAAS,CAAC;AACtF,IAAI;AACJ,IAAI,MAAM,wBAAwB,CAAC,WAAW,EAAE,SAAS,EAAE;AAC3D,QAAQ,IAAI,CAACD,uBAAiB,EAAE;AAChC,YAAY,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC;AACtC,QAAQ,OAAOI,2BAAqB,CAAC,WAAW,CAAC;AACjD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;;"}
1
+ {"version":3,"file":"email-auth-provider-BHtR1H_E.js","sources":["../.rollup-tmp/auth/providers/email-auth-provider.js"],"sourcesContent":["import { getActiveSessionManager } from '@bounded-sh/core';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { hasEmbeddedWallet, hasEmbeddedEvmWallet, embeddedSignAndSubmit, embeddedRunEvmTransaction, EMBEDDED_WALLET_UNSUPPORTED, } from '../crossmint-signer-bridge';\n// Web uses localStorage (WebSessionManager); React Native uses the configured\n// ReactNativeSessionManager. getActiveSessionManager() picks the right one by\n// whether the RN manager was configured (NOT `typeof window`, which is truthy on\n// RN too and would wrongly route to localStorage). Same selector the core\n// request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.\nconst sessionManager = getActiveSessionManager;\nconst NO_WALLET = 'Email login has no embedded wallet. Enable `\"auth\": { \"wallets\": true }` in ' +\n 'the app policy so email logins get a non-custodial Crossmint wallet ' +\n '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +\n 'provider (e.g. Phantom) for onchain actions.';\n// ---------------------------------------------------------------------------\n// token / session helpers\n// ---------------------------------------------------------------------------\nfunction decodeJwt(token) {\n try {\n let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n const pad = b64.length % 4;\n if (pad === 2)\n b64 += '==';\n else if (pad === 3)\n b64 += '=';\n // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).\n return JSON.parse(getPlatform().atob(b64));\n }\n catch (_a) {\n return {};\n }\n}\nfunction userFromIdToken(idToken, fallbackEmail) {\n const c = decodeJwt(idToken);\n const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';\n const email = (c.email || fallbackEmail || null);\n // Email logins have no wallet — address is null (the User type allows it).\n const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])\n ? c['custom:evmWalletAddress'].toLowerCase()\n : null;\n return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };\n}\n// ---------------------------------------------------------------------------\n// provider\n// ---------------------------------------------------------------------------\nexport class EmailAuthProvider {\n async login() {\n throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +\n 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');\n }\n async restoreSession() {\n const sm = sessionManager();\n const session = await sm.getSession();\n if (!session)\n return null;\n const idToken = sm.getIdToken();\n if (!idToken)\n return null;\n const user = userFromIdToken(idToken);\n setCurrentUser(user);\n return user;\n }\n async logout() {\n sessionManager().clearSession();\n setCurrentUser(null);\n }\n // Crossmint Solana smart wallets sign+submit atomically and cannot produce a\n // raw signature — signMessage/signTransaction are structurally unsupported\n // (throw the clear \"use signAndSubmitTransaction\" error when a wallet exists;\n // the no-wallet error otherwise). signAndSubmitTransaction routes through the\n // Bounded signer popup for wallets-enabled email logins.\n async signMessage(_message) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async runTransaction(evm, sol, options) {\n if (evm && sol)\n throw new Error('A transaction cannot target EVM and Solana at the same time.');\n if (!evm)\n throw new Error(NO_WALLET);\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)\n throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');\n if (!hasEmbeddedEvmWallet())\n throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');\n return embeddedRunEvmTransaction(evm);\n }\n async signTransaction(_t) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n if (!hasEmbeddedWallet())\n throw new Error(NO_WALLET);\n return embeddedSignAndSubmit(transaction);\n }\n async getNativeMethods() { return {}; }\n}\nconst emailProviderSingleton = new EmailAuthProvider();\nexport { emailProviderSingleton };\n"],"names":["getActiveSessionManager","getPlatform","setCurrentUser","hasEmbeddedWallet","EMBEDDED_WALLET_UNSUPPORTED","hasEmbeddedEvmWallet","embeddedRunEvmTransaction","embeddedSignAndSubmit"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAGA,4BAAuB;AAC9C,MAAM,SAAS,GAAG,8EAA8E;AAChG,IAAI,sEAAsE;AAC1E,IAAI,yEAAyE;AAC7E,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC3E,QAAQ,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC;AAClC,QAAQ,IAAI,GAAG,KAAK,CAAC;AACrB,YAAY,GAAG,IAAI,IAAI;AACvB,aAA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S,CAAC;AACtF,IAAI;AACJ,IAAI,MAAM,wBAAwB,CAAC,WAAW,EAAE,SAAS,EAAE;AAC3D,QAAQ,IAAI,CAACD,uBAAiB,EAAE;AAChC,YAAY,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC;AACtC,QAAQ,OAAOI,2BAAqB,CAAC,WAAW,CAAC;AACjD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;;"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var core = require('@bounded-sh/core');
4
- var index_native = require('./index.native-BqK-14S8.js');
4
+ var index_native = require('./index.native-hu3o3zXU.js');
5
5
  require('react');
6
6
 
7
7
  // Web uses localStorage (WebSessionManager); React Native uses the configured
@@ -99,4 +99,4 @@ const emailProviderSingleton = new EmailAuthProvider();
99
99
 
100
100
  exports.EmailAuthProvider = EmailAuthProvider;
101
101
  exports.emailProviderSingleton = emailProviderSingleton;
102
- //# sourceMappingURL=email-auth-provider-CZ-xYVln.js.map
102
+ //# sourceMappingURL=email-auth-provider-BlJI-8w9.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-auth-provider-CZ-xYVln.js","sources":["../.rollup-tmp/auth/providers/email-auth-provider.js"],"sourcesContent":["import { getActiveSessionManager } from '@bounded-sh/core';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { hasEmbeddedWallet, hasEmbeddedEvmWallet, embeddedSignAndSubmit, embeddedRunEvmTransaction, EMBEDDED_WALLET_UNSUPPORTED, } from '../crossmint-signer-bridge';\n// Web uses localStorage (WebSessionManager); React Native uses the configured\n// ReactNativeSessionManager. getActiveSessionManager() picks the right one by\n// whether the RN manager was configured (NOT `typeof window`, which is truthy on\n// RN too and would wrongly route to localStorage). Same selector the core\n// request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.\nconst sessionManager = getActiveSessionManager;\nconst NO_WALLET = 'Email login has no embedded wallet. Enable `\"auth\": { \"wallets\": true }` in ' +\n 'the app policy so email logins get a non-custodial Crossmint wallet ' +\n '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +\n 'provider (e.g. Phantom) for onchain actions.';\n// ---------------------------------------------------------------------------\n// token / session helpers\n// ---------------------------------------------------------------------------\nfunction decodeJwt(token) {\n try {\n let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n const pad = b64.length % 4;\n if (pad === 2)\n b64 += '==';\n else if (pad === 3)\n b64 += '=';\n // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).\n return JSON.parse(getPlatform().atob(b64));\n }\n catch (_a) {\n return {};\n }\n}\nfunction userFromIdToken(idToken, fallbackEmail) {\n const c = decodeJwt(idToken);\n const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';\n const email = (c.email || fallbackEmail || null);\n // Email logins have no wallet — address is null (the User type allows it).\n const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])\n ? c['custom:evmWalletAddress'].toLowerCase()\n : null;\n return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };\n}\n// ---------------------------------------------------------------------------\n// provider\n// ---------------------------------------------------------------------------\nexport class EmailAuthProvider {\n async login() {\n throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +\n 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');\n }\n async restoreSession() {\n const sm = sessionManager();\n const session = await sm.getSession();\n if (!session)\n return null;\n const idToken = sm.getIdToken();\n if (!idToken)\n return null;\n const user = userFromIdToken(idToken);\n setCurrentUser(user);\n return user;\n }\n async logout() {\n sessionManager().clearSession();\n setCurrentUser(null);\n }\n // Crossmint Solana smart wallets sign+submit atomically and cannot produce a\n // raw signature — signMessage/signTransaction are structurally unsupported\n // (throw the clear \"use signAndSubmitTransaction\" error when a wallet exists;\n // the no-wallet error otherwise). signAndSubmitTransaction routes through the\n // Bounded signer popup for wallets-enabled email logins.\n async signMessage(_message) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async runTransaction(evm, sol, options) {\n if (evm && sol)\n throw new Error('A transaction cannot target EVM and Solana at the same time.');\n if (!evm)\n throw new Error(NO_WALLET);\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)\n throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');\n if (!hasEmbeddedEvmWallet())\n throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');\n return embeddedRunEvmTransaction(evm);\n }\n async signTransaction(_t) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n if (!hasEmbeddedWallet())\n throw new Error(NO_WALLET);\n return embeddedSignAndSubmit(transaction);\n }\n async getNativeMethods() { return {}; }\n}\nconst emailProviderSingleton = new EmailAuthProvider();\nexport { emailProviderSingleton };\n"],"names":["getActiveSessionManager","getPlatform","setCurrentUser","hasEmbeddedWallet","EMBEDDED_WALLET_UNSUPPORTED","hasEmbeddedEvmWallet","embeddedRunEvmTransaction","embeddedSignAndSubmit"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAGA,4BAAuB;AAC9C,MAAM,SAAS,GAAG,8EAA8E;AAChG,IAAI,sEAAsE;AAC1E,IAAI,yEAAyE;AAC7E,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE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,CAAC,GAAG,CAAC;AAC7C,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,EAAE,EAAE;AAC9B,QAAQ,MAAM,IAAI,KAAK,CAACH,8BAAiB,EAAE,GAAGC,wCAA2B,GAAG,SAAS,CAAC;AACtF,IAAI;AACJ,IAAI,MAAM,wBAAwB,CAAC,WAAW,EAAE,SAAS,EAAE;AAC3D,QAAQ,IAAI,CAACD,8BAAiB,EAAE;AAChC,YAAY,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC;AACtC,QAAQ,OAAOI,kCAAqB,CAAC,WAAW,CAAC;AACjD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;;"}
1
+ {"version":3,"file":"email-auth-provider-BlJI-8w9.js","sources":["../.rollup-tmp/auth/providers/email-auth-provider.js"],"sourcesContent":["import { getActiveSessionManager } from '@bounded-sh/core';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { hasEmbeddedWallet, hasEmbeddedEvmWallet, embeddedSignAndSubmit, embeddedRunEvmTransaction, EMBEDDED_WALLET_UNSUPPORTED, } from '../crossmint-signer-bridge';\n// Web uses localStorage (WebSessionManager); React Native uses the configured\n// ReactNativeSessionManager. getActiveSessionManager() picks the right one by\n// whether the RN manager was configured (NOT `typeof window`, which is truthy on\n// RN too and would wrongly route to localStorage). Same selector the core\n// request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.\nconst sessionManager = getActiveSessionManager;\nconst NO_WALLET = 'Email login has no embedded wallet. Enable `\"auth\": { \"wallets\": true }` in ' +\n 'the app policy so email logins get a non-custodial Crossmint wallet ' +\n '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +\n 'provider (e.g. Phantom) for onchain actions.';\n// ---------------------------------------------------------------------------\n// token / session helpers\n// ---------------------------------------------------------------------------\nfunction decodeJwt(token) {\n try {\n let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n const pad = b64.length % 4;\n if (pad === 2)\n b64 += '==';\n else if (pad === 3)\n b64 += '=';\n // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).\n return JSON.parse(getPlatform().atob(b64));\n }\n catch (_a) {\n return {};\n }\n}\nfunction userFromIdToken(idToken, fallbackEmail) {\n const c = decodeJwt(idToken);\n const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';\n const email = (c.email || fallbackEmail || null);\n // Email logins have no wallet — address is null (the User type allows it).\n const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])\n ? c['custom:evmWalletAddress'].toLowerCase()\n : null;\n return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };\n}\n// ---------------------------------------------------------------------------\n// provider\n// ---------------------------------------------------------------------------\nexport class EmailAuthProvider {\n async login() {\n throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +\n 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');\n }\n async restoreSession() {\n const sm = sessionManager();\n const session = await sm.getSession();\n if (!session)\n return null;\n const idToken = sm.getIdToken();\n if (!idToken)\n return null;\n const user = userFromIdToken(idToken);\n setCurrentUser(user);\n return user;\n }\n async logout() {\n sessionManager().clearSession();\n setCurrentUser(null);\n }\n // Crossmint Solana smart wallets sign+submit atomically and cannot produce a\n // raw signature — signMessage/signTransaction are structurally unsupported\n // (throw the clear \"use signAndSubmitTransaction\" error when a wallet exists;\n // the no-wallet error otherwise). signAndSubmitTransaction routes through the\n // Bounded signer popup for wallets-enabled email logins.\n async signMessage(_message) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async runTransaction(evm, sol, options) {\n if (evm && sol)\n throw new Error('A transaction cannot target EVM and Solana at the same time.');\n if (!evm)\n throw new Error(NO_WALLET);\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)\n throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');\n if (!hasEmbeddedEvmWallet())\n throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');\n return embeddedRunEvmTransaction(evm);\n }\n async signTransaction(_t) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n if (!hasEmbeddedWallet())\n throw new Error(NO_WALLET);\n return embeddedSignAndSubmit(transaction);\n }\n async getNativeMethods() { return {}; }\n}\nconst emailProviderSingleton = new EmailAuthProvider();\nexport { emailProviderSingleton };\n"],"names":["getActiveSessionManager","getPlatform","setCurrentUser","hasEmbeddedWallet","EMBEDDED_WALLET_UNSUPPORTED","hasEmbeddedEvmWallet","embeddedRunEvmTransaction","embeddedSignAndSubmit"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAGA,4BAAuB;AAC9C,MAAM,SAAS,GAAG,8EAA8E;AAChG,IAAI,sEAAsE;AAC1E,IAAI,yEAAyE;AAC7E,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC3E,QAAQ,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC;AAClC,QAAQ,IAAI,GAAG,KAAK,CAAC;AACrB,YAAY,GAAG,IAAI,IAAI;AACvB,aAAa,IAAI,GAAG,KAAK,CAAC;AAC1B,YAAY,GAAG,IAAI,GAAG;AACtB;AACA,QAAQ,OAAO,IAAI,CAAC,KAAK,CAACC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BAAiB,EAAE;AAChC,YAAY,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC;AACtC,QAAQ,OAAOI,kCAAqB,CAAC,WAAW,CAAC;AACjD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { getActiveSessionManager } from '@bounded-sh/core';
2
- import { s as setCurrentUser, E as EMBEDDED_WALLET_UNSUPPORTED, h as hasEmbeddedWallet, a as hasEmbeddedEvmWallet, e as embeddedRunEvmTransaction, b as embeddedSignAndSubmit, g as getPlatform } from './index--jrXqxte.mjs';
2
+ import { s as setCurrentUser, E as EMBEDDED_WALLET_UNSUPPORTED, h as hasEmbeddedWallet, a as hasEmbeddedEvmWallet, e as embeddedRunEvmTransaction, b as embeddedSignAndSubmit, g as getPlatform } from './index-DWodlTFG.mjs';
3
3
  import 'react';
4
4
 
5
5
  // Web uses localStorage (WebSessionManager); React Native uses the configured
@@ -96,4 +96,4 @@ class EmailAuthProvider {
96
96
  const emailProviderSingleton = new EmailAuthProvider();
97
97
 
98
98
  export { EmailAuthProvider, emailProviderSingleton };
99
- //# sourceMappingURL=email-auth-provider-By6SL0YS.mjs.map
99
+ //# sourceMappingURL=email-auth-provider-CX7foEhA.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-auth-provider-By6SL0YS.mjs","sources":["../.rollup-tmp/auth/providers/email-auth-provider.js"],"sourcesContent":["import { getActiveSessionManager } from '@bounded-sh/core';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { hasEmbeddedWallet, hasEmbeddedEvmWallet, embeddedSignAndSubmit, embeddedRunEvmTransaction, EMBEDDED_WALLET_UNSUPPORTED, } from '../crossmint-signer-bridge';\n// Web uses localStorage (WebSessionManager); React Native uses the configured\n// ReactNativeSessionManager. getActiveSessionManager() picks the right one by\n// whether the RN manager was configured (NOT `typeof window`, which is truthy on\n// RN too and would wrongly route to localStorage). Same selector the core\n// request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.\nconst sessionManager = getActiveSessionManager;\nconst NO_WALLET = 'Email login has no embedded wallet. Enable `\"auth\": { \"wallets\": true }` in ' +\n 'the app policy so email logins get a non-custodial Crossmint wallet ' +\n '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +\n 'provider (e.g. Phantom) for onchain actions.';\n// ---------------------------------------------------------------------------\n// token / session helpers\n// ---------------------------------------------------------------------------\nfunction decodeJwt(token) {\n try {\n let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n const pad = b64.length % 4;\n if (pad === 2)\n b64 += '==';\n else if (pad === 3)\n b64 += '=';\n // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).\n return JSON.parse(getPlatform().atob(b64));\n }\n catch (_a) {\n return {};\n }\n}\nfunction userFromIdToken(idToken, fallbackEmail) {\n const c = decodeJwt(idToken);\n const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';\n const email = (c.email || fallbackEmail || null);\n // Email logins have no wallet — address is null (the User type allows it).\n const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])\n ? c['custom:evmWalletAddress'].toLowerCase()\n : null;\n return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };\n}\n// ---------------------------------------------------------------------------\n// provider\n// ---------------------------------------------------------------------------\nexport class EmailAuthProvider {\n async login() {\n throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +\n 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');\n }\n async restoreSession() {\n const sm = sessionManager();\n const session = await sm.getSession();\n if (!session)\n return null;\n const idToken = sm.getIdToken();\n if (!idToken)\n return null;\n const user = userFromIdToken(idToken);\n setCurrentUser(user);\n return user;\n }\n async logout() {\n sessionManager().clearSession();\n setCurrentUser(null);\n }\n // Crossmint Solana smart wallets sign+submit atomically and cannot produce a\n // raw signature — signMessage/signTransaction are structurally unsupported\n // (throw the clear \"use signAndSubmitTransaction\" error when a wallet exists;\n // the no-wallet error otherwise). signAndSubmitTransaction routes through the\n // Bounded signer popup for wallets-enabled email logins.\n async signMessage(_message) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async runTransaction(evm, sol, options) {\n if (evm && sol)\n throw new Error('A transaction cannot target EVM and Solana at the same time.');\n if (!evm)\n throw new Error(NO_WALLET);\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)\n throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');\n if (!hasEmbeddedEvmWallet())\n throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');\n return embeddedRunEvmTransaction(evm);\n }\n async signTransaction(_t) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n if (!hasEmbeddedWallet())\n throw new Error(NO_WALLET);\n return embeddedSignAndSubmit(transaction);\n }\n async getNativeMethods() { return {}; }\n}\nconst emailProviderSingleton = new EmailAuthProvider();\nexport { emailProviderSingleton };\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,uBAAuB;AAC9C,MAAM,SAAS,GAAG,8EAA8E;AAChG,IAAI,sEAAsE;AAC1E,IAAI,yEAAyE;AAC7E,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CA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AC;AAC7C,IAAI;AACJ,IAAI,MAAM,eAAe,CAAC,EAAE,EAAE;AAC9B,QAAQ,MAAM,IAAI,KAAK,CAAC,iBAAiB,EAAE,GAAG,2BAA2B,GAAG,SAAS,CAAC;AACtF,IAAI;AACJ,IAAI,MAAM,wBAAwB,CAAC,WAAW,EAAE,SAAS,EAAE;AAC3D,QAAQ,IAAI,CAAC,iBAAiB,EAAE;AAChC,YAAY,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC;AACtC,QAAQ,OAAO,qBAAqB,CAAC,WAAW,CAAC;AACjD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;"}
1
+ {"version":3,"file":"email-auth-provider-CX7foEhA.mjs","sources":["../.rollup-tmp/auth/providers/email-auth-provider.js"],"sourcesContent":["import { getActiveSessionManager } from '@bounded-sh/core';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { hasEmbeddedWallet, hasEmbeddedEvmWallet, embeddedSignAndSubmit, embeddedRunEvmTransaction, EMBEDDED_WALLET_UNSUPPORTED, } from '../crossmint-signer-bridge';\n// Web uses localStorage (WebSessionManager); React Native uses the configured\n// ReactNativeSessionManager. getActiveSessionManager() picks the right one by\n// whether the RN manager was configured (NOT `typeof window`, which is truthy on\n// RN too and would wrongly route to localStorage). Same selector the core\n// request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.\nconst sessionManager = getActiveSessionManager;\nconst NO_WALLET = 'Email login has no embedded wallet. Enable `\"auth\": { \"wallets\": true }` in ' +\n 'the app policy so email logins get a non-custodial Crossmint wallet ' +\n '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +\n 'provider (e.g. Phantom) for onchain actions.';\n// ---------------------------------------------------------------------------\n// token / session helpers\n// ---------------------------------------------------------------------------\nfunction decodeJwt(token) {\n try {\n let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n const pad = b64.length % 4;\n if (pad === 2)\n b64 += '==';\n else if (pad === 3)\n b64 += '=';\n // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).\n return JSON.parse(getPlatform().atob(b64));\n }\n catch (_a) {\n return {};\n }\n}\nfunction userFromIdToken(idToken, fallbackEmail) {\n const c = decodeJwt(idToken);\n const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';\n const email = (c.email || fallbackEmail || null);\n // Email logins have no wallet — address is null (the User type allows it).\n const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])\n ? c['custom:evmWalletAddress'].toLowerCase()\n : null;\n return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };\n}\n// ---------------------------------------------------------------------------\n// provider\n// ---------------------------------------------------------------------------\nexport class EmailAuthProvider {\n async login() {\n throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +\n 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');\n }\n async restoreSession() {\n const sm = sessionManager();\n const session = await sm.getSession();\n if (!session)\n return null;\n const idToken = sm.getIdToken();\n if (!idToken)\n return null;\n const user = userFromIdToken(idToken);\n setCurrentUser(user);\n return user;\n }\n async logout() {\n sessionManager().clearSession();\n setCurrentUser(null);\n }\n // Crossmint Solana smart wallets sign+submit atomically and cannot produce a\n // raw signature — signMessage/signTransaction are structurally unsupported\n // (throw the clear \"use signAndSubmitTransaction\" error when a wallet exists;\n // the no-wallet error otherwise). signAndSubmitTransaction routes through the\n // Bounded signer popup for wallets-enabled email logins.\n async signMessage(_message) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async runTransaction(evm, sol, options) {\n if (evm && sol)\n throw new Error('A transaction cannot target EVM and Solana at the same time.');\n if (!evm)\n throw new Error(NO_WALLET);\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)\n throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');\n if (!hasEmbeddedEvmWallet())\n throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');\n return embeddedRunEvmTransaction(evm);\n }\n async signTransaction(_t) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n if (!hasEmbeddedWallet())\n throw new Error(NO_WALLET);\n return embeddedSignAndSubmit(transaction);\n }\n async getNativeMethods() { return {}; }\n}\nconst emailProviderSingleton = new EmailAuthProvider();\nexport { emailProviderSingleton };\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,uBAAuB;AAC9C,MAAM,SAAS,GAAG,8EAA8E;AAChG,IAAI,sEAAsE;AAC1E,IAAI,yEAAyE;AAC7E,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC3E,QAAQ,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC;AAClC,QAAQ,IAAI,GAAG,KAAK,CAAC;AACrB,YAAY,GAAG,IAAI,IAAI;AACvB,aAAa,IAAI,GAAG,KAAK,CAAC;AAC1B,YAAY,GAAG,IAAI,GAAG;AACtB;AACA,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,IAAI;AACJ,IAAI,OAAO,EAAE,EAAE;AACf,QAAQ,OAAO,EAAE;AACjB,IAAI;AACJ;AACA,SAAS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,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { getActiveSessionManager } from '@bounded-sh/core';
2
- import { s as setCurrentUser, E as EMBEDDED_WALLET_UNSUPPORTED, h as hasEmbeddedWallet, a as hasEmbeddedEvmWallet, e as embeddedRunEvmTransaction, b as embeddedSignAndSubmit, g as getPlatform } from './index.native-CTVEq0VY.mjs';
2
+ import { s as setCurrentUser, E as EMBEDDED_WALLET_UNSUPPORTED, h as hasEmbeddedWallet, a as hasEmbeddedEvmWallet, e as embeddedRunEvmTransaction, b as embeddedSignAndSubmit, g as getPlatform } from './index.native-CQiw9baS.mjs';
3
3
  import 'react';
4
4
 
5
5
  // Web uses localStorage (WebSessionManager); React Native uses the configured
@@ -96,4 +96,4 @@ class EmailAuthProvider {
96
96
  const emailProviderSingleton = new EmailAuthProvider();
97
97
 
98
98
  export { EmailAuthProvider, emailProviderSingleton };
99
- //# sourceMappingURL=email-auth-provider-BqX-o_sJ.mjs.map
99
+ //# sourceMappingURL=email-auth-provider-CfNSS8Du.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"email-auth-provider-BqX-o_sJ.mjs","sources":["../.rollup-tmp/auth/providers/email-auth-provider.js"],"sourcesContent":["import { getActiveSessionManager } from '@bounded-sh/core';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { hasEmbeddedWallet, hasEmbeddedEvmWallet, embeddedSignAndSubmit, embeddedRunEvmTransaction, EMBEDDED_WALLET_UNSUPPORTED, } from '../crossmint-signer-bridge';\n// Web uses localStorage (WebSessionManager); React Native uses the configured\n// ReactNativeSessionManager. getActiveSessionManager() picks the right one by\n// whether the RN manager was configured (NOT `typeof window`, which is truthy on\n// RN too and would wrongly route to localStorage). Same selector the core\n// request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.\nconst sessionManager = getActiveSessionManager;\nconst NO_WALLET = 'Email login has no embedded wallet. Enable `\"auth\": { \"wallets\": true }` in ' +\n 'the app policy so email logins get a non-custodial Crossmint wallet ' +\n '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +\n 'provider (e.g. Phantom) for onchain actions.';\n// ---------------------------------------------------------------------------\n// token / session helpers\n// ---------------------------------------------------------------------------\nfunction decodeJwt(token) {\n try {\n let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n const pad = b64.length % 4;\n if (pad === 2)\n b64 += '==';\n else if (pad === 3)\n b64 += '=';\n // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).\n return JSON.parse(getPlatform().atob(b64));\n }\n catch (_a) {\n return {};\n }\n}\nfunction userFromIdToken(idToken, fallbackEmail) {\n const c = decodeJwt(idToken);\n const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';\n const email = (c.email || fallbackEmail || null);\n // Email logins have no wallet — address is null (the User type allows it).\n const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])\n ? c['custom:evmWalletAddress'].toLowerCase()\n : null;\n return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };\n}\n// ---------------------------------------------------------------------------\n// provider\n// ---------------------------------------------------------------------------\nexport class EmailAuthProvider {\n async login() {\n throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +\n 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');\n }\n async restoreSession() {\n const sm = sessionManager();\n const session = await sm.getSession();\n if (!session)\n return null;\n const idToken = sm.getIdToken();\n if (!idToken)\n return null;\n const user = userFromIdToken(idToken);\n setCurrentUser(user);\n return user;\n }\n async logout() {\n sessionManager().clearSession();\n setCurrentUser(null);\n }\n // Crossmint Solana smart wallets sign+submit atomically and cannot produce a\n // raw signature — signMessage/signTransaction are structurally unsupported\n // (throw the clear \"use signAndSubmitTransaction\" error when a wallet exists;\n // the no-wallet error otherwise). signAndSubmitTransaction routes through the\n // Bounded signer popup for wallets-enabled email logins.\n async signMessage(_message) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async runTransaction(evm, sol, options) {\n if (evm && sol)\n throw new Error('A transaction cannot target EVM and Solana at the same time.');\n if (!evm)\n throw new Error(NO_WALLET);\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)\n throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');\n if (!hasEmbeddedEvmWallet())\n throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');\n return embeddedRunEvmTransaction(evm);\n }\n async signTransaction(_t) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n if (!hasEmbeddedWallet())\n throw new Error(NO_WALLET);\n return embeddedSignAndSubmit(transaction);\n }\n async getNativeMethods() { return {}; }\n}\nconst emailProviderSingleton = new EmailAuthProvider();\nexport { emailProviderSingleton };\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,uBAAuB;AAC9C,MAAM,SAAS,GAAG,8EAA8E;AAChG,IAAI,sEAAsE;AAC1E,IAAI,yEAAyE;AAC7E,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC3E,QAAQ,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC;AAClC,QAAQ,IAAI,GAAG,KAAK,CAAC;AACrB,YAAY,GAAG,IAAI,IAAI;AACvB,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AAC;AACtF,IAAI;AACJ,IAAI,MAAM,wBAAwB,CAAC,WAAW,EAAE,SAAS,EAAE;AAC3D,QAAQ,IAAI,CAAC,iBAAiB,EAAE;AAChC,YAAY,MAAM,IAAI,KAAK,CAAC,SAAS,CAAC;AACtC,QAAQ,OAAO,qBAAqB,CAAC,WAAW,CAAC;AACjD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;"}
1
+ {"version":3,"file":"email-auth-provider-CfNSS8Du.mjs","sources":["../.rollup-tmp/auth/providers/email-auth-provider.js"],"sourcesContent":["import { getActiveSessionManager } from '@bounded-sh/core';\nimport { setCurrentUser } from '../../global';\nimport { getPlatform } from '../../platform';\nimport { hasEmbeddedWallet, hasEmbeddedEvmWallet, embeddedSignAndSubmit, embeddedRunEvmTransaction, EMBEDDED_WALLET_UNSUPPORTED, } from '../crossmint-signer-bridge';\n// Web uses localStorage (WebSessionManager); React Native uses the configured\n// ReactNativeSessionManager. getActiveSessionManager() picks the right one by\n// whether the RN manager was configured (NOT `typeof window`, which is truthy on\n// RN too and would wrongly route to localStorage). Same selector the core\n// request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.\nconst sessionManager = getActiveSessionManager;\nconst NO_WALLET = 'Email login has no embedded wallet. Enable `\"auth\": { \"wallets\": true }` in ' +\n 'the app policy so email logins get a non-custodial Crossmint wallet ' +\n '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +\n 'provider (e.g. Phantom) for onchain actions.';\n// ---------------------------------------------------------------------------\n// token / session helpers\n// ---------------------------------------------------------------------------\nfunction decodeJwt(token) {\n try {\n let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\n const pad = b64.length % 4;\n if (pad === 2)\n b64 += '==';\n else if (pad === 3)\n b64 += '=';\n // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).\n return JSON.parse(getPlatform().atob(b64));\n }\n catch (_a) {\n return {};\n }\n}\nfunction userFromIdToken(idToken, fallbackEmail) {\n const c = decodeJwt(idToken);\n const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';\n const email = (c.email || fallbackEmail || null);\n // Email logins have no wallet — address is null (the User type allows it).\n const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])\n ? c['custom:evmWalletAddress'].toLowerCase()\n : null;\n return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };\n}\n// ---------------------------------------------------------------------------\n// provider\n// ---------------------------------------------------------------------------\nexport class EmailAuthProvider {\n async login() {\n throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +\n 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');\n }\n async restoreSession() {\n const sm = sessionManager();\n const session = await sm.getSession();\n if (!session)\n return null;\n const idToken = sm.getIdToken();\n if (!idToken)\n return null;\n const user = userFromIdToken(idToken);\n setCurrentUser(user);\n return user;\n }\n async logout() {\n sessionManager().clearSession();\n setCurrentUser(null);\n }\n // Crossmint Solana smart wallets sign+submit atomically and cannot produce a\n // raw signature — signMessage/signTransaction are structurally unsupported\n // (throw the clear \"use signAndSubmitTransaction\" error when a wallet exists;\n // the no-wallet error otherwise). signAndSubmitTransaction routes through the\n // Bounded signer popup for wallets-enabled email logins.\n async signMessage(_message) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async runTransaction(evm, sol, options) {\n if (evm && sol)\n throw new Error('A transaction cannot target EVM and Solana at the same time.');\n if (!evm)\n throw new Error(NO_WALLET);\n if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)\n throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');\n if (!hasEmbeddedEvmWallet())\n throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');\n return embeddedRunEvmTransaction(evm);\n }\n async signTransaction(_t) {\n throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);\n }\n async signAndSubmitTransaction(transaction, _feePayer) {\n if (!hasEmbeddedWallet())\n throw new Error(NO_WALLET);\n return embeddedSignAndSubmit(transaction);\n }\n async getNativeMethods() { return {}; }\n}\nconst emailProviderSingleton = new EmailAuthProvider();\nexport { emailProviderSingleton };\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,uBAAuB;AAC9C,MAAM,SAAS,GAAG,8EAA8E;AAChG,IAAI,sEAAsE;AAC1E,IAAI,yEAAyE;AAC7E,IAAI,8CAA8C;AAClD;AACA;AACA;AACA,SAAS,SAAS,CAAC,KAAK,EAAE;AAC1B,IAAI,IAAI;AACR,QAAQ,IAAI,GAAG,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;AAC3E,QAAQ,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,GAAG,CAAC;AAClC,QAAQ,IAAI,GAAG,KAAK,CAAC;AACrB,YAAY,GAAG,IAAI,IAAI;AACvB,aAAa,IAAI,GAAG,KAAK,CAAC;AAC1B,YAAY,GAAG,IAAI,GAAG;AACtB;AACA,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,IAAI;AACJ,IAAI,OAAO,EAAE,EAAE;AACf,QAAQ,OAAO,EAAE;AACjB,IAAI;AACJ;AACA,SAAS,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE;AACjD,IAAI,MAAM,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;AAChC,IAAI,MAAM,EAAE,GAAG,CAAC,CAAC,eAAe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bounded-sh/core');
4
- var index = require('./index-B_uRc6gn.js');
4
+ var index = require('./index-MKE9tHpl.js');
5
5
  require('react');
6
6
 
7
7
  // guest-keystore.ts — durable per-device keypair for anonymous ("guest") auth.
@@ -274,4 +274,4 @@ class GuestAuthProvider {
274
274
  }
275
275
 
276
276
  exports.GuestAuthProvider = GuestAuthProvider;
277
- //# sourceMappingURL=guest-auth-provider-DWcdRvLW.js.map
277
+ //# sourceMappingURL=guest-auth-provider-BPXDJoEQ.js.map