@privy-io/react-auth 1.94.1 → 1.94.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";var e=require("react"),t=require("viem"),a=require("./privy-context-BWc1w1jF.js"),n=require("./useWallets-D_QN9JnP.js"),r=require("./getEmbeddedConnectedWallet-B58KNyMS.js"),i=require("permissionless"),o=require("permissionless/accounts"),s=require("permissionless/clients/pimlico"),l=require("viem/account-abstraction"),d=require("zod"),u=require("bs58"),c=require("ethers"),p=require("libphonenumber-js/max");function _(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=_(d),z=_(u);let g;var b=((g=b||{}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",g.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",g.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",g.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",g.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",g.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",g.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",g.INVALID_DATA="invalid_data",g.INVALID_CREDENTIALS="invalid_credentials",g.INVALID_CAPTCHA="invalid_captcha",g.LINKED_TO_ANOTHER_USER="linked_to_another_user",g.ALLOWLIST_REJECTED="allowlist_rejected",g.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",g.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",g.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",g.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",g.TOO_MANY_REQUESTS="too_many_requests",g.INVALID_ORIGIN="invalid_origin",g.MISSING_ORIGIN="missing_origin",g.INVALID_NATIVE_APP_ID="invalid_native_app_id",g.TOKEN_ALREADY_USED="token_already_used",g.ALREADY_LOGGED_OUT="already_logged_out",g.NOT_SUPPORTED="not_supported",g.USER_UNSUBSCRIBED="user_unsubscribed",g.MAX_APPS_REACHED="max_apps_reached",g.USER_LIMIT_REACHED="max_accounts_reached",g.DEVICE_REVOKED="device_revoked",g.WALLET_PASSWORD_EXISTS="wallet_password_exists",g.OAUTH_STATE_MISMATCH="oauth_state_mismatch",g.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",g.DISALLOWED_LOGIN_METHOD="disallowed_login_method",g.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",g.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",g.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",g.CANNOT_SET_PASSWORD="cannot_set_password",g.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",g.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",g.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",g.USER_DOES_NOT_EXIST="user_does_not_exist",g.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",g.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",g.FEATURE_NOT_ENABLED="feature_not_enabled",g),h=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}},f=class extends h{constructor(e,t){super(400,e,t||"invalid_data")}},y=class extends h{constructor(e,t){super(401,e,t)}},v=class extends h{constructor(e,t){super(422,e,t)}};function I(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 S(e,t,a,n){Object.defineProperty(e,t,{get:a,set:n,enumerable:!0,configurable:!0})}d.z.object({error:d.z.string(),cause:d.z.string().optional(),code:d.z.nativeEnum(b).optional()});var k={},A={};S(A,"AnalyticsEvent",(()=>T));let T={path:"/api/v1/analytics_events",method:"POST"};var E={};S(E,"AppConfig",(()=>P));let P={path:"/api/v1/apps/:app_id",method:"GET"};var w={};S(w,"CoinbaseOnRampInit",(()=>j)),S(w,"CoinbaseOnRampStatus",(()=>O));let j={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},O={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"};var C={};S(C,"GetCrossAppConnections",(()=>R));let R={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"};var N={};S(N,"CustomJWTAuthenticate",(()=>D));let D={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"};var x={};S(x,"FarcasterInit",(()=>W)),S(x,"FarcasterAuthenticate",(()=>L)),S(x,"FarcasterLink",(()=>M)),S(x,"FarcasterUnlink",(()=>U)),S(x,"FarcasterStatus",(()=>F));let W={path:"/api/v1/farcaster/init",method:"POST"},L={path:"/api/v1/farcaster/authenticate",method:"POST"},M={path:"/api/v1/farcaster/link",method:"POST"},U={path:"/api/v1/farcaster/unlink",method:"POST"},F={path:"/api/v1/farcaster/status",method:"GET"};var G={};S(G,"FarcasterSignerInit",(()=>V)),S(G,"FarcasterSignerStatus",(()=>q));let V={path:"/api/v1/farcaster/signer/init",method:"POST"},q={path:"/api/v1/farcaster/signer/status",method:"POST"};var B={};S(B,"GuestAuthenticate",(()=>K));let K={path:"/api/v1/guest/authenticate",method:"POST"};var $={};S($,"MfaPasskeyInit",(()=>H)),S($,"MfaPasskeyVerify",(()=>Y)),S($,"MfaPasskeyEnrollment",(()=>J));let H={path:"/api/v1/mfa/passkeys/init",method:"POST"},Y={path:"/api/v1/mfa/passkeys/verify",method:"POST"},J={path:"/api/v1/mfa/passkeys/enrollment",method:"POST"};var Q={};S(Q,"MfaPasswordlessSmsEnroll",(()=>X)),S(Q,"MfaPasswordlessSmsVerify",(()=>Z)),S(Q,"MfaPasswordlessSmsInit",(()=>ee)),S(Q,"MfaPasswordlessSmsUnenroll",(()=>te));let X={path:"/api/v1/mfa/passwordless_sms/enroll",method:"POST"},Z={path:"/api/v1/mfa/passwordless_sms/verify",method:"POST"},ee={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},te={path:"/api/v1/mfa/passwordless_sms/unenroll",method:"POST"};var ae={};S(ae,"MfaTotpEnroll",(()=>ne)),S(ae,"MfaTotpVerify",(()=>re)),S(ae,"MfaTotpInit",(()=>ie)),S(ae,"MfaTotpUnenroll",(()=>oe));let ne={path:"/api/v1/mfa/totp/enroll",method:"POST"},re={path:"/api/v1/mfa/totp/verify",method:"POST"},ie={path:"/api/v1/mfa/totp/init",method:"POST"},oe={path:"/api/v1/mfa/totp/unenroll",method:"POST"};var se={};S(se,"OAuthAuthenticate",(()=>le)),S(se,"OAuthInit",(()=>de)),S(se,"OAuthLink",(()=>ue)),S(se,"OAuthUnlink",(()=>ce));let le={path:"/api/v1/oauth/authenticate",method:"POST"},de={path:"/api/v1/oauth/init",method:"POST"},ue={path:"/api/v1/oauth/link",method:"POST"},ce={path:"/api/v1/oauth/unlink",method:"POST"};var pe={};S(pe,"OAuthProviderAuthorize",(()=>_e)),S(pe,"OAuthProviderVerify",(()=>me));let _e={path:"/oauth/authorization_code",method:"POST"},me={path:"/oauth/verify",method:"POST"};var ze={};S(ze,"PasskeyLink",(()=>ge)),S(ze,"PasskeyAuthenticate",(()=>be)),S(ze,"PasskeyAuthenticateInit",(()=>he)),S(ze,"PasskeyLinkInit",(()=>fe)),S(ze,"PasskeyUnlink",(()=>ye));let ge={path:"/api/v1/passkeys/link",method:"POST"},be={path:"/api/v1/passkeys/authenticate",method:"POST"},he={path:"/api/v1/passkeys/authenticate/init",method:"POST"},fe={path:"/api/v1/passkeys/link/init",method:"POST"},ye={path:"/api/v1/passkeys/unlink",method:"POST"};var ve={};S(ve,"PasswordlessAuthenticate",(()=>Ie)),S(ve,"PasswordlessInit",(()=>Se)),S(ve,"PasswordlessLink",(()=>ke)),S(ve,"PasswordlessUnlink",(()=>Ae)),S(ve,"PasswordlessUpdate",(()=>Te));let Ie={path:"/api/v1/passwordless/authenticate",method:"POST"},Se={path:"/api/v1/passwordless/init",method:"POST"},ke={path:"/api/v1/passwordless/link",method:"POST"},Ae={path:"/api/v1/passwordless/unlink",method:"POST"},Te={path:"/api/v1/passwordless/update",method:"POST"};var Ee={};S(Ee,"PasswordlessSmsAuthenticate",(()=>Pe)),S(Ee,"PasswordlessSmsInit",(()=>we)),S(Ee,"PasswordlessSmsLink",(()=>je)),S(Ee,"PasswordlessSmsUnlink",(()=>Oe)),S(Ee,"PasswordlessSmsUpdate",(()=>Ce));let Pe={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},we={path:"/api/v1/passwordless_sms/init",method:"POST"},je={path:"/api/v1/passwordless_sms/link",method:"POST"},Oe={path:"/api/v1/passwordless_sms/unlink",method:"POST"},Ce={path:"/api/v1/passwordless_sms/update",method:"POST"};var Re={};S(Re,"RecoveryKeyMaterial",(()=>Ne)),S(Re,"RecoveryOAuthInit",(()=>De)),S(Re,"RecoveryOAuthAuthenticate",(()=>xe)),S(Re,"RecoveryOAuthInitICloud",(()=>We)),S(Re,"RecoveryOAuthCallbackICloudExpo",(()=>Le)),S(Re,"RecoveryConfigurationICloud",(()=>Me));let Ne={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},De={path:"/api/v1/recovery/oauth/init",method:"POST"},xe={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},We={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},Le={path:"/api/v1/recovery/oauth/callback_icloud/:app_id/expo_ios",method:"GET"},Me={path:"/api/v1/recovery/configuration_icloud",method:"POST"};var Ue={};S(Ue,"getPathWithParams",(()=>Fe));let Fe=(e,t)=>t?Object.entries(t).reduce(((e,[t,a])=>e.replace(`:${t}`,`${a}`)),e):e;var Ge={};S(Ge,"RefreshSession",(()=>Ve)),S(Ge,"Logout",(()=>qe));let Ve={path:"/api/v1/sessions",method:"POST"},qe={path:"/api/v1/sessions/logout",method:"POST"};var Be={};S(Be,"GetSmartWalletConfig",(()=>Ke)),S(Be,"PostSmartWalletConfig",(()=>$e));let Ke={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},$e={path:"/api/v1/apps/:app_id/smart_wallets",method:"POST"};var He={};S(He,"SiweInit",(()=>Ye)),S(He,"SiweAuthenticate",(()=>Je)),S(He,"SiweLink",(()=>Qe)),S(He,"SiweLinkSmartWallet",(()=>Xe)),S(He,"SiweUnlink",(()=>Ze));let Ye={path:"/api/v1/siwe/init",method:"POST"},Je={path:"/api/v1/siwe/authenticate",method:"POST"},Qe={path:"/api/v1/siwe/link",method:"POST"},Xe={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},Ze={path:"/api/v1/siwe/unlink",method:"POST"};var et={};S(et,"SiwsInit",(()=>tt)),S(et,"SiwsAuthenticate",(()=>at)),S(et,"SiwsLink",(()=>nt)),S(et,"SiwsUnlink",(()=>rt));let tt={path:"/api/v1/siws/init",method:"POST"},at={path:"/api/v1/siws/authenticate",method:"POST"},nt={path:"/api/v1/siws/link",method:"POST"},rt={path:"/api/v1/siws/unlink",method:"POST"};var it={};S(it,"AcceptTermsOnUser",(()=>ot));let ot={path:"/api/v1/users/me/accept_terms",method:"POST"};var st={};S(st,"TelegramAuthenticate",(()=>lt)),S(st,"TelegramLink",(()=>dt)),S(st,"TelegramUnlink",(()=>ut));let lt={path:"/api/v1/telegram/authenticate",method:"POST"},dt={path:"/api/v1/telegram/link",method:"POST"},ut={path:"/api/v1/telegram/unlink",method:"POST"};I(k,A),I(k,E),I(k,w),I(k,C),I(k,N),I(k,x),I(k,G),I(k,B),I(k,$),I(k,Q),I(k,ae),I(k,se),I(k,pe),I(k,ze),I(k,ve),I(k,Ee),I(k,Re),I(k,Ue),I(k,Ge),I(k,Be),I(k,He),I(k,et),I(k,it),I(k,st);var ct={},pt={};S(pt,"AnalyticsEventInput",(()=>_t));let _t=d.z.object({event_name:d.z.string().max(255),client_id:d.z.string().max(255).nullable(),payload:d.z.record(d.z.any()).optional()});var mt={};S(mt,"AccountIdFromPath",(()=>Tt)),S(mt,"AppIdFromPath",(()=>Et)),S(mt,"Pagination",(()=>Pt));var zt={};S(zt,"UserId",(()=>gt)),S(zt,"Email",(()=>bt)),S(zt,"PasswordlessCode",(()=>ht)),S(zt,"WalletAddress",(()=>ft)),S(zt,"normalizeEthereumAddress",(()=>kt)),S(zt,"SolanaWalletAddress",(()=>yt)),S(zt,"PhoneNumber",(()=>vt)),S(zt,"normalizePhoneNumber",(()=>It)),S(zt,"isValidAddress",(()=>St)),S(zt,"AuthenticateMode",(()=>At));let gt=d.z.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:",""))),bt=d.z.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())),ht=d.z.string({required_error:"Verification code must be provided",invalid_type_error:"Invalid verification code"}).length(6,"Verification code must have 6 digits."),ft=d.z.string({required_error:"Ethereum address must be provided",invalid_type_error:"Invalid Ethereum address"}).transform(((e,t)=>kt(e)||(t.addIssue({code:d.z.ZodIssueCode.custom,message:"Invalid Ethereum address"}),d.z.NEVER))),yt=d.z.string({required_error:"Solana address must be provided",invalid_type_error:"Invalid Solana address"}).trim().transform(((e,t)=>{try{z.default.decode(e)}catch(e){return t.addIssue({code:d.z.ZodIssueCode.custom,message:"Invalid Solana address"}),d.z.NEVER}return e})),vt=d.z.string({required_error:"Phone number must be included",invalid_type_error:"Phone number is not a valid string"}).refine((e=>{try{return void 0!==It(e)}catch(e){return!1}}),{message:"Phone number is not valid"}).transform((e=>It(e)||""));function It(e){let t=p.parsePhoneNumber(e,"US");if(t?.isPossible())return t.formatInternational()}function St(e){return!!kt(e)}function kt(e){if("string"==typeof e)try{return c.ethers.utils.getAddress(e.trim())}catch(e){}}let At=d.z.object({mode:d.z.enum(["no-signup","login-or-sign-up"]).optional()}),Tt=d.z.object({account_id:d.z.string({required_error:"Account ID must be provided",invalid_type_error:"Account ID is not a valid string"}).min(1)}),Et=d.z.object({app_id:d.z.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 f(e.message,b.MISSING_OR_INVALID_PRIVY_APP_ID)})),Pt=d.z.object({cursor:gt.optional(),limit:d.z.coerce.number().max(100,{message:"Query limit can be at maximum 100 records."}).optional()});var wt={};S(wt,"AppResponseSchema",(()=>Wt));var jt={};S(jt,"EmbeddedWalletConfigSchema",(()=>Ct)),S(jt,"TelegramAuthConfigSchema",(()=>Rt)),S(jt,"FundingMethodEnum",(()=>Nt)),S(jt,"FundingMethodArraySchema",(()=>Dt)),S(jt,"FundingConfigSchema",(()=>xt));let Ot=m.default.object({chain:m.default.string(),asset:m.default.enum(["native-currency","USDC"]).optional()}),Ct=m.default.object({create_on_login:m.default.enum(["users-without-wallets","all-users","off"]),user_owned_recovery_options:m.default.array(m.default.enum(["user-passcode","google-drive","icloud"])),require_user_owned_recovery_on_create:m.default.boolean().optional(),require_user_password_on_create:m.default.boolean().optional()}),Rt=m.default.object({bot_id:m.default.string(),bot_name:m.default.string(),link_enabled:m.default.boolean(),seamless_auth_enabled:m.default.boolean()}),Nt=m.default.enum(["moonpay","coinbase-onramp","external"]),Dt=m.default.array(Nt),xt=m.default.object({default_recommended_currency:Ot,default_recommended_amount:m.default.string(),methods:Dt,prompt_funding_on_wallet_creation:m.default.boolean(),cross_chain_bridging_enabled:m.default.boolean()}),Wt=d.z.object({id:d.z.string(),name:d.z.string(),logo_url:d.z.string().nullable(),icon_url:d.z.string().nullable(),terms_and_conditions_url:d.z.string().nullable(),privacy_policy_url:d.z.string().nullable(),require_users_accept_terms:d.z.boolean().nullable(),theme:d.z.string(),accent_color:d.z.string().nullable(),show_wallet_login_first:d.z.boolean(),allowed_domains:d.z.array(d.z.string()),allowed_native_app_ids:d.z.array(d.z.string()),allowed_native_app_url_schemes:d.z.array(d.z.string()),wallet_auth:d.z.boolean(),email_auth:d.z.boolean(),sms_auth:d.z.boolean(),google_oauth:d.z.boolean(),twitter_oauth:d.z.boolean(),discord_oauth:d.z.boolean(),github_oauth:d.z.boolean(),spotify_oauth:d.z.boolean(),instagram_oauth:d.z.boolean(),tiktok_oauth:d.z.boolean(),linkedin_oauth:d.z.boolean(),apple_oauth:d.z.boolean(),farcaster_auth:d.z.boolean(),passkey_auth:d.z.boolean(),telegram_auth:d.z.boolean(),guest_auth:d.z.boolean(),solana_wallet_auth:d.z.boolean(),disable_plus_emails:d.z.boolean(),allowlist_enabled:d.z.boolean(),allowlist_config:d.z.object({error_title:d.z.string().nullable(),error_detail:d.z.string().nullable(),cta_text:d.z.string().nullable(),cta_link:d.z.string().nullable()}),wallet_connect_cloud_project_id:d.z.string().nullable(),custom_api_url:d.z.string().nullable(),embedded_wallet_config:Ct,enforce_wallet_uis:d.z.boolean(),legacy_wallet_ui_config:d.z.boolean(),fiat_on_ramp_enabled:d.z.boolean(),captcha_enabled:d.z.boolean(),twitter_oauth_on_mobile_enabled:d.z.boolean(),mfa_methods:d.z.array(d.z.enum(["sms","totp","passkey"])),captcha_site_key:d.z.string().optional(),verification_key:d.z.string(),telegram_auth_config:Rt.optional(),funding_config:xt.optional(),max_linked_wallets_per_user:d.z.number().nullable(),farcaster_link_wallets_enabled:d.z.boolean()});var Lt={};S(Lt,"CoinbaseOnRampInitInput",(()=>qt)),S(Lt,"CoinbaseOnRampInitResponse",(()=>Bt)),S(Lt,"CoinbaseOnRampStatusResponse",(()=>Kt));let Mt=d.z.enum(["ethereum","bitcoin","base","avacchain","optimism","solana","polygon","arbitrum","stellar"]),Ut=d.z.enum(["eth","ETH","USDC"]).transform((e=>e.toUpperCase())),Ft=d.z.enum(["SOL"]).transform((e=>e.toUpperCase())),Gt=d.z.object({addresses:d.z.array(d.z.object({address:ft,blockchains:d.z.array(Mt)})).max(1).min(1),assets:d.z.array(Ut).optional()}),Vt=d.z.object({addresses:d.z.array(d.z.object({address:yt,blockchains:d.z.array(Mt)})).max(1).min(1),assets:d.z.array(Ft).optional()}),qt=d.z.union([Gt,Vt]),Bt=d.z.object({app_id:d.z.string(),session_token:d.z.string(),channel_id:d.z.string(),partner_user_id:d.z.string()}),Kt=d.z.object({status:d.z.enum(["pending","success","failure"])});var $t={};S($t,"CrossAppConnectionsResponse",(()=>Ht));let Ht=d.z.object({connections:d.z.array(d.z.object({provider_app_id:d.z.string(),provider_app_name:d.z.string(),provider_app_icon_url:d.z.string().url().nullable(),provider_app_custom_api_url:d.z.string().url().nullable(),read_only:d.z.boolean()}))});var Yt={};S(Yt,"AuthenticateJwtInput",(()=>Jt));let Jt=m.default.object({token:m.default.string().optional()});var Qt={};S(Qt,"VerifyEmailInput",(()=>Zt)),S(Qt,"AuthenticateEmailInput",(()=>ea)),S(Qt,"InitEmailInput",(()=>ta)),S(Qt,"UnlinkEmailInput",(()=>aa)),S(Qt,"UpdateEmailInput",(()=>na)),S(Qt,"TransferEmailInput",(()=>ra));let Xt=d.z.object({nonce:d.z.string()}),Zt=d.z.object({code:ht,email:bt}),ea=Zt.merge(At),ta=d.z.object({email:bt,token:d.z.string().optional()}),aa=d.z.object({address:bt}),na=d.z.object({oldAddress:bt,newAddress:bt,code:ht}),ra=Xt.extend({email:bt});var ia={};S(ia,"JsonWebKey",(()=>oa)),S(ia,"JsonWebKeySet",(()=>sa));let oa=d.z.object({kty:d.z.string(),use:d.z.enum(["sig","enc"]).optional(),key_ops:d.z.array(d.z.enum(["sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits"])).optional(),alg:d.z.enum(["RS256"]),kid:d.z.string().optional(),x5u:d.z.string().optional(),x5c:d.z.array(d.z.string()).optional(),x5t:d.z.string().optional(),"x5t#S256":d.z.string().optional(),n:d.z.string().optional(),e:d.z.string().optional(),d:d.z.string().optional()}),sa=d.z.object({keys:d.z.array(oa)});var la={};S(la,"FarcasterConnectInitResponse",(()=>da)),S(la,"FarcasterConnectStatusCompletedResponse",(()=>ua)),S(la,"FarcasterConnectStatusPendingResponse",(()=>ca)),S(la,"FarcasterAuthenticateInput",(()=>pa)),S(la,"FarcasterLinkInput",(()=>_a)),S(la,"FarcasterInitInput",(()=>ma)),S(la,"FarcasterUnlinkInput",(()=>za)),S(la,"TransferFarcasterInput",(()=>ga));let da=d.z.object({channel_token:d.z.string(),connect_uri:d.z.string()}),ua=d.z.object({state:d.z.literal("completed"),nonce:d.z.string(),message:d.z.string(),signature:d.z.string(),fid:d.z.number(),username:d.z.string(),display_name:d.z.string(),bio:d.z.string(),pfp_url:d.z.string()}),ca=d.z.object({state:d.z.literal("pending"),nonce:d.z.string()}),pa=d.z.object({channel_token:d.z.string(),message:d.z.string(),signature:d.z.string(),fid:d.z.number()}).merge(At),_a=d.z.object({channel_token:d.z.string(),message:d.z.string(),signature:d.z.string(),fid:d.z.number()}),ma=d.z.object({token:d.z.string().optional(),redirect_url:d.z.string().url().optional(),relying_party:d.z.string().optional()}),za=d.z.object({fid:d.z.number()}),ga=Xt.extend({farcaster_id:d.z.string(),farcaster_embedded_address:d.z.string()});var ba={};S(ba,"FarcasterSignerInitInput",(()=>ha)),S(ba,"FarcasterSignerInitResponse",(()=>fa)),S(ba,"FarcasterSignerStatusResponse",(()=>ya));let ha=d.z.object({ed25519_public_key:d.z.string().refine((e=>e.startsWith("0x")&&66===e.length)),deadline:d.z.bigint().optional().default((()=>BigInt(Math.floor(Date.now()/1e3)+3600)))}),fa=d.z.discriminatedUnion("status",[d.z.object({public_key:d.z.string(),status:d.z.literal("pending_approval"),signer_approval_url:d.z.string()}),d.z.object({public_key:d.z.string(),status:d.z.literal("approved"),fid:d.z.bigint()}),d.z.object({public_key:d.z.string(),status:d.z.literal("revoked"),fid:d.z.bigint()})]),ya=d.z.discriminatedUnion("status",[d.z.object({public_key:d.z.string(),status:d.z.literal("pending_approval")}),d.z.object({public_key:d.z.string(),status:d.z.literal("approved"),fid:d.z.bigint()}),d.z.object({public_key:d.z.string(),status:d.z.literal("revoked"),fid:d.z.bigint()})]);var va={};S(va,"AuthenticateGuestInput",(()=>Ia));let Ia=d.z.object({guest_credential:d.z.string().length(43)}).strict();var Sa={};S(Sa,"EmailIdTokenEntry",(()=>Pn)),S(Sa,"PhoneIdTokenEntry",(()=>wn)),S(Sa,"EthereumIdTokenEntry",(()=>jn)),S(Sa,"SolanaIdTokenEntry",(()=>On)),S(Sa,"FarcasterIdTokenEntry",(()=>Cn)),S(Sa,"PasskeyIdTokenEntry",(()=>Rn)),S(Sa,"TelegramIdTokenEntry",(()=>Nn)),S(Sa,"EthereumEmbeddedWalletIdTokenEntry",(()=>Dn)),S(Sa,"SolanaEmbeddedWalletIdTokenEntry",(()=>xn)),S(Sa,"GoogleOauthIdTokenEntry",(()=>Wn)),S(Sa,"TwitterOauthIdTokenEntry",(()=>Ln)),S(Sa,"DiscordOauthIdTokenEntry",(()=>Mn)),S(Sa,"GithubOauthIdTokenEntry",(()=>Un)),S(Sa,"LinkedInOauthIdTokenEntry",(()=>Fn)),S(Sa,"SpotifyOauthIdTokenEntry",(()=>Gn)),S(Sa,"InstagramOauthIdTokenEntry",(()=>Vn)),S(Sa,"TiktokOauthIdTokenEntry",(()=>qn)),S(Sa,"AppleOauthIdTokenEntry",(()=>Bn)),S(Sa,"CustomJwtIdTokenEntry",(()=>Kn)),S(Sa,"CrossAppIdTokenEntry",(()=>$n)),S(Sa,"SmartWalletIdTokenEntry",(()=>Hn));var ka={};S(ka,"EmailAccount",(()=>Ua)),S(ka,"PhoneAccount",(()=>Fa)),S(ka,"BaseWalletAccount",(()=>Ga)),S(ka,"EthereumAccount",(()=>Va)),S(ka,"SmartWalletAccount",(()=>qa)),S(ka,"SolanaAccount",(()=>Ba)),S(ka,"FarcasterAccount",(()=>Ka)),S(ka,"PasskeyAccount",(()=>$a)),S(ka,"TelegramAccount",(()=>Ha)),S(ka,"EthereumEmbeddedWalletAccount",(()=>Qa)),S(ka,"SolanaEmbeddedWalletAccount",(()=>Xa)),S(ka,"BitcoinSegwitEmbeddedWalletAccount",(()=>Za)),S(ka,"BitcoinTaprootEmbeddedWalletAccount",(()=>en)),S(ka,"GoogleOauthAccount",(()=>tn)),S(ka,"TwitterOauthAccount",(()=>an)),S(ka,"DiscordOauthAccount",(()=>nn)),S(ka,"GithubOauthAccount",(()=>rn)),S(ka,"LinkedInOauthAccount",(()=>on)),S(ka,"SpotifyOauthAccount",(()=>sn)),S(ka,"InstagramOauthAccount",(()=>ln)),S(ka,"TiktokOauthAccount",(()=>dn)),S(ka,"AppleOauthAccount",(()=>un)),S(ka,"CustomJwtAccount",(()=>cn)),S(ka,"CrossAppEmbeddedWallet",(()=>pn)),S(ka,"CrossAppSmartWallet",(()=>_n)),S(ka,"CrossAppAccount",(()=>mn)),S(ka,"LinkedAccount",(()=>zn)),S(ka,"SmsMfaMethod",(()=>gn)),S(ka,"TotpMfaMethod",(()=>bn)),S(ka,"PasskeyMfaMethod",(()=>hn)),S(ka,"LinkedMfaMethod",(()=>fn)),S(ka,"CustomMetadata",(()=>yn)),S(ka,"OAuthTokens",(()=>vn)),S(ka,"User",(()=>In)),S(ka,"SessionUpdateActionEnum",(()=>Sn)),S(ka,"AuthenticatedUser",(()=>kn)),S(ka,"LoggedOutUser",(()=>An)),S(ka,"MaybeUser",(()=>Tn));var Aa={};S(Aa,"SmartWalletProvider",(()=>Ca)),S(Aa,"AlchemyPaymasterContextSchema",(()=>Na)),S(Aa,"SmartWalletNetworkConfigurationInputSchema",(()=>xa)),S(Aa,"SmartWalletConfigurationSchema",(()=>Wa)),S(Aa,"SmartWalletConfigurationInputSchema",(()=>La)),S(Aa,"SmartWalletConfigurationResponseSchema",(()=>Ma)),S(Aa,"SAFE",(()=>Ta)),S(Aa,"KERNEL",(()=>Ea)),S(Aa,"LIGHT_ACCOUNT",(()=>wa)),S(Aa,"BICONOMY",(()=>Pa)),S(Aa,"COINBASE_SMART_WALLET",(()=>ja)),S(Aa,"SUPPORTED_SMART_WALLET_TYPES",(()=>Oa));let Ta="safe",Ea="kernel",Pa="biconomy",wa="light_account",ja="coinbase_smart_wallet",Oa=[Ta,Ea,Pa,wa,ja],Ca=d.z.enum(Oa,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Ra=d.z.string().regex(/^eip155:\d+$/,"Chain ID must be an eip155 chain ID"),Na=d.z.object({policy_id:d.z.string().uuid()}),Da=d.z.object({chain_id:Ra,bundler_url:d.z.string(),paymaster_url:d.z.string().optional(),rpc_url:d.z.string().optional(),chain_name:d.z.string().optional(),paymaster_context:Na.optional()}),xa=d.z.object({chain_id:Ra,bundler_url:d.z.string().optional(),paymaster_url:d.z.string().optional(),rpc_url:d.z.string().optional(),chain_name:d.z.string().optional(),paymaster_context:Na.optional()}),Wa=d.z.discriminatedUnion("enabled",[d.z.object({enabled:d.z.literal(!1)}),d.z.object({enabled:d.z.literal(!0),smart_wallet_type:Ca,configured_networks:d.z.array(Da).min(1)})]),La=d.z.discriminatedUnion("enabled",[d.z.object({enabled:d.z.literal(!1)}),d.z.object({enabled:d.z.literal(!0),smart_wallet_type:Ca,configured_networks:d.z.array(xa).min(1)})]),Ma=Wa,Ua=d.z.object({type:d.z.literal("email"),address:d.z.string(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Fa=d.z.object({type:d.z.literal("phone"),phoneNumber:d.z.string(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Ga=d.z.object({type:d.z.enum(["wallet","smart_wallet"]),address:d.z.string(),chain_type:d.z.enum(["solana","ethereum"])}),Va=d.z.object({type:d.z.literal("wallet"),address:d.z.string(),chain_id:d.z.string().optional(),chain_type:d.z.literal("ethereum"),wallet_client:d.z.literal("unknown"),wallet_client_type:d.z.string().optional(),connector_type:d.z.string().optional(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),qa=d.z.object({type:d.z.literal("smart_wallet"),address:d.z.string(),smart_wallet_type:Ca,verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Ba=d.z.object({type:d.z.literal("wallet"),address:d.z.string(),chain_type:d.z.literal("solana"),wallet_client:d.z.literal("unknown"),wallet_client_type:d.z.string().optional(),connector_type:d.z.string().optional(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Ka=d.z.object({type:d.z.literal("farcaster"),fid:d.z.number(),owner_address:ft,username:d.z.string().optional(),display_name:d.z.string().optional(),bio:d.z.string().optional(),profile_picture:d.z.string().optional(),profile_picture_url:d.z.string().optional(),homepage_url:d.z.string().optional(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable(),signer_public_key:d.z.string().optional()}),$a=d.z.object({type:d.z.literal("passkey"),created_with_browser:d.z.string().optional(),created_with_os:d.z.string().optional(),created_with_device:d.z.string().optional(),credential_id:d.z.string(),authenticator_name:d.z.string().optional(),enrolled_in_mfa:d.z.boolean(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Ha=d.z.object({type:d.z.literal("telegram"),telegram_user_id:d.z.string(),first_name:d.z.string().nullish(),last_name:d.z.string().nullish(),username:d.z.string().nullish(),photo_url:d.z.string().nullish(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}).transform((e=>({...e,telegramUserId:e.telegram_user_id,firstName:e.first_name}))),Ya=d.z.enum(["privy","user-passcode","google-drive","icloud"]),Ja=d.z.object({type:d.z.literal("wallet"),address:d.z.string(),imported:d.z.boolean().default(!1),delegated:d.z.boolean().default(!1),wallet_index:d.z.number(),chain_id:d.z.string(),chain_type:d.z.string(),wallet_client:d.z.literal("privy"),wallet_client_type:d.z.literal("privy"),connector_type:d.z.literal("embedded"),recovery_method:Ya,verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Qa=Ja.merge(d.z.object({chain_type:d.z.literal("ethereum")})),Xa=Ja.merge(d.z.object({chain_type:d.z.literal("solana"),public_key:d.z.string()})),Za=Ja.merge(d.z.object({chain_type:d.z.literal("bitcoin-segwit"),public_key:d.z.string()})),en=Ja.merge(d.z.object({chain_type:d.z.literal("bitcoin-taproot"),public_key:d.z.string()})),tn=d.z.object({type:d.z.literal("google_oauth"),subject:d.z.string(),email:d.z.string(),name:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),an=d.z.object({type:d.z.literal("twitter_oauth"),subject:d.z.string(),username:d.z.string().nullable(),name:d.z.string().nullable(),profile_picture_url:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),nn=d.z.object({type:d.z.literal("discord_oauth"),subject:d.z.string(),username:d.z.string().nullable(),email:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),rn=d.z.object({type:d.z.literal("github_oauth"),subject:d.z.string(),username:d.z.string().nullable(),name:d.z.string().nullable(),email:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),on=d.z.object({type:d.z.literal("linkedin_oauth"),subject:d.z.string(),name:d.z.string().optional(),email:d.z.string().nullable(),vanity_name:d.z.string().optional(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),sn=d.z.object({type:d.z.literal("spotify_oauth"),subject:d.z.string(),email:d.z.string().nullable(),name:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),ln=d.z.object({type:d.z.literal("instagram_oauth"),subject:d.z.string(),username:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),dn=d.z.object({type:d.z.literal("tiktok_oauth"),subject:d.z.string(),username:d.z.string().nullable(),name:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),un=d.z.object({type:d.z.literal("apple_oauth"),subject:d.z.string(),email:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),cn=d.z.object({type:d.z.literal("custom_auth"),custom_user_id:d.z.string(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),pn=d.z.object({address:d.z.string()}),_n=d.z.object({address:d.z.string()}),mn=d.z.object({type:d.z.literal("cross_app"),subject:d.z.string(),provider_app_id:d.z.string(),embedded_wallets:d.z.array(pn),smart_wallets:d.z.array(_n),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),zn=d.z.union([Ua,Fa,Va,Ba,qa,Qa,Xa,Za,en,tn,an,nn,rn,sn,ln,dn,on,un,cn,Ka,$a,Ha,mn]),gn=d.z.object({type:d.z.literal("sms"),verified_at:d.z.number()}),bn=d.z.object({type:d.z.literal("totp"),verified_at:d.z.number()}),hn=d.z.object({type:d.z.literal("passkey"),verified_at:d.z.number()}),fn=d.z.union([gn,bn,hn]),yn=d.z.record(d.z.string(),d.z.union([d.z.string(),d.z.number(),d.z.boolean()])),vn=d.z.object({provider:d.z.string(),access_token:d.z.string(),access_token_expires_in_seconds:d.z.number().optional(),refresh_token:d.z.string().optional(),refresh_token_expires_in_seconds:d.z.number().optional(),scopes:d.z.array(d.z.string()).optional()}),In=d.z.object({id:d.z.string(),linked_accounts:d.z.array(zn),mfa_methods:d.z.array(fn),created_at:d.z.number(),has_accepted_terms:d.z.boolean(),is_guest:d.z.boolean(),custom_metadata:yn.optional()}),Sn=d.z.enum(["set","ignore","clear"]),kn=d.z.object({user:In,token:d.z.string().min(1).nullable(),privy_access_token:d.z.string().min(1).nullable(),refresh_token:d.z.string().min(1).nullable(),identity_token:d.z.string().min(1).optional(),is_new_user:d.z.boolean().optional(),oauth_tokens:vn.optional(),oauth_provider_tokens:d.z.object({provider:d.z.string(),access_token:d.z.string(),access_token_expires_in_seconds:d.z.number().optional(),refresh_token:d.z.string().optional(),scopes:d.z.array(d.z.string()).optional()}).optional(),session_update_action:Sn}),An=d.z.object({user:d.z.null(),token:d.z.null(),refresh_token:d.z.null(),session_update_action:d.z.literal(Sn.Values.clear)}),Tn=d.z.union([kn,An]),En={lv:d.z.number().nullable()},Pn=Ua.pick({type:!0,address:!0}).extend(En),wn=Fa.pick({type:!0,phoneNumber:!0}).extend(En).transform((({phoneNumber:e,...t})=>({phone_number:e,...t}))),jn=Va.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(En),On=Ba.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(En),Cn=Ka.pick({type:!0,fid:!0,username:!0,owner_address:!0}).extend(En).transform((({owner_address:e,...t})=>({oa:e,...t}))),Rn=$a.pick({type:!0,credential_id:!0}).extend(En),Nn=d.z.object({type:d.z.literal("telegram"),telegram_user_id:d.z.string(),username:d.z.string().nullish(),lv:d.z.number().nullable()}),Dn=Qa.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(En),xn=Xa.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(En),Wn=tn.pick({type:!0,subject:!0,email:!0}).extend(En),Ln=an.pick({type:!0,subject:!0,username:!0}).extend(En),Mn=nn.pick({type:!0,subject:!0,username:!0}).extend(En),Un=rn.pick({type:!0,subject:!0,username:!0}).extend(En),Fn=on.pick({type:!0,subject:!0,email:!0}).extend(En),Gn=sn.pick({type:!0,subject:!0,email:!0}).extend(En),Vn=ln.pick({type:!0,subject:!0,username:!0}).extend(En),qn=dn.pick({type:!0,subject:!0,username:!0}).extend(En),Bn=un.pick({type:!0,subject:!0,email:!0}).extend(En),Kn=cn.pick({type:!0,custom_user_id:!0}).extend(En),$n=mn.pick({type:!0,subject:!0,provider_app_id:!0,embedded_wallets:!0,smart_wallets:!0}).extend(En),Hn=qa.pick({type:!0,smart_wallet_type:!0,address:!0}).extend(En);var Yn={};S(Yn,"MfaVerifyResponse",(()=>Jn)),S(Yn,"MfaSmsInitInput",(()=>Zn)),S(Yn,"MfaSmsAuthenticateEnrollInput",(()=>er)),S(Yn,"MfaSmsEnrollInput",(()=>tr)),S(Yn,"MfaSmsVerifyInput",(()=>ar)),S(Yn,"MfaTotpInput",(()=>nr)),S(Yn,"ResponseTotpInitMfa",(()=>rr));let Jn=m.default.object({token:m.default.string()}).strict(),Qn=m.default.object({action:m.default.literal("verify")}).strict(),Xn=m.default.object({action:m.default.literal("enroll"),phoneNumber:vt}).strict(),Zn=m.default.union([Qn,Xn]),er=m.default.object({action:m.default.literal("enroll").optional(),code:ht,phoneNumber:vt}).strict(),tr=m.default.object({code:ht,phoneNumber:vt}).strict(),ar=m.default.object({code:ht}).strict(),nr=m.default.object({code:ht}).strict(),rr=m.default.object({totpSecret:m.default.string(),totpAuthUrl:m.default.string()}).strict();var ir={};S(ir,"MfaPasskeyInitInput",(()=>br)),S(ir,"ResponsePasskeyInitMfa",(()=>hr)),S(ir,"MfaPasskeyVerifyInput",(()=>fr)),S(ir,"MfaEnrollmentPasskeyInput",(()=>yr));var or={};S(or,"PasskeyAuthenticatorVerifyOptions",(()=>sr)),S(or,"PasskeyAuthenticatorEnrollmentOptions",(()=>lr)),S(or,"PasskeyAuthenticatorVerifyResponse",(()=>dr)),S(or,"PasskeyAuthenticatorEnrollmentResponse",(()=>ur)),S(or,"PasskeyInitInput",(()=>cr)),S(or,"ResponsePasskeyInitAuthenticate",(()=>pr)),S(or,"ResponsePasskeyInitLink",(()=>_r)),S(or,"PasskeyLinkInput",(()=>mr)),S(or,"PasskeyAuthenticateInput",(()=>zr)),S(or,"UnlinkPasskeyInput",(()=>gr));let sr=m.default.object({challenge:m.default.string(),timeout:m.default.number().optional(),rp_id:m.default.string().optional(),allow_credentials:m.default.array(m.default.object({id:m.default.string(),type:m.default.string(),transports:m.default.array(m.default.string()).optional()})).optional(),user_verification:m.default.string().optional(),extensions:m.default.object({app_id:m.default.string().optional(),cred_props:m.default.boolean().optional(),hmac_create_secret:m.default.boolean().optional()}).optional()}),lr=m.default.object({rp:m.default.object({name:m.default.string(),id:m.default.string().optional()}),user:m.default.object({id:m.default.string(),name:m.default.string(),display_name:m.default.string()}),challenge:m.default.string(),pub_key_cred_params:m.default.array(m.default.object({alg:m.default.number(),type:m.default.literal("public-key")})),timeout:m.default.number().optional(),exclude_credentials:m.default.array(m.default.object({id:m.default.string(),type:m.default.string(),transports:m.default.array(m.default.string()).optional()})).optional(),authenticator_selection:m.default.object({authenticator_attachment:m.default.string().optional(),require_resident_key:m.default.boolean().optional(),resident_key:m.default.string().optional(),user_verification:m.default.string().optional()}).optional(),attestation:m.default.string().optional(),extensions:m.default.object({app_id:m.default.string().optional(),cred_props:m.default.object({rk:m.default.boolean().optional()}).optional(),hmac_create_secret:m.default.boolean().optional()}).optional()}),dr=m.default.object({id:m.default.string(),raw_id:m.default.string(),response:m.default.object({client_data_json:m.default.string(),authenticator_data:m.default.string(),signature:m.default.string(),user_handle:m.default.string().optional()}),authenticator_attachment:m.default.string().optional(),client_extension_results:m.default.object({app_id:m.default.boolean().optional(),cred_props:m.default.object({rk:m.default.boolean().optional()}).optional(),hmac_create_secret:m.default.boolean().optional()}),type:m.default.literal("public-key")}),ur=m.default.object({id:m.default.string(),raw_id:m.default.string(),response:m.default.object({client_data_json:m.default.string(),attestation_object:m.default.string(),authenticator_data:m.default.string().optional(),transports:m.default.array(m.default.any()).optional(),public_key_algorithm:m.default.number().optional(),public_key:m.default.string().optional()}),authenticator_attachment:m.default.string().optional(),client_extension_results:m.default.object({app_id:m.default.boolean().optional(),cred_props:m.default.object({rk:m.default.boolean().optional()}).optional(),hmac_create_secret:m.default.boolean().optional()}),type:m.default.literal("public-key")}),cr=m.default.object({relying_party:m.default.string().url().optional(),token:m.default.string().optional()}).strict(),pr=m.default.object({relying_party:m.default.string().url().optional(),options:sr}).strict(),_r=m.default.object({relying_party:m.default.string().url().optional(),options:lr}).strict(),mr=m.default.object({relying_party:m.default.string().url().optional(),authenticator_response:ur}).strict(),zr=m.default.object({relying_party:m.default.string().url().optional(),challenge:m.default.string(),authenticator_response:dr}).strict(),gr=m.default.object({credential_id:m.default.string()}),br=m.default.object({relying_party:m.default.string().url().optional()}).strict(),hr=m.default.object({options:sr}).strict(),fr=m.default.object({authenticator_response:dr,relying_party:m.default.string().url().optional()}).strict(),yr=m.default.object({credential_ids:m.default.array(m.default.string())});var vr={};S(vr,"ExternalOAuthProvider",(()=>Sr)),S(vr,"OAuthProvider",(()=>kr)),S(vr,"AuthenticateOauthInput",(()=>Ar)),S(vr,"OAuthInitInput",(()=>Tr)),S(vr,"LinkOAuthInput",(()=>Er)),S(vr,"OAuthUnlinkInput",(()=>Pr)),S(vr,"OAuthInitResponse",(()=>wr)),S(vr,"OAuthLinkResponse",(()=>jr)),S(vr,"TransferOAuthInput",(()=>Or)),S(vr,"SUPPORTED_OAUTH_PROVIDERS",(()=>Ir));let Ir=["google","discord","twitter","github","spotify","instagram","tiktok","linkedin","apple"],Sr=d.z.enum(Ir,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),kr=Sr.or(d.z.custom((e=>"string"==typeof e&&/^privy:[a-z0-9]{25}$/i.test(e)),{message:"Please specify a supported provider."})),Ar=d.z.object({authorization_code:d.z.string(),state_code:d.z.string(),code_verifier:d.z.string().min(43).max(128).optional(),code_type:d.z.enum(["raw"]).optional()}).merge(At).catch((()=>{throw new y("Please specify authorization_code and state_code.",b.INVALID_CREDENTIALS)})),Tr=d.z.object({redirect_to:d.z.string({required_error:"Please provide a redirect_to value."}),provider:kr,token:d.z.string().optional(),state_code:d.z.string().optional(),code_challenge:d.z.string().optional()}),Er=d.z.object({authorization_code:d.z.string(),state_code:d.z.string(),code_verifier:d.z.string().min(43).max(128).optional(),code_type:d.z.enum(["raw"]).optional()}),Pr=d.z.object({subject:d.z.string(),provider:kr}),wr=d.z.object({url:d.z.string()}),jr=In.extend({oauth_tokens:vn.optional()}),Or=Xt.extend({userInfo:d.z.object({subject:d.z.string(),name:d.z.string().optional(),username:d.z.string().optional(),profilePictureUrl:d.z.string().optional(),email:d.z.string().optional(),vanityName:d.z.string().optional()})});var Cr={};S(Cr,"AuthorizationCodeInput",(()=>Rr));let Rr=d.z.object({redirect_to:d.z.string(),state:d.z.string(),code_challenge:d.z.string()});var Nr={};S(Nr,"EmptyObject",(()=>Dr)),S(Nr,"SuccessObject",(()=>xr));let Dr=d.z.record(d.z.string(),d.z.never()),xr=d.z.object({success:d.z.boolean()});var Wr={};S(Wr,"RecoveryKeyMaterialInput",(()=>Lr)),S(Wr,"RecoveryKeyMaterialResponse",(()=>Mr)),S(Wr,"OAuthAuthenticateRecoveryResponse",(()=>Ur)),S(Wr,"OAuthInitRecoveryInput",(()=>Fr)),S(Wr,"OAuthInitICloudRecoveryInput",(()=>Gr)),S(Wr,"OAuthCallbackICloudExpoInput",(()=>Vr)),S(Wr,"OAuthCallbackICloudExpoResponse",(()=>qr)),S(Wr,"RecoveryConfigurationICloudInput",(()=>Br)),S(Wr,"RecoveryConfigurationICloudResponse",(()=>Kr));let Lr=d.z.object({chain_type:d.z.string().optional()}),Mr=d.z.object({recovery_type:d.z.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:d.z.string(),recovery_code:d.z.string(),recovery_key:d.z.string(),file_id:d.z.string(),icloud_record_name:d.z.string()}),Ur=d.z.object({access_token:d.z.string()}),Fr=d.z.object({redirect_to:d.z.string({required_error:"Please provide a redirect_to value."}),token:d.z.string().optional(),state_code:d.z.string().optional(),code_challenge:d.z.string().optional()}),Gr=d.z.object({client_type:d.z.enum(["web","expo-ios"])}),Vr=d.z.object({ckWebAuthToken:d.z.string()}).transform((e=>({ckWebAuthToken:e.ckWebAuthToken}))).catch((()=>{throw new y("Missing ckWebAuthToken.",b.INVALID_DATA)})),qr=Dr,Br=d.z.object({client_type:d.z.enum(["web","expo-ios"])}),Kr=d.z.object({api_token:d.z.string(),container_identifier:d.z.string(),environment:d.z.string()});var $r={};S($r,"SiweInput",(()=>Hr)),S($r,"SmartWalletSiweInput",(()=>Yr)),S($r,"AuthenticateSiweInput",(()=>Jr)),S($r,"SiweAddressInput",(()=>Qr)),S($r,"SiweInitInput",(()=>Xr)),S($r,"SiweNonce",(()=>Zr)),S($r,"TransferSiweInput",(()=>ei));let Hr=d.z.object({message:d.z.string({invalid_type_error:"Invalid SIWE message"}),signature:d.z.string({invalid_type_error:"Invalid SIWE signature"}),chainId:d.z.string().max(41).nullable().default(null),walletClientType:d.z.string().max(64).nullable().default(null),connectorType:d.z.string().max(64).nullable().default(null)}),Yr=d.z.object({message:d.z.string({invalid_type_error:"Invalid SIWE message"}),signature:d.z.string({invalid_type_error:"Invalid SIWE signature"}),smart_wallet_type:Ca}),Jr=Hr.merge(At),Qr=d.z.object({address:ft}),Xr=d.z.object({address:ft,token:d.z.string().optional()}),Zr=d.z.object({nonce:d.z.string(),address:d.z.string(),expires_at:d.z.string()}),ei=Xt.extend({address:ft,chainId:d.z.string().max(41).nullable().default(null),walletClientType:d.z.string().max(64).nullable().default(null),connectorType:d.z.string().max(64).nullable().default(null)});var ti={};S(ti,"SiwsInput",(()=>ai)),S(ti,"AuthenticateSiwsInput",(()=>ni)),S(ti,"SiwsAddressInput",(()=>ri)),S(ti,"SiwsInitInput",(()=>ii)),S(ti,"SiwsNonce",(()=>oi));let ai=d.z.object({message:d.z.string({invalid_type_error:"Invalid SIWS message"}),signature:d.z.string({invalid_type_error:"Invalid SIWS signature"}),walletClientType:d.z.string().max(64).nullable().default(null),connectorType:d.z.string().max(64).nullable().default(null)}),ni=ai.merge(At),ri=d.z.object({address:yt}),ii=d.z.object({address:yt,token:d.z.string().optional()}),oi=d.z.object({nonce:d.z.string(),address:d.z.string(),expires_at:d.z.string()});var si={};S(si,"VerifyPhoneInput",(()=>li)),S(si,"AuthenticatePhoneInput",(()=>di)),S(si,"PasswordlessSmsPhoneInput",(()=>ui)),S(si,"UnlinkPhoneInput",(()=>ci)),S(si,"UpdatePhoneInput",(()=>pi)),S(si,"TransferPhoneInput",(()=>_i));let li=d.z.object({code:ht.catch((()=>{throw new v("Invalid SMS verification code",b.INVALID_CREDENTIALS)})),phoneNumber:vt.catch((()=>{throw new v("Invalid phone number",b.INVALID_CREDENTIALS)}))}),di=li.merge(At),ui=d.z.object({phoneNumber:vt.catch((()=>{throw new v("Invalid phone number",b.INVALID_DATA)})),token:d.z.string().optional()}),ci=d.z.object({phoneNumber:vt}),pi=d.z.object({old_phone_number:vt,new_phone_number:vt,code:ht}),_i=Xt.extend({phoneNumber:vt});var mi={};S(mi,"TelegramAuthenticateInput",(()=>gi)),S(mi,"TelegramLinkInput",(()=>bi)),S(mi,"TelegramUnlinkInput",(()=>hi)),S(mi,"TransferTelegramInput",(()=>fi));let zi=m.default.object({id:m.default.number(),first_name:m.default.string(),auth_date:m.default.number(),hash:m.default.string(),username:m.default.string().optional(),last_name:m.default.string().optional(),photo_url:m.default.string().optional()}),gi=m.default.object({captcha_token:m.default.string().optional(),telegram_auth_result:zi.optional(),telegram_web_app_data:m.default.object({query_id:m.default.string().optional(),auth_date:m.default.number(),hash:m.default.string(),user:m.default.string(),chat_instance:m.default.string().optional(),chat_type:m.default.string().optional(),start_param:m.default.string().optional()}).optional()}).merge(At),bi=gi.omit({telegram_web_app_data:!0}).required({telegram_auth_result:!0}),hi=m.default.object({telegram_user_id:m.default.string()}),fi=Xt.extend({telegram_auth_result:zi});var yi={};S(yi,"RefreshTokenInput",(()=>vi)),S(yi,"OptionalRefreshTokenInput",(()=>Ii)),S(yi,"ForkedToken",(()=>Si));let vi=d.z.object({refresh_token:d.z.string()}),Ii=vi.partial(),Si=d.z.object({token:d.z.string(),refresh_token:d.z.string(),new_session_refresh_token:d.z.string()});var ki={};S(ki,"DelegatedActionsConsentInput",(()=>Ai));let Ai=d.z.object({encrypted_tee_share:d.z.string(),app_share:d.z.string(),delegated_addresses:d.z.array(d.z.object({chain_type:d.z.union([d.z.literal("solana"),d.z.literal("ethereum")]),address:d.z.string(),wallet_index:d.z.number().default(0)}))});var Ti={};S(Ti,"WalletApiSolanaSignTransactionRpcInput",(()=>wi)),S(Ti,"WalletApiSolanaSignMessageRpcInput",(()=>ji)),S(Ti,"UnsignedEthereumTransaction",(()=>Ri)),S(Ti,"WalletApiEthereumSignTransactionRpcInput",(()=>Ni)),S(Ti,"WalletApiEthereumPersonalSignRpcInputParams",(()=>Di)),S(Ti,"WalletApiEthereumPersonalSignRpcInput",(()=>xi)),S(Ti,"WalletApiEthereumSignTypedDataRpcInput",(()=>Wi)),S(Ti,"WalletApiRpcInput",(()=>Li)),S(Ti,"WalletApiSolanaSignTransactionRpcResponse",(()=>Mi)),S(Ti,"WalletApiSolanaSignMessageRpcResponse",(()=>Ui)),S(Ti,"WalletApiEthereumSignTransactionRpcResponse",(()=>Fi)),S(Ti,"WalletApiEthereumPersonalSignRpcResponse",(()=>Gi)),S(Ti,"WalletApiEthereumSignTypedDataRpcResponse",(()=>Vi)),S(Ti,"WalletApiRpcResponse",(()=>qi)),S(Ti,"WalletApiRegisterAuthorizationKeyInput",(()=>Bi));let Ei=d.z.object({address:d.z.string(),chain_type:d.z.literal("solana")}),Pi=d.z.object({address:d.z.string(),chain_type:d.z.literal("ethereum")}),wi=d.z.object({method:d.z.literal("signTransaction"),params:d.z.object({transaction:d.z.string(),encoding:d.z.literal("base64")})}).merge(Ei),ji=d.z.object({method:d.z.literal("signMessage"),params:d.z.object({message:d.z.string(),encoding:d.z.literal("base64")})}).merge(Ei),Oi=d.z.string().startsWith("0x"),Ci=d.z.union([Oi,d.z.number()]),Ri=d.z.object({from:ft.optional(),to:ft.optional(),nonce:Ci.optional(),chain_id:d.z.number().optional(),data:Oi.optional(),value:Ci.optional(),type:d.z.union([d.z.literal(0),d.z.literal(1),d.z.literal(2)]).optional(),gas_limit:Ci.optional(),gas_price:Ci.optional(),max_fee_per_gas:Ci.optional(),max_priority_fee_per_gas:Ci.optional()}),Ni=d.z.object({method:d.z.literal("eth_signTransaction"),params:d.z.object({transaction:Ri})}).merge(Pi),Di=d.z.object({message:d.z.string(),encoding:d.z.union([d.z.literal("utf-8"),d.z.literal("hex")])}),xi=d.z.object({method:d.z.literal("personal_sign"),params:Di}).merge(Pi),Wi=d.z.object({method:d.z.literal("eth_signTypedData_v4"),params:d.z.object({typed_data:d.z.object({domain:d.z.record(d.z.string(),d.z.any()),types:d.z.record(d.z.string(),d.z.any()),message:d.z.record(d.z.string(),d.z.any()),primary_type:d.z.string()})})}).merge(Pi),Li=d.z.discriminatedUnion("method",[wi,ji,Ni,xi,Wi]),Mi=d.z.object({method:d.z.literal("signTransaction"),data:d.z.object({signed_transaction:d.z.string(),encoding:d.z.literal("base64")})}),Ui=d.z.object({method:d.z.literal("signMessage"),data:d.z.object({signature:d.z.string(),encoding:d.z.literal("base64")})}),Fi=d.z.object({method:d.z.literal("eth_signTransaction"),data:d.z.object({signed_transaction:d.z.string(),encoding:d.z.literal("rlp")})}),Gi=d.z.object({method:d.z.literal("personal_sign"),data:d.z.object({signature:d.z.string(),encoding:d.z.literal("hex")})}),Vi=d.z.object({method:d.z.literal("eth_signTypedData_v4"),data:d.z.object({signature:d.z.string(),encoding:d.z.literal("hex")})}),qi=d.z.discriminatedUnion("method",[Mi,Ui,Fi,Gi,Vi]),Bi=d.z.object({public_key:d.z.string()});I(ct,pt),I(ct,mt),I(ct,wt),I(ct,jt),I(ct,Lt),I(ct,zt),I(ct,$t),I(ct,Yt),I(ct,Qt),I(ct,ia),I(ct,la),I(ct,ba),I(ct,va),I(ct,Sa),I(ct,Yn),I(ct,ir),I(ct,vr),I(ct,Cr),I(ct,Nr),I(ct,or),I(ct,Wr),I(ct,$r),I(ct,ti),I(ct,si),I(ct,Aa),I(ct,mi),I(ct,yi),I(ct,ka),I(ct,ki),I(ct,Ti);let Ki={address:l.entryPoint06Address,version:"0.6"},$i={address:l.entryPoint07Address,version:"0.7"},Hi=({owner:e,smartWalletType:t,publicClient:a})=>{switch(t){case Ta:return o.toSafeSmartAccount({client:a,entryPoint:$i,owners:[e],version:"1.4.1"});case Ea:return o.toEcdsaKernelSmartAccount({client:a,version:"0.3.1",entryPoint:$i,owners:[e]});case Pa:return o.toBiconomySmartAccount({client:a,owners:[e],entryPoint:Ki});case wa:return o.toLightSmartAccount({client:a,entryPoint:Ki,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 l.toCoinbaseSmartAccount({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}.`)}},Yi=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const Ji=({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}))),Qi=async({chain:e,paymasterContext:r,embeddedWallet:o,user:l,smartWalletsConfig:d,rpcConfig:u,privyAppId:c})=>{if(!d?.enabled||!l||!o)return;let p=await o.getEthereumProvider(),_=d?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!_)throw new a.PrivyClientError(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let m=l.smartWallet?.smartWalletType??d.smartWalletType,z=n.getJsonRpcEndpointFromChain(e,u,c),g=t.createPublicClient({chain:e,transport:t.http(z)}),b=r??_.paymasterContext,h=await(async({owner:e,smartWalletType:a,chain:n,publicClient:r,bundlerUrl:o,paymasterUrl:l,paymasterContext:d})=>{let u=await Hi({owner:e,smartWalletType:a,publicClient:r}),c=s.createPimlicoClient({transport:t.http(o),entryPoint:u.entryPoint}),p=l?s.createPimlicoClient({transport:t.http(l),entryPoint:u.entryPoint}):void 0;return i.createSmartAccountClient({account:u,chain:n,paymaster:p,paymasterContext:d,bundlerTransport:t.http(o),userOperation:{estimateFeesPerGas:async()=>{if(Yi.some((e=>o.includes(e))))return await c.getUserOperationGasPrice().then((e=>e.fast));{let e=await r.estimateFeesPerGas();return{...e,maxFeePerGas:150n*e.maxFeePerGas/100n,maxPriorityFeePerGas:150n*e.maxPriorityFeePerGas/100n}}}}})})({owner:p,smartWalletType:m,chain:e,publicClient:g,paymasterContext:b,..._});if(!h)throw new a.PrivyClientError(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return h};exports.callsToTransactionRequests=Ji,exports.getSmartWalletClient=Qi,exports.useSmartWalletsWrapper=({clientConfig:t,smartWalletsConfig:i})=>{let{noPromptOnSignature:o,openPrivyModal:s,appId:l}=a.usePrivyInternal(),d=n.useAppConfig(),{setModalData:u}=r.usePrivyModal(),{user:c}=a.usePrivyContext(),{chains:p}=n.useAppConfig(),{chainId:_,clients:m,setChainId:z,chainIdState:g}=(()=>{let t=e.useRef(),[a,n]=e.useState();return{clients:e.useRef({}),setChainId:e=>{t.current=e,n(e)},chainId:t,chainIdState:a}})(),b=p.find((e=>e.id===g)),{wallets:h}=n.useWallets(),f=e.useCallback((async()=>_.current),[_]),y=e.useCallback((async({id:e})=>{if(!m.current[e]){let a=r.getEmbeddedConnectedWallet(h),n=await Qi({chain:p.find((t=>t.id===e)),embeddedWallet:a,user:c,paymasterContext:t?.paymasterContext,smartWalletsConfig:i,rpcConfig:d.rpcConfig,privyAppId:l});n&&(m.current[e]=n)}z(e)}),[p,t,h,c,i]);return{wrapSmartAccountClient:e=>{m.current[e.chain.id]=e,g||z(e.chain.id);return{...e,sendTransaction:async e=>{let t=void 0===d.embeddedWallets.showWalletUIs?d.embeddedWallets.noPromptOnSignature:!d.embeddedWallets.showWalletUIs,n=m.current[_.current];if(!n)throw new a.PrivyClientError(`Smart wallet client for chain (eip155:${_.current}) not found`);if(t)return o.current=!0,await n.sendTransaction(e).finally((()=>o.current=!1));let i=[];"calls"in e&&void 0!==e.calls?i=[...e.calls]:"to"in e&&(i=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let l=async()=>{if(!n.paymaster)return!1;let{paymasterAndData:t,paymasterData:a}=await n.prepareUserOperation({calls:i,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(t??a??0)>0};return new Promise((async(t,d)=>{o.current=!0;let{entropyId:p,entropyIdVerifier:_}=a.getEntropyDetailsFromUser(c);u({connectWallet:{entropyId:p,entropyIdVerifier:_,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:Ji({calls:i,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:p,entropyIdVerifier:_,transactingWallet:{address:n.account.address,walletIndex:null},getIsSponsored:l,onConfirm:()=>n.sendTransaction(e),onSuccess:e=>t(e.hash),onFailure:d,uiOptions:{}}}),s(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},signMessage:async({message:e})=>{let t=void 0===d.embeddedWallets.showWalletUIs?d.embeddedWallets.noPromptOnSignature:!d.embeddedWallets.showWalletUIs,n=m.current[_.current];if(!n)throw new a.PrivyClientError(`Smart wallet client for chain (eip155:${_.current}) not found`);return t?(o.current=!0,await n.signMessage({message:e}).finally((()=>o.current=!1))):new Promise((async(t,i)=>{let{entropyId:l,entropyIdVerifier:d}=a.getEntropyDetailsFromUser(c);o.current=!0,u({connectWallet:{entropyId:l,entropyIdVerifier:d,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>n.signMessage({message:e}),onSuccess:e=>t(e),onFailure:i,uiOptions:{}}}),s(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},signTypedData:async e=>{let t=void 0===d.embeddedWallets.showWalletUIs?d.embeddedWallets.noPromptOnSignature:!d.embeddedWallets.showWalletUIs,n=m.current[_.current];if(!n)throw new a.PrivyClientError(`Smart wallet client for chain (eip155:${_.current}) not found`);return t?(o.current=!0,await n.signTypedData(e).finally((()=>o.current=!1))):new Promise((async(t,i)=>{o.current=!0;let{entropyId:l,entropyIdVerifier:d}=a.getEntropyDetailsFromUser(c);u({connectWallet:{entropyId:l,entropyIdVerifier:d,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>n.signTypedData(e),onSuccess:e=>t(e),onFailure:i,uiOptions:{}}}),s(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},getChainId:f,chain:b,switchChain:y}}}};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./useWallets-DS5oOPnB.js"),i=require("./privy-context-BWc1w1jF.js"),n=require("./getEmbeddedConnectedWallet-BAWFwm3E.js"),a=require("./smart-wallets-C_uID25w.js");require("@ethersproject/providers"),require("tinycolor2"),require("ofetch"),require("@ethersproject/address"),require("viem"),require("permissionless"),require("permissionless/accounts"),require("permissionless/clients/pimlico"),require("viem/account-abstraction"),require("zod"),require("bs58"),require("ethers"),require("libphonenumber-js/max");let l=r.createContext({client:void 0});let s=r.createContext({config:void 0}),c=()=>{let{config:e}=r.useContext(s);return{config:e}},o=({children:t})=>{let[n,a]=r.useState(void 0),{client:l}=i.usePrivyInternal();return r.useEffect((()=>{!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.jsx(s.Provider,{value:{config:n},children:t})},u=({config:l,children:s})=>{let{config:o}=c(),{appId:u}=i.usePrivyInternal(),{chains:f,defaultChain:g,rpcConfig:m}=t.useAppConfig(),{wallets:p}=t.useWallets(),{user:h}=i.usePrivyContext(),[v,C]=r.useState(),y=n.getEmbeddedConnectedWallet(p);return r.useEffect((()=>{(async()=>{if(!o?.enabled)return;let e=o.configuredNetworks.find((e=>e.chainId===`eip155:${g.id}`))?g:f.find((e=>o.configuredNetworks.map((e=>e.chainId)).includes(`eip155:${e.id}`)));if(!e)throw new i.PrivyClientError("Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.");C(await a.getSmartWalletClient({chain:e,privyAppId:u,paymasterContext:l?.paymasterContext,rpcConfig:m,embeddedWallet:y,user:h,smartWalletsConfig:o}))})()}),[!!o?.enabled,!!h?.smartWallet,!!y]),e.jsx(d.Provider,{value:{client:v,config:l},children:s})},d=r.createContext({client:void 0,config:void 0}),f=({children:t})=>{let{client:n,config:s}=(()=>{let{client:e,config:t}=r.useContext(d);return{client:e,config:t}})(),{config:o}=c(),{wrapSmartAccountClient:u}=a.useSmartWalletsWrapper({clientConfig:s,smartWalletsConfig:o}),{user:f}=i.usePrivyContext(),{generateSiweMessageForSmartWallet:g,linkSmartWallet:m,noPromptOnSignature:p}=i.usePrivyInternal();return r.useEffect((()=>{(async()=>{if(n&&f&&!f?.smartWallet&&o?.enabled)try{let e=await g({address:n.account.address,chainId:`eip155:${n.chain.id}`});p.current=!0;let r=await n.signMessage({message:e});await m({signature:r,message:e,smartWalletType:o.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{p.current=!1}})()}),[!!n,!!f?.smartWallet,!!o?.enabled]),e.jsx(l.Provider,{value:{client:f?.smartWallet&&n?u(n):void 0},children:t})};exports.SmartWalletsProvider=({config:r,children:t})=>e.jsx(o,{children:e.jsx(u,{config:r,children:e.jsx(f,{children:t})})}),exports.useSmartWallets=()=>{let{client:e}=r.useContext(l);return{client:e}};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./useWallets-D_QN9JnP.js"),i=require("./privy-context-BWc1w1jF.js"),n=require("./getEmbeddedConnectedWallet-B58KNyMS.js"),a=require("./smart-wallets-DLloNuo4.js");require("@ethersproject/providers"),require("tinycolor2"),require("ofetch"),require("@ethersproject/address"),require("viem"),require("permissionless"),require("permissionless/accounts"),require("permissionless/clients/pimlico"),require("viem/account-abstraction"),require("zod"),require("bs58"),require("ethers"),require("libphonenumber-js/max");let l=r.createContext({client:void 0});let s=r.createContext({config:void 0}),c=()=>{let{config:e}=r.useContext(s);return{config:e}},o=({children:t})=>{let[n,a]=r.useState(void 0),{client:l}=i.usePrivyInternal();return r.useEffect((()=>{!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.jsx(s.Provider,{value:{config:n},children:t})},u=({config:l,children:s})=>{let{config:o}=c(),{appId:u}=i.usePrivyInternal(),{chains:f,defaultChain:g,rpcConfig:m}=t.useAppConfig(),{wallets:p}=t.useWallets(),{user:h}=i.usePrivyContext(),[v,C]=r.useState(),y=n.getEmbeddedConnectedWallet(p);return r.useEffect((()=>{(async()=>{if(!o?.enabled)return;let e=o.configuredNetworks.find((e=>e.chainId===`eip155:${g.id}`))?g:f.find((e=>o.configuredNetworks.map((e=>e.chainId)).includes(`eip155:${e.id}`)));if(!e)throw new i.PrivyClientError("Could not find smart wallets chain configurations for any Privy client configured chains. Please configure smart wallets for your chains in the Privy dashboard.");C(await a.getSmartWalletClient({chain:e,privyAppId:u,paymasterContext:l?.paymasterContext,rpcConfig:m,embeddedWallet:y,user:h,smartWalletsConfig:o}))})()}),[!!o?.enabled,!!h?.smartWallet,!!y]),e.jsx(d.Provider,{value:{client:v,config:l},children:s})},d=r.createContext({client:void 0,config:void 0}),f=({children:t})=>{let{client:n,config:s}=(()=>{let{client:e,config:t}=r.useContext(d);return{client:e,config:t}})(),{config:o}=c(),{wrapSmartAccountClient:u}=a.useSmartWalletsWrapper({clientConfig:s,smartWalletsConfig:o}),{user:f}=i.usePrivyContext(),{generateSiweMessageForSmartWallet:g,linkSmartWallet:m,noPromptOnSignature:p}=i.usePrivyInternal();return r.useEffect((()=>{(async()=>{if(n&&f&&!f?.smartWallet&&o?.enabled)try{let e=await g({address:n.account.address,chainId:`eip155:${n.chain.id}`});p.current=!0;let r=await n.signMessage({message:e});await m({signature:r,message:e,smartWalletType:o.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{p.current=!1}})()}),[!!n,!!f?.smartWallet,!!o?.enabled]),e.jsx(l.Provider,{value:{client:f?.smartWallet&&n?u(n):void 0},children:t})};exports.SmartWalletsProvider=({config:r,children:t})=>e.jsx(o,{children:e.jsx(u,{config:r,children:e.jsx(f,{children:t})})}),exports.useSmartWallets=()=>{let{client:e}=r.useContext(l);return{client:e}};
package/dist/cjs/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("./privy-context-BWc1w1jF.js"),s=require("./useFundWallet-6RBQbyke.js"),r=require("./useWallets-DS5oOPnB.js"),i=require("styled-components"),n=require("@heroicons/react/24/outline/CheckIcon"),l=require("react"),o=require("@floating-ui/react");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}require("ofetch"),require("@ethersproject/address"),require("./events-context-D4csIP2K.js"),require("@heroicons/react/24/outline/Square2StackIcon"),require("@ethersproject/bignumber"),require("@ethersproject/units"),require("viem"),require("@ethersproject/providers"),require("tinycolor2");var c=a(n),h=d(l);const p=t=>e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("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"})}),x=i.styled.button`
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("./privy-context-BWc1w1jF.js"),s=require("./useFundWallet-D_NMzUBC.js"),r=require("./useWallets-D_QN9JnP.js"),i=require("styled-components"),n=require("@heroicons/react/24/outline/CheckIcon"),l=require("react"),o=require("@floating-ui/react");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(s){if("default"!==s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}})),t.default=e,Object.freeze(t)}require("ofetch"),require("@ethersproject/address"),require("./events-context-D4csIP2K.js"),require("@heroicons/react/24/outline/Square2StackIcon"),require("@ethersproject/bignumber"),require("@ethersproject/units"),require("viem"),require("@ethersproject/providers"),require("tinycolor2");var c=a(n),h=d(l);const p=t=>e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:e.jsx("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"})}),x=i.styled.button`
2
2
  --size: ${({$size:e})=>`${e}px`};
