@crossmint/client-sdk-react-base 1.0.7 → 2.0.0-beta.2

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 (74) hide show
  1. package/dist/{CrossmintWalletBaseProvider-B_Ad3uZ2.d.ts → CrossmintWalletBaseProvider-BC3s1L7V.d.ts} +17 -8
  2. package/dist/{CrossmintWalletBaseProvider-CusZ3teM.d.cts → CrossmintWalletBaseProvider-CFRV-0N0.d.cts} +17 -8
  3. package/dist/chunk-5PN427A7.cjs +1 -0
  4. package/dist/chunk-6LPM65VC.js +1 -0
  5. package/dist/chunk-753F2TL5.cjs +1 -0
  6. package/dist/chunk-772QWMBB.cjs +1 -0
  7. package/dist/{chunk-ELPIFOQ5.js → chunk-DY4BVQZD.js} +1 -1
  8. package/dist/chunk-HMSQ2OMO.js +1 -0
  9. package/dist/chunk-KXK5YLCP.js +1 -0
  10. package/dist/{chunk-33LPDFQU.cjs → chunk-P3KCES3S.cjs} +1 -1
  11. package/dist/chunk-VVXHOVXA.js +1 -0
  12. package/dist/hooks/index.cjs +1 -1
  13. package/dist/hooks/index.d.cts +3 -2
  14. package/dist/hooks/index.d.ts +3 -2
  15. package/dist/hooks/index.js +1 -1
  16. package/dist/hooks/useAuth.cjs +1 -1
  17. package/dist/hooks/useAuth.d.cts +1 -2
  18. package/dist/hooks/useAuth.d.ts +1 -2
  19. package/dist/hooks/useAuth.js +1 -1
  20. package/dist/hooks/useCrossmint.cjs +1 -1
  21. package/dist/hooks/useCrossmint.js +1 -1
  22. package/dist/hooks/useSignerAuth.cjs +1 -1
  23. package/dist/hooks/useSignerAuth.d.cts +5 -5
  24. package/dist/hooks/useSignerAuth.d.ts +5 -5
  25. package/dist/hooks/useSignerAuth.js +1 -1
  26. package/dist/hooks/useWallet.cjs +1 -1
  27. package/dist/hooks/useWallet.d.cts +1 -1
  28. package/dist/hooks/useWallet.d.ts +1 -1
  29. package/dist/hooks/useWallet.js +1 -1
  30. package/dist/hooks/useWalletOtpSigner.cjs +1 -0
  31. package/dist/hooks/useWalletOtpSigner.d.cts +18 -0
  32. package/dist/hooks/useWalletOtpSigner.d.ts +18 -0
  33. package/dist/hooks/useWalletOtpSigner.js +1 -0
  34. package/dist/index.cjs +1 -1
  35. package/dist/index.d.cts +4 -3
  36. package/dist/index.d.ts +4 -3
  37. package/dist/index.js +1 -1
  38. package/dist/providers/CrossmintAuthBaseProvider.cjs +1 -1
  39. package/dist/providers/CrossmintAuthBaseProvider.js +1 -1
  40. package/dist/providers/CrossmintProvider.cjs +1 -1
  41. package/dist/providers/CrossmintProvider.d.cts +1 -3
  42. package/dist/providers/CrossmintProvider.d.ts +1 -3
  43. package/dist/providers/CrossmintProvider.js +1 -1
  44. package/dist/providers/CrossmintWalletBaseProvider.cjs +1 -1
  45. package/dist/providers/CrossmintWalletBaseProvider.d.cts +1 -1
  46. package/dist/providers/CrossmintWalletBaseProvider.d.ts +1 -1
  47. package/dist/providers/CrossmintWalletBaseProvider.js +1 -1
  48. package/dist/providers/CrossmintWalletUIBaseProvider.cjs +1 -1
  49. package/dist/providers/CrossmintWalletUIBaseProvider.d.cts +1 -1
  50. package/dist/providers/CrossmintWalletUIBaseProvider.d.ts +1 -1
  51. package/dist/providers/CrossmintWalletUIBaseProvider.js +1 -1
  52. package/dist/providers/index.cjs +1 -1
  53. package/dist/providers/index.d.cts +1 -1
  54. package/dist/providers/index.d.ts +1 -1
  55. package/dist/providers/index.js +1 -1
  56. package/dist/types/auth.d.cts +1 -6
  57. package/dist/types/auth.d.ts +1 -6
  58. package/dist/types/index.cjs +1 -1
  59. package/dist/types/index.d.cts +1 -1
  60. package/dist/types/index.d.ts +1 -1
  61. package/dist/types/index.js +1 -1
  62. package/dist/types/wallet.cjs +1 -1
  63. package/dist/types/wallet.d.cts +3 -42
  64. package/dist/types/wallet.d.ts +3 -42
  65. package/dist/types/wallet.js +1 -1
  66. package/package.json +6 -6
  67. package/dist/chunk-3UZONNFB.js +0 -1
  68. package/dist/chunk-FJDGBKSK.cjs +0 -1
  69. package/dist/chunk-GFXPYJ63.js +0 -1
  70. package/dist/chunk-J5H2Z5BK.cjs +0 -1
  71. package/dist/chunk-LEFZXON3.js +0 -1
  72. package/dist/chunk-SSWKOAEE.js +0 -1
  73. package/dist/chunk-V6H3YTID.cjs +0 -1
  74. /package/dist/{chunk-PU5EOTE7.cjs → chunk-BZI46GB2.cjs} +0 -0
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { MutableRefObject, ReactNode } from 'react';
4
- import { Wallet, Chain, WalletArgsFor, EmailSignerConfig, PhoneSignerConfig } from '@crossmint/wallets-sdk';
4
+ import { Wallet, Chain, ClientSideWalletArgsFor, ClientSideWalletCreateArgs, DeviceSignerDescriptor, RegisterSignerPasskeyParams, DeviceSignerKeyStorage, Callbacks } from '@crossmint/wallets-sdk';
5
5
  import { HandshakeParent } from '@crossmint/client-sdk-window';
