@privy-io/react-auth 1.95.3 → 1.95.4

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 (27) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/{context-Unj5mD8K.js → context-DDxZLdBi.js} +1 -1
  3. package/dist/cjs/{getEmbeddedConnectedWallet-DMZM38WV.js → getEmbeddedConnectedWallet-BSvFUzUt.js} +1 -1
  4. package/dist/cjs/index.js +174 -174
  5. package/dist/cjs/{smart-wallets-D_pDHYlr.js → smart-wallets-BZJXF_7K.js} +1 -1
  6. package/dist/cjs/smart-wallets.js +1 -1
  7. package/dist/cjs/ui.js +1 -1
  8. package/dist/cjs/{useFundWallet-BIeYj1if.js → useFundWallet-CHLP6mJz.js} +2 -2
  9. package/dist/dts/index.d.mts +4 -4
  10. package/dist/dts/index.d.ts +4 -4
  11. package/dist/dts/{solana-ByUtVSFD.d.mts → solana-qFDiMVem.d.mts} +1 -1
  12. package/dist/dts/{solana-ByUtVSFD.d.ts → solana-qFDiMVem.d.ts} +1 -1
  13. package/dist/dts/solana.d.mts +2 -2
  14. package/dist/dts/solana.d.ts +2 -2
  15. package/dist/dts/{types-CJoUyidF.d.mts → types-qQSMnxsi.d.mts} +6 -0
  16. package/dist/dts/{types-CJoUyidF.d.ts → types-qQSMnxsi.d.ts} +6 -0
  17. package/dist/dts/ui.d.mts +1 -1
  18. package/dist/dts/ui.d.ts +1 -1
  19. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  20. package/dist/esm/{context-BXivPMz8.mjs → context-DKEKRqPy.mjs} +1 -1
  21. package/dist/esm/{getEmbeddedConnectedWallet-ComEChZh.mjs → getEmbeddedConnectedWallet-BlqPeSFk.mjs} +1 -1
  22. package/dist/esm/index.mjs +315 -315
  23. package/dist/esm/{smart-wallets-Cf_4SaVH.mjs → smart-wallets-BBSoh3Z1.mjs} +1 -1
  24. package/dist/esm/smart-wallets.mjs +1 -1
  25. package/dist/esm/ui.mjs +1 -1
  26. package/dist/esm/{useFundWallet-CQLW4Zdx.mjs → useFundWallet-BLbOcKe5.mjs} +4 -4
  27. package/package.json +1 -1