3
3
 
4
4
  -webkit-font-smoothing: antialiased;
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react"),r=require("react/jsx-runtime"),t=require("styled-components"),o=require("./useWallets-DS5oOPnB.js"),a=require("./events-context-D4csIP2K.js"),c=require("./privy-context-BWc1w1jF.js"),i=require("@heroicons/react/24/outline/Square2StackIcon"),n=require("@ethersproject/bignumber"),l=require("@ethersproject/units"),s=require("viem");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=d(i);let u=e=>n.BigNumber.from(e);class p{get(e){let r=localStorage.getItem(e);return null===r?void 0:JSON.parse(r)}put(e,r){void 0!==r?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}var v="undefined"!=typeof window&&window.localStorage?new p:new class{get(e){return this._cache[e]}put(e,r){void 0!==r?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const g=t.styled.span`
1
+ "use strict";var e=require("react"),r=require("react/jsx-runtime"),t=require("styled-components"),o=require("./useWallets-D_QN9JnP.js"),a=require("./events-context-D4csIP2K.js"),c=require("./privy-context-BWc1w1jF.js"),i=require("@heroicons/react/24/outline/Square2StackIcon"),n=require("@ethersproject/bignumber"),l=require("@ethersproject/units"),s=require("viem");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=d(i);let u=e=>n.BigNumber.from(e);class p{get(e){let r=localStorage.getItem(e);return null===r?void 0:JSON.parse(r)}put(e,r){void 0!==r?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}var v="undefined"!=typeof window&&window.localStorage?new p:new class{get(e){return this._cache[e]}put(e,r){void 0!==r?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const g=t.styled.span`
2
2
  && {
3
3
  width: 82px;
4
4
  height: 82px;
@@ -1 +1 @@
1
- "use strict";var e=require("@ethersproject/providers"),t=require("./privy-context-BWc1w1jF.js"),r=require("react/jsx-runtime"),a=require("react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(require("tinycolor2"));const l=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,i=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==l(e))return!1;if(e.providers)for(let t of e.providers)if(!i(t))return!1;return!0},s=(e,t=3,r=4,a="ethereum")=>{if(!e)return"";let n="ethereum"===a?2:0;return t+r+n+3>=e.length?e:`${e.slice(0,n+t)}...${e.slice(e.length-r,e.length)}`},p=e=>new Promise((t=>setTimeout(t,e)));const c=(e,r,a)=>{let n,o=e.id,l=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[l])n=r.rpcUrls[l];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",a),n=t.toString()}else n=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!n)throw new t.PrivyConnectorError(`No RPC url found for ${o}`);return n};const u={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},d={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},h={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},m={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},f={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},g={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},y={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},b={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},w={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},C={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},v={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},E={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},x={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},k={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},S={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},O=[u,d,k,w,C,v,E,x,y,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},f,g,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},b,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},h,m,S,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],A=new Set(O.map((e=>e.id))),_={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let U=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),T=e=>U.has(e),W=(e,t,r)=>r.indexOf(e)===t;const P=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(T).filter(W):e?e.filter(T).filter(W):_.appearance.walletList;function M(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let I="#FFFFFF";function F(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function L({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=I;break;case"dark":r="#1E1E1D";break;default:r=e}let a=o.default(r),n=o.default(t),l=o.default("#51BA81"),i=o.default("#FFB74D"),s=o.default("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(a.getLuminance()),c=F(a,"light"===p?-.04:.11),u=F(a,"light"===p?-.88:.87),d=F(a,"light"===p?-.7:.75),h=F(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=F(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),f=F(n,.15),g=F(n,.25),y=F(n,-.06),b=F(n,-.6),w=F(s,.3),C=F(i,.3),v=o.default(n.getLuminance()>.5?"#040217":I),E=F(l,-.16),x=F(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),foreground:u.toHslString(),foreground2:d.toHslString(),foreground3:h.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:f.toHslString(),accentLightest:g.toHslString(),accentDark:y.toHslString(),accentDarkest:b.toHslString(),foregroundAccent:v.toHslString(),success:l.toHslString(),successDark:E.toHslString(),successLight:x.toHslString(),error:s.toHslString(),errorLight:w.toHslString(),warn:i.toHslString(),warnLight:C.toHslString()}}function D(e,t,r){let a,n,o,l,i,s,p,c,u,d,h,m,f,g,y,b,C=r?console.warn:()=>{};t?.loginMethods?(a=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),d=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),h=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),g=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(a=e.emailAuth,n=e.smsAuth,l=e.walletAuth||e.solanaWalletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,u=e.spotifyOAuth,d=e.instagramOAuth,c=e.tiktokOAuth,h=e.linkedinOAuth,f=e.appleOAuth,g=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let v=[a,n].filter(Boolean),E=[i,s,p,m,u,d,c,h,f,g,y].filter(Boolean),x=[l].filter(Boolean);if(v.length+E.length+x.length===0)throw Error("You must enable at least one login method");let k=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;k&&0===x.length?(C("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),k=!1):k||E.length+v.length!==0||(C("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),k=!0);let S=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&C("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let A=P({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),U=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let a of e.overflow??[])t.includes(a)||r.includes(a)?console.warn(`Duplicated login method: ${a}`):r.push(a);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),T=t?.intl?.defaultCountry??"US",{chains:W,defaultChain:I}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:a}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&a&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=O.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?M(e,r):e}))}else n=O.concat(e??[]);let o=t?n[0]:w,l=r??o;if(!n.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),F=!!t?.defaultChain,D=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?D?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??R:R,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:H,...K}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??_.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:L({backgroundTheme:t?.appearance?.theme??_.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??_.appearance.accentColor}),loginGroupPriority:k?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:A,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:l,email:a,sms:n,passkey:o,google:i,twitter:s,discord:p,github:m,spotify:u,instagram:d,tiktok:c,linkedin:h,apple:f,farcaster:g,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:U,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??_.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??_.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??_.rpcConfig.rpcTimeouts},chains:W,defaultChain:I,intl:{defaultCountry:T},shouldEnforceDefaultChainOnConnect:F,captchaEnabled:e.captchaEnabled??_.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??_.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:S},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof H?{requireUserOwnedRecoveryOnCreate:H}:{},...D?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...K,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:D?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??_._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??_.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??_.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??_.fundingMethodConfig.moonpay.useSandbox}}}}let R={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const H=D(R,void 0,!1);let K=a.createContext({appConfig:H,isServerConfigLoaded:!1});const N=a.createContext(null);exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=H,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=O,exports.DEFAULT_SUPPORTED_CHAIN_IDS=A,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PrivyAppConfigProvider=({children:e,legacyCreateEmbeddedWalletFlag:t,client:n,clientConfig:o})=>{let[l,i]=a.useState(null),s=a.useMemo((()=>D(l??R,o,!!l)),[l,o]);return a.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:a,supportedChains:n,defaultChain:o,externalWallets:l,...i}=e;return{...i,...a?{additionalChains:a.map((e=>e.id))}:void 0,...n?{supportedChains:n.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(o,t),r=function(e,t=0){let r=3735928559^t,a=1103547991^t;for(let t,n=0;n<e.length;n++)r=Math.imul(r^(t=e.charCodeAt(n)),2654435761),a=Math.imul(a^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${l.id}:${r}`;localStorage.getItem(a)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[o,t,l]),a.useEffect((()=>{l||(async()=>{try{let e=await n.getServerConfig();e.customApiUrl&&n.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),r.jsx(K.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:e})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.UseWalletsContext=N,exports.VERSION="1.94.1",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=M,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!A.has(e.id)));return O.concat(t)},exports.arbitrum=u,exports.arbitrumSepolia=d,exports.avalanche=h,exports.avalancheFuji=m,exports.base=f,exports.baseSepolia=g,exports.celo=y,exports.clamp=function(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)},exports.constructURL=(e,t,r={},a={})=>{let n=new URL(t,e);for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);let o=Object.entries(a);if(o.length>0){let e=new URLSearchParams;for(let[t,r]of o)e.append(t,r);n.hash=e.toString()}return n.href},exports.convert1dTo2dArray=(e,t)=>{let r=e.slice(0),a=[];for(;r.length;)a.push(r.splice(0,t));return a},exports.detectInjectedConnectors=async function({store:e,walletList:t,externalWalletConfig:r,walletChainType:a,timeout:n=3e3}){let o=!1,s=window;return new Promise((p=>{function c(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",c);let n=e.getProviders();console.debug("Detected injected providers:",n.map((e=>e.info)));let s=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===a&&"app.phantom"===e.info.rdns||s.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==a)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=l(e);if(!n.some((e=>e.info.name===t))){if(i(e,!0)&&!s.find((e=>"metamask"===e.type))){s.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!s.find((e=>"phantom"===e.type))){s.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!s.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==r.coinbaseWallet?.connectionOptions))){s.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}s.find((e=>"unknown_browser_extension"===e.type))||s.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}p(s)}s.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout((()=>{c()}),n))}))},exports.formatChainIdToCAIP2=function(e){return`eip155:${String(Number(e))}`},exports.formatSolanaWalletAddress=(e,t=3,r=4)=>s(e,t,r,"solana"),exports.formatWalletAddress=s,exports.generateTypedDataWithDomainType=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map((([e,r])=>{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:r}}},exports.getBlockExplorer=(e,r)=>{let a=Number(e),n=r.find((e=>e.id===a));if(!n)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getJsonRpcEndpoint=(e,r,a,n)=>{let o=Number(e),l=r.find((e=>e.id===o));if(!l)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return c(l,a,n)},exports.getJsonRpcEndpointFromChain=c,exports.getJsonRpcProvider=(r,a,n,o)=>{let l=Number(r),i=a.find((e=>e.id===l));if(!i)throw new t.PrivyConnectorError(`Unsupported chainId ${r}`,4901);return new e.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?i.rpcUrls.privyWalletOverride.http[0]:n.rpcUrls&&n.rpcUrls[l]?n.rpcUrls[l]:i.rpcUrls.privy?.http[0]?{url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}:i.rpcUrls.public?.http[0]?i.rpcUrls.public.http[0]:i.rpcUrls.default?.http[0])},exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.invokeUntilSettled=(e,t={})=>{let r=t.delayMs||150,a=t.maxAttempts||270;return new Promise((async(n,o)=>{let l=!1,i=0;for(;!l&&i<a;){if(t.abortSignal?.aborted)return;e().then((e=>{l=!0,n(e)}),((...e)=>{l=!0,o(...e)})),i+=1,await p(r)}l||o(Error("Exceeded max attempts before resolving function"))}))},exports.isCoinbaseWalletInstalled=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},exports.isPhantomInstalled=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},exports.linea=b,exports.mainnet=w,exports.optimism=C,exports.optimismSepolia=v,exports.pollForResult=function(e,{interval:t=100,timeout:r=5e3}={}){return new Promise(((a,n)=>{let o,l=0,i=()=>{l>=r?n("Max attempts reached without result"):(o=e(),l+=t,null==o?setTimeout(i,t):a(o))};i()}))},exports.polygon=E,exports.polygonAmoy=x,exports.sepolia=k,exports.sleep=p,exports.splitAtIndex=(e,t)=>{let r=[],a=[];for(let[n,o]of e.entries())n<t?r.push(o):a.push(o);return[r,a]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.useAppConfig=()=>{let{appConfig:e}=a.useContext(K);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=a.useContext(K);return e},exports.useWallets=function(){let e=a.useContext(N);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.validateEmail=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),exports.zora=S;
1
+ "use strict";var e=require("@ethersproject/providers"),t=require("./privy-context-BWc1w1jF.js"),r=require("react/jsx-runtime"),a=require("react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(require("tinycolor2"));const l=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,i=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==l(e))return!1;if(e.providers)for(let t of e.providers)if(!i(t))return!1;return!0},s=(e,t=3,r=4,a="ethereum")=>{if(!e)return"";let n="ethereum"===a?2:0;return t+r+n+3>=e.length?e:`${e.slice(0,n+t)}...${e.slice(e.length-r,e.length)}`},p=e=>new Promise((t=>setTimeout(t,e)));const c=(e,r,a)=>{let n,o=e.id,l=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[l])n=r.rpcUrls[l];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",a),n=t.toString()}else n=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!n)throw new t.PrivyConnectorError(`No RPC url found for ${o}`);return n};const u={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},d={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},h={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},m={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},f={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},g={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},y={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},b={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},w={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},C={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},v={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},E={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},x={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},k={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},S={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},O=[u,d,k,w,C,v,E,x,y,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},f,g,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},b,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},h,m,S,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],A=new Set(O.map((e=>e.id))),_={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let U=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),T=e=>U.has(e),W=(e,t,r)=>r.indexOf(e)===t;const P=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(T).filter(W):e?e.filter(T).filter(W):_.appearance.walletList;function M(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let I="#FFFFFF";function F(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function L({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=I;break;case"dark":r="#1E1E1D";break;default:r=e}let a=o.default(r),n=o.default(t),l=o.default("#51BA81"),i=o.default("#FFB74D"),s=o.default("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(a.getLuminance()),c=F(a,"light"===p?-.04:.11),u=F(a,"light"===p?-.88:.87),d=F(a,"light"===p?-.7:.75),h=F(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=F(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),f=F(n,.15),g=F(n,.25),y=F(n,-.06),b=F(n,-.6),w=F(s,.3),C=F(i,.3),v=o.default(n.getLuminance()>.5?"#040217":I),E=F(l,-.16),x=F(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),foreground:u.toHslString(),foreground2:d.toHslString(),foreground3:h.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:f.toHslString(),accentLightest:g.toHslString(),accentDark:y.toHslString(),accentDarkest:b.toHslString(),foregroundAccent:v.toHslString(),success:l.toHslString(),successDark:E.toHslString(),successLight:x.toHslString(),error:s.toHslString(),errorLight:w.toHslString(),warn:i.toHslString(),warnLight:C.toHslString()}}function D(e,t,r){let a,n,o,l,i,s,p,c,u,d,h,m,f,g,y,b,C=r?console.warn:()=>{};t?.loginMethods?(a=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),d=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),h=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),g=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(a=e.emailAuth,n=e.smsAuth,l=e.walletAuth||e.solanaWalletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,u=e.spotifyOAuth,d=e.instagramOAuth,c=e.tiktokOAuth,h=e.linkedinOAuth,f=e.appleOAuth,g=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let v=[a,n].filter(Boolean),E=[i,s,p,m,u,d,c,h,f,g,y].filter(Boolean),x=[l].filter(Boolean);if(v.length+E.length+x.length===0)throw Error("You must enable at least one login method");let k=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;k&&0===x.length?(C("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),k=!1):k||E.length+v.length!==0||(C("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),k=!0);let S=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&C("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let A=P({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),U=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let a of e.overflow??[])t.includes(a)||r.includes(a)?console.warn(`Duplicated login method: ${a}`):r.push(a);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),T=t?.intl?.defaultCountry??"US",{chains:W,defaultChain:I}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:a}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&a&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=O.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?M(e,r):e}))}else n=O.concat(e??[]);let o=t?n[0]:w,l=r??o;if(!n.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),F=!!t?.defaultChain,D=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?D?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??R:R,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:H,...K}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??_.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:L({backgroundTheme:t?.appearance?.theme??_.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??_.appearance.accentColor}),loginGroupPriority:k?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:A,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:l,email:a,sms:n,passkey:o,google:i,twitter:s,discord:p,github:m,spotify:u,instagram:d,tiktok:c,linkedin:h,apple:f,farcaster:g,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:U,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??_.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??_.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??_.rpcConfig.rpcTimeouts},chains:W,defaultChain:I,intl:{defaultCountry:T},shouldEnforceDefaultChainOnConnect:F,captchaEnabled:e.captchaEnabled??_.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??_.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:S},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof H?{requireUserOwnedRecoveryOnCreate:H}:{},...D?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...K,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:D?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??_._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??_.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??_.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??_.fundingMethodConfig.moonpay.useSandbox}}}}let R={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const H=D(R,void 0,!1);let K=a.createContext({appConfig:H,isServerConfigLoaded:!1});const N=a.createContext(null);exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=H,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=O,exports.DEFAULT_SUPPORTED_CHAIN_IDS=A,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PrivyAppConfigProvider=({children:e,legacyCreateEmbeddedWalletFlag:t,client:n,clientConfig:o})=>{let[l,i]=a.useState(null),s=a.useMemo((()=>D(l??R,o,!!l)),[l,o]);return a.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:a,supportedChains:n,defaultChain:o,externalWallets:l,...i}=e;return{...i,...a?{additionalChains:a.map((e=>e.id))}:void 0,...n?{supportedChains:n.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(o,t),r=function(e,t=0){let r=3735928559^t,a=1103547991^t;for(let t,n=0;n<e.length;n++)r=Math.imul(r^(t=e.charCodeAt(n)),2654435761),a=Math.imul(a^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${l.id}:${r}`;localStorage.getItem(a)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[o,t,l]),a.useEffect((()=>{l||(async()=>{try{let e=await n.getServerConfig();e.customApiUrl&&n.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),r.jsx(K.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:e})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.UseWalletsContext=N,exports.VERSION="1.94.2",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=M,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!A.has(e.id)));return O.concat(t)},exports.arbitrum=u,exports.arbitrumSepolia=d,exports.avalanche=h,exports.avalancheFuji=m,exports.base=f,exports.baseSepolia=g,exports.celo=y,exports.clamp=function(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)},exports.constructURL=(e,t,r={},a={})=>{let n=new URL(t,e);for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);let o=Object.entries(a);if(o.length>0){let e=new URLSearchParams;for(let[t,r]of o)e.append(t,r);n.hash=e.toString()}return n.href},exports.convert1dTo2dArray=(e,t)=>{let r=e.slice(0),a=[];for(;r.length;)a.push(r.splice(0,t));return a},exports.detectInjectedConnectors=async function({store:e,walletList:t,externalWalletConfig:r,walletChainType:a,timeout:n=3e3}){let o=!1,s=window;return new Promise((p=>{function c(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",c);let n=e.getProviders();console.debug("Detected injected providers:",n.map((e=>e.info)));let s=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===a&&"app.phantom"===e.info.rdns||s.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==a)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=l(e);if(!n.some((e=>e.info.name===t))){if(i(e,!0)&&!s.find((e=>"metamask"===e.type))){s.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!s.find((e=>"phantom"===e.type))){s.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!s.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==r.coinbaseWallet?.connectionOptions))){s.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}s.find((e=>"unknown_browser_extension"===e.type))||s.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}p(s)}s.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout((()=>{c()}),n))}))},exports.formatChainIdToCAIP2=function(e){return`eip155:${String(Number(e))}`},exports.formatSolanaWalletAddress=(e,t=3,r=4)=>s(e,t,r,"solana"),exports.formatWalletAddress=s,exports.generateTypedDataWithDomainType=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map((([e,r])=>{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:r}}},exports.getBlockExplorer=(e,r)=>{let a=Number(e),n=r.find((e=>e.id===a));if(!n)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getJsonRpcEndpoint=(e,r,a,n)=>{let o=Number(e),l=r.find((e=>e.id===o));if(!l)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return c(l,a,n)},exports.getJsonRpcEndpointFromChain=c,exports.getJsonRpcProvider=(r,a,n,o)=>{let l=Number(r),i=a.find((e=>e.id===l));if(!i)throw new t.PrivyConnectorError(`Unsupported chainId ${r}`,4901);return new e.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?i.rpcUrls.privyWalletOverride.http[0]:n.rpcUrls&&n.rpcUrls[l]?n.rpcUrls[l]:i.rpcUrls.privy?.http[0]?{url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}:i.rpcUrls.public?.http[0]?i.rpcUrls.public.http[0]:i.rpcUrls.default?.http[0])},exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.invokeUntilSettled=(e,t={})=>{let r=t.delayMs||150,a=t.maxAttempts||270;return new Promise((async(n,o)=>{let l=!1,i=0;for(;!l&&i<a;){if(t.abortSignal?.aborted)return;e().then((e=>{l=!0,n(e)}),((...e)=>{l=!0,o(...e)})),i+=1,await p(r)}l||o(Error("Exceeded max attempts before resolving function"))}))},exports.isCoinbaseWalletInstalled=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},exports.isPhantomInstalled=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},exports.linea=b,exports.mainnet=w,exports.optimism=C,exports.optimismSepolia=v,exports.pollForResult=function(e,{interval:t=100,timeout:r=5e3}={}){return new Promise(((a,n)=>{let o,l=0,i=()=>{l>=r?n("Max attempts reached without result"):(o=e(),l+=t,null==o?setTimeout(i,t):a(o))};i()}))},exports.polygon=E,exports.polygonAmoy=x,exports.sepolia=k,exports.sleep=p,exports.splitAtIndex=(e,t)=>{let r=[],a=[];for(let[n,o]of e.entries())n<t?r.push(o):a.push(o);return[r,a]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.useAppConfig=()=>{let{appConfig:e}=a.useContext(K);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=a.useContext(K);return e},exports.useWallets=function(){let e=a.useContext(N);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.validateEmail=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),exports.zora=S;
@@ -1 +1 @@
1
- import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{createWalletClient as r,custom as t}from"viem";import{toAccount as n}from"viem/accounts";import{abstractTestnet as a}from"viem/chains";import{j as i,u as s,w as o}from"./privy-context-2XTbQLV9.mjs";import{u as c,M as l,g as p}from"./getEmbeddedConnectedWallet-CrtphMZJ.mjs";import{a4 as m,U as d}from"./useWallets-2CoAaSEx.mjs";import{c as E}from"./smart-wallets-BkY69ru9.mjs";import"ofetch";import"@ethersproject/address";import"react";import"react/jsx-runtime";import"@ethersproject/providers";import"tinycolor2";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";import"zod";import"bs58";import"ethers";import"libphonenumber-js/max";function u(){let{user:u}=i(),{noPromptOnSignature:g,openPrivyModal:y,chains:f,appId:T,rpcConfig:D}=s(),{wallets:h}=m(),{setModalData:I}=c(),N=async()=>{let i=p(h);if(!i)throw Error("No connected wallet found");let s=f.find((e=>e.id===a.id));if(!s)throw Error("Chain not configured");await i.switchChain(s.id);let o=await i.getEthereumProvider(),c=r({account:i.address,transport:t(o)}),l=n({address:i.address,signMessage:c.signMessage,signTransaction:c.signTransaction,signTypedData:c.signTypedData});return await e({chain:{...s,rpcUrls:{default:{http:[d(s,D,T)]}}},signer:l})};return{signMessage:async({message:e})=>{let r=await N();return new Promise((async(t,n)=>{let{entropyId:a,entropyIdVerifier:i}=o(u);g.current=!0,I({connectWallet:{entropyId:a,entropyIdVerifier:i,onCompleteNavigateTo:l.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),y(l.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))},signTypedData:async e=>{let r=await N();return new Promise((async(t,n)=>{g.current=!0;let{entropyId:a,entropyIdVerifier:i}=o(u);I({connectWallet:{entropyId:a,entropyIdVerifier:i,onCompleteNavigateTo:l.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),y(l.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))},sendTransaction:async e=>{let r=await N(),t=[];return t="calls"in e&&void 0!==e.calls?[...e.calls]:[e],new Promise((async(n,a)=>{g.current=!0;let{entropyId:i,entropyIdVerifier:s}=o(u);I({connectWallet:{entropyId:i,entropyIdVerifier:s,onCompleteNavigateTo:l.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:E({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:i,entropyIdVerifier:s,transactingWallet:{address:r.account.address,walletIndex:null},getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterData,onConfirm:()=>t.length>1?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>n(e.hash),onFailure:a,uiOptions:{}}}),y(l.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))}}}export{u as useAbstractSmartWallets};
1
+ import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{createWalletClient as r,custom as t}from"viem";import{toAccount as n}from"viem/accounts";import{abstractTestnet as a}from"viem/chains";import{j as i,u as s,w as o}from"./privy-context-2XTbQLV9.mjs";import{u as c,M as l,g as p}from"./getEmbeddedConnectedWallet-BfN7mN3S.mjs";import{a4 as m,U as d}from"./useWallets-BhLT0fR-.mjs";import{c as E}from"./smart-wallets-CUo4wQHo.mjs";import"ofetch";import"@ethersproject/address";import"react";import"react/jsx-runtime";import"@ethersproject/providers";import"tinycolor2";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";import"zod";import"bs58";import"ethers";import"libphonenumber-js/max";function u(){let{user:u}=i(),{noPromptOnSignature:g,openPrivyModal:y,chains:f,appId:T,rpcConfig:D}=s(),{wallets:h}=m(),{setModalData:I}=c(),N=async()=>{let i=p(h);if(!i)throw Error("No connected wallet found");let s=f.find((e=>e.id===a.id));if(!s)throw Error("Chain not configured");await i.switchChain(s.id);let o=await i.getEthereumProvider(),c=r({account:i.address,transport:t(o)}),l=n({address:i.address,signMessage:c.signMessage,signTransaction:c.signTransaction,signTypedData:c.signTypedData});return await e({chain:{...s,rpcUrls:{default:{http:[d(s,D,T)]}}},signer:l})};return{signMessage:async({message:e})=>{let r=await N();return new Promise((async(t,n)=>{let{entropyId:a,entropyIdVerifier:i}=o(u);g.current=!0,I({connectWallet:{entropyId:a,entropyIdVerifier:i,onCompleteNavigateTo:l.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),y(l.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))},signTypedData:async e=>{let r=await N();return new Promise((async(t,n)=>{g.current=!0;let{entropyId:a,entropyIdVerifier:i}=o(u);I({connectWallet:{entropyId:a,entropyIdVerifier:i,onCompleteNavigateTo:l.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),y(l.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))},sendTransaction:async e=>{let r=await N(),t=[];return t="calls"in e&&void 0!==e.calls?[...e.calls]:[e],new Promise((async(n,a)=>{g.current=!0;let{entropyId:i,entropyIdVerifier:s}=o(u);I({connectWallet:{entropyId:i,entropyIdVerifier:s,onCompleteNavigateTo:l.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:E({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:i,entropyIdVerifier:s,transactingWallet:{address:r.account.address,walletIndex:null},getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterData,onConfirm:()=>t.length>1?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>n(e.hash),onFailure:a,uiOptions:{}}}),y(l.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{g.current=!1}))}}}export{u as useAbstractSmartWallets};
@@ -1 +1 @@
1
- import{jsx as E,jsxs as _}from"react/jsx-runtime";import{useState as N,useEffect as A,useRef as S,useContext as R,createContext as T}from"react";import{A as C,aq as D}from"./useWallets-2CoAaSEx.mjs";import{n as L}from"./privy-context-2XTbQLV9.mjs";function O({src:_,...N}){return E("img",{src:_,...N,style:{display:"none"}})}var I,e;(I=e||(e={})).LANDING="LANDING",I.CONNECT_OR_CREATE="CONNECT_OR_CREATE",I.AWAITING_CONNECTION="AWAITING_CONNECTION",I.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",I.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",I.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",I.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",I.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",I.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",I.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",I.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",I.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",I.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",I.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",I.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",I.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",I.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",I.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",I.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",I.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",I.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",I.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",I.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",I.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",I.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",I.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",I.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",I.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",I.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",I.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",I.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",I.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",I.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",I.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",I.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",I.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",I.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",I.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",I.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",I.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",I.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",I.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",I.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",I.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",I.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",I.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",I.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",I.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",I.MOONPAY_PROMPT_SCREEN="MOONPAY_PROMPT_SCREEN",I.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",I.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",I.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",I.CAPTCHA_SCREEN="CAPTCHA_SCREEN",I.ERROR_SCREEN="ERROR_SCREEN",I.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",I.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",I.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const M=T({ready:!1,app:D,currentScreen:null,lastScreen:null,navigate:L,navigateBack:L,resetNavigation:L,setModalData:L,onUserCloseViaDialogOrKeybindRef:void 0});let a=[e.LANDING,e.CONNECT_ONLY_LANDING_SCREEN,null];const W=R=>{let T=C(),D=R.authenticated,[L,I]=N(R.initialScreen);A((()=>{D||a.includes(R.initialScreen)||R.setInitialScreen(null)}),[D]);let e=S(null);A((()=>{R.open||(e.current=null)}),[R.open]),A((()=>{e.current=null}),[R.initialScreen]);let W={ready:!!T.id,app:T,data:R.data,setModalData:R.setModalData,currentScreen:R.initialScreen,lastScreen:L,navigate:(E,_=!0)=>{R.setInitialScreen(E),_&&I(R.initialScreen)},navigateBack:()=>{R.setInitialScreen(L)},resetNavigation:()=>{R.setInitialScreen(null),I(null)},onUserCloseViaDialogOrKeybindRef:e};return _(M.Provider,{value:W,children:[("string"==typeof T.appearance.logo||"img"===T.appearance.logo?.type)&&E(O,{src:"string"==typeof T.appearance.logo?T.appearance.logo:T.appearance.logo.props.src}),R.children]})},n=()=>R(M);function t(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null}export{e as M,W as a,t as g,n as u};
1
+ import{jsx as E,jsxs as _}from"react/jsx-runtime";import{useState as N,useEffect as A,useRef as S,useContext as R,createContext as T}from"react";import{A as C,aq as D}from"./useWallets-BhLT0fR-.mjs";import{n as L}from"./privy-context-2XTbQLV9.mjs";function O({src:_,...N}){return E("img",{src:_,...N,style:{display:"none"}})}var I,e;(I=e||(e={})).LANDING="LANDING",I.CONNECT_OR_CREATE="CONNECT_OR_CREATE",I.AWAITING_CONNECTION="AWAITING_CONNECTION",I.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",I.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",I.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",I.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",I.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",I.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",I.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",I.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",I.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",I.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",I.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",I.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",I.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",I.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",I.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",I.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",I.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",I.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",I.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",I.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",I.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",I.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",I.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",I.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",I.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",I.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",I.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",I.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",I.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",I.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",I.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",I.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",I.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",I.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",I.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",I.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",I.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",I.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",I.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",I.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",I.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",I.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",I.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",I.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",I.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",I.MOONPAY_PROMPT_SCREEN="MOONPAY_PROMPT_SCREEN",I.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",I.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",I.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",I.CAPTCHA_SCREEN="CAPTCHA_SCREEN",I.ERROR_SCREEN="ERROR_SCREEN",I.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",I.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",I.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const M=T({ready:!1,app:D,currentScreen:null,lastScreen:null,navigate:L,navigateBack:L,resetNavigation:L,setModalData:L,onUserCloseViaDialogOrKeybindRef:void 0});let a=[e.LANDING,e.CONNECT_ONLY_LANDING_SCREEN,null];const W=R=>{let T=C(),D=R.authenticated,[L,I]=N(R.initialScreen);A((()=>{D||a.includes(R.initialScreen)||R.setInitialScreen(null)}),[D]);let e=S(null);A((()=>{R.open||(e.current=null)}),[R.open]),A((()=>{e.current=null}),[R.initialScreen]);let W={ready:!!T.id,app:T,data:R.data,setModalData:R.setModalData,currentScreen:R.initialScreen,lastScreen:L,navigate:(E,_=!0)=>{R.setInitialScreen(E),_&&I(R.initialScreen)},navigateBack:()=>{R.setInitialScreen(L)},resetNavigation:()=>{R.setInitialScreen(null),I(null)},onUserCloseViaDialogOrKeybindRef:e};return _(M.Provider,{value:W,children:[("string"==typeof T.appearance.logo||"img"===T.appearance.logo?.type)&&E(O,{src:"string"==typeof T.appearance.logo?T.appearance.logo:T.appearance.logo.props.src}),R.children]})},n=()=>R(M);function t(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null}export{e as M,W as a,t as g,n as u};