6
6
  import { signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
7
7
  import { UIConfig } from '@crossmint/common-sdk-base';
@@ -52,24 +52,33 @@ type CrossmintWalletBaseContext = {
52
52
  wallet: Wallet<Chain> | undefined;
53
53
  /** Current wallet status. */
54
54
  status: "not-loaded" | "in-progress" | "loaded" | "error";
55
- /** Creates a new wallet or retrieves an existing one. */
56
- getOrCreateWallet: <C extends Chain>(props: WalletArgsFor<C>) => Promise<Wallet<Chain> | undefined>;
57
- /** Callback invoked when email or phone verification is required during a non-custodial wallet signing flow. */
58
- onAuthRequired?: EmailSignerConfig["onAuthRequired"] | PhoneSignerConfig["onAuthRequired"];
55
+ /** Retrieves an existing wallet. */
56
+ getWallet: <C extends Chain>(props: Pick<ClientSideWalletArgsFor<C>, "chain" | "alias">) => Promise<Wallet<Chain> | undefined>;
57
+ /** Creates a new wallet. */
58
+ createWallet: <C extends Chain>(props: ClientSideWalletCreateArgs<C>) => Promise<Wallet<Chain> | undefined>;
59
59
  /** @internal */
60
60
  clientTEEConnection?: () => HandshakeParent<typeof signerOutboundEvents, typeof signerInboundEvents>;
61
61
  /** @internal */
62
62
  emailSignerState: {
63
63
  needsAuth: boolean;
64
- sendEmailWithOtp: (() => Promise<void>) | null;
64
+ sendOtp: (() => Promise<void>) | null;
65
65
  verifyOtp: ((otp: string) => Promise<void>) | null;
66
66
  reject: ((error?: Error) => void) | null;
67
67
  };
68
+ /** Creates a Device Signer */
69
+ createDeviceSigner: () => Promise<DeviceSignerDescriptor> | undefined;
70
+ /** Creates a Passkey Signer */
71
+ createPasskeySigner: (passkeyName: string) => Promise<RegisterSignerPasskeyParams>;
68
72
  };
69
73
  declare const CrossmintWalletBaseContext: react.Context<CrossmintWalletBaseContext>;
70
74
  interface CrossmintWalletBaseProviderProps {
71
75
  /** Configuration for automatic wallet creation on login. */
72
76
  createOnLogin?: CreateOnLogin;
77
+ /**
78
+ * @internal
79
+ * Storage for the device signer key.
80
+ */
81
+ deviceSignerKeyStorage?: DeviceSignerKeyStorage;
73
82
  /** Lifecycle callbacks for wallet creation and transaction events. */
74
83
  callbacks?: {
75
84
  onWalletCreationStart?: () => Promise<void>;
@@ -82,7 +91,7 @@ interface CrossmintWalletBaseProviderProps {
82
91
  /** When true, no UI is rendered and signing flows must be handled manually. When false, built-in UI components are rendered. */
83
92
  headlessSigningFlow?: boolean;
84
93
  /** Callback invoked when email or phone verification is required during a non-custodial wallet signing flow. */
85
- onAuthRequired?: EmailSignerConfig["onAuthRequired"] | PhoneSignerConfig["onAuthRequired"];
94
+ onAuthRequired?: Callbacks["onAuthRequired"];
86
95
  /** @internal */
87
96
  children: ReactNode;
88
97
  /** @internal */
@@ -99,6 +108,6 @@ type PasskeyPromptState = {
99
108
  primaryActionOnClick?: () => void;
100
109
  secondaryActionOnClick?: () => void;
101
110
  };
102
- declare function CrossmintWalletBaseProvider({ children, createOnLogin, callbacks, clientTEEConnection, initializeWebView, appearance, headlessSigningFlow, showPasskeyHelpers, renderUI, }: CrossmintWalletBaseProviderProps): react_jsx_runtime.JSX.Element;
111
+ declare function CrossmintWalletBaseProvider({ children, createOnLogin, callbacks, clientTEEConnection, deviceSignerKeyStorage, initializeWebView, appearance, headlessSigningFlow, onAuthRequired: onAuthRequiredFromProps, showPasskeyHelpers, renderUI, }: CrossmintWalletBaseProviderProps): react_jsx_runtime.JSX.Element;
103
112
 
104
113
  export { CrossmintWalletBaseContext as C, type PasskeyPromptState as P, type UIRenderProps as U, type CrossmintWalletBaseProviderProps as a, CrossmintWalletBaseProvider as b, type CrossmintWalletUIBaseProviderProps as c, CrossmintWalletUIBaseProvider as d };
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { MutableRefObject, ReactNode } from 'react';
4
- import { Wallet, Chain, WalletArgsFor, EmailSignerConfig, PhoneSignerConfig } from '@crossmint/wallets-sdk';
4
+ import { Wallet, Chain, ClientSideWalletArgsFor, ClientSideWalletCreateArgs, DeviceSignerDescriptor, RegisterSignerPasskeyParams, DeviceSignerKeyStorage, Callbacks } from '@crossmint/wallets-sdk';
5
5
  import { HandshakeParent } from '@crossmint/client-sdk-window';
6
6
  import { signerOutboundEvents, signerInboundEvents } from '@crossmint/client-signers';
7
7
  import { UIConfig } from '@crossmint/common-sdk-base';
@@ -52,24 +52,33 @@ type CrossmintWalletBaseContext = {
52
52
  wallet: Wallet<Chain> | undefined;
53
53
  /** Current wallet status. */
54
54
  status: "not-loaded" | "in-progress" | "loaded" | "error";
55
- /** Creates a new wallet or retrieves an existing one. */
56
- getOrCreateWallet: <C extends Chain>(props: WalletArgsFor<C>) => Promise<Wallet<Chain> | undefined>;
57
- /** Callback invoked when email or phone verification is required during a non-custodial wallet signing flow. */
58
- onAuthRequired?: EmailSignerConfig["onAuthRequired"] | PhoneSignerConfig["onAuthRequired"];
55
+ /** Retrieves an existing wallet. */
56
+ getWallet: <C extends Chain>(props: Pick<ClientSideWalletArgsFor<C>, "chain" | "alias">) => Promise<Wallet<Chain> | undefined>;
57
+ /** Creates a new wallet. */
58
+ createWallet: <C extends Chain>(props: ClientSideWalletCreateArgs<C>) => Promise<Wallet<Chain> | undefined>;
59
59
  /** @internal */
60
60
  clientTEEConnection?: () => HandshakeParent<typeof signerOutboundEvents, typeof signerInboundEvents>;
61
61
  /** @internal */
62
62
  emailSignerState: {
63
63
  needsAuth: boolean;
64
- sendEmailWithOtp: (() => Promise<void>) | null;
64
+ sendOtp: (() => Promise<void>) | null;
65
65
  verifyOtp: ((otp: string) => Promise<void>) | null;
66
66
  reject: ((error?: Error) => void) | null;
67
67
  };
68
+ /** Creates a Device Signer */
69
+ createDeviceSigner: () => Promise<DeviceSignerDescriptor> | undefined;
70
+ /** Creates a Passkey Signer */
71
+ createPasskeySigner: (passkeyName: string) => Promise<RegisterSignerPasskeyParams>;
68
72
  };
69
73
  declare const CrossmintWalletBaseContext: react.Context<CrossmintWalletBaseContext>;
70
74
  interface CrossmintWalletBaseProviderProps {
71
75
  /** Configuration for automatic wallet creation on login. */
72
76
  createOnLogin?: CreateOnLogin;
77
+ /**
78
+ * @internal
79
+ * Storage for the device signer key.
80
+ */
81
+ deviceSignerKeyStorage?: DeviceSignerKeyStorage;
73
82
  /** Lifecycle callbacks for wallet creation and transaction events. */
74
83
  callbacks?: {
75
84
  onWalletCreationStart?: () => Promise<void>;
@@ -82,7 +91,7 @@ interface CrossmintWalletBaseProviderProps {
82
91
  /** When true, no UI is rendered and signing flows must be handled manually. When false, built-in UI components are rendered. */
83
92
  headlessSigningFlow?: boolean;
84
93
  /** Callback invoked when email or phone verification is required during a non-custodial wallet signing flow. */
85
- onAuthRequired?: EmailSignerConfig["onAuthRequired"] | PhoneSignerConfig["onAuthRequired"];
94
+ onAuthRequired?: Callbacks["onAuthRequired"];
86
95
  /** @internal */
87
96
  children: ReactNode;
88
97
  /** @internal */
@@ -99,6 +108,6 @@ type PasskeyPromptState = {
99
108
  primaryActionOnClick?: () => void;
100
109
  secondaryActionOnClick?: () => void;
101
110
  };
102
- declare function CrossmintWalletBaseProvider({ children, createOnLogin, callbacks, clientTEEConnection, initializeWebView, appearance, headlessSigningFlow, showPasskeyHelpers, renderUI, }: CrossmintWalletBaseProviderProps): react_jsx_runtime.JSX.Element;
111
+ declare function CrossmintWalletBaseProvider({ children, createOnLogin, callbacks, clientTEEConnection, deviceSignerKeyStorage, initializeWebView, appearance, headlessSigningFlow, onAuthRequired: onAuthRequiredFromProps, showPasskeyHelpers, renderUI, }: CrossmintWalletBaseProviderProps): react_jsx_runtime.JSX.Element;
103
112
 
104
113
  export { CrossmintWalletBaseContext as C, type PasskeyPromptState as P, type UIRenderProps as U, type CrossmintWalletBaseProviderProps as a, CrossmintWalletBaseProvider as b, type CrossmintWalletUIBaseProviderProps as c, CrossmintWalletUIBaseProvider as d };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkP3KCES3Scjs = require('./chunk-P3KCES3S.cjs');var _chunk772QWMBBcjs = require('./chunk-772QWMBB.cjs');var _chunkQBEM2WHMcjs = require('./chunk-QBEM2WHM.cjs');var _chunk753F2TL5cjs = require('./chunk-753F2TL5.cjs');var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var _react = require('react');var _walletssdk = require('@crossmint/wallets-sdk');var G=i=>()=>{throw new Error(`${i} is not available. Make sure you're using an email or phone signer wallet.`)};function Fe(){let i=_react.useContext.call(void 0, D);if(i==null)throw new Error("useWalletOtpSigner must be used within CrossmintWalletProvider");let{emailSignerState:e}=i,m=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var n;return e.sendOtp==null&&G("sendOtp")(),yield(n=e.sendOtp)==null?void 0:n.call(e)}),[e.sendOtp]),c=_react.useCallback.call(void 0, n=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var l;return e.verifyOtp==null&&G("verifyOtp")(),yield(l=e.verifyOtp)==null?void 0:l.call(e,n)}),[e.verifyOtp]),u=_react.useCallback.call(void 0, n=>{var l;e.reject==null&&G("reject")(),(l=e.reject)==null||l.call(e,n)},[e.reject]);return{needsAuth:e.needsAuth,sendOtp:m,verifyOtp:c,reject:u}}var _clientsdkauth = require('@crossmint/client-sdk-auth');var _commonsdkauth = require('@crossmint/common-sdk-auth');var _jsxruntime = require('react/jsx-runtime');var T=_react.createContext.call(void 0, {crossmintAuth:void 0,logout:()=>_chunkCK4JCQY6cjs.c.call(void 0, void 0,null,function*(){}),status:"initializing",getUser:()=>{},login:()=>{}});function be(){let i=_react.useContext.call(void 0, T);if(i==null)throw new Error("useCrossmintAuthBase must be used within CrossmintAuthBaseProvider");return i}function Ae({children:i,onLoginSuccess:e,refreshRoute:m,logoutRoute:c,storageProvider:u}){let{crossmint:n}=_chunkP3KCES3Scjs.a.call(void 0, "CrossmintAuthBaseProvider must be used within CrossmintProvider"),[l,v]=_react.useState.call(void 0, void 0),[a,P]=_react.useState.call(void 0, void 0),[x,O]=_react.useState.call(void 0, !1),s=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{if(!s.current)try{s.current=_clientsdkauth.CrossmintAuth.from(n,{callbacks:{onLogout:()=>{v(void 0),P(void 0)},onTokenRefresh:h=>{v(h.user),P(h.jwt)}},refreshRoute:m,logoutRoute:c,storageProvider:u})}catch(h){console.error("Failed to initialize CrossmintAuth:",h)}},[n,m,c,u]);let d=s.current,b=_react.useCallback.call(void 0, ()=>{e==null||e()},[e]);_react.useEffect.call(void 0, ()=>{var h;if(a==null)if(u)(h=u.get)==null||h.call(u,_commonsdkauth.SESSION_PREFIX).then(A=>{A!=null&&P(A)}).finally(()=>{O(!0)});else{try{let A=_clientsdkauth.getCookie.call(void 0, _commonsdkauth.SESSION_PREFIX);P(A)}catch(A){console.error("Failed to get cookie:",A)}O(!0)}else O(!0)},[a,u]),_react.useEffect.call(void 0, ()=>{a!=null&&b()},[a,b]);let w=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return v(void 0),P(void 0),yield d==null?void 0:d.logout()}),[d]),f=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){if(a==null){console.log("User not logged in");return}let h=yield d==null?void 0:d.getUser();return v(h),h}),[a,d]),_=_react.useCallback.call(void 0, ()=>x?a!=null?"logged-in":"logged-out":"initializing",[a,x]),U=_react.useMemo.call(void 0, ()=>({crossmintAuth:d,logout:w,jwt:a,user:l,status:_(),getUser:f,login:()=>{}}),[d,w,a,l,x,f,_]);return _jsxruntime.jsx.call(void 0, T.Provider,{value:U,children:i})}function lt(){let i=_react.useContext.call(void 0, T);if(i==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return i}var _lodashclonedeep = require('lodash.clonedeep'); var _lodashclonedeep2 = _interopRequireDefault(_lodashclonedeep);var D=_react.createContext.call(void 0, {wallet:void 0,status:"not-loaded",getWallet:()=>Promise.resolve(void 0),createWallet:()=>Promise.resolve(void 0),clientTEEConnection:void 0,emailSignerState:{needsAuth:!1,sendOtp:null,verifyOtp:null,reject:null},createDeviceSigner:()=>Promise.reject(new Error("createDeviceSigner must be used within a CrossmintWalletBaseProvider")),createPasskeySigner:()=>Promise.reject(new Error("createPasskeySigner must be used within a CrossmintWalletBaseProvider"))});function At({children:i,createOnLogin:e,callbacks:m,clientTEEConnection:c,deviceSignerKeyStorage:u,initializeWebView:n,appearance:l,headlessSigningFlow:v,onAuthRequired:a,showPasskeyHelpers:P,renderUI:x}){var ie,ae;let O=_chunkQBEM2WHMcjs.b.call(void 0, _chunk772QWMBBcjs.b),{crossmint:s}=_chunkP3KCES3Scjs.a.call(void 0, "CrossmintWalletBaseProvider must be used within CrossmintProvider"),[d,b]=_react.useState.call(void 0, void 0),[w,f]=_react.useState.call(void 0, "not-loaded"),[_,U]=_react.useState.call(void 0, {open:!1}),h=_chunk753F2TL5cjs.a.call(void 0, ),{onAuthRequired:A}=h,[L,Ce]=_react.useState.call(void 0, {needsAuth:!1,sendOtp:null,verifyOtp:null,reject:null}),J=_react.useCallback.call(void 0, t=>()=>new Promise(r=>{if(!P){r();return}U({type:t,open:!0,primaryActionOnClick:()=>{U({open:!1}),r()},secondaryActionOnClick:()=>{U({open:!1}),r()}})}),[P]),R=_react.useMemo.call(void 0, ()=>{var o;let t=m==null?void 0:m.onWalletCreationStart,r=m==null?void 0:m.onTransactionStart;return((o=e==null?void 0:e.recovery)==null?void 0:o.type)==="passkey"&&P&&(t=J("create-wallet"),r=J("transaction")),{onWalletCreationStart:t,onTransactionStart:r}},[m,(ie=e==null?void 0:e.recovery)==null?void 0:ie.type,P,J]),ee=_react.useCallback.call(void 0, (t,r,o,W,C,y)=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){Ce({needsAuth:o,sendOtp:W,verifyOtp:C,reject:y});let p=a!=null?a:A;return yield p==null?void 0:p(t,r,o,W,C,y)}),[a,A]),E=_react.useCallback.call(void 0, t=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){(t.type==="email"||t.type==="phone")&&(yield n==null?void 0:n())}),[n]),I=_react.useCallback.call(void 0, t=>{var r,o,W,C,y,p;return{clientTEEConnection:c==null?void 0:c(),callbacks:{onWalletCreationStart:(o=(r=t==null?void 0:t.callbacks)==null?void 0:r.onWalletCreationStart)!=null?o:R==null?void 0:R.onWalletCreationStart,onTransactionStart:(C=(W=t==null?void 0:t.callbacks)==null?void 0:W.onTransactionStart)!=null?C:R==null?void 0:R.onTransactionStart,onAuthRequired:(p=(y=t==null?void 0:t.callbacks)==null?void 0:y.onAuthRequired)!=null?p:ee},deviceSignerKeyStorage:u}},[c,R,u,ee]),te=_react.useCallback.call(void 0, t=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){let r=_lodashclonedeep2.default.call(void 0, t);if(!(s.jwt==null||w==="in-progress")){if(d!=null)return d;try{f("in-progress");let o=_walletssdk.CrossmintWallets.from(s);yield E(r.recovery);let W=I(r.options),C;try{C=yield o.getWallet({chain:r.chain,alias:r.alias,options:W})}catch(y){if(!(y instanceof _walletssdk.WalletNotAvailableError))throw y}return C==null&&(C=yield o.createWallet({chain:r.chain,plugins:r.plugins,recovery:r.recovery,signers:r.signers,alias:r.alias,options:W})),b(C),f("loaded"),C}catch(o){console.error("Failed to create wallet:",o),b(void 0),f("error");return}}}),[s,s.jwt,w,d,E,I]),re=_react.useCallback.call(void 0, t=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){if((s==null?void 0:s.jwt)!=null)try{f("in-progress");let o=yield _walletssdk.CrossmintWallets.from(s).getWallet({chain:t.chain,alias:t.alias,options:I()});return o!=null?(yield E(o.recovery),b(o),f("loaded")):f("not-loaded"),o}catch(r){console.error("Failed to get wallet:",r),f("error");return}}),[s,E,I]),ne=_react.useCallback.call(void 0, t=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){if(!(s.jwt==null||w==="in-progress"))try{f("in-progress");let r=_walletssdk.CrossmintWallets.from(s);yield E(t.recovery);let o=yield r.createWallet(_chunkCK4JCQY6cjs.b.call(void 0, _chunkCK4JCQY6cjs.a.call(void 0, {},t),{options:I(t.options)}));return b(o),f("loaded"),o}catch(r){console.error("Failed to create wallet:",r),b(void 0),f("error");return}}),[s,w,E,I]),oe=_react.useCallback.call(void 0, ()=>{let t=_walletssdk.CrossmintWallets.from(s);if(u==null)throw new Error("A DeviceSignerKeyStorage must be provided to create a device signer");return t.createDeviceSigner(u)},[s,u]),se=_react.useCallback.call(void 0, t=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return yield _walletssdk.CrossmintWallets.from(s).createPasskeySigner(t)}),[s]),S=_react.useContext.call(void 0, T),[M,K]=_react.useState.call(void 0, void 0);_react.useEffect.call(void 0, ()=>{var r,o,W,C;if(e==null){K(void 0);return}if(((r=e.recovery)==null?void 0:r.type)==="email"&&e.recovery.email==null||((W=(o=e.signers)==null?void 0:o.some(y=>y.type==="email"&&y.email==null))!=null?W:!1)){if((S==null?void 0:S.user)==null)return;if(S.user.email==null){S.getUser();return}let y=S.user.email,p=_chunkCK4JCQY6cjs.a.call(void 0, {},e);((C=p.recovery)==null?void 0:C.type)==="email"&&p.recovery.email==null&&(p.recovery=_chunkCK4JCQY6cjs.b.call(void 0, _chunkCK4JCQY6cjs.a.call(void 0, {},p.recovery),{email:y})),p.signers!=null&&(p.signers=p.signers.map(H=>H.type==="email"&&H.email==null?_chunkCK4JCQY6cjs.b.call(void 0, _chunkCK4JCQY6cjs.a.call(void 0, {},H),{email:y}):H)),K(p);return}K(e)},[e,S==null?void 0:S.user,(ae=S==null?void 0:S.user)==null?void 0:ae.email]),_react.useEffect.call(void 0, ()=>{if(M!=null){let{recovery:t,signers:r}=M;if((t==null?void 0:t.type)==="external-wallet"&&t.address==null||r!=null&&r.some(o=>o.type==="external-wallet"&&o.address==null))return;te(M)}},[M,te,s.jwt]),_react.useEffect.call(void 0, ()=>{s.jwt==null&&w!=="not-loaded"&&(f("not-loaded"),b(void 0))},[s.jwt,w]);let ye=_react.useMemo.call(void 0, ()=>({wallet:d,status:w,getWallet:re,createWallet:ne,clientTEEConnection:c,emailSignerState:L,createDeviceSigner:oe,createPasskeySigner:se}),[re,ne,d,w,c,L,oe,se]),ge=l!=null||v!=null||P!=null||x!=null;return _jsxruntime.jsx.call(void 0, D.Provider,{value:ye,children:ge?_jsxruntime.jsx.call(void 0, ce,{appearance:l,headlessSigningFlow:v,renderUI:x,passkeyPromptState:_,signerAuth:h,children:i}):i})}function fe(){let i=_react.useContext.call(void 0, D);if(!i)throw new Error("useWallet must be used within CrossmintWalletProvider");return i}function ce({children:i,appearance:e,headlessSigningFlow:m,renderUI:c,passkeyPromptState:u,signerAuth:n}){var x,O;let{wallet:l}=fe(),v=(x=l==null?void 0:l.signer)==null?void 0:x.type,a=(O=l==null?void 0:l.signer)==null?void 0:O.locator().split(":")[1],P={emailSignerProps:{email:v==="email"?a:void 0,open:n.emailSignerDialogOpen&&v==="email"&&a!=null,setOpen:n.setEmailSignerDialogOpen,step:n.emailSignerDialogStep,onSubmitOTP:n.emailsigners_handleOTPSubmit,onResendOTPCode:n.emailsigners_handleResendOTP,onSubmitEmail:n.emailsigners_handleSendEmailOTP,rejectRef:n.rejectRef,appearance:e},phoneSignerProps:{phone:v==="phone"?a:void 0,open:n.phoneSignerDialogOpen&&v==="phone"&&a!=null,setOpen:n.setPhoneSignerDialogOpen,step:n.phoneSignerDialogStep,onSubmitOTP:n.phonesigners_handleOTPSubmit,onResendOTPCode:n.phonesigners_handleResendOTP,onSubmitPhone:n.phonesigners_handleSendPhoneOTP,rejectRef:n.rejectRef,appearance:e},passkeyPromptProps:{state:u,appearance:e}};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[i,!m&&c!=null&&c(P)]})}exports.a = ce; exports.b = T; exports.c = be; exports.d = Ae; exports.e = D; exports.f = At; exports.g = fe; exports.h = Fe; exports.i = lt;
