@bounded-sh/client 0.0.44 → 0.0.48

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 (60) hide show
  1. package/dist/auth/crossmint-signer-bridge.d.ts +1 -1
  2. package/dist/auth/index.d.ts +1 -1
  3. package/dist/auth/providers/email-auth-provider.d.ts +1 -2
  4. package/dist/auth/providers/guest-auth-provider.d.ts +1 -1
  5. package/dist/auth/providers/injected-wallet-provider.d.ts +1 -1
  6. package/dist/auth/providers/offchain-auth-provider.d.ts +3 -3
  7. package/dist/auth/providers/phantom-wallet-provider.d.ts +1 -1
  8. package/dist/auth/providers/privy-expo-provider.d.ts +1 -1
  9. package/dist/auth/providers/privy-wallet-provider.d.ts +1 -1
  10. package/dist/auth/providers/sol/sol-utils.d.ts +1 -1
  11. package/dist/auth/providers/transaction-utils.d.ts +1 -1
  12. package/dist/email-auth-provider-CTyjwhLb.mjs +99 -0
  13. package/dist/email-auth-provider-CTyjwhLb.mjs.map +1 -0
  14. package/dist/email-auth-provider-CmunfauO.js +102 -0
  15. package/dist/email-auth-provider-CmunfauO.js.map +1 -0
  16. package/dist/email-auth-provider-DyxZTpx6.js +102 -0
  17. package/dist/email-auth-provider-DyxZTpx6.js.map +1 -0
  18. package/dist/email-auth-provider-GRj8IOg2.mjs +99 -0
  19. package/dist/email-auth-provider-GRj8IOg2.mjs.map +1 -0
  20. package/dist/guest-auth-provider-B68XT2lU.js +193 -0
  21. package/dist/guest-auth-provider-B68XT2lU.js.map +1 -0
  22. package/dist/guest-auth-provider-C4BuTNIa.mjs +191 -0
  23. package/dist/guest-auth-provider-C4BuTNIa.mjs.map +1 -0
  24. package/dist/guest-auth-provider-D54uHbov.js +193 -0
  25. package/dist/guest-auth-provider-D54uHbov.js.map +1 -0
  26. package/dist/guest-auth-provider-Dk_km5tF.mjs +191 -0
  27. package/dist/guest-auth-provider-Dk_km5tF.mjs.map +1 -0
  28. package/dist/index-C0pR5b7j.mjs +5450 -0
  29. package/dist/index-C0pR5b7j.mjs.map +1 -0
  30. package/dist/index-JBeYYsGm.js +5508 -0
  31. package/dist/index-JBeYYsGm.js.map +1 -0
  32. package/dist/index.js +82 -6378
  33. package/dist/index.js.map +1 -1
  34. package/dist/index.mjs +2 -6283
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/index.native-BZCc0gO-.js +5353 -0
  37. package/dist/index.native-BZCc0gO-.js.map +1 -0
  38. package/dist/index.native-CytJPNQV.mjs +5299 -0
  39. package/dist/index.native-CytJPNQV.mjs.map +1 -0
  40. package/dist/index.native.js +78 -6308
  41. package/dist/index.native.js.map +1 -1
  42. package/dist/index.native.mjs +2 -6217
  43. package/dist/index.native.mjs.map +1 -1
  44. package/dist/injected-evm-wallet-provider-BOMLGGHM.mjs +406 -0
  45. package/dist/injected-evm-wallet-provider-BOMLGGHM.mjs.map +1 -0
  46. package/dist/injected-evm-wallet-provider-CxAiNN7R.mjs +340 -0
  47. package/dist/injected-evm-wallet-provider-CxAiNN7R.mjs.map +1 -0
  48. package/dist/injected-evm-wallet-provider-T-EF9C3W.js +409 -0
  49. package/dist/injected-evm-wallet-provider-T-EF9C3W.js.map +1 -0
  50. package/dist/injected-evm-wallet-provider-_eeYB1ww.js +343 -0
  51. package/dist/injected-evm-wallet-provider-_eeYB1ww.js.map +1 -0
  52. package/dist/injected-wallet-provider-B1uq3r4r.mjs +260 -0
  53. package/dist/injected-wallet-provider-B1uq3r4r.mjs.map +1 -0
  54. package/dist/injected-wallet-provider-B2T7JEvn.js +263 -0
  55. package/dist/injected-wallet-provider-B2T7JEvn.js.map +1 -0
  56. package/dist/injected-wallet-provider-BBZym7YQ.js +282 -0
  57. package/dist/injected-wallet-provider-BBZym7YQ.js.map +1 -0
  58. package/dist/injected-wallet-provider-DCwygA3j.mjs +279 -0
  59. package/dist/injected-wallet-provider-DCwygA3j.mjs.map +1 -0
  60. package/package.json +10 -5