@@ -1 +1 @@
1
- import{useRef as e,useState as t,useCallback as a}from"react";import{http as n,createPublicClient as r}from"viem";import{h as i}from"./user-EiUNCG17.mjs";import{U as o,A as s}from"./context-BXivPMz8.mjs";import{P as l,u as c,h as p,l as d}from"./useWallets-BfKlC62m.mjs";import{u,g as _,M as m}from"./getEmbeddedConnectedWallet-ComEChZh.mjs";import{createSmartAccountClient as g}from"permissionless";import{toLightSmartAccount as b,toBiconomySmartAccount as h,toEcdsaKernelSmartAccount as y,toSafeSmartAccount as v}from"permissionless/accounts";import{createPimlicoClient as I}from"permissionless/clients/pimlico";import{toCoinbaseSmartAccount as f,entryPoint06Address as S,entryPoint07Address as T}from"viem/account-abstraction";import E,{z as A}from"zod";import k from"bs58";import{ethers as O}from"ethers";import{parsePhoneNumber as P}from"libphonenumber-js/max";let j;var w=((j=w||{}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",j.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",j.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",j.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",j.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",j.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",j.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",j.INVALID_DATA="invalid_data",j.INVALID_CREDENTIALS="invalid_credentials",j.INVALID_CAPTCHA="invalid_captcha",j.LINKED_TO_ANOTHER_USER="linked_to_another_user",j.ALLOWLIST_REJECTED="allowlist_rejected",j.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",j.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",j.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",j.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",j.TOO_MANY_REQUESTS="too_many_requests",j.INVALID_ORIGIN="invalid_origin",j.MISSING_ORIGIN="missing_origin",j.INVALID_NATIVE_APP_ID="invalid_native_app_id",j.TOKEN_ALREADY_USED="token_already_used",j.ALREADY_LOGGED_OUT="already_logged_out",j.NOT_SUPPORTED="not_supported",j.USER_UNSUBSCRIBED="user_unsubscribed",j.MAX_APPS_REACHED="max_apps_reached",j.USER_LIMIT_REACHED="max_accounts_reached",j.DEVICE_REVOKED="device_revoked",j.WALLET_PASSWORD_EXISTS="wallet_password_exists",j.OAUTH_STATE_MISMATCH="oauth_state_mismatch",j.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",j.DISALLOWED_LOGIN_METHOD="disallowed_login_method",j.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",j.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",j.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",j.CANNOT_SET_PASSWORD="cannot_set_password",j.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",j.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",j.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",j.USER_DOES_NOT_EXIST="user_does_not_exist",j.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",j.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",j.FEATURE_NOT_ENABLED="feature_not_enabled",j.INSUFFICIENT_FUNDS="insufficient_funds",j.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",j),C=class extends Error{toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a,n){super(t),this.code=a,this.status=e,this.responseData=n}},R=class extends C{constructor(e,t){super(400,e,t||"invalid_data")}},D=class extends C{constructor(e,t){super(401,e,t)}},N=class extends C{constructor(e,t){super(422,e,t)}};function U(e,t){return Object.keys(t).forEach((function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[a]}})})),e}function L(e,t,a,n){Object.defineProperty(e,t,{get:a,set:n,enumerable:!0,configurable:!0})}A.object({error:A.string(),cause:A.string().optional(),code:A.nativeEnum(w).optional()});var M={},W={};L(W,"AnalyticsEvent",(()=>x));let x={path:"/api/v1/analytics_events",method:"POST"};var F={};L(F,"AppConfig",(()=>G));let G={path:"/api/v1/apps/:app_id",method:"GET"};var V={};L(V,"CoinbaseOnRampInit",(()=>B)),L(V,"CoinbaseOnRampStatus",(()=>H));let B={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},H={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"};var Y={};L(Y,"GetCrossAppConnections",(()=>q));let q={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"};var K={};L(K,"CustomJWTAuthenticate",(()=>$));let $={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"};var z={};L(z,"FarcasterInit",(()=>X)),L(z,"FarcasterAuthenticate",(()=>J)),L(z,"FarcasterLink",(()=>Q)),L(z,"FarcasterUnlink",(()=>Z)),L(z,"FarcasterStatus",(()=>ee)),L(z,"FarcasterV2Init",(()=>te)),L(z,"FarcasterV2Authenticate",(()=>ae));let X={path:"/api/v1/farcaster/init",method:"POST"},J={path:"/api/v1/farcaster/authenticate",method:"POST"},Q={path:"/api/v1/farcaster/link",method:"POST"},Z={path:"/api/v1/farcaster/unlink",method:"POST"},ee={path:"/api/v1/farcaster/status",method:"GET"},te={path:"/api/v2/farcaster/init",method:"POST"},ae={path:"/api/v2/farcaster/authenticate",method:"POST"};var ne={};L(ne,"FarcasterSignerInit",(()=>re)),L(ne,"FarcasterSignerStatus",(()=>ie));let re={path:"/api/v1/farcaster/signer/init",method:"POST"},ie={path:"/api/v1/farcaster/signer/status",method:"POST"};var oe={};L(oe,"GuestAuthenticate",(()=>se));let se={path:"/api/v1/guest/authenticate",method:"POST"};var le={};L(le,"MfaPasskeyInit",(()=>ce)),L(le,"MfaPasskeyVerify",(()=>pe)),L(le,"MfaPasskeyEnrollment",(()=>de));let ce={path:"/api/v1/mfa/passkeys/init",method:"POST"},pe={path:"/api/v1/mfa/passkeys/verify",method:"POST"},de={path:"/api/v1/mfa/passkeys/enrollment",method:"POST"};var ue={};L(ue,"MfaPasswordlessSmsEnroll",(()=>_e)),L(ue,"MfaPasswordlessSmsVerify",(()=>me)),L(ue,"MfaPasswordlessSmsInit",(()=>ge)),L(ue,"MfaPasswordlessSmsUnenroll",(()=>be));let _e={path:"/api/v1/mfa/passwordless_sms/enroll",method:"POST"},me={path:"/api/v1/mfa/passwordless_sms/verify",method:"POST"},ge={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},be={path:"/api/v1/mfa/passwordless_sms/unenroll",method:"POST"};var he={};L(he,"MfaTotpEnroll",(()=>ye)),L(he,"MfaTotpVerify",(()=>ve)),L(he,"MfaTotpInit",(()=>Ie)),L(he,"MfaTotpUnenroll",(()=>fe));let ye={path:"/api/v1/mfa/totp/enroll",method:"POST"},ve={path:"/api/v1/mfa/totp/verify",method:"POST"},Ie={path:"/api/v1/mfa/totp/init",method:"POST"},fe={path:"/api/v1/mfa/totp/unenroll",method:"POST"};var Se={};L(Se,"OAuthAuthenticate",(()=>Te)),L(Se,"OAuthInit",(()=>Ee)),L(Se,"OAuthLink",(()=>Ae)),L(Se,"OAuthUnlink",(()=>ke));let Te={path:"/api/v1/oauth/authenticate",method:"POST"},Ee={path:"/api/v1/oauth/init",method:"POST"},Ae={path:"/api/v1/oauth/link",method:"POST"},ke={path:"/api/v1/oauth/unlink",method:"POST"};var Oe={};L(Oe,"OAuthProviderAuthorize",(()=>Pe)),L(Oe,"OAuthProviderVerify",(()=>je));let Pe={path:"/oauth/authorization_code",method:"POST"},je={path:"/oauth/verify",method:"POST"};var we={};L(we,"PasskeyLink",(()=>Ce)),L(we,"PasskeyAuthenticate",(()=>Re)),L(we,"PasskeyAuthenticateInit",(()=>De)),L(we,"PasskeyLinkInit",(()=>Ne)),L(we,"PasskeyUnlink",(()=>Ue));let Ce={path:"/api/v1/passkeys/link",method:"POST"},Re={path:"/api/v1/passkeys/authenticate",method:"POST"},De={path:"/api/v1/passkeys/authenticate/init",method:"POST"},Ne={path:"/api/v1/passkeys/link/init",method:"POST"},Ue={path:"/api/v1/passkeys/unlink",method:"POST"};var Le={};L(Le,"PasswordlessAuthenticate",(()=>Me)),L(Le,"PasswordlessInit",(()=>We)),L(Le,"PasswordlessLink",(()=>xe)),L(Le,"PasswordlessUnlink",(()=>Fe)),L(Le,"PasswordlessUpdate",(()=>Ge));let Me={path:"/api/v1/passwordless/authenticate",method:"POST"},We={path:"/api/v1/passwordless/init",method:"POST"},xe={path:"/api/v1/passwordless/link",method:"POST"},Fe={path:"/api/v1/passwordless/unlink",method:"POST"},Ge={path:"/api/v1/passwordless/update",method:"POST"};var Ve={};L(Ve,"PasswordlessSmsAuthenticate",(()=>Be)),L(Ve,"PasswordlessSmsInit",(()=>He)),L(Ve,"PasswordlessSmsLink",(()=>Ye)),L(Ve,"PasswordlessSmsUnlink",(()=>qe)),L(Ve,"PasswordlessSmsUpdate",(()=>Ke));let Be={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},He={path:"/api/v1/passwordless_sms/init",method:"POST"},Ye={path:"/api/v1/passwordless_sms/link",method:"POST"},qe={path:"/api/v1/passwordless_sms/unlink",method:"POST"},Ke={path:"/api/v1/passwordless_sms/update",method:"POST"};var $e={};L($e,"RecoveryKeyMaterial",(()=>ze)),L($e,"RecoveryOAuthInit",(()=>Xe)),L($e,"RecoveryOAuthAuthenticate",(()=>Je)),L($e,"RecoveryOAuthInitICloud",(()=>Qe)),L($e,"RecoveryOAuthCallbackICloudExpo",(()=>Ze)),L($e,"RecoveryConfigurationICloud",(()=>et));let ze={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},Xe={path:"/api/v1/recovery/oauth/init",method:"POST"},Je={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},Qe={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},Ze={path:"/api/v1/recovery/oauth/callback_icloud/:app_id/expo_ios",method:"GET"},et={path:"/api/v1/recovery/configuration_icloud",method:"POST"};var tt={};L(tt,"getPathWithParams",(()=>at));let at=(e,t)=>t?Object.entries(t).reduce(((e,[t,a])=>e.replace(`:${t}`,`${a}`)),e):e;var nt={};L(nt,"RefreshSession",(()=>rt)),L(nt,"Logout",(()=>it));let rt={path:"/api/v1/sessions",method:"POST"},it={path:"/api/v1/sessions/logout",method:"POST"};var ot={};L(ot,"GetSmartWalletConfig",(()=>st)),L(ot,"PostSmartWalletConfig",(()=>lt));let st={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},lt={path:"/api/v1/apps/:app_id/smart_wallets",method:"POST"};var ct={};L(ct,"SiweInit",(()=>pt)),L(ct,"SiweAuthenticate",(()=>dt)),L(ct,"SiweLink",(()=>ut)),L(ct,"SiweLinkSmartWallet",(()=>_t)),L(ct,"SiweUnlink",(()=>mt));let pt={path:"/api/v1/siwe/init",method:"POST"},dt={path:"/api/v1/siwe/authenticate",method:"POST"},ut={path:"/api/v1/siwe/link",method:"POST"},_t={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},mt={path:"/api/v1/siwe/unlink",method:"POST"};var gt={};L(gt,"SiwsInit",(()=>bt)),L(gt,"SiwsAuthenticate",(()=>ht)),L(gt,"SiwsLink",(()=>yt)),L(gt,"SiwsUnlink",(()=>vt));let bt={path:"/api/v1/siws/init",method:"POST"},ht={path:"/api/v1/siws/authenticate",method:"POST"},yt={path:"/api/v1/siws/link",method:"POST"},vt={path:"/api/v1/siws/unlink",method:"POST"};var It={};L(It,"AcceptTermsOnUser",(()=>ft));let ft={path:"/api/v1/users/me/accept_terms",method:"POST"};var St={};L(St,"TelegramAuthenticate",(()=>Tt)),L(St,"TelegramLink",(()=>Et)),L(St,"TelegramUnlink",(()=>At));let Tt={path:"/api/v1/telegram/authenticate",method:"POST"},Et={path:"/api/v1/telegram/link",method:"POST"},At={path:"/api/v1/telegram/unlink",method:"POST"};var kt={};L(kt,"MoonpayOnRampSign",(()=>Ot));let Ot={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"};U(M,W),U(M,F),U(M,V),U(M,Y),U(M,K),U(M,z),U(M,ne),U(M,oe),U(M,le),U(M,ue),U(M,he),U(M,Se),U(M,Oe),U(M,we),U(M,Le),U(M,Ve),U(M,$e),U(M,tt),U(M,nt),U(M,ot),U(M,ct),U(M,gt),U(M,It),U(M,St),U(M,kt);var Pt={},jt={};L(jt,"AnalyticsEventInput",(()=>wt));let wt=A.object({event_name:A.string().max(255),client_id:A.string().max(255).nullable(),payload:A.record(A.any()).optional()});var Ct={};L(Ct,"AccountIdFromPath",(()=>Bt)),L(Ct,"AppIdFromPath",(()=>Ht)),L(Ct,"Pagination",(()=>Yt));var Rt={};L(Rt,"UserId",(()=>Dt)),L(Rt,"Email",(()=>Nt)),L(Rt,"PasswordlessCode",(()=>Ut)),L(Rt,"WalletAddress",(()=>Lt)),L(Rt,"normalizeEthereumAddress",(()=>Gt)),L(Rt,"SolanaWalletAddress",(()=>Mt)),L(Rt,"PhoneNumber",(()=>Wt)),L(Rt,"normalizePhoneNumber",(()=>xt)),L(Rt,"isValidAddress",(()=>Ft)),L(Rt,"AuthenticateMode",(()=>Vt));let Dt=A.string({required_error:"Privy DID must be included",invalid_type_error:"Privy DID is not a valid string"}).min(1).transform((e=>e.replace("did:privy:",""))),Nt=A.string({required_error:"Email address must be provided",invalid_type_error:"Email address must be a valid string"}).email("Invalid email address").transform((e=>e.toLowerCase())),Ut=A.string({required_error:"Verification code must be provided",invalid_type_error:"Invalid verification code"}).length(6,"Verification code must have 6 digits."),Lt=A.string({required_error:"Ethereum address must be provided",invalid_type_error:"Invalid Ethereum address"}).transform(((e,t)=>Gt(e)||(t.addIssue({code:A.ZodIssueCode.custom,message:"Invalid Ethereum address"}),A.NEVER))),Mt=A.string({required_error:"Solana address must be provided",invalid_type_error:"Invalid Solana address"}).trim().transform(((e,t)=>{try{k.decode(e)}catch(e){return t.addIssue({code:A.ZodIssueCode.custom,message:"Invalid Solana address"}),A.NEVER}return e})),Wt=A.string({required_error:"Phone number must be included",invalid_type_error:"Phone number is not a valid string"}).refine((e=>{try{return void 0!==xt(e)}catch(e){return!1}}),{message:"Phone number is not valid"}).transform((e=>xt(e)||""));function xt(e){let t=P(e,"US");if(t?.isPossible())return t.formatInternational()}function Ft(e){return!!Gt(e)}function Gt(e){if("string"==typeof e)try{return O.utils.getAddress(e.trim())}catch(e){}}let Vt=A.object({mode:A.enum(["no-signup","login-or-sign-up"]).optional()}),Bt=A.object({account_id:A.string({required_error:"Account ID must be provided",invalid_type_error:"Account ID is not a valid string"}).min(1)}),Ht=A.object({app_id:A.string({required_error:"App ID must be provided",invalid_type_error:"App ID is not a valid string"}).min(1)}).transform((({app_id:e})=>({app_id:e,appId:e}))).catch((({error:e})=>{throw new R(e.message,w.MISSING_OR_INVALID_PRIVY_APP_ID)})),Yt=A.object({cursor:Dt.optional(),limit:A.coerce.number().max(100,{message:"Query limit can be at maximum 100 records."}).optional()});var qt={};L(qt,"AppResponseSchema",(()=>ta));var Kt={};L(Kt,"EmbeddedWalletConfigSchema",(()=>Xt)),L(Kt,"TelegramAuthConfigSchema",(()=>Jt)),L(Kt,"FundingMethodEnum",(()=>Qt)),L(Kt,"FundingMethodArraySchema",(()=>Zt)),L(Kt,"FundingConfigResponseSchema",(()=>ea));var $t={};L($t,"Currency",(()=>zt));let zt=E.object({chain:E.string(),asset:E.enum(["native-currency","USDC"]).optional()}),Xt=E.object({create_on_login:E.enum(["users-without-wallets","all-users","off"]),user_owned_recovery_options:E.array(E.enum(["user-passcode","google-drive","icloud"])),require_user_owned_recovery_on_create:E.boolean().optional(),require_user_password_on_create:E.boolean().optional()}),Jt=E.object({bot_id:E.string(),bot_name:E.string(),link_enabled:E.boolean(),seamless_auth_enabled:E.boolean()}),Qt=E.enum(["moonpay","coinbase-onramp","external"]),Zt=E.array(Qt),ea=E.object({default_recommended_currency:zt,default_recommended_amount:E.string(),methods:Zt,options:E.array(E.object({method:E.string(),provider:E.string()})),prompt_funding_on_wallet_creation:E.boolean(),cross_chain_bridging_enabled:E.boolean()}),ta=A.object({id:A.string(),name:A.string(),logo_url:A.string().nullable(),icon_url:A.string().nullable(),terms_and_conditions_url:A.string().nullable(),privacy_policy_url:A.string().nullable(),require_users_accept_terms:A.boolean().nullable(),theme:A.string(),accent_color:A.string().nullable(),show_wallet_login_first:A.boolean(),allowed_domains:A.array(A.string()),allowed_native_app_ids:A.array(A.string()),allowed_native_app_url_schemes:A.array(A.string()),wallet_auth:A.boolean(),email_auth:A.boolean(),sms_auth:A.boolean(),google_oauth:A.boolean(),twitter_oauth:A.boolean(),discord_oauth:A.boolean(),github_oauth:A.boolean(),spotify_oauth:A.boolean(),instagram_oauth:A.boolean(),tiktok_oauth:A.boolean(),linkedin_oauth:A.boolean(),apple_oauth:A.boolean(),farcaster_auth:A.boolean(),passkey_auth:A.boolean(),telegram_auth:A.boolean(),guest_auth:A.boolean(),solana_wallet_auth:A.boolean(),disable_plus_emails:A.boolean(),allowlist_enabled:A.boolean(),allowlist_config:A.object({error_title:A.string().nullable(),error_detail:A.string().nullable(),cta_text:A.string().nullable(),cta_link:A.string().nullable()}),wallet_connect_cloud_project_id:A.string().nullable(),custom_api_url:A.string().nullable(),embedded_wallet_config:Xt,enforce_wallet_uis:A.boolean(),legacy_wallet_ui_config:A.boolean(),fiat_on_ramp_enabled:A.boolean(),captcha_enabled:A.boolean(),twitter_oauth_on_mobile_enabled:A.boolean(),mfa_methods:A.array(A.enum(["sms","totp","passkey"])),captcha_site_key:A.string().optional(),verification_key:A.string(),telegram_auth_config:Jt.optional(),funding_config:ea.optional(),max_linked_wallets_per_user:A.number().nullable(),farcaster_link_wallets_enabled:A.boolean()});var aa={};L(aa,"CoinbaseOnRampInitInput",(()=>la)),L(aa,"CoinbaseOnRampInitResponse",(()=>ca)),L(aa,"CoinbaseOnRampStatusResponse",(()=>pa));let na=A.enum(["ethereum","bitcoin","base","avacchain","optimism","solana","polygon","arbitrum","stellar"]),ra=A.enum(["eth","ETH","USDC"]).transform((e=>e.toUpperCase())),ia=A.enum(["SOL","USDC"]).transform((e=>e.toUpperCase())),oa=A.object({addresses:A.array(A.object({address:Lt,blockchains:A.array(na)})).max(1).min(1),assets:A.array(ra).optional()}),sa=A.object({addresses:A.array(A.object({address:Mt,blockchains:A.array(na)})).max(1).min(1),assets:A.array(ia).optional()}),la=A.union([oa,sa]),ca=A.object({app_id:A.string(),session_token:A.string(),channel_id:A.string(),partner_user_id:A.string()}),pa=A.object({status:A.enum(["pending","success","failure"])});var da={};L(da,"CrossAppConnectionsResponse",(()=>ua));let ua=A.object({connections:A.array(A.object({provider_app_id:A.string(),provider_app_name:A.string(),provider_app_icon_url:A.string().url().nullable(),provider_app_custom_api_url:A.string().url().nullable(),read_only:A.boolean()}))});var _a={};L(_a,"AuthenticateJwtInput",(()=>ma));let ma=E.object({token:E.string().optional()});var ga={};L(ga,"VerifyEmailInput",(()=>ha)),L(ga,"AuthenticateEmailInput",(()=>ya)),L(ga,"InitEmailInput",(()=>va)),L(ga,"UnlinkEmailInput",(()=>Ia)),L(ga,"UpdateEmailInput",(()=>fa)),L(ga,"TransferEmailInput",(()=>Sa));let ba=A.object({nonce:A.string()}),ha=A.object({code:Ut,email:Nt}),ya=ha.merge(Vt),va=A.object({email:Nt,token:A.string().optional()}),Ia=A.object({address:Nt}),fa=A.object({oldAddress:Nt,newAddress:Nt,code:Ut}),Sa=ba.extend({email:Nt});var Ta={};L(Ta,"JsonWebKey",(()=>Ea)),L(Ta,"JsonWebKeySet",(()=>Aa));let Ea=A.object({kty:A.string(),use:A.enum(["sig","enc"]).optional(),key_ops:A.array(A.enum(["sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits"])).optional(),alg:A.enum(["RS256"]),kid:A.string().optional(),x5u:A.string().optional(),x5c:A.array(A.string()).optional(),x5t:A.string().optional(),"x5t#S256":A.string().optional(),n:A.string().optional(),e:A.string().optional(),d:A.string().optional()}),Aa=A.object({keys:A.array(Ea)});var ka={};L(ka,"FarcasterConnectInitResponse",(()=>Oa)),L(ka,"FarcasterConnectStatusCompletedResponse",(()=>Pa)),L(ka,"FarcasterConnectStatusPendingResponse",(()=>ja)),L(ka,"FarcasterAuthenticateInput",(()=>wa)),L(ka,"FarcasterLinkInput",(()=>Ca)),L(ka,"FarcasterInitInput",(()=>Ra)),L(ka,"FarcasterUnlinkInput",(()=>Da)),L(ka,"TransferFarcasterInput",(()=>Na)),L(ka,"FarcasterV2InitInput",(()=>Ua)),L(ka,"FarcasterV2InitResponse",(()=>La)),L(ka,"FarcasterV2AuthenticateInput",(()=>Ma));let Oa=A.object({channel_token:A.string(),connect_uri:A.string()}),Pa=A.object({state:A.literal("completed"),nonce:A.string(),message:A.string(),signature:A.string(),fid:A.number(),username:A.string(),display_name:A.string(),bio:A.string(),pfp_url:A.string()}),ja=A.object({state:A.literal("pending"),nonce:A.string()}),wa=A.object({channel_token:A.string(),message:A.string(),signature:A.string(),fid:A.number()}).merge(Vt),Ca=A.object({channel_token:A.string(),message:A.string(),signature:A.string(),fid:A.number()}),Ra=A.object({token:A.string().optional(),redirect_url:A.string().url().optional(),relying_party:A.string().optional()}),Da=A.object({fid:A.number()}),Na=ba.extend({farcaster_id:A.string(),farcaster_embedded_address:A.string()}),Ua=A.object({}),La=A.object({nonce:A.string(),expires_at:A.string()}),Ma=A.object({fid:A.number(),message:A.string(),signature:A.string()}).merge(Vt);var Wa={};L(Wa,"FarcasterSignerInitInput",(()=>xa)),L(Wa,"FarcasterSignerInitResponse",(()=>Fa)),L(Wa,"FarcasterSignerStatusResponse",(()=>Ga));let xa=A.object({ed25519_public_key:A.string().refine((e=>e.startsWith("0x")&&66===e.length)),deadline:A.bigint().optional().default((()=>BigInt(Math.floor(Date.now()/1e3)+3600)))}),Fa=A.discriminatedUnion("status",[A.object({public_key:A.string(),status:A.literal("pending_approval"),signer_approval_url:A.string()}),A.object({public_key:A.string(),status:A.literal("approved"),fid:A.bigint()}),A.object({public_key:A.string(),status:A.literal("revoked"),fid:A.bigint()})]),Ga=A.discriminatedUnion("status",[A.object({public_key:A.string(),status:A.literal("pending_approval")}),A.object({public_key:A.string(),status:A.literal("approved"),fid:A.bigint()}),A.object({public_key:A.string(),status:A.literal("revoked"),fid:A.bigint()})]);var Va={};L(Va,"AuthenticateGuestInput",(()=>Ba));let Ba=A.object({guest_credential:A.string().length(43)}).strict();var Ha={};L(Ha,"EmailIdTokenEntry",(()=>zn)),L(Ha,"PhoneIdTokenEntry",(()=>Xn)),L(Ha,"EthereumIdTokenEntry",(()=>Jn)),L(Ha,"SolanaIdTokenEntry",(()=>Qn)),L(Ha,"FarcasterIdTokenEntry",(()=>Zn)),L(Ha,"PasskeyIdTokenEntry",(()=>er)),L(Ha,"TelegramIdTokenEntry",(()=>tr)),L(Ha,"EthereumEmbeddedWalletIdTokenEntry",(()=>ar)),L(Ha,"SolanaEmbeddedWalletIdTokenEntry",(()=>nr)),L(Ha,"GoogleOauthIdTokenEntry",(()=>rr)),L(Ha,"TwitterOauthIdTokenEntry",(()=>ir)),L(Ha,"DiscordOauthIdTokenEntry",(()=>or)),L(Ha,"GithubOauthIdTokenEntry",(()=>sr)),L(Ha,"LinkedInOauthIdTokenEntry",(()=>lr)),L(Ha,"SpotifyOauthIdTokenEntry",(()=>cr)),L(Ha,"InstagramOauthIdTokenEntry",(()=>pr)),L(Ha,"TiktokOauthIdTokenEntry",(()=>dr)),L(Ha,"AppleOauthIdTokenEntry",(()=>ur)),L(Ha,"CustomJwtIdTokenEntry",(()=>_r)),L(Ha,"CrossAppIdTokenEntry",(()=>mr)),L(Ha,"SmartWalletIdTokenEntry",(()=>gr));var Ya={};L(Ya,"EmailAccount",(()=>ln)),L(Ya,"PhoneAccount",(()=>cn)),L(Ya,"BaseWalletAccount",(()=>pn)),L(Ya,"EthereumAccount",(()=>dn)),L(Ya,"SmartWalletAccount",(()=>un)),L(Ya,"SolanaAccount",(()=>_n)),L(Ya,"FarcasterAccount",(()=>mn)),L(Ya,"PasskeyAccount",(()=>gn)),L(Ya,"TelegramAccount",(()=>bn)),L(Ya,"EthereumEmbeddedWalletAccount",(()=>vn)),L(Ya,"SolanaEmbeddedWalletAccount",(()=>In)),L(Ya,"BitcoinSegwitEmbeddedWalletAccount",(()=>fn)),L(Ya,"BitcoinTaprootEmbeddedWalletAccount",(()=>Sn)),L(Ya,"GoogleOauthAccount",(()=>Tn)),L(Ya,"TwitterOauthAccount",(()=>En)),L(Ya,"DiscordOauthAccount",(()=>An)),L(Ya,"GithubOauthAccount",(()=>kn)),L(Ya,"LinkedInOauthAccount",(()=>On)),L(Ya,"SpotifyOauthAccount",(()=>Pn)),L(Ya,"InstagramOauthAccount",(()=>jn)),L(Ya,"TiktokOauthAccount",(()=>wn)),L(Ya,"AppleOauthAccount",(()=>Cn)),L(Ya,"CustomJwtAccount",(()=>Rn)),L(Ya,"CrossAppEmbeddedWallet",(()=>Dn)),L(Ya,"CrossAppSmartWallet",(()=>Nn)),L(Ya,"CrossAppAccount",(()=>Un)),L(Ya,"LinkedAccount",(()=>Ln)),L(Ya,"SmsMfaMethod",(()=>Mn)),L(Ya,"TotpMfaMethod",(()=>Wn)),L(Ya,"PasskeyMfaMethod",(()=>xn)),L(Ya,"LinkedMfaMethod",(()=>Fn)),L(Ya,"CustomMetadata",(()=>Gn)),L(Ya,"OAuthTokens",(()=>Vn)),L(Ya,"User",(()=>Bn)),L(Ya,"SessionUpdateActionEnum",(()=>Hn)),L(Ya,"AuthenticatedUser",(()=>Yn)),L(Ya,"LoggedOutUser",(()=>qn)),L(Ya,"MaybeUser",(()=>Kn));var qa={};L(qa,"SmartWalletProvider",(()=>Za)),L(qa,"AlchemyPaymasterContextSchema",(()=>tn)),L(qa,"SmartWalletNetworkConfigurationInputSchema",(()=>nn)),L(qa,"SmartWalletConfigurationSchema",(()=>rn)),L(qa,"SmartWalletConfigurationInputSchema",(()=>on)),L(qa,"SmartWalletConfigurationResponseSchema",(()=>sn)),L(qa,"SAFE",(()=>Ka)),L(qa,"KERNEL",(()=>$a)),L(qa,"LIGHT_ACCOUNT",(()=>Xa)),L(qa,"BICONOMY",(()=>za)),L(qa,"COINBASE_SMART_WALLET",(()=>Ja)),L(qa,"SUPPORTED_SMART_WALLET_TYPES",(()=>Qa));let Ka="safe",$a="kernel",za="biconomy",Xa="light_account",Ja="coinbase_smart_wallet",Qa=[Ka,$a,za,Xa,Ja],Za=A.enum(Qa,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),en=A.string().regex(/^eip155:\d+$/,"Chain ID must be an eip155 chain ID"),tn=A.object({policy_id:A.string().uuid()}),an=A.object({chain_id:en,bundler_url:A.string(),paymaster_url:A.string().optional(),rpc_url:A.string().optional(),chain_name:A.string().optional(),paymaster_context:tn.optional()}),nn=A.object({chain_id:en,bundler_url:A.string().optional(),paymaster_url:A.string().optional(),rpc_url:A.string().optional(),chain_name:A.string().optional(),paymaster_context:tn.optional()}),rn=A.discriminatedUnion("enabled",[A.object({enabled:A.literal(!1)}),A.object({enabled:A.literal(!0),smart_wallet_type:Za,configured_networks:A.array(an).min(1)})]),on=A.discriminatedUnion("enabled",[A.object({enabled:A.literal(!1)}),A.object({enabled:A.literal(!0),smart_wallet_type:Za,configured_networks:A.array(nn).min(1)})]),sn=rn,ln=A.object({type:A.literal("email"),address:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),cn=A.object({type:A.literal("phone"),phoneNumber:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),pn=A.object({type:A.enum(["wallet","smart_wallet"]),address:A.string(),chain_type:A.enum(["solana","ethereum"])}),dn=A.object({type:A.literal("wallet"),address:A.string(),chain_id:A.string().optional(),chain_type:A.literal("ethereum"),wallet_client:A.literal("unknown"),wallet_client_type:A.string().optional(),connector_type:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),un=A.object({type:A.literal("smart_wallet"),address:A.string(),smart_wallet_type:Za,verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),_n=A.object({type:A.literal("wallet"),address:A.string(),chain_type:A.literal("solana"),wallet_client:A.literal("unknown"),wallet_client_type:A.string().optional(),connector_type:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),mn=A.object({type:A.literal("farcaster"),fid:A.number(),owner_address:Lt,username:A.string().optional(),display_name:A.string().optional(),bio:A.string().optional(),profile_picture:A.string().optional(),profile_picture_url:A.string().optional(),homepage_url:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable(),signer_public_key:A.string().optional()}),gn=A.object({type:A.literal("passkey"),created_with_browser:A.string().optional(),created_with_os:A.string().optional(),created_with_device:A.string().optional(),credential_id:A.string(),authenticator_name:A.string().optional(),enrolled_in_mfa:A.boolean(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),bn=A.object({type:A.literal("telegram"),telegram_user_id:A.string(),first_name:A.string().nullish(),last_name:A.string().nullish(),username:A.string().nullish(),photo_url:A.string().nullish(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}).transform((e=>({...e,telegramUserId:e.telegram_user_id,firstName:e.first_name}))),hn=A.enum(["privy","user-passcode","google-drive","icloud"]),yn=A.object({type:A.literal("wallet"),address:A.string(),imported:A.boolean().default(!1),delegated:A.boolean().default(!1),wallet_index:A.number(),chain_id:A.string(),chain_type:A.string(),wallet_client:A.literal("privy"),wallet_client_type:A.literal("privy"),connector_type:A.literal("embedded"),recovery_method:hn,verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),vn=yn.merge(A.object({chain_type:A.literal("ethereum")})),In=yn.merge(A.object({chain_type:A.literal("solana"),public_key:A.string()})),fn=yn.merge(A.object({chain_type:A.literal("bitcoin-segwit"),public_key:A.string()})),Sn=yn.merge(A.object({chain_type:A.literal("bitcoin-taproot"),public_key:A.string()})),Tn=A.object({type:A.literal("google_oauth"),subject:A.string(),email:A.string(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),En=A.object({type:A.literal("twitter_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),profile_picture_url:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),An=A.object({type:A.literal("discord_oauth"),subject:A.string(),username:A.string().nullable(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),kn=A.object({type:A.literal("github_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),On=A.object({type:A.literal("linkedin_oauth"),subject:A.string(),name:A.string().optional(),email:A.string().nullable(),vanity_name:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Pn=A.object({type:A.literal("spotify_oauth"),subject:A.string(),email:A.string().nullable(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),jn=A.object({type:A.literal("instagram_oauth"),subject:A.string(),username:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),wn=A.object({type:A.literal("tiktok_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Cn=A.object({type:A.literal("apple_oauth"),subject:A.string(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Rn=A.object({type:A.literal("custom_auth"),custom_user_id:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Dn=A.object({address:A.string()}),Nn=A.object({address:A.string()}),Un=A.object({type:A.literal("cross_app"),subject:A.string(),provider_app_id:A.string(),embedded_wallets:A.array(Dn),smart_wallets:A.array(Nn),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Ln=A.union([ln,cn,dn,_n,un,vn,In,fn,Sn,Tn,En,An,kn,Pn,jn,wn,On,Cn,Rn,mn,gn,bn,Un]),Mn=A.object({type:A.literal("sms"),verified_at:A.number()}),Wn=A.object({type:A.literal("totp"),verified_at:A.number()}),xn=A.object({type:A.literal("passkey"),verified_at:A.number()}),Fn=A.union([Mn,Wn,xn]),Gn=A.record(A.string(),A.union([A.string(),A.number(),A.boolean()])),Vn=A.object({provider:A.string(),access_token:A.string(),access_token_expires_in_seconds:A.number().optional(),refresh_token:A.string().optional(),refresh_token_expires_in_seconds:A.number().optional(),scopes:A.array(A.string()).optional()}),Bn=A.object({id:A.string(),linked_accounts:A.array(Ln),mfa_methods:A.array(Fn),created_at:A.number(),has_accepted_terms:A.boolean(),is_guest:A.boolean(),custom_metadata:Gn.optional()}),Hn=A.enum(["set","ignore","clear"]),Yn=A.object({user:Bn,token:A.string().min(1).nullable(),privy_access_token:A.string().min(1).nullable(),refresh_token:A.string().min(1).nullable(),identity_token:A.string().min(1).optional(),is_new_user:A.boolean().optional(),oauth_tokens:Vn.optional(),oauth_provider_tokens:A.object({provider:A.string(),access_token:A.string(),access_token_expires_in_seconds:A.number().optional(),refresh_token:A.string().optional(),scopes:A.array(A.string()).optional()}).optional(),session_update_action:Hn}),qn=A.object({user:A.null(),token:A.null(),refresh_token:A.null(),session_update_action:A.literal(Hn.Values.clear)}),Kn=A.union([Yn,qn]),$n={lv:A.number().nullable()},zn=ln.pick({type:!0,address:!0}).extend($n),Xn=cn.pick({type:!0,phoneNumber:!0}).extend($n).transform((({phoneNumber:e,...t})=>({phone_number:e,...t}))),Jn=dn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),Qn=_n.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),Zn=mn.pick({type:!0,fid:!0,username:!0,owner_address:!0}).extend($n).transform((({owner_address:e,...t})=>({oa:e,...t}))),er=gn.pick({type:!0,credential_id:!0}).extend($n),tr=A.object({type:A.literal("telegram"),telegram_user_id:A.string(),username:A.string().nullish(),lv:A.number().nullable()}),ar=vn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),nr=In.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),rr=Tn.pick({type:!0,subject:!0,email:!0}).extend($n),ir=En.pick({type:!0,subject:!0,username:!0}).extend($n),or=An.pick({type:!0,subject:!0,username:!0}).extend($n),sr=kn.pick({type:!0,subject:!0,username:!0}).extend($n),lr=On.pick({type:!0,subject:!0,email:!0}).extend($n),cr=Pn.pick({type:!0,subject:!0,email:!0}).extend($n),pr=jn.pick({type:!0,subject:!0,username:!0}).extend($n),dr=wn.pick({type:!0,subject:!0,username:!0}).extend($n),ur=Cn.pick({type:!0,subject:!0,email:!0}).extend($n),_r=Rn.pick({type:!0,custom_user_id:!0}).extend($n),mr=Un.pick({type:!0,subject:!0,provider_app_id:!0,embedded_wallets:!0,smart_wallets:!0}).extend($n),gr=un.pick({type:!0,smart_wallet_type:!0,address:!0}).extend($n);var br={};L(br,"MfaVerifyResponse",(()=>hr)),L(br,"MfaSmsInitInput",(()=>Ir)),L(br,"MfaSmsAuthenticateEnrollInput",(()=>fr)),L(br,"MfaSmsEnrollInput",(()=>Sr)),L(br,"MfaSmsVerifyInput",(()=>Tr)),L(br,"MfaTotpInput",(()=>Er)),L(br,"ResponseTotpInitMfa",(()=>Ar));let hr=E.object({token:E.string()}).strict(),yr=E.object({action:E.literal("verify")}).strict(),vr=E.object({action:E.literal("enroll"),phoneNumber:Wt}).strict(),Ir=E.union([yr,vr]),fr=E.object({action:E.literal("enroll").optional(),code:Ut,phoneNumber:Wt}).strict(),Sr=E.object({code:Ut,phoneNumber:Wt}).strict(),Tr=E.object({code:Ut}).strict(),Er=E.object({code:Ut}).strict(),Ar=E.object({totpSecret:E.string(),totpAuthUrl:E.string()}).strict();var kr={};L(kr,"MfaPasskeyInitInput",(()=>Wr)),L(kr,"ResponsePasskeyInitMfa",(()=>xr)),L(kr,"MfaPasskeyVerifyInput",(()=>Fr)),L(kr,"MfaEnrollmentPasskeyInput",(()=>Gr));var Or={};L(Or,"PasskeyAuthenticatorVerifyOptions",(()=>Pr)),L(Or,"PasskeyAuthenticatorEnrollmentOptions",(()=>jr)),L(Or,"PasskeyAuthenticatorVerifyResponse",(()=>wr)),L(Or,"PasskeyAuthenticatorEnrollmentResponse",(()=>Cr)),L(Or,"PasskeyInitInput",(()=>Rr)),L(Or,"ResponsePasskeyInitAuthenticate",(()=>Dr)),L(Or,"ResponsePasskeyInitLink",(()=>Nr)),L(Or,"PasskeyLinkInput",(()=>Ur)),L(Or,"PasskeyAuthenticateInput",(()=>Lr)),L(Or,"UnlinkPasskeyInput",(()=>Mr));let Pr=E.object({challenge:E.string(),timeout:E.number().optional(),rp_id:E.string().optional(),allow_credentials:E.array(E.object({id:E.string(),type:E.string(),transports:E.array(E.string()).optional()})).optional(),user_verification:E.string().optional(),extensions:E.object({app_id:E.string().optional(),cred_props:E.boolean().optional(),hmac_create_secret:E.boolean().optional()}).optional()}),jr=E.object({rp:E.object({name:E.string(),id:E.string().optional()}),user:E.object({id:E.string(),name:E.string(),display_name:E.string()}),challenge:E.string(),pub_key_cred_params:E.array(E.object({alg:E.number(),type:E.literal("public-key")})),timeout:E.number().optional(),exclude_credentials:E.array(E.object({id:E.string(),type:E.string(),transports:E.array(E.string()).optional()})).optional(),authenticator_selection:E.object({authenticator_attachment:E.string().optional(),require_resident_key:E.boolean().optional(),resident_key:E.string().optional(),user_verification:E.string().optional()}).optional(),attestation:E.string().optional(),extensions:E.object({app_id:E.string().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}).optional()}),wr=E.object({id:E.string(),raw_id:E.string(),response:E.object({client_data_json:E.string(),authenticator_data:E.string(),signature:E.string(),user_handle:E.string().optional()}),authenticator_attachment:E.string().optional(),client_extension_results:E.object({app_id:E.boolean().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}),type:E.literal("public-key")}),Cr=E.object({id:E.string(),raw_id:E.string(),response:E.object({client_data_json:E.string(),attestation_object:E.string(),authenticator_data:E.string().optional(),transports:E.array(E.any()).optional(),public_key_algorithm:E.number().optional(),public_key:E.string().optional()}),authenticator_attachment:E.string().optional(),client_extension_results:E.object({app_id:E.boolean().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}),type:E.literal("public-key")}),Rr=E.object({relying_party:E.string().url().optional(),token:E.string().optional()}).strict(),Dr=E.object({relying_party:E.string().url().optional(),options:Pr}).strict(),Nr=E.object({relying_party:E.string().url().optional(),options:jr}).strict(),Ur=E.object({relying_party:E.string().url().optional(),authenticator_response:Cr}).strict(),Lr=E.object({relying_party:E.string().url().optional(),challenge:E.string(),authenticator_response:wr}).strict(),Mr=E.object({credential_id:E.string()}),Wr=E.object({relying_party:E.string().url().optional()}).strict(),xr=E.object({options:Pr}).strict(),Fr=E.object({authenticator_response:wr,relying_party:E.string().url().optional()}).strict(),Gr=E.object({credential_ids:E.array(E.string())});var Vr={};L(Vr,"ExternalOAuthProvider",(()=>Hr)),L(Vr,"OAuthProvider",(()=>Yr)),L(Vr,"AuthenticateOauthInput",(()=>qr)),L(Vr,"OAuthInitInput",(()=>Kr)),L(Vr,"LinkOAuthInput",(()=>$r)),L(Vr,"OAuthUnlinkInput",(()=>zr)),L(Vr,"OAuthInitResponse",(()=>Xr)),L(Vr,"OAuthLinkResponse",(()=>Jr)),L(Vr,"TransferOAuthInput",(()=>Qr)),L(Vr,"SUPPORTED_OAUTH_PROVIDERS",(()=>Br));let Br=["google","discord","twitter","github","spotify","instagram","tiktok","linkedin","apple"],Hr=A.enum(Br,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Yr=Hr.or(A.custom((e=>"string"==typeof e&&/^privy:[a-z0-9]{25}$/i.test(e)),{message:"Please specify a supported provider."})),qr=A.object({authorization_code:A.string(),state_code:A.string(),code_verifier:A.string().min(43).max(128).optional(),code_type:A.enum(["raw"]).optional()}).merge(Vt).catch((()=>{throw new D("Please specify authorization_code and state_code.",w.INVALID_CREDENTIALS)})),Kr=A.object({redirect_to:A.string({required_error:"Please provide a redirect_to value."}),provider:Yr,token:A.string().optional(),state_code:A.string().optional(),code_challenge:A.string().optional()}),$r=A.object({authorization_code:A.string(),state_code:A.string(),code_verifier:A.string().min(43).max(128).optional(),code_type:A.enum(["raw"]).optional()}),zr=A.object({subject:A.string(),provider:Yr}),Xr=A.object({url:A.string()}),Jr=Bn.extend({oauth_tokens:Vn.optional()}),Qr=ba.extend({userInfo:A.object({subject:A.string(),name:A.string().optional(),username:A.string().optional(),profilePictureUrl:A.string().optional(),email:A.string().optional(),vanityName:A.string().optional()})});var Zr={};L(Zr,"AuthorizationCodeInput",(()=>ei));let ei=A.object({redirect_to:A.string(),state:A.string(),code_challenge:A.string()});var ti={};L(ti,"EmptyObject",(()=>ai)),L(ti,"SuccessObject",(()=>ni));let ai=A.record(A.string(),A.never()),ni=A.object({success:A.boolean()});var ri={};L(ri,"RecoveryKeyMaterialInput",(()=>ii)),L(ri,"RecoveryKeyMaterialResponse",(()=>oi)),L(ri,"OAuthAuthenticateRecoveryResponse",(()=>si)),L(ri,"OAuthInitRecoveryInput",(()=>li)),L(ri,"OAuthInitICloudRecoveryInput",(()=>ci)),L(ri,"OAuthCallbackICloudExpoInput",(()=>pi)),L(ri,"OAuthCallbackICloudExpoResponse",(()=>di)),L(ri,"RecoveryConfigurationICloudInput",(()=>ui)),L(ri,"RecoveryConfigurationICloudResponse",(()=>_i));let ii=A.object({chain_type:A.string().optional()}),oi=A.object({recovery_type:A.enum(["user_passcode_derived_recovery_key","privy_passcode_derived_recovery_key","privy_generated_recovery_key","google_drive_recovery_secret","icloud_recovery_secret"]),recovery_key_derivation_salt:A.string(),recovery_code:A.string(),recovery_key:A.string(),file_id:A.string(),icloud_record_name:A.string()}),si=A.object({access_token:A.string()}),li=A.object({redirect_to:A.string({required_error:"Please provide a redirect_to value."}),token:A.string().optional(),state_code:A.string().optional(),code_challenge:A.string().optional()}),ci=A.object({client_type:A.enum(["web","expo-ios"])}),pi=A.object({ckWebAuthToken:A.string()}).transform((e=>({ckWebAuthToken:e.ckWebAuthToken}))).catch((()=>{throw new D("Missing ckWebAuthToken.",w.INVALID_DATA)})),di=ai,ui=A.object({client_type:A.enum(["web","expo-ios"])}),_i=A.object({api_token:A.string(),container_identifier:A.string(),environment:A.string()});var mi={};L(mi,"SiweInput",(()=>gi)),L(mi,"SmartWalletSiweInput",(()=>bi)),L(mi,"AuthenticateSiweInput",(()=>hi)),L(mi,"SiweAddressInput",(()=>yi)),L(mi,"SiweInitInput",(()=>vi)),L(mi,"SiweNonce",(()=>Ii)),L(mi,"TransferSiweInput",(()=>fi));let gi=A.object({message:A.string({invalid_type_error:"Invalid SIWE message"}),signature:A.string({invalid_type_error:"Invalid SIWE signature"}),chainId:A.string().max(41).nullable().default(null),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)}),bi=A.object({message:A.string({invalid_type_error:"Invalid SIWE message"}),signature:A.string({invalid_type_error:"Invalid SIWE signature"}),smart_wallet_type:Za}),hi=gi.merge(Vt),yi=A.object({address:Lt}),vi=A.object({address:Lt,token:A.string().optional()}),Ii=A.object({nonce:A.string(),address:A.string(),expires_at:A.string()}),fi=ba.extend({address:Lt,chainId:A.string().max(41).nullable().default(null),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)});var Si={};L(Si,"SiwsInput",(()=>Ti)),L(Si,"AuthenticateSiwsInput",(()=>Ei)),L(Si,"SiwsAddressInput",(()=>Ai)),L(Si,"SiwsInitInput",(()=>ki)),L(Si,"SiwsNonce",(()=>Oi));let Ti=A.object({message:A.string({invalid_type_error:"Invalid SIWS message"}),signature:A.string({invalid_type_error:"Invalid SIWS signature"}),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)}),Ei=Ti.merge(Vt),Ai=A.object({address:Mt}),ki=A.object({address:Mt,token:A.string().optional()}),Oi=A.object({nonce:A.string(),address:A.string(),expires_at:A.string()});var Pi={};L(Pi,"VerifyPhoneInput",(()=>ji)),L(Pi,"AuthenticatePhoneInput",(()=>wi)),L(Pi,"PasswordlessSmsPhoneInput",(()=>Ci)),L(Pi,"UnlinkPhoneInput",(()=>Ri)),L(Pi,"UpdatePhoneInput",(()=>Di)),L(Pi,"TransferPhoneInput",(()=>Ni));let ji=A.object({code:Ut.catch((()=>{throw new N("Invalid SMS verification code",w.INVALID_CREDENTIALS)})),phoneNumber:Wt.catch((()=>{throw new N("Invalid phone number",w.INVALID_CREDENTIALS)}))}),wi=ji.merge(Vt),Ci=A.object({phoneNumber:Wt.catch((()=>{throw new N("Invalid phone number, not formatted correctly",w.INVALID_DATA)})),token:A.string().optional()}),Ri=A.object({phoneNumber:Wt}),Di=A.object({old_phone_number:Wt,new_phone_number:Wt,code:Ut}),Ni=ba.extend({phoneNumber:Wt});var Ui={};L(Ui,"TelegramAuthenticateInput",(()=>Mi)),L(Ui,"TelegramLinkInput",(()=>Wi)),L(Ui,"TelegramUnlinkInput",(()=>xi)),L(Ui,"TransferTelegramInput",(()=>Fi));let Li=E.object({id:E.coerce.number(),first_name:E.string(),auth_date:E.coerce.number(),hash:E.string(),username:E.string().optional(),last_name:E.string().optional(),photo_url:E.string().optional()}),Mi=E.object({captcha_token:E.string().optional(),telegram_auth_result:Li.optional(),telegram_web_app_data:E.object({query_id:E.string().optional(),auth_date:E.coerce.number(),hash:E.string(),user:E.string(),chat_instance:E.string().optional(),chat_type:E.string().optional(),start_param:E.string().optional(),signature:E.string().optional()}).optional()}).merge(Vt),Wi=Mi.omit({telegram_web_app_data:!0}).required({telegram_auth_result:!0}),xi=E.object({telegram_user_id:E.string()}),Fi=ba.extend({telegram_auth_result:Li});var Gi={};L(Gi,"RefreshTokenInput",(()=>Vi)),L(Gi,"OptionalRefreshTokenInput",(()=>Bi)),L(Gi,"ForkedToken",(()=>Hi));let Vi=A.object({refresh_token:A.string()}),Bi=Vi.partial(),Hi=A.object({token:A.string(),refresh_token:A.string(),new_session_refresh_token:A.string()});var Yi={};L(Yi,"DelegatedActionsConsentInput",(()=>qi));let qi=A.object({encrypted_tee_share:A.string(),app_share:A.string(),delegated_addresses:A.array(A.object({chain_type:A.union([A.literal("solana"),A.literal("ethereum")]),address:A.string(),wallet_index:A.number().default(0)}))});var Ki={};L(Ki,"CAIP2",(()=>$i)),L(Ki,"AuthorizationKeyRole",(()=>Ji)),L(Ki,"WalletApiSolanaSignTransactionRpcInput",(()=>Qi)),L(Ki,"WalletApiSolanaSignAndSendTransactionRpcInput",(()=>Zi)),L(Ki,"WalletApiSolanaSignMessageRpcInput",(()=>eo)),L(Ki,"UnsignedEthereumTransaction",(()=>no)),L(Ki,"WalletApiEthereumSignTransactionRpcInput",(()=>ro)),L(Ki,"WalletApiEthereumSendTransactionRpcInput",(()=>io)),L(Ki,"WalletApiEthereumPersonalSignRpcInputParams",(()=>oo)),L(Ki,"WalletApiEthereumPersonalSignRpcInput",(()=>so)),L(Ki,"WalletApiEthereumSignTypedDataRpcInput",(()=>lo)),L(Ki,"WalletApiEthereumRpcInput",(()=>co)),L(Ki,"WalletApiSolanaRpcInput",(()=>po)),L(Ki,"WalletApiRpcInput",(()=>uo)),L(Ki,"WalletApiSolanaSignTransactionRpcResponse",(()=>_o)),L(Ki,"WalletApiSolanaSignAndSendTransactionRpcResponse",(()=>mo)),L(Ki,"WalletApiSolanaSignMessageRpcResponse",(()=>go)),L(Ki,"WalletApiEthereumSignTransactionRpcResponse",(()=>bo)),L(Ki,"WalletApiEthereumSendTransactionRpcResponse",(()=>ho)),L(Ki,"WalletApiEthereumPersonalSignRpcResponse",(()=>yo)),L(Ki,"WalletApiEthereumSignTypedDataRpcResponse",(()=>vo)),L(Ki,"WalletApiRpcResponse",(()=>Io)),L(Ki,"WalletApiRegisterAuthorizationKeyInput",(()=>fo)),L(Ki,"WalletResponse",(()=>To)),L(Ki,"WalletApiCreateInput",(()=>Eo)),L(Ki,"WalletApiCreateResponse",(()=>Ao)),L(Ki,"WalletIdFromPath",(()=>ko)),L(Ki,"WalletApiRevokeAuthorizationKeyInput",(()=>Oo));let $i=A.string().regex(/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/,"Chain ID must be a valid CAIP-2 chain ID, e.g. 'eip155:1'"),zi=A.object({address:Mt.optional(),chain_type:A.literal("solana").optional()}),Xi=A.object({address:Lt.optional(),chain_type:A.literal("ethereum").optional()}),Ji=A.enum(["root","manager"]).nullable(),Qi=A.object({method:A.literal("signTransaction"),params:A.object({transaction:A.string(),encoding:A.literal("base64")})}).merge(zi),Zi=A.object({method:A.literal("signAndSendTransaction"),caip2:$i,params:A.object({transaction:A.string(),encoding:A.literal("base64")})}).merge(zi),eo=A.object({method:A.literal("signMessage"),params:A.object({message:A.string(),encoding:A.literal("base64")})}).merge(zi),to=A.string().startsWith("0x"),ao=A.union([to,A.number()]),no=A.object({from:Lt.optional(),to:Lt.optional(),chain_id:ao.optional(),nonce:ao.optional(),data:to.optional(),value:ao.optional(),type:A.union([A.literal(0),A.literal(1),A.literal(2)]).optional(),gas_limit:ao.optional(),gas_price:ao.optional(),max_fee_per_gas:ao.optional(),max_priority_fee_per_gas:ao.optional()}),ro=A.object({method:A.literal("eth_signTransaction"),params:A.object({transaction:no})}).merge(Xi),io=A.object({method:A.literal("eth_sendTransaction"),caip2:$i,params:A.object({transaction:no})}).merge(Xi),oo=A.object({message:A.string(),encoding:A.union([A.literal("utf-8"),A.literal("hex")])}),so=A.object({method:A.literal("personal_sign"),params:oo}).merge(Xi),lo=A.object({method:A.literal("eth_signTypedData_v4"),params:A.object({typed_data:A.object({domain:A.record(A.string(),A.any()),types:A.record(A.string(),A.any()),message:A.record(A.string(),A.any()),primary_type:A.string()})})}).merge(Xi),co=A.discriminatedUnion("method",[ro,io,so,lo]),po=A.discriminatedUnion("method",[Qi,Zi,eo]),uo=A.union([co,po]),_o=A.object({method:A.literal("signTransaction"),data:A.object({signed_transaction:A.string(),encoding:A.literal("base64")})}),mo=A.object({method:A.literal("signAndSendTransaction"),data:A.object({hash:A.string(),caip2:$i}).optional(),error:A.object({code:A.string(),message:A.string()}).optional()}),go=A.object({method:A.literal("signMessage"),data:A.object({signature:A.string(),encoding:A.literal("base64")})}),bo=A.object({method:A.literal("eth_signTransaction"),data:A.object({signed_transaction:A.string(),encoding:A.literal("rlp")})}),ho=A.object({method:A.literal("eth_sendTransaction"),data:A.object({hash:A.string(),caip2:$i}).optional(),error:A.object({code:A.string(),message:A.string()}).optional()}),yo=A.object({method:A.literal("personal_sign"),data:A.object({signature:A.string(),encoding:A.literal("hex")})}),vo=A.object({method:A.literal("eth_signTypedData_v4"),data:A.object({signature:A.string(),encoding:A.literal("hex")})}),Io=A.discriminatedUnion("method",[_o,mo,go,bo,ho,yo,vo]),fo=A.object({public_key:A.string(),role:Ji.optional()}),So=A.union([A.literal("solana"),A.literal("ethereum")]),To=A.object({id:A.string(),address:A.string(),chain_type:So}),Eo=A.object({chain_type:So,policy_id:A.string().optional()}),Ao=A.object({id:A.string(),chain_type:So,address:A.string()}),ko=A.object({wallet_id:A.string({required_error:"Wallet ID must be provided",invalid_type_error:"Wallet ID is not a valid string"}).min(1)}).catch((({error:e})=>{throw new R(e.message,w.INVALID_DATA)})),Oo=A.object({id:A.string()});var Po={};L(Po,"MoonpayOnRampSignInput",(()=>No)),L(Po,"MoonpayOnRampSignResponse",(()=>Uo));let jo=A.enum(["ach_bank_transfer","credit_debit_card","gbp_bank_transfer","gbp_open_banking_payment","mobile_wallet","sepa_bank_transfer","sepa_open_banking_payment","pix_instant_payment","yellow_card_bank_transfer"]),wo=A.enum(["AVAX_CCHAIN","CELO_CELO","CUSD_CELO","DAI_ETHEREUM","ETH_ETHEREUM","ETH_ARBITRUM","ETH_OPTIMISM","ETH_POLYGON","ETH_BASE","FIL_FVM","MATIC_ETHEREUM","MATIC_POLYGON","USDC_ETHEREUM","USDC_ARBITRUM","USDC_OPTIMISM","USDC_POLYGON","USDC_BASE","USDT_ETHEREUM","USDT_POLYGON","WETH_POLYGON","WBTC_ETHEREUM","BNB_BNB","BNB_BSC","CELO","CUSD","DAI","ETH","FIL","MATIC","USDC","USDT","WETH","WBTC"]),Co=A.object({quoteCurrencyAmount:A.number().optional(),email:Nt.optional(),paymentMethod:jo.optional(),uiConfig:A.object({accentColor:A.string().optional(),theme:A.enum(["light","dark"]).optional()}).optional()}),Ro=A.object({address:Lt,config:Co.extend({currencyCode:wo.transform((e=>{switch(e){case"AVAX_CCHAIN":return"AVAX_CCHAIN";case"CELO_CELO":return"CELO";case"CUSD_CELO":return"CUSD";case"DAI_ETHEREUM":return"DAI";case"ETH_ETHEREUM":return"ETH";case"ETH_ARBITRUM":return"ETH_ARBITRUM";case"ETH_OPTIMISM":return"ETH_OPTIMISM";case"ETH_POLYGON":return"ETH_POLYGON";case"ETH_BASE":return"ETH_BASE";case"FIL_FVM":return"FIL";case"MATIC_ETHEREUM":return"MATIC";case"MATIC_POLYGON":return"MATIC_POLYGON";case"USDC_ETHEREUM":return"USDC";case"USDC_ARBITRUM":return"USDC_ARBITRUM";case"USDC_OPTIMISM":return"USDC_OPTIMISM";case"USDC_POLYGON":return"USDC_POLYGON";case"USDC_BASE":return"USDC_BASE";case"USDT_ETHEREUM":return"USDT";case"USDT_POLYGON":return"USDT_POLYGON";case"WETH_POLYGON":return"WETH";case"WBTC_ETHEREUM":return"WBTC";case"BNB_BNB":return"BNB";case"BNB_BSC":return"BNB_BSC";case"CELO":case"CUSD":case"DAI":case"ETH":case"FIL":case"MATIC":case"USDC":case"USDT":case"WETH":case"WBTC":return e;default:throw Error(`Invalid currency code: ${e}`)}})).optional()})}),Do=A.object({address:Mt,config:Co.extend({currencyCode:A.enum(["SOL","USDC_SOL"]).optional()})}),No=A.union([Ro,Do]).and(A.object({useSandbox:A.boolean().optional().default(!1)})),Uo=A.object({signedUrl:A.string(),externalTransactionId:A.string()});U(Pt,jt),U(Pt,Ct),U(Pt,qt),U(Pt,Kt),U(Pt,aa),U(Pt,Rt),U(Pt,da),U(Pt,$t),U(Pt,_a),U(Pt,ga),U(Pt,Ta),U(Pt,ka),U(Pt,Wa),U(Pt,Va),U(Pt,Ha),U(Pt,br),U(Pt,kr),U(Pt,Vr),U(Pt,Zr),U(Pt,ti),U(Pt,Or),U(Pt,ri),U(Pt,mi),U(Pt,Si),U(Pt,Pi),U(Pt,qa),U(Pt,Ui),U(Pt,Gi),U(Pt,Ya),U(Pt,Yi),U(Pt,Ki),U(Pt,Po);let Lo={address:S,version:"0.6"},Mo={address:T,version:"0.7"},Wo=({owner:e,smartWalletType:t,publicClient:a})=>{switch(t){case Ka:return v({client:a,entryPoint:Mo,owners:[e],version:"1.4.1"});case $a:return y({client:a,version:"0.3.1",entryPoint:Mo,owners:[e]});case za:return h({client:a,owners:[e],entryPoint:Lo});case Xa:return b({client:a,entryPoint:Lo,owner:e,version:"1.1.0"});case Ja:return async function({client:e,owner:t}){let[a]=await t.request({method:"eth_accounts"});if(!a)throw Error("Unable to request embedded owner for eth_accounts");return await f({client:e,owners:[{type:"local",source:"privy",address:a,sign:async({hash:e})=>await t.request({method:"secp256k1_sign",params:[e]})}]})}({client:a,owner:e});default:throw Error(`Invalid smart account type: ${t}.`)}},xo=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const Fo=({calls:e,chain:t,maxPriorityFeePerGas:a,maxFeePerGas:n,nonce:r})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:r,maxFeePerGas:n,maxPriorityFeePerGas:a}))),Go=async({chain:e,paymasterContext:t,embeddedWallet:a,user:i,smartWalletsConfig:s,rpcConfig:c,privyAppId:p})=>{if(!s?.enabled||!i||!a)return;let d=await a.getEthereumProvider(),u=s?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!u)throw new l(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let _=i.smartWallet?.smartWalletType??s.smartWalletType,m=o(e,c,p),b=r({chain:e,transport:n(m)}),h=t??u.paymasterContext,y=await(async({owner:e,smartWalletType:t,chain:a,publicClient:r,bundlerUrl:i,paymasterUrl:o,paymasterContext:s})=>{let l=await Wo({owner:e,smartWalletType:t,publicClient:r}),c=I({transport:n(i),entryPoint:l.entryPoint}),p=o?I({transport:n(o),entryPoint:l.entryPoint}):void 0;return g({account:l,chain:a,paymaster:p,paymasterContext:s,bundlerTransport:n(i),userOperation:{estimateFeesPerGas:async()=>{if(xo.some((e=>i.includes(e))))return await c.getUserOperationGasPrice().then((e=>e.fast));{let e=await r.estimateFeesPerGas(),t=i.includes("api.developer.coinbase.com")?175n:150n;return{...e,maxFeePerGas:e.maxFeePerGas*t/100n,maxPriorityFeePerGas:e.maxPriorityFeePerGas*t/100n}}}}})})({owner:d,smartWalletType:_,chain:e,publicClient:b,paymasterContext:h,...u});if(!y)throw new l(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return y},Vo=({clientConfig:n,smartWalletsConfig:r})=>{let{noPromptOnSignature:o,openPrivyModal:g,appId:b}=c(),h=s(),{setModalData:y}=u(),{user:v}=p(),{chains:I}=s(),{chainId:f,clients:S,setChainId:T,chainIdState:E}=(()=>{let a=e(),[n,r]=t();return{clients:e({}),setChainId:e=>{a.current=e,r(e)},chainId:a,chainIdState:n}})(),A=I.find((e=>e.id===E)),{wallets:k}=d(),O=a((async()=>f.current),[f]),P=a((async({id:e})=>{if(!S.current[e]){let t=_(k),a=await Go({chain:I.find((t=>t.id===e)),embeddedWallet:t,user:v,paymasterContext:n?.paymasterContext,smartWalletsConfig:r,rpcConfig:h.rpcConfig,privyAppId:b});a&&(S.current[e]=a)}T(e)}),[I,n,k,v,r]);return{wrapSmartAccountClient:e=>{S.current[e.chain.id]=e,E||T(e.chain.id);return{...e,sendTransaction:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[f.current];if(!a)throw new l(`Smart wallet client for chain (eip155:${f.current}) not found`);if(t)return o.current=!0,await a.sendTransaction(e).finally((()=>o.current=!1));let n=[];"calls"in e&&void 0!==e.calls?n=[...e.calls]:"to"in e&&(n=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let r=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:t,paymasterData:r}=await a.prepareUserOperation({calls:n,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(t??r??0)>0};return new Promise((async(t,s)=>{o.current=!0;let{entropyId:l,entropyIdVerifier:c}=i(v);y({connectWallet:{entropyId:l,entropyIdVerifier:c,onCompleteNavigateTo:m.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:Fo({calls:n,chain:a.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:l,entropyIdVerifier:c,transactingWallet:{address:a.account.address,walletIndex:null},getIsSponsored:r,onConfirm:()=>a.sendTransaction(e),onSuccess:e=>t(e.hash),onFailure:s,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},signMessage:async({message:e})=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[f.current];if(!a)throw new l(`Smart wallet client for chain (eip155:${f.current}) not found`);return t?(o.current=!0,await a.signMessage({message:e}).finally((()=>o.current=!1))):new Promise((async(t,n)=>{let{entropyId:r,entropyIdVerifier:s}=i(v);o.current=!0,y({connectWallet:{entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>a.signMessage({message:e}),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},signTypedData:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[f.current];if(!a)throw new l(`Smart wallet client for chain (eip155:${f.current}) not found`);return t?(o.current=!0,await a.signTypedData(e).finally((()=>o.current=!1))):new Promise((async(t,n)=>{o.current=!0;let{entropyId:r,entropyIdVerifier:s}=i(v);y({connectWallet:{entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>a.signTypedData(e),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},getChainId:O,chain:A,switchChain:P}}}};export{Fo as c,Go as g,Vo as u};
1
+ import{useRef as e,useState as t,useCallback as a}from"react";import{http as n,createPublicClient as r}from"viem";import{h as i}from"./user-EiUNCG17.mjs";import{U as o,A as s}from"./context-DKEKRqPy.mjs";import{P as l,u as c,h as p,l as d}from"./useWallets-BfKlC62m.mjs";import{u,g as _,M as m}from"./getEmbeddedConnectedWallet-BlqPeSFk.mjs";import{createSmartAccountClient as g}from"permissionless";import{toLightSmartAccount as b,toBiconomySmartAccount as h,toEcdsaKernelSmartAccount as y,toSafeSmartAccount as v}from"permissionless/accounts";import{createPimlicoClient as I}from"permissionless/clients/pimlico";import{toCoinbaseSmartAccount as f,entryPoint06Address as S,entryPoint07Address as T}from"viem/account-abstraction";import E,{z as A}from"zod";import k from"bs58";import{ethers as O}from"ethers";import{parsePhoneNumber as P}from"libphonenumber-js/max";let j;var w=((j=w||{}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",j.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",j.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",j.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",j.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",j.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",j.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",j.INVALID_DATA="invalid_data",j.INVALID_CREDENTIALS="invalid_credentials",j.INVALID_CAPTCHA="invalid_captcha",j.LINKED_TO_ANOTHER_USER="linked_to_another_user",j.ALLOWLIST_REJECTED="allowlist_rejected",j.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",j.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",j.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",j.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",j.TOO_MANY_REQUESTS="too_many_requests",j.INVALID_ORIGIN="invalid_origin",j.MISSING_ORIGIN="missing_origin",j.INVALID_NATIVE_APP_ID="invalid_native_app_id",j.TOKEN_ALREADY_USED="token_already_used",j.ALREADY_LOGGED_OUT="already_logged_out",j.NOT_SUPPORTED="not_supported",j.USER_UNSUBSCRIBED="user_unsubscribed",j.MAX_APPS_REACHED="max_apps_reached",j.USER_LIMIT_REACHED="max_accounts_reached",j.DEVICE_REVOKED="device_revoked",j.WALLET_PASSWORD_EXISTS="wallet_password_exists",j.OAUTH_STATE_MISMATCH="oauth_state_mismatch",j.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",j.DISALLOWED_LOGIN_METHOD="disallowed_login_method",j.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",j.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",j.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",j.CANNOT_SET_PASSWORD="cannot_set_password",j.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",j.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",j.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",j.USER_DOES_NOT_EXIST="user_does_not_exist",j.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",j.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",j.FEATURE_NOT_ENABLED="feature_not_enabled",j.INSUFFICIENT_FUNDS="insufficient_funds",j.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",j),C=class extends Error{toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a,n){super(t),this.code=a,this.status=e,this.responseData=n}},R=class extends C{constructor(e,t){super(400,e,t||"invalid_data")}},D=class extends C{constructor(e,t){super(401,e,t)}},N=class extends C{constructor(e,t){super(422,e,t)}};function U(e,t){return Object.keys(t).forEach((function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[a]}})})),e}function L(e,t,a,n){Object.defineProperty(e,t,{get:a,set:n,enumerable:!0,configurable:!0})}A.object({error:A.string(),cause:A.string().optional(),code:A.nativeEnum(w).optional()});var M={},W={};L(W,"AnalyticsEvent",(()=>x));let x={path:"/api/v1/analytics_events",method:"POST"};var F={};L(F,"AppConfig",(()=>G));let G={path:"/api/v1/apps/:app_id",method:"GET"};var V={};L(V,"CoinbaseOnRampInit",(()=>B)),L(V,"CoinbaseOnRampStatus",(()=>H));let B={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},H={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"};var Y={};L(Y,"GetCrossAppConnections",(()=>q));let q={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"};var K={};L(K,"CustomJWTAuthenticate",(()=>$));let $={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"};var z={};L(z,"FarcasterInit",(()=>X)),L(z,"FarcasterAuthenticate",(()=>J)),L(z,"FarcasterLink",(()=>Q)),L(z,"FarcasterUnlink",(()=>Z)),L(z,"FarcasterStatus",(()=>ee)),L(z,"FarcasterV2Init",(()=>te)),L(z,"FarcasterV2Authenticate",(()=>ae));let X={path:"/api/v1/farcaster/init",method:"POST"},J={path:"/api/v1/farcaster/authenticate",method:"POST"},Q={path:"/api/v1/farcaster/link",method:"POST"},Z={path:"/api/v1/farcaster/unlink",method:"POST"},ee={path:"/api/v1/farcaster/status",method:"GET"},te={path:"/api/v2/farcaster/init",method:"POST"},ae={path:"/api/v2/farcaster/authenticate",method:"POST"};var ne={};L(ne,"FarcasterSignerInit",(()=>re)),L(ne,"FarcasterSignerStatus",(()=>ie));let re={path:"/api/v1/farcaster/signer/init",method:"POST"},ie={path:"/api/v1/farcaster/signer/status",method:"POST"};var oe={};L(oe,"GuestAuthenticate",(()=>se));let se={path:"/api/v1/guest/authenticate",method:"POST"};var le={};L(le,"MfaPasskeyInit",(()=>ce)),L(le,"MfaPasskeyVerify",(()=>pe)),L(le,"MfaPasskeyEnrollment",(()=>de));let ce={path:"/api/v1/mfa/passkeys/init",method:"POST"},pe={path:"/api/v1/mfa/passkeys/verify",method:"POST"},de={path:"/api/v1/mfa/passkeys/enrollment",method:"POST"};var ue={};L(ue,"MfaPasswordlessSmsEnroll",(()=>_e)),L(ue,"MfaPasswordlessSmsVerify",(()=>me)),L(ue,"MfaPasswordlessSmsInit",(()=>ge)),L(ue,"MfaPasswordlessSmsUnenroll",(()=>be));let _e={path:"/api/v1/mfa/passwordless_sms/enroll",method:"POST"},me={path:"/api/v1/mfa/passwordless_sms/verify",method:"POST"},ge={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},be={path:"/api/v1/mfa/passwordless_sms/unenroll",method:"POST"};var he={};L(he,"MfaTotpEnroll",(()=>ye)),L(he,"MfaTotpVerify",(()=>ve)),L(he,"MfaTotpInit",(()=>Ie)),L(he,"MfaTotpUnenroll",(()=>fe));let ye={path:"/api/v1/mfa/totp/enroll",method:"POST"},ve={path:"/api/v1/mfa/totp/verify",method:"POST"},Ie={path:"/api/v1/mfa/totp/init",method:"POST"},fe={path:"/api/v1/mfa/totp/unenroll",method:"POST"};var Se={};L(Se,"OAuthAuthenticate",(()=>Te)),L(Se,"OAuthInit",(()=>Ee)),L(Se,"OAuthLink",(()=>Ae)),L(Se,"OAuthUnlink",(()=>ke));let Te={path:"/api/v1/oauth/authenticate",method:"POST"},Ee={path:"/api/v1/oauth/init",method:"POST"},Ae={path:"/api/v1/oauth/link",method:"POST"},ke={path:"/api/v1/oauth/unlink",method:"POST"};var Oe={};L(Oe,"OAuthProviderAuthorize",(()=>Pe)),L(Oe,"OAuthProviderVerify",(()=>je));let Pe={path:"/oauth/authorization_code",method:"POST"},je={path:"/oauth/verify",method:"POST"};var we={};L(we,"PasskeyLink",(()=>Ce)),L(we,"PasskeyAuthenticate",(()=>Re)),L(we,"PasskeyAuthenticateInit",(()=>De)),L(we,"PasskeyLinkInit",(()=>Ne)),L(we,"PasskeyUnlink",(()=>Ue));let Ce={path:"/api/v1/passkeys/link",method:"POST"},Re={path:"/api/v1/passkeys/authenticate",method:"POST"},De={path:"/api/v1/passkeys/authenticate/init",method:"POST"},Ne={path:"/api/v1/passkeys/link/init",method:"POST"},Ue={path:"/api/v1/passkeys/unlink",method:"POST"};var Le={};L(Le,"PasswordlessAuthenticate",(()=>Me)),L(Le,"PasswordlessInit",(()=>We)),L(Le,"PasswordlessLink",(()=>xe)),L(Le,"PasswordlessUnlink",(()=>Fe)),L(Le,"PasswordlessUpdate",(()=>Ge));let Me={path:"/api/v1/passwordless/authenticate",method:"POST"},We={path:"/api/v1/passwordless/init",method:"POST"},xe={path:"/api/v1/passwordless/link",method:"POST"},Fe={path:"/api/v1/passwordless/unlink",method:"POST"},Ge={path:"/api/v1/passwordless/update",method:"POST"};var Ve={};L(Ve,"PasswordlessSmsAuthenticate",(()=>Be)),L(Ve,"PasswordlessSmsInit",(()=>He)),L(Ve,"PasswordlessSmsLink",(()=>Ye)),L(Ve,"PasswordlessSmsUnlink",(()=>qe)),L(Ve,"PasswordlessSmsUpdate",(()=>Ke));let Be={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},He={path:"/api/v1/passwordless_sms/init",method:"POST"},Ye={path:"/api/v1/passwordless_sms/link",method:"POST"},qe={path:"/api/v1/passwordless_sms/unlink",method:"POST"},Ke={path:"/api/v1/passwordless_sms/update",method:"POST"};var $e={};L($e,"RecoveryKeyMaterial",(()=>ze)),L($e,"RecoveryOAuthInit",(()=>Xe)),L($e,"RecoveryOAuthAuthenticate",(()=>Je)),L($e,"RecoveryOAuthInitICloud",(()=>Qe)),L($e,"RecoveryOAuthCallbackICloudExpo",(()=>Ze)),L($e,"RecoveryConfigurationICloud",(()=>et));let ze={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},Xe={path:"/api/v1/recovery/oauth/init",method:"POST"},Je={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},Qe={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},Ze={path:"/api/v1/recovery/oauth/callback_icloud/:app_id/expo_ios",method:"GET"},et={path:"/api/v1/recovery/configuration_icloud",method:"POST"};var tt={};L(tt,"getPathWithParams",(()=>at));let at=(e,t)=>t?Object.entries(t).reduce(((e,[t,a])=>e.replace(`:${t}`,`${a}`)),e):e;var nt={};L(nt,"RefreshSession",(()=>rt)),L(nt,"Logout",(()=>it));let rt={path:"/api/v1/sessions",method:"POST"},it={path:"/api/v1/sessions/logout",method:"POST"};var ot={};L(ot,"GetSmartWalletConfig",(()=>st)),L(ot,"PostSmartWalletConfig",(()=>lt));let st={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},lt={path:"/api/v1/apps/:app_id/smart_wallets",method:"POST"};var ct={};L(ct,"SiweInit",(()=>pt)),L(ct,"SiweAuthenticate",(()=>dt)),L(ct,"SiweLink",(()=>ut)),L(ct,"SiweLinkSmartWallet",(()=>_t)),L(ct,"SiweUnlink",(()=>mt));let pt={path:"/api/v1/siwe/init",method:"POST"},dt={path:"/api/v1/siwe/authenticate",method:"POST"},ut={path:"/api/v1/siwe/link",method:"POST"},_t={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},mt={path:"/api/v1/siwe/unlink",method:"POST"};var gt={};L(gt,"SiwsInit",(()=>bt)),L(gt,"SiwsAuthenticate",(()=>ht)),L(gt,"SiwsLink",(()=>yt)),L(gt,"SiwsUnlink",(()=>vt));let bt={path:"/api/v1/siws/init",method:"POST"},ht={path:"/api/v1/siws/authenticate",method:"POST"},yt={path:"/api/v1/siws/link",method:"POST"},vt={path:"/api/v1/siws/unlink",method:"POST"};var It={};L(It,"AcceptTermsOnUser",(()=>ft));let ft={path:"/api/v1/users/me/accept_terms",method:"POST"};var St={};L(St,"TelegramAuthenticate",(()=>Tt)),L(St,"TelegramLink",(()=>Et)),L(St,"TelegramUnlink",(()=>At));let Tt={path:"/api/v1/telegram/authenticate",method:"POST"},Et={path:"/api/v1/telegram/link",method:"POST"},At={path:"/api/v1/telegram/unlink",method:"POST"};var kt={};L(kt,"MoonpayOnRampSign",(()=>Ot));let Ot={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"};U(M,W),U(M,F),U(M,V),U(M,Y),U(M,K),U(M,z),U(M,ne),U(M,oe),U(M,le),U(M,ue),U(M,he),U(M,Se),U(M,Oe),U(M,we),U(M,Le),U(M,Ve),U(M,$e),U(M,tt),U(M,nt),U(M,ot),U(M,ct),U(M,gt),U(M,It),U(M,St),U(M,kt);var Pt={},jt={};L(jt,"AnalyticsEventInput",(()=>wt));let wt=A.object({event_name:A.string().max(255),client_id:A.string().max(255).nullable(),payload:A.record(A.any()).optional()});var Ct={};L(Ct,"AccountIdFromPath",(()=>Bt)),L(Ct,"AppIdFromPath",(()=>Ht)),L(Ct,"Pagination",(()=>Yt));var Rt={};L(Rt,"UserId",(()=>Dt)),L(Rt,"Email",(()=>Nt)),L(Rt,"PasswordlessCode",(()=>Ut)),L(Rt,"WalletAddress",(()=>Lt)),L(Rt,"normalizeEthereumAddress",(()=>Gt)),L(Rt,"SolanaWalletAddress",(()=>Mt)),L(Rt,"PhoneNumber",(()=>Wt)),L(Rt,"normalizePhoneNumber",(()=>xt)),L(Rt,"isValidAddress",(()=>Ft)),L(Rt,"AuthenticateMode",(()=>Vt));let Dt=A.string({required_error:"Privy DID must be included",invalid_type_error:"Privy DID is not a valid string"}).min(1).transform((e=>e.replace("did:privy:",""))),Nt=A.string({required_error:"Email address must be provided",invalid_type_error:"Email address must be a valid string"}).email("Invalid email address").transform((e=>e.toLowerCase())),Ut=A.string({required_error:"Verification code must be provided",invalid_type_error:"Invalid verification code"}).length(6,"Verification code must have 6 digits."),Lt=A.string({required_error:"Ethereum address must be provided",invalid_type_error:"Invalid Ethereum address"}).transform(((e,t)=>Gt(e)||(t.addIssue({code:A.ZodIssueCode.custom,message:"Invalid Ethereum address"}),A.NEVER))),Mt=A.string({required_error:"Solana address must be provided",invalid_type_error:"Invalid Solana address"}).trim().transform(((e,t)=>{try{k.decode(e)}catch(e){return t.addIssue({code:A.ZodIssueCode.custom,message:"Invalid Solana address"}),A.NEVER}return e})),Wt=A.string({required_error:"Phone number must be included",invalid_type_error:"Phone number is not a valid string"}).refine((e=>{try{return void 0!==xt(e)}catch(e){return!1}}),{message:"Phone number is not valid"}).transform((e=>xt(e)||""));function xt(e){let t=P(e,"US");if(t?.isPossible())return t.formatInternational()}function Ft(e){return!!Gt(e)}function Gt(e){if("string"==typeof e)try{return O.utils.getAddress(e.trim())}catch(e){}}let Vt=A.object({mode:A.enum(["no-signup","login-or-sign-up"]).optional()}),Bt=A.object({account_id:A.string({required_error:"Account ID must be provided",invalid_type_error:"Account ID is not a valid string"}).min(1)}),Ht=A.object({app_id:A.string({required_error:"App ID must be provided",invalid_type_error:"App ID is not a valid string"}).min(1)}).transform((({app_id:e})=>({app_id:e,appId:e}))).catch((({error:e})=>{throw new R(e.message,w.MISSING_OR_INVALID_PRIVY_APP_ID)})),Yt=A.object({cursor:Dt.optional(),limit:A.coerce.number().max(100,{message:"Query limit can be at maximum 100 records."}).optional()});var qt={};L(qt,"AppResponseSchema",(()=>ta));var Kt={};L(Kt,"EmbeddedWalletConfigSchema",(()=>Xt)),L(Kt,"TelegramAuthConfigSchema",(()=>Jt)),L(Kt,"FundingMethodEnum",(()=>Qt)),L(Kt,"FundingMethodArraySchema",(()=>Zt)),L(Kt,"FundingConfigResponseSchema",(()=>ea));var $t={};L($t,"Currency",(()=>zt));let zt=E.object({chain:E.string(),asset:E.enum(["native-currency","USDC"]).optional()}),Xt=E.object({create_on_login:E.enum(["users-without-wallets","all-users","off"]),user_owned_recovery_options:E.array(E.enum(["user-passcode","google-drive","icloud"])),require_user_owned_recovery_on_create:E.boolean().optional(),require_user_password_on_create:E.boolean().optional()}),Jt=E.object({bot_id:E.string(),bot_name:E.string(),link_enabled:E.boolean(),seamless_auth_enabled:E.boolean()}),Qt=E.enum(["moonpay","coinbase-onramp","external"]),Zt=E.array(Qt),ea=E.object({default_recommended_currency:zt,default_recommended_amount:E.string(),methods:Zt,options:E.array(E.object({method:E.string(),provider:E.string()})),prompt_funding_on_wallet_creation:E.boolean(),cross_chain_bridging_enabled:E.boolean()}),ta=A.object({id:A.string(),name:A.string(),logo_url:A.string().nullable(),icon_url:A.string().nullable(),terms_and_conditions_url:A.string().nullable(),privacy_policy_url:A.string().nullable(),require_users_accept_terms:A.boolean().nullable(),theme:A.string(),accent_color:A.string().nullable(),show_wallet_login_first:A.boolean(),allowed_domains:A.array(A.string()),allowed_native_app_ids:A.array(A.string()),allowed_native_app_url_schemes:A.array(A.string()),wallet_auth:A.boolean(),email_auth:A.boolean(),sms_auth:A.boolean(),google_oauth:A.boolean(),twitter_oauth:A.boolean(),discord_oauth:A.boolean(),github_oauth:A.boolean(),spotify_oauth:A.boolean(),instagram_oauth:A.boolean(),tiktok_oauth:A.boolean(),linkedin_oauth:A.boolean(),apple_oauth:A.boolean(),farcaster_auth:A.boolean(),passkey_auth:A.boolean(),telegram_auth:A.boolean(),guest_auth:A.boolean(),solana_wallet_auth:A.boolean(),disable_plus_emails:A.boolean(),allowlist_enabled:A.boolean(),allowlist_config:A.object({error_title:A.string().nullable(),error_detail:A.string().nullable(),cta_text:A.string().nullable(),cta_link:A.string().nullable()}),wallet_connect_cloud_project_id:A.string().nullable(),custom_api_url:A.string().nullable(),embedded_wallet_config:Xt,enforce_wallet_uis:A.boolean(),legacy_wallet_ui_config:A.boolean(),fiat_on_ramp_enabled:A.boolean(),captcha_enabled:A.boolean(),twitter_oauth_on_mobile_enabled:A.boolean(),mfa_methods:A.array(A.enum(["sms","totp","passkey"])),captcha_site_key:A.string().optional(),verification_key:A.string(),telegram_auth_config:Jt.optional(),funding_config:ea.optional(),max_linked_wallets_per_user:A.number().nullable(),farcaster_link_wallets_enabled:A.boolean()});var aa={};L(aa,"CoinbaseOnRampInitInput",(()=>la)),L(aa,"CoinbaseOnRampInitResponse",(()=>ca)),L(aa,"CoinbaseOnRampStatusResponse",(()=>pa));let na=A.enum(["ethereum","bitcoin","base","avacchain","optimism","solana","polygon","arbitrum","stellar"]),ra=A.enum(["eth","ETH","USDC"]).transform((e=>e.toUpperCase())),ia=A.enum(["SOL","USDC"]).transform((e=>e.toUpperCase())),oa=A.object({addresses:A.array(A.object({address:Lt,blockchains:A.array(na)})).max(1).min(1),assets:A.array(ra).optional()}),sa=A.object({addresses:A.array(A.object({address:Mt,blockchains:A.array(na)})).max(1).min(1),assets:A.array(ia).optional()}),la=A.union([oa,sa]),ca=A.object({app_id:A.string(),session_token:A.string(),channel_id:A.string(),partner_user_id:A.string()}),pa=A.object({status:A.enum(["pending","success","failure"])});var da={};L(da,"CrossAppConnectionsResponse",(()=>ua));let ua=A.object({connections:A.array(A.object({provider_app_id:A.string(),provider_app_name:A.string(),provider_app_icon_url:A.string().url().nullable(),provider_app_custom_api_url:A.string().url().nullable(),read_only:A.boolean()}))});var _a={};L(_a,"AuthenticateJwtInput",(()=>ma));let ma=E.object({token:E.string().optional()});var ga={};L(ga,"VerifyEmailInput",(()=>ha)),L(ga,"AuthenticateEmailInput",(()=>ya)),L(ga,"InitEmailInput",(()=>va)),L(ga,"UnlinkEmailInput",(()=>Ia)),L(ga,"UpdateEmailInput",(()=>fa)),L(ga,"TransferEmailInput",(()=>Sa));let ba=A.object({nonce:A.string()}),ha=A.object({code:Ut,email:Nt}),ya=ha.merge(Vt),va=A.object({email:Nt,token:A.string().optional()}),Ia=A.object({address:Nt}),fa=A.object({oldAddress:Nt,newAddress:Nt,code:Ut}),Sa=ba.extend({email:Nt});var Ta={};L(Ta,"JsonWebKey",(()=>Ea)),L(Ta,"JsonWebKeySet",(()=>Aa));let Ea=A.object({kty:A.string(),use:A.enum(["sig","enc"]).optional(),key_ops:A.array(A.enum(["sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits"])).optional(),alg:A.enum(["RS256"]),kid:A.string().optional(),x5u:A.string().optional(),x5c:A.array(A.string()).optional(),x5t:A.string().optional(),"x5t#S256":A.string().optional(),n:A.string().optional(),e:A.string().optional(),d:A.string().optional()}),Aa=A.object({keys:A.array(Ea)});var ka={};L(ka,"FarcasterConnectInitResponse",(()=>Oa)),L(ka,"FarcasterConnectStatusCompletedResponse",(()=>Pa)),L(ka,"FarcasterConnectStatusPendingResponse",(()=>ja)),L(ka,"FarcasterAuthenticateInput",(()=>wa)),L(ka,"FarcasterLinkInput",(()=>Ca)),L(ka,"FarcasterInitInput",(()=>Ra)),L(ka,"FarcasterUnlinkInput",(()=>Da)),L(ka,"TransferFarcasterInput",(()=>Na)),L(ka,"FarcasterV2InitInput",(()=>Ua)),L(ka,"FarcasterV2InitResponse",(()=>La)),L(ka,"FarcasterV2AuthenticateInput",(()=>Ma));let Oa=A.object({channel_token:A.string(),connect_uri:A.string()}),Pa=A.object({state:A.literal("completed"),nonce:A.string(),message:A.string(),signature:A.string(),fid:A.number(),username:A.string(),display_name:A.string(),bio:A.string(),pfp_url:A.string()}),ja=A.object({state:A.literal("pending"),nonce:A.string()}),wa=A.object({channel_token:A.string(),message:A.string(),signature:A.string(),fid:A.number()}).merge(Vt),Ca=A.object({channel_token:A.string(),message:A.string(),signature:A.string(),fid:A.number()}),Ra=A.object({token:A.string().optional(),redirect_url:A.string().url().optional(),relying_party:A.string().optional()}),Da=A.object({fid:A.number()}),Na=ba.extend({farcaster_id:A.string(),farcaster_embedded_address:A.string()}),Ua=A.object({}),La=A.object({nonce:A.string(),expires_at:A.string()}),Ma=A.object({fid:A.number(),message:A.string(),signature:A.string()}).merge(Vt);var Wa={};L(Wa,"FarcasterSignerInitInput",(()=>xa)),L(Wa,"FarcasterSignerInitResponse",(()=>Fa)),L(Wa,"FarcasterSignerStatusResponse",(()=>Ga));let xa=A.object({ed25519_public_key:A.string().refine((e=>e.startsWith("0x")&&66===e.length)),deadline:A.bigint().optional().default((()=>BigInt(Math.floor(Date.now()/1e3)+3600)))}),Fa=A.discriminatedUnion("status",[A.object({public_key:A.string(),status:A.literal("pending_approval"),signer_approval_url:A.string()}),A.object({public_key:A.string(),status:A.literal("approved"),fid:A.bigint()}),A.object({public_key:A.string(),status:A.literal("revoked"),fid:A.bigint()})]),Ga=A.discriminatedUnion("status",[A.object({public_key:A.string(),status:A.literal("pending_approval")}),A.object({public_key:A.string(),status:A.literal("approved"),fid:A.bigint()}),A.object({public_key:A.string(),status:A.literal("revoked"),fid:A.bigint()})]);var Va={};L(Va,"AuthenticateGuestInput",(()=>Ba));let Ba=A.object({guest_credential:A.string().length(43)}).strict();var Ha={};L(Ha,"EmailIdTokenEntry",(()=>zn)),L(Ha,"PhoneIdTokenEntry",(()=>Xn)),L(Ha,"EthereumIdTokenEntry",(()=>Jn)),L(Ha,"SolanaIdTokenEntry",(()=>Qn)),L(Ha,"FarcasterIdTokenEntry",(()=>Zn)),L(Ha,"PasskeyIdTokenEntry",(()=>er)),L(Ha,"TelegramIdTokenEntry",(()=>tr)),L(Ha,"EthereumEmbeddedWalletIdTokenEntry",(()=>ar)),L(Ha,"SolanaEmbeddedWalletIdTokenEntry",(()=>nr)),L(Ha,"GoogleOauthIdTokenEntry",(()=>rr)),L(Ha,"TwitterOauthIdTokenEntry",(()=>ir)),L(Ha,"DiscordOauthIdTokenEntry",(()=>or)),L(Ha,"GithubOauthIdTokenEntry",(()=>sr)),L(Ha,"LinkedInOauthIdTokenEntry",(()=>lr)),L(Ha,"SpotifyOauthIdTokenEntry",(()=>cr)),L(Ha,"InstagramOauthIdTokenEntry",(()=>pr)),L(Ha,"TiktokOauthIdTokenEntry",(()=>dr)),L(Ha,"AppleOauthIdTokenEntry",(()=>ur)),L(Ha,"CustomJwtIdTokenEntry",(()=>_r)),L(Ha,"CrossAppIdTokenEntry",(()=>mr)),L(Ha,"SmartWalletIdTokenEntry",(()=>gr));var Ya={};L(Ya,"EmailAccount",(()=>ln)),L(Ya,"PhoneAccount",(()=>cn)),L(Ya,"BaseWalletAccount",(()=>pn)),L(Ya,"EthereumAccount",(()=>dn)),L(Ya,"SmartWalletAccount",(()=>un)),L(Ya,"SolanaAccount",(()=>_n)),L(Ya,"FarcasterAccount",(()=>mn)),L(Ya,"PasskeyAccount",(()=>gn)),L(Ya,"TelegramAccount",(()=>bn)),L(Ya,"EthereumEmbeddedWalletAccount",(()=>vn)),L(Ya,"SolanaEmbeddedWalletAccount",(()=>In)),L(Ya,"BitcoinSegwitEmbeddedWalletAccount",(()=>fn)),L(Ya,"BitcoinTaprootEmbeddedWalletAccount",(()=>Sn)),L(Ya,"GoogleOauthAccount",(()=>Tn)),L(Ya,"TwitterOauthAccount",(()=>En)),L(Ya,"DiscordOauthAccount",(()=>An)),L(Ya,"GithubOauthAccount",(()=>kn)),L(Ya,"LinkedInOauthAccount",(()=>On)),L(Ya,"SpotifyOauthAccount",(()=>Pn)),L(Ya,"InstagramOauthAccount",(()=>jn)),L(Ya,"TiktokOauthAccount",(()=>wn)),L(Ya,"AppleOauthAccount",(()=>Cn)),L(Ya,"CustomJwtAccount",(()=>Rn)),L(Ya,"CrossAppEmbeddedWallet",(()=>Dn)),L(Ya,"CrossAppSmartWallet",(()=>Nn)),L(Ya,"CrossAppAccount",(()=>Un)),L(Ya,"LinkedAccount",(()=>Ln)),L(Ya,"SmsMfaMethod",(()=>Mn)),L(Ya,"TotpMfaMethod",(()=>Wn)),L(Ya,"PasskeyMfaMethod",(()=>xn)),L(Ya,"LinkedMfaMethod",(()=>Fn)),L(Ya,"CustomMetadata",(()=>Gn)),L(Ya,"OAuthTokens",(()=>Vn)),L(Ya,"User",(()=>Bn)),L(Ya,"SessionUpdateActionEnum",(()=>Hn)),L(Ya,"AuthenticatedUser",(()=>Yn)),L(Ya,"LoggedOutUser",(()=>qn)),L(Ya,"MaybeUser",(()=>Kn));var qa={};L(qa,"SmartWalletProvider",(()=>Za)),L(qa,"AlchemyPaymasterContextSchema",(()=>tn)),L(qa,"SmartWalletNetworkConfigurationInputSchema",(()=>nn)),L(qa,"SmartWalletConfigurationSchema",(()=>rn)),L(qa,"SmartWalletConfigurationInputSchema",(()=>on)),L(qa,"SmartWalletConfigurationResponseSchema",(()=>sn)),L(qa,"SAFE",(()=>Ka)),L(qa,"KERNEL",(()=>$a)),L(qa,"LIGHT_ACCOUNT",(()=>Xa)),L(qa,"BICONOMY",(()=>za)),L(qa,"COINBASE_SMART_WALLET",(()=>Ja)),L(qa,"SUPPORTED_SMART_WALLET_TYPES",(()=>Qa));let Ka="safe",$a="kernel",za="biconomy",Xa="light_account",Ja="coinbase_smart_wallet",Qa=[Ka,$a,za,Xa,Ja],Za=A.enum(Qa,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),en=A.string().regex(/^eip155:\d+$/,"Chain ID must be an eip155 chain ID"),tn=A.object({policy_id:A.string().uuid()}),an=A.object({chain_id:en,bundler_url:A.string(),paymaster_url:A.string().optional(),rpc_url:A.string().optional(),chain_name:A.string().optional(),paymaster_context:tn.optional()}),nn=A.object({chain_id:en,bundler_url:A.string().optional(),paymaster_url:A.string().optional(),rpc_url:A.string().optional(),chain_name:A.string().optional(),paymaster_context:tn.optional()}),rn=A.discriminatedUnion("enabled",[A.object({enabled:A.literal(!1)}),A.object({enabled:A.literal(!0),smart_wallet_type:Za,configured_networks:A.array(an).min(1)})]),on=A.discriminatedUnion("enabled",[A.object({enabled:A.literal(!1)}),A.object({enabled:A.literal(!0),smart_wallet_type:Za,configured_networks:A.array(nn).min(1)})]),sn=rn,ln=A.object({type:A.literal("email"),address:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),cn=A.object({type:A.literal("phone"),phoneNumber:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),pn=A.object({type:A.enum(["wallet","smart_wallet"]),address:A.string(),chain_type:A.enum(["solana","ethereum"])}),dn=A.object({type:A.literal("wallet"),address:A.string(),chain_id:A.string().optional(),chain_type:A.literal("ethereum"),wallet_client:A.literal("unknown"),wallet_client_type:A.string().optional(),connector_type:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),un=A.object({type:A.literal("smart_wallet"),address:A.string(),smart_wallet_type:Za,verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),_n=A.object({type:A.literal("wallet"),address:A.string(),chain_type:A.literal("solana"),wallet_client:A.literal("unknown"),wallet_client_type:A.string().optional(),connector_type:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),mn=A.object({type:A.literal("farcaster"),fid:A.number(),owner_address:Lt,username:A.string().optional(),display_name:A.string().optional(),bio:A.string().optional(),profile_picture:A.string().optional(),profile_picture_url:A.string().optional(),homepage_url:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable(),signer_public_key:A.string().optional()}),gn=A.object({type:A.literal("passkey"),created_with_browser:A.string().optional(),created_with_os:A.string().optional(),created_with_device:A.string().optional(),credential_id:A.string(),authenticator_name:A.string().optional(),enrolled_in_mfa:A.boolean(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),bn=A.object({type:A.literal("telegram"),telegram_user_id:A.string(),first_name:A.string().nullish(),last_name:A.string().nullish(),username:A.string().nullish(),photo_url:A.string().nullish(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}).transform((e=>({...e,telegramUserId:e.telegram_user_id,firstName:e.first_name}))),hn=A.enum(["privy","user-passcode","google-drive","icloud"]),yn=A.object({type:A.literal("wallet"),address:A.string(),imported:A.boolean().default(!1),delegated:A.boolean().default(!1),wallet_index:A.number(),chain_id:A.string(),chain_type:A.string(),wallet_client:A.literal("privy"),wallet_client_type:A.literal("privy"),connector_type:A.literal("embedded"),recovery_method:hn,verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),vn=yn.merge(A.object({chain_type:A.literal("ethereum")})),In=yn.merge(A.object({chain_type:A.literal("solana"),public_key:A.string()})),fn=yn.merge(A.object({chain_type:A.literal("bitcoin-segwit"),public_key:A.string()})),Sn=yn.merge(A.object({chain_type:A.literal("bitcoin-taproot"),public_key:A.string()})),Tn=A.object({type:A.literal("google_oauth"),subject:A.string(),email:A.string(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),En=A.object({type:A.literal("twitter_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),profile_picture_url:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),An=A.object({type:A.literal("discord_oauth"),subject:A.string(),username:A.string().nullable(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),kn=A.object({type:A.literal("github_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),On=A.object({type:A.literal("linkedin_oauth"),subject:A.string(),name:A.string().optional(),email:A.string().nullable(),vanity_name:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Pn=A.object({type:A.literal("spotify_oauth"),subject:A.string(),email:A.string().nullable(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),jn=A.object({type:A.literal("instagram_oauth"),subject:A.string(),username:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),wn=A.object({type:A.literal("tiktok_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Cn=A.object({type:A.literal("apple_oauth"),subject:A.string(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Rn=A.object({type:A.literal("custom_auth"),custom_user_id:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Dn=A.object({address:A.string()}),Nn=A.object({address:A.string()}),Un=A.object({type:A.literal("cross_app"),subject:A.string(),provider_app_id:A.string(),embedded_wallets:A.array(Dn),smart_wallets:A.array(Nn),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Ln=A.union([ln,cn,dn,_n,un,vn,In,fn,Sn,Tn,En,An,kn,Pn,jn,wn,On,Cn,Rn,mn,gn,bn,Un]),Mn=A.object({type:A.literal("sms"),verified_at:A.number()}),Wn=A.object({type:A.literal("totp"),verified_at:A.number()}),xn=A.object({type:A.literal("passkey"),verified_at:A.number()}),Fn=A.union([Mn,Wn,xn]),Gn=A.record(A.string(),A.union([A.string(),A.number(),A.boolean()])),Vn=A.object({provider:A.string(),access_token:A.string(),access_token_expires_in_seconds:A.number().optional(),refresh_token:A.string().optional(),refresh_token_expires_in_seconds:A.number().optional(),scopes:A.array(A.string()).optional()}),Bn=A.object({id:A.string(),linked_accounts:A.array(Ln),mfa_methods:A.array(Fn),created_at:A.number(),has_accepted_terms:A.boolean(),is_guest:A.boolean(),custom_metadata:Gn.optional()}),Hn=A.enum(["set","ignore","clear"]),Yn=A.object({user:Bn,token:A.string().min(1).nullable(),privy_access_token:A.string().min(1).nullable(),refresh_token:A.string().min(1).nullable(),identity_token:A.string().min(1).optional(),is_new_user:A.boolean().optional(),oauth_tokens:Vn.optional(),oauth_provider_tokens:A.object({provider:A.string(),access_token:A.string(),access_token_expires_in_seconds:A.number().optional(),refresh_token:A.string().optional(),scopes:A.array(A.string()).optional()}).optional(),session_update_action:Hn}),qn=A.object({user:A.null(),token:A.null(),refresh_token:A.null(),session_update_action:A.literal(Hn.Values.clear)}),Kn=A.union([Yn,qn]),$n={lv:A.number().nullable()},zn=ln.pick({type:!0,address:!0}).extend($n),Xn=cn.pick({type:!0,phoneNumber:!0}).extend($n).transform((({phoneNumber:e,...t})=>({phone_number:e,...t}))),Jn=dn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),Qn=_n.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),Zn=mn.pick({type:!0,fid:!0,username:!0,owner_address:!0}).extend($n).transform((({owner_address:e,...t})=>({oa:e,...t}))),er=gn.pick({type:!0,credential_id:!0}).extend($n),tr=A.object({type:A.literal("telegram"),telegram_user_id:A.string(),username:A.string().nullish(),lv:A.number().nullable()}),ar=vn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),nr=In.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),rr=Tn.pick({type:!0,subject:!0,email:!0}).extend($n),ir=En.pick({type:!0,subject:!0,username:!0}).extend($n),or=An.pick({type:!0,subject:!0,username:!0}).extend($n),sr=kn.pick({type:!0,subject:!0,username:!0}).extend($n),lr=On.pick({type:!0,subject:!0,email:!0}).extend($n),cr=Pn.pick({type:!0,subject:!0,email:!0}).extend($n),pr=jn.pick({type:!0,subject:!0,username:!0}).extend($n),dr=wn.pick({type:!0,subject:!0,username:!0}).extend($n),ur=Cn.pick({type:!0,subject:!0,email:!0}).extend($n),_r=Rn.pick({type:!0,custom_user_id:!0}).extend($n),mr=Un.pick({type:!0,subject:!0,provider_app_id:!0,embedded_wallets:!0,smart_wallets:!0}).extend($n),gr=un.pick({type:!0,smart_wallet_type:!0,address:!0}).extend($n);var br={};L(br,"MfaVerifyResponse",(()=>hr)),L(br,"MfaSmsInitInput",(()=>Ir)),L(br,"MfaSmsAuthenticateEnrollInput",(()=>fr)),L(br,"MfaSmsEnrollInput",(()=>Sr)),L(br,"MfaSmsVerifyInput",(()=>Tr)),L(br,"MfaTotpInput",(()=>Er)),L(br,"ResponseTotpInitMfa",(()=>Ar));let hr=E.object({token:E.string()}).strict(),yr=E.object({action:E.literal("verify")}).strict(),vr=E.object({action:E.literal("enroll"),phoneNumber:Wt}).strict(),Ir=E.union([yr,vr]),fr=E.object({action:E.literal("enroll").optional(),code:Ut,phoneNumber:Wt}).strict(),Sr=E.object({code:Ut,phoneNumber:Wt}).strict(),Tr=E.object({code:Ut}).strict(),Er=E.object({code:Ut}).strict(),Ar=E.object({totpSecret:E.string(),totpAuthUrl:E.string()}).strict();var kr={};L(kr,"MfaPasskeyInitInput",(()=>Wr)),L(kr,"ResponsePasskeyInitMfa",(()=>xr)),L(kr,"MfaPasskeyVerifyInput",(()=>Fr)),L(kr,"MfaEnrollmentPasskeyInput",(()=>Gr));var Or={};L(Or,"PasskeyAuthenticatorVerifyOptions",(()=>Pr)),L(Or,"PasskeyAuthenticatorEnrollmentOptions",(()=>jr)),L(Or,"PasskeyAuthenticatorVerifyResponse",(()=>wr)),L(Or,"PasskeyAuthenticatorEnrollmentResponse",(()=>Cr)),L(Or,"PasskeyInitInput",(()=>Rr)),L(Or,"ResponsePasskeyInitAuthenticate",(()=>Dr)),L(Or,"ResponsePasskeyInitLink",(()=>Nr)),L(Or,"PasskeyLinkInput",(()=>Ur)),L(Or,"PasskeyAuthenticateInput",(()=>Lr)),L(Or,"UnlinkPasskeyInput",(()=>Mr));let Pr=E.object({challenge:E.string(),timeout:E.number().optional(),rp_id:E.string().optional(),allow_credentials:E.array(E.object({id:E.string(),type:E.string(),transports:E.array(E.string()).optional()})).optional(),user_verification:E.string().optional(),extensions:E.object({app_id:E.string().optional(),cred_props:E.boolean().optional(),hmac_create_secret:E.boolean().optional()}).optional()}),jr=E.object({rp:E.object({name:E.string(),id:E.string().optional()}),user:E.object({id:E.string(),name:E.string(),display_name:E.string()}),challenge:E.string(),pub_key_cred_params:E.array(E.object({alg:E.number(),type:E.literal("public-key")})),timeout:E.number().optional(),exclude_credentials:E.array(E.object({id:E.string(),type:E.string(),transports:E.array(E.string()).optional()})).optional(),authenticator_selection:E.object({authenticator_attachment:E.string().optional(),require_resident_key:E.boolean().optional(),resident_key:E.string().optional(),user_verification:E.string().optional()}).optional(),attestation:E.string().optional(),extensions:E.object({app_id:E.string().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}).optional()}),wr=E.object({id:E.string(),raw_id:E.string(),response:E.object({client_data_json:E.string(),authenticator_data:E.string(),signature:E.string(),user_handle:E.string().optional()}),authenticator_attachment:E.string().optional(),client_extension_results:E.object({app_id:E.boolean().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}),type:E.literal("public-key")}),Cr=E.object({id:E.string(),raw_id:E.string(),response:E.object({client_data_json:E.string(),attestation_object:E.string(),authenticator_data:E.string().optional(),transports:E.array(E.any()).optional(),public_key_algorithm:E.number().optional(),public_key:E.string().optional()}),authenticator_attachment:E.string().optional(),client_extension_results:E.object({app_id:E.boolean().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}),type:E.literal("public-key")}),Rr=E.object({relying_party:E.string().url().optional(),token:E.string().optional()}).strict(),Dr=E.object({relying_party:E.string().url().optional(),options:Pr}).strict(),Nr=E.object({relying_party:E.string().url().optional(),options:jr}).strict(),Ur=E.object({relying_party:E.string().url().optional(),authenticator_response:Cr}).strict(),Lr=E.object({relying_party:E.string().url().optional(),challenge:E.string(),authenticator_response:wr}).strict(),Mr=E.object({credential_id:E.string()}),Wr=E.object({relying_party:E.string().url().optional()}).strict(),xr=E.object({options:Pr}).strict(),Fr=E.object({authenticator_response:wr,relying_party:E.string().url().optional()}).strict(),Gr=E.object({credential_ids:E.array(E.string())});var Vr={};L(Vr,"ExternalOAuthProvider",(()=>Hr)),L(Vr,"OAuthProvider",(()=>Yr)),L(Vr,"AuthenticateOauthInput",(()=>qr)),L(Vr,"OAuthInitInput",(()=>Kr)),L(Vr,"LinkOAuthInput",(()=>$r)),L(Vr,"OAuthUnlinkInput",(()=>zr)),L(Vr,"OAuthInitResponse",(()=>Xr)),L(Vr,"OAuthLinkResponse",(()=>Jr)),L(Vr,"TransferOAuthInput",(()=>Qr)),L(Vr,"SUPPORTED_OAUTH_PROVIDERS",(()=>Br));let Br=["google","discord","twitter","github","spotify","instagram","tiktok","linkedin","apple"],Hr=A.enum(Br,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Yr=Hr.or(A.custom((e=>"string"==typeof e&&/^privy:[a-z0-9]{25}$/i.test(e)),{message:"Please specify a supported provider."})),qr=A.object({authorization_code:A.string(),state_code:A.string(),code_verifier:A.string().min(43).max(128).optional(),code_type:A.enum(["raw"]).optional()}).merge(Vt).catch((()=>{throw new D("Please specify authorization_code and state_code.",w.INVALID_CREDENTIALS)})),Kr=A.object({redirect_to:A.string({required_error:"Please provide a redirect_to value."}),provider:Yr,token:A.string().optional(),state_code:A.string().optional(),code_challenge:A.string().optional()}),$r=A.object({authorization_code:A.string(),state_code:A.string(),code_verifier:A.string().min(43).max(128).optional(),code_type:A.enum(["raw"]).optional()}),zr=A.object({subject:A.string(),provider:Yr}),Xr=A.object({url:A.string()}),Jr=Bn.extend({oauth_tokens:Vn.optional()}),Qr=ba.extend({userInfo:A.object({subject:A.string(),name:A.string().optional(),username:A.string().optional(),profilePictureUrl:A.string().optional(),email:A.string().optional(),vanityName:A.string().optional()})});var Zr={};L(Zr,"AuthorizationCodeInput",(()=>ei));let ei=A.object({redirect_to:A.string(),state:A.string(),code_challenge:A.string()});var ti={};L(ti,"EmptyObject",(()=>ai)),L(ti,"SuccessObject",(()=>ni));let ai=A.record(A.string(),A.never()),ni=A.object({success:A.boolean()});var ri={};L(ri,"RecoveryKeyMaterialInput",(()=>ii)),L(ri,"RecoveryKeyMaterialResponse",(()=>oi)),L(ri,"OAuthAuthenticateRecoveryResponse",(()=>si)),L(ri,"OAuthInitRecoveryInput",(()=>li)),L(ri,"OAuthInitICloudRecoveryInput",(()=>ci)),L(ri,"OAuthCallbackICloudExpoInput",(()=>pi)),L(ri,"OAuthCallbackICloudExpoResponse",(()=>di)),L(ri,"RecoveryConfigurationICloudInput",(()=>ui)),L(ri,"RecoveryConfigurationICloudResponse",(()=>_i));let ii=A.object({chain_type:A.string().optional()}),oi=A.object({recovery_type:A.enum(["user_passcode_derived_recovery_key","privy_passcode_derived_recovery_key","privy_generated_recovery_key","google_drive_recovery_secret","icloud_recovery_secret"]),recovery_key_derivation_salt:A.string(),recovery_code:A.string(),recovery_key:A.string(),file_id:A.string(),icloud_record_name:A.string()}),si=A.object({access_token:A.string()}),li=A.object({redirect_to:A.string({required_error:"Please provide a redirect_to value."}),token:A.string().optional(),state_code:A.string().optional(),code_challenge:A.string().optional()}),ci=A.object({client_type:A.enum(["web","expo-ios"])}),pi=A.object({ckWebAuthToken:A.string()}).transform((e=>({ckWebAuthToken:e.ckWebAuthToken}))).catch((()=>{throw new D("Missing ckWebAuthToken.",w.INVALID_DATA)})),di=ai,ui=A.object({client_type:A.enum(["web","expo-ios"])}),_i=A.object({api_token:A.string(),container_identifier:A.string(),environment:A.string()});var mi={};L(mi,"SiweInput",(()=>gi)),L(mi,"SmartWalletSiweInput",(()=>bi)),L(mi,"AuthenticateSiweInput",(()=>hi)),L(mi,"SiweAddressInput",(()=>yi)),L(mi,"SiweInitInput",(()=>vi)),L(mi,"SiweNonce",(()=>Ii)),L(mi,"TransferSiweInput",(()=>fi));let gi=A.object({message:A.string({invalid_type_error:"Invalid SIWE message"}),signature:A.string({invalid_type_error:"Invalid SIWE signature"}),chainId:A.string().max(41).nullable().default(null),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)}),bi=A.object({message:A.string({invalid_type_error:"Invalid SIWE message"}),signature:A.string({invalid_type_error:"Invalid SIWE signature"}),smart_wallet_type:Za}),hi=gi.merge(Vt),yi=A.object({address:Lt}),vi=A.object({address:Lt,token:A.string().optional()}),Ii=A.object({nonce:A.string(),address:A.string(),expires_at:A.string()}),fi=ba.extend({address:Lt,chainId:A.string().max(41).nullable().default(null),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)});var Si={};L(Si,"SiwsInput",(()=>Ti)),L(Si,"AuthenticateSiwsInput",(()=>Ei)),L(Si,"SiwsAddressInput",(()=>Ai)),L(Si,"SiwsInitInput",(()=>ki)),L(Si,"SiwsNonce",(()=>Oi));let Ti=A.object({message:A.string({invalid_type_error:"Invalid SIWS message"}),signature:A.string({invalid_type_error:"Invalid SIWS signature"}),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)}),Ei=Ti.merge(Vt),Ai=A.object({address:Mt}),ki=A.object({address:Mt,token:A.string().optional()}),Oi=A.object({nonce:A.string(),address:A.string(),expires_at:A.string()});var Pi={};L(Pi,"VerifyPhoneInput",(()=>ji)),L(Pi,"AuthenticatePhoneInput",(()=>wi)),L(Pi,"PasswordlessSmsPhoneInput",(()=>Ci)),L(Pi,"UnlinkPhoneInput",(()=>Ri)),L(Pi,"UpdatePhoneInput",(()=>Di)),L(Pi,"TransferPhoneInput",(()=>Ni));let ji=A.object({code:Ut.catch((()=>{throw new N("Invalid SMS verification code",w.INVALID_CREDENTIALS)})),phoneNumber:Wt.catch((()=>{throw new N("Invalid phone number",w.INVALID_CREDENTIALS)}))}),wi=ji.merge(Vt),Ci=A.object({phoneNumber:Wt.catch((()=>{throw new N("Invalid phone number, not formatted correctly",w.INVALID_DATA)})),token:A.string().optional()}),Ri=A.object({phoneNumber:Wt}),Di=A.object({old_phone_number:Wt,new_phone_number:Wt,code:Ut}),Ni=ba.extend({phoneNumber:Wt});var Ui={};L(Ui,"TelegramAuthenticateInput",(()=>Mi)),L(Ui,"TelegramLinkInput",(()=>Wi)),L(Ui,"TelegramUnlinkInput",(()=>xi)),L(Ui,"TransferTelegramInput",(()=>Fi));let Li=E.object({id:E.coerce.number(),first_name:E.string(),auth_date:E.coerce.number(),hash:E.string(),username:E.string().optional(),last_name:E.string().optional(),photo_url:E.string().optional()}),Mi=E.object({captcha_token:E.string().optional(),telegram_auth_result:Li.optional(),telegram_web_app_data:E.object({query_id:E.string().optional(),auth_date:E.coerce.number(),hash:E.string(),user:E.string(),chat_instance:E.string().optional(),chat_type:E.string().optional(),start_param:E.string().optional(),signature:E.string().optional()}).optional()}).merge(Vt),Wi=Mi.omit({telegram_web_app_data:!0}).required({telegram_auth_result:!0}),xi=E.object({telegram_user_id:E.string()}),Fi=ba.extend({telegram_auth_result:Li});var Gi={};L(Gi,"RefreshTokenInput",(()=>Vi)),L(Gi,"OptionalRefreshTokenInput",(()=>Bi)),L(Gi,"ForkedToken",(()=>Hi));let Vi=A.object({refresh_token:A.string()}),Bi=Vi.partial(),Hi=A.object({token:A.string(),refresh_token:A.string(),new_session_refresh_token:A.string()});var Yi={};L(Yi,"DelegatedActionsConsentInput",(()=>qi));let qi=A.object({encrypted_tee_share:A.string(),app_share:A.string(),delegated_addresses:A.array(A.object({chain_type:A.union([A.literal("solana"),A.literal("ethereum")]),address:A.string(),wallet_index:A.number().default(0)}))});var Ki={};L(Ki,"CAIP2",(()=>$i)),L(Ki,"AuthorizationKeyRole",(()=>Ji)),L(Ki,"WalletApiSolanaSignTransactionRpcInput",(()=>Qi)),L(Ki,"WalletApiSolanaSignAndSendTransactionRpcInput",(()=>Zi)),L(Ki,"WalletApiSolanaSignMessageRpcInput",(()=>eo)),L(Ki,"UnsignedEthereumTransaction",(()=>no)),L(Ki,"WalletApiEthereumSignTransactionRpcInput",(()=>ro)),L(Ki,"WalletApiEthereumSendTransactionRpcInput",(()=>io)),L(Ki,"WalletApiEthereumPersonalSignRpcInputParams",(()=>oo)),L(Ki,"WalletApiEthereumPersonalSignRpcInput",(()=>so)),L(Ki,"WalletApiEthereumSignTypedDataRpcInput",(()=>lo)),L(Ki,"WalletApiEthereumRpcInput",(()=>co)),L(Ki,"WalletApiSolanaRpcInput",(()=>po)),L(Ki,"WalletApiRpcInput",(()=>uo)),L(Ki,"WalletApiSolanaSignTransactionRpcResponse",(()=>_o)),L(Ki,"WalletApiSolanaSignAndSendTransactionRpcResponse",(()=>mo)),L(Ki,"WalletApiSolanaSignMessageRpcResponse",(()=>go)),L(Ki,"WalletApiEthereumSignTransactionRpcResponse",(()=>bo)),L(Ki,"WalletApiEthereumSendTransactionRpcResponse",(()=>ho)),L(Ki,"WalletApiEthereumPersonalSignRpcResponse",(()=>yo)),L(Ki,"WalletApiEthereumSignTypedDataRpcResponse",(()=>vo)),L(Ki,"WalletApiRpcResponse",(()=>Io)),L(Ki,"WalletApiRegisterAuthorizationKeyInput",(()=>fo)),L(Ki,"WalletResponse",(()=>To)),L(Ki,"WalletApiCreateInput",(()=>Eo)),L(Ki,"WalletApiCreateResponse",(()=>Ao)),L(Ki,"WalletIdFromPath",(()=>ko)),L(Ki,"WalletApiRevokeAuthorizationKeyInput",(()=>Oo));let $i=A.string().regex(/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/,"Chain ID must be a valid CAIP-2 chain ID, e.g. 'eip155:1'"),zi=A.object({address:Mt.optional(),chain_type:A.literal("solana").optional()}),Xi=A.object({address:Lt.optional(),chain_type:A.literal("ethereum").optional()}),Ji=A.enum(["root","manager"]).nullable(),Qi=A.object({method:A.literal("signTransaction"),params:A.object({transaction:A.string(),encoding:A.literal("base64")})}).merge(zi),Zi=A.object({method:A.literal("signAndSendTransaction"),caip2:$i,params:A.object({transaction:A.string(),encoding:A.literal("base64")})}).merge(zi),eo=A.object({method:A.literal("signMessage"),params:A.object({message:A.string(),encoding:A.literal("base64")})}).merge(zi),to=A.string().startsWith("0x"),ao=A.union([to,A.number()]),no=A.object({from:Lt.optional(),to:Lt.optional(),chain_id:ao.optional(),nonce:ao.optional(),data:to.optional(),value:ao.optional(),type:A.union([A.literal(0),A.literal(1),A.literal(2)]).optional(),gas_limit:ao.optional(),gas_price:ao.optional(),max_fee_per_gas:ao.optional(),max_priority_fee_per_gas:ao.optional()}),ro=A.object({method:A.literal("eth_signTransaction"),params:A.object({transaction:no})}).merge(Xi),io=A.object({method:A.literal("eth_sendTransaction"),caip2:$i,params:A.object({transaction:no})}).merge(Xi),oo=A.object({message:A.string(),encoding:A.union([A.literal("utf-8"),A.literal("hex")])}),so=A.object({method:A.literal("personal_sign"),params:oo}).merge(Xi),lo=A.object({method:A.literal("eth_signTypedData_v4"),params:A.object({typed_data:A.object({domain:A.record(A.string(),A.any()),types:A.record(A.string(),A.any()),message:A.record(A.string(),A.any()),primary_type:A.string()})})}).merge(Xi),co=A.discriminatedUnion("method",[ro,io,so,lo]),po=A.discriminatedUnion("method",[Qi,Zi,eo]),uo=A.union([co,po]),_o=A.object({method:A.literal("signTransaction"),data:A.object({signed_transaction:A.string(),encoding:A.literal("base64")})}),mo=A.object({method:A.literal("signAndSendTransaction"),data:A.object({hash:A.string(),caip2:$i}).optional(),error:A.object({code:A.string(),message:A.string()}).optional()}),go=A.object({method:A.literal("signMessage"),data:A.object({signature:A.string(),encoding:A.literal("base64")})}),bo=A.object({method:A.literal("eth_signTransaction"),data:A.object({signed_transaction:A.string(),encoding:A.literal("rlp")})}),ho=A.object({method:A.literal("eth_sendTransaction"),data:A.object({hash:A.string(),caip2:$i}).optional(),error:A.object({code:A.string(),message:A.string()}).optional()}),yo=A.object({method:A.literal("personal_sign"),data:A.object({signature:A.string(),encoding:A.literal("hex")})}),vo=A.object({method:A.literal("eth_signTypedData_v4"),data:A.object({signature:A.string(),encoding:A.literal("hex")})}),Io=A.discriminatedUnion("method",[_o,mo,go,bo,ho,yo,vo]),fo=A.object({public_key:A.string(),role:Ji.optional()}),So=A.union([A.literal("solana"),A.literal("ethereum")]),To=A.object({id:A.string(),address:A.string(),chain_type:So}),Eo=A.object({chain_type:So,policy_id:A.string().optional()}),Ao=A.object({id:A.string(),chain_type:So,address:A.string()}),ko=A.object({wallet_id:A.string({required_error:"Wallet ID must be provided",invalid_type_error:"Wallet ID is not a valid string"}).min(1)}).catch((({error:e})=>{throw new R(e.message,w.INVALID_DATA)})),Oo=A.object({id:A.string()});var Po={};L(Po,"MoonpayOnRampSignInput",(()=>No)),L(Po,"MoonpayOnRampSignResponse",(()=>Uo));let jo=A.enum(["ach_bank_transfer","credit_debit_card","gbp_bank_transfer","gbp_open_banking_payment","mobile_wallet","sepa_bank_transfer","sepa_open_banking_payment","pix_instant_payment","yellow_card_bank_transfer"]),wo=A.enum(["AVAX_CCHAIN","CELO_CELO","CUSD_CELO","DAI_ETHEREUM","ETH_ETHEREUM","ETH_ARBITRUM","ETH_OPTIMISM","ETH_POLYGON","ETH_BASE","FIL_FVM","MATIC_ETHEREUM","MATIC_POLYGON","USDC_ETHEREUM","USDC_ARBITRUM","USDC_OPTIMISM","USDC_POLYGON","USDC_BASE","USDT_ETHEREUM","USDT_POLYGON","WETH_POLYGON","WBTC_ETHEREUM","BNB_BNB","BNB_BSC","CELO","CUSD","DAI","ETH","FIL","MATIC","USDC","USDT","WETH","WBTC"]),Co=A.object({quoteCurrencyAmount:A.number().optional(),email:Nt.optional(),paymentMethod:jo.optional(),uiConfig:A.object({accentColor:A.string().optional(),theme:A.enum(["light","dark"]).optional()}).optional()}),Ro=A.object({address:Lt,config:Co.extend({currencyCode:wo.transform((e=>{switch(e){case"AVAX_CCHAIN":return"AVAX_CCHAIN";case"CELO_CELO":return"CELO";case"CUSD_CELO":return"CUSD";case"DAI_ETHEREUM":return"DAI";case"ETH_ETHEREUM":return"ETH";case"ETH_ARBITRUM":return"ETH_ARBITRUM";case"ETH_OPTIMISM":return"ETH_OPTIMISM";case"ETH_POLYGON":return"ETH_POLYGON";case"ETH_BASE":return"ETH_BASE";case"FIL_FVM":return"FIL";case"MATIC_ETHEREUM":return"MATIC";case"MATIC_POLYGON":return"MATIC_POLYGON";case"USDC_ETHEREUM":return"USDC";case"USDC_ARBITRUM":return"USDC_ARBITRUM";case"USDC_OPTIMISM":return"USDC_OPTIMISM";case"USDC_POLYGON":return"USDC_POLYGON";case"USDC_BASE":return"USDC_BASE";case"USDT_ETHEREUM":return"USDT";case"USDT_POLYGON":return"USDT_POLYGON";case"WETH_POLYGON":return"WETH";case"WBTC_ETHEREUM":return"WBTC";case"BNB_BNB":return"BNB";case"BNB_BSC":return"BNB_BSC";case"CELO":case"CUSD":case"DAI":case"ETH":case"FIL":case"MATIC":case"USDC":case"USDT":case"WETH":case"WBTC":return e;default:throw Error(`Invalid currency code: ${e}`)}})).optional()})}),Do=A.object({address:Mt,config:Co.extend({currencyCode:A.enum(["SOL","USDC_SOL"]).optional()})}),No=A.union([Ro,Do]).and(A.object({useSandbox:A.boolean().optional().default(!1)})),Uo=A.object({signedUrl:A.string(),externalTransactionId:A.string()});U(Pt,jt),U(Pt,Ct),U(Pt,qt),U(Pt,Kt),U(Pt,aa),U(Pt,Rt),U(Pt,da),U(Pt,$t),U(Pt,_a),U(Pt,ga),U(Pt,Ta),U(Pt,ka),U(Pt,Wa),U(Pt,Va),U(Pt,Ha),U(Pt,br),U(Pt,kr),U(Pt,Vr),U(Pt,Zr),U(Pt,ti),U(Pt,Or),U(Pt,ri),U(Pt,mi),U(Pt,Si),U(Pt,Pi),U(Pt,qa),U(Pt,Ui),U(Pt,Gi),U(Pt,Ya),U(Pt,Yi),U(Pt,Ki),U(Pt,Po);let Lo={address:S,version:"0.6"},Mo={address:T,version:"0.7"},Wo=({owner:e,smartWalletType:t,publicClient:a})=>{switch(t){case Ka:return v({client:a,entryPoint:Mo,owners:[e],version:"1.4.1"});case $a:return y({client:a,version:"0.3.1",entryPoint:Mo,owners:[e]});case za:return h({client:a,owners:[e],entryPoint:Lo});case Xa:return b({client:a,entryPoint:Lo,owner:e,version:"1.1.0"});case Ja:return async function({client:e,owner:t}){let[a]=await t.request({method:"eth_accounts"});if(!a)throw Error("Unable to request embedded owner for eth_accounts");return await f({client:e,owners:[{type:"local",source:"privy",address:a,sign:async({hash:e})=>await t.request({method:"secp256k1_sign",params:[e]})}]})}({client:a,owner:e});default:throw Error(`Invalid smart account type: ${t}.`)}},xo=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const Fo=({calls:e,chain:t,maxPriorityFeePerGas:a,maxFeePerGas:n,nonce:r})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:r,maxFeePerGas:n,maxPriorityFeePerGas:a}))),Go=async({chain:e,paymasterContext:t,embeddedWallet:a,user:i,smartWalletsConfig:s,rpcConfig:c,privyAppId:p})=>{if(!s?.enabled||!i||!a)return;let d=await a.getEthereumProvider(),u=s?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!u)throw new l(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let _=i.smartWallet?.smartWalletType??s.smartWalletType,m=o(e,c,p),b=r({chain:e,transport:n(m)}),h=t??u.paymasterContext,y=await(async({owner:e,smartWalletType:t,chain:a,publicClient:r,bundlerUrl:i,paymasterUrl:o,paymasterContext:s})=>{let l=await Wo({owner:e,smartWalletType:t,publicClient:r}),c=I({transport:n(i),entryPoint:l.entryPoint}),p=o?I({transport:n(o),entryPoint:l.entryPoint}):void 0;return g({account:l,chain:a,paymaster:p,paymasterContext:s,bundlerTransport:n(i),userOperation:{estimateFeesPerGas:async()=>{if(xo.some((e=>i.includes(e))))return await c.getUserOperationGasPrice().then((e=>e.fast));{let e=await r.estimateFeesPerGas(),t=i.includes("api.developer.coinbase.com")?175n:150n;return{...e,maxFeePerGas:e.maxFeePerGas*t/100n,maxPriorityFeePerGas:e.maxPriorityFeePerGas*t/100n}}}}})})({owner:d,smartWalletType:_,chain:e,publicClient:b,paymasterContext:h,...u});if(!y)throw new l(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return y},Vo=({clientConfig:n,smartWalletsConfig:r})=>{let{noPromptOnSignature:o,openPrivyModal:g,appId:b}=c(),h=s(),{setModalData:y}=u(),{user:v}=p(),{chains:I}=s(),{chainId:f,clients:S,setChainId:T,chainIdState:E}=(()=>{let a=e(),[n,r]=t();return{clients:e({}),setChainId:e=>{a.current=e,r(e)},chainId:a,chainIdState:n}})(),A=I.find((e=>e.id===E)),{wallets:k}=d(),O=a((async()=>f.current),[f]),P=a((async({id:e})=>{if(!S.current[e]){let t=_(k),a=await Go({chain:I.find((t=>t.id===e)),embeddedWallet:t,user:v,paymasterContext:n?.paymasterContext,smartWalletsConfig:r,rpcConfig:h.rpcConfig,privyAppId:b});a&&(S.current[e]=a)}T(e)}),[I,n,k,v,r]);return{wrapSmartAccountClient:e=>{S.current[e.chain.id]=e,E||T(e.chain.id);return{...e,sendTransaction:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[f.current];if(!a)throw new l(`Smart wallet client for chain (eip155:${f.current}) not found`);if(t)return o.current=!0,await a.sendTransaction(e).finally((()=>o.current=!1));let n=[];"calls"in e&&void 0!==e.calls?n=[...e.calls]:"to"in e&&(n=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let r=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:t,paymasterData:r}=await a.prepareUserOperation({calls:n,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(t??r??0)>0};return new Promise((async(t,s)=>{o.current=!0;let{entropyId:l,entropyIdVerifier:c}=i(v);y({connectWallet:{entropyId:l,entropyIdVerifier:c,onCompleteNavigateTo:m.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:Fo({calls:n,chain:a.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:l,entropyIdVerifier:c,transactingWallet:{address:a.account.address,walletIndex:null},getIsSponsored:r,onConfirm:()=>a.sendTransaction(e),onSuccess:e=>t(e.hash),onFailure:s,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},signMessage:async({message:e})=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[f.current];if(!a)throw new l(`Smart wallet client for chain (eip155:${f.current}) not found`);return t?(o.current=!0,await a.signMessage({message:e}).finally((()=>o.current=!1))):new Promise((async(t,n)=>{let{entropyId:r,entropyIdVerifier:s}=i(v);o.current=!0,y({connectWallet:{entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>a.signMessage({message:e}),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},signTypedData:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[f.current];if(!a)throw new l(`Smart wallet client for chain (eip155:${f.current}) not found`);return t?(o.current=!0,await a.signTypedData(e).finally((()=>o.current=!1))):new Promise((async(t,n)=>{o.current=!0;let{entropyId:r,entropyIdVerifier:s}=i(v);y({connectWallet:{entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>a.signTypedData(e),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},getChainId:O,chain:A,switchChain:P}}}};export{Fo as c,Go as g,Vo as u};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useContext as t,useState as r,useEffect as i,createContext as n}from"react";import{A as a}from"./context-BXivPMz8.mjs";import{u as o,l,h as s,P as c}from"./useWallets-BfKlC62m.mjs";import{g as m}from"./getEmbeddedConnectedWallet-ComEChZh.mjs";import{g as d,u as p}from"./smart-wallets-Cf_4SaVH.mjs";import"@ethersproject/providers";import"tinycolor2";import"ofetch";import"viem";import"./user-EiUNCG17.mjs";import"@ethersproject/address";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";import"zod";import"bs58";import"ethers";import"libphonenumber-js/max";let f=n({client:void 0});const g=({config:t,children:r})=>e(w,{children:e(y,{config:t,children:e(C,{children:r})})}),u=()=>{let{client:e}=t(f);return{client:e}};let h=n({config:void 0}),v=()=>{let{config:e}=t(h);return{config:e}},w=({children:t})=>{let[n,a]=r(void 0),{client:l}=o();return i((()=>{!n&&l&&(async()=>{try{if(!l)return void console.warn("No client found");let e=await l.getSmartWalletsConfig();a(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!l]),e(h.Provider,{value:{config:n},children:t})},y=({config:t,children:n})=>{let{config:p}=v(),{appId:f}=o(),{chains:g,defaultChain:u,rpcConfig:h}=a(),{wallets:w}=l(),{user:y}=s(),[C,b]=r(),j=m(w);return i((()=>{(async()=>{if(!p?.enabled)return;let e=p.configuredNetworks.find((e=>e.chainId===`eip155:${u.id}`))?u:g.find((e=>p.configuredNetworks.map((e=>e.chainId)).includes(`eip155:${e.id}`)));if(!e)throw new c("Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.");b(await d({chain:e,privyAppId:f,paymasterContext:t?.paymasterContext,rpcConfig:h,embeddedWallet:j,user:y,smartWalletsConfig:p}))})()}),[!!p?.enabled,!!y?.smartWallet,!!j]),e(W.Provider,{value:{client:C,config:t},children:n})},W=n({client:void 0,config:void 0}),C=({children:r})=>{let{client:n,config:a}=(()=>{let{client:e,config:r}=t(W);return{client:e,config:r}})(),{config:l}=v(),{wrapSmartAccountClient:c}=p({clientConfig:a,smartWalletsConfig:l}),{user:m}=s(),{generateSiweMessageForSmartWallet:d,linkSmartWallet:g,noPromptOnSignature:u}=o();return i((()=>{(async()=>{if(n&&m&&!m?.smartWallet&&l?.enabled)try{let e=await d({address:n.account.address,chainId:`eip155:${n.chain.id}`});u.current=!0;let t=await n.signMessage({message:e});await g({signature:t,message:e,smartWalletType:l.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{u.current=!1}})()}),[!!n,!!m?.smartWallet,!!l?.enabled]),e(f.Provider,{value:{client:m?.smartWallet&&n?c(n):void 0},children:r})};export{g as SmartWalletsProvider,u as useSmartWallets};
1
+ import{jsx as e}from"react/jsx-runtime";import{useContext as t,useState as r,useEffect as i,createContext as n}from"react";import{A as a}from"./context-DKEKRqPy.mjs";import{u as o,l,h as s,P as c}from"./useWallets-BfKlC62m.mjs";import{g as m}from"./getEmbeddedConnectedWallet-BlqPeSFk.mjs";import{g as d,u as p}from"./smart-wallets-BBSoh3Z1.mjs";import"@ethersproject/providers";import"tinycolor2";import"ofetch";import"viem";import"./user-EiUNCG17.mjs";import"@ethersproject/address";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";import"zod";import"bs58";import"ethers";import"libphonenumber-js/max";let f=n({client:void 0});const g=({config:t,children:r})=>e(w,{children:e(y,{config:t,children:e(C,{children:r})})}),u=()=>{let{client:e}=t(f);return{client:e}};let h=n({config:void 0}),v=()=>{let{config:e}=t(h);return{config:e}},w=({children:t})=>{let[n,a]=r(void 0),{client:l}=o();return i((()=>{!n&&l&&(async()=>{try{if(!l)return void console.warn("No client found");let e=await l.getSmartWalletsConfig();a(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!l]),e(h.Provider,{value:{config:n},children:t})},y=({config:t,children:n})=>{let{config:p}=v(),{appId:f}=o(),{chains:g,defaultChain:u,rpcConfig:h}=a(),{wallets:w}=l(),{user:y}=s(),[C,b]=r(),j=m(w);return i((()=>{(async()=>{if(!p?.enabled)return;let e=p.configuredNetworks.find((e=>e.chainId===`eip155:${u.id}`))?u:g.find((e=>p.configuredNetworks.map((e=>e.chainId)).includes(`eip155:${e.id}`)));if(!e)throw new c("Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.");b(await d({chain:e,privyAppId:f,paymasterContext:t?.paymasterContext,rpcConfig:h,embeddedWallet:j,user:y,smartWalletsConfig:p}))})()}),[!!p?.enabled,!!y?.smartWallet,!!j]),e(W.Provider,{value:{client:C,config:t},children:n})},W=n({client:void 0,config:void 0}),C=({children:r})=>{let{client:n,config:a}=(()=>{let{client:e,config:r}=t(W);return{client:e,config:r}})(),{config:l}=v(),{wrapSmartAccountClient:c}=p({clientConfig:a,smartWalletsConfig:l}),{user:m}=s(),{generateSiweMessageForSmartWallet:d,linkSmartWallet:g,noPromptOnSignature:u}=o();return i((()=>{(async()=>{if(n&&m&&!m?.smartWallet&&l?.enabled)try{let e=await d({address:n.account.address,chainId:`eip155:${n.chain.id}`});u.current=!0;let t=await n.signMessage({message:e});await g({signature:t,message:e,smartWalletType:l.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{u.current=!1}})()}),[!!n,!!m?.smartWallet,!!l?.enabled]),e(f.Provider,{value:{client:m?.smartWallet&&n?c(n):void 0},children:r})};export{g as SmartWalletsProvider,u as useSmartWallets};
package/dist/esm/ui.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{l as r,h as l,u as n}from"./useWallets-BfKlC62m.mjs";import{f as a,o,u as s,y as d,p as c,W as h,k as p,d as C,v as u,b as f,w,x as g,B as m}from"./useFundWallet-CQLW4Zdx.mjs";import{styled as v,css as x}from"styled-components";import{G as y,A as k}from"./context-BXivPMz8.mjs";import _ from"@heroicons/react/24/outline/CheckIcon";import*as b from"react";import{useState as M,useContext as z,createContext as L,useRef as H}from"react";import{useMergeRefs as V,useTransitionStyles as F,FloatingPortal as Z,FloatingFocusManager as U,useFloating as A,autoUpdate as S,offset as B,flip as T,shift as O,useInteractions as W,useClick as j,useDismiss as P,useRole as R}from"@floating-ui/react";import D from"@heroicons/react/24/outline/UserIcon";import G from"@heroicons/react/24/outline/EllipsisHorizontalIcon";import I from"@heroicons/react/24/outline/PlusCircleIcon";import"ofetch";import"./events-context-2ZF4RQWB.mjs";import"@heroicons/react/24/outline/Square2StackIcon";import"@ethersproject/bignumber";import"@ethersproject/units";import"viem";import"@ethersproject/providers";import"tinycolor2";const $=t=>e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:e("path",{d:"M9.99999 10.8333C12.3012 10.8333 14.1667 8.96785 14.1667 6.66667C14.1667 4.36548 12.3012 2.5 9.99999 2.5C7.69881 2.5 5.83333 4.36548 5.83333 6.66667C5.83333 8.96785 7.69881 10.8333 9.99999 10.8333ZM9.99999 10.8333C11.7681 10.8333 13.4638 11.5357 14.714 12.786C15.9643 14.0362 16.6667 15.7319 16.6667 17.5M9.99999 10.8333C8.23188 10.8333 6.53619 11.5357 5.28595 12.786C4.03571 14.0362 3.33333 15.7319 3.33333 17.5",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})}),N=v.button`
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import{l as r,h as l,u as n}from"./useWallets-BfKlC62m.mjs";import{f as a,o,u as s,y as d,p as c,W as h,k as p,d as C,v as u,b as f,w,x as g,B as m}from"./useFundWallet-BLbOcKe5.mjs";import{styled as v,css as x}from"styled-components";import{G as y,A as k}from"./context-DKEKRqPy.mjs";import _ from"@heroicons/react/24/outline/CheckIcon";import*as b from"react";import{useState as M,useContext as z,createContext as L,useRef as H}from"react";import{useMergeRefs as V,useTransitionStyles as F,FloatingPortal as Z,FloatingFocusManager as U,useFloating as A,autoUpdate as S,offset as B,flip as T,shift as O,useInteractions as W,useClick as j,useDismiss as P,useRole as R}from"@floating-ui/react";import D from"@heroicons/react/24/outline/UserIcon";import G from"@heroicons/react/24/outline/EllipsisHorizontalIcon";import I from"@heroicons/react/24/outline/PlusCircleIcon";import"ofetch";import"./events-context-2ZF4RQWB.mjs";import"@heroicons/react/24/outline/Square2StackIcon";import"@ethersproject/bignumber";import"@ethersproject/units";import"viem";import"@ethersproject/providers";import"tinycolor2";const $=t=>e("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:e("path",{d:"M9.99999 10.8333C12.3012 10.8333 14.1667 8.96785 14.1667 6.66667C14.1667 4.36548 12.3012 2.5 9.99999 2.5C7.69881 2.5 5.83333 4.36548 5.83333 6.66667C5.83333 8.96785 7.69881 10.8333 9.99999 10.8333ZM9.99999 10.8333C11.7681 10.8333 13.4638 11.5357 14.714 12.786C15.9643 14.0362 16.6667 15.7319 16.6667 17.5M9.99999 10.8333C8.23188 10.8333 6.53619 11.5357 5.28595 12.786C4.03571 14.0362 3.33333 15.7319 3.33333 17.5",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})}),N=v.button`
2
2
  --size: ${({$size:e})=>`${e}px`};
3
3
 
4
4
  -webkit-font-smoothing: antialiased;
@@ -1,4 +1,4 @@
1
- import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo as a,useCallback as c}from"react";import{jsx as i,jsxs as n,Fragment as l}from"react/jsx-runtime";import{styled as s,keyframes as d,css as h}from"styled-components";import{G as v,A as p,an as u,U as g}from"./context-BXivPMz8.mjs";import{u as m}from"./events-context-2ZF4RQWB.mjs";import{m as y,u as f}from"./useWallets-BfKlC62m.mjs";import w from"@heroicons/react/24/outline/Square2StackIcon";import{BigNumber as b}from"@ethersproject/bignumber";import{formatEther as x}from"@ethersproject/units";import{createPublicClient as $,http as M}from"viem";let k=r=>b.from(r);function V(r){if("number"==typeof r||"bigint"==typeof r||"string"==typeof r)return r;if("function"==typeof r.toHexString)return r.toHexString();throw Error(`Expected numeric value but received ${r}`)}function Z(r){let e={};return void 0!==r.to&&(e.to=r.to),void 0!==r.data&&(e.data=r.data),void 0!==r.chainId&&(e.chainId=r.chainId),void 0!==r.type&&(e.type=r.type),void 0!==r.accessList&&(e.accessList=r.accessList),void 0!==r.nonce&&(e.nonce=k(r.nonce).toNumber()),void 0!==r.gasLimit&&(e.gasLimit=k(r.gasLimit)),void 0!==r.gasPrice&&(e.gasPrice=k(r.gasPrice)),void 0!==r.value&&(e.value=k(r.value)),void 0!==r.maxFeePerGas&&(e.maxFeePerGas=k(r.maxFeePerGas)),void 0!==r.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=k(r.maxPriorityFeePerGas)),e}class L{get(r){let e=localStorage.getItem(r);return null===e?void 0:JSON.parse(e)}put(r,e){void 0!==e?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map((([r])=>r))}}function P(){try{let r="privy:__session_storage__test",e=new L;return e.put(r,"blobby"),e.del(r),!0}catch(r){return!1}}var T="undefined"!=typeof window&&window.localStorage?new L:new class{get(r){return this._cache[r]}put(r,e){void 0!==e?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const C=o=>{let[t,a]=r("auto");return e((()=>{let r=new ResizeObserver((r=>{a(r[0]?.contentRect.height??"auto")}));return o.current&&r.observe(o.current),()=>{o.current&&r.unobserve(o.current)}}),[o.current]),t},S=({success:r,fail:e})=>n(l,{children:[i(_,{className:r?"success":e?"fail":""}),i(H,{className:r?"success":e?"fail":""})]}),_=s.span`
1
+ import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo as a,useCallback as c}from"react";import{jsx as i,jsxs as l,Fragment as n}from"react/jsx-runtime";import{styled as s,keyframes as d,css as h}from"styled-components";import{G as v,A as p,at as u,U as g}from"./context-DKEKRqPy.mjs";import{u as m}from"./events-context-2ZF4RQWB.mjs";import{m as y,u as f}from"./useWallets-BfKlC62m.mjs";import w from"@heroicons/react/24/outline/Square2StackIcon";import{BigNumber as b}from"@ethersproject/bignumber";import{formatEther as x}from"@ethersproject/units";import{createPublicClient as $,http as M}from"viem";let k=r=>b.from(r);function V(r){if("number"==typeof r||"bigint"==typeof r||"string"==typeof r)return r;if("function"==typeof r.toHexString)return r.toHexString();throw Error(`Expected numeric value but received ${r}`)}function Z(r){let e={};return void 0!==r.to&&(e.to=r.to),void 0!==r.data&&(e.data=r.data),void 0!==r.chainId&&(e.chainId=r.chainId),void 0!==r.type&&(e.type=r.type),void 0!==r.accessList&&(e.accessList=r.accessList),void 0!==r.nonce&&(e.nonce=k(r.nonce).toNumber()),void 0!==r.gasLimit&&(e.gasLimit=k(r.gasLimit)),void 0!==r.gasPrice&&(e.gasPrice=k(r.gasPrice)),void 0!==r.value&&(e.value=k(r.value)),void 0!==r.maxFeePerGas&&(e.maxFeePerGas=k(r.maxFeePerGas)),void 0!==r.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=k(r.maxPriorityFeePerGas)),e}class L{get(r){let e=localStorage.getItem(r);return null===e?void 0:JSON.parse(e)}put(r,e){void 0!==e?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map((([r])=>r))}}function P(){try{let r="privy:__session_storage__test",e=new L;return e.put(r,"blobby"),e.del(r),!0}catch(r){return!1}}var T="undefined"!=typeof window&&window.localStorage?new L:new class{get(r){return this._cache[r]}put(r,e){void 0!==e?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const C=o=>{let[t,a]=r("auto");return e((()=>{let r=new ResizeObserver((r=>{a(r[0]?.contentRect.height??"auto")}));return o.current&&r.observe(o.current),()=>{o.current&&r.unobserve(o.current)}}),[o.current]),t},S=({success:r,fail:e})=>l(n,{children:[i(_,{className:r?"success":e?"fail":""}),i(H,{className:r?"success":e?"fail":""})]}),_=s.span`
2
2
  && {
3
3
  width: 82px;
4
4
  height: 82px;
@@ -56,7 +56,7 @@ import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo a
56
56
  && > a {
57
57
  color: var(--privy-color-accent);
58
58
  }
59
- `;function A(r){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:o,requireUsersAcceptTerms:t}}=r.app;if(t&&!r.alwaysShowImplicitConsent||!o&&!e)return i(N,{});let a=!(!e||!o);return n(N,{children:["By logging in I agree to the"," ",o&&i("a",{href:o,target:"_blank",children:a?"Terms":"Terms of Service"}),a&&" & ",e&&i("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const z=()=>i(W,{children:i("a",{href:"https://www.privy.io/",target:"_blank",children:i(F,{height:13,width:150})})}),W=s.div`
59
+ `;function A(r){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:o,requireUsersAcceptTerms:t}}=r.app;if(t&&!r.alwaysShowImplicitConsent||!o&&!e)return i(N,{});let a=!(!e||!o);return l(N,{children:["By logging in I agree to the"," ",o&&i("a",{href:o,target:"_blank",children:a?"Terms":"Terms of Service"}),a&&" & ",e&&i("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const z=()=>i(W,{children:i("a",{href:"https://www.privy.io/",target:"_blank",children:i(F,{height:13,width:150})})}),W=s.div`
60
60
  display: flex;
61
61
  align-items: center;
62
62
  justify-content: center;
@@ -77,7 +77,7 @@ import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo a
77
77
  @media all and (display-mode: standalone) {
78
78
  padding-bottom: 30px;
79
79
  }
80
- `,B=({address:r,showCopyIcon:e,url:o,className:t})=>o?i("a",{title:r,className:t,href:`${o}/address/${r}`,target:"_blank",children:v(r)}):n("button",{title:r,className:t,onClick:()=>navigator.clipboard.writeText(r).catch(console.error),children:[v(r),e&&i(G,{})]});let G=s(w)`
80
+ `,B=({address:r,showCopyIcon:e,url:o,className:t})=>o?i("a",{title:r,className:t,href:`${o}/address/${r}`,target:"_blank",children:v(r)}):l("button",{title:r,className:t,onClick:()=>navigator.clipboard.writeText(r).catch(console.error),children:[v(r),e&&i(G,{})]});let G=s(w)`
81
81
  && {
82
82
  display: inline;
83
83
  }
@@ -159,4 +159,4 @@ import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo a
159
159
  ${r=>"error"===r.$state?"border-color: var(--privy-color-error);":""}
160
160
  `,ar=s.div`
161
161
  ${tr}
162
- `,cr=({errMsg:r,balance:e,address:o,isLoading:t,className:a,title:c,isPulsing:s,showIcon:d,statusColor:h="green"})=>{let v;return v=h||(r?"red":"green"),n(l,{children:[n(ar,{className:a,$state:r?"error":void 0,children:[n(rr,{children:[i(or,{children:c||"Pay with"}),i(B,{address:o,showCopyIcon:d||!!r})]}),void 0!==e&&i(R,{isLoading:t,isPulsing:s,color:v,children:e})]}),r&&i(er,{style:{marginTop:"0.25rem"},children:r})]})},ir=({color:r,...e})=>i("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...e,children:i("g",{children:i("path",{fill:r||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});let nr=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),lr=r=>nr.format(r);const sr=(r,e)=>{let o=lr(e*parseFloat(r));return"$0.00"!==o?o:"<$0.01"},dr=(r,e)=>{let o=lr(e*parseFloat(x(r)));return"$0.00"===o?"<$0.01":o},hr=(r,e,o=6,t=!1)=>{let a=parseFloat(x(r)).toFixed(o).replace(/0+$/,"").replace(/\.$/,"");return t?`${a} ${e}`:`${"0"===a?"<0.001":a} ${e}`},vr=r=>r.map(k).reduce(((r,e)=>r.add(e)),b.from(0)).toHexString(),pr=(r,e)=>{let{chains:o}=f(),t=`https://etherscan.io/address/${e}`,a=`${u(r,o)}/address/${e}`;if(!a)return t;try{new URL(a)}catch{return t}return a},ur=({...r})=>n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...r,children:[i("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),i("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),i("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]});function gr({rpcConfig:o,appId:t,address:i,chain:n}){let{chains:l}=f(),[s,d]=r(0n),[h,v]=r(!1),p=a((()=>{let r=n||l[0];if(r)return $({chain:n,transport:M(g(r,o,t))})}),[n,o,t]),u=c((async()=>{if(!i||!p)return;v(!0);let r=await p.getBalance({address:i}).catch(console.error);return r?(d(r),v(!1),r):void 0}),[p,i,d]);return e((()=>{u().catch(console.error)}),[]),{balance:s,isLoading:h,reloadBalance:u}}function mr(r){let{login:e}=t(y);return m("login",r),{login:e}}function yr(r){let{connectWallet:e}=t(y);return m("connectWallet",r),{connectWallet:e}}const fr=r=>{m("fundWallet",r);let{fundWallet:e}=f();return{fundWallet:e}};export{B as A,I as B,S as C,er as E,_ as L,W as M,D as R,A as T,cr as W,T as a,z as b,R as c,Y as d,P as e,ir as f,U as g,ar as h,k as i,tr as j,hr as k,sr as l,dr as m,H as n,ur as o,gr as p,pr as q,Z as r,vr as s,V as t,Q as u,C as v,mr as w,yr as x,fr as y};
162
+ `,cr=({errMsg:r,balance:e,address:o,isLoading:t,className:a,title:c,isPulsing:s,showIcon:d,statusColor:h="green"})=>{let v;return v=h||(r?"red":"green"),l(n,{children:[l(ar,{className:a,$state:r?"error":void 0,children:[l(rr,{children:[i(or,{children:c||"Pay with"}),i(B,{address:o,showCopyIcon:d||!!r})]}),void 0!==e&&i(R,{isLoading:t,isPulsing:s,color:v,children:e})]}),r&&i(er,{style:{marginTop:"0.25rem"},children:r})]})},ir=({color:r,...e})=>i("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...e,children:i("g",{children:i("path",{fill:r||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});let lr=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),nr=r=>lr.format(r);const sr=(r,e)=>{let o=nr(e*parseFloat(r));return"$0.00"!==o?o:"<$0.01"},dr=(r,e)=>{let o=nr(e*parseFloat(x(r)));return"$0.00"===o?"<$0.01":o},hr=(r,e,o=6,t=!1)=>{let a=parseFloat(x(r)).toFixed(o).replace(/0+$/,"").replace(/\.$/,"");return t?`${a} ${e}`:`${"0"===a?"<0.001":a} ${e}`},vr=r=>r.map(k).reduce(((r,e)=>r.add(e)),b.from(0)).toHexString(),pr=(r,e)=>{let{chains:o}=f(),t=`https://etherscan.io/address/${e}`,a=`${u(r,o)}/address/${e}`;if(!a)return t;try{new URL(a)}catch{return t}return a},ur=({...r})=>l("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...r,children:[i("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),i("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),i("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]});function gr({rpcConfig:o,appId:t,address:i,chain:l}){let{chains:n}=f(),[s,d]=r(0n),[h,v]=r(!1),p=a((()=>{let r=l||n[0];if(r)return $({chain:l,transport:M(g(r,o,t))})}),[l,o,t]),u=c((async()=>{if(!i||!p)return;v(!0);let r=await p.getBalance({address:i}).catch(console.error);return r?(d(r),v(!1),r):void 0}),[p,i,d]);return e((()=>{u().catch(console.error)}),[]),{balance:s,isLoading:h,reloadBalance:u}}function mr(r){let{login:e}=t(y);return m("login",r),{login:e}}function yr(r){let{connectWallet:e}=t(y);return m("connectWallet",r),{connectWallet:e}}const fr=r=>{m("fundWallet",r);let{fundWallet:e}=f();return{fundWallet:e}};export{B as A,I as B,S as C,er as E,_ as L,W as M,D as R,A as T,cr as W,T as a,z as b,R as c,Y as d,P as e,ir as f,U as g,ar as h,k as i,tr as j,hr as k,sr as l,dr as m,H as n,ur as o,gr as p,pr as q,Z as r,vr as s,V as t,Q as u,C as v,mr as w,yr as x,fr as y};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@privy-io/react-auth",
3
- "version": "1.95.3",
3
+ "version": "1.95.4",
4
4
  "description": "React client for the Privy Auth API",
5
5
  "keywords": [
6
6
  "authentication",