@@ -0,0 +1 @@
1
+ import{c as o}from"./chunk-22GIA4MK.js";import{useState as p,useRef as t,useCallback as n}from"react";var a=c=>()=>{throw new Error(`${c} is not available. Make sure you're using an email or phone signer wallet.`)};function q(){let[c,d]=p(!1),[b,g]=p("initial"),[y,h]=p(!1),[R,m]=p("initial"),s=t(a("sendEmailOtp")),P=t(a("verifyOtp")),l=t(a("sendPhoneOtp")),u=t(a("verifyPhoneOtp")),r=t(a("reject")),T=n(()=>o(this,null,function*(){try{yield s.current(),g("otp")}catch(e){console.error("Failed to send email OTP",e),r.current(new Error("Failed to send email OTP"))}}),[]),D=n(e=>o(this,null,function*(){try{yield P.current(e),d(!1),g("initial")}catch(i){console.error("Failed to verify OTP",i),r.current(new Error("Failed to verify OTP"))}}),[]),E=n(()=>o(this,null,function*(){try{yield s.current()}catch(e){console.error("Failed to resend email OTP",e),r.current(new Error("Failed to resend email OTP"))}}),[]),w=n(()=>o(this,null,function*(){try{yield l.current(),m("otp")}catch(e){console.error("Failed to send phone OTP",e),r.current(new Error("Failed to send phone OTP"))}}),[]),F=n(e=>o(this,null,function*(){try{yield u.current(e),h(!1),m("initial")}catch(i){console.error("Failed to verify phone OTP",i),r.current(new Error("Failed to verify phone OTP"))}}),[]),_=n(()=>o(this,null,function*(){try{yield l.current()}catch(e){console.error("Failed to resend phone OTP",e),r.current(new Error("Failed to resend phone OTP"))}}),[]),j=n((e,i,O,S,f,A)=>{let v=i.split(":")[1];return e==="phone"&&v!=null?(h(O),l.current=S,u.current=f):e==="email"&&v!=null&&(d(O),s.current=S,P.current=f),r.current=A,Promise.resolve()},[]);return{emailSignerDialogOpen:c,emailSignerDialogStep:b,setEmailSignerDialogOpen:d,setEmailSignerDialogStep:g,phoneSignerDialogOpen:y,phoneSignerDialogStep:R,setPhoneSignerDialogOpen:h,setPhoneSignerDialogStep:m,sendEmailOtpRef:s,verifyOtpRef:P,sendPhoneOtpRef:l,verifyPhoneOtpRef:u,rejectRef:r,emailsigners_handleSendEmailOTP:T,emailsigners_handleOTPSubmit:D,emailsigners_handleResendOTP:E,phonesigners_handleSendPhoneOTP:w,phonesigners_handleOTPSubmit:F,phonesigners_handleResendOTP:_,onAuthRequired:j}}export{q as a};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var _react = require('react');var a=c=>()=>{throw new Error(`${c} is not available. Make sure you're using an email or phone signer wallet.`)};function x(){let[c,d]=_react.useState.call(void 0, !1),[b,g]=_react.useState.call(void 0, "initial"),[y,h]=_react.useState.call(void 0, !1),[R,m]=_react.useState.call(void 0, "initial"),s=_react.useRef.call(void 0, a("sendEmailOtp")),P=_react.useRef.call(void 0, a("verifyOtp")),l=_react.useRef.call(void 0, a("sendPhoneOtp")),u=_react.useRef.call(void 0, a("verifyPhoneOtp")),r=_react.useRef.call(void 0, a("reject")),T=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield s.current(),g("otp")}catch(e){console.error("Failed to send email OTP",e),r.current(new Error("Failed to send email OTP"))}}),[]),D=_react.useCallback.call(void 0, e=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield P.current(e),d(!1),g("initial")}catch(i){console.error("Failed to verify OTP",i),r.current(new Error("Failed to verify OTP"))}}),[]),E=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield s.current()}catch(e){console.error("Failed to resend email OTP",e),r.current(new Error("Failed to resend email OTP"))}}),[]),w=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield l.current(),m("otp")}catch(e){console.error("Failed to send phone OTP",e),r.current(new Error("Failed to send phone OTP"))}}),[]),F=_react.useCallback.call(void 0, e=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield u.current(e),h(!1),m("initial")}catch(i){console.error("Failed to verify phone OTP",i),r.current(new Error("Failed to verify phone OTP"))}}),[]),_=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield l.current()}catch(e){console.error("Failed to resend phone OTP",e),r.current(new Error("Failed to resend phone OTP"))}}),[]),j=_react.useCallback.call(void 0, (e,i,O,S,f,A)=>{let v=i.split(":")[1];return e==="phone"&&v!=null?(h(O),l.current=S,u.current=f):e==="email"&&v!=null&&(d(O),s.current=S,P.current=f),r.current=A,Promise.resolve()},[]);return{emailSignerDialogOpen:c,emailSignerDialogStep:b,setEmailSignerDialogOpen:d,setEmailSignerDialogStep:g,phoneSignerDialogOpen:y,phoneSignerDialogStep:R,setPhoneSignerDialogOpen:h,setPhoneSignerDialogStep:m,sendEmailOtpRef:s,verifyOtpRef:P,sendPhoneOtpRef:l,verifyPhoneOtpRef:u,rejectRef:r,emailsigners_handleSendEmailOTP:T,emailsigners_handleOTPSubmit:D,emailsigners_handleResendOTP:E,phonesigners_handleSendPhoneOTP:w,phonesigners_handleOTPSubmit:F,phonesigners_handleResendOTP:_,onAuthRequired:j}}exports.a = x;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQBEM2WHMcjs = require('./chunk-QBEM2WHM.cjs');var _chunk4UKWTU5Wcjs = require('./chunk-4UKWTU5W.cjs');var _react = require('react');var _commonsdkbase = require('@crossmint/common-sdk-base');var r={name:"@crossmint/client-sdk-react-base",version:"2.0.0-beta.2",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","test:vitest":"vitest run"},dependencies:{"@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/wallets-sdk":"workspace:*","lodash.isequal":"4.5.0","lodash.clonedeep":"4.5.0"},devDependencies:{"@types/react":"19.1.10","@types/lodash.isequal":"4.5.6","@types/lodash.clonedeep":"4.5.6"},peerDependencies:{react:">=17.0.2"}};var _jsxruntime = require('react/jsx-runtime');var E=_react.createContext.call(void 0, null),N= exports.b =_chunkQBEM2WHMcjs.a.call(void 0, );function q({children:l,apiKey:t,appId:u,extensionId:p,overrideBaseUrl:C}){let f=_react.useMemo.call(void 0, ()=>_chunk4UKWTU5Wcjs.a.call(void 0, t,r.name,r.version),[t]),[w,x]=_react.useState.call(void 0, 0),e=_react.useRef.call(void 0, null);e.current==null&&(e.current=new Proxy(_commonsdkbase.createCrossmint.call(void 0, {apiKey:t,overrideBaseUrl:C,appId:u,extensionId:p}),{set(s,n,i){return n==="jwt"&&s.jwt!==i&&x(g=>g+1),Reflect.set(s,n,i)}}));let o=_react.useCallback.call(void 0, s=>{if(e.current==null)throw new Error("CrossmintProvider is not initialized");s!==e.current.jwt&&(e.current.jwt=s)},[]),v=_react.useMemo.call(void 0, ()=>{if(!e.current)throw new Error("CrossmintProvider is not initialized");return{get crossmint(){return e.current},setJwt:o}},[o,w]);return _jsxruntime.jsx.call(void 0, N.Provider,{value:f,children:_jsxruntime.jsx.call(void 0, E.Provider,{value:v,children:l})})}exports.a = E; exports.b = N; exports.c = q;
@@ -1 +1 @@
1
- import{a as t}from"./chunk-GFXPYJ63.js";import{useContext as u}from"react";function c(r){let o=u(t);if(o==null)throw new Error(r!=null?r:"useCrossmint must be used within a CrossmintProvider");return o}export{c as a};
1
+ import{a as t}from"./chunk-KXK5YLCP.js";import{useContext as u}from"react";function c(r){let o=u(t);if(o==null)throw new Error(r!=null?r:"useCrossmint must be used within a CrossmintProvider");return o}export{c as a};
@@ -0,0 +1 @@
1
+ import{EVMWallet as n,SolanaWallet as i,StellarWallet as o}from"@crossmint/wallets-sdk";export{n as a,i as b,o as c};
@@ -0,0 +1 @@
1
+ import{a as d}from"./chunk-FF2S33DL.js";import{a as c}from"./chunk-SUETDQ6M.js";import{createContext as h,useCallback as P,useMemo as m,useRef as b,useState as y}from"react";import{createCrossmint as j}from"@crossmint/common-sdk-base";var r={name:"@crossmint/client-sdk-react-base",version:"2.0.0-beta.2",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","test:vitest":"vitest run"},dependencies:{"@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/wallets-sdk":"workspace:*","lodash.isequal":"4.5.0","lodash.clonedeep":"4.5.0"},devDependencies:{"@types/react":"19.1.10","@types/lodash.isequal":"4.5.6","@types/lodash.clonedeep":"4.5.6"},peerDependencies:{react:">=17.0.2"}};import{jsx as a}from"react/jsx-runtime";var E=h(null),N=d();function J({children:l,apiKey:t,appId:u,extensionId:p,overrideBaseUrl:C}){let f=m(()=>c(t,r.name,r.version),[t]),[w,x]=y(0),e=b(null);e.current==null&&(e.current=new Proxy(j({apiKey:t,overrideBaseUrl:C,appId:u,extensionId:p}),{set(s,n,i){return n==="jwt"&&s.jwt!==i&&x(g=>g+1),Reflect.set(s,n,i)}}));let o=P(s=>{if(e.current==null)throw new Error("CrossmintProvider is not initialized");s!==e.current.jwt&&(e.current.jwt=s)},[]),v=m(()=>{if(!e.current)throw new Error("CrossmintProvider is not initialized");return{get crossmint(){return e.current},setJwt:o}},[o,w]);return a(N.Provider,{value:f,children:a(E.Provider,{value:v,children:l})})}export{E as a,N as b,J as c};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkV6H3YTIDcjs = require('./chunk-V6H3YTID.cjs');var _react = require('react');function i(r){let o=_react.useContext.call(void 0, _chunkV6H3YTIDcjs.a);if(o==null)throw new Error(r!=null?r:"useCrossmint must be used within a CrossmintProvider");return o}exports.a = i;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk772QWMBBcjs = require('./chunk-772QWMBB.cjs');var _react = require('react');function i(r){let o=_react.useContext.call(void 0, _chunk772QWMBBcjs.a);if(o==null)throw new Error(r!=null?r:"useCrossmint must be used within a CrossmintProvider");return o}exports.a = i;
@@ -0,0 +1 @@
1
+ import{a as z}from"./chunk-DY4BVQZD.js";import{b as ue}from"./chunk-KXK5YLCP.js";import{b as $}from"./chunk-FF2S33DL.js";import{a as de}from"./chunk-6LPM65VC.js";import{a as D,b as q,c as g}from"./chunk-22GIA4MK.js";import{useContext as Ue}from"react";import{createContext as Be,useCallback as k,useContext as Te,useEffect as L,useMemo as me,useState as F}from"react";import{CrossmintWallets as _,WalletNotAvailableError as Ee}from"@crossmint/wallets-sdk";import{useCallback as G,useContext as he}from"react";var Q=i=>()=>{throw new Error(`${i} is not available. Make sure you're using an email or phone signer wallet.`)};function _e(){let i=he(N);if(i==null)throw new Error("useWalletOtpSigner must be used within CrossmintWalletProvider");let{emailSignerState:e}=i,m=G(()=>g(this,null,function*(){var n;return e.sendOtp==null&&Q("sendOtp")(),yield(n=e.sendOtp)==null?void 0:n.call(e)}),[e.sendOtp]),c=G(n=>g(this,null,function*(){var l;return e.verifyOtp==null&&Q("verifyOtp")(),yield(l=e.verifyOtp)==null?void 0:l.call(e,n)}),[e.verifyOtp]),u=G(n=>{var l;e.reject==null&&Q("reject")(),(l=e.reject)==null||l.call(e,n)},[e.reject]);return{needsAuth:e.needsAuth,sendOtp:m,verifyOtp:c,reject:u}}import{useContext as Re}from"react";import{createContext as ve,useCallback as J,useContext as Se,useEffect as Y,useMemo as we,useRef as We,useState as Z}from"react";import{CrossmintAuth as xe,getCookie as be}from"@crossmint/client-sdk-auth";import{SESSION_PREFIX as pe}from"@crossmint/common-sdk-auth";import{jsx as Oe}from"react/jsx-runtime";var E=ve({crossmintAuth:void 0,logout:()=>g(void 0,null,function*(){}),status:"initializing",getUser:()=>{},login:()=>{}});function Ae(){let i=Se(E);if(i==null)throw new Error("useCrossmintAuthBase must be used within CrossmintAuthBaseProvider");return i}function ke({children:i,onLoginSuccess:e,refreshRoute:m,logoutRoute:c,storageProvider:u}){let{crossmint:n}=z("CrossmintAuthBaseProvider must be used within CrossmintProvider"),[l,v]=Z(void 0),[a,P]=Z(void 0),[x,O]=Z(!1),s=We(null);Y(()=>{if(!s.current)try{s.current=xe.from(n,{callbacks:{onLogout:()=>{v(void 0),P(void 0)},onTokenRefresh:h=>{v(h.user),P(h.jwt)}},refreshRoute:m,logoutRoute:c,storageProvider:u})}catch(h){console.error("Failed to initialize CrossmintAuth:",h)}},[n,m,c,u]);let d=s.current,b=J(()=>{e==null||e()},[e]);Y(()=>{var h;if(a==null)if(u)(h=u.get)==null||h.call(u,pe).then(A=>{A!=null&&P(A)}).finally(()=>{O(!0)});else{try{let A=be(pe);P(A)}catch(A){console.error("Failed to get cookie:",A)}O(!0)}else O(!0)},[a,u]),Y(()=>{a!=null&&b()},[a,b]);let w=J(()=>g(this,null,function*(){return v(void 0),P(void 0),yield d==null?void 0:d.logout()}),[d]),f=J(()=>g(this,null,function*(){if(a==null){console.log("User not logged in");return}let h=yield d==null?void 0:d.getUser();return v(h),h}),[a,d]),M=J(()=>x?a!=null?"logged-in":"logged-out":"initializing",[a,x]),j=we(()=>({crossmintAuth:d,logout:w,jwt:a,user:l,status:M(),getUser:f,login:()=>{}}),[d,w,a,l,x,f,M]);return Oe(E.Provider,{value:j,children:i})}function ut(){let i=Re(E);if(i==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return i}import Ie from"lodash.clonedeep";import{jsx as ce}from"react/jsx-runtime";var N=Be({wallet:void 0,status:"not-loaded",getWallet:()=>Promise.resolve(void 0),createWallet:()=>Promise.resolve(void 0),clientTEEConnection:void 0,emailSignerState:{needsAuth:!1,sendOtp:null,verifyOtp:null,reject:null},createDeviceSigner:()=>Promise.reject(new Error("createDeviceSigner must be used within a CrossmintWalletBaseProvider")),createPasskeySigner:()=>Promise.reject(new Error("createPasskeySigner must be used within a CrossmintWalletBaseProvider"))});function kt({children:i,createOnLogin:e,callbacks:m,clientTEEConnection:c,deviceSignerKeyStorage:u,initializeWebView:n,appearance:l,headlessSigningFlow:v,onAuthRequired:a,showPasskeyHelpers:P,renderUI:x}){var ae,le;let O=$(ue),{crossmint:s}=z("CrossmintWalletBaseProvider must be used within CrossmintProvider"),[d,b]=F(void 0),[w,f]=F("not-loaded"),[M,j]=F({open:!1}),h=de(),{onAuthRequired:A}=h,[ee,ye]=F({needsAuth:!1,sendOtp:null,verifyOtp:null,reject:null}),K=k(t=>()=>new Promise(r=>{if(!P){r();return}j({type:t,open:!0,primaryActionOnClick:()=>{j({open:!1}),r()},secondaryActionOnClick:()=>{j({open:!1}),r()}})}),[P]),R=me(()=>{var o;let t=m==null?void 0:m.onWalletCreationStart,r=m==null?void 0:m.onTransactionStart;return((o=e==null?void 0:e.recovery)==null?void 0:o.type)==="passkey"&&P&&(t=K("create-wallet"),r=K("transaction")),{onWalletCreationStart:t,onTransactionStart:r}},[m,(ae=e==null?void 0:e.recovery)==null?void 0:ae.type,P,K]),te=k((t,r,o,W,C,y)=>g(this,null,function*(){ye({needsAuth:o,sendOtp:W,verifyOtp:C,reject:y});let p=a!=null?a:A;return yield p==null?void 0:p(t,r,o,W,C,y)}),[a,A]),I=k(t=>g(this,null,function*(){(t.type==="email"||t.type==="phone")&&(yield n==null?void 0:n())}),[n]),U=k(t=>{var r,o,W,C,y,p;return{clientTEEConnection:c==null?void 0:c(),callbacks:{onWalletCreationStart:(o=(r=t==null?void 0:t.callbacks)==null?void 0:r.onWalletCreationStart)!=null?o:R==null?void 0:R.onWalletCreationStart,onTransactionStart:(C=(W=t==null?void 0:t.callbacks)==null?void 0:W.onTransactionStart)!=null?C:R==null?void 0:R.onTransactionStart,onAuthRequired:(p=(y=t==null?void 0:t.callbacks)==null?void 0:y.onAuthRequired)!=null?p:te},deviceSignerKeyStorage:u}},[c,R,u,te]),re=k(t=>g(this,null,function*(){let r=Ie(t);if(!(s.jwt==null||w==="in-progress")){if(d!=null)return d;try{f("in-progress");let o=_.from(s);yield I(r.recovery);let W=U(r.options),C;try{C=yield o.getWallet({chain:r.chain,alias:r.alias,options:W})}catch(y){if(!(y instanceof Ee))throw y}return C==null&&(C=yield o.createWallet({chain:r.chain,plugins:r.plugins,recovery:r.recovery,signers:r.signers,alias:r.alias,options:W})),b(C),f("loaded"),C}catch(o){console.error("Failed to create wallet:",o),b(void 0),f("error");return}}}),[s,s.jwt,w,d,I,U]),ne=k(t=>g(this,null,function*(){if((s==null?void 0:s.jwt)!=null)try{f("in-progress");let o=yield _.from(s).getWallet({chain:t.chain,alias:t.alias,options:U()});return o!=null?(yield I(o.recovery),b(o),f("loaded")):f("not-loaded"),o}catch(r){console.error("Failed to get wallet:",r),f("error");return}}),[s,I,U]),oe=k(t=>g(this,null,function*(){if(!(s.jwt==null||w==="in-progress"))try{f("in-progress");let r=_.from(s);yield I(t.recovery);let o=yield r.createWallet(q(D({},t),{options:U(t.options)}));return b(o),f("loaded"),o}catch(r){console.error("Failed to create wallet:",r),b(void 0),f("error");return}}),[s,w,I,U]),se=k(()=>{let t=_.from(s);if(u==null)throw new Error("A DeviceSignerKeyStorage must be provided to create a device signer");return t.createDeviceSigner(u)},[s,u]),ie=k(t=>g(this,null,function*(){return yield _.from(s).createPasskeySigner(t)}),[s]),S=Te(E),[H,X]=F(void 0);L(()=>{var r,o,W,C;if(e==null){X(void 0);return}if(((r=e.recovery)==null?void 0:r.type)==="email"&&e.recovery.email==null||((W=(o=e.signers)==null?void 0:o.some(y=>y.type==="email"&&y.email==null))!=null?W:!1)){if((S==null?void 0:S.user)==null)return;if(S.user.email==null){S.getUser();return}let y=S.user.email,p=D({},e);((C=p.recovery)==null?void 0:C.type)==="email"&&p.recovery.email==null&&(p.recovery=q(D({},p.recovery),{email:y})),p.signers!=null&&(p.signers=p.signers.map(V=>V.type==="email"&&V.email==null?q(D({},V),{email:y}):V)),X(p);return}X(e)},[e,S==null?void 0:S.user,(le=S==null?void 0:S.user)==null?void 0:le.email]),L(()=>{if(H!=null){let{recovery:t,signers:r}=H;if((t==null?void 0:t.type)==="external-wallet"&&t.address==null||r!=null&&r.some(o=>o.type==="external-wallet"&&o.address==null))return;re(H)}},[H,re,s.jwt]),L(()=>{s.jwt==null&&w!=="not-loaded"&&(f("not-loaded"),b(void 0))},[s.jwt,w]);let ge=me(()=>({wallet:d,status:w,getWallet:ne,createWallet:oe,clientTEEConnection:c,emailSignerState:ee,createDeviceSigner:se,createPasskeySigner:ie}),[ne,oe,d,w,c,ee,se,ie]),Pe=l!=null||v!=null||P!=null||x!=null;return ce(N.Provider,{value:ge,children:Pe?ce(fe,{appearance:l,headlessSigningFlow:v,renderUI:x,passkeyPromptState:M,signerAuth:h,children:i}):i})}function Ce(){let i=Ue(N);if(!i)throw new Error("useWallet must be used within CrossmintWalletProvider");return i}import{Fragment as je,jsxs as De}from"react/jsx-runtime";function fe({children:i,appearance:e,headlessSigningFlow:m,renderUI:c,passkeyPromptState:u,signerAuth:n}){var x,O;let{wallet:l}=Ce(),v=(x=l==null?void 0:l.signer)==null?void 0:x.type,a=(O=l==null?void 0:l.signer)==null?void 0:O.locator().split(":")[1],P={emailSignerProps:{email:v==="email"?a:void 0,open:n.emailSignerDialogOpen&&v==="email"&&a!=null,setOpen:n.setEmailSignerDialogOpen,step:n.emailSignerDialogStep,onSubmitOTP:n.emailsigners_handleOTPSubmit,onResendOTPCode:n.emailsigners_handleResendOTP,onSubmitEmail:n.emailsigners_handleSendEmailOTP,rejectRef:n.rejectRef,appearance:e},phoneSignerProps:{phone:v==="phone"?a:void 0,open:n.phoneSignerDialogOpen&&v==="phone"&&a!=null,setOpen:n.setPhoneSignerDialogOpen,step:n.phoneSignerDialogStep,onSubmitOTP:n.phonesigners_handleOTPSubmit,onResendOTPCode:n.phonesigners_handleResendOTP,onSubmitPhone:n.phonesigners_handleSendPhoneOTP,rejectRef:n.rejectRef,appearance:e},passkeyPromptProps:{state:u,appearance:e}};return De(je,{children:[i,!m&&c!=null&&c(P)]})}export{fe as a,E as b,Ae as c,ke as d,N as e,kt as f,Ce as g,_e as h,ut as i};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFJDGBKSKcjs = require('../chunk-FJDGBKSK.cjs');var _chunk33LPDFQUcjs = require('../chunk-33LPDFQU.cjs');require('../chunk-V6H3YTID.cjs');require('../chunk-QBEM2WHM.cjs');var _chunkJ5H2Z5BKcjs = require('../chunk-J5H2Z5BK.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useAuth = _chunkFJDGBKSKcjs.i; exports.useCrossmint = _chunk33LPDFQUcjs.a; exports.useCrossmintAuth = _chunkFJDGBKSKcjs.h; exports.useSignerAuth = _chunkJ5H2Z5BKcjs.a; exports.useWallet = _chunkFJDGBKSKcjs.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5PN427A7cjs = require('../chunk-5PN427A7.cjs');var _chunkP3KCES3Scjs = require('../chunk-P3KCES3S.cjs');require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');var _chunk753F2TL5cjs = require('../chunk-753F2TL5.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useCrossmint = _chunkP3KCES3Scjs.a; exports.useCrossmintAuth = _chunk5PN427A7cjs.i; exports.useSignerAuth = _chunk753F2TL5cjs.a; exports.useWallet = _chunk5PN427A7cjs.g; exports.useWalletOtpSigner = _chunk5PN427A7cjs.h;
@@ -1,13 +1,14 @@
1
1
  export { useCrossmint } from './useCrossmint.cjs';
2
2
  export { useWallet } from './useWallet.cjs';
3
- export { useAuth, useCrossmintAuth } from './useAuth.cjs';
3
+ export { OtpSignerFunctions, useWalletOtpSigner } from './useWalletOtpSigner.cjs';
4
+ export { useCrossmintAuth } from './useAuth.cjs';
4
5
  export { DialogStep, SignerAuthHandlers, SignerAuthState, SignerType, useSignerAuth } from './useSignerAuth.cjs';
5
6
  import '../providers/CrossmintProvider.cjs';
6
7
  import 'react/jsx-runtime';
7
8
  import '../providers/LoggerProvider.cjs';
8
9
  import 'react';
9
10
  import '@crossmint/common-sdk-base';
10
- import '../CrossmintWalletBaseProvider-CusZ3teM.cjs';
11
+ import '../CrossmintWalletBaseProvider-CFRV-0N0.cjs';
11
12
  import '@crossmint/wallets-sdk';
12
13
  import '@crossmint/client-sdk-window';
13
14
  import '@crossmint/client-signers';
@@ -1,13 +1,14 @@
1
1
  export { useCrossmint } from './useCrossmint.js';
2
2
  export { useWallet } from './useWallet.js';
3
- export { useAuth, useCrossmintAuth } from './useAuth.js';
3
+ export { OtpSignerFunctions, useWalletOtpSigner } from './useWalletOtpSigner.js';
4
+ export { useCrossmintAuth } from './useAuth.js';
4
5
  export { DialogStep, SignerAuthHandlers, SignerAuthState, SignerType, useSignerAuth } from './useSignerAuth.js';
5
6
  import '../providers/CrossmintProvider.js';
6
7
  import 'react/jsx-runtime';
7
8
  import '../providers/LoggerProvider.js';
8
9
  import 'react';
9
10
  import '@crossmint/common-sdk-base';
10
- import '../CrossmintWalletBaseProvider-B_Ad3uZ2.js';
11
+ import '../CrossmintWalletBaseProvider-BC3s1L7V.js';
11
12
  import '@crossmint/wallets-sdk';
12
13
  import '@crossmint/client-sdk-window';
13
14
  import '@crossmint/client-signers';
@@ -1 +1 @@
1
- import{d as b,h as c,i as d}from"../chunk-SSWKOAEE.js";import{a}from"../chunk-ELPIFOQ5.js";import"../chunk-GFXPYJ63.js";import"../chunk-FF2S33DL.js";import{a as e}from"../chunk-LEFZXON3.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{d as useAuth,a as useCrossmint,c as useCrossmintAuth,e as useSignerAuth,b as useWallet};
1
+ import{g as b,h as c,i as d}from"../chunk-VVXHOVXA.js";import{a}from"../chunk-DY4BVQZD.js";import"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import{a as e}from"../chunk-6LPM65VC.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as useCrossmint,d as useCrossmintAuth,e as useSignerAuth,b as useWallet,c as useWalletOtpSigner};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFJDGBKSKcjs = require('../chunk-FJDGBKSK.cjs');require('../chunk-33LPDFQU.cjs');require('../chunk-V6H3YTID.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-J5H2Z5BK.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useAuth = _chunkFJDGBKSKcjs.i; exports.useCrossmintAuth = _chunkFJDGBKSKcjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5PN427A7cjs = require('../chunk-5PN427A7.cjs');require('../chunk-P3KCES3S.cjs');require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-753F2TL5.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useCrossmintAuth = _chunk5PN427A7cjs.i;
@@ -4,6 +4,5 @@ import '@crossmint/client-sdk-auth';
4
4
  import '@crossmint/common-sdk-auth';
5
5
 
6
6
  declare function useCrossmintAuth(): CrossmintAuthBaseContextType;
7
- declare const useAuth: typeof useCrossmintAuth;
8
7
 
9
- export { useAuth, useCrossmintAuth };
8
+ export { useCrossmintAuth };
@@ -4,6 +4,5 @@ import '@crossmint/client-sdk-auth';
4
4
  import '@crossmint/common-sdk-auth';
5
5
 
6
6
  declare function useCrossmintAuth(): CrossmintAuthBaseContextType;
7
- declare const useAuth: typeof useCrossmintAuth;
8
7
 
9
- export { useAuth, useCrossmintAuth };
8
+ export { useCrossmintAuth };
@@ -1 +1 @@
1
- import{h as a,i as b}from"../chunk-SSWKOAEE.js";import"../chunk-ELPIFOQ5.js";import"../chunk-GFXPYJ63.js";import"../chunk-FF2S33DL.js";import"../chunk-LEFZXON3.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{b as useAuth,a as useCrossmintAuth};
1
+ import{i as a}from"../chunk-VVXHOVXA.js";import"../chunk-DY4BVQZD.js";import"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import"../chunk-6LPM65VC.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as useCrossmintAuth};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk33LPDFQUcjs = require('../chunk-33LPDFQU.cjs');require('../chunk-V6H3YTID.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useCrossmint = _chunk33LPDFQUcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkP3KCES3Scjs = require('../chunk-P3KCES3S.cjs');require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useCrossmint = _chunkP3KCES3Scjs.a;
@@ -1 +1 @@
1
- import{a}from"../chunk-ELPIFOQ5.js";import"../chunk-GFXPYJ63.js";import"../chunk-FF2S33DL.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as useCrossmint};
1
+ import{a}from"../chunk-DY4BVQZD.js";import"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as useCrossmint};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJ5H2Z5BKcjs = require('../chunk-J5H2Z5BK.cjs');require('../chunk-CK4JCQY6.cjs');exports.useSignerAuth = _chunkJ5H2Z5BKcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk753F2TL5cjs = require('../chunk-753F2TL5.cjs');require('../chunk-CK4JCQY6.cjs');exports.useSignerAuth = _chunk753F2TL5cjs.a;
@@ -1,5 +1,5 @@
1
1
  import { MutableRefObject } from 'react';
2
- import { Signer } from '@crossmint/wallets-sdk';
2
+ import { Callbacks } from '@crossmint/wallets-sdk';
3
3
 
4
4
  type SignerType = "email" | "phone";
5
5
  type DialogStep = "initial" | "otp";
@@ -12,9 +12,9 @@ interface SignerAuthState {
12
12
  phoneSignerDialogStep: DialogStep;
13
13
  setPhoneSignerDialogOpen: (open: boolean) => void;
14
14
  setPhoneSignerDialogStep: (step: DialogStep) => void;
15
- sendEmailWithOtpRef: MutableRefObject<() => Promise<void>>;
15
+ sendEmailOtpRef: MutableRefObject<() => Promise<void>>;
16
16
  verifyOtpRef: MutableRefObject<(otp: string) => Promise<void>>;
17
- sendPhoneWithOtpRef: MutableRefObject<() => Promise<void>>;
17
+ sendPhoneOtpRef: MutableRefObject<() => Promise<void>>;
18
18
  verifyPhoneOtpRef: MutableRefObject<(otp: string) => Promise<void>>;
19
19
  rejectRef: MutableRefObject<(error?: Error) => void>;
20
20
  }
@@ -25,8 +25,8 @@ interface SignerAuthHandlers {
25
25
  phonesigners_handleSendPhoneOTP: () => Promise<void>;
26
26
  phonesigners_handleOTPSubmit: (otp: string) => Promise<void>;
27
27
  phonesigners_handleResendOTP: () => Promise<void>;
28
- onAuthRequired: (needsAuth: boolean, sendMessageWithOtp: () => Promise<void>, verifyOtp: (otp: string) => Promise<void>, reject: () => void) => Promise<void>;
28
+ onAuthRequired: Callbacks["onAuthRequired"];
29
29
  }
30
- declare function useSignerAuth(signer?: Signer): SignerAuthState & SignerAuthHandlers;
30
+ declare function useSignerAuth(): SignerAuthState & SignerAuthHandlers;
31
31
 
32
32
  export { type DialogStep, type SignerAuthHandlers, type SignerAuthState, type SignerType, useSignerAuth };
@@ -1,5 +1,5 @@
1
1
  import { MutableRefObject } from 'react';
2
- import { Signer } from '@crossmint/wallets-sdk';
2
+ import { Callbacks } from '@crossmint/wallets-sdk';
3
3
 
4
4
  type SignerType = "email" | "phone";
5
5
  type DialogStep = "initial" | "otp";
@@ -12,9 +12,9 @@ interface SignerAuthState {
12
12
  phoneSignerDialogStep: DialogStep;
13
13
  setPhoneSignerDialogOpen: (open: boolean) => void;
14
14
  setPhoneSignerDialogStep: (step: DialogStep) => void;
15
- sendEmailWithOtpRef: MutableRefObject<() => Promise<void>>;
15
+ sendEmailOtpRef: MutableRefObject<() => Promise<void>>;
16
16
  verifyOtpRef: MutableRefObject<(otp: string) => Promise<void>>;
17
- sendPhoneWithOtpRef: MutableRefObject<() => Promise<void>>;
17
+ sendPhoneOtpRef: MutableRefObject<() => Promise<void>>;
18
18
  verifyPhoneOtpRef: MutableRefObject<(otp: string) => Promise<void>>;
19
19
  rejectRef: MutableRefObject<(error?: Error) => void>;
20
20
  }
@@ -25,8 +25,8 @@ interface SignerAuthHandlers {
25
25
  phonesigners_handleSendPhoneOTP: () => Promise<void>;
26
26
  phonesigners_handleOTPSubmit: (otp: string) => Promise<void>;
27
27
  phonesigners_handleResendOTP: () => Promise<void>;
28
- onAuthRequired: (needsAuth: boolean, sendMessageWithOtp: () => Promise<void>, verifyOtp: (otp: string) => Promise<void>, reject: () => void) => Promise<void>;
28
+ onAuthRequired: Callbacks["onAuthRequired"];
29
29
  }
30
- declare function useSignerAuth(signer?: Signer): SignerAuthState & SignerAuthHandlers;
30
+ declare function useSignerAuth(): SignerAuthState & SignerAuthHandlers;
31
31
 
32
32
  export { type DialogStep, type SignerAuthHandlers, type SignerAuthState, type SignerType, useSignerAuth };
@@ -1 +1 @@
1
- import{a}from"../chunk-LEFZXON3.js";import"../chunk-22GIA4MK.js";export{a as useSignerAuth};
1
+ import{a}from"../chunk-6LPM65VC.js";import"../chunk-22GIA4MK.js";export{a as useSignerAuth};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFJDGBKSKcjs = require('../chunk-FJDGBKSK.cjs');require('../chunk-33LPDFQU.cjs');require('../chunk-V6H3YTID.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-J5H2Z5BK.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useWallet = _chunkFJDGBKSKcjs.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5PN427A7cjs = require('../chunk-5PN427A7.cjs');require('../chunk-P3KCES3S.cjs');require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-753F2TL5.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useWallet = _chunk5PN427A7cjs.g;
@@ -1,4 +1,4 @@
1
- import { C as CrossmintWalletBaseContext } from '../CrossmintWalletBaseProvider-CusZ3teM.cjs';
1
+ import { C as CrossmintWalletBaseContext } from '../CrossmintWalletBaseProvider-CFRV-0N0.cjs';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@crossmint/wallets-sdk';
@@ -1,4 +1,4 @@
1
- import { C as CrossmintWalletBaseContext } from '../CrossmintWalletBaseProvider-B_Ad3uZ2.js';
1
+ import { C as CrossmintWalletBaseContext } from '../CrossmintWalletBaseProvider-BC3s1L7V.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import '@crossmint/wallets-sdk';
@@ -1 +1 @@
1
- import{d as a}from"../chunk-SSWKOAEE.js";import"../chunk-ELPIFOQ5.js";import"../chunk-GFXPYJ63.js";import"../chunk-FF2S33DL.js";import"../chunk-LEFZXON3.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as useWallet};
1
+ import{g as a}from"../chunk-VVXHOVXA.js";import"../chunk-DY4BVQZD.js";import"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import"../chunk-6LPM65VC.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as useWallet};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5PN427A7cjs = require('../chunk-5PN427A7.cjs');require('../chunk-P3KCES3S.cjs');require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-753F2TL5.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.useWalletOtpSigner = _chunk5PN427A7cjs.h;
@@ -0,0 +1,18 @@
1
+ type OtpSignerFunctions = {
2
+ /** Whether the OTP signer currently requires authentication (OTP verification). */
3
+ needsAuth: boolean;
4
+ /** Sends a one-time password to the user (via email or phone, depending on the signer type). */
5
+ sendOtp: () => Promise<void>;
6
+ /** Verifies the one-time password entered by the user. */
7
+ verifyOtp: (otp: string) => Promise<void>;
8
+ /** Rejects the current authentication request with an error. */
9
+ reject: (error: Error) => void;
10
+ };
11
+ /**
12
+ * Hook for managing OTP-based signer authentication flows.
13
+ * Provides OTP send/verify functions for wallets using an email or phone signer.
14
+ * Must be used within a {@link CrossmintWalletProvider}.
15
+ */
16
+ declare function useWalletOtpSigner(): OtpSignerFunctions;
17
+
18
+ export { type OtpSignerFunctions, useWalletOtpSigner };
@@ -0,0 +1,18 @@
1
+ type OtpSignerFunctions = {
2
+ /** Whether the OTP signer currently requires authentication (OTP verification). */
3
+ needsAuth: boolean;
4
+ /** Sends a one-time password to the user (via email or phone, depending on the signer type). */
5
+ sendOtp: () => Promise<void>;
6
+ /** Verifies the one-time password entered by the user. */
7
+ verifyOtp: (otp: string) => Promise<void>;
8
+ /** Rejects the current authentication request with an error. */
9
+ reject: (error: Error) => void;
10
+ };
11
+ /**
12
+ * Hook for managing OTP-based signer authentication flows.
13
+ * Provides OTP send/verify functions for wallets using an email or phone signer.
14
+ * Must be used within a {@link CrossmintWalletProvider}.
15
+ */
16
+ declare function useWalletOtpSigner(): OtpSignerFunctions;
17
+
18
+ export { type OtpSignerFunctions, useWalletOtpSigner };
@@ -0,0 +1 @@
1
+ import{h as a}from"../chunk-VVXHOVXA.js";import"../chunk-DY4BVQZD.js";import"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import"../chunk-6LPM65VC.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as useWalletOtpSigner};
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-YSXSE5ZY.cjs');var _chunkPU5EOTE7cjs = require('./chunk-PU5EOTE7.cjs');var _chunkFJDGBKSKcjs = require('./chunk-FJDGBKSK.cjs');var _chunk33LPDFQUcjs = require('./chunk-33LPDFQU.cjs');var _chunkV6H3YTIDcjs = require('./chunk-V6H3YTID.cjs');var _chunkQBEM2WHMcjs = require('./chunk-QBEM2WHM.cjs');var _chunkJ5H2Z5BKcjs = require('./chunk-J5H2Z5BK.cjs');var _chunk4UKWTU5Wcjs = require('./chunk-4UKWTU5W.cjs');require('./chunk-CK4JCQY6.cjs');exports.CrossmintAuthBaseContext = _chunkFJDGBKSKcjs.e; exports.CrossmintAuthBaseProvider = _chunkFJDGBKSKcjs.g; exports.CrossmintContext = _chunkV6H3YTIDcjs.a; exports.CrossmintProvider = _chunkV6H3YTIDcjs.c; exports.CrossmintWalletBaseContext = _chunkFJDGBKSKcjs.b; exports.CrossmintWalletBaseProvider = _chunkFJDGBKSKcjs.c; exports.CrossmintWalletUIBaseProvider = _chunkFJDGBKSKcjs.a; exports.EVMWallet = _chunkPU5EOTE7cjs.a; exports.LoggerContext = _chunkV6H3YTIDcjs.b; exports.SolanaWallet = _chunkPU5EOTE7cjs.b; exports.StellarWallet = _chunkPU5EOTE7cjs.c; exports.createLoggerContext = _chunkQBEM2WHMcjs.a; exports.initReactLogger = _chunk4UKWTU5Wcjs.a; exports.useAuth = _chunkFJDGBKSKcjs.i; exports.useCrossmint = _chunk33LPDFQUcjs.a; exports.useCrossmintAuth = _chunkFJDGBKSKcjs.h; exports.useCrossmintAuthBase = _chunkFJDGBKSKcjs.f; exports.useLogger = _chunkQBEM2WHMcjs.b; exports.useSignerAuth = _chunkJ5H2Z5BKcjs.a; exports.useWallet = _chunkFJDGBKSKcjs.d;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-YSXSE5ZY.cjs');var _chunkBZI46GB2cjs = require('./chunk-BZI46GB2.cjs');var _chunk5PN427A7cjs = require('./chunk-5PN427A7.cjs');var _chunkP3KCES3Scjs = require('./chunk-P3KCES3S.cjs');var _chunk772QWMBBcjs = require('./chunk-772QWMBB.cjs');var _chunkQBEM2WHMcjs = require('./chunk-QBEM2WHM.cjs');var _chunk753F2TL5cjs = require('./chunk-753F2TL5.cjs');var _chunk4UKWTU5Wcjs = require('./chunk-4UKWTU5W.cjs');require('./chunk-CK4JCQY6.cjs');exports.CrossmintAuthBaseContext = _chunk5PN427A7cjs.b; exports.CrossmintAuthBaseProvider = _chunk5PN427A7cjs.d; exports.CrossmintContext = _chunk772QWMBBcjs.a; exports.CrossmintProvider = _chunk772QWMBBcjs.c; exports.CrossmintWalletBaseContext = _chunk5PN427A7cjs.e; exports.CrossmintWalletBaseProvider = _chunk5PN427A7cjs.f; exports.CrossmintWalletUIBaseProvider = _chunk5PN427A7cjs.a; exports.EVMWallet = _chunkBZI46GB2cjs.a; exports.LoggerContext = _chunk772QWMBBcjs.b; exports.SolanaWallet = _chunkBZI46GB2cjs.b; exports.StellarWallet = _chunkBZI46GB2cjs.c; exports.createLoggerContext = _chunkQBEM2WHMcjs.a; exports.initReactLogger = _chunk4UKWTU5Wcjs.a; exports.useCrossmint = _chunkP3KCES3Scjs.a; exports.useCrossmintAuth = _chunk5PN427A7cjs.i; exports.useCrossmintAuthBase = _chunk5PN427A7cjs.c; exports.useLogger = _chunkQBEM2WHMcjs.b; exports.useSignerAuth = _chunk753F2TL5cjs.a; exports.useWallet = _chunk5PN427A7cjs.g; exports.useWalletOtpSigner = _chunk5PN427A7cjs.h;
package/dist/index.d.cts CHANGED
@@ -1,15 +1,16 @@
1
1
  export { useCrossmint } from './hooks/useCrossmint.cjs';
2
2
  export { useWallet } from './hooks/useWallet.cjs';
3
- export { useAuth, useCrossmintAuth } from './hooks/useAuth.cjs';
3
+ export { OtpSignerFunctions, useWalletOtpSigner } from './hooks/useWalletOtpSigner.cjs';
4
+ export { useCrossmintAuth } from './hooks/useAuth.cjs';
4
5
  export { DialogStep, SignerAuthHandlers, SignerAuthState, SignerType, useSignerAuth } from './hooks/useSignerAuth.cjs';
5
- export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, P as PasskeyPromptState, U as UIRenderProps } from './CrossmintWalletBaseProvider-CusZ3teM.cjs';
6
+ export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, P as PasskeyPromptState, U as UIRenderProps } from './CrossmintWalletBaseProvider-CFRV-0N0.cjs';
6
7
  export { CrossmintContext, CrossmintProvider, LoggerContext } from './providers/CrossmintProvider.cjs';
