@privy-io/expo 0.76.2 → 0.76.3

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6GY37RNTjs = require('./chunk-6GY37RNT.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _react = require('react');var _jssdkcore = require('@privy-io/js-sdk-core');var f=()=>{let e=_chunk6GY37RNTjs.m.call(void 0, );return _react.useMemo.call(void 0, ()=>({createWallet(n){return _chunkK5SPDXVFjs.e.call(void 0, this,null,function*(){let s=yield _jssdkcore.create.call(void 0, e,{request:{chain_type:n.chainType}}),{user:o}=yield e.user.get();return{user:o,wallet:s}})}}),[e])};var C=()=>{let e=_chunk6GY37RNTjs.m.call(void 0, );return _react.useMemo.call(void 0, ()=>({signRawHash(k){return _chunkK5SPDXVFjs.e.call(void 0, this,arguments,function*({address:n,chainType:s,hash:o}){let l=_chunk6GY37RNTjs.b.call(void 0, );if(!l)throw new (0, _jssdkcore.PrivyClientError)({code:"embedded_wallet_before_logged_in",error:"User must be authenticated before signing a raw hash"});let p=l.linked_accounts.filter(_jssdkcore.isEmbeddedWalletAccount).filter(_jssdkcore.isUnifiedWallet).filter(t=>t.chain_type===s).find(t=>t.address===n);if(!p)throw new (0, _jssdkcore.PrivyClientError)({code:"embedded_wallet_does_not_exist",error:"No embedded wallet found for the given address and chain type"});let r=yield _jssdkcore.rawSign.call(void 0, e,(...t)=>e.embeddedWallet.signWithUserSigner(...t),{wallet_id:p.id,params:{hash:o}});if(r.data&&"signature"in r.data&&r.data.encoding==="hex")return{signature:r.data.signature};throw new Error("Failed to sign")})}}),[e])};exports.useCreateWallet = f; exports.useSignRawHash = C;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHNRKZKAWjs = require('./chunk-HNRKZKAW.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _react = require('react');var _jssdkcore = require('@privy-io/js-sdk-core');var f=()=>{let e=_chunkHNRKZKAWjs.m.call(void 0, );return _react.useMemo.call(void 0, ()=>({createWallet(n){return _chunkK5SPDXVFjs.e.call(void 0, this,null,function*(){let s=yield _jssdkcore.create.call(void 0, e,{request:{chain_type:n.chainType}}),{user:o}=yield e.user.get();return{user:o,wallet:s}})}}),[e])};var C=()=>{let e=_chunkHNRKZKAWjs.m.call(void 0, );return _react.useMemo.call(void 0, ()=>({signRawHash(k){return _chunkK5SPDXVFjs.e.call(void 0, this,arguments,function*({address:n,chainType:s,hash:o}){let l=_chunkHNRKZKAWjs.b.call(void 0, );if(!l)throw new (0, _jssdkcore.PrivyClientError)({code:"embedded_wallet_before_logged_in",error:"User must be authenticated before signing a raw hash"});let p=l.linked_accounts.filter(_jssdkcore.isEmbeddedWalletAccount).filter(_jssdkcore.isUnifiedWallet).filter(t=>t.chain_type===s).find(t=>t.address===n);if(!p)throw new (0, _jssdkcore.PrivyClientError)({code:"embedded_wallet_does_not_exist",error:"No embedded wallet found for the given address and chain type"});let r=yield _jssdkcore.rawSign.call(void 0, e,(...t)=>e.embeddedWallet.signWithUserSigner(...t),{wallet_id:p.id,params:{hash:o}});if(r.data&&"signature"in r.data&&r.data.encoding==="hex")return{signature:r.data.signature};throw new Error("Failed to sign")})}}),[e])};exports.useCreateWallet = f; exports.useSignRawHash = C;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunkFJGLXYQVjs = require('./chunk-FJGLXYQV.js');var _chunk6GY37RNTjs = require('./chunk-6GY37RNT.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _jssdkcore = require('@privy-io/js-sdk-core'); _createStarExport(_jssdkcore);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var Kt=({loading:t,error:e,unauthenticated:o,children:i})=>{let{isReady:u,error:p}=_chunk6GY37RNTjs.aa.call(void 0, ),U=_chunk6GY37RNTjs.e.call(void 0, );if(!u)return _react2.default.createElement(_react2.default.Fragment,null,t);if(p&&e){let n=typeof e=="function"?e(p):e;return _react2.default.createElement(_react2.default.Fragment,null,n)}return U?_react2.default.createElement(_react2.default.Fragment,null,i):_react2.default.createElement(_react2.default.Fragment,null,o)};function g(t){return _chunkFJGLXYQVjs.a.call(void 0, t)}function F(t){let{state:e,start:o}=_chunkFJGLXYQVjs.a.call(void 0, _chunkK5SPDXVFjs.c.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {},t),{action:"link"}));return{state:e,link:o}}var H=t=>{let{client:e}=_react.useContext.call(void 0, _chunk6GY37RNTjs.ka),o=_react.useRef.call(void 0, t);return _react.useEffect.call(void 0, ()=>{o.current=t},[t]),{unlinkOAuth:_react.useCallback.call(void 0, U=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[U],function*({provider:u,subject:p}){var n,A,s,O;try{let{user:h}=yield e.auth.oauth.unlink(u,p);return(A=(n=o.current)==null?void 0:n.onSuccess)==null||A.call(n,h),h}catch(h){let c=_chunk6GY37RNTjs.h.call(void 0, h);throw(O=(s=o.current)==null?void 0:s.onError)==null||O.call(s,c),c}}),[e.auth.oauth])}};var D=t=>{let{client:e}=_react.useContext.call(void 0, _chunk6GY37RNTjs.ka),o=_react.useRef.call(void 0, t.onOAuthTokenGrant);o.current=t.onOAuthTokenGrant,_react.useEffect.call(void 0, ()=>{let{unsubscribe:i}=e.addOAuthTokensListener(u=>{o.current(u)});return i},[e])};exports.AuthBoundary = Kt; exports.PrivyContext = _chunk6GY37RNTjs.ka; exports.PrivyProvider = _chunk6GY37RNTjs.ma; exports.SecureStorageAdapter = _chunkK5SPDXVFjs.h; exports.createPrivyClient = _chunk6GY37RNTjs.j; exports.dataSuffix = _jssdkcore.createDataSuffixPlugin; exports.getAccessToken = _chunk6GY37RNTjs.la; exports.hasError = _chunkQSWCX5XIjs.g; exports.isConnected = _chunkQSWCX5XIjs.a; exports.isConnecting = _chunkQSWCX5XIjs.c; exports.isCreating = _chunkQSWCX5XIjs.f; exports.isDisconnected = _chunkQSWCX5XIjs.d; exports.isNotCreated = _chunkQSWCX5XIjs.e; exports.isReconnecting = _chunkQSWCX5XIjs.b; exports.needsRecovery = _chunkQSWCX5XIjs.h; exports.useAcceptTerms = _chunk6GY37RNTjs.ba; exports.useAuthorizationSignature = _chunk6GY37RNTjs.ca; exports.useCreateGuestAccount = _chunk6GY37RNTjs.Q; exports.useDepositAddress = _chunk6GY37RNTjs.A; exports.useEmbeddedBitcoinWallet = _chunk6GY37RNTjs.$; exports.useEmbeddedEthereumWallet = _chunk6GY37RNTjs.Z; exports.useEmbeddedSolanaWallet = _chunk6GY37RNTjs._; exports.useEmbeddedWallet = _chunk6GY37RNTjs.N; exports.useEmbeddedWalletStateChange = _chunk6GY37RNTjs.O; exports.useGetEncryptedAuthorizationKey = _chunk6GY37RNTjs.da; exports.useHeadlessCryptoDeposit = _chunk6GY37RNTjs.B; exports.useHeadlessDelegatedActions = _chunk6GY37RNTjs.z; exports.useIdentityToken = _chunk6GY37RNTjs.P; exports.useImportWallet = _chunk6GY37RNTjs.Y; exports.useLinkEmail = _chunk6GY37RNTjs.q; exports.useLinkSMS = _chunk6GY37RNTjs.t; exports.useLinkWithCrossApp = _chunk6GY37RNTjs.H; exports.useLinkWithFarcaster = _chunk6GY37RNTjs.v; exports.useLinkWithOAuth = F; exports.useLinkWithSiwe = _chunk6GY37RNTjs.k; exports.useLinkWithSiws = _chunk6GY37RNTjs.n; exports.useLoginWithCrossApp = _chunk6GY37RNTjs.G; exports.useLoginWithEmail = _chunk6GY37RNTjs.s; exports.useLoginWithFarcaster = _chunk6GY37RNTjs.x; exports.useLoginWithFarcasterV2 = _chunk6GY37RNTjs.y; exports.useLoginWithOAuth = _chunkFJGLXYQVjs.b; exports.useLoginWithSMS = _chunk6GY37RNTjs.u; exports.useLoginWithSiwe = _chunk6GY37RNTjs.l; exports.useLoginWithSiws = _chunk6GY37RNTjs.o; exports.useMfa = _chunk6GY37RNTjs.V; exports.useMfaEnrollment = _chunk6GY37RNTjs.W; exports.useMigrateWallets = _chunk6GY37RNTjs.ja; exports.useOAuthFlow = g; exports.useOAuthTokens = D; exports.useOnNeedsRecovery = _chunk6GY37RNTjs.f; exports.usePrivy = _chunk6GY37RNTjs.aa; exports.usePrivyClient = _chunk6GY37RNTjs.m; exports.useRecoverEmbeddedWallet = _chunk6GY37RNTjs.M; exports.useRegisterMfaListener = _chunk6GY37RNTjs.R; exports.useSendTransactionWithCrossApp = _chunk6GY37RNTjs.K; exports.useSessionSigners = _chunk6GY37RNTjs.C; exports.useSetEmbeddedWalletRecovery = _chunk6GY37RNTjs.L; exports.useSign7702Authorization = _chunk6GY37RNTjs.ea; exports.useSignMessageWithCrossApp = _chunk6GY37RNTjs.I; exports.useSignTypedDataWithCrossApp = _chunk6GY37RNTjs.J; exports.useSigners = _chunk6GY37RNTjs.D; exports.useStoredUsers = _chunk6GY37RNTjs.ha; exports.useSwitchUser = _chunk6GY37RNTjs.ia; exports.useTransfer = _chunk6GY37RNTjs.fa; exports.useUnlinkEmail = _chunk6GY37RNTjs.r; exports.useUnlinkFarcaster = _chunk6GY37RNTjs.w; exports.useUnlinkOAuth = H; exports.useUnlinkPasskey = _chunk6GY37RNTjs.X; exports.useUnlinkWallet = _chunk6GY37RNTjs.p; exports.useUpdateEmail = _chunk6GY37RNTjs.E; exports.useUpdatePhone = _chunk6GY37RNTjs.F; exports.useWalletActions = _chunk6GY37RNTjs.ga;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunk6D3SMMVWjs = require('./chunk-6D3SMMVW.js');var _chunkHNRKZKAWjs = require('./chunk-HNRKZKAW.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _jssdkcore = require('@privy-io/js-sdk-core'); _createStarExport(_jssdkcore);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var Kt=({loading:t,error:e,unauthenticated:o,children:i})=>{let{isReady:u,error:p}=_chunkHNRKZKAWjs.aa.call(void 0, ),U=_chunkHNRKZKAWjs.e.call(void 0, );if(!u)return _react2.default.createElement(_react2.default.Fragment,null,t);if(p&&e){let n=typeof e=="function"?e(p):e;return _react2.default.createElement(_react2.default.Fragment,null,n)}return U?_react2.default.createElement(_react2.default.Fragment,null,i):_react2.default.createElement(_react2.default.Fragment,null,o)};function g(t){return _chunk6D3SMMVWjs.a.call(void 0, t)}function F(t){let{state:e,start:o}=_chunk6D3SMMVWjs.a.call(void 0, _chunkK5SPDXVFjs.c.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {},t),{action:"link"}));return{state:e,link:o}}var H=t=>{let{client:e}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),o=_react.useRef.call(void 0, t);return _react.useEffect.call(void 0, ()=>{o.current=t},[t]),{unlinkOAuth:_react.useCallback.call(void 0, U=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[U],function*({provider:u,subject:p}){var n,A,s,O;try{let{user:h}=yield e.auth.oauth.unlink(u,p);return(A=(n=o.current)==null?void 0:n.onSuccess)==null||A.call(n,h),h}catch(h){let c=_chunkHNRKZKAWjs.h.call(void 0, h);throw(O=(s=o.current)==null?void 0:s.onError)==null||O.call(s,c),c}}),[e.auth.oauth])}};var D=t=>{let{client:e}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),o=_react.useRef.call(void 0, t.onOAuthTokenGrant);o.current=t.onOAuthTokenGrant,_react.useEffect.call(void 0, ()=>{let{unsubscribe:i}=e.addOAuthTokensListener(u=>{o.current(u)});return i},[e])};exports.AuthBoundary = Kt; exports.PrivyContext = _chunkHNRKZKAWjs.ka; exports.PrivyProvider = _chunkHNRKZKAWjs.ma; exports.SecureStorageAdapter = _chunkK5SPDXVFjs.h; exports.createPrivyClient = _chunkHNRKZKAWjs.j; exports.dataSuffix = _jssdkcore.createDataSuffixPlugin; exports.getAccessToken = _chunkHNRKZKAWjs.la; exports.hasError = _chunkQSWCX5XIjs.g; exports.isConnected = _chunkQSWCX5XIjs.a; exports.isConnecting = _chunkQSWCX5XIjs.c; exports.isCreating = _chunkQSWCX5XIjs.f; exports.isDisconnected = _chunkQSWCX5XIjs.d; exports.isNotCreated = _chunkQSWCX5XIjs.e; exports.isReconnecting = _chunkQSWCX5XIjs.b; exports.needsRecovery = _chunkQSWCX5XIjs.h; exports.useAcceptTerms = _chunkHNRKZKAWjs.ba; exports.useAuthorizationSignature = _chunkHNRKZKAWjs.ca; exports.useCreateGuestAccount = _chunkHNRKZKAWjs.Q; exports.useDepositAddress = _chunkHNRKZKAWjs.A; exports.useEmbeddedBitcoinWallet = _chunkHNRKZKAWjs.$; exports.useEmbeddedEthereumWallet = _chunkHNRKZKAWjs.Z; exports.useEmbeddedSolanaWallet = _chunkHNRKZKAWjs._; exports.useEmbeddedWallet = _chunkHNRKZKAWjs.N; exports.useEmbeddedWalletStateChange = _chunkHNRKZKAWjs.O; exports.useGetEncryptedAuthorizationKey = _chunkHNRKZKAWjs.da; exports.useHeadlessCryptoDeposit = _chunkHNRKZKAWjs.B; exports.useHeadlessDelegatedActions = _chunkHNRKZKAWjs.z; exports.useIdentityToken = _chunkHNRKZKAWjs.P; exports.useImportWallet = _chunkHNRKZKAWjs.Y; exports.useLinkEmail = _chunkHNRKZKAWjs.q; exports.useLinkSMS = _chunkHNRKZKAWjs.t; exports.useLinkWithCrossApp = _chunkHNRKZKAWjs.H; exports.useLinkWithFarcaster = _chunkHNRKZKAWjs.v; exports.useLinkWithOAuth = F; exports.useLinkWithSiwe = _chunkHNRKZKAWjs.k; exports.useLinkWithSiws = _chunkHNRKZKAWjs.n; exports.useLoginWithCrossApp = _chunkHNRKZKAWjs.G; exports.useLoginWithEmail = _chunkHNRKZKAWjs.s; exports.useLoginWithFarcaster = _chunkHNRKZKAWjs.x; exports.useLoginWithFarcasterV2 = _chunkHNRKZKAWjs.y; exports.useLoginWithOAuth = _chunk6D3SMMVWjs.b; exports.useLoginWithSMS = _chunkHNRKZKAWjs.u; exports.useLoginWithSiwe = _chunkHNRKZKAWjs.l; exports.useLoginWithSiws = _chunkHNRKZKAWjs.o; exports.useMfa = _chunkHNRKZKAWjs.V; exports.useMfaEnrollment = _chunkHNRKZKAWjs.W; exports.useMigrateWallets = _chunkHNRKZKAWjs.ja; exports.useOAuthFlow = g; exports.useOAuthTokens = D; exports.useOnNeedsRecovery = _chunkHNRKZKAWjs.f; exports.usePrivy = _chunkHNRKZKAWjs.aa; exports.usePrivyClient = _chunkHNRKZKAWjs.m; exports.useRecoverEmbeddedWallet = _chunkHNRKZKAWjs.M; exports.useRegisterMfaListener = _chunkHNRKZKAWjs.R; exports.useSendTransactionWithCrossApp = _chunkHNRKZKAWjs.K; exports.useSessionSigners = _chunkHNRKZKAWjs.C; exports.useSetEmbeddedWalletRecovery = _chunkHNRKZKAWjs.L; exports.useSign7702Authorization = _chunkHNRKZKAWjs.ea; exports.useSignMessageWithCrossApp = _chunkHNRKZKAWjs.I; exports.useSignTypedDataWithCrossApp = _chunkHNRKZKAWjs.J; exports.useSigners = _chunkHNRKZKAWjs.D; exports.useStoredUsers = _chunkHNRKZKAWjs.ha; exports.useSwitchUser = _chunkHNRKZKAWjs.ia; exports.useTransfer = _chunkHNRKZKAWjs.fa; exports.useUnlinkEmail = _chunkHNRKZKAWjs.r; exports.useUnlinkFarcaster = _chunkHNRKZKAWjs.w; exports.useUnlinkOAuth = H; exports.useUnlinkPasskey = _chunkHNRKZKAWjs.X; exports.useUnlinkWallet = _chunkHNRKZKAWjs.p; exports.useUpdateEmail = _chunkHNRKZKAWjs.E; exports.useUpdatePhone = _chunkHNRKZKAWjs.F; exports.useWalletActions = _chunkHNRKZKAWjs.ga;
package/dist/passkey.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunk6GY37RNTjs = require('./chunk-6GY37RNT.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _react = require('react');var _jssdkcore = require('@privy-io/js-sdk-core');var Y=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunk6GY37RNTjs.ka),c=_react.useCallback.call(void 0, o=>{var n;let t=_chunk6GY37RNTjs.h.call(void 0, o);return s({status:"error",error:t}),(n=e==null?void 0:e.onError)==null||n.call(e,t),t},[e==null?void 0:e.onError]);return{linkWithPasskey:_react.useCallback.call(void 0, n=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[n],function*({relyingParty:o,extra_options:t}){var u;try{if(!_chunk6GY37RNTjs.b.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_link_passkey_before_logged_in",error:"Must be logged in to link a passkey."});s({status:"generating-challenege"});let{options:k}=yield a.auth.passkey.generateRegistrationOptions(o);s({status:"awaiting-passkey"});let y=yield _chunk6GY37RNTjs.S.call(void 0, _chunk6GY37RNTjs.U.call(void 0, k),t);s({status:"submitting-response"});let{user:m}=yield a.auth.passkey.linkWithPasskey(y,o);return s({status:"done"}),(u=e==null?void 0:e.onSuccess)==null||u.call(e,m),m}catch(r){throw c(r)}}),[a,c,e==null?void 0:e.onSuccess]),state:d}};var ie=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunk6GY37RNTjs.ka),c=_react.useCallback.call(void 0, o=>{var n;let t=_chunk6GY37RNTjs.h.call(void 0, o);return s({status:"error",error:t}),(n=e==null?void 0:e.onError)==null||n.call(e,t),t},[e==null?void 0:e.onError]);return{loginWithPasskey:_react.useCallback.call(void 0, n=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[n],function*({relyingParty:o,extra_options:t}){var u,r,k,y;try{if(_chunk6GY37RNTjs.b.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_login_with_passkey_while_already_logged_in",error:"Already logged in, use `useLinkWithPasskey` if you are trying to link a passkey to an existing account"});s({status:"generating-challenege"});let{options:i}=yield a.auth.passkey.generateAuthenticationOptions(o);s({status:"awaiting-passkey"});let f=yield _chunk6GY37RNTjs.T.call(void 0, {challenge:i.challenge,rpId:i.rp_id,extensions:{appid:(u=i.extensions)==null?void 0:u.app_id,credProps:(r=i.extensions)==null?void 0:r.cred_props,hmacCreateSecret:(k=i.extensions)==null?void 0:k.hmac_create_secret},timeout:i.timeout,allowCredentials:i.allow_credentials,userVerification:i.user_verification},t);s({status:"submitting-response"});let l=_chunk6GY37RNTjs.a.call(void 0, ),C=yield a.auth.passkey.loginWithPasskey(f,i.challenge,o,{embedded:l==null?void 0:l.embedded});return s({status:"done"}),(y=e==null?void 0:e.onSuccess)==null||y.call(e,C.user,C.is_new_user),C.user}catch(m){throw c(m)}}),[a,c,e==null?void 0:e.onSuccess]),state:d}};var ge=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunk6GY37RNTjs.ka),c=_react.useRef.call(void 0, e);_react.useEffect.call(void 0, ()=>{c.current=e},[e]);let S=_react.useCallback.call(void 0, t=>{var u,r;let n=_chunk6GY37RNTjs.h.call(void 0, t);return s({status:"error",error:n}),(r=(u=c.current)==null?void 0:u.onError)==null||r.call(u,n),n},[s]);return{signupWithPasskey:_react.useCallback.call(void 0, u=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[u],function*({relyingParty:t,extra_options:n}){var r,k;try{if(_chunk6GY37RNTjs.b.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_login_with_passkey_while_already_logged_in",error:"Already logged in, use `useLinkWithPasskey` if you are trying to link a passkey to an existing account"});s({status:"generating-challenege"});let{options:m}=yield a.auth.passkey.generateSignupOptions(t);s({status:"awaiting-passkey"});let i=yield _chunk6GY37RNTjs.S.call(void 0, _chunk6GY37RNTjs.U.call(void 0, m),n);s({status:"submitting-response"});let f=_chunk6GY37RNTjs.a.call(void 0, ),l=yield a.auth.passkey.signupWithPasskey(i,t,{embedded:f==null?void 0:f.embedded});return s({status:"done"}),(k=(r=c.current)==null?void 0:r.onSuccess)==null||k.call(r,l.user,l.is_new_user),{user:l.user}}catch(y){throw S(y)}}),[a.auth.passkey,S,s]),state:d}};exports.hasError = _chunkQSWCX5XIjs.g; exports.isConnected = _chunkQSWCX5XIjs.a; exports.isConnecting = _chunkQSWCX5XIjs.c; exports.isCreating = _chunkQSWCX5XIjs.f; exports.isDisconnected = _chunkQSWCX5XIjs.d; exports.isNotCreated = _chunkQSWCX5XIjs.e; exports.isReconnecting = _chunkQSWCX5XIjs.b; exports.needsRecovery = _chunkQSWCX5XIjs.h; exports.useLinkWithPasskey = Y; exports.useLoginWithPasskey = ie; exports.useSignupWithPasskey = ge;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunkHNRKZKAWjs = require('./chunk-HNRKZKAW.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _react = require('react');var _jssdkcore = require('@privy-io/js-sdk-core');var Y=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),c=_react.useCallback.call(void 0, o=>{var n;let t=_chunkHNRKZKAWjs.h.call(void 0, o);return s({status:"error",error:t}),(n=e==null?void 0:e.onError)==null||n.call(e,t),t},[e==null?void 0:e.onError]);return{linkWithPasskey:_react.useCallback.call(void 0, n=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[n],function*({relyingParty:o,extra_options:t}){var u;try{if(!_chunkHNRKZKAWjs.b.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_link_passkey_before_logged_in",error:"Must be logged in to link a passkey."});s({status:"generating-challenege"});let{options:k}=yield a.auth.passkey.generateRegistrationOptions(o);s({status:"awaiting-passkey"});let y=yield _chunkHNRKZKAWjs.S.call(void 0, _chunkHNRKZKAWjs.U.call(void 0, k),t);s({status:"submitting-response"});let{user:m}=yield a.auth.passkey.linkWithPasskey(y,o);return s({status:"done"}),(u=e==null?void 0:e.onSuccess)==null||u.call(e,m),m}catch(r){throw c(r)}}),[a,c,e==null?void 0:e.onSuccess]),state:d}};var ie=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),c=_react.useCallback.call(void 0, o=>{var n;let t=_chunkHNRKZKAWjs.h.call(void 0, o);return s({status:"error",error:t}),(n=e==null?void 0:e.onError)==null||n.call(e,t),t},[e==null?void 0:e.onError]);return{loginWithPasskey:_react.useCallback.call(void 0, n=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[n],function*({relyingParty:o,extra_options:t}){var u,r,k,y;try{if(_chunkHNRKZKAWjs.b.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_login_with_passkey_while_already_logged_in",error:"Already logged in, use `useLinkWithPasskey` if you are trying to link a passkey to an existing account"});s({status:"generating-challenege"});let{options:i}=yield a.auth.passkey.generateAuthenticationOptions(o);s({status:"awaiting-passkey"});let f=yield _chunkHNRKZKAWjs.T.call(void 0, {challenge:i.challenge,rpId:i.rp_id,extensions:{appid:(u=i.extensions)==null?void 0:u.app_id,credProps:(r=i.extensions)==null?void 0:r.cred_props,hmacCreateSecret:(k=i.extensions)==null?void 0:k.hmac_create_secret},timeout:i.timeout,allowCredentials:i.allow_credentials,userVerification:i.user_verification},t);s({status:"submitting-response"});let l=_chunkHNRKZKAWjs.a.call(void 0, ),C=yield a.auth.passkey.loginWithPasskey(f,i.challenge,o,{embedded:l==null?void 0:l.embedded});return s({status:"done"}),(y=e==null?void 0:e.onSuccess)==null||y.call(e,C.user,C.is_new_user),C.user}catch(m){throw c(m)}}),[a,c,e==null?void 0:e.onSuccess]),state:d}};var ge=e=>{let{client:a,passkeyState:d,setPasskeyState:s}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),c=_react.useRef.call(void 0, e);_react.useEffect.call(void 0, ()=>{c.current=e},[e]);let S=_react.useCallback.call(void 0, t=>{var u,r;let n=_chunkHNRKZKAWjs.h.call(void 0, t);return s({status:"error",error:n}),(r=(u=c.current)==null?void 0:u.onError)==null||r.call(u,n),n},[s]);return{signupWithPasskey:_react.useCallback.call(void 0, u=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[u],function*({relyingParty:t,extra_options:n}){var r,k;try{if(_chunkHNRKZKAWjs.b.call(void 0, ))throw new (0, _jssdkcore.PrivyClientError)({code:"attempted_login_with_passkey_while_already_logged_in",error:"Already logged in, use `useLinkWithPasskey` if you are trying to link a passkey to an existing account"});s({status:"generating-challenege"});let{options:m}=yield a.auth.passkey.generateSignupOptions(t);s({status:"awaiting-passkey"});let i=yield _chunkHNRKZKAWjs.S.call(void 0, _chunkHNRKZKAWjs.U.call(void 0, m),n);s({status:"submitting-response"});let f=_chunkHNRKZKAWjs.a.call(void 0, ),l=yield a.auth.passkey.signupWithPasskey(i,t,{embedded:f==null?void 0:f.embedded});return s({status:"done"}),(k=(r=c.current)==null?void 0:r.onSuccess)==null||k.call(r,l.user,l.is_new_user),{user:l.user}}catch(y){throw S(y)}}),[a.auth.passkey,S,s]),state:d}};exports.hasError = _chunkQSWCX5XIjs.g; exports.isConnected = _chunkQSWCX5XIjs.a; exports.isConnecting = _chunkQSWCX5XIjs.c; exports.isCreating = _chunkQSWCX5XIjs.f; exports.isDisconnected = _chunkQSWCX5XIjs.d; exports.isNotCreated = _chunkQSWCX5XIjs.e; exports.isReconnecting = _chunkQSWCX5XIjs.b; exports.needsRecovery = _chunkQSWCX5XIjs.h; exports.useLinkWithPasskey = Y; exports.useLoginWithPasskey = ie; exports.useSignupWithPasskey = ge;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunk6GY37RNTjs = require('./chunk-6GY37RNT.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _jssdkcore = require('@privy-io/js-sdk-core');var _viem = require('viem');var _smartwallets = require('@privy-io/js-sdk-core/smart-wallets');var P=y=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[y],function*({chain:t,privyAppId:e,user:a,embeddedWallet:r,smartWalletsConfig:n,client:i,dataSuffix:c}){if(!(n!=null&&n.enabled)||!r||!_chunkQSWCX5XIjs.a.call(void 0, r))return;let s=yield i.embeddedWallet.getProvider(r.account),o=n==null?void 0:n.configured_networks.find(B=>B.chain_id===`eip155:${t.id}`);if(!o)throw new (0, _jssdkcore.PrivyClientError)({code:"chain_not_supported",error:`The chain ${t.name} (eip155:${t.id}) must be configured in the smart wallet configuration in your dashboard`});let l=_jssdkcore.getUserSmartWallet.call(void 0, a),C=l?l.smart_wallet_type:n.smart_wallet_type,W=l?l.smart_wallet_version:n.smart_wallet_version,F=_jssdkcore.getJsonRpcEndpointFromChain.call(void 0, t,{rpcUrls:[]},e),G=_viem.createPublicClient.call(void 0, {chain:t,transport:_viem.http.call(void 0, F)}),E=yield _smartwallets.signerToSmartAccountClient.call(void 0, {owner:s,smartWalletType:C,smartWalletVersion:W,chain:t,publicClient:G,paymasterContext:Q(o.paymaster_url,o.paymaster_context),bundlerUrl:o.bundler_url,paymasterUrl:o.paymaster_url});if(!E)throw new (0, _jssdkcore.PrivyClientError)({code:"smart_wallet_client_error",error:`Failed to create smart wallet client for chain ${t.name} (eip155:${t.id})`});return K(E,c)});function K(t,e){return e?t.extend(a=>({sendTransaction:r=>a.sendTransaction(_chunkK5SPDXVFjs.c.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {},r),{dataSuffix:e}))})):t}var V=/paymaster\.biconomy\.io\/api/i;function q(t){return V.test(t)}var z={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}},Q=(t,e)=>{if(t&&q(t))return z;if(e&&e.policy_id)return{policyId:e.policy_id}};var U=3,tt=500,et= exports.SmartWalletsProvider =({children:t})=>_react2.default.createElement(at,null,_react2.default.createElement(it,null,_react2.default.createElement(lt,null,t))),D=_react.createContext.call(void 0, {config:void 0}),b=()=>{let{config:t}=_react.useContext.call(void 0, D);return{config:t}},R=_react.createContext.call(void 0, {smartWalletClient:void 0}),rt=()=>{let{smartWalletClient:t}=_react.useContext.call(void 0, R);return{smartWalletClient:t}},$=_react.createContext.call(void 0, {client:void 0}),nt= exports.useSmartWallets =()=>{let{client:t}=_react.useContext.call(void 0, $),e=ot();return{client:t,getClientForChain:e}},at=({children:t})=>{let[e,a]=_react.useState.call(void 0, void 0),r=_chunk6GY37RNTjs.m.call(void 0, );return _react.useEffect.call(void 0, ()=>{!e&&r&&(()=>_chunkK5SPDXVFjs.e.call(void 0, void 0,null,function*(){try{if(!r){console.warn("No client found");return}let i=yield r.app.getSmartWalletConfig();a(i)}catch(i){console.warn("Error generating smart wallet config: ",i)}}))()},[r,e]),_react2.default.createElement(D.Provider,{value:{config:e}},t)},it=({children:t})=>{let{config:e}=b(),{client:a,wallet:r}=_react.useContext.call(void 0, _chunk6GY37RNTjs.ka),n=_chunk6GY37RNTjs.d.call(void 0, ),[i,c]=_react.useState.call(void 0, );return _react.useEffect.call(void 0, ()=>{(()=>_chunkK5SPDXVFjs.e.call(void 0, void 0,null,function*(){var l;if(!n&&i&&c(void 0),!(e!=null&&e.enabled)||!n||r.status!=="connected"||n&&i&&r.status==="connected")return;let s=a.embeddedWallet.chains.find(C=>e.configured_networks.map(W=>W.chain_id).includes(`eip155:${C.id}`));if(!s)throw new (0, _jssdkcore.PrivyClientError)({error:"Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.",code:"chain_not_supported"});let o=yield P({chain:s,privyAppId:a.app.appId,user:n,embeddedWallet:r,smartWalletsConfig:e,client:a,dataSuffix:(l=_jssdkcore.getDataSuffixPlugin.call(void 0, a.plugins))==null?void 0:l.suffix});if(!o)throw new (0, _jssdkcore.PrivyClientError)({error:"Could not create smart wallet client",code:"smart_wallet_client_error"});c(o)}))()},[!!(e!=null&&e.enabled),!!a,!!n,r.status]),_react2.default.createElement(R.Provider,{value:{smartWalletClient:i}},t)},lt=({children:t})=>{let{client:e,wallet:a}=_react.useContext.call(void 0, _chunk6GY37RNTjs.ka),r=_chunk6GY37RNTjs.d.call(void 0, ),{smartWalletClient:n}=rt(),{config:i}=b();return _react.useEffect.call(void 0, ()=>{let c=!1;return(()=>_chunkK5SPDXVFjs.e.call(void 0, void 0,null,function*(){var d;if(!(!n||!r||_jssdkcore.getUserSmartWallet.call(void 0, r)||!(i!=null&&i.enabled)||a.status!=="connected"))for(let s=0;s<U;s++){if(c||_jssdkcore.getUserSmartWallet.call(void 0, (d=_chunk6GY37RNTjs.b.call(void 0, ))!=null?d:r))return;let o=!1;for(let l=0;l<5;l++){if(c)return;if(yield e.embeddedWallet.ping(tt)){o=!0;break}yield _chunk6GY37RNTjs.i.call(void 0, 200*_chunkK5SPDXVFjs.a.call(void 0, 2,l))}if(o)try{let{message:l}=yield e.auth.smartWallet.init({address:n.account.address,chainId:`eip155:${n.chain.id}`}),C=yield n.signMessage({message:l});yield e.auth.smartWallet.link(l,C,i.smart_wallet_type,i.smart_wallet_version);return}catch(l){s===U-1?console.error("Error creating smart wallet:",l):yield _chunk6GY37RNTjs.i.call(void 0, 500*_chunkK5SPDXVFjs.a.call(void 0, 2,s))}}}))(),()=>{c=!0}},[!!n,!!r,!!_jssdkcore.getUserSmartWallet.call(void 0, r),i,a.status]),_react2.default.createElement($.Provider,{value:{client:_jssdkcore.getUserSmartWallet.call(void 0, r)?n:void 0}},t)},ot=()=>{let{client:t,wallet:e}=_react.useContext.call(void 0, _chunk6GY37RNTjs.ka),{config:a}=b();return _react.useCallback.call(void 0, n=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[n],function*({chainId:r}){var s;let i=_chunk6GY37RNTjs.b.call(void 0, );if(!i)throw new (0, _jssdkcore.PrivyClientError)({error:"Must be logged in to get a smart wallet client",code:"smart_wallet_client_error"});if(!a||!a.enabled)throw new (0, _jssdkcore.PrivyClientError)({error:"Must have smart wallets enabled to get a smart wallet client",code:"smart_wallet_client_error"});let y=t.embeddedWallet.chains.find(o=>o.id===r);if(!y)throw new (0, _jssdkcore.PrivyClientError)({error:`Could not find chain with id: ${r}`,code:"chain_not_supported"});let d=yield P({chain:y,privyAppId:t.app.appId,user:i,embeddedWallet:e,smartWalletsConfig:a,client:t,dataSuffix:(s=_jssdkcore.getDataSuffixPlugin.call(void 0, t.plugins))==null?void 0:s.suffix});if(!d)throw new (0, _jssdkcore.PrivyClientError)({error:`Could not create smart wallet client for chain ${r}`,code:"smart_wallet_client_error"});return d}),[a,e,t])};exports.SmartWalletsProvider = et; exports.useSmartWallets = nt;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkQSWCX5XIjs = require('./chunk-QSWCX5XI.js');var _chunkHNRKZKAWjs = require('./chunk-HNRKZKAW.js');var _chunkK5SPDXVFjs = require('./chunk-K5SPDXVF.js');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _jssdkcore = require('@privy-io/js-sdk-core');var _viem = require('viem');var _smartwallets = require('@privy-io/js-sdk-core/smart-wallets');var P=y=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[y],function*({chain:t,privyAppId:e,user:a,embeddedWallet:r,smartWalletsConfig:n,client:i,dataSuffix:c}){if(!(n!=null&&n.enabled)||!r||!_chunkQSWCX5XIjs.a.call(void 0, r))return;let s=yield i.embeddedWallet.getProvider(r.account),o=n==null?void 0:n.configured_networks.find(B=>B.chain_id===`eip155:${t.id}`);if(!o)throw new (0, _jssdkcore.PrivyClientError)({code:"chain_not_supported",error:`The chain ${t.name} (eip155:${t.id}) must be configured in the smart wallet configuration in your dashboard`});let l=_jssdkcore.getUserSmartWallet.call(void 0, a),C=l?l.smart_wallet_type:n.smart_wallet_type,W=l?l.smart_wallet_version:n.smart_wallet_version,F=_jssdkcore.getJsonRpcEndpointFromChain.call(void 0, t,{rpcUrls:[]},e),G=_viem.createPublicClient.call(void 0, {chain:t,transport:_viem.http.call(void 0, F)}),E=yield _smartwallets.signerToSmartAccountClient.call(void 0, {owner:s,smartWalletType:C,smartWalletVersion:W,chain:t,publicClient:G,paymasterContext:Q(o.paymaster_url,o.paymaster_context),bundlerUrl:o.bundler_url,paymasterUrl:o.paymaster_url});if(!E)throw new (0, _jssdkcore.PrivyClientError)({code:"smart_wallet_client_error",error:`Failed to create smart wallet client for chain ${t.name} (eip155:${t.id})`});return K(E,c)});function K(t,e){return e?t.extend(a=>({sendTransaction:r=>a.sendTransaction(_chunkK5SPDXVFjs.c.call(void 0, _chunkK5SPDXVFjs.b.call(void 0, {},r),{dataSuffix:e}))})):t}var V=/paymaster\.biconomy\.io\/api/i;function q(t){return V.test(t)}var z={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}},Q=(t,e)=>{if(t&&q(t))return z;if(e&&e.policy_id)return{policyId:e.policy_id}};var U=3,tt=500,et= exports.SmartWalletsProvider =({children:t})=>_react2.default.createElement(at,null,_react2.default.createElement(it,null,_react2.default.createElement(lt,null,t))),D=_react.createContext.call(void 0, {config:void 0}),b=()=>{let{config:t}=_react.useContext.call(void 0, D);return{config:t}},R=_react.createContext.call(void 0, {smartWalletClient:void 0}),rt=()=>{let{smartWalletClient:t}=_react.useContext.call(void 0, R);return{smartWalletClient:t}},$=_react.createContext.call(void 0, {client:void 0}),nt= exports.useSmartWallets =()=>{let{client:t}=_react.useContext.call(void 0, $),e=ot();return{client:t,getClientForChain:e}},at=({children:t})=>{let[e,a]=_react.useState.call(void 0, void 0),r=_chunkHNRKZKAWjs.m.call(void 0, );return _react.useEffect.call(void 0, ()=>{!e&&r&&(()=>_chunkK5SPDXVFjs.e.call(void 0, void 0,null,function*(){try{if(!r){console.warn("No client found");return}let i=yield r.app.getSmartWalletConfig();a(i)}catch(i){console.warn("Error generating smart wallet config: ",i)}}))()},[r,e]),_react2.default.createElement(D.Provider,{value:{config:e}},t)},it=({children:t})=>{let{config:e}=b(),{client:a,wallet:r}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),n=_chunkHNRKZKAWjs.d.call(void 0, ),[i,c]=_react.useState.call(void 0, );return _react.useEffect.call(void 0, ()=>{(()=>_chunkK5SPDXVFjs.e.call(void 0, void 0,null,function*(){var l;if(!n&&i&&c(void 0),!(e!=null&&e.enabled)||!n||r.status!=="connected"||n&&i&&r.status==="connected")return;let s=a.embeddedWallet.chains.find(C=>e.configured_networks.map(W=>W.chain_id).includes(`eip155:${C.id}`));if(!s)throw new (0, _jssdkcore.PrivyClientError)({error:"Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.",code:"chain_not_supported"});let o=yield P({chain:s,privyAppId:a.app.appId,user:n,embeddedWallet:r,smartWalletsConfig:e,client:a,dataSuffix:(l=_jssdkcore.getDataSuffixPlugin.call(void 0, a.plugins))==null?void 0:l.suffix});if(!o)throw new (0, _jssdkcore.PrivyClientError)({error:"Could not create smart wallet client",code:"smart_wallet_client_error"});c(o)}))()},[!!(e!=null&&e.enabled),!!a,!!n,r.status]),_react2.default.createElement(R.Provider,{value:{smartWalletClient:i}},t)},lt=({children:t})=>{let{client:e,wallet:a}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),r=_chunkHNRKZKAWjs.d.call(void 0, ),{smartWalletClient:n}=rt(),{config:i}=b();return _react.useEffect.call(void 0, ()=>{let c=!1;return(()=>_chunkK5SPDXVFjs.e.call(void 0, void 0,null,function*(){var d;if(!(!n||!r||_jssdkcore.getUserSmartWallet.call(void 0, r)||!(i!=null&&i.enabled)||a.status!=="connected"))for(let s=0;s<U;s++){if(c||_jssdkcore.getUserSmartWallet.call(void 0, (d=_chunkHNRKZKAWjs.b.call(void 0, ))!=null?d:r))return;let o=!1;for(let l=0;l<5;l++){if(c)return;if(yield e.embeddedWallet.ping(tt)){o=!0;break}yield _chunkHNRKZKAWjs.i.call(void 0, 200*_chunkK5SPDXVFjs.a.call(void 0, 2,l))}if(o)try{let{message:l}=yield e.auth.smartWallet.init({address:n.account.address,chainId:`eip155:${n.chain.id}`}),C=yield n.signMessage({message:l});yield e.auth.smartWallet.link(l,C,i.smart_wallet_type,i.smart_wallet_version);return}catch(l){s===U-1?console.error("Error creating smart wallet:",l):yield _chunkHNRKZKAWjs.i.call(void 0, 500*_chunkK5SPDXVFjs.a.call(void 0, 2,s))}}}))(),()=>{c=!0}},[!!n,!!r,!!_jssdkcore.getUserSmartWallet.call(void 0, r),i,a.status]),_react2.default.createElement($.Provider,{value:{client:_jssdkcore.getUserSmartWallet.call(void 0, r)?n:void 0}},t)},ot=()=>{let{client:t,wallet:e}=_react.useContext.call(void 0, _chunkHNRKZKAWjs.ka),{config:a}=b();return _react.useCallback.call(void 0, n=>_chunkK5SPDXVFjs.e.call(void 0, void 0,[n],function*({chainId:r}){var s;let i=_chunkHNRKZKAWjs.b.call(void 0, );if(!i)throw new (0, _jssdkcore.PrivyClientError)({error:"Must be logged in to get a smart wallet client",code:"smart_wallet_client_error"});if(!a||!a.enabled)throw new (0, _jssdkcore.PrivyClientError)({error:"Must have smart wallets enabled to get a smart wallet client",code:"smart_wallet_client_error"});let y=t.embeddedWallet.chains.find(o=>o.id===r);if(!y)throw new (0, _jssdkcore.PrivyClientError)({error:`Could not find chain with id: ${r}`,code:"chain_not_supported"});let d=yield P({chain:y,privyAppId:t.app.appId,user:i,embeddedWallet:e,smartWalletsConfig:a,client:t,dataSuffix:(s=_jssdkcore.getDataSuffixPlugin.call(void 0, t.plugins))==null?void 0:s.suffix});if(!d)throw new (0, _jssdkcore.PrivyClientError)({error:`Could not create smart wallet client for chain ${r}`,code:"smart_wallet_client_error"});return d}),[a,e,t])};exports.SmartWalletsProvider = et; exports.useSmartWallets = nt;