@privy-io/react-auth 1.94.1 → 1.94.3-beta-20241118141256
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.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{getEmbeddedConnectedWallet-BAWFwm3E.js → getEmbeddedConnectedWallet-Del3IDYI.js} +1 -1
- package/dist/cjs/index.js +310 -310
- package/dist/cjs/smart-wallets-DJPOfurY.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{useFundWallet-6RBQbyke.js → useFundWallet-BeSetwKW.js} +1 -1
- package/dist/cjs/{useWallets-DS5oOPnB.js → useWallets-C0z7M7ns.js} +1 -1
- package/dist/dts/index.d.mts +9 -7
- package/dist/dts/index.d.ts +9 -7
- package/dist/dts/{solana-PuIs0zwD.d.mts → solana-HIKrfby6.d.mts} +1 -1
- package/dist/dts/{solana-PuIs0zwD.d.ts → solana-HIKrfby6.d.ts} +1 -1
- package/dist/dts/solana.d.mts +2 -2
- package/dist/dts/solana.d.ts +2 -2
- package/dist/dts/{types-STuZuryK.d.mts → types-D0KmEjpU.d.mts} +7 -3
- package/dist/dts/{types-STuZuryK.d.ts → types-D0KmEjpU.d.ts} +7 -3
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/{getEmbeddedConnectedWallet-CrtphMZJ.mjs → getEmbeddedConnectedWallet-D3Za0fyV.mjs} +1 -1
- package/dist/esm/index.mjs +306 -306
- package/dist/esm/smart-wallets-a33-nifX.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{useFundWallet-FgeN9XU6.mjs → useFundWallet-DU2VXB6Y.mjs} +1 -1
- package/dist/esm/useWallets-NYcDMECu.mjs +1 -0
- package/package.json +3 -3
- package/dist/cjs/smart-wallets-C_uID25w.js +0 -1
- package/dist/esm/smart-wallets-BkY69ru9.mjs +0 -1
- package/dist/esm/useWallets-2CoAaSEx.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRef as e,useState as t,useCallback as a}from"react";import{http as n,createPublicClient as r}from"viem";import{P as i,u as o,j as s,w as l}from"./privy-context-2XTbQLV9.mjs";import{U as c,A as p,a4 as d}from"./useWallets-2CoAaSEx.mjs";import{u,g as _,M as m}from"./getEmbeddedConnectedWallet-CrtphMZJ.mjs";import{createSmartAccountClient as g}from"permissionless";import{toLightSmartAccount as b,toBiconomySmartAccount as h,toEcdsaKernelSmartAccount as y,toSafeSmartAccount as v}from"permissionless/accounts";import{createPimlicoClient as f}from"permissionless/clients/pimlico";import{toCoinbaseSmartAccount as I,entryPoint06Address as S,entryPoint07Address as k}from"viem/account-abstraction";import T,{z as w}from"zod";import A from"bs58";import{ethers as E}from"ethers";import{parsePhoneNumber as P}from"libphonenumber-js/max";let j;var O=((j=O||{}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",j.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",j.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",j.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",j.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",j.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",j.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",j.INVALID_DATA="invalid_data",j.INVALID_CREDENTIALS="invalid_credentials",j.INVALID_CAPTCHA="invalid_captcha",j.LINKED_TO_ANOTHER_USER="linked_to_another_user",j.ALLOWLIST_REJECTED="allowlist_rejected",j.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",j.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",j.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",j.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",j.TOO_MANY_REQUESTS="too_many_requests",j.INVALID_ORIGIN="invalid_origin",j.MISSING_ORIGIN="missing_origin",j.INVALID_NATIVE_APP_ID="invalid_native_app_id",j.TOKEN_ALREADY_USED="token_already_used",j.ALREADY_LOGGED_OUT="already_logged_out",j.NOT_SUPPORTED="not_supported",j.USER_UNSUBSCRIBED="user_unsubscribed",j.MAX_APPS_REACHED="max_apps_reached",j.USER_LIMIT_REACHED="max_accounts_reached",j.DEVICE_REVOKED="device_revoked",j.WALLET_PASSWORD_EXISTS="wallet_password_exists",j.OAUTH_STATE_MISMATCH="oauth_state_mismatch",j.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",j.DISALLOWED_LOGIN_METHOD="disallowed_login_method",j.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",j.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",j.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",j.CANNOT_SET_PASSWORD="cannot_set_password",j.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",j.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",j.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",j.USER_DOES_NOT_EXIST="user_does_not_exist",j.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",j.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",j.FEATURE_NOT_ENABLED="feature_not_enabled",j),C=class extends Error{toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a,n){super(t),this.code=a,this.status=e,this.responseData=n}},N=class extends C{constructor(e,t){super(400,e,t||"invalid_data")}},R=class extends C{constructor(e,t){super(401,e,t)}},D=class extends C{constructor(e,t){super(422,e,t)}};function x(e,t){return Object.keys(t).forEach((function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[a]}})})),e}function L(e,t,a,n){Object.defineProperty(e,t,{get:a,set:n,enumerable:!0,configurable:!0})}w.object({error:w.string(),cause:w.string().optional(),code:w.nativeEnum(O).optional()});var W={},U={};L(U,"AnalyticsEvent",(()=>M));let M={path:"/api/v1/analytics_events",method:"POST"};var F={};L(F,"AppConfig",(()=>G));let G={path:"/api/v1/apps/:app_id",method:"GET"};var V={};L(V,"CoinbaseOnRampInit",(()=>q)),L(V,"CoinbaseOnRampStatus",(()=>B));let q={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},B={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"};var K={};L(K,"GetCrossAppConnections",(()=>$));let $={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"};var H={};L(H,"CustomJWTAuthenticate",(()=>z));let z={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"};var Y={};L(Y,"FarcasterInit",(()=>J)),L(Y,"FarcasterAuthenticate",(()=>Q)),L(Y,"FarcasterLink",(()=>X)),L(Y,"FarcasterUnlink",(()=>Z)),L(Y,"FarcasterStatus",(()=>ee));let J={path:"/api/v1/farcaster/init",method:"POST"},Q={path:"/api/v1/farcaster/authenticate",method:"POST"},X={path:"/api/v1/farcaster/link",method:"POST"},Z={path:"/api/v1/farcaster/unlink",method:"POST"},ee={path:"/api/v1/farcaster/status",method:"GET"};var te={};L(te,"FarcasterSignerInit",(()=>ae)),L(te,"FarcasterSignerStatus",(()=>ne));let ae={path:"/api/v1/farcaster/signer/init",method:"POST"},ne={path:"/api/v1/farcaster/signer/status",method:"POST"};var re={};L(re,"GuestAuthenticate",(()=>ie));let ie={path:"/api/v1/guest/authenticate",method:"POST"};var oe={};L(oe,"MfaPasskeyInit",(()=>se)),L(oe,"MfaPasskeyVerify",(()=>le)),L(oe,"MfaPasskeyEnrollment",(()=>ce));let se={path:"/api/v1/mfa/passkeys/init",method:"POST"},le={path:"/api/v1/mfa/passkeys/verify",method:"POST"},ce={path:"/api/v1/mfa/passkeys/enrollment",method:"POST"};var pe={};L(pe,"MfaPasswordlessSmsEnroll",(()=>de)),L(pe,"MfaPasswordlessSmsVerify",(()=>ue)),L(pe,"MfaPasswordlessSmsInit",(()=>_e)),L(pe,"MfaPasswordlessSmsUnenroll",(()=>me));let de={path:"/api/v1/mfa/passwordless_sms/enroll",method:"POST"},ue={path:"/api/v1/mfa/passwordless_sms/verify",method:"POST"},_e={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},me={path:"/api/v1/mfa/passwordless_sms/unenroll",method:"POST"};var ge={};L(ge,"MfaTotpEnroll",(()=>be)),L(ge,"MfaTotpVerify",(()=>he)),L(ge,"MfaTotpInit",(()=>ye)),L(ge,"MfaTotpUnenroll",(()=>ve));let be={path:"/api/v1/mfa/totp/enroll",method:"POST"},he={path:"/api/v1/mfa/totp/verify",method:"POST"},ye={path:"/api/v1/mfa/totp/init",method:"POST"},ve={path:"/api/v1/mfa/totp/unenroll",method:"POST"};var fe={};L(fe,"OAuthAuthenticate",(()=>Ie)),L(fe,"OAuthInit",(()=>Se)),L(fe,"OAuthLink",(()=>ke)),L(fe,"OAuthUnlink",(()=>Te));let Ie={path:"/api/v1/oauth/authenticate",method:"POST"},Se={path:"/api/v1/oauth/init",method:"POST"},ke={path:"/api/v1/oauth/link",method:"POST"},Te={path:"/api/v1/oauth/unlink",method:"POST"};var we={};L(we,"OAuthProviderAuthorize",(()=>Ae)),L(we,"OAuthProviderVerify",(()=>Ee));let Ae={path:"/oauth/authorization_code",method:"POST"},Ee={path:"/oauth/verify",method:"POST"};var Pe={};L(Pe,"PasskeyLink",(()=>je)),L(Pe,"PasskeyAuthenticate",(()=>Oe)),L(Pe,"PasskeyAuthenticateInit",(()=>Ce)),L(Pe,"PasskeyLinkInit",(()=>Ne)),L(Pe,"PasskeyUnlink",(()=>Re));let je={path:"/api/v1/passkeys/link",method:"POST"},Oe={path:"/api/v1/passkeys/authenticate",method:"POST"},Ce={path:"/api/v1/passkeys/authenticate/init",method:"POST"},Ne={path:"/api/v1/passkeys/link/init",method:"POST"},Re={path:"/api/v1/passkeys/unlink",method:"POST"};var De={};L(De,"PasswordlessAuthenticate",(()=>xe)),L(De,"PasswordlessInit",(()=>Le)),L(De,"PasswordlessLink",(()=>We)),L(De,"PasswordlessUnlink",(()=>Ue)),L(De,"PasswordlessUpdate",(()=>Me));let xe={path:"/api/v1/passwordless/authenticate",method:"POST"},Le={path:"/api/v1/passwordless/init",method:"POST"},We={path:"/api/v1/passwordless/link",method:"POST"},Ue={path:"/api/v1/passwordless/unlink",method:"POST"},Me={path:"/api/v1/passwordless/update",method:"POST"};var Fe={};L(Fe,"PasswordlessSmsAuthenticate",(()=>Ge)),L(Fe,"PasswordlessSmsInit",(()=>Ve)),L(Fe,"PasswordlessSmsLink",(()=>qe)),L(Fe,"PasswordlessSmsUnlink",(()=>Be)),L(Fe,"PasswordlessSmsUpdate",(()=>Ke));let Ge={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},Ve={path:"/api/v1/passwordless_sms/init",method:"POST"},qe={path:"/api/v1/passwordless_sms/link",method:"POST"},Be={path:"/api/v1/passwordless_sms/unlink",method:"POST"},Ke={path:"/api/v1/passwordless_sms/update",method:"POST"};var $e={};L($e,"RecoveryKeyMaterial",(()=>He)),L($e,"RecoveryOAuthInit",(()=>ze)),L($e,"RecoveryOAuthAuthenticate",(()=>Ye)),L($e,"RecoveryOAuthInitICloud",(()=>Je)),L($e,"RecoveryOAuthCallbackICloudExpo",(()=>Qe)),L($e,"RecoveryConfigurationICloud",(()=>Xe));let He={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},ze={path:"/api/v1/recovery/oauth/init",method:"POST"},Ye={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},Je={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},Qe={path:"/api/v1/recovery/oauth/callback_icloud/:app_id/expo_ios",method:"GET"},Xe={path:"/api/v1/recovery/configuration_icloud",method:"POST"};var Ze={};L(Ze,"getPathWithParams",(()=>et));let et=(e,t)=>t?Object.entries(t).reduce(((e,[t,a])=>e.replace(`:${t}`,`${a}`)),e):e;var tt={};L(tt,"RefreshSession",(()=>at)),L(tt,"Logout",(()=>nt));let at={path:"/api/v1/sessions",method:"POST"},nt={path:"/api/v1/sessions/logout",method:"POST"};var rt={};L(rt,"GetSmartWalletConfig",(()=>it)),L(rt,"PostSmartWalletConfig",(()=>ot));let it={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},ot={path:"/api/v1/apps/:app_id/smart_wallets",method:"POST"};var st={};L(st,"SiweInit",(()=>lt)),L(st,"SiweAuthenticate",(()=>ct)),L(st,"SiweLink",(()=>pt)),L(st,"SiweLinkSmartWallet",(()=>dt)),L(st,"SiweUnlink",(()=>ut));let lt={path:"/api/v1/siwe/init",method:"POST"},ct={path:"/api/v1/siwe/authenticate",method:"POST"},pt={path:"/api/v1/siwe/link",method:"POST"},dt={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},ut={path:"/api/v1/siwe/unlink",method:"POST"};var _t={};L(_t,"SiwsInit",(()=>mt)),L(_t,"SiwsAuthenticate",(()=>gt)),L(_t,"SiwsLink",(()=>bt)),L(_t,"SiwsUnlink",(()=>ht));let mt={path:"/api/v1/siws/init",method:"POST"},gt={path:"/api/v1/siws/authenticate",method:"POST"},bt={path:"/api/v1/siws/link",method:"POST"},ht={path:"/api/v1/siws/unlink",method:"POST"};var yt={};L(yt,"AcceptTermsOnUser",(()=>vt));let vt={path:"/api/v1/users/me/accept_terms",method:"POST"};var ft={};L(ft,"TelegramAuthenticate",(()=>It)),L(ft,"TelegramLink",(()=>St)),L(ft,"TelegramUnlink",(()=>kt));let It={path:"/api/v1/telegram/authenticate",method:"POST"},St={path:"/api/v1/telegram/link",method:"POST"},kt={path:"/api/v1/telegram/unlink",method:"POST"};x(W,U),x(W,F),x(W,V),x(W,K),x(W,H),x(W,Y),x(W,te),x(W,re),x(W,oe),x(W,pe),x(W,ge),x(W,fe),x(W,we),x(W,Pe),x(W,De),x(W,Fe),x(W,$e),x(W,Ze),x(W,tt),x(W,rt),x(W,st),x(W,_t),x(W,yt),x(W,ft);var Tt={},wt={};L(wt,"AnalyticsEventInput",(()=>At));let At=w.object({event_name:w.string().max(255),client_id:w.string().max(255).nullable(),payload:w.record(w.any()).optional()});var Et={};L(Et,"AccountIdFromPath",(()=>Mt)),L(Et,"AppIdFromPath",(()=>Ft)),L(Et,"Pagination",(()=>Gt));var Pt={};L(Pt,"UserId",(()=>jt)),L(Pt,"Email",(()=>Ot)),L(Pt,"PasswordlessCode",(()=>Ct)),L(Pt,"WalletAddress",(()=>Nt)),L(Pt,"normalizeEthereumAddress",(()=>Wt)),L(Pt,"SolanaWalletAddress",(()=>Rt)),L(Pt,"PhoneNumber",(()=>Dt)),L(Pt,"normalizePhoneNumber",(()=>xt)),L(Pt,"isValidAddress",(()=>Lt)),L(Pt,"AuthenticateMode",(()=>Ut));let jt=w.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:",""))),Ot=w.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())),Ct=w.string({required_error:"Verification code must be provided",invalid_type_error:"Invalid verification code"}).length(6,"Verification code must have 6 digits."),Nt=w.string({required_error:"Ethereum address must be provided",invalid_type_error:"Invalid Ethereum address"}).transform(((e,t)=>Wt(e)||(t.addIssue({code:w.ZodIssueCode.custom,message:"Invalid Ethereum address"}),w.NEVER))),Rt=w.string({required_error:"Solana address must be provided",invalid_type_error:"Invalid Solana address"}).trim().transform(((e,t)=>{try{A.decode(e)}catch(e){return t.addIssue({code:w.ZodIssueCode.custom,message:"Invalid Solana address"}),w.NEVER}return e})),Dt=w.string({required_error:"Phone number must be included",invalid_type_error:"Phone number is not a valid string"}).refine((e=>{try{return void 0!==xt(e)}catch(e){return!1}}),{message:"Phone number is not valid"}).transform((e=>xt(e)||""));function xt(e){let t=P(e,"US");if(t?.isPossible())return t.formatInternational()}function Lt(e){return!!Wt(e)}function Wt(e){if("string"==typeof e)try{return E.utils.getAddress(e.trim())}catch(e){}}let Ut=w.object({mode:w.enum(["no-signup","login-or-sign-up"]).optional()}),Mt=w.object({account_id:w.string({required_error:"Account ID must be provided",invalid_type_error:"Account ID is not a valid string"}).min(1)}),Ft=w.object({app_id:w.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 N(e.message,O.MISSING_OR_INVALID_PRIVY_APP_ID)})),Gt=w.object({cursor:jt.optional(),limit:w.coerce.number().max(100,{message:"Query limit can be at maximum 100 records."}).optional()});var Vt={};L(Vt,"AppResponseSchema",(()=>Jt));var qt={};L(qt,"EmbeddedWalletConfigSchema",(()=>Kt)),L(qt,"TelegramAuthConfigSchema",(()=>$t)),L(qt,"FundingMethodEnum",(()=>Ht)),L(qt,"FundingMethodArraySchema",(()=>zt)),L(qt,"FundingConfigSchema",(()=>Yt));let Bt=T.object({chain:T.string(),asset:T.enum(["native-currency","USDC"]).optional()}),Kt=T.object({create_on_login:T.enum(["users-without-wallets","all-users","off"]),user_owned_recovery_options:T.array(T.enum(["user-passcode","google-drive","icloud"])),require_user_owned_recovery_on_create:T.boolean().optional(),require_user_password_on_create:T.boolean().optional()}),$t=T.object({bot_id:T.string(),bot_name:T.string(),link_enabled:T.boolean(),seamless_auth_enabled:T.boolean()}),Ht=T.enum(["moonpay","coinbase-onramp","external"]),zt=T.array(Ht),Yt=T.object({default_recommended_currency:Bt,default_recommended_amount:T.string(),methods:zt,prompt_funding_on_wallet_creation:T.boolean(),cross_chain_bridging_enabled:T.boolean()}),Jt=w.object({id:w.string(),name:w.string(),logo_url:w.string().nullable(),icon_url:w.string().nullable(),terms_and_conditions_url:w.string().nullable(),privacy_policy_url:w.string().nullable(),require_users_accept_terms:w.boolean().nullable(),theme:w.string(),accent_color:w.string().nullable(),show_wallet_login_first:w.boolean(),allowed_domains:w.array(w.string()),allowed_native_app_ids:w.array(w.string()),allowed_native_app_url_schemes:w.array(w.string()),wallet_auth:w.boolean(),email_auth:w.boolean(),sms_auth:w.boolean(),google_oauth:w.boolean(),twitter_oauth:w.boolean(),discord_oauth:w.boolean(),github_oauth:w.boolean(),spotify_oauth:w.boolean(),instagram_oauth:w.boolean(),tiktok_oauth:w.boolean(),linkedin_oauth:w.boolean(),apple_oauth:w.boolean(),farcaster_auth:w.boolean(),passkey_auth:w.boolean(),telegram_auth:w.boolean(),guest_auth:w.boolean(),solana_wallet_auth:w.boolean(),disable_plus_emails:w.boolean(),allowlist_enabled:w.boolean(),allowlist_config:w.object({error_title:w.string().nullable(),error_detail:w.string().nullable(),cta_text:w.string().nullable(),cta_link:w.string().nullable()}),wallet_connect_cloud_project_id:w.string().nullable(),custom_api_url:w.string().nullable(),embedded_wallet_config:Kt,enforce_wallet_uis:w.boolean(),legacy_wallet_ui_config:w.boolean(),fiat_on_ramp_enabled:w.boolean(),captcha_enabled:w.boolean(),twitter_oauth_on_mobile_enabled:w.boolean(),mfa_methods:w.array(w.enum(["sms","totp","passkey"])),captcha_site_key:w.string().optional(),verification_key:w.string(),telegram_auth_config:$t.optional(),funding_config:Yt.optional(),max_linked_wallets_per_user:w.number().nullable(),farcaster_link_wallets_enabled:w.boolean()});var Qt={};L(Qt,"CoinbaseOnRampInitInput",(()=>na)),L(Qt,"CoinbaseOnRampInitResponse",(()=>ra)),L(Qt,"CoinbaseOnRampStatusResponse",(()=>ia));let Xt=w.enum(["ethereum","bitcoin","base","avacchain","optimism","solana","polygon","arbitrum","stellar"]),Zt=w.enum(["eth","ETH","USDC"]).transform((e=>e.toUpperCase())),ea=w.enum(["SOL"]).transform((e=>e.toUpperCase())),ta=w.object({addresses:w.array(w.object({address:Nt,blockchains:w.array(Xt)})).max(1).min(1),assets:w.array(Zt).optional()}),aa=w.object({addresses:w.array(w.object({address:Rt,blockchains:w.array(Xt)})).max(1).min(1),assets:w.array(ea).optional()}),na=w.union([ta,aa]),ra=w.object({app_id:w.string(),session_token:w.string(),channel_id:w.string(),partner_user_id:w.string()}),ia=w.object({status:w.enum(["pending","success","failure"])});var oa={};L(oa,"CrossAppConnectionsResponse",(()=>sa));let sa=w.object({connections:w.array(w.object({provider_app_id:w.string(),provider_app_name:w.string(),provider_app_icon_url:w.string().url().nullable(),provider_app_custom_api_url:w.string().url().nullable(),read_only:w.boolean()}))});var la={};L(la,"AuthenticateJwtInput",(()=>ca));let ca=T.object({token:T.string().optional()});var pa={};L(pa,"VerifyEmailInput",(()=>ua)),L(pa,"AuthenticateEmailInput",(()=>_a)),L(pa,"InitEmailInput",(()=>ma)),L(pa,"UnlinkEmailInput",(()=>ga)),L(pa,"UpdateEmailInput",(()=>ba)),L(pa,"TransferEmailInput",(()=>ha));let da=w.object({nonce:w.string()}),ua=w.object({code:Ct,email:Ot}),_a=ua.merge(Ut),ma=w.object({email:Ot,token:w.string().optional()}),ga=w.object({address:Ot}),ba=w.object({oldAddress:Ot,newAddress:Ot,code:Ct}),ha=da.extend({email:Ot});var ya={};L(ya,"JsonWebKey",(()=>va)),L(ya,"JsonWebKeySet",(()=>fa));let va=w.object({kty:w.string(),use:w.enum(["sig","enc"]).optional(),key_ops:w.array(w.enum(["sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits"])).optional(),alg:w.enum(["RS256"]),kid:w.string().optional(),x5u:w.string().optional(),x5c:w.array(w.string()).optional(),x5t:w.string().optional(),"x5t#S256":w.string().optional(),n:w.string().optional(),e:w.string().optional(),d:w.string().optional()}),fa=w.object({keys:w.array(va)});var Ia={};L(Ia,"FarcasterConnectInitResponse",(()=>Sa)),L(Ia,"FarcasterConnectStatusCompletedResponse",(()=>ka)),L(Ia,"FarcasterConnectStatusPendingResponse",(()=>Ta)),L(Ia,"FarcasterAuthenticateInput",(()=>wa)),L(Ia,"FarcasterLinkInput",(()=>Aa)),L(Ia,"FarcasterInitInput",(()=>Ea)),L(Ia,"FarcasterUnlinkInput",(()=>Pa)),L(Ia,"TransferFarcasterInput",(()=>ja));let Sa=w.object({channel_token:w.string(),connect_uri:w.string()}),ka=w.object({state:w.literal("completed"),nonce:w.string(),message:w.string(),signature:w.string(),fid:w.number(),username:w.string(),display_name:w.string(),bio:w.string(),pfp_url:w.string()}),Ta=w.object({state:w.literal("pending"),nonce:w.string()}),wa=w.object({channel_token:w.string(),message:w.string(),signature:w.string(),fid:w.number()}).merge(Ut),Aa=w.object({channel_token:w.string(),message:w.string(),signature:w.string(),fid:w.number()}),Ea=w.object({token:w.string().optional(),redirect_url:w.string().url().optional(),relying_party:w.string().optional()}),Pa=w.object({fid:w.number()}),ja=da.extend({farcaster_id:w.string(),farcaster_embedded_address:w.string()});var Oa={};L(Oa,"FarcasterSignerInitInput",(()=>Ca)),L(Oa,"FarcasterSignerInitResponse",(()=>Na)),L(Oa,"FarcasterSignerStatusResponse",(()=>Ra));let Ca=w.object({ed25519_public_key:w.string().refine((e=>e.startsWith("0x")&&66===e.length)),deadline:w.bigint().optional().default((()=>BigInt(Math.floor(Date.now()/1e3)+3600)))}),Na=w.discriminatedUnion("status",[w.object({public_key:w.string(),status:w.literal("pending_approval"),signer_approval_url:w.string()}),w.object({public_key:w.string(),status:w.literal("approved"),fid:w.bigint()}),w.object({public_key:w.string(),status:w.literal("revoked"),fid:w.bigint()})]),Ra=w.discriminatedUnion("status",[w.object({public_key:w.string(),status:w.literal("pending_approval")}),w.object({public_key:w.string(),status:w.literal("approved"),fid:w.bigint()}),w.object({public_key:w.string(),status:w.literal("revoked"),fid:w.bigint()})]);var Da={};L(Da,"AuthenticateGuestInput",(()=>xa));let xa=w.object({guest_credential:w.string().length(43)}).strict();var La={};L(La,"EmailIdTokenEntry",(()=>Gn)),L(La,"PhoneIdTokenEntry",(()=>Vn)),L(La,"EthereumIdTokenEntry",(()=>qn)),L(La,"SolanaIdTokenEntry",(()=>Bn)),L(La,"FarcasterIdTokenEntry",(()=>Kn)),L(La,"PasskeyIdTokenEntry",(()=>$n)),L(La,"TelegramIdTokenEntry",(()=>Hn)),L(La,"EthereumEmbeddedWalletIdTokenEntry",(()=>zn)),L(La,"SolanaEmbeddedWalletIdTokenEntry",(()=>Yn)),L(La,"GoogleOauthIdTokenEntry",(()=>Jn)),L(La,"TwitterOauthIdTokenEntry",(()=>Qn)),L(La,"DiscordOauthIdTokenEntry",(()=>Xn)),L(La,"GithubOauthIdTokenEntry",(()=>Zn)),L(La,"LinkedInOauthIdTokenEntry",(()=>er)),L(La,"SpotifyOauthIdTokenEntry",(()=>tr)),L(La,"InstagramOauthIdTokenEntry",(()=>ar)),L(La,"TiktokOauthIdTokenEntry",(()=>nr)),L(La,"AppleOauthIdTokenEntry",(()=>rr)),L(La,"CustomJwtIdTokenEntry",(()=>ir)),L(La,"CrossAppIdTokenEntry",(()=>or)),L(La,"SmartWalletIdTokenEntry",(()=>sr));var Wa={};L(Wa,"EmailAccount",(()=>Za)),L(Wa,"PhoneAccount",(()=>en)),L(Wa,"BaseWalletAccount",(()=>tn)),L(Wa,"EthereumAccount",(()=>an)),L(Wa,"SmartWalletAccount",(()=>nn)),L(Wa,"SolanaAccount",(()=>rn)),L(Wa,"FarcasterAccount",(()=>on)),L(Wa,"PasskeyAccount",(()=>sn)),L(Wa,"TelegramAccount",(()=>ln)),L(Wa,"EthereumEmbeddedWalletAccount",(()=>dn)),L(Wa,"SolanaEmbeddedWalletAccount",(()=>un)),L(Wa,"BitcoinSegwitEmbeddedWalletAccount",(()=>_n)),L(Wa,"BitcoinTaprootEmbeddedWalletAccount",(()=>mn)),L(Wa,"GoogleOauthAccount",(()=>gn)),L(Wa,"TwitterOauthAccount",(()=>bn)),L(Wa,"DiscordOauthAccount",(()=>hn)),L(Wa,"GithubOauthAccount",(()=>yn)),L(Wa,"LinkedInOauthAccount",(()=>vn)),L(Wa,"SpotifyOauthAccount",(()=>fn)),L(Wa,"InstagramOauthAccount",(()=>In)),L(Wa,"TiktokOauthAccount",(()=>Sn)),L(Wa,"AppleOauthAccount",(()=>kn)),L(Wa,"CustomJwtAccount",(()=>Tn)),L(Wa,"CrossAppEmbeddedWallet",(()=>wn)),L(Wa,"CrossAppSmartWallet",(()=>An)),L(Wa,"CrossAppAccount",(()=>En)),L(Wa,"LinkedAccount",(()=>Pn)),L(Wa,"SmsMfaMethod",(()=>jn)),L(Wa,"TotpMfaMethod",(()=>On)),L(Wa,"PasskeyMfaMethod",(()=>Cn)),L(Wa,"LinkedMfaMethod",(()=>Nn)),L(Wa,"CustomMetadata",(()=>Rn)),L(Wa,"OAuthTokens",(()=>Dn)),L(Wa,"User",(()=>xn)),L(Wa,"SessionUpdateActionEnum",(()=>Ln)),L(Wa,"AuthenticatedUser",(()=>Wn)),L(Wa,"LoggedOutUser",(()=>Un)),L(Wa,"MaybeUser",(()=>Mn));var Ua={};L(Ua,"SmartWalletProvider",(()=>Ka)),L(Ua,"AlchemyPaymasterContextSchema",(()=>Ha)),L(Ua,"SmartWalletNetworkConfigurationInputSchema",(()=>Ya)),L(Ua,"SmartWalletConfigurationSchema",(()=>Ja)),L(Ua,"SmartWalletConfigurationInputSchema",(()=>Qa)),L(Ua,"SmartWalletConfigurationResponseSchema",(()=>Xa)),L(Ua,"SAFE",(()=>Ma)),L(Ua,"KERNEL",(()=>Fa)),L(Ua,"LIGHT_ACCOUNT",(()=>Va)),L(Ua,"BICONOMY",(()=>Ga)),L(Ua,"COINBASE_SMART_WALLET",(()=>qa)),L(Ua,"SUPPORTED_SMART_WALLET_TYPES",(()=>Ba));let Ma="safe",Fa="kernel",Ga="biconomy",Va="light_account",qa="coinbase_smart_wallet",Ba=[Ma,Fa,Ga,Va,qa],Ka=w.enum(Ba,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),$a=w.string().regex(/^eip155:\d+$/,"Chain ID must be an eip155 chain ID"),Ha=w.object({policy_id:w.string().uuid()}),za=w.object({chain_id:$a,bundler_url:w.string(),paymaster_url:w.string().optional(),rpc_url:w.string().optional(),chain_name:w.string().optional(),paymaster_context:Ha.optional()}),Ya=w.object({chain_id:$a,bundler_url:w.string().optional(),paymaster_url:w.string().optional(),rpc_url:w.string().optional(),chain_name:w.string().optional(),paymaster_context:Ha.optional()}),Ja=w.discriminatedUnion("enabled",[w.object({enabled:w.literal(!1)}),w.object({enabled:w.literal(!0),smart_wallet_type:Ka,configured_networks:w.array(za).min(1)})]),Qa=w.discriminatedUnion("enabled",[w.object({enabled:w.literal(!1)}),w.object({enabled:w.literal(!0),smart_wallet_type:Ka,configured_networks:w.array(Ya).min(1)})]),Xa=Ja,Za=w.object({type:w.literal("email"),address:w.string(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),en=w.object({type:w.literal("phone"),phoneNumber:w.string(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),tn=w.object({type:w.enum(["wallet","smart_wallet"]),address:w.string(),chain_type:w.enum(["solana","ethereum"])}),an=w.object({type:w.literal("wallet"),address:w.string(),chain_id:w.string().optional(),chain_type:w.literal("ethereum"),wallet_client:w.literal("unknown"),wallet_client_type:w.string().optional(),connector_type:w.string().optional(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),nn=w.object({type:w.literal("smart_wallet"),address:w.string(),smart_wallet_type:Ka,verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),rn=w.object({type:w.literal("wallet"),address:w.string(),chain_type:w.literal("solana"),wallet_client:w.literal("unknown"),wallet_client_type:w.string().optional(),connector_type:w.string().optional(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),on=w.object({type:w.literal("farcaster"),fid:w.number(),owner_address:Nt,username:w.string().optional(),display_name:w.string().optional(),bio:w.string().optional(),profile_picture:w.string().optional(),profile_picture_url:w.string().optional(),homepage_url:w.string().optional(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable(),signer_public_key:w.string().optional()}),sn=w.object({type:w.literal("passkey"),created_with_browser:w.string().optional(),created_with_os:w.string().optional(),created_with_device:w.string().optional(),credential_id:w.string(),authenticator_name:w.string().optional(),enrolled_in_mfa:w.boolean(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),ln=w.object({type:w.literal("telegram"),telegram_user_id:w.string(),first_name:w.string().nullish(),last_name:w.string().nullish(),username:w.string().nullish(),photo_url:w.string().nullish(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}).transform((e=>({...e,telegramUserId:e.telegram_user_id,firstName:e.first_name}))),cn=w.enum(["privy","user-passcode","google-drive","icloud"]),pn=w.object({type:w.literal("wallet"),address:w.string(),imported:w.boolean().default(!1),delegated:w.boolean().default(!1),wallet_index:w.number(),chain_id:w.string(),chain_type:w.string(),wallet_client:w.literal("privy"),wallet_client_type:w.literal("privy"),connector_type:w.literal("embedded"),recovery_method:cn,verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),dn=pn.merge(w.object({chain_type:w.literal("ethereum")})),un=pn.merge(w.object({chain_type:w.literal("solana"),public_key:w.string()})),_n=pn.merge(w.object({chain_type:w.literal("bitcoin-segwit"),public_key:w.string()})),mn=pn.merge(w.object({chain_type:w.literal("bitcoin-taproot"),public_key:w.string()})),gn=w.object({type:w.literal("google_oauth"),subject:w.string(),email:w.string(),name:w.string().nullable(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),bn=w.object({type:w.literal("twitter_oauth"),subject:w.string(),username:w.string().nullable(),name:w.string().nullable(),profile_picture_url:w.string().nullable(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),hn=w.object({type:w.literal("discord_oauth"),subject:w.string(),username:w.string().nullable(),email:w.string().nullable(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),yn=w.object({type:w.literal("github_oauth"),subject:w.string(),username:w.string().nullable(),name:w.string().nullable(),email:w.string().nullable(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),vn=w.object({type:w.literal("linkedin_oauth"),subject:w.string(),name:w.string().optional(),email:w.string().nullable(),vanity_name:w.string().optional(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),fn=w.object({type:w.literal("spotify_oauth"),subject:w.string(),email:w.string().nullable(),name:w.string().nullable(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),In=w.object({type:w.literal("instagram_oauth"),subject:w.string(),username:w.string().nullable(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),Sn=w.object({type:w.literal("tiktok_oauth"),subject:w.string(),username:w.string().nullable(),name:w.string().nullable(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),kn=w.object({type:w.literal("apple_oauth"),subject:w.string(),email:w.string().nullable(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),Tn=w.object({type:w.literal("custom_auth"),custom_user_id:w.string(),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),wn=w.object({address:w.string()}),An=w.object({address:w.string()}),En=w.object({type:w.literal("cross_app"),subject:w.string(),provider_app_id:w.string(),embedded_wallets:w.array(wn),smart_wallets:w.array(An),verified_at:w.number(),first_verified_at:w.number().nullable(),latest_verified_at:w.number().nullable()}),Pn=w.union([Za,en,an,rn,nn,dn,un,_n,mn,gn,bn,hn,yn,fn,In,Sn,vn,kn,Tn,on,sn,ln,En]),jn=w.object({type:w.literal("sms"),verified_at:w.number()}),On=w.object({type:w.literal("totp"),verified_at:w.number()}),Cn=w.object({type:w.literal("passkey"),verified_at:w.number()}),Nn=w.union([jn,On,Cn]),Rn=w.record(w.string(),w.union([w.string(),w.number(),w.boolean()])),Dn=w.object({provider:w.string(),access_token:w.string(),access_token_expires_in_seconds:w.number().optional(),refresh_token:w.string().optional(),refresh_token_expires_in_seconds:w.number().optional(),scopes:w.array(w.string()).optional()}),xn=w.object({id:w.string(),linked_accounts:w.array(Pn),mfa_methods:w.array(Nn),created_at:w.number(),has_accepted_terms:w.boolean(),is_guest:w.boolean(),custom_metadata:Rn.optional()}),Ln=w.enum(["set","ignore","clear"]),Wn=w.object({user:xn,token:w.string().min(1).nullable(),privy_access_token:w.string().min(1).nullable(),refresh_token:w.string().min(1).nullable(),identity_token:w.string().min(1).optional(),is_new_user:w.boolean().optional(),oauth_tokens:Dn.optional(),oauth_provider_tokens:w.object({provider:w.string(),access_token:w.string(),access_token_expires_in_seconds:w.number().optional(),refresh_token:w.string().optional(),scopes:w.array(w.string()).optional()}).optional(),session_update_action:Ln}),Un=w.object({user:w.null(),token:w.null(),refresh_token:w.null(),session_update_action:w.literal(Ln.Values.clear)}),Mn=w.union([Wn,Un]),Fn={lv:w.number().nullable()},Gn=Za.pick({type:!0,address:!0}).extend(Fn),Vn=en.pick({type:!0,phoneNumber:!0}).extend(Fn).transform((({phoneNumber:e,...t})=>({phone_number:e,...t}))),qn=an.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Fn),Bn=rn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Fn),Kn=on.pick({type:!0,fid:!0,username:!0,owner_address:!0}).extend(Fn).transform((({owner_address:e,...t})=>({oa:e,...t}))),$n=sn.pick({type:!0,credential_id:!0}).extend(Fn),Hn=w.object({type:w.literal("telegram"),telegram_user_id:w.string(),username:w.string().nullish(),lv:w.number().nullable()}),zn=dn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Fn),Yn=un.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Fn),Jn=gn.pick({type:!0,subject:!0,email:!0}).extend(Fn),Qn=bn.pick({type:!0,subject:!0,username:!0}).extend(Fn),Xn=hn.pick({type:!0,subject:!0,username:!0}).extend(Fn),Zn=yn.pick({type:!0,subject:!0,username:!0}).extend(Fn),er=vn.pick({type:!0,subject:!0,email:!0}).extend(Fn),tr=fn.pick({type:!0,subject:!0,email:!0}).extend(Fn),ar=In.pick({type:!0,subject:!0,username:!0}).extend(Fn),nr=Sn.pick({type:!0,subject:!0,username:!0}).extend(Fn),rr=kn.pick({type:!0,subject:!0,email:!0}).extend(Fn),ir=Tn.pick({type:!0,custom_user_id:!0}).extend(Fn),or=En.pick({type:!0,subject:!0,provider_app_id:!0,embedded_wallets:!0,smart_wallets:!0}).extend(Fn),sr=nn.pick({type:!0,smart_wallet_type:!0,address:!0}).extend(Fn);var lr={};L(lr,"MfaVerifyResponse",(()=>cr)),L(lr,"MfaSmsInitInput",(()=>ur)),L(lr,"MfaSmsAuthenticateEnrollInput",(()=>_r)),L(lr,"MfaSmsEnrollInput",(()=>mr)),L(lr,"MfaSmsVerifyInput",(()=>gr)),L(lr,"MfaTotpInput",(()=>br)),L(lr,"ResponseTotpInitMfa",(()=>hr));let cr=T.object({token:T.string()}).strict(),pr=T.object({action:T.literal("verify")}).strict(),dr=T.object({action:T.literal("enroll"),phoneNumber:Dt}).strict(),ur=T.union([pr,dr]),_r=T.object({action:T.literal("enroll").optional(),code:Ct,phoneNumber:Dt}).strict(),mr=T.object({code:Ct,phoneNumber:Dt}).strict(),gr=T.object({code:Ct}).strict(),br=T.object({code:Ct}).strict(),hr=T.object({totpSecret:T.string(),totpAuthUrl:T.string()}).strict();var yr={};L(yr,"MfaPasskeyInitInput",(()=>Or)),L(yr,"ResponsePasskeyInitMfa",(()=>Cr)),L(yr,"MfaPasskeyVerifyInput",(()=>Nr)),L(yr,"MfaEnrollmentPasskeyInput",(()=>Rr));var vr={};L(vr,"PasskeyAuthenticatorVerifyOptions",(()=>fr)),L(vr,"PasskeyAuthenticatorEnrollmentOptions",(()=>Ir)),L(vr,"PasskeyAuthenticatorVerifyResponse",(()=>Sr)),L(vr,"PasskeyAuthenticatorEnrollmentResponse",(()=>kr)),L(vr,"PasskeyInitInput",(()=>Tr)),L(vr,"ResponsePasskeyInitAuthenticate",(()=>wr)),L(vr,"ResponsePasskeyInitLink",(()=>Ar)),L(vr,"PasskeyLinkInput",(()=>Er)),L(vr,"PasskeyAuthenticateInput",(()=>Pr)),L(vr,"UnlinkPasskeyInput",(()=>jr));let fr=T.object({challenge:T.string(),timeout:T.number().optional(),rp_id:T.string().optional(),allow_credentials:T.array(T.object({id:T.string(),type:T.string(),transports:T.array(T.string()).optional()})).optional(),user_verification:T.string().optional(),extensions:T.object({app_id:T.string().optional(),cred_props:T.boolean().optional(),hmac_create_secret:T.boolean().optional()}).optional()}),Ir=T.object({rp:T.object({name:T.string(),id:T.string().optional()}),user:T.object({id:T.string(),name:T.string(),display_name:T.string()}),challenge:T.string(),pub_key_cred_params:T.array(T.object({alg:T.number(),type:T.literal("public-key")})),timeout:T.number().optional(),exclude_credentials:T.array(T.object({id:T.string(),type:T.string(),transports:T.array(T.string()).optional()})).optional(),authenticator_selection:T.object({authenticator_attachment:T.string().optional(),require_resident_key:T.boolean().optional(),resident_key:T.string().optional(),user_verification:T.string().optional()}).optional(),attestation:T.string().optional(),extensions:T.object({app_id:T.string().optional(),cred_props:T.object({rk:T.boolean().optional()}).optional(),hmac_create_secret:T.boolean().optional()}).optional()}),Sr=T.object({id:T.string(),raw_id:T.string(),response:T.object({client_data_json:T.string(),authenticator_data:T.string(),signature:T.string(),user_handle:T.string().optional()}),authenticator_attachment:T.string().optional(),client_extension_results:T.object({app_id:T.boolean().optional(),cred_props:T.object({rk:T.boolean().optional()}).optional(),hmac_create_secret:T.boolean().optional()}),type:T.literal("public-key")}),kr=T.object({id:T.string(),raw_id:T.string(),response:T.object({client_data_json:T.string(),attestation_object:T.string(),authenticator_data:T.string().optional(),transports:T.array(T.any()).optional(),public_key_algorithm:T.number().optional(),public_key:T.string().optional()}),authenticator_attachment:T.string().optional(),client_extension_results:T.object({app_id:T.boolean().optional(),cred_props:T.object({rk:T.boolean().optional()}).optional(),hmac_create_secret:T.boolean().optional()}),type:T.literal("public-key")}),Tr=T.object({relying_party:T.string().url().optional(),token:T.string().optional()}).strict(),wr=T.object({relying_party:T.string().url().optional(),options:fr}).strict(),Ar=T.object({relying_party:T.string().url().optional(),options:Ir}).strict(),Er=T.object({relying_party:T.string().url().optional(),authenticator_response:kr}).strict(),Pr=T.object({relying_party:T.string().url().optional(),challenge:T.string(),authenticator_response:Sr}).strict(),jr=T.object({credential_id:T.string()}),Or=T.object({relying_party:T.string().url().optional()}).strict(),Cr=T.object({options:fr}).strict(),Nr=T.object({authenticator_response:Sr,relying_party:T.string().url().optional()}).strict(),Rr=T.object({credential_ids:T.array(T.string())});var Dr={};L(Dr,"ExternalOAuthProvider",(()=>Lr)),L(Dr,"OAuthProvider",(()=>Wr)),L(Dr,"AuthenticateOauthInput",(()=>Ur)),L(Dr,"OAuthInitInput",(()=>Mr)),L(Dr,"LinkOAuthInput",(()=>Fr)),L(Dr,"OAuthUnlinkInput",(()=>Gr)),L(Dr,"OAuthInitResponse",(()=>Vr)),L(Dr,"OAuthLinkResponse",(()=>qr)),L(Dr,"TransferOAuthInput",(()=>Br)),L(Dr,"SUPPORTED_OAUTH_PROVIDERS",(()=>xr));let xr=["google","discord","twitter","github","spotify","instagram","tiktok","linkedin","apple"],Lr=w.enum(xr,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Wr=Lr.or(w.custom((e=>"string"==typeof e&&/^privy:[a-z0-9]{25}$/i.test(e)),{message:"Please specify a supported provider."})),Ur=w.object({authorization_code:w.string(),state_code:w.string(),code_verifier:w.string().min(43).max(128).optional(),code_type:w.enum(["raw"]).optional()}).merge(Ut).catch((()=>{throw new R("Please specify authorization_code and state_code.",O.INVALID_CREDENTIALS)})),Mr=w.object({redirect_to:w.string({required_error:"Please provide a redirect_to value."}),provider:Wr,token:w.string().optional(),state_code:w.string().optional(),code_challenge:w.string().optional()}),Fr=w.object({authorization_code:w.string(),state_code:w.string(),code_verifier:w.string().min(43).max(128).optional(),code_type:w.enum(["raw"]).optional()}),Gr=w.object({subject:w.string(),provider:Wr}),Vr=w.object({url:w.string()}),qr=xn.extend({oauth_tokens:Dn.optional()}),Br=da.extend({userInfo:w.object({subject:w.string(),name:w.string().optional(),username:w.string().optional(),profilePictureUrl:w.string().optional(),email:w.string().optional(),vanityName:w.string().optional()})});var Kr={};L(Kr,"AuthorizationCodeInput",(()=>$r));let $r=w.object({redirect_to:w.string(),state:w.string(),code_challenge:w.string()});var Hr={};L(Hr,"EmptyObject",(()=>zr)),L(Hr,"SuccessObject",(()=>Yr));let zr=w.record(w.string(),w.never()),Yr=w.object({success:w.boolean()});var Jr={};L(Jr,"RecoveryKeyMaterialInput",(()=>Qr)),L(Jr,"RecoveryKeyMaterialResponse",(()=>Xr)),L(Jr,"OAuthAuthenticateRecoveryResponse",(()=>Zr)),L(Jr,"OAuthInitRecoveryInput",(()=>ei)),L(Jr,"OAuthInitICloudRecoveryInput",(()=>ti)),L(Jr,"OAuthCallbackICloudExpoInput",(()=>ai)),L(Jr,"OAuthCallbackICloudExpoResponse",(()=>ni)),L(Jr,"RecoveryConfigurationICloudInput",(()=>ri)),L(Jr,"RecoveryConfigurationICloudResponse",(()=>ii));let Qr=w.object({chain_type:w.string().optional()}),Xr=w.object({recovery_type:w.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:w.string(),recovery_code:w.string(),recovery_key:w.string(),file_id:w.string(),icloud_record_name:w.string()}),Zr=w.object({access_token:w.string()}),ei=w.object({redirect_to:w.string({required_error:"Please provide a redirect_to value."}),token:w.string().optional(),state_code:w.string().optional(),code_challenge:w.string().optional()}),ti=w.object({client_type:w.enum(["web","expo-ios"])}),ai=w.object({ckWebAuthToken:w.string()}).transform((e=>({ckWebAuthToken:e.ckWebAuthToken}))).catch((()=>{throw new R("Missing ckWebAuthToken.",O.INVALID_DATA)})),ni=zr,ri=w.object({client_type:w.enum(["web","expo-ios"])}),ii=w.object({api_token:w.string(),container_identifier:w.string(),environment:w.string()});var oi={};L(oi,"SiweInput",(()=>si)),L(oi,"SmartWalletSiweInput",(()=>li)),L(oi,"AuthenticateSiweInput",(()=>ci)),L(oi,"SiweAddressInput",(()=>pi)),L(oi,"SiweInitInput",(()=>di)),L(oi,"SiweNonce",(()=>ui)),L(oi,"TransferSiweInput",(()=>_i));let si=w.object({message:w.string({invalid_type_error:"Invalid SIWE message"}),signature:w.string({invalid_type_error:"Invalid SIWE signature"}),chainId:w.string().max(41).nullable().default(null),walletClientType:w.string().max(64).nullable().default(null),connectorType:w.string().max(64).nullable().default(null)}),li=w.object({message:w.string({invalid_type_error:"Invalid SIWE message"}),signature:w.string({invalid_type_error:"Invalid SIWE signature"}),smart_wallet_type:Ka}),ci=si.merge(Ut),pi=w.object({address:Nt}),di=w.object({address:Nt,token:w.string().optional()}),ui=w.object({nonce:w.string(),address:w.string(),expires_at:w.string()}),_i=da.extend({address:Nt,chainId:w.string().max(41).nullable().default(null),walletClientType:w.string().max(64).nullable().default(null),connectorType:w.string().max(64).nullable().default(null)});var mi={};L(mi,"SiwsInput",(()=>gi)),L(mi,"AuthenticateSiwsInput",(()=>bi)),L(mi,"SiwsAddressInput",(()=>hi)),L(mi,"SiwsInitInput",(()=>yi)),L(mi,"SiwsNonce",(()=>vi));let gi=w.object({message:w.string({invalid_type_error:"Invalid SIWS message"}),signature:w.string({invalid_type_error:"Invalid SIWS signature"}),walletClientType:w.string().max(64).nullable().default(null),connectorType:w.string().max(64).nullable().default(null)}),bi=gi.merge(Ut),hi=w.object({address:Rt}),yi=w.object({address:Rt,token:w.string().optional()}),vi=w.object({nonce:w.string(),address:w.string(),expires_at:w.string()});var fi={};L(fi,"VerifyPhoneInput",(()=>Ii)),L(fi,"AuthenticatePhoneInput",(()=>Si)),L(fi,"PasswordlessSmsPhoneInput",(()=>ki)),L(fi,"UnlinkPhoneInput",(()=>Ti)),L(fi,"UpdatePhoneInput",(()=>wi)),L(fi,"TransferPhoneInput",(()=>Ai));let Ii=w.object({code:Ct.catch((()=>{throw new D("Invalid SMS verification code",O.INVALID_CREDENTIALS)})),phoneNumber:Dt.catch((()=>{throw new D("Invalid phone number",O.INVALID_CREDENTIALS)}))}),Si=Ii.merge(Ut),ki=w.object({phoneNumber:Dt.catch((()=>{throw new D("Invalid phone number",O.INVALID_DATA)})),token:w.string().optional()}),Ti=w.object({phoneNumber:Dt}),wi=w.object({old_phone_number:Dt,new_phone_number:Dt,code:Ct}),Ai=da.extend({phoneNumber:Dt});var Ei={};L(Ei,"TelegramAuthenticateInput",(()=>ji)),L(Ei,"TelegramLinkInput",(()=>Oi)),L(Ei,"TelegramUnlinkInput",(()=>Ci)),L(Ei,"TransferTelegramInput",(()=>Ni));let Pi=T.object({id:T.number(),first_name:T.string(),auth_date:T.number(),hash:T.string(),username:T.string().optional(),last_name:T.string().optional(),photo_url:T.string().optional()}),ji=T.object({captcha_token:T.string().optional(),telegram_auth_result:Pi.optional(),telegram_web_app_data:T.object({query_id:T.string().optional(),auth_date:T.number(),hash:T.string(),user:T.string(),chat_instance:T.string().optional(),chat_type:T.string().optional(),start_param:T.string().optional()}).optional()}).merge(Ut),Oi=ji.omit({telegram_web_app_data:!0}).required({telegram_auth_result:!0}),Ci=T.object({telegram_user_id:T.string()}),Ni=da.extend({telegram_auth_result:Pi});var Ri={};L(Ri,"RefreshTokenInput",(()=>Di)),L(Ri,"OptionalRefreshTokenInput",(()=>xi)),L(Ri,"ForkedToken",(()=>Li));let Di=w.object({refresh_token:w.string()}),xi=Di.partial(),Li=w.object({token:w.string(),refresh_token:w.string(),new_session_refresh_token:w.string()});var Wi={};L(Wi,"DelegatedActionsConsentInput",(()=>Ui));let Ui=w.object({encrypted_tee_share:w.string(),app_share:w.string(),delegated_addresses:w.array(w.object({chain_type:w.union([w.literal("solana"),w.literal("ethereum")]),address:w.string(),wallet_index:w.number().default(0)}))});var Mi={};L(Mi,"WalletApiSignTransactionRpcInput",(()=>Gi)),L(Mi,"WalletApiSignMessageRpcInput",(()=>Vi)),L(Mi,"WalletApiRpcInput",(()=>qi)),L(Mi,"WalletApiSignTransactionRpcResponse",(()=>Bi)),L(Mi,"WalletApiSignMessageRpcResponse",(()=>Ki)),L(Mi,"WalletApiRpcResponse",(()=>$i)),L(Mi,"WalletApiRegisterAuthorizationKeyInput",(()=>Hi));let Fi=w.object({address:w.string(),chain_type:w.union([w.literal("solana"),w.literal("ethereum")])}),Gi=w.object({method:w.literal("signTransaction"),params:w.object({transaction:w.string(),encoding:w.literal("base64")})}).merge(Fi),Vi=w.object({method:w.literal("signMessage"),params:w.object({message:w.string(),encoding:w.literal("base64")})}).merge(Fi),qi=w.discriminatedUnion("method",[Gi,Vi]),Bi=w.object({method:w.literal("signTransaction"),data:w.object({signed_transaction:w.string(),encoding:w.literal("base64")})}),Ki=w.object({method:w.literal("signMessage"),data:w.object({signature:w.string(),encoding:w.literal("base64")})}),$i=w.discriminatedUnion("method",[Bi,Ki]),Hi=w.object({public_key:w.string()});x(Tt,wt),x(Tt,Et),x(Tt,Vt),x(Tt,qt),x(Tt,Qt),x(Tt,Pt),x(Tt,oa),x(Tt,la),x(Tt,pa),x(Tt,ya),x(Tt,Ia),x(Tt,Oa),x(Tt,Da),x(Tt,La),x(Tt,lr),x(Tt,yr),x(Tt,Dr),x(Tt,Kr),x(Tt,Hr),x(Tt,vr),x(Tt,Jr),x(Tt,oi),x(Tt,mi),x(Tt,fi),x(Tt,Ua),x(Tt,Ei),x(Tt,Ri),x(Tt,Wa),x(Tt,Wi),x(Tt,Mi);let zi={address:S,version:"0.6"},Yi={address:k,version:"0.7"},Ji=({owner:e,smartWalletType:t,publicClient:a})=>{switch(t){case Ma:return v({client:a,entryPoint:Yi,owners:[e],version:"1.4.1"});case Fa:return y({client:a,version:"0.3.1",entryPoint:Yi,owners:[e]});case Ga:return h({client:a,owners:[e],entryPoint:zi});case Va:return b({client:a,entryPoint:zi,owner:e,version:"1.1.0"});case qa: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 I({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}.`)}},Qi=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const Xi=({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}))),Zi=async({chain:e,paymasterContext:t,embeddedWallet:a,user:o,smartWalletsConfig:s,rpcConfig:l,privyAppId:p})=>{if(!s?.enabled||!o||!a)return;let d=await a.getEthereumProvider(),u=s?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!u)throw new i(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let _=o.smartWallet?.smartWalletType??s.smartWalletType,m=c(e,l,p),b=r({chain:e,transport:n(m)}),h=t??u.paymasterContext,y=await(async({owner:e,smartWalletType:t,chain:a,publicClient:r,bundlerUrl:i,paymasterUrl:o,paymasterContext:s})=>{let l=await Ji({owner:e,smartWalletType:t,publicClient:r}),c=f({transport:n(i),entryPoint:l.entryPoint}),p=o?f({transport:n(o),entryPoint:l.entryPoint}):void 0;return g({account:l,chain:a,paymaster:p,paymasterContext:s,bundlerTransport:n(i),userOperation:{estimateFeesPerGas:async()=>{if(Qi.some((e=>i.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:d,smartWalletType:_,chain:e,publicClient:b,paymasterContext:h,...u});if(!y)throw new i(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return y},eo=({clientConfig:n,smartWalletsConfig:r})=>{let{noPromptOnSignature:c,openPrivyModal:g,appId:b}=o(),h=p(),{setModalData:y}=u(),{user:v}=s(),{chains:f}=p(),{chainId:I,clients:S,setChainId:k,chainIdState:T}=(()=>{let a=e(),[n,r]=t();return{clients:e({}),setChainId:e=>{a.current=e,r(e)},chainId:a,chainIdState:n}})(),w=f.find((e=>e.id===T)),{wallets:A}=d(),E=a((async()=>I.current),[I]),P=a((async({id:e})=>{if(!S.current[e]){let t=_(A),a=await Zi({chain:f.find((t=>t.id===e)),embeddedWallet:t,user:v,paymasterContext:n?.paymasterContext,smartWalletsConfig:r,rpcConfig:h.rpcConfig,privyAppId:b});a&&(S.current[e]=a)}k(e)}),[f,n,A,v,r]);return{wrapSmartAccountClient:e=>{S.current[e.chain.id]=e,T||k(e.chain.id);return{...e,sendTransaction:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[I.current];if(!a)throw new i(`Smart wallet client for chain (eip155:${I.current}) not found`);if(t)return c.current=!0,await a.sendTransaction(e).finally((()=>c.current=!1));let n=[];"calls"in e&&void 0!==e.calls?n=[...e.calls]:"to"in e&&(n=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let r=async()=>{if(!a.paymaster)return!1;let{paymasterAndData:t,paymasterData:r}=await a.prepareUserOperation({calls:n,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(t??r??0)>0};return new Promise((async(t,i)=>{c.current=!0;let{entropyId:o,entropyIdVerifier:s}=l(v);y({connectWallet:{entropyId:o,entropyIdVerifier:s,onCompleteNavigateTo:m.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:Xi({calls:n,chain:a.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:o,entropyIdVerifier:s,transactingWallet:{address:a.account.address,walletIndex:null},getIsSponsored:r,onConfirm:()=>a.sendTransaction(e),onSuccess:e=>t(e.hash),onFailure:i,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{c.current=!1}))},signMessage:async({message:e})=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[I.current];if(!a)throw new i(`Smart wallet client for chain (eip155:${I.current}) not found`);return t?(c.current=!0,await a.signMessage({message:e}).finally((()=>c.current=!1))):new Promise((async(t,n)=>{let{entropyId:r,entropyIdVerifier:i}=l(v);c.current=!0,y({connectWallet:{entropyId:r,entropyIdVerifier:i,onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>a.signMessage({message:e}),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{c.current=!1}))},signTypedData:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[I.current];if(!a)throw new i(`Smart wallet client for chain (eip155:${I.current}) not found`);return t?(c.current=!0,await a.signTypedData(e).finally((()=>c.current=!1))):new Promise((async(t,n)=>{c.current=!0;let{entropyId:r,entropyIdVerifier:i}=l(v);y({connectWallet:{entropyId:r,entropyIdVerifier:i,onCompleteNavigateTo:m.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>a.signTypedData(e),onSuccess:e=>t(e),onFailure:n,uiOptions:{}}}),g(m.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{c.current=!1}))},getChainId:E,chain:w,switchChain:P}}}};export{Xi as c,Zi as g,eo as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{StaticJsonRpcProvider as e}from"@ethersproject/providers";import{c as t}from"./privy-context-2XTbQLV9.mjs";import{jsx as a}from"react/jsx-runtime";import{useState as r,useMemo as n,useEffect as l,useContext as i,createContext as o}from"react";import s from"tinycolor2";const p="https://auth.privy.io",c=2e4,u=1400,h=2500,d=4e3,m="1.94.1",f="privy:token",g="privy-token",y="privy:refresh_token",b="privy-refresh-token",w="privy:pat",v="privy:id_token",C="privy-id-token",k="privy-session",E="privy:session_transfer_token",W="privy:caid",S=e=>`privy:guest:${e}`,x=e=>`privy:cross-app:${e}`,U="privy:state_code",O="privy:code_verifier",A="privy:headless_oauth",M="privy:oauth_disable_signup",T=e=>`privy:wallet:${e}`,F="privy:connectors",P="privy:connections",H=12e4,L=1,_="0x1",D=3e4,I="https://api.moonpay.com/v1",j="https://api.moonpay.com/v1",B="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",z="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",R="deprecated";const K=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,$=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==K(e))return!1;if(e.providers)for(let t of e.providers)if(!$(t))return!1;return!0},q=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},Z=()=>{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},N=(e,t)=>{let a=[],r=[];for(let[n,l]of e.entries())n<t?a.push(l):r.push(l);return[a,r]},G=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,}))$/),X=(e,t)=>{let a=e.slice(0),r=[];for(;a.length;)r.push(a.splice(0,t));return r},Y=(e,t=3,a=4,r="ethereum")=>{if(!e)return"";let n="ethereum"===r?2:0;return t+a+n+3>=e.length?e:`${e.slice(0,n+t)}...${e.slice(e.length-a,e.length)}`},J=(e,t=3,a=4)=>Y(e,t,a,"solana"),V=e=>new Promise((t=>setTimeout(t,e)));function Q(e,{interval:t=100,timeout:a=5e3}={}){return new Promise(((r,n)=>{let l,i=0,o=()=>{i>=a?n("Max attempts reached without result"):(l=e(),i+=t,null==l?setTimeout(o,t):r(l))};o()}))}const ee=(e,t={})=>{let a=t.delayMs||150,r=t.maxAttempts||270;return new Promise((async(n,l)=>{let i=!1,o=0;for(;!i&&o<r;){if(t.abortSignal?.aborted)return;e().then((e=>{i=!0,n(e)}),((...e)=>{i=!0,l(...e)})),o+=1,await V(a)}i||l(Error("Exceeded max attempts before resolving function"))}))},te=(e,t,a={},r={})=>{let n=new URL(t,e);for(let[e,t]of Object.entries(a))void 0!==t&&n.searchParams.set(e,t);let l=Object.entries(r);if(l.length>0){let e=new URLSearchParams;for(let[t,a]of l)e.append(t,a);n.hash=e.toString()}return n.href},ae=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),re=e=>"string"==typeof e?e:"0x"+e.toString(16);async function ne({store:e,walletList:t,externalWalletConfig:a,walletChainType:r,timeout:n=3e3}){let l=!1,i=window;return new Promise((o=>{function s(){if(l)return;l=!0,window.removeEventListener("ethereum#initialized",s);let n=e.getProviders();console.debug("Detected injected providers:",n.map((e=>e.info)));let i=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===r&&"app.phantom"===e.info.rdns||i.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==r)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let a=[];if(t.providers?.length)for(let e of t.providers)e&&a.push(e);return a.push(e.ethereum),a}()){let t=K(e);if(!n.some((e=>e.info.name===t))){if($(e,!0)&&!i.find((e=>"metamask"===e.type))){i.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!i.find((e=>"phantom"===e.type))){i.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!i.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==a.coinbaseWallet?.connectionOptions))){i.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}i.find((e=>"unknown_browser_extension"===e.type))||i.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}o(i)}i.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout((()=>{s()}),n))}))}function le(e){return`eip155:${String(Number(e))}`}const ie=(e,a,r,n)=>{let l=Number(e),i=a.find((e=>e.id===l));if(!i)throw new t(`Unsupported chainId ${e}`,4901);return oe(i,r,n)},oe=(e,a,r)=>{let n,l=e.id,i=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(a.rpcUrls&&a.rpcUrls[i])n=a.rpcUrls[i];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",r),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(`No RPC url found for ${l}`);return n},se=(e,a)=>{let r=Number(e),n=a.find((e=>e.id===r));if(!n)throw new t(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},pe=(a,r,n,l)=>{let i=Number(a),o=r.find((e=>e.id===i));if(!o)throw new t(`Unsupported chainId ${a}`,4901);return new e(o.rpcUrls.privyWalletOverride&&o.rpcUrls.privyWalletOverride.http[0]?o.rpcUrls.privyWalletOverride.http[0]:n.rpcUrls&&n.rpcUrls[i]?n.rpcUrls[i]:o.rpcUrls.privy?.http[0]?{url:o.rpcUrls.privy.http[0],headers:{"privy-app-id":l.appId}}:o.rpcUrls.public?.http[0]?o.rpcUrls.public.http[0]:o.rpcUrls.default?.http[0])},ce=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},a=e.types.EIP712Domain??Object.entries(e.domain).map((([e,a])=>{if(null!=a&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:a}}};function ue(e,{min:t,max:a}){return Math.min(Math.max(e,t),a)}const he={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"}}},de={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},me={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"}}},fe={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},ge={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"}}},ye={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},be={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},we={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},ve={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"}}},Ce={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"}}},ke={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},Ee={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"}}},We={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},Se={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},xe={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"}}},Ue=[he,de,Se,ve,Ce,ke,Ee,We,be,{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"}}},ge,ye,{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"}}},we,{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},me,fe,xe,{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"}}}],Oe=new Set(Ue.map((e=>e.id))),Ae={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 Me=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"]),Te=e=>Me.has(e),Fe=(e,t,a)=>a.indexOf(e)===t;const Pe=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(Te).filter(Fe):e?e.filter(Te).filter(Fe):Ae.appearance.walletList;function He(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}}function Le(e){let t=e.filter((e=>!Oe.has(e.id)));return Ue.concat(t)}function _e(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let De="#FFFFFF";function Ie(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return s({...e.toHsl(),l:a})}function je({backgroundTheme:e,accentHex:t}){let a;switch(e){case"light":a=De;break;case"dark":a="#1E1E1D";break;default:a=e}let r=s(a),n=s(t),l=s("#51BA81"),i=s("#FFB74D"),o=s("#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"}(r.getLuminance()),c=Ie(r,"light"===p?-.04:.11),u=Ie(r,"light"===p?-.88:.87),h=Ie(r,"light"===p?-.7:.75),d=Ie(r,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=Ie(r,"light"===p?-.08:.25).desaturate("light"===p?60:20),f=Ie(n,.15),g=Ie(n,.25),y=Ie(n,-.06),b=Ie(n,-.6),w=Ie(o,.3),v=Ie(i,.3),C=s(n.getLuminance()>.5?"#040217":De),k=Ie(l,-.16),E=Ie(l,.4);return{colorScheme:p,background:r.toHslString(),background2:c.toHslString(),foreground:u.toHslString(),foreground2:h.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:f.toHslString(),accentLightest:g.toHslString(),accentDark:y.toHslString(),accentDarkest:b.toHslString(),foregroundAccent:C.toHslString(),success:l.toHslString(),successDark:k.toHslString(),successLight:E.toHslString(),error:o.toHslString(),errorLight:w.toHslString(),warn:i.toHslString(),warnLight:v.toHslString()}}function Be(e,t,a){let r,n,l,i,o,s,p,c,u,h,d,m,f,g,y,b,w=a?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),o=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),h=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),d=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),g=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(r=e.emailAuth,n=e.smsAuth,i=e.walletAuth||e.solanaWalletAuth,o=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,u=e.spotifyOAuth,h=e.instagramOAuth,c=e.tiktokOAuth,d=e.linkedinOAuth,f=e.appleOAuth,g=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let v=[r,n].filter(Boolean),C=[o,s,p,m,u,h,c,d,f,g,y].filter(Boolean),k=[i].filter(Boolean);if(v.length+C.length+k.length===0)throw Error("You must enable at least one login method");let E=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;E&&0===k.length?(w("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),E=!1):E||C.length+v.length!==0||(w("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),E=!0);let W=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&w("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let S=Pe({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),x=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a 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(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let r of e.overflow??[])t.includes(r)||a.includes(r)?console.warn(`Duplicated login method: ${r}`):a.push(r);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),U=t?.intl?.defaultCountry??"US",{chains:O,defaultChain:A}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:a,hasRpcConfigDefined:r}){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&&r&&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=Ue.find((t=>t.id===e.id)),a=t?.rpcUrls.privy?.http[0];return a?_e(e,a):e}))}else n=Ue.concat(e??[]);let l=t?n[0]:ve,i=a??l;if(!n.find((e=>e.id===i.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:i}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),M=!!t?.defaultChain,T=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,F=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?T?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??F:F,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:P,...H}=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??Ae.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:je({backgroundTheme:t?.appearance?.theme??Ae.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??Ae.appearance.accentColor}),loginGroupPriority:E?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:S,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:i,email:r,sms:n,passkey:l,google:o,twitter:s,discord:p,github:m,spotify:u,instagram:h,tiktok:c,linkedin:d,apple:f,farcaster:g,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:x,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??Ae.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??Ae.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??Ae.rpcConfig.rpcTimeouts},chains:O,defaultChain:A,intl:{defaultCountry:U},shouldEnforceDefaultChainOnConnect:M,captchaEnabled:e.captchaEnabled??Ae.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??Ae.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:W},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof P?{requireUserOwnedRecoveryOnCreate:P}:{},...T?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...H,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:T?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??Ae._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??Ae.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??Ae.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??Ae.fundingMethodConfig.moonpay.useSandbox}}}}let ze={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 Re=Be(ze,void 0,!1);let Ke=o({appConfig:Re,isServerConfigLoaded:!1});const $e=({children:e,legacyCreateEmbeddedWalletFlag:t,client:i,clientConfig:o})=>{let[s,p]=r(null),c=n((()=>Be(s??ze,o,!!s)),[s,o]);return l((()=>{if(!s)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:a,additionalChains:r,supportedChains:n,defaultChain:l,externalWallets:i,...o}=e;return{...o,...r?{additionalChains:r.map((e=>e.id))}:void 0,...n?{supportedChains:n.map((e=>e.id))}:void 0,...l?{defaultChain:l.id}:void 0,...i?{walletConnect:i.walletConnect,coinbaseWallet:i.coinbaseWallet,solana:{connectors:i.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(o,t),a=function(e,t=0){let a=3735928559^t,r=1103547991^t;for(let t,n=0;n<e.length;n++)a=Math.imul(a^(t=e.charCodeAt(n)),2654435761),r=Math.imul(r^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&(r=Math.imul(r^r>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),r=`privy:sent:${s.id}:${a}`;localStorage.getItem(r)||(i.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(r,"t"))}),[o,t,s]),l((()=>{s||(async()=>{try{let e=await i.getServerConfig();e.customApiUrl&&i.updateApiUrl(e.customApiUrl),p(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),a(Ke.Provider,{value:{appConfig:c,isServerConfigLoaded:!!s},children:e})},qe=()=>{let{appConfig:e}=i(Ke);return e},Ze=()=>{let{isServerConfigLoaded:e}=i(Ke);return e},Ne=o(null);function Ge(){let e=i(Ne);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e}export{we as $,qe as A,u as B,O as C,H as D,Z as E,E as F,Y as G,A as H,v as I,V as J,h as K,te as L,X as M,ue as N,M as O,w as P,Le as Q,y as R,U as S,L as T,oe as U,m as V,D as W,he as X,me as Y,ge as Z,be as _,T as a,ve as a0,Ce as a1,Ee as a2,xe as a3,Ge as a4,d as a5,J as a6,j as a7,I as a8,z as a9,B as aa,G as ab,N as ac,Se as ad,ke as ae,We as af,ye as ag,fe as ah,de as ai,$e as aj,Ze as ak,Ne as al,Ue as am,He as an,_e as ao,se as ap,Re as aq,_ as b,Oe as c,pe as d,ce as e,le as f,S as g,ie as h,ee as i,F as j,ne as k,q as l,P as m,f as n,x as o,Q as p,k as q,R as r,ae as s,re as t,g as u,b as v,C as w,p as x,c as y,W as z};
|