7
8
  export { CrossmintAuthBaseContext, CrossmintAuthBaseProvider, useCrossmintAuthBase } from './providers/CrossmintAuthBaseProvider.cjs';
8
9
  export { createLoggerContext, useLogger } from './providers/LoggerProvider.cjs';
9
10
  export { initReactLogger } from './logger/init.cjs';
10
11
  export { BaseCrossmintWalletProviderProps, CreateOnLogin } from './types/wallet.cjs';
11
12
  export { AuthStatus, CrossmintAuthBaseContextType, CrossmintAuthBaseProviderProps, LoginMethod } from './types/auth.cjs';
12
- export { Balances, Chain, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
13
+ export { Balances, Chain, ClientSideWalletArgsFor, ClientSideWalletCreateArgs, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
13
14
  import 'react';
14
15
  import 'react/jsx-runtime';
15
16
  import '@crossmint/client-sdk-window';
package/dist/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
1
  export { useCrossmint } from './hooks/useCrossmint.js';
2
2
  export { useWallet } from './hooks/useWallet.js';
3
- export { useAuth, useCrossmintAuth } from './hooks/useAuth.js';
3
+ export { OtpSignerFunctions, useWalletOtpSigner } from './hooks/useWalletOtpSigner.js';
4
+ export { useCrossmintAuth } from './hooks/useAuth.js';
4
5
  export { DialogStep, SignerAuthHandlers, SignerAuthState, SignerType, useSignerAuth } from './hooks/useSignerAuth.js';
5
- export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, P as PasskeyPromptState, U as UIRenderProps } from './CrossmintWalletBaseProvider-B_Ad3uZ2.js';
6
+ export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, P as PasskeyPromptState, U as UIRenderProps } from './CrossmintWalletBaseProvider-BC3s1L7V.js';
6
7
  export { CrossmintContext, CrossmintProvider, LoggerContext } from './providers/CrossmintProvider.js';