@@ -1,5 +1,5 @@
1
1
  import type { EVMTransaction, TransactionResult } from '@bounded-sh/core';
2
- import { Transaction, VersionedTransaction } from '@solana/web3.js';
2
+ import type { Transaction, VersionedTransaction } from '@solana/web3.js';
3
3
  export type SignerAction = {
4
4
  kind: 'sendToken';
5
5
  recipient: string;
@@ -1,4 +1,4 @@
1
- import { AuthProvider, User, ClientConfig } from "@bounded-sh/core";
1
+ import type { AuthProvider, User, ClientConfig } from "@bounded-sh/core";
2
2
  /**
3
3
  * Clears the session if it was created by a different auth method.
4
4
  * Returns true if the session was cleared, false if the session is compatible.
@@ -1,6 +1,5 @@
1
1
  import type { AuthProvider, User, TransactionResult, SolTransaction, EVMTransaction, SetOptions } from '@bounded-sh/core';
2
- import { Transaction, VersionedTransaction } from '@solana/web3.js';
3
- import { PublicKey } from '@solana/web3.js';
2
+ import type { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
4
3
  export declare class EmailAuthProvider implements AuthProvider {
5
4
  login(): Promise<User | null>;
6
5
  restoreSession(): Promise<User | null>;
@@ -1,5 +1,5 @@
1
1
  import type { AuthProvider, User, TransactionResult, SolTransaction, EVMTransaction, SetOptions } from '@bounded-sh/core';
2
- import { Transaction, VersionedTransaction } from '@solana/web3.js';
2
+ import type { Transaction, VersionedTransaction } from '@solana/web3.js';
3
3
  export declare class GuestAuthProvider implements AuthProvider {
4
4
  login(): Promise<User | null>;
5
5
  restoreSession(): Promise<User | null>;
@@ -1,5 +1,5 @@
1
1
  import type { EVMTransaction, SolTransaction, TransactionResult, User, AuthProvider, SetOptions } from '@bounded-sh/core';
2
- import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
2
+ import type { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
3
3
  import { defaultInjectedProvider, type InjectedSolanaProvider, type InjectedWalletConfig } from './injected-wallet-types';
4
4
  export { defaultInjectedProvider };
5
5
  export type { InjectedSolanaProvider, InjectedWalletConfig };
@@ -1,6 +1,6 @@
1
- import { AuthProvider, User, TransactionResult, EVMTransaction, SolTransaction } from "@bounded-sh/core";
2
- import { SetOptions } from "@bounded-sh/core";
3
- import { Transaction, VersionedTransaction } from "@solana/web3.js";
1
+ import type { AuthProvider, User, TransactionResult, EVMTransaction, SolTransaction } from "@bounded-sh/core";
2
+ import type { SetOptions } from "@bounded-sh/core";
3
+ import type { Transaction, VersionedTransaction } from "@solana/web3.js";
4
4
  export interface OffchainAuthProviderConfig {
5
5
  onSigningStart?: () => void;
6
6
  onSigningComplete?: (signature: string) => void;
@@ -1,5 +1,5 @@
1
1
  import type { EVMTransaction, SolTransaction, TransactionResult, User, AuthProvider, SetOptions } from '@bounded-sh/core';
2
- import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
2
+ import type { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
3
3
  export type PhantomProviderType = 'injected' | 'google' | 'apple' | 'deeplink' | 'phantom';
4
4
  export interface PhantomWalletConfig {
5
5
  appId?: string;
@@ -19,7 +19,7 @@
19
19
  * to render <PrivyProvider> and then bridge the hooks via setPrivyMethods().
20
20
  */
21
21
  import type { EVMTransaction, SolTransaction, TransactionResult, AuthProvider, User, SetOptions } from '@bounded-sh/core';
22
- import { PublicKey, Connection, Transaction, VersionedTransaction } from '@solana/web3.js';
22
+ import type { PublicKey, Connection, Transaction, VersionedTransaction } from '@solana/web3.js';
23
23
  export interface PrivyExpoMethods {
24
24
  /** Whether Privy SDK is fully initialized. */
25
25
  isReady: boolean;
@@ -1,5 +1,5 @@
1
1
  import type { EVMTransaction, SolTransaction, TransactionResult, AuthProvider, User, SetOptions } from '@bounded-sh/core';
2
- import { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
2
+ import type { PublicKey, Transaction, VersionedTransaction } from '@solana/web3.js';
3
3
  type PrivyWalletConfig = {
4
4
  appId: string;
5
5
  config: any;
@@ -1,2 +1,2 @@
1
- import { Transaction, VersionedTransaction } from "@solana/web3.js";
1
+ import type { Transaction, VersionedTransaction } from "@solana/web3.js";
2
2
  export declare function deserializeTransaction(tx: string | Buffer): Promise<Transaction | VersionedTransaction>;
@@ -1,4 +1,4 @@
1
- import { Connection } from '@solana/web3.js';
1
+ import type { Connection } from '@solana/web3.js';
2
2
  /**
3
3
  * Extracts a human-readable error message from Solana transaction logs.
4
4
  */
@@ -0,0 +1,99 @@
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-C0pR5b7j.mjs';
3
+ import 'react';
4
+
5
+ // Web uses localStorage (WebSessionManager); React Native uses the configured
6
+ // ReactNativeSessionManager. getActiveSessionManager() picks the right one by
7
+ // whether the RN manager was configured (NOT `typeof window`, which is truthy on
8
+ // RN too and would wrongly route to localStorage). Same selector the core
9
+ // request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.
10
+ const sessionManager = getActiveSessionManager;
11
+ const NO_WALLET = 'Email login has no embedded wallet. Enable `"auth": { "wallets": true }` in ' +
12
+ 'the app policy so email logins get a non-custodial Crossmint wallet ' +
13
+ '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +
14
+ 'provider (e.g. Phantom) for onchain actions.';
15
+ // ---------------------------------------------------------------------------
16
+ // token / session helpers
17
+ // ---------------------------------------------------------------------------
18
+ function decodeJwt(token) {
19
+ try {
20
+ let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');
21
+ const pad = b64.length % 4;
22
+ if (pad === 2)
23
+ b64 += '==';
24
+ else if (pad === 3)
25
+ b64 += '=';
26
+ // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).
27
+ return JSON.parse(getPlatform().atob(b64));
28
+ }
29
+ catch (_a) {
30
+ return {};
31
+ }
32
+ }
33
+ function userFromIdToken(idToken, fallbackEmail) {
34
+ const c = decodeJwt(idToken);
35
+ const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';
36
+ const email = (c.email || fallbackEmail || null);
37
+ // Email logins have no wallet — address is null (the User type allows it).
38
+ const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])
39
+ ? c['custom:evmWalletAddress'].toLowerCase()
40
+ : null;
41
+ return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };
42
+ }
43
+ // ---------------------------------------------------------------------------
44
+ // provider
45
+ // ---------------------------------------------------------------------------
46
+ class EmailAuthProvider {
47
+ async login() {
48
+ throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +
49
+ 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');
50
+ }
51
+ async restoreSession() {
52
+ const sm = sessionManager();
53
+ const session = await sm.getSession();
54
+ if (!session)
55
+ return null;
56
+ const idToken = sm.getIdToken();
57
+ if (!idToken)
58
+ return null;
59
+ const user = userFromIdToken(idToken);
60
+ setCurrentUser(user);
61
+ return user;
62
+ }
63
+ async logout() {
64
+ sessionManager().clearSession();
65
+ setCurrentUser(null);
66
+ }
67
+ // Crossmint Solana smart wallets sign+submit atomically and cannot produce a
68
+ // raw signature — signMessage/signTransaction are structurally unsupported
69
+ // (throw the clear "use signAndSubmitTransaction" error when a wallet exists;
70
+ // the no-wallet error otherwise). signAndSubmitTransaction routes through the
71
+ // Bounded signer popup for wallets-enabled email logins.
72
+ async signMessage(_message) {
73
+ throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);
74
+ }
75
+ async runTransaction(evm, sol, options) {
76
+ if (evm && sol)
77
+ throw new Error('A transaction cannot target EVM and Solana at the same time.');
78
+ if (!evm)
79
+ throw new Error(NO_WALLET);
80
+ if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)
81
+ throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');
82
+ if (!hasEmbeddedEvmWallet())
83
+ throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');
84
+ return embeddedRunEvmTransaction(evm);
85
+ }
86
+ async signTransaction(_t) {
87
+ throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);
88
+ }
89
+ async signAndSubmitTransaction(transaction, _feePayer) {
90
+ if (!hasEmbeddedWallet())
91
+ throw new Error(NO_WALLET);
92
+ return embeddedSignAndSubmit(transaction);
93
+ }
94
+ async getNativeMethods() { return {}; }
95
+ }
96
+ const emailProviderSingleton = new EmailAuthProvider();
97
+
98
+ export { EmailAuthProvider, emailProviderSingleton };
99
+ //# sourceMappingURL=email-auth-provider-CTyjwhLb.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-auth-provider-CTyjwhLb.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,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AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;"}
@@ -0,0 +1,102 @@
1
+ 'use strict';
2
+
3
+ var core = require('@bounded-sh/core');
4
+ var index_native = require('./index.native-BZCc0gO-.js');
5
+ require('react');
6
+
7
+ // Web uses localStorage (WebSessionManager); React Native uses the configured
8
+ // ReactNativeSessionManager. getActiveSessionManager() picks the right one by
9
+ // whether the RN manager was configured (NOT `typeof window`, which is truthy on
10
+ // RN too and would wrongly route to localStorage). Same selector the core
11
+ // request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.
12
+ const sessionManager = core.getActiveSessionManager;
13
+ const NO_WALLET = 'Email login has no embedded wallet. Enable `"auth": { "wallets": true }` in ' +
14
+ 'the app policy so email logins get a non-custodial Crossmint wallet ' +
15
+ '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +
16
+ 'provider (e.g. Phantom) for onchain actions.';
17
+ // ---------------------------------------------------------------------------
18
+ // token / session helpers
19
+ // ---------------------------------------------------------------------------
20
+ function decodeJwt(token) {
21
+ try {
22
+ let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');
23
+ const pad = b64.length % 4;
24
+ if (pad === 2)
25
+ b64 += '==';
26
+ else if (pad === 3)
27
+ b64 += '=';
28
+ // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).
29
+ return JSON.parse(index_native.getPlatform().atob(b64));
30
+ }
31
+ catch (_a) {
32
+ return {};
33
+ }
34
+ }
35
+ function userFromIdToken(idToken, fallbackEmail) {
36
+ const c = decodeJwt(idToken);
37
+ const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';
38
+ const email = (c.email || fallbackEmail || null);
39
+ // Email logins have no wallet — address is null (the User type allows it).
40
+ const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])
41
+ ? c['custom:evmWalletAddress'].toLowerCase()
42
+ : null;
43
+ return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };
44
+ }
45
+ // ---------------------------------------------------------------------------
46
+ // provider
47
+ // ---------------------------------------------------------------------------
48
+ class EmailAuthProvider {
49
+ async login() {
50
+ throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +
51
+ 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');
52
+ }
53
+ async restoreSession() {
54
+ const sm = sessionManager();
55
+ const session = await sm.getSession();
56
+ if (!session)
57
+ return null;
58
+ const idToken = sm.getIdToken();
59
+ if (!idToken)
60
+ return null;
61
+ const user = userFromIdToken(idToken);
62
+ index_native.setCurrentUser(user);
63
+ return user;
64
+ }
65
+ async logout() {
66
+ sessionManager().clearSession();
67
+ index_native.setCurrentUser(null);
68
+ }
69
+ // Crossmint Solana smart wallets sign+submit atomically and cannot produce a
70
+ // raw signature — signMessage/signTransaction are structurally unsupported
71
+ // (throw the clear "use signAndSubmitTransaction" error when a wallet exists;
72
+ // the no-wallet error otherwise). signAndSubmitTransaction routes through the
73
+ // Bounded signer popup for wallets-enabled email logins.
74
+ async signMessage(_message) {
75
+ throw new Error(index_native.hasEmbeddedWallet() ? index_native.EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);
76
+ }
77
+ async runTransaction(evm, sol, options) {
78
+ if (evm && sol)
79
+ throw new Error('A transaction cannot target EVM and Solana at the same time.');
80
+ if (!evm)
81
+ throw new Error(NO_WALLET);
82
+ if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)
83
+ throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');
84
+ if (!index_native.hasEmbeddedEvmWallet())
85
+ throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');
86
+ return index_native.embeddedRunEvmTransaction(evm);
87
+ }
88
+ async signTransaction(_t) {
89
+ throw new Error(index_native.hasEmbeddedWallet() ? index_native.EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);
90
+ }
91
+ async signAndSubmitTransaction(transaction, _feePayer) {
92
+ if (!index_native.hasEmbeddedWallet())
93
+ throw new Error(NO_WALLET);
94
+ return index_native.embeddedSignAndSubmit(transaction);
95
+ }
96
+ async getNativeMethods() { return {}; }
97
+ }
98
+ const emailProviderSingleton = new EmailAuthProvider();
99
+
100
+ exports.EmailAuthProvider = EmailAuthProvider;
101
+ exports.emailProviderSingleton = emailProviderSingleton;
102
+ //# sourceMappingURL=email-auth-provider-CmunfauO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-auth-provider-CmunfauO.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,wBAAW,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,EA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AAC;AAC1C;AACK,MAAC,sBAAsB,GAAG,IAAI,iBAAiB;;;;;"}
@@ -0,0 +1,102 @@
1
+ 'use strict';
2
+
3
+ var core = require('@bounded-sh/core');
4
+ var index = require('./index-JBeYYsGm.js');
5
+ require('react');
6
+
7
+ // Web uses localStorage (WebSessionManager); React Native uses the configured
8
+ // ReactNativeSessionManager. getActiveSessionManager() picks the right one by
9
+ // whether the RN manager was configured (NOT `typeof window`, which is truthy on
10
+ // RN too and would wrongly route to localStorage). Same selector the core
11
+ // request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.
12
+ const sessionManager = core.getActiveSessionManager;
13
+ const NO_WALLET = 'Email login has no embedded wallet. Enable `"auth": { "wallets": true }` in ' +
14
+ 'the app policy so email logins get a non-custodial Crossmint wallet ' +
15
+ '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +
16
+ 'provider (e.g. Phantom) for onchain actions.';
17
+ // ---------------------------------------------------------------------------
18
+ // token / session helpers
19
+ // ---------------------------------------------------------------------------
20
+ function decodeJwt(token) {
21
+ try {
22
+ let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');
23
+ const pad = b64.length % 4;
24
+ if (pad === 2)
25
+ b64 += '==';
26
+ else if (pad === 3)
27
+ b64 += '=';
28
+ // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).
29
+ return JSON.parse(index.getPlatform().atob(b64));
30
+ }
31
+ catch (_a) {
32
+ return {};
33
+ }
34
+ }
35
+ function userFromIdToken(idToken, fallbackEmail) {
36
+ const c = decodeJwt(idToken);
37
+ const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';
38
+ const email = (c.email || fallbackEmail || null);
39
+ // Email logins have no wallet — address is null (the User type allows it).
40
+ const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])
41
+ ? c['custom:evmWalletAddress'].toLowerCase()
42
+ : null;
43
+ return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };
44
+ }
45
+ // ---------------------------------------------------------------------------
46
+ // provider
47
+ // ---------------------------------------------------------------------------
48
+ class EmailAuthProvider {
49
+ async login() {
50
+ throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +
51
+ 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');
52
+ }
53
+ async restoreSession() {
54
+ const sm = sessionManager();
55
+ const session = await sm.getSession();
56
+ if (!session)
57
+ return null;
58
+ const idToken = sm.getIdToken();
59
+ if (!idToken)
60
+ return null;
61
+ const user = userFromIdToken(idToken);
62
+ index.setCurrentUser(user);
63
+ return user;
64
+ }
65
+ async logout() {
66
+ sessionManager().clearSession();
67
+ index.setCurrentUser(null);
68
+ }
69
+ // Crossmint Solana smart wallets sign+submit atomically and cannot produce a
70
+ // raw signature — signMessage/signTransaction are structurally unsupported
71
+ // (throw the clear "use signAndSubmitTransaction" error when a wallet exists;
72
+ // the no-wallet error otherwise). signAndSubmitTransaction routes through the
73
+ // Bounded signer popup for wallets-enabled email logins.
74
+ async signMessage(_message) {
75
+ throw new Error(index.hasEmbeddedWallet() ? index.EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);
76
+ }
77
+ async runTransaction(evm, sol, options) {
78
+ if (evm && sol)
79
+ throw new Error('A transaction cannot target EVM and Solana at the same time.');
80
+ if (!evm)
81
+ throw new Error(NO_WALLET);
82
+ if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)
83
+ throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');
84
+ if (!index.hasEmbeddedEvmWallet())
85
+ throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');
86
+ return index.embeddedRunEvmTransaction(evm);
87
+ }
88
+ async signTransaction(_t) {
89
+ throw new Error(index.hasEmbeddedWallet() ? index.EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);
90
+ }
91
+ async signAndSubmitTransaction(transaction, _feePayer) {
92
+ if (!index.hasEmbeddedWallet())
93
+ throw new Error(NO_WALLET);
94
+ return index.embeddedSignAndSubmit(transaction);
95
+ }
96
+ async getNativeMethods() { return {}; }
97
+ }
98
+ const emailProviderSingleton = new EmailAuthProvider();
99
+
100
+ exports.EmailAuthProvider = EmailAuthProvider;
101
+ exports.emailProviderSingleton = emailProviderSingleton;
102
+ //# sourceMappingURL=email-auth-provider-DyxZTpx6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-auth-provider-DyxZTpx6.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,iBAAW,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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C,sBAAsB,GAAG,IAAI,iBAAiB;;;;;"}
@@ -0,0 +1,99 @@
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-CytJPNQV.mjs';
3
+ import 'react';
4
+
5
+ // Web uses localStorage (WebSessionManager); React Native uses the configured
6
+ // ReactNativeSessionManager. getActiveSessionManager() picks the right one by
7
+ // whether the RN manager was configured (NOT `typeof window`, which is truthy on
8
+ // RN too and would wrongly route to localStorage). Same selector the core
9
+ // request path uses, so hosted Bounded Auth sessions persist + authenticate on BOTH.
10
+ const sessionManager = getActiveSessionManager;
11
+ const NO_WALLET = 'Email login has no embedded wallet. Enable `"auth": { "wallets": true }` in ' +
12
+ 'the app policy so email logins get a non-custodial Crossmint wallet ' +
13
+ '(@user.address), then sign from a user gesture. Otherwise use a wallet ' +
14
+ 'provider (e.g. Phantom) for onchain actions.';
15
+ // ---------------------------------------------------------------------------
16
+ // token / session helpers
17
+ // ---------------------------------------------------------------------------
18
+ function decodeJwt(token) {
19
+ try {
20
+ let b64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');
21
+ const pad = b64.length % 4;
22
+ if (pad === 2)
23
+ b64 += '==';
24
+ else if (pad === 3)
25
+ b64 += '=';
26
+ // getPlatform().atob is RN-safe (global atob is undefined on Hermes/JSC).
27
+ return JSON.parse(getPlatform().atob(b64));
28
+ }
29
+ catch (_a) {
30
+ return {};
31
+ }
32
+ }
33
+ function userFromIdToken(idToken, fallbackEmail) {
34
+ const c = decodeJwt(idToken);
35
+ const id = c['custom:userId'] || c.sub || c['custom:walletAddress'] || '';
36
+ const email = (c.email || fallbackEmail || null);
37
+ // Email logins have no wallet — address is null (the User type allows it).
38
+ const evmAddress = typeof c['custom:evmWalletAddress'] === 'string' && /^0x[0-9a-fA-F]{40}$/.test(c['custom:evmWalletAddress'])
39
+ ? c['custom:evmWalletAddress'].toLowerCase()
40
+ : null;
41
+ return { id, address: (c['custom:walletAddress'] || null), evmAddress, email, provider: emailProviderSingleton };
42
+ }
43
+ // ---------------------------------------------------------------------------
44
+ // provider
45
+ // ---------------------------------------------------------------------------
46
+ class EmailAuthProvider {
47
+ async login() {
48
+ throw new Error('login() no longer opens inline email OTP. Use loginWithRedirect({ redirectUri }) ' +
49
+ 'or loginWithPopup({ redirectUri }) for hosted Bounded Auth.');
50
+ }
51
+ async restoreSession() {
52
+ const sm = sessionManager();
53
+ const session = await sm.getSession();
54
+ if (!session)
55
+ return null;
56
+ const idToken = sm.getIdToken();
57
+ if (!idToken)
58
+ return null;
59
+ const user = userFromIdToken(idToken);
60
+ setCurrentUser(user);
61
+ return user;
62
+ }
63
+ async logout() {
64
+ sessionManager().clearSession();
65
+ setCurrentUser(null);
66
+ }
67
+ // Crossmint Solana smart wallets sign+submit atomically and cannot produce a
68
+ // raw signature — signMessage/signTransaction are structurally unsupported
69
+ // (throw the clear "use signAndSubmitTransaction" error when a wallet exists;
70
+ // the no-wallet error otherwise). signAndSubmitTransaction routes through the
71
+ // Bounded signer popup for wallets-enabled email logins.
72
+ async signMessage(_message) {
73
+ throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);
74
+ }
75
+ async runTransaction(evm, sol, options) {
76
+ if (evm && sol)
77
+ throw new Error('A transaction cannot target EVM and Solana at the same time.');
78
+ if (!evm)
79
+ throw new Error(NO_WALLET);
80
+ if ((options === null || options === void 0 ? void 0 : options.shouldSubmitTx) === false)
81
+ throw new Error('Embedded EVM wallets sign and submit atomically; shouldSubmitTx:false is unsupported.');
82
+ if (!hasEmbeddedEvmWallet())
83
+ throw new Error('This login has no embedded EVM wallet. Enable auth.wallets on an app with an EVM collection and sign in again.');
84
+ return embeddedRunEvmTransaction(evm);
85
+ }
86
+ async signTransaction(_t) {
87
+ throw new Error(hasEmbeddedWallet() ? EMBEDDED_WALLET_UNSUPPORTED : NO_WALLET);
88
+ }
89
+ async signAndSubmitTransaction(transaction, _feePayer) {
90
+ if (!hasEmbeddedWallet())
91
+ throw new Error(NO_WALLET);
92
+ return embeddedSignAndSubmit(transaction);
93
+ }
94
+ async getNativeMethods() { return {}; }
95
+ }
96
+ const emailProviderSingleton = new EmailAuthProvider();
97
+
98
+ export { EmailAuthProvider, emailProviderSingleton };
99
+ //# sourceMappingURL=email-auth-provider-GRj8IOg2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-auth-provider-GRj8IOg2.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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