7
8
  export { CrossmintAuthBaseContext, CrossmintAuthBaseProvider, useCrossmintAuthBase } from './providers/CrossmintAuthBaseProvider.js';
8
9
  export { createLoggerContext, useLogger } from './providers/LoggerProvider.js';
9
10
  export { initReactLogger } from './logger/init.js';
10
11
  export { BaseCrossmintWalletProviderProps, CreateOnLogin } from './types/wallet.js';
11
12
  export { AuthStatus, CrossmintAuthBaseContextType, CrossmintAuthBaseProviderProps, LoginMethod } from './types/auth.js';
12
- export { Balances, Chain, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
13
+ export { Balances, Chain, ClientSideWalletArgsFor, ClientSideWalletCreateArgs, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
13
14
  import 'react';
14
15
  import 'react/jsx-runtime';
15
16
  import '@crossmint/client-sdk-window';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-B35TULQO.js";import{a as l,b as n,c as q}from"./chunk-3UZONNFB.js";import{a as x,b as a,c as b,d as c,e as d,f as g,g as h,h as i,i as j}from"./chunk-SSWKOAEE.js";import{a as t}from"./chunk-ELPIFOQ5.js";import{a as f,b as m,c as p}from"./chunk-GFXPYJ63.js";import{a as r,b as e}from"./chunk-FF2S33DL.js";import{a as k}from"./chunk-LEFZXON3.js";import{a as o}from"./chunk-SUETDQ6M.js";import"./chunk-22GIA4MK.js";export{d as CrossmintAuthBaseContext,h as CrossmintAuthBaseProvider,f as CrossmintContext,p as CrossmintProvider,a as CrossmintWalletBaseContext,b as CrossmintWalletBaseProvider,x as CrossmintWalletUIBaseProvider,l as EVMWallet,m as LoggerContext,n as SolanaWallet,q as StellarWallet,r as createLoggerContext,o as initReactLogger,j as useAuth,t as useCrossmint,i as useCrossmintAuth,g as useCrossmintAuthBase,e as useLogger,k as useSignerAuth,c as useWallet};
1
+ import"./chunk-B35TULQO.js";import{a as l,b as n,c as q}from"./chunk-HMSQ2OMO.js";import{a as x,b as a,c as b,d as c,e as d,f as g,g as h,h as i,i as j}from"./chunk-VVXHOVXA.js";import{a as t}from"./chunk-DY4BVQZD.js";import{a as f,b as m,c as p}from"./chunk-KXK5YLCP.js";import{a as r,b as e}from"./chunk-FF2S33DL.js";import{a as k}from"./chunk-6LPM65VC.js";import{a as o}from"./chunk-SUETDQ6M.js";import"./chunk-22GIA4MK.js";export{a as CrossmintAuthBaseContext,c as CrossmintAuthBaseProvider,f as CrossmintContext,p as CrossmintProvider,d as CrossmintWalletBaseContext,g as CrossmintWalletBaseProvider,x as CrossmintWalletUIBaseProvider,l as EVMWallet,m as LoggerContext,n as SolanaWallet,q as StellarWallet,r as createLoggerContext,o as initReactLogger,t as useCrossmint,j as useCrossmintAuth,b as useCrossmintAuthBase,e as useLogger,k as useSignerAuth,h as useWallet,i as useWalletOtpSigner};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFJDGBKSKcjs = require('../chunk-FJDGBKSK.cjs');require('../chunk-33LPDFQU.cjs');require('../chunk-V6H3YTID.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-J5H2Z5BK.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintAuthBaseContext = _chunkFJDGBKSKcjs.e; exports.CrossmintAuthBaseProvider = _chunkFJDGBKSKcjs.g; exports.useCrossmintAuthBase = _chunkFJDGBKSKcjs.f;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5PN427A7cjs = require('../chunk-5PN427A7.cjs');require('../chunk-P3KCES3S.cjs');require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-753F2TL5.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintAuthBaseContext = _chunk5PN427A7cjs.b; exports.CrossmintAuthBaseProvider = _chunk5PN427A7cjs.d; exports.useCrossmintAuthBase = _chunk5PN427A7cjs.c;
@@ -1 +1 @@
1
- import{e as a,f as b,g as c}from"../chunk-SSWKOAEE.js";import"../chunk-ELPIFOQ5.js";import"../chunk-GFXPYJ63.js";import"../chunk-FF2S33DL.js";import"../chunk-LEFZXON3.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as CrossmintAuthBaseContext,c as CrossmintAuthBaseProvider,b as useCrossmintAuthBase};
1
+ import{b as a,c as b,d as c}from"../chunk-VVXHOVXA.js";import"../chunk-DY4BVQZD.js";import"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import"../chunk-6LPM65VC.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as CrossmintAuthBaseContext,c as CrossmintAuthBaseProvider,b as useCrossmintAuthBase};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkV6H3YTIDcjs = require('../chunk-V6H3YTID.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintContext = _chunkV6H3YTIDcjs.a; exports.CrossmintProvider = _chunkV6H3YTIDcjs.c; exports.LoggerContext = _chunkV6H3YTIDcjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk772QWMBBcjs = require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintContext = _chunk772QWMBBcjs.a; exports.CrossmintProvider = _chunk772QWMBBcjs.c; exports.LoggerContext = _chunk772QWMBBcjs.b;
@@ -2,12 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { LoggerContext as LoggerContext$1 } from './LoggerProvider.cjs';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
- import { Crossmint, CustomAuth, CrossmintConfig } from '@crossmint/common-sdk-base';
5
+ import { Crossmint, CrossmintConfig } from '@crossmint/common-sdk-base';
6
6
 
7
7
  interface CrossmintContext {
8
8
  crossmint: Crossmint;
9
- experimental_setCustomAuth: (customAuthParams?: CustomAuth) => void;
10
- experimental_customAuth?: CustomAuth;
11
9
  setJwt: (jwt: string | undefined) => void;
12
10
  }
13
11
  declare const CrossmintContext: react.Context<CrossmintContext | null>;
@@ -2,12 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { LoggerContext as LoggerContext$1 } from './LoggerProvider.js';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
- import { Crossmint, CustomAuth, CrossmintConfig } from '@crossmint/common-sdk-base';
5
+ import { Crossmint, CrossmintConfig } from '@crossmint/common-sdk-base';
6
6
 
7
7
  interface CrossmintContext {
8
8
  crossmint: Crossmint;
9
- experimental_setCustomAuth: (customAuthParams?: CustomAuth) => void;
10
- experimental_customAuth?: CustomAuth;
11
9
  setJwt: (jwt: string | undefined) => void;
12
10
  }
13
11
  declare const CrossmintContext: react.Context<CrossmintContext | null>;
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-GFXPYJ63.js";import"../chunk-FF2S33DL.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as CrossmintContext,c as CrossmintProvider,b as LoggerContext};
1
+ import{a,b,c}from"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as CrossmintContext,c as CrossmintProvider,b as LoggerContext};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFJDGBKSKcjs = require('../chunk-FJDGBKSK.cjs');require('../chunk-33LPDFQU.cjs');require('../chunk-V6H3YTID.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-J5H2Z5BK.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintWalletBaseContext = _chunkFJDGBKSKcjs.b; exports.CrossmintWalletBaseProvider = _chunkFJDGBKSKcjs.c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5PN427A7cjs = require('../chunk-5PN427A7.cjs');require('../chunk-P3KCES3S.cjs');require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-753F2TL5.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintWalletBaseContext = _chunk5PN427A7cjs.e; exports.CrossmintWalletBaseProvider = _chunk5PN427A7cjs.f;
@@ -5,5 +5,5 @@ import '@crossmint/client-sdk-window';
5
5
  import '@crossmint/client-signers';
6
6
  import '@crossmint/common-sdk-base';
7
7
  import '../types/wallet.cjs';
8
- export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, P as PasskeyPromptState } from '../CrossmintWalletBaseProvider-CusZ3teM.cjs';
8
+ export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, P as PasskeyPromptState } from '../CrossmintWalletBaseProvider-CFRV-0N0.cjs';
9
9
  import '../hooks/useSignerAuth.cjs';
@@ -5,5 +5,5 @@ import '@crossmint/client-sdk-window';
5
5
  import '@crossmint/client-signers';
6
6
  import '@crossmint/common-sdk-base';
7
7
  import '../types/wallet.js';
8
- export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, P as PasskeyPromptState } from '../CrossmintWalletBaseProvider-B_Ad3uZ2.js';
8
+ export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, P as PasskeyPromptState } from '../CrossmintWalletBaseProvider-BC3s1L7V.js';
9
9
  import '../hooks/useSignerAuth.js';
@@ -1 +1 @@
1
- import{b as a,c as b}from"../chunk-SSWKOAEE.js";import"../chunk-ELPIFOQ5.js";import"../chunk-GFXPYJ63.js";import"../chunk-FF2S33DL.js";import"../chunk-LEFZXON3.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as CrossmintWalletBaseContext,b as CrossmintWalletBaseProvider};
1
+ import{e as a,f as b}from"../chunk-VVXHOVXA.js";import"../chunk-DY4BVQZD.js";import"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import"../chunk-6LPM65VC.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as CrossmintWalletBaseContext,b as CrossmintWalletBaseProvider};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFJDGBKSKcjs = require('../chunk-FJDGBKSK.cjs');require('../chunk-33LPDFQU.cjs');require('../chunk-V6H3YTID.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-J5H2Z5BK.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintWalletUIBaseProvider = _chunkFJDGBKSKcjs.a;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5PN427A7cjs = require('../chunk-5PN427A7.cjs');require('../chunk-P3KCES3S.cjs');require('../chunk-772QWMBB.cjs');require('../chunk-QBEM2WHM.cjs');require('../chunk-753F2TL5.cjs');require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintWalletUIBaseProvider = _chunk5PN427A7cjs.a;
@@ -2,7 +2,7 @@ import 'react/jsx-runtime';
2
2
  import 'react';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import '../hooks/useSignerAuth.cjs';
5
- export { d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, U as UIRenderProps } from '../CrossmintWalletBaseProvider-CusZ3teM.cjs';
5
+ export { d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, U as UIRenderProps } from '../CrossmintWalletBaseProvider-CFRV-0N0.cjs';
6
6
  import '@crossmint/wallets-sdk';
7
7
  import '@crossmint/client-sdk-window';
8
8
  import '@crossmint/client-signers';
@@ -2,7 +2,7 @@ import 'react/jsx-runtime';
2
2
  import 'react';
3
3
  import '@crossmint/common-sdk-base';
4
4
  import '../hooks/useSignerAuth.js';
5
- export { d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, U as UIRenderProps } from '../CrossmintWalletBaseProvider-B_Ad3uZ2.js';
5
+ export { d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, U as UIRenderProps } from '../CrossmintWalletBaseProvider-BC3s1L7V.js';
6
6
  import '@crossmint/wallets-sdk';
7
7
  import '@crossmint/client-sdk-window';
8
8
  import '@crossmint/client-signers';
@@ -1 +1 @@
1
- import{a}from"../chunk-SSWKOAEE.js";import"../chunk-ELPIFOQ5.js";import"../chunk-GFXPYJ63.js";import"../chunk-FF2S33DL.js";import"../chunk-LEFZXON3.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as CrossmintWalletUIBaseProvider};
1
+ import{a}from"../chunk-VVXHOVXA.js";import"../chunk-DY4BVQZD.js";import"../chunk-KXK5YLCP.js";import"../chunk-FF2S33DL.js";import"../chunk-6LPM65VC.js";import"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{a as CrossmintWalletUIBaseProvider};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkFJDGBKSKcjs = require('../chunk-FJDGBKSK.cjs');require('../chunk-33LPDFQU.cjs');var _chunkV6H3YTIDcjs = require('../chunk-V6H3YTID.cjs');var _chunkQBEM2WHMcjs = require('../chunk-QBEM2WHM.cjs');require('../chunk-J5H2Z5BK.cjs');var _chunk4UKWTU5Wcjs = require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintAuthBaseContext = _chunkFJDGBKSKcjs.e; exports.CrossmintAuthBaseProvider = _chunkFJDGBKSKcjs.g; exports.CrossmintContext = _chunkV6H3YTIDcjs.a; exports.CrossmintProvider = _chunkV6H3YTIDcjs.c; exports.CrossmintWalletBaseContext = _chunkFJDGBKSKcjs.b; exports.CrossmintWalletBaseProvider = _chunkFJDGBKSKcjs.c; exports.CrossmintWalletUIBaseProvider = _chunkFJDGBKSKcjs.a; exports.LoggerContext = _chunkV6H3YTIDcjs.b; exports.createLoggerContext = _chunkQBEM2WHMcjs.a; exports.initReactLogger = _chunk4UKWTU5Wcjs.a; exports.useCrossmintAuthBase = _chunkFJDGBKSKcjs.f; exports.useLogger = _chunkQBEM2WHMcjs.b;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk5PN427A7cjs = require('../chunk-5PN427A7.cjs');require('../chunk-P3KCES3S.cjs');var _chunk772QWMBBcjs = require('../chunk-772QWMBB.cjs');var _chunkQBEM2WHMcjs = require('../chunk-QBEM2WHM.cjs');require('../chunk-753F2TL5.cjs');var _chunk4UKWTU5Wcjs = require('../chunk-4UKWTU5W.cjs');require('../chunk-CK4JCQY6.cjs');exports.CrossmintAuthBaseContext = _chunk5PN427A7cjs.b; exports.CrossmintAuthBaseProvider = _chunk5PN427A7cjs.d; exports.CrossmintContext = _chunk772QWMBBcjs.a; exports.CrossmintProvider = _chunk772QWMBBcjs.c; exports.CrossmintWalletBaseContext = _chunk5PN427A7cjs.e; exports.CrossmintWalletBaseProvider = _chunk5PN427A7cjs.f; exports.CrossmintWalletUIBaseProvider = _chunk5PN427A7cjs.a; exports.LoggerContext = _chunk772QWMBBcjs.b; exports.createLoggerContext = _chunkQBEM2WHMcjs.a; exports.initReactLogger = _chunk4UKWTU5Wcjs.a; exports.useCrossmintAuthBase = _chunk5PN427A7cjs.c; exports.useLogger = _chunkQBEM2WHMcjs.b;
@@ -1,4 +1,4 @@
1
- export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, P as PasskeyPromptState, U as UIRenderProps } from '../CrossmintWalletBaseProvider-CusZ3teM.cjs';
1
+ export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, P as PasskeyPromptState, U as UIRenderProps } from '../CrossmintWalletBaseProvider-CFRV-0N0.cjs';
2
2
  export { CrossmintContext, CrossmintProvider, LoggerContext } from './CrossmintProvider.cjs';
3
3
  export { CrossmintAuthBaseContext, CrossmintAuthBaseProvider, useCrossmintAuthBase } from './CrossmintAuthBaseProvider.cjs';
4
4
  export { createLoggerContext, useLogger } from './LoggerProvider.cjs';
@@ -1,4 +1,4 @@
1
- export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, P as PasskeyPromptState, U as UIRenderProps } from '../CrossmintWalletBaseProvider-B_Ad3uZ2.js';
1
+ export { C as CrossmintWalletBaseContext, b as CrossmintWalletBaseProvider, a as CrossmintWalletBaseProviderProps, d as CrossmintWalletUIBaseProvider, c as CrossmintWalletUIBaseProviderProps, P as PasskeyPromptState, U as UIRenderProps } from '../CrossmintWalletBaseProvider-BC3s1L7V.js';
2
2
  export { CrossmintContext, CrossmintProvider, LoggerContext } from './CrossmintProvider.js';
3
3
  export { CrossmintAuthBaseContext, CrossmintAuthBaseProvider, useCrossmintAuthBase } from './CrossmintAuthBaseProvider.js';
4
4
  export { createLoggerContext, useLogger } from './LoggerProvider.js';
@@ -1 +1 @@
1
- import{a as g,b as h,c as i,e as j,f as k,g as l}from"../chunk-SSWKOAEE.js";import"../chunk-ELPIFOQ5.js";import{a as d,b as e,c as f}from"../chunk-GFXPYJ63.js";import{a as b,b as c}from"../chunk-FF2S33DL.js";import"../chunk-LEFZXON3.js";import{a}from"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{j as CrossmintAuthBaseContext,l as CrossmintAuthBaseProvider,d as CrossmintContext,f as CrossmintProvider,h as CrossmintWalletBaseContext,i as CrossmintWalletBaseProvider,g as CrossmintWalletUIBaseProvider,e as LoggerContext,b as createLoggerContext,a as initReactLogger,k as useCrossmintAuthBase,c as useLogger};
1
+ import{a as g,b as h,c as i,d as j,e as k,f as l}from"../chunk-VVXHOVXA.js";import"../chunk-DY4BVQZD.js";import{a as d,b as e,c as f}from"../chunk-KXK5YLCP.js";import{a as b,b as c}from"../chunk-FF2S33DL.js";import"../chunk-6LPM65VC.js";import{a}from"../chunk-SUETDQ6M.js";import"../chunk-22GIA4MK.js";export{h as CrossmintAuthBaseContext,j as CrossmintAuthBaseProvider,d as CrossmintContext,f as CrossmintProvider,k as CrossmintWalletBaseContext,l as CrossmintWalletBaseProvider,g as CrossmintWalletUIBaseProvider,e as LoggerContext,b as createLoggerContext,a as initReactLogger,i as useCrossmintAuthBase,c as useLogger};
@@ -3,10 +3,7 @@ import { StorageProvider } from '@crossmint/client-sdk-auth';
3
3
  import { SDKExternalUser } from '@crossmint/common-sdk-auth';
4
4
 
5
5
  type AuthStatus = "logged-in" | "logged-out" | "in-progress" | "initializing";
6
- /**
7
- * "farcaster" is deprecated and will be removed in a future release.
8
- */
9
- type LoginMethod = "email" | "google" | "farcaster" | "twitter" | "web3" | "web3:evm-only" | "web3:solana-only";
6
+ type LoginMethod = "email" | "google" | "twitter";
10
7
  type CrossmintAuthBaseContextType = {
11
8
  /** Trigger the login flow. Optionally pass a default email. */
12
9
  login: (defaultEmail?: string | MouseEvent) => void;
@@ -24,8 +21,6 @@ type CrossmintAuthBaseContextType = {
24
21
  getUser: () => void;
25
22
  /** The underlying Crossmint auth client instance. */
26
23
  crossmintAuth?: any;
27
- /** External wallet signer for connecting third-party wallets to Crossmint auth. */
28
- experimental_externalWalletSigner?: any;
29
24
  };
30
25
  type CrossmintAuthBaseProviderProps = {
31
26
  children: ReactNode;
@@ -3,10 +3,7 @@ import { StorageProvider } from '@crossmint/client-sdk-auth';
3
3
  import { SDKExternalUser } from '@crossmint/common-sdk-auth';
4
4
 
5
5
  type AuthStatus = "logged-in" | "logged-out" | "in-progress" | "initializing";
6
- /**
7
- * "farcaster" is deprecated and will be removed in a future release.
8
- */
9
- type LoginMethod = "email" | "google" | "farcaster" | "twitter" | "web3" | "web3:evm-only" | "web3:solana-only";
6
+ type LoginMethod = "email" | "google" | "twitter";
10
7
  type CrossmintAuthBaseContextType = {
11
8
  /** Trigger the login flow. Optionally pass a default email. */
12
9
  login: (defaultEmail?: string | MouseEvent) => void;
@@ -24,8 +21,6 @@ type CrossmintAuthBaseContextType = {
24
21
  getUser: () => void;
25
22
  /** The underlying Crossmint auth client instance. */
26
23
  crossmintAuth?: any;
27
- /** External wallet signer for connecting third-party wallets to Crossmint auth. */
28
- experimental_externalWalletSigner?: any;
29
24
  };
30
25
  type CrossmintAuthBaseProviderProps = {
31
26
  children: ReactNode;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-YSXSE5ZY.cjs');var _chunkPU5EOTE7cjs = require('../chunk-PU5EOTE7.cjs');require('../chunk-CK4JCQY6.cjs');exports.EVMWallet = _chunkPU5EOTE7cjs.a; exports.SolanaWallet = _chunkPU5EOTE7cjs.b; exports.StellarWallet = _chunkPU5EOTE7cjs.c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-YSXSE5ZY.cjs');var _chunkBZI46GB2cjs = require('../chunk-BZI46GB2.cjs');require('../chunk-CK4JCQY6.cjs');exports.EVMWallet = _chunkBZI46GB2cjs.a; exports.SolanaWallet = _chunkBZI46GB2cjs.b; exports.StellarWallet = _chunkBZI46GB2cjs.c;
@@ -1,6 +1,6 @@
1
1
  export { BaseCrossmintWalletProviderProps, CreateOnLogin } from './wallet.cjs';
2
2
  export { AuthStatus, CrossmintAuthBaseContextType, CrossmintAuthBaseProviderProps, LoginMethod } from './auth.cjs';
3
- export { Balances, Chain, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
3
+ export { Balances, Chain, ClientSideWalletArgsFor, ClientSideWalletCreateArgs, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
4
4
  import '@crossmint/common-sdk-base';
5
5
  import 'react';
6
6
  import '@crossmint/client-sdk-auth';
@@ -1,6 +1,6 @@
1
1
  export { BaseCrossmintWalletProviderProps, CreateOnLogin } from './wallet.js';
2
2
  export { AuthStatus, CrossmintAuthBaseContextType, CrossmintAuthBaseProviderProps, LoginMethod } from './auth.js';
3
- export { Balances, Chain, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
3
+ export { Balances, Chain, ClientSideWalletArgsFor, ClientSideWalletCreateArgs, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
4
4
  import '@crossmint/common-sdk-base';
5
5
  import 'react';
6
6
  import '@crossmint/client-sdk-auth';
@@ -1 +1 @@
1
- import"../chunk-B35TULQO.js";import{a,b,c}from"../chunk-3UZONNFB.js";import"../chunk-22GIA4MK.js";export{a as EVMWallet,b as SolanaWallet,c as StellarWallet};
1
+ import"../chunk-B35TULQO.js";import{a,b,c}from"../chunk-HMSQ2OMO.js";import"../chunk-22GIA4MK.js";export{a as EVMWallet,b as SolanaWallet,c as StellarWallet};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkPU5EOTE7cjs = require('../chunk-PU5EOTE7.cjs');require('../chunk-CK4JCQY6.cjs');exports.EVMWallet = _chunkPU5EOTE7cjs.a; exports.SolanaWallet = _chunkPU5EOTE7cjs.b; exports.StellarWallet = _chunkPU5EOTE7cjs.c;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBZI46GB2cjs = require('../chunk-BZI46GB2.cjs');require('../chunk-CK4JCQY6.cjs');exports.EVMWallet = _chunkBZI46GB2cjs.a; exports.SolanaWallet = _chunkBZI46GB2cjs.b; exports.StellarWallet = _chunkBZI46GB2cjs.c;
@@ -1,48 +1,9 @@
1
1
  import { UIConfig } from '@crossmint/common-sdk-base';
2
- import { SolanaChain, SignerConfigForChain, WalletPlugin, DelegatedSigner, EVMChain, StellarChain } from '@crossmint/wallets-sdk';
3
- export { Balances, Chain, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
2
+ import { ClientSideWalletCreateArgs, SolanaChain, EVMChain, StellarChain } from '@crossmint/wallets-sdk';
3
+ export { Balances, Chain, ClientSideWalletArgsFor, ClientSideWalletCreateArgs, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
4
4
 
5
5
  /** Configuration for automatic wallet creation on user login. */
6
- type CreateOnLogin = {
7
- /** The blockchain to create the wallet on (e.g. "base-sepolia"). */
8
- chain: SolanaChain;
9
- /** The signer configuration (e.g. `{ type: "email" }`). */
10
- signer: SignerConfigForChain<SolanaChain>;
11
- /** Optional owner identifier. */
12
- owner?: string;
13
- /** Optional array of wallet plugins. */
14
- plugins?: WalletPlugin<SolanaChain>[];
15
- /** Optional array of delegated signers. */
16
- delegatedSigners?: Array<DelegatedSigner>;
17
- /** Optional wallet alias. */
18
- alias?: string;
19
- } | {
20
- /** The blockchain to create the wallet on (e.g. "base-sepolia"). */
21
- chain: EVMChain;
22
- /** The signer configuration (e.g. `{ type: "email" }`). */
23
- signer: SignerConfigForChain<EVMChain>;
24
- /** Optional owner identifier. */
25
- owner?: string;
26
- /** Optional array of wallet plugins. */
27
- plugins?: WalletPlugin<EVMChain>[];
28
- /** Optional array of delegated signers. */
29
- delegatedSigners?: Array<DelegatedSigner>;
30
- /** Optional wallet alias. */
31
- alias?: string;
32
- } | {
33
- /** The blockchain to create the wallet on (e.g. "base-sepolia"). */
34
- chain: StellarChain;
35
- /** The signer configuration (e.g. `{ type: "email" }`). */
36
- signer: SignerConfigForChain<StellarChain>;
37
- /** Optional owner identifier. */
38
- owner?: string;
39
- /** Optional array of wallet plugins. */
40
- plugins?: WalletPlugin<StellarChain>[];
41
- /** Optional array of delegated signers. */
42
- delegatedSigners?: Array<DelegatedSigner>;
43
- /** Optional wallet alias. */
44
- alias?: string;
45
- };
6
+ type CreateOnLogin = ClientSideWalletCreateArgs<SolanaChain> | ClientSideWalletCreateArgs<EVMChain> | ClientSideWalletCreateArgs<StellarChain>;
46
7
  type BaseCrossmintWalletProviderProps = {
47
8
  /** Configuration for automatic wallet creation on login. */
48
9
  createOnLogin?: CreateOnLogin;
@@ -1,48 +1,9 @@
1
1
  import { UIConfig } from '@crossmint/common-sdk-base';
2
- import { SolanaChain, SignerConfigForChain, WalletPlugin, DelegatedSigner, EVMChain, StellarChain } from '@crossmint/wallets-sdk';
3
- export { Balances, Chain, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
2
+ import { ClientSideWalletCreateArgs, SolanaChain, EVMChain, StellarChain } from '@crossmint/wallets-sdk';
3
+ export { Balances, Chain, ClientSideWalletArgsFor, ClientSideWalletCreateArgs, DelegatedSigner, EVMWallet, EvmExternalWalletSignerConfig, SolanaExternalWalletSignerConfig, SolanaWallet, StellarWallet, Wallet, WalletPlugin } from '@crossmint/wallets-sdk';
4
4
 
5
5
  /** Configuration for automatic wallet creation on user login. */
6
- type CreateOnLogin = {
7
- /** The blockchain to create the wallet on (e.g. "base-sepolia"). */
8
- chain: SolanaChain;
9
- /** The signer configuration (e.g. `{ type: "email" }`). */
10
- signer: SignerConfigForChain<SolanaChain>;
11
- /** Optional owner identifier. */
12
- owner?: string;
13
- /** Optional array of wallet plugins. */
14
- plugins?: WalletPlugin<SolanaChain>[];
15
- /** Optional array of delegated signers. */
16
- delegatedSigners?: Array<DelegatedSigner>;
17
- /** Optional wallet alias. */
18
- alias?: string;
19
- } | {
20
- /** The blockchain to create the wallet on (e.g. "base-sepolia"). */
21
- chain: EVMChain;
22
- /** The signer configuration (e.g. `{ type: "email" }`). */
23
- signer: SignerConfigForChain<EVMChain>;
24
- /** Optional owner identifier. */
25
- owner?: string;
26
- /** Optional array of wallet plugins. */
27
- plugins?: WalletPlugin<EVMChain>[];
28
- /** Optional array of delegated signers. */
29
- delegatedSigners?: Array<DelegatedSigner>;
30
- /** Optional wallet alias. */
31
- alias?: string;
32
- } | {
33
- /** The blockchain to create the wallet on (e.g. "base-sepolia"). */
34
- chain: StellarChain;
35
- /** The signer configuration (e.g. `{ type: "email" }`). */
36
- signer: SignerConfigForChain<StellarChain>;
37
- /** Optional owner identifier. */
38
- owner?: string;
39
- /** Optional array of wallet plugins. */
40
- plugins?: WalletPlugin<StellarChain>[];
41
- /** Optional array of delegated signers. */
42
- delegatedSigners?: Array<DelegatedSigner>;
43
- /** Optional wallet alias. */
44
- alias?: string;
45
- };
6
+ type CreateOnLogin = ClientSideWalletCreateArgs<SolanaChain> | ClientSideWalletCreateArgs<EVMChain> | ClientSideWalletCreateArgs<StellarChain>;
46
7
  type BaseCrossmintWalletProviderProps = {
47
8
  /** Configuration for automatic wallet creation on login. */
48
9
  createOnLogin?: CreateOnLogin;
@@ -1 +1 @@
1
- import{a,b,c}from"../chunk-3UZONNFB.js";import"../chunk-22GIA4MK.js";export{a as EVMWallet,b as SolanaWallet,c as StellarWallet};
1
+ import{a,b,c}from"../chunk-HMSQ2OMO.js";import"../chunk-22GIA4MK.js";export{a as EVMWallet,b as SolanaWallet,c as StellarWallet};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/client-sdk-react-base",
3
- "version": "1.0.7",
3
+ "version": "2.0.0-beta.2",
4
4
  "repository": "https://github.com/Crossmint/crossmint-sdk",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Paella Labs Inc",
@@ -20,13 +20,13 @@
20
20
  "dependencies": {
21
21
  "lodash.isequal": "4.5.0",
22
22
  "lodash.clonedeep": "4.5.0",
23
- "@crossmint/common-sdk-auth": "1.0.73",
24
- "@crossmint/common-sdk-base": "0.9.20",
25
- "@crossmint/client-sdk-auth": "1.2.51",
26
- "@crossmint/client-sdk-base": "2.1.0",
23
+ "@crossmint/common-sdk-auth": "1.1.0-beta.0",
24
+ "@crossmint/client-sdk-auth": "1.3.0-beta.0",
25
+ "@crossmint/common-sdk-base": "0.10.0-beta.0",
26
+ "@crossmint/client-sdk-base": "2.0.3-beta.0",
27
27
  "@crossmint/client-sdk-window": "1.0.9",
28
28
  "@crossmint/client-signers": "0.1.2",
29
- "@crossmint/wallets-sdk": "0.21.0"
29
+ "@crossmint/wallets-sdk": "1.0.0-beta.2"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/react": "19.1.10",
@@ -1 +0,0 @@
1
- import{EVMWallet as r,SolanaWallet as t,StellarWallet as g}from"@crossmint/wallets-sdk";export{r as a,t as b,g as c};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunk33LPDFQUcjs = require('./chunk-33LPDFQU.cjs');var _chunkV6H3YTIDcjs = require('./chunk-V6H3YTID.cjs');var _chunkQBEM2WHMcjs = require('./chunk-QBEM2WHM.cjs');var _chunkJ5H2Z5BKcjs = require('./chunk-J5H2Z5BK.cjs');var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var _react = require('react');var _walletssdk = require('@crossmint/wallets-sdk');var _clientsdkauth = require('@crossmint/client-sdk-auth');var _commonsdkauth = require('@crossmint/common-sdk-auth');var _jsxruntime = require('react/jsx-runtime');var O=_react.createContext.call(void 0, {crossmintAuth:void 0,logout:()=>_chunkCK4JCQY6cjs.c.call(void 0, void 0,null,function*(){}),status:"initializing",getUser:()=>{},login:()=>{}});function ve(){let s=_react.useContext.call(void 0, O);if(s==null)throw new Error("useCrossmintAuthBase must be used within CrossmintAuthBaseProvider");return s}function xe({children:s,onLoginSuccess:n,refreshRoute:p,logoutRoute:u,storageProvider:a}){let{crossmint:o}=_chunk33LPDFQUcjs.a.call(void 0, "CrossmintAuthBaseProvider must be used within CrossmintProvider"),[m,i]=_react.useState.call(void 0, void 0),[r,c]=_react.useState.call(void 0, void 0),[x,t]=_react.useState.call(void 0, !1),f=_react.useRef.call(void 0, null);_react.useEffect.call(void 0, ()=>{if(!f.current)try{f.current=_clientsdkauth.CrossmintAuth.from(o,{callbacks:{onLogout:()=>{i(void 0),c(void 0)},onTokenRefresh:d=>{i(d.user),c(d.jwt)}},refreshRoute:p,logoutRoute:u,storageProvider:a})}catch(d){console.error("Failed to initialize CrossmintAuth:",d)}},[o,p,u,a]);let l=f.current,C=_react.useCallback.call(void 0, ()=>{n==null||n()},[n]);_react.useEffect.call(void 0, ()=>{var d;if(r==null)if(a)(d=a.get)==null||d.call(a,_commonsdkauth.SESSION_PREFIX).then(P=>{P!=null&&c(P)}).finally(()=>{t(!0)});else{try{let P=_clientsdkauth.getCookie.call(void 0, _commonsdkauth.SESSION_PREFIX);c(P)}catch(P){console.error("Failed to get cookie:",P)}t(!0)}else t(!0)},[r,a]),_react.useEffect.call(void 0, ()=>{r!=null&&C()},[r,C]);let y=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){return i(void 0),c(void 0),yield l==null?void 0:l.logout()}),[l]),T=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){if(r==null){console.log("User not logged in");return}let d=yield l==null?void 0:l.getUser();return i(d),d}),[r,l]),R=_react.useCallback.call(void 0, ()=>x?r!=null?"logged-in":"logged-out":"initializing",[r,x]),E=_react.useMemo.call(void 0, ()=>({crossmintAuth:l,logout:y,jwt:r,user:m,status:R(),getUser:T,login:()=>{}}),[l,y,r,m,x,T,R]);return _jsxruntime.jsx.call(void 0, O.Provider,{value:E,children:s})}function we(){let s=_react.useContext.call(void 0, O);if(s==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return s}var _e=we;var _lodashclonedeep = require('lodash.clonedeep'); var _lodashclonedeep2 = _interopRequireDefault(_lodashclonedeep);var X=_react.createContext.call(void 0, {wallet:void 0,status:"not-loaded",getOrCreateWallet:()=>Promise.resolve(void 0),onAuthRequired:void 0,clientTEEConnection:void 0,emailSignerState:{needsAuth:!1,sendEmailWithOtp:null,verifyOtp:null,reject:null}});function gt({children:s,createOnLogin:n,callbacks:p,clientTEEConnection:u,initializeWebView:a,appearance:o,headlessSigningFlow:m,showPasskeyHelpers:i,renderUI:r}){let c=_chunkQBEM2WHMcjs.b.call(void 0, _chunkV6H3YTIDcjs.b),{crossmint:x,experimental_customAuth:t}=_chunk33LPDFQUcjs.a.call(void 0, "CrossmintWalletBaseProvider must be used within CrossmintProvider"),[f,l]=_react.useState.call(void 0, void 0),[C,y]=_react.useState.call(void 0, "not-loaded"),[T,R]=_react.useState.call(void 0, {open:!1}),E=_chunkJ5H2Z5BKcjs.a.call(void 0, f==null?void 0:f.signer),{onAuthRequired:d}=E,[P,me]=_react.useState.call(void 0, {needsAuth:!1,sendEmailWithOtp:null,verifyOtp:null,reject:null}),q=_react.useCallback.call(void 0, h=>()=>new Promise(e=>{if(!i){e();return}R({type:h,open:!0,primaryActionOnClick:()=>{R({open:!1}),e()},secondaryActionOnClick:()=>{R({open:!1}),e()}})}),[i]),g=_react.useMemo.call(void 0, ()=>{let h=p==null?void 0:p.onWalletCreationStart,e=p==null?void 0:p.onTransactionStart;return(n==null?void 0:n.signer.type)==="passkey"&&i&&(h=q("create-wallet"),e=q("transaction")),{onWalletCreationStart:h,onTransactionStart:e}},[p,n==null?void 0:n.signer.type,i,q]),w=_react.useCallback.call(void 0, (h,e,B,A)=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){if(me({needsAuth:h,sendEmailWithOtp:e,verifyOtp:B,reject:A}),d)return yield d(h,e,B,A)}),[d]),b=_react.useCallback.call(void 0, h=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){var B,A,G,Q,Y,Z,$,_,L,ee,te,ne;let e=_lodashclonedeep2.default.call(void 0, h);if(!((t==null?void 0:t.jwt)==null||C==="in-progress")){if(f!=null)return f;try{y("in-progress");let j=_walletssdk.CrossmintWallets.from(x),F=(A=(B=e.options)==null?void 0:B.experimental_callbacks)==null?void 0:A.onWalletCreationStart,D=(Q=(G=e.options)==null?void 0:G.experimental_callbacks)==null?void 0:Q.onTransactionStart;if(((Y=e==null?void 0:e.signer)==null?void 0:Y.type)==="email"){let S=(Z=e.signer.email)!=null?Z:t==null?void 0:t.email,N=($=e.signer.onAuthRequired)!=null?$:w;if(S==null)throw new Error("Email not found in experimental_customAuth or signer. Please set email in experimental_customAuth or signer.");e.signer=_chunkCK4JCQY6cjs.b.call(void 0, _chunkCK4JCQY6cjs.a.call(void 0, {},e.signer),{email:S,onAuthRequired:N})}if(((_=e==null?void 0:e.signer)==null?void 0:_.type)==="phone"){let S=(L=e.signer.phone)!=null?L:t==null?void 0:t.phone,N=(ee=e.signer.onAuthRequired)!=null?ee:w;if(S==null)throw new Error("Phone not found in signer. Please set phone in signer.");e.signer=_chunkCK4JCQY6cjs.b.call(void 0, _chunkCK4JCQY6cjs.a.call(void 0, {},e.signer),{phone:S,onAuthRequired:N})}if(((te=e==null?void 0:e.signer)==null?void 0:te.type)==="external-wallet"){let S=((ne=e.signer)==null?void 0:ne.address)!=null?e.signer:t.externalWalletSigner;if(S==null)throw new Error("External wallet config not found in experimental_customAuth or signer. Please set it in experimental_customAuth or signer.");e.signer=S}(e.signer.type==="email"||e.signer.type==="phone")&&(yield a==null?void 0:a());let oe=yield j.getOrCreateWallet({chain:e.chain,signer:e.signer,owner:e.owner,plugins:e.plugins,delegatedSigners:e.delegatedSigners,alias:e.alias,options:{clientTEEConnection:u==null?void 0:u(),experimental_callbacks:{onWalletCreationStart:F!=null?F:g==null?void 0:g.onWalletCreationStart,onTransactionStart:D!=null?D:g==null?void 0:g.onTransactionStart}}});return l(oe),y("loaded"),oe}catch(j){console.error("Failed to create wallet:",j),l(void 0),y("error");return}}}),[x,t,w,C,f,g==null?void 0:g.onWalletCreationStart,g==null?void 0:g.onTransactionStart,u,a]);_react.useEffect.call(void 0, ()=>{if(n!=null){if(n.signer.type==="email"&&(t==null?void 0:t.email)==null||n.signer.type==="external-wallet"&&(t==null?void 0:t.externalWalletSigner)==null&&n.signer.address==null)return;b(n)}},[n,b,t==null?void 0:t.email,t==null?void 0:t.externalWalletSigner]),_react.useEffect.call(void 0, ()=>{(t==null?void 0:t.jwt)==null&&C!=="not-loaded"&&(y("not-loaded"),l(void 0))},[t==null?void 0:t.jwt,C]);let fe=_react.useMemo.call(void 0, ()=>({wallet:f,status:C,getOrCreateWallet:b,onAuthRequired:w,clientTEEConnection:u,emailSignerState:P}),[b,f,C,w,u,P]),ge=o!=null||m!=null||i!=null||r!=null;return _jsxruntime.jsx.call(void 0, X.Provider,{value:fe,children:ge?_jsxruntime.jsx.call(void 0, pe,{appearance:o,headlessSigningFlow:m,renderUI:r,passkeyPromptState:T,signerAuth:E,children:s}):s})}function ue(){let s=_react.useContext.call(void 0, X);if(!s)throw new Error("useWallet must be used within CrossmintWalletProvider");return s}function pe({children:s,appearance:n,headlessSigningFlow:p,renderUI:u,passkeyPromptState:a,signerAuth:o}){let{wallet:m}=ue(),i=m==null?void 0:m.signer.type,r=m==null?void 0:m.signer.locator().split(":")[1],c={emailSignerProps:{email:i==="email"?r:void 0,open:o.emailSignerDialogOpen&&i==="email"&&r!=null,setOpen:o.setEmailSignerDialogOpen,step:o.emailSignerDialogStep,onSubmitOTP:o.emailsigners_handleOTPSubmit,onResendOTPCode:o.emailsigners_handleResendOTP,onSubmitEmail:o.emailsigners_handleSendEmailOTP,rejectRef:o.rejectRef,appearance:n},phoneSignerProps:{phone:i==="phone"?r:void 0,open:o.phoneSignerDialogOpen&&i==="phone"&&r!=null,setOpen:o.setPhoneSignerDialogOpen,step:o.phoneSignerDialogStep,onSubmitOTP:o.phonesigners_handleOTPSubmit,onResendOTPCode:o.phonesigners_handleResendOTP,onSubmitPhone:o.phonesigners_handleSendPhoneOTP,rejectRef:o.rejectRef,appearance:n},passkeyPromptProps:{state:a,appearance:n}};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[s,!p&&u!=null&&u(c)]})}exports.a = pe; exports.b = X; exports.c = gt; exports.d = ue; exports.e = O; exports.f = ve; exports.g = xe; exports.h = we; exports.i = _e;
@@ -1 +0,0 @@
1
- import{a as d}from"./chunk-FF2S33DL.js";import{a as m}from"./chunk-SUETDQ6M.js";import{createContext as j,useCallback as p,useMemo as a,useRef as y,useState as E}from"react";import{createCrossmint as b}from"@crossmint/common-sdk-base";import A from"lodash.isequal";var o={name:"@crossmint/client-sdk-react-base",version:"1.0.7",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","test:vitest":"vitest run"},dependencies:{"@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/wallets-sdk":"workspace:*","lodash.isequal":"4.5.0","lodash.clonedeep":"4.5.0"},devDependencies:{"@types/react":"19.1.10","@types/lodash.isequal":"4.5.6","@types/lodash.clonedeep":"4.5.6"},peerDependencies:{react:">=17.0.2"}};import{jsx as C}from"react/jsx-runtime";var N=j(null),L=d();function T({children:x,apiKey:s,appId:f,extensionId:w,overrideBaseUrl:h}){let v=a(()=>m(s,o.name,o.version),[s]),[k,c]=E(0),t=y(null);t.current==null&&(t.current=new Proxy(b({apiKey:s,overrideBaseUrl:h,appId:f,extensionId:w}),{set(e,r,n){return r==="jwt"&&e.jwt!==n&&c(i=>i+1),r==="experimental_customAuth"&&e.experimental_customAuth!==n&&c(i=>i+1),Reflect.set(e,r,n)}}));let l=p(e=>{if(t.current==null)throw new Error("CrossmintProvider is not initialized");e!==t.current.jwt&&(t.current.jwt=e,t.current.experimental_customAuth==null?t.current.experimental_customAuth={jwt:e}:t.current.experimental_customAuth.jwt=e)},[]),u=p(e=>{if(t.current==null)throw new Error("CrossmintProvider is not initialized");t.current.jwt!=(e==null?void 0:e.jwt)&&(t.current.jwt=e==null?void 0:e.jwt),A(e,t.current.experimental_customAuth)||(t.current.experimental_customAuth=e)},[]),g=a(()=>{if(!t.current)throw new Error("CrossmintProvider is not initialized");return{get crossmint(){return t.current},experimental_setCustomAuth:u,experimental_customAuth:t.current.experimental_customAuth,setJwt:l}},[u,l,k]);return C(L.Provider,{value:v,children:C(N.Provider,{value:g,children:x})})}export{N as a,L as b,T as c};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCK4JCQY6cjs = require('./chunk-CK4JCQY6.cjs');var _react = require('react');var a=s=>()=>{throw new Error(`${s} is not available. Make sure you're using an email or phone signer wallet.`)};function q(s){let[y,c]=_react.useState.call(void 0, !1),[b,g]=_react.useState.call(void 0, "initial"),[T,h]=_react.useState.call(void 0, !1),[R,P]=_react.useState.call(void 0, "initial"),m=_react.useRef.call(void 0, s);m.current=s;let l=_react.useRef.call(void 0, a("sendEmailWithOtp")),u=_react.useRef.call(void 0, a("verifyOtp")),p=_react.useRef.call(void 0, a("sendPhoneWithOtp")),S=_react.useRef.call(void 0, a("verifyPhoneOtp")),r=_react.useRef.call(void 0, a("reject")),D=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield l.current(),g("otp")}catch(e){console.error("Failed to send email OTP",e),r.current(new Error("Failed to send email OTP"))}}),[]),E=_react.useCallback.call(void 0, e=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield u.current(e),c(!1),g("initial")}catch(n){console.error("Failed to verify OTP",n),r.current(new Error("Failed to verify OTP"))}}),[]),w=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield l.current()}catch(e){console.error("Failed to resend email OTP",e),r.current(new Error("Failed to resend email OTP"))}}),[]),F=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield p.current(),P("otp")}catch(e){console.error("Failed to send phone OTP",e),r.current(new Error("Failed to send phone OTP"))}}),[]),_=_react.useCallback.call(void 0, e=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield S.current(e),h(!1),P("initial")}catch(n){console.error("Failed to verify phone OTP",n),r.current(new Error("Failed to verify phone OTP"))}}),[]),j=_react.useCallback.call(void 0, ()=>_chunkCK4JCQY6cjs.c.call(void 0, this,null,function*(){try{yield p.current()}catch(e){console.error("Failed to resend phone OTP",e),r.current(new Error("Failed to resend phone OTP"))}}),[]),A=_react.useCallback.call(void 0, (e,n,O,M)=>{var v,f;let W=(v=m.current)==null?void 0:v.locator().split(":")[1];return((f=m.current)==null?void 0:f.type)==="phone"&&W!=null?(h(e),p.current=n,S.current=O):(c(e),l.current=n,u.current=O),r.current=M,Promise.resolve()},[]);return{emailSignerDialogOpen:y,emailSignerDialogStep:b,setEmailSignerDialogOpen:c,setEmailSignerDialogStep:g,phoneSignerDialogOpen:T,phoneSignerDialogStep:R,setPhoneSignerDialogOpen:h,setPhoneSignerDialogStep:P,sendEmailWithOtpRef:l,verifyOtpRef:u,sendPhoneWithOtpRef:p,verifyPhoneOtpRef:S,rejectRef:r,emailsigners_handleSendEmailOTP:D,emailsigners_handleOTPSubmit:E,emailsigners_handleResendOTP:w,phonesigners_handleSendPhoneOTP:F,phonesigners_handleOTPSubmit:_,phonesigners_handleResendOTP:j,onAuthRequired:A}}exports.a = q;
@@ -1 +0,0 @@
1
- import{c as o}from"./chunk-22GIA4MK.js";import{useState as d,useRef as t,useCallback as i}from"react";var a=s=>()=>{throw new Error(`${s} is not available. Make sure you're using an email or phone signer wallet.`)};function H(s){let[y,c]=d(!1),[b,g]=d("initial"),[T,h]=d(!1),[R,P]=d("initial"),m=t(s);m.current=s;let l=t(a("sendEmailWithOtp")),u=t(a("verifyOtp")),p=t(a("sendPhoneWithOtp")),S=t(a("verifyPhoneOtp")),r=t(a("reject")),D=i(()=>o(this,null,function*(){try{yield l.current(),g("otp")}catch(e){console.error("Failed to send email OTP",e),r.current(new Error("Failed to send email OTP"))}}),[]),E=i(e=>o(this,null,function*(){try{yield u.current(e),c(!1),g("initial")}catch(n){console.error("Failed to verify OTP",n),r.current(new Error("Failed to verify OTP"))}}),[]),w=i(()=>o(this,null,function*(){try{yield l.current()}catch(e){console.error("Failed to resend email OTP",e),r.current(new Error("Failed to resend email OTP"))}}),[]),F=i(()=>o(this,null,function*(){try{yield p.current(),P("otp")}catch(e){console.error("Failed to send phone OTP",e),r.current(new Error("Failed to send phone OTP"))}}),[]),_=i(e=>o(this,null,function*(){try{yield S.current(e),h(!1),P("initial")}catch(n){console.error("Failed to verify phone OTP",n),r.current(new Error("Failed to verify phone OTP"))}}),[]),j=i(()=>o(this,null,function*(){try{yield p.current()}catch(e){console.error("Failed to resend phone OTP",e),r.current(new Error("Failed to resend phone OTP"))}}),[]),A=i((e,n,O,M)=>{var v,f;let W=(v=m.current)==null?void 0:v.locator().split(":")[1];return((f=m.current)==null?void 0:f.type)==="phone"&&W!=null?(h(e),p.current=n,S.current=O):(c(e),l.current=n,u.current=O),r.current=M,Promise.resolve()},[]);return{emailSignerDialogOpen:y,emailSignerDialogStep:b,setEmailSignerDialogOpen:c,setEmailSignerDialogStep:g,phoneSignerDialogOpen:T,phoneSignerDialogStep:R,setPhoneSignerDialogOpen:h,setPhoneSignerDialogStep:P,sendEmailWithOtpRef:l,verifyOtpRef:u,sendPhoneWithOtpRef:p,verifyPhoneOtpRef:S,rejectRef:r,emailsigners_handleSendEmailOTP:D,emailsigners_handleOTPSubmit:E,emailsigners_handleResendOTP:w,phonesigners_handleSendPhoneOTP:F,phonesigners_handleOTPSubmit:_,phonesigners_handleResendOTP:j,onAuthRequired:A}}export{H as a};
@@ -1 +0,0 @@
1
- import{a as U}from"./chunk-ELPIFOQ5.js";import{b as se}from"./chunk-GFXPYJ63.js";import{b as K}from"./chunk-FF2S33DL.js";import{a as ie}from"./chunk-LEFZXON3.js";import{a as M,b as J,c as v}from"./chunk-22GIA4MK.js";import{useContext as Ee}from"react";import{createContext as Ae,useCallback as X,useEffect as le,useMemo as de,useState as q}from"react";import{CrossmintWallets as Oe}from"@crossmint/wallets-sdk";import{useContext as we}from"react";import{createContext as Pe,useCallback as k,useContext as he,useEffect as V,useMemo as ce,useRef as Se,useState as z}from"react";import{CrossmintAuth as ye,getCookie as ve}from"@crossmint/client-sdk-auth";import{SESSION_PREFIX as ae}from"@crossmint/common-sdk-auth";import{jsx as We}from"react/jsx-runtime";var T=Pe({crossmintAuth:void 0,logout:()=>v(void 0,null,function*(){}),status:"initializing",getUser:()=>{},login:()=>{}});function xe(){let s=he(T);if(s==null)throw new Error("useCrossmintAuthBase must be used within CrossmintAuthBaseProvider");return s}function Re({children:s,onLoginSuccess:n,refreshRoute:p,logoutRoute:u,storageProvider:a}){let{crossmint:o}=U("CrossmintAuthBaseProvider must be used within CrossmintProvider"),[m,i]=z(void 0),[r,c]=z(void 0),[x,t]=z(!1),f=Se(null);V(()=>{if(!f.current)try{f.current=ye.from(o,{callbacks:{onLogout:()=>{i(void 0),c(void 0)},onTokenRefresh:d=>{i(d.user),c(d.jwt)}},refreshRoute:p,logoutRoute:u,storageProvider:a})}catch(d){console.error("Failed to initialize CrossmintAuth:",d)}},[o,p,u,a]);let l=f.current,C=k(()=>{n==null||n()},[n]);V(()=>{var d;if(r==null)if(a)(d=a.get)==null||d.call(a,ae).then(P=>{P!=null&&c(P)}).finally(()=>{t(!0)});else{try{let P=ve(ae);c(P)}catch(P){console.error("Failed to get cookie:",P)}t(!0)}else t(!0)},[r,a]),V(()=>{r!=null&&C()},[r,C]);let y=k(()=>v(this,null,function*(){return i(void 0),c(void 0),yield l==null?void 0:l.logout()}),[l]),E=k(()=>v(this,null,function*(){if(r==null){console.log("User not logged in");return}let d=yield l==null?void 0:l.getUser();return i(d),d}),[r,l]),R=k(()=>x?r!=null?"logged-in":"logged-out":"initializing",[r,x]),b=ce(()=>({crossmintAuth:l,logout:y,jwt:r,user:m,status:R(),getUser:E,login:()=>{}}),[l,y,r,m,x,E,R]);return We(T.Provider,{value:b,children:s})}function Be(){let s=we(T);if(s==null)throw new Error("useCrossmintAuth must be used within a CrossmintAuthProvider");return s}var Le=Be;import Te from"lodash.clonedeep";import{jsx as pe}from"react/jsx-runtime";var G=Ae({wallet:void 0,status:"not-loaded",getOrCreateWallet:()=>Promise.resolve(void 0),onAuthRequired:void 0,clientTEEConnection:void 0,emailSignerState:{needsAuth:!1,sendEmailWithOtp:null,verifyOtp:null,reject:null}});function Ct({children:s,createOnLogin:n,callbacks:p,clientTEEConnection:u,initializeWebView:a,appearance:o,headlessSigningFlow:m,showPasskeyHelpers:i,renderUI:r}){let c=K(se),{crossmint:x,experimental_customAuth:t}=U("CrossmintWalletBaseProvider must be used within CrossmintProvider"),[f,l]=q(void 0),[C,y]=q("not-loaded"),[E,R]=q({open:!1}),b=ie(f==null?void 0:f.signer),{onAuthRequired:d}=b,[P,fe]=q({needsAuth:!1,sendEmailWithOtp:null,verifyOtp:null,reject:null}),j=X(h=>()=>new Promise(e=>{if(!i){e();return}R({type:h,open:!0,primaryActionOnClick:()=>{R({open:!1}),e()},secondaryActionOnClick:()=>{R({open:!1}),e()}})}),[i]),g=de(()=>{let h=p==null?void 0:p.onWalletCreationStart,e=p==null?void 0:p.onTransactionStart;return(n==null?void 0:n.signer.type)==="passkey"&&i&&(h=j("create-wallet"),e=j("transaction")),{onWalletCreationStart:h,onTransactionStart:e}},[p,n==null?void 0:n.signer.type,i,j]),B=X((h,e,A,O)=>v(this,null,function*(){if(fe({needsAuth:h,sendEmailWithOtp:e,verifyOtp:A,reject:O}),d)return yield d(h,e,A,O)}),[d]),I=X(h=>v(this,null,function*(){var A,O,Q,Y,Z,$,_,L,ee,te,ne,oe;let e=Te(h);if(!((t==null?void 0:t.jwt)==null||C==="in-progress")){if(f!=null)return f;try{y("in-progress");let F=Oe.from(x),D=(O=(A=e.options)==null?void 0:A.experimental_callbacks)==null?void 0:O.onWalletCreationStart,N=(Y=(Q=e.options)==null?void 0:Q.experimental_callbacks)==null?void 0:Y.onTransactionStart;if(((Z=e==null?void 0:e.signer)==null?void 0:Z.type)==="email"){let S=($=e.signer.email)!=null?$:t==null?void 0:t.email,H=(_=e.signer.onAuthRequired)!=null?_:B;if(S==null)throw new Error("Email not found in experimental_customAuth or signer. Please set email in experimental_customAuth or signer.");e.signer=J(M({},e.signer),{email:S,onAuthRequired:H})}if(((L=e==null?void 0:e.signer)==null?void 0:L.type)==="phone"){let S=(ee=e.signer.phone)!=null?ee:t==null?void 0:t.phone,H=(te=e.signer.onAuthRequired)!=null?te:B;if(S==null)throw new Error("Phone not found in signer. Please set phone in signer.");e.signer=J(M({},e.signer),{phone:S,onAuthRequired:H})}if(((ne=e==null?void 0:e.signer)==null?void 0:ne.type)==="external-wallet"){let S=((oe=e.signer)==null?void 0:oe.address)!=null?e.signer:t.externalWalletSigner;if(S==null)throw new Error("External wallet config not found in experimental_customAuth or signer. Please set it in experimental_customAuth or signer.");e.signer=S}(e.signer.type==="email"||e.signer.type==="phone")&&(yield a==null?void 0:a());let re=yield F.getOrCreateWallet({chain:e.chain,signer:e.signer,owner:e.owner,plugins:e.plugins,delegatedSigners:e.delegatedSigners,alias:e.alias,options:{clientTEEConnection:u==null?void 0:u(),experimental_callbacks:{onWalletCreationStart:D!=null?D:g==null?void 0:g.onWalletCreationStart,onTransactionStart:N!=null?N:g==null?void 0:g.onTransactionStart}}});return l(re),y("loaded"),re}catch(F){console.error("Failed to create wallet:",F),l(void 0),y("error");return}}}),[x,t,B,C,f,g==null?void 0:g.onWalletCreationStart,g==null?void 0:g.onTransactionStart,u,a]);le(()=>{if(n!=null){if(n.signer.type==="email"&&(t==null?void 0:t.email)==null||n.signer.type==="external-wallet"&&(t==null?void 0:t.externalWalletSigner)==null&&n.signer.address==null)return;I(n)}},[n,I,t==null?void 0:t.email,t==null?void 0:t.externalWalletSigner]),le(()=>{(t==null?void 0:t.jwt)==null&&C!=="not-loaded"&&(y("not-loaded"),l(void 0))},[t==null?void 0:t.jwt,C]);let ge=de(()=>({wallet:f,status:C,getOrCreateWallet:I,onAuthRequired:B,clientTEEConnection:u,emailSignerState:P}),[I,f,C,B,u,P]),Ce=o!=null||m!=null||i!=null||r!=null;return pe(G.Provider,{value:ge,children:Ce?pe(ue,{appearance:o,headlessSigningFlow:m,renderUI:r,passkeyPromptState:E,signerAuth:b,children:s}):s})}function me(){let s=Ee(G);if(!s)throw new Error("useWallet must be used within CrossmintWalletProvider");return s}import{Fragment as be,jsxs as Ie}from"react/jsx-runtime";function ue({children:s,appearance:n,headlessSigningFlow:p,renderUI:u,passkeyPromptState:a,signerAuth:o}){let{wallet:m}=me(),i=m==null?void 0:m.signer.type,r=m==null?void 0:m.signer.locator().split(":")[1],c={emailSignerProps:{email:i==="email"?r:void 0,open:o.emailSignerDialogOpen&&i==="email"&&r!=null,setOpen:o.setEmailSignerDialogOpen,step:o.emailSignerDialogStep,onSubmitOTP:o.emailsigners_handleOTPSubmit,onResendOTPCode:o.emailsigners_handleResendOTP,onSubmitEmail:o.emailsigners_handleSendEmailOTP,rejectRef:o.rejectRef,appearance:n},phoneSignerProps:{phone:i==="phone"?r:void 0,open:o.phoneSignerDialogOpen&&i==="phone"&&r!=null,setOpen:o.setPhoneSignerDialogOpen,step:o.phoneSignerDialogStep,onSubmitOTP:o.phonesigners_handleOTPSubmit,onResendOTPCode:o.phonesigners_handleResendOTP,onSubmitPhone:o.phonesigners_handleSendPhoneOTP,rejectRef:o.rejectRef,appearance:n},passkeyPromptProps:{state:a,appearance:n}};return Ie(be,{children:[s,!p&&u!=null&&u(c)]})}export{ue as a,G as b,Ct as c,me as d,T as e,xe as f,Re as g,Be as h,Le as i};
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkQBEM2WHMcjs = require('./chunk-QBEM2WHM.cjs');var _chunk4UKWTU5Wcjs = require('./chunk-4UKWTU5W.cjs');var _react = require('react');var _commonsdkbase = require('@crossmint/common-sdk-base');var _lodashisequal = require('lodash.isequal'); var _lodashisequal2 = _interopRequireDefault(_lodashisequal);var o={name:"@crossmint/client-sdk-react-base",version:"1.0.7",repository:"https://github.com/Crossmint/crossmint-sdk",license:"Apache-2.0",author:"Paella Labs Inc",sideEffects:!1,type:"module",exports:{import:"./dist/index.js",require:"./dist/index.cjs"},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist","LICENSE"],scripts:{build:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup",dev:"cross-env NODE_OPTIONS='--max-old-space-size=8192' tsup --watch","test:vitest":"vitest run"},dependencies:{"@crossmint/common-sdk-auth":"workspace:*","@crossmint/common-sdk-base":"workspace:*","@crossmint/client-sdk-auth":"workspace:*","@crossmint/client-sdk-base":"workspace:*","@crossmint/client-sdk-window":"workspace:*","@crossmint/client-signers":"workspace:*","@crossmint/wallets-sdk":"workspace:*","lodash.isequal":"4.5.0","lodash.clonedeep":"4.5.0"},devDependencies:{"@types/react":"19.1.10","@types/lodash.isequal":"4.5.6","@types/lodash.clonedeep":"4.5.6"},peerDependencies:{react:">=17.0.2"}};var _jsxruntime = require('react/jsx-runtime');var N=_react.createContext.call(void 0, null),L= exports.b =_chunkQBEM2WHMcjs.a.call(void 0, );function P({children:x,apiKey:s,appId:f,extensionId:w,overrideBaseUrl:h}){let v=_react.useMemo.call(void 0, ()=>_chunk4UKWTU5Wcjs.a.call(void 0, s,o.name,o.version),[s]),[k,c]=_react.useState.call(void 0, 0),t=_react.useRef.call(void 0, null);t.current==null&&(t.current=new Proxy(_commonsdkbase.createCrossmint.call(void 0, {apiKey:s,overrideBaseUrl:h,appId:f,extensionId:w}),{set(e,r,n){return r==="jwt"&&e.jwt!==n&&c(i=>i+1),r==="experimental_customAuth"&&e.experimental_customAuth!==n&&c(i=>i+1),Reflect.set(e,r,n)}}));let l=_react.useCallback.call(void 0, e=>{if(t.current==null)throw new Error("CrossmintProvider is not initialized");e!==t.current.jwt&&(t.current.jwt=e,t.current.experimental_customAuth==null?t.current.experimental_customAuth={jwt:e}:t.current.experimental_customAuth.jwt=e)},[]),u=_react.useCallback.call(void 0, e=>{if(t.current==null)throw new Error("CrossmintProvider is not initialized");t.current.jwt!=(e==null?void 0:e.jwt)&&(t.current.jwt=e==null?void 0:e.jwt),_lodashisequal2.default.call(void 0, e,t.current.experimental_customAuth)||(t.current.experimental_customAuth=e)},[]),g=_react.useMemo.call(void 0, ()=>{if(!t.current)throw new Error("CrossmintProvider is not initialized");return{get crossmint(){return t.current},experimental_setCustomAuth:u,experimental_customAuth:t.current.experimental_customAuth,setJwt:l}},[u,l,k]);return _jsxruntime.jsx.call(void 0, L.Provider,{value:v,children:_jsxruntime.jsx.call(void 0, N.Provider,{value:g,children:x})})}exports.a = N; exports.b = L; exports.c = P;
File without changes