@privy-io/react-auth 1.95.1 → 1.95.2-beta-20241126164238

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/getEmbeddedConnectedWallet-DTU4T9TJ.js +1 -0
  3. package/dist/cjs/index.js +297 -297
  4. package/dist/cjs/modal-context-I1Fdpr3p.js +1 -0
  5. package/dist/cjs/prepareFundingModalData-Bswl2oe1.js +1 -0
  6. package/dist/cjs/privy-context-CLUwX6HZ.js +1 -0
  7. package/dist/cjs/smart-wallets-DK3QIVaY.js +1 -0
  8. package/dist/cjs/smart-wallets.js +1 -1
  9. package/dist/cjs/solana.js +1 -1
  10. package/dist/cjs/ui.js +2 -2
  11. package/dist/cjs/{useFundWallet-AQyGHV8J.js → useFundWallet-CF0b-Bzz.js} +3 -3
  12. package/dist/cjs/useWallets-fER6uSW_.js +1 -0
  13. package/dist/dts/index.d.mts +4 -4
  14. package/dist/dts/index.d.ts +4 -4
  15. package/dist/dts/solana.d.mts +79 -4
  16. package/dist/dts/solana.d.ts +79 -4
  17. package/dist/dts/{types-BwcPm4mZ.d.mts → types-CIYA8UPe.d.mts} +1 -1
  18. package/dist/dts/{types-BwcPm4mZ.d.ts → types-CIYA8UPe.d.ts} +1 -1
  19. package/dist/dts/ui.d.mts +1 -1
  20. package/dist/dts/ui.d.ts +1 -1
  21. package/dist/dts/{solana-D5xAHDt7.d.mts → useFundSolanaWallet-B_Whp-i8.d.mts} +1 -1
  22. package/dist/dts/{solana-D5xAHDt7.d.ts → useFundSolanaWallet-B_Whp-i8.d.ts} +1 -1
  23. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  24. package/dist/esm/getEmbeddedConnectedWallet-CSSBWE2p.mjs +1 -0
  25. package/dist/esm/index.mjs +303 -303
  26. package/dist/esm/modal-context-CM9V79tL.mjs +1 -0
  27. package/dist/esm/prepareFundingModalData-htghSii6.mjs +1 -0
  28. package/dist/esm/privy-context-DPGGTP4R.mjs +1 -0
  29. package/dist/esm/smart-wallets-BhrSszZr.mjs +1 -0
  30. package/dist/esm/smart-wallets.mjs +1 -1
  31. package/dist/esm/solana.mjs +1 -1
  32. package/dist/esm/ui.mjs +8 -8
  33. package/dist/esm/{useFundWallet-ByXRecrX.mjs → useFundWallet-BtKi7j4a.mjs} +6 -6
  34. package/dist/esm/useWallets-DmUWD7Ng.mjs +1 -0
  35. package/package.json +2 -2
  36. package/dist/cjs/getEmbeddedConnectedWallet-CwyoH1JD.js +0 -1
  37. package/dist/cjs/privy-context-Cyf8aoOj.js +0 -1
  38. package/dist/cjs/smart-wallets-DfLkHwnE.js +0 -1
  39. package/dist/cjs/useSolanaWallets-X3yIJO4K.js +0 -1
  40. package/dist/cjs/useWallets-CjE39UqR.js +0 -1
  41. package/dist/esm/getEmbeddedConnectedWallet-DQ7twXmj.mjs +0 -1
  42. package/dist/esm/privy-context-CrcnzDDK.mjs +0 -1
  43. package/dist/esm/smart-wallets-Ql59pTa3.mjs +0 -1
  44. package/dist/esm/useSolanaWallets-ByOYtyDO.mjs +0 -1
  45. package/dist/esm/useWallets--4nIqKdE.mjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";var e=require("react"),t=require("viem"),a=require("./privy-context-Cyf8aoOj.js"),n=require("./useWallets-CjE39UqR.js"),r=require("./getEmbeddedConnectedWallet-CwyoH1JD.js"),i=require("permissionless"),o=require("permissionless/accounts"),s=require("permissionless/clients/pimlico"),l=require("viem/account-abstraction"),u=require("zod"),d=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=_(u),z=_(d);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.INSUFFICIENT_FUNDS="insufficient_funds",g.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",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})}u.z.object({error:u.z.string(),cause:u.z.string().optional(),code:u.z.nativeEnum(b).optional()});var T={},E={};S(E,"AnalyticsEvent",(()=>A));let A={path:"/api/v1/analytics_events",method:"POST"};var k={};S(k,"AppConfig",(()=>P));let P={path:"/api/v1/apps/:app_id",method:"GET"};var O={};S(O,"CoinbaseOnRampInit",(()=>j)),S(O,"CoinbaseOnRampStatus",(()=>w));let j={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},w={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 D={};S(D,"CustomJWTAuthenticate",(()=>N));let N={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"};var U={};S(U,"FarcasterInit",(()=>L)),S(U,"FarcasterAuthenticate",(()=>M)),S(U,"FarcasterLink",(()=>W)),S(U,"FarcasterUnlink",(()=>x)),S(U,"FarcasterStatus",(()=>F)),S(U,"FarcasterV2Init",(()=>G)),S(U,"FarcasterV2Authenticate",(()=>V));let L={path:"/api/v1/farcaster/init",method:"POST"},M={path:"/api/v1/farcaster/authenticate",method:"POST"},W={path:"/api/v1/farcaster/link",method:"POST"},x={path:"/api/v1/farcaster/unlink",method:"POST"},F={path:"/api/v1/farcaster/status",method:"GET"},G={path:"/api/v2/farcaster/init",method:"POST"},V={path:"/api/v2/farcaster/authenticate",method:"POST"};var B={};S(B,"FarcasterSignerInit",(()=>H)),S(B,"FarcasterSignerStatus",(()=>q));let H={path:"/api/v1/farcaster/signer/init",method:"POST"},q={path:"/api/v1/farcaster/signer/status",method:"POST"};var Y={};S(Y,"GuestAuthenticate",(()=>K));let K={path:"/api/v1/guest/authenticate",method:"POST"};var $={};S($,"MfaPasskeyInit",(()=>J)),S($,"MfaPasskeyVerify",(()=>X)),S($,"MfaPasskeyEnrollment",(()=>Q));let J={path:"/api/v1/mfa/passkeys/init",method:"POST"},X={path:"/api/v1/mfa/passkeys/verify",method:"POST"},Q={path:"/api/v1/mfa/passkeys/enrollment",method:"POST"};var Z={};S(Z,"MfaPasswordlessSmsEnroll",(()=>ee)),S(Z,"MfaPasswordlessSmsVerify",(()=>te)),S(Z,"MfaPasswordlessSmsInit",(()=>ae)),S(Z,"MfaPasswordlessSmsUnenroll",(()=>ne));let ee={path:"/api/v1/mfa/passwordless_sms/enroll",method:"POST"},te={path:"/api/v1/mfa/passwordless_sms/verify",method:"POST"},ae={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},ne={path:"/api/v1/mfa/passwordless_sms/unenroll",method:"POST"};var re={};S(re,"MfaTotpEnroll",(()=>ie)),S(re,"MfaTotpVerify",(()=>oe)),S(re,"MfaTotpInit",(()=>se)),S(re,"MfaTotpUnenroll",(()=>le));let ie={path:"/api/v1/mfa/totp/enroll",method:"POST"},oe={path:"/api/v1/mfa/totp/verify",method:"POST"},se={path:"/api/v1/mfa/totp/init",method:"POST"},le={path:"/api/v1/mfa/totp/unenroll",method:"POST"};var ue={};S(ue,"OAuthAuthenticate",(()=>de)),S(ue,"OAuthInit",(()=>ce)),S(ue,"OAuthLink",(()=>pe)),S(ue,"OAuthUnlink",(()=>_e));let de={path:"/api/v1/oauth/authenticate",method:"POST"},ce={path:"/api/v1/oauth/init",method:"POST"},pe={path:"/api/v1/oauth/link",method:"POST"},_e={path:"/api/v1/oauth/unlink",method:"POST"};var me={};S(me,"OAuthProviderAuthorize",(()=>ze)),S(me,"OAuthProviderVerify",(()=>ge));let ze={path:"/oauth/authorization_code",method:"POST"},ge={path:"/oauth/verify",method:"POST"};var be={};S(be,"PasskeyLink",(()=>he)),S(be,"PasskeyAuthenticate",(()=>fe)),S(be,"PasskeyAuthenticateInit",(()=>ye)),S(be,"PasskeyLinkInit",(()=>ve)),S(be,"PasskeyUnlink",(()=>Ie));let he={path:"/api/v1/passkeys/link",method:"POST"},fe={path:"/api/v1/passkeys/authenticate",method:"POST"},ye={path:"/api/v1/passkeys/authenticate/init",method:"POST"},ve={path:"/api/v1/passkeys/link/init",method:"POST"},Ie={path:"/api/v1/passkeys/unlink",method:"POST"};var Se={};S(Se,"PasswordlessAuthenticate",(()=>Te)),S(Se,"PasswordlessInit",(()=>Ee)),S(Se,"PasswordlessLink",(()=>Ae)),S(Se,"PasswordlessUnlink",(()=>ke)),S(Se,"PasswordlessUpdate",(()=>Pe));let Te={path:"/api/v1/passwordless/authenticate",method:"POST"},Ee={path:"/api/v1/passwordless/init",method:"POST"},Ae={path:"/api/v1/passwordless/link",method:"POST"},ke={path:"/api/v1/passwordless/unlink",method:"POST"},Pe={path:"/api/v1/passwordless/update",method:"POST"};var Oe={};S(Oe,"PasswordlessSmsAuthenticate",(()=>je)),S(Oe,"PasswordlessSmsInit",(()=>we)),S(Oe,"PasswordlessSmsLink",(()=>Ce)),S(Oe,"PasswordlessSmsUnlink",(()=>Re)),S(Oe,"PasswordlessSmsUpdate",(()=>De));let je={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},we={path:"/api/v1/passwordless_sms/init",method:"POST"},Ce={path:"/api/v1/passwordless_sms/link",method:"POST"},Re={path:"/api/v1/passwordless_sms/unlink",method:"POST"},De={path:"/api/v1/passwordless_sms/update",method:"POST"};var Ne={};S(Ne,"RecoveryKeyMaterial",(()=>Ue)),S(Ne,"RecoveryOAuthInit",(()=>Le)),S(Ne,"RecoveryOAuthAuthenticate",(()=>Me)),S(Ne,"RecoveryOAuthInitICloud",(()=>We)),S(Ne,"RecoveryOAuthCallbackICloudExpo",(()=>xe)),S(Ne,"RecoveryConfigurationICloud",(()=>Fe));let Ue={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},Le={path:"/api/v1/recovery/oauth/init",method:"POST"},Me={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},We={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},xe={path:"/api/v1/recovery/oauth/callback_icloud/:app_id/expo_ios",method:"GET"},Fe={path:"/api/v1/recovery/configuration_icloud",method:"POST"};var Ge={};S(Ge,"getPathWithParams",(()=>Ve));let Ve=(e,t)=>t?Object.entries(t).reduce(((e,[t,a])=>e.replace(`:${t}`,`${a}`)),e):e;var Be={};S(Be,"RefreshSession",(()=>He)),S(Be,"Logout",(()=>qe));let He={path:"/api/v1/sessions",method:"POST"},qe={path:"/api/v1/sessions/logout",method:"POST"};var Ye={};S(Ye,"GetSmartWalletConfig",(()=>Ke)),S(Ye,"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 Je={};S(Je,"SiweInit",(()=>Xe)),S(Je,"SiweAuthenticate",(()=>Qe)),S(Je,"SiweLink",(()=>Ze)),S(Je,"SiweLinkSmartWallet",(()=>et)),S(Je,"SiweUnlink",(()=>tt));let Xe={path:"/api/v1/siwe/init",method:"POST"},Qe={path:"/api/v1/siwe/authenticate",method:"POST"},Ze={path:"/api/v1/siwe/link",method:"POST"},et={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},tt={path:"/api/v1/siwe/unlink",method:"POST"};var at={};S(at,"SiwsInit",(()=>nt)),S(at,"SiwsAuthenticate",(()=>rt)),S(at,"SiwsLink",(()=>it)),S(at,"SiwsUnlink",(()=>ot));let nt={path:"/api/v1/siws/init",method:"POST"},rt={path:"/api/v1/siws/authenticate",method:"POST"},it={path:"/api/v1/siws/link",method:"POST"},ot={path:"/api/v1/siws/unlink",method:"POST"};var st={};S(st,"AcceptTermsOnUser",(()=>lt));let lt={path:"/api/v1/users/me/accept_terms",method:"POST"};var ut={};S(ut,"TelegramAuthenticate",(()=>dt)),S(ut,"TelegramLink",(()=>ct)),S(ut,"TelegramUnlink",(()=>pt));let dt={path:"/api/v1/telegram/authenticate",method:"POST"},ct={path:"/api/v1/telegram/link",method:"POST"},pt={path:"/api/v1/telegram/unlink",method:"POST"};var _t={};S(_t,"MoonpayOnRampSign",(()=>mt));let mt={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"};I(T,E),I(T,k),I(T,O),I(T,C),I(T,D),I(T,U),I(T,B),I(T,Y),I(T,$),I(T,Z),I(T,re),I(T,ue),I(T,me),I(T,be),I(T,Se),I(T,Oe),I(T,Ne),I(T,Ge),I(T,Be),I(T,Ye),I(T,Je),I(T,at),I(T,st),I(T,ut),I(T,_t);var zt={},gt={};S(gt,"AnalyticsEventInput",(()=>bt));let bt=u.z.object({event_name:u.z.string().max(255),client_id:u.z.string().max(255).nullable(),payload:u.z.record(u.z.any()).optional()});var ht={};S(ht,"AccountIdFromPath",(()=>jt)),S(ht,"AppIdFromPath",(()=>wt)),S(ht,"Pagination",(()=>Ct));var ft={};S(ft,"UserId",(()=>yt)),S(ft,"Email",(()=>vt)),S(ft,"PasswordlessCode",(()=>It)),S(ft,"WalletAddress",(()=>St)),S(ft,"normalizeEthereumAddress",(()=>Pt)),S(ft,"SolanaWalletAddress",(()=>Tt)),S(ft,"PhoneNumber",(()=>Et)),S(ft,"normalizePhoneNumber",(()=>At)),S(ft,"isValidAddress",(()=>kt)),S(ft,"AuthenticateMode",(()=>Ot));let yt=u.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:",""))),vt=u.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())),It=u.z.string({required_error:"Verification code must be provided",invalid_type_error:"Invalid verification code"}).length(6,"Verification code must have 6 digits."),St=u.z.string({required_error:"Ethereum address must be provided",invalid_type_error:"Invalid Ethereum address"}).transform(((e,t)=>Pt(e)||(t.addIssue({code:u.z.ZodIssueCode.custom,message:"Invalid Ethereum address"}),u.z.NEVER))),Tt=u.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:u.z.ZodIssueCode.custom,message:"Invalid Solana address"}),u.z.NEVER}return e})),Et=u.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!==At(e)}catch(e){return!1}}),{message:"Phone number is not valid"}).transform((e=>At(e)||""));function At(e){let t=p.parsePhoneNumber(e,"US");if(t?.isPossible())return t.formatInternational()}function kt(e){return!!Pt(e)}function Pt(e){if("string"==typeof e)try{return c.ethers.utils.getAddress(e.trim())}catch(e){}}let Ot=u.z.object({mode:u.z.enum(["no-signup","login-or-sign-up"]).optional()}),jt=u.z.object({account_id:u.z.string({required_error:"Account ID must be provided",invalid_type_error:"Account ID is not a valid string"}).min(1)}),wt=u.z.object({app_id:u.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)})),Ct=u.z.object({cursor:yt.optional(),limit:u.z.coerce.number().max(100,{message:"Query limit can be at maximum 100 records."}).optional()});var Rt={};S(Rt,"AppResponseSchema",(()=>Gt));var Dt={};S(Dt,"EmbeddedWalletConfigSchema",(()=>Lt)),S(Dt,"TelegramAuthConfigSchema",(()=>Mt)),S(Dt,"FundingMethodEnum",(()=>Wt)),S(Dt,"FundingMethodArraySchema",(()=>xt)),S(Dt,"FundingConfigResponseSchema",(()=>Ft));var Nt={};S(Nt,"Currency",(()=>Ut));let Ut=m.default.object({chain:m.default.string(),asset:m.default.enum(["native-currency","USDC"]).optional()}),Lt=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()}),Mt=m.default.object({bot_id:m.default.string(),bot_name:m.default.string(),link_enabled:m.default.boolean(),seamless_auth_enabled:m.default.boolean()}),Wt=m.default.enum(["moonpay","coinbase-onramp","external"]),xt=m.default.array(Wt),Ft=m.default.object({default_recommended_currency:Ut,default_recommended_amount:m.default.string(),methods:xt,options:m.default.array(m.default.object({method:m.default.string(),provider:m.default.string()})),prompt_funding_on_wallet_creation:m.default.boolean(),cross_chain_bridging_enabled:m.default.boolean()}),Gt=u.z.object({id:u.z.string(),name:u.z.string(),logo_url:u.z.string().nullable(),icon_url:u.z.string().nullable(),terms_and_conditions_url:u.z.string().nullable(),privacy_policy_url:u.z.string().nullable(),require_users_accept_terms:u.z.boolean().nullable(),theme:u.z.string(),accent_color:u.z.string().nullable(),show_wallet_login_first:u.z.boolean(),allowed_domains:u.z.array(u.z.string()),allowed_native_app_ids:u.z.array(u.z.string()),allowed_native_app_url_schemes:u.z.array(u.z.string()),wallet_auth:u.z.boolean(),email_auth:u.z.boolean(),sms_auth:u.z.boolean(),google_oauth:u.z.boolean(),twitter_oauth:u.z.boolean(),discord_oauth:u.z.boolean(),github_oauth:u.z.boolean(),spotify_oauth:u.z.boolean(),instagram_oauth:u.z.boolean(),tiktok_oauth:u.z.boolean(),linkedin_oauth:u.z.boolean(),apple_oauth:u.z.boolean(),farcaster_auth:u.z.boolean(),passkey_auth:u.z.boolean(),telegram_auth:u.z.boolean(),guest_auth:u.z.boolean(),solana_wallet_auth:u.z.boolean(),disable_plus_emails:u.z.boolean(),allowlist_enabled:u.z.boolean(),allowlist_config:u.z.object({error_title:u.z.string().nullable(),error_detail:u.z.string().nullable(),cta_text:u.z.string().nullable(),cta_link:u.z.string().nullable()}),wallet_connect_cloud_project_id:u.z.string().nullable(),custom_api_url:u.z.string().nullable(),embedded_wallet_config:Lt,enforce_wallet_uis:u.z.boolean(),legacy_wallet_ui_config:u.z.boolean(),fiat_on_ramp_enabled:u.z.boolean(),captcha_enabled:u.z.boolean(),twitter_oauth_on_mobile_enabled:u.z.boolean(),mfa_methods:u.z.array(u.z.enum(["sms","totp","passkey"])),captcha_site_key:u.z.string().optional(),verification_key:u.z.string(),telegram_auth_config:Mt.optional(),funding_config:Ft.optional(),max_linked_wallets_per_user:u.z.number().nullable(),farcaster_link_wallets_enabled:u.z.boolean()});var Vt={};S(Vt,"CoinbaseOnRampInitInput",(()=>$t)),S(Vt,"CoinbaseOnRampInitResponse",(()=>Jt)),S(Vt,"CoinbaseOnRampStatusResponse",(()=>Xt));let Bt=u.z.enum(["ethereum","bitcoin","base","avacchain","optimism","solana","polygon","arbitrum","stellar"]),Ht=u.z.enum(["eth","ETH","USDC"]).transform((e=>e.toUpperCase())),qt=u.z.enum(["SOL","USDC"]).transform((e=>e.toUpperCase())),Yt=u.z.object({addresses:u.z.array(u.z.object({address:St,blockchains:u.z.array(Bt)})).max(1).min(1),assets:u.z.array(Ht).optional()}),Kt=u.z.object({addresses:u.z.array(u.z.object({address:Tt,blockchains:u.z.array(Bt)})).max(1).min(1),assets:u.z.array(qt).optional()}),$t=u.z.union([Yt,Kt]),Jt=u.z.object({app_id:u.z.string(),session_token:u.z.string(),channel_id:u.z.string(),partner_user_id:u.z.string()}),Xt=u.z.object({status:u.z.enum(["pending","success","failure"])});var Qt={};S(Qt,"CrossAppConnectionsResponse",(()=>Zt));let Zt=u.z.object({connections:u.z.array(u.z.object({provider_app_id:u.z.string(),provider_app_name:u.z.string(),provider_app_icon_url:u.z.string().url().nullable(),provider_app_custom_api_url:u.z.string().url().nullable(),read_only:u.z.boolean()}))});var ea={};S(ea,"AuthenticateJwtInput",(()=>ta));let ta=m.default.object({token:m.default.string().optional()});var aa={};S(aa,"VerifyEmailInput",(()=>ra)),S(aa,"AuthenticateEmailInput",(()=>ia)),S(aa,"InitEmailInput",(()=>oa)),S(aa,"UnlinkEmailInput",(()=>sa)),S(aa,"UpdateEmailInput",(()=>la)),S(aa,"TransferEmailInput",(()=>ua));let na=u.z.object({nonce:u.z.string()}),ra=u.z.object({code:It,email:vt}),ia=ra.merge(Ot),oa=u.z.object({email:vt,token:u.z.string().optional()}),sa=u.z.object({address:vt}),la=u.z.object({oldAddress:vt,newAddress:vt,code:It}),ua=na.extend({email:vt});var da={};S(da,"JsonWebKey",(()=>ca)),S(da,"JsonWebKeySet",(()=>pa));let ca=u.z.object({kty:u.z.string(),use:u.z.enum(["sig","enc"]).optional(),key_ops:u.z.array(u.z.enum(["sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits"])).optional(),alg:u.z.enum(["RS256"]),kid:u.z.string().optional(),x5u:u.z.string().optional(),x5c:u.z.array(u.z.string()).optional(),x5t:u.z.string().optional(),"x5t#S256":u.z.string().optional(),n:u.z.string().optional(),e:u.z.string().optional(),d:u.z.string().optional()}),pa=u.z.object({keys:u.z.array(ca)});var _a={};S(_a,"FarcasterConnectInitResponse",(()=>ma)),S(_a,"FarcasterConnectStatusCompletedResponse",(()=>za)),S(_a,"FarcasterConnectStatusPendingResponse",(()=>ga)),S(_a,"FarcasterAuthenticateInput",(()=>ba)),S(_a,"FarcasterLinkInput",(()=>ha)),S(_a,"FarcasterInitInput",(()=>fa)),S(_a,"FarcasterUnlinkInput",(()=>ya)),S(_a,"TransferFarcasterInput",(()=>va)),S(_a,"FarcasterV2InitInput",(()=>Ia)),S(_a,"FarcasterV2InitResponse",(()=>Sa)),S(_a,"FarcasterV2AuthenticateInput",(()=>Ta));let ma=u.z.object({channel_token:u.z.string(),connect_uri:u.z.string()}),za=u.z.object({state:u.z.literal("completed"),nonce:u.z.string(),message:u.z.string(),signature:u.z.string(),fid:u.z.number(),username:u.z.string(),display_name:u.z.string(),bio:u.z.string(),pfp_url:u.z.string()}),ga=u.z.object({state:u.z.literal("pending"),nonce:u.z.string()}),ba=u.z.object({channel_token:u.z.string(),message:u.z.string(),signature:u.z.string(),fid:u.z.number()}).merge(Ot),ha=u.z.object({channel_token:u.z.string(),message:u.z.string(),signature:u.z.string(),fid:u.z.number()}),fa=u.z.object({token:u.z.string().optional(),redirect_url:u.z.string().url().optional(),relying_party:u.z.string().optional()}),ya=u.z.object({fid:u.z.number()}),va=na.extend({farcaster_id:u.z.string(),farcaster_embedded_address:u.z.string()}),Ia=u.z.object({}),Sa=u.z.object({nonce:u.z.string(),expires_at:u.z.string()}),Ta=u.z.object({fid:u.z.number(),message:u.z.string(),signature:u.z.string()}).merge(Ot);var Ea={};S(Ea,"FarcasterSignerInitInput",(()=>Aa)),S(Ea,"FarcasterSignerInitResponse",(()=>ka)),S(Ea,"FarcasterSignerStatusResponse",(()=>Pa));let Aa=u.z.object({ed25519_public_key:u.z.string().refine((e=>e.startsWith("0x")&&66===e.length)),deadline:u.z.bigint().optional().default((()=>BigInt(Math.floor(Date.now()/1e3)+3600)))}),ka=u.z.discriminatedUnion("status",[u.z.object({public_key:u.z.string(),status:u.z.literal("pending_approval"),signer_approval_url:u.z.string()}),u.z.object({public_key:u.z.string(),status:u.z.literal("approved"),fid:u.z.bigint()}),u.z.object({public_key:u.z.string(),status:u.z.literal("revoked"),fid:u.z.bigint()})]),Pa=u.z.discriminatedUnion("status",[u.z.object({public_key:u.z.string(),status:u.z.literal("pending_approval")}),u.z.object({public_key:u.z.string(),status:u.z.literal("approved"),fid:u.z.bigint()}),u.z.object({public_key:u.z.string(),status:u.z.literal("revoked"),fid:u.z.bigint()})]);var Oa={};S(Oa,"AuthenticateGuestInput",(()=>ja));let ja=u.z.object({guest_credential:u.z.string().length(43)}).strict();var wa={};S(wa,"EmailIdTokenEntry",(()=>Un)),S(wa,"PhoneIdTokenEntry",(()=>Ln)),S(wa,"EthereumIdTokenEntry",(()=>Mn)),S(wa,"SolanaIdTokenEntry",(()=>Wn)),S(wa,"FarcasterIdTokenEntry",(()=>xn)),S(wa,"PasskeyIdTokenEntry",(()=>Fn)),S(wa,"TelegramIdTokenEntry",(()=>Gn)),S(wa,"EthereumEmbeddedWalletIdTokenEntry",(()=>Vn)),S(wa,"SolanaEmbeddedWalletIdTokenEntry",(()=>Bn)),S(wa,"GoogleOauthIdTokenEntry",(()=>Hn)),S(wa,"TwitterOauthIdTokenEntry",(()=>qn)),S(wa,"DiscordOauthIdTokenEntry",(()=>Yn)),S(wa,"GithubOauthIdTokenEntry",(()=>Kn)),S(wa,"LinkedInOauthIdTokenEntry",(()=>$n)),S(wa,"SpotifyOauthIdTokenEntry",(()=>Jn)),S(wa,"InstagramOauthIdTokenEntry",(()=>Xn)),S(wa,"TiktokOauthIdTokenEntry",(()=>Qn)),S(wa,"AppleOauthIdTokenEntry",(()=>Zn)),S(wa,"CustomJwtIdTokenEntry",(()=>er)),S(wa,"CrossAppIdTokenEntry",(()=>tr)),S(wa,"SmartWalletIdTokenEntry",(()=>ar));var Ca={};S(Ca,"EmailAccount",(()=>Ka)),S(Ca,"PhoneAccount",(()=>$a)),S(Ca,"BaseWalletAccount",(()=>Ja)),S(Ca,"EthereumAccount",(()=>Xa)),S(Ca,"SmartWalletAccount",(()=>Qa)),S(Ca,"SolanaAccount",(()=>Za)),S(Ca,"FarcasterAccount",(()=>en)),S(Ca,"PasskeyAccount",(()=>tn)),S(Ca,"TelegramAccount",(()=>an)),S(Ca,"EthereumEmbeddedWalletAccount",(()=>on)),S(Ca,"SolanaEmbeddedWalletAccount",(()=>sn)),S(Ca,"BitcoinSegwitEmbeddedWalletAccount",(()=>ln)),S(Ca,"BitcoinTaprootEmbeddedWalletAccount",(()=>un)),S(Ca,"GoogleOauthAccount",(()=>dn)),S(Ca,"TwitterOauthAccount",(()=>cn)),S(Ca,"DiscordOauthAccount",(()=>pn)),S(Ca,"GithubOauthAccount",(()=>_n)),S(Ca,"LinkedInOauthAccount",(()=>mn)),S(Ca,"SpotifyOauthAccount",(()=>zn)),S(Ca,"InstagramOauthAccount",(()=>gn)),S(Ca,"TiktokOauthAccount",(()=>bn)),S(Ca,"AppleOauthAccount",(()=>hn)),S(Ca,"CustomJwtAccount",(()=>fn)),S(Ca,"CrossAppEmbeddedWallet",(()=>yn)),S(Ca,"CrossAppSmartWallet",(()=>vn)),S(Ca,"CrossAppAccount",(()=>In)),S(Ca,"LinkedAccount",(()=>Sn)),S(Ca,"SmsMfaMethod",(()=>Tn)),S(Ca,"TotpMfaMethod",(()=>En)),S(Ca,"PasskeyMfaMethod",(()=>An)),S(Ca,"LinkedMfaMethod",(()=>kn)),S(Ca,"CustomMetadata",(()=>Pn)),S(Ca,"OAuthTokens",(()=>On)),S(Ca,"User",(()=>jn)),S(Ca,"SessionUpdateActionEnum",(()=>wn)),S(Ca,"AuthenticatedUser",(()=>Cn)),S(Ca,"LoggedOutUser",(()=>Rn)),S(Ca,"MaybeUser",(()=>Dn));var Ra={};S(Ra,"SmartWalletProvider",(()=>xa)),S(Ra,"AlchemyPaymasterContextSchema",(()=>Ga)),S(Ra,"SmartWalletNetworkConfigurationInputSchema",(()=>Ba)),S(Ra,"SmartWalletConfigurationSchema",(()=>Ha)),S(Ra,"SmartWalletConfigurationInputSchema",(()=>qa)),S(Ra,"SmartWalletConfigurationResponseSchema",(()=>Ya)),S(Ra,"SAFE",(()=>Da)),S(Ra,"KERNEL",(()=>Na)),S(Ra,"LIGHT_ACCOUNT",(()=>La)),S(Ra,"BICONOMY",(()=>Ua)),S(Ra,"COINBASE_SMART_WALLET",(()=>Ma)),S(Ra,"SUPPORTED_SMART_WALLET_TYPES",(()=>Wa));let Da="safe",Na="kernel",Ua="biconomy",La="light_account",Ma="coinbase_smart_wallet",Wa=[Da,Na,Ua,La,Ma],xa=u.z.enum(Wa,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Fa=u.z.string().regex(/^eip155:\d+$/,"Chain ID must be an eip155 chain ID"),Ga=u.z.object({policy_id:u.z.string().uuid()}),Va=u.z.object({chain_id:Fa,bundler_url:u.z.string(),paymaster_url:u.z.string().optional(),rpc_url:u.z.string().optional(),chain_name:u.z.string().optional(),paymaster_context:Ga.optional()}),Ba=u.z.object({chain_id:Fa,bundler_url:u.z.string().optional(),paymaster_url:u.z.string().optional(),rpc_url:u.z.string().optional(),chain_name:u.z.string().optional(),paymaster_context:Ga.optional()}),Ha=u.z.discriminatedUnion("enabled",[u.z.object({enabled:u.z.literal(!1)}),u.z.object({enabled:u.z.literal(!0),smart_wallet_type:xa,configured_networks:u.z.array(Va).min(1)})]),qa=u.z.discriminatedUnion("enabled",[u.z.object({enabled:u.z.literal(!1)}),u.z.object({enabled:u.z.literal(!0),smart_wallet_type:xa,configured_networks:u.z.array(Ba).min(1)})]),Ya=Ha,Ka=u.z.object({type:u.z.literal("email"),address:u.z.string(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),$a=u.z.object({type:u.z.literal("phone"),phoneNumber:u.z.string(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),Ja=u.z.object({type:u.z.enum(["wallet","smart_wallet"]),address:u.z.string(),chain_type:u.z.enum(["solana","ethereum"])}),Xa=u.z.object({type:u.z.literal("wallet"),address:u.z.string(),chain_id:u.z.string().optional(),chain_type:u.z.literal("ethereum"),wallet_client:u.z.literal("unknown"),wallet_client_type:u.z.string().optional(),connector_type:u.z.string().optional(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),Qa=u.z.object({type:u.z.literal("smart_wallet"),address:u.z.string(),smart_wallet_type:xa,verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),Za=u.z.object({type:u.z.literal("wallet"),address:u.z.string(),chain_type:u.z.literal("solana"),wallet_client:u.z.literal("unknown"),wallet_client_type:u.z.string().optional(),connector_type:u.z.string().optional(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),en=u.z.object({type:u.z.literal("farcaster"),fid:u.z.number(),owner_address:St,username:u.z.string().optional(),display_name:u.z.string().optional(),bio:u.z.string().optional(),profile_picture:u.z.string().optional(),profile_picture_url:u.z.string().optional(),homepage_url:u.z.string().optional(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable(),signer_public_key:u.z.string().optional()}),tn=u.z.object({type:u.z.literal("passkey"),created_with_browser:u.z.string().optional(),created_with_os:u.z.string().optional(),created_with_device:u.z.string().optional(),credential_id:u.z.string(),authenticator_name:u.z.string().optional(),enrolled_in_mfa:u.z.boolean(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),an=u.z.object({type:u.z.literal("telegram"),telegram_user_id:u.z.string(),first_name:u.z.string().nullish(),last_name:u.z.string().nullish(),username:u.z.string().nullish(),photo_url:u.z.string().nullish(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}).transform((e=>({...e,telegramUserId:e.telegram_user_id,firstName:e.first_name}))),nn=u.z.enum(["privy","user-passcode","google-drive","icloud"]),rn=u.z.object({type:u.z.literal("wallet"),address:u.z.string(),imported:u.z.boolean().default(!1),delegated:u.z.boolean().default(!1),wallet_index:u.z.number(),chain_id:u.z.string(),chain_type:u.z.string(),wallet_client:u.z.literal("privy"),wallet_client_type:u.z.literal("privy"),connector_type:u.z.literal("embedded"),recovery_method:nn,verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),on=rn.merge(u.z.object({chain_type:u.z.literal("ethereum")})),sn=rn.merge(u.z.object({chain_type:u.z.literal("solana"),public_key:u.z.string()})),ln=rn.merge(u.z.object({chain_type:u.z.literal("bitcoin-segwit"),public_key:u.z.string()})),un=rn.merge(u.z.object({chain_type:u.z.literal("bitcoin-taproot"),public_key:u.z.string()})),dn=u.z.object({type:u.z.literal("google_oauth"),subject:u.z.string(),email:u.z.string(),name:u.z.string().nullable(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),cn=u.z.object({type:u.z.literal("twitter_oauth"),subject:u.z.string(),username:u.z.string().nullable(),name:u.z.string().nullable(),profile_picture_url:u.z.string().nullable(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),pn=u.z.object({type:u.z.literal("discord_oauth"),subject:u.z.string(),username:u.z.string().nullable(),email:u.z.string().nullable(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),_n=u.z.object({type:u.z.literal("github_oauth"),subject:u.z.string(),username:u.z.string().nullable(),name:u.z.string().nullable(),email:u.z.string().nullable(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),mn=u.z.object({type:u.z.literal("linkedin_oauth"),subject:u.z.string(),name:u.z.string().optional(),email:u.z.string().nullable(),vanity_name:u.z.string().optional(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),zn=u.z.object({type:u.z.literal("spotify_oauth"),subject:u.z.string(),email:u.z.string().nullable(),name:u.z.string().nullable(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),gn=u.z.object({type:u.z.literal("instagram_oauth"),subject:u.z.string(),username:u.z.string().nullable(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),bn=u.z.object({type:u.z.literal("tiktok_oauth"),subject:u.z.string(),username:u.z.string().nullable(),name:u.z.string().nullable(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),hn=u.z.object({type:u.z.literal("apple_oauth"),subject:u.z.string(),email:u.z.string().nullable(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),fn=u.z.object({type:u.z.literal("custom_auth"),custom_user_id:u.z.string(),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),yn=u.z.object({address:u.z.string()}),vn=u.z.object({address:u.z.string()}),In=u.z.object({type:u.z.literal("cross_app"),subject:u.z.string(),provider_app_id:u.z.string(),embedded_wallets:u.z.array(yn),smart_wallets:u.z.array(vn),verified_at:u.z.number(),first_verified_at:u.z.number().nullable(),latest_verified_at:u.z.number().nullable()}),Sn=u.z.union([Ka,$a,Xa,Za,Qa,on,sn,ln,un,dn,cn,pn,_n,zn,gn,bn,mn,hn,fn,en,tn,an,In]),Tn=u.z.object({type:u.z.literal("sms"),verified_at:u.z.number()}),En=u.z.object({type:u.z.literal("totp"),verified_at:u.z.number()}),An=u.z.object({type:u.z.literal("passkey"),verified_at:u.z.number()}),kn=u.z.union([Tn,En,An]),Pn=u.z.record(u.z.string(),u.z.union([u.z.string(),u.z.number(),u.z.boolean()])),On=u.z.object({provider:u.z.string(),access_token:u.z.string(),access_token_expires_in_seconds:u.z.number().optional(),refresh_token:u.z.string().optional(),refresh_token_expires_in_seconds:u.z.number().optional(),scopes:u.z.array(u.z.string()).optional()}),jn=u.z.object({id:u.z.string(),linked_accounts:u.z.array(Sn),mfa_methods:u.z.array(kn),created_at:u.z.number(),has_accepted_terms:u.z.boolean(),is_guest:u.z.boolean(),custom_metadata:Pn.optional()}),wn=u.z.enum(["set","ignore","clear"]),Cn=u.z.object({user:jn,token:u.z.string().min(1).nullable(),privy_access_token:u.z.string().min(1).nullable(),refresh_token:u.z.string().min(1).nullable(),identity_token:u.z.string().min(1).optional(),is_new_user:u.z.boolean().optional(),oauth_tokens:On.optional(),oauth_provider_tokens:u.z.object({provider:u.z.string(),access_token:u.z.string(),access_token_expires_in_seconds:u.z.number().optional(),refresh_token:u.z.string().optional(),scopes:u.z.array(u.z.string()).optional()}).optional(),session_update_action:wn}),Rn=u.z.object({user:u.z.null(),token:u.z.null(),refresh_token:u.z.null(),session_update_action:u.z.literal(wn.Values.clear)}),Dn=u.z.union([Cn,Rn]),Nn={lv:u.z.number().nullable()},Un=Ka.pick({type:!0,address:!0}).extend(Nn),Ln=$a.pick({type:!0,phoneNumber:!0}).extend(Nn).transform((({phoneNumber:e,...t})=>({phone_number:e,...t}))),Mn=Xa.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Nn),Wn=Za.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Nn),xn=en.pick({type:!0,fid:!0,username:!0,owner_address:!0}).extend(Nn).transform((({owner_address:e,...t})=>({oa:e,...t}))),Fn=tn.pick({type:!0,credential_id:!0}).extend(Nn),Gn=u.z.object({type:u.z.literal("telegram"),telegram_user_id:u.z.string(),username:u.z.string().nullish(),lv:u.z.number().nullable()}),Vn=on.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Nn),Bn=sn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Nn),Hn=dn.pick({type:!0,subject:!0,email:!0}).extend(Nn),qn=cn.pick({type:!0,subject:!0,username:!0}).extend(Nn),Yn=pn.pick({type:!0,subject:!0,username:!0}).extend(Nn),Kn=_n.pick({type:!0,subject:!0,username:!0}).extend(Nn),$n=mn.pick({type:!0,subject:!0,email:!0}).extend(Nn),Jn=zn.pick({type:!0,subject:!0,email:!0}).extend(Nn),Xn=gn.pick({type:!0,subject:!0,username:!0}).extend(Nn),Qn=bn.pick({type:!0,subject:!0,username:!0}).extend(Nn),Zn=hn.pick({type:!0,subject:!0,email:!0}).extend(Nn),er=fn.pick({type:!0,custom_user_id:!0}).extend(Nn),tr=In.pick({type:!0,subject:!0,provider_app_id:!0,embedded_wallets:!0,smart_wallets:!0}).extend(Nn),ar=Qa.pick({type:!0,smart_wallet_type:!0,address:!0}).extend(Nn);var nr={};S(nr,"MfaVerifyResponse",(()=>rr)),S(nr,"MfaSmsInitInput",(()=>sr)),S(nr,"MfaSmsAuthenticateEnrollInput",(()=>lr)),S(nr,"MfaSmsEnrollInput",(()=>ur)),S(nr,"MfaSmsVerifyInput",(()=>dr)),S(nr,"MfaTotpInput",(()=>cr)),S(nr,"ResponseTotpInitMfa",(()=>pr));let rr=m.default.object({token:m.default.string()}).strict(),ir=m.default.object({action:m.default.literal("verify")}).strict(),or=m.default.object({action:m.default.literal("enroll"),phoneNumber:Et}).strict(),sr=m.default.union([ir,or]),lr=m.default.object({action:m.default.literal("enroll").optional(),code:It,phoneNumber:Et}).strict(),ur=m.default.object({code:It,phoneNumber:Et}).strict(),dr=m.default.object({code:It}).strict(),cr=m.default.object({code:It}).strict(),pr=m.default.object({totpSecret:m.default.string(),totpAuthUrl:m.default.string()}).strict();var _r={};S(_r,"MfaPasskeyInitInput",(()=>Er)),S(_r,"ResponsePasskeyInitMfa",(()=>Ar)),S(_r,"MfaPasskeyVerifyInput",(()=>kr)),S(_r,"MfaEnrollmentPasskeyInput",(()=>Pr));var mr={};S(mr,"PasskeyAuthenticatorVerifyOptions",(()=>zr)),S(mr,"PasskeyAuthenticatorEnrollmentOptions",(()=>gr)),S(mr,"PasskeyAuthenticatorVerifyResponse",(()=>br)),S(mr,"PasskeyAuthenticatorEnrollmentResponse",(()=>hr)),S(mr,"PasskeyInitInput",(()=>fr)),S(mr,"ResponsePasskeyInitAuthenticate",(()=>yr)),S(mr,"ResponsePasskeyInitLink",(()=>vr)),S(mr,"PasskeyLinkInput",(()=>Ir)),S(mr,"PasskeyAuthenticateInput",(()=>Sr)),S(mr,"UnlinkPasskeyInput",(()=>Tr));let zr=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()}),gr=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()}),br=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")}),hr=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")}),fr=m.default.object({relying_party:m.default.string().url().optional(),token:m.default.string().optional()}).strict(),yr=m.default.object({relying_party:m.default.string().url().optional(),options:zr}).strict(),vr=m.default.object({relying_party:m.default.string().url().optional(),options:gr}).strict(),Ir=m.default.object({relying_party:m.default.string().url().optional(),authenticator_response:hr}).strict(),Sr=m.default.object({relying_party:m.default.string().url().optional(),challenge:m.default.string(),authenticator_response:br}).strict(),Tr=m.default.object({credential_id:m.default.string()}),Er=m.default.object({relying_party:m.default.string().url().optional()}).strict(),Ar=m.default.object({options:zr}).strict(),kr=m.default.object({authenticator_response:br,relying_party:m.default.string().url().optional()}).strict(),Pr=m.default.object({credential_ids:m.default.array(m.default.string())});var Or={};S(Or,"ExternalOAuthProvider",(()=>wr)),S(Or,"OAuthProvider",(()=>Cr)),S(Or,"AuthenticateOauthInput",(()=>Rr)),S(Or,"OAuthInitInput",(()=>Dr)),S(Or,"LinkOAuthInput",(()=>Nr)),S(Or,"OAuthUnlinkInput",(()=>Ur)),S(Or,"OAuthInitResponse",(()=>Lr)),S(Or,"OAuthLinkResponse",(()=>Mr)),S(Or,"TransferOAuthInput",(()=>Wr)),S(Or,"SUPPORTED_OAUTH_PROVIDERS",(()=>jr));let jr=["google","discord","twitter","github","spotify","instagram","tiktok","linkedin","apple"],wr=u.z.enum(jr,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Cr=wr.or(u.z.custom((e=>"string"==typeof e&&/^privy:[a-z0-9]{25}$/i.test(e)),{message:"Please specify a supported provider."})),Rr=u.z.object({authorization_code:u.z.string(),state_code:u.z.string(),code_verifier:u.z.string().min(43).max(128).optional(),code_type:u.z.enum(["raw"]).optional()}).merge(Ot).catch((()=>{throw new y("Please specify authorization_code and state_code.",b.INVALID_CREDENTIALS)})),Dr=u.z.object({redirect_to:u.z.string({required_error:"Please provide a redirect_to value."}),provider:Cr,token:u.z.string().optional(),state_code:u.z.string().optional(),code_challenge:u.z.string().optional()}),Nr=u.z.object({authorization_code:u.z.string(),state_code:u.z.string(),code_verifier:u.z.string().min(43).max(128).optional(),code_type:u.z.enum(["raw"]).optional()}),Ur=u.z.object({subject:u.z.string(),provider:Cr}),Lr=u.z.object({url:u.z.string()}),Mr=jn.extend({oauth_tokens:On.optional()}),Wr=na.extend({userInfo:u.z.object({subject:u.z.string(),name:u.z.string().optional(),username:u.z.string().optional(),profilePictureUrl:u.z.string().optional(),email:u.z.string().optional(),vanityName:u.z.string().optional()})});var xr={};S(xr,"AuthorizationCodeInput",(()=>Fr));let Fr=u.z.object({redirect_to:u.z.string(),state:u.z.string(),code_challenge:u.z.string()});var Gr={};S(Gr,"EmptyObject",(()=>Vr)),S(Gr,"SuccessObject",(()=>Br));let Vr=u.z.record(u.z.string(),u.z.never()),Br=u.z.object({success:u.z.boolean()});var Hr={};S(Hr,"RecoveryKeyMaterialInput",(()=>qr)),S(Hr,"RecoveryKeyMaterialResponse",(()=>Yr)),S(Hr,"OAuthAuthenticateRecoveryResponse",(()=>Kr)),S(Hr,"OAuthInitRecoveryInput",(()=>$r)),S(Hr,"OAuthInitICloudRecoveryInput",(()=>Jr)),S(Hr,"OAuthCallbackICloudExpoInput",(()=>Xr)),S(Hr,"OAuthCallbackICloudExpoResponse",(()=>Qr)),S(Hr,"RecoveryConfigurationICloudInput",(()=>Zr)),S(Hr,"RecoveryConfigurationICloudResponse",(()=>ei));let qr=u.z.object({chain_type:u.z.string().optional()}),Yr=u.z.object({recovery_type:u.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:u.z.string(),recovery_code:u.z.string(),recovery_key:u.z.string(),file_id:u.z.string(),icloud_record_name:u.z.string()}),Kr=u.z.object({access_token:u.z.string()}),$r=u.z.object({redirect_to:u.z.string({required_error:"Please provide a redirect_to value."}),token:u.z.string().optional(),state_code:u.z.string().optional(),code_challenge:u.z.string().optional()}),Jr=u.z.object({client_type:u.z.enum(["web","expo-ios"])}),Xr=u.z.object({ckWebAuthToken:u.z.string()}).transform((e=>({ckWebAuthToken:e.ckWebAuthToken}))).catch((()=>{throw new y("Missing ckWebAuthToken.",b.INVALID_DATA)})),Qr=Vr,Zr=u.z.object({client_type:u.z.enum(["web","expo-ios"])}),ei=u.z.object({api_token:u.z.string(),container_identifier:u.z.string(),environment:u.z.string()});var ti={};S(ti,"SiweInput",(()=>ai)),S(ti,"SmartWalletSiweInput",(()=>ni)),S(ti,"AuthenticateSiweInput",(()=>ri)),S(ti,"SiweAddressInput",(()=>ii)),S(ti,"SiweInitInput",(()=>oi)),S(ti,"SiweNonce",(()=>si)),S(ti,"TransferSiweInput",(()=>li));let ai=u.z.object({message:u.z.string({invalid_type_error:"Invalid SIWE message"}),signature:u.z.string({invalid_type_error:"Invalid SIWE signature"}),chainId:u.z.string().max(41).nullable().default(null),walletClientType:u.z.string().max(64).nullable().default(null),connectorType:u.z.string().max(64).nullable().default(null)}),ni=u.z.object({message:u.z.string({invalid_type_error:"Invalid SIWE message"}),signature:u.z.string({invalid_type_error:"Invalid SIWE signature"}),smart_wallet_type:xa}),ri=ai.merge(Ot),ii=u.z.object({address:St}),oi=u.z.object({address:St,token:u.z.string().optional()}),si=u.z.object({nonce:u.z.string(),address:u.z.string(),expires_at:u.z.string()}),li=na.extend({address:St,chainId:u.z.string().max(41).nullable().default(null),walletClientType:u.z.string().max(64).nullable().default(null),connectorType:u.z.string().max(64).nullable().default(null)});var ui={};S(ui,"SiwsInput",(()=>di)),S(ui,"AuthenticateSiwsInput",(()=>ci)),S(ui,"SiwsAddressInput",(()=>pi)),S(ui,"SiwsInitInput",(()=>_i)),S(ui,"SiwsNonce",(()=>mi));let di=u.z.object({message:u.z.string({invalid_type_error:"Invalid SIWS message"}),signature:u.z.string({invalid_type_error:"Invalid SIWS signature"}),walletClientType:u.z.string().max(64).nullable().default(null),connectorType:u.z.string().max(64).nullable().default(null)}),ci=di.merge(Ot),pi=u.z.object({address:Tt}),_i=u.z.object({address:Tt,token:u.z.string().optional()}),mi=u.z.object({nonce:u.z.string(),address:u.z.string(),expires_at:u.z.string()});var zi={};S(zi,"VerifyPhoneInput",(()=>gi)),S(zi,"AuthenticatePhoneInput",(()=>bi)),S(zi,"PasswordlessSmsPhoneInput",(()=>hi)),S(zi,"UnlinkPhoneInput",(()=>fi)),S(zi,"UpdatePhoneInput",(()=>yi)),S(zi,"TransferPhoneInput",(()=>vi));let gi=u.z.object({code:It.catch((()=>{throw new v("Invalid SMS verification code",b.INVALID_CREDENTIALS)})),phoneNumber:Et.catch((()=>{throw new v("Invalid phone number",b.INVALID_CREDENTIALS)}))}),bi=gi.merge(Ot),hi=u.z.object({phoneNumber:Et.catch((()=>{throw new v("Invalid phone number, not formatted correctly",b.INVALID_DATA)})),token:u.z.string().optional()}),fi=u.z.object({phoneNumber:Et}),yi=u.z.object({old_phone_number:Et,new_phone_number:Et,code:It}),vi=na.extend({phoneNumber:Et});var Ii={};S(Ii,"TelegramAuthenticateInput",(()=>Ti)),S(Ii,"TelegramLinkInput",(()=>Ei)),S(Ii,"TelegramUnlinkInput",(()=>Ai)),S(Ii,"TransferTelegramInput",(()=>ki));let Si=m.default.object({id:m.default.coerce.number(),first_name:m.default.string(),auth_date:m.default.coerce.number(),hash:m.default.string(),username:m.default.string().optional(),last_name:m.default.string().optional(),photo_url:m.default.string().optional()}),Ti=m.default.object({captcha_token:m.default.string().optional(),telegram_auth_result:Si.optional(),telegram_web_app_data:m.default.object({query_id:m.default.string().optional(),auth_date:m.default.coerce.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(),signature:m.default.string().optional()}).optional()}).merge(Ot),Ei=Ti.omit({telegram_web_app_data:!0}).required({telegram_auth_result:!0}),Ai=m.default.object({telegram_user_id:m.default.string()}),ki=na.extend({telegram_auth_result:Si});var Pi={};S(Pi,"RefreshTokenInput",(()=>Oi)),S(Pi,"OptionalRefreshTokenInput",(()=>ji)),S(Pi,"ForkedToken",(()=>wi));let Oi=u.z.object({refresh_token:u.z.string()}),ji=Oi.partial(),wi=u.z.object({token:u.z.string(),refresh_token:u.z.string(),new_session_refresh_token:u.z.string()});var Ci={};S(Ci,"DelegatedActionsConsentInput",(()=>Ri));let Ri=u.z.object({encrypted_tee_share:u.z.string(),app_share:u.z.string(),delegated_addresses:u.z.array(u.z.object({chain_type:u.z.union([u.z.literal("solana"),u.z.literal("ethereum")]),address:u.z.string(),wallet_index:u.z.number().default(0)}))});var Di={};S(Di,"CAIP2",(()=>Ni)),S(Di,"AuthorizationKeyRole",(()=>Mi)),S(Di,"WalletApiSolanaSignTransactionRpcInput",(()=>Wi)),S(Di,"WalletApiSolanaSignAndSendTransactionRpcInput",(()=>xi)),S(Di,"WalletApiSolanaSignMessageRpcInput",(()=>Fi)),S(Di,"UnsignedEthereumTransaction",(()=>Bi)),S(Di,"WalletApiEthereumSignTransactionRpcInput",(()=>Hi)),S(Di,"WalletApiEthereumSendTransactionRpcInput",(()=>qi)),S(Di,"WalletApiEthereumPersonalSignRpcInputParams",(()=>Yi)),S(Di,"WalletApiEthereumPersonalSignRpcInput",(()=>Ki)),S(Di,"WalletApiEthereumSignTypedDataRpcInput",(()=>$i)),S(Di,"WalletApiEthereumRpcInput",(()=>Ji)),S(Di,"WalletApiSolanaRpcInput",(()=>Xi)),S(Di,"WalletApiRpcInput",(()=>Qi)),S(Di,"WalletApiSolanaSignTransactionRpcResponse",(()=>Zi)),S(Di,"WalletApiSolanaSignAndSendTransactionRpcResponse",(()=>eo)),S(Di,"WalletApiSolanaSignMessageRpcResponse",(()=>to)),S(Di,"WalletApiEthereumSignTransactionRpcResponse",(()=>ao)),S(Di,"WalletApiEthereumSendTransactionRpcResponse",(()=>no)),S(Di,"WalletApiEthereumPersonalSignRpcResponse",(()=>ro)),S(Di,"WalletApiEthereumSignTypedDataRpcResponse",(()=>io)),S(Di,"WalletApiRpcResponse",(()=>oo)),S(Di,"WalletApiRegisterAuthorizationKeyInput",(()=>so)),S(Di,"WalletResponse",(()=>uo)),S(Di,"WalletApiCreateInput",(()=>co)),S(Di,"WalletIdFromPath",(()=>po)),S(Di,"WalletApiRevokeAuthorizationKeyInput",(()=>_o));let Ni=u.z.string().regex(/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/,"Chain ID must be a valid CAIP-2 chain ID, e.g. 'eip155:1'"),Ui=u.z.object({address:Tt.optional(),chain_type:u.z.literal("solana").optional()}),Li=u.z.object({address:St.optional(),chain_type:u.z.literal("ethereum").optional()}),Mi=u.z.enum(["root","manager"]).nullable(),Wi=u.z.object({method:u.z.literal("signTransaction"),params:u.z.object({transaction:u.z.string(),encoding:u.z.literal("base64")})}).merge(Ui),xi=u.z.object({method:u.z.literal("signAndSendTransaction"),caip2:Ni,params:u.z.object({transaction:u.z.string(),encoding:u.z.literal("base64")})}).merge(Ui),Fi=u.z.object({method:u.z.literal("signMessage"),params:u.z.object({message:u.z.string(),encoding:u.z.literal("base64")})}).merge(Ui),Gi=u.z.string().startsWith("0x"),Vi=u.z.union([Gi,u.z.number()]),Bi=u.z.object({from:St.optional(),to:St.optional(),chain_id:Vi.optional(),nonce:Vi.optional(),data:Gi.optional(),value:Vi.optional(),type:u.z.union([u.z.literal(0),u.z.literal(1),u.z.literal(2)]).optional(),gas_limit:Vi.optional(),gas_price:Vi.optional(),max_fee_per_gas:Vi.optional(),max_priority_fee_per_gas:Vi.optional()}),Hi=u.z.object({method:u.z.literal("eth_signTransaction"),params:u.z.object({transaction:Bi})}).merge(Li),qi=u.z.object({method:u.z.literal("eth_sendTransaction"),caip2:Ni,params:u.z.object({transaction:Bi})}).merge(Li),Yi=u.z.object({message:u.z.string(),encoding:u.z.union([u.z.literal("utf-8"),u.z.literal("hex")])}),Ki=u.z.object({method:u.z.literal("personal_sign"),params:Yi}).merge(Li),$i=u.z.object({method:u.z.literal("eth_signTypedData_v4"),params:u.z.object({typed_data:u.z.object({domain:u.z.record(u.z.string(),u.z.any()),types:u.z.record(u.z.string(),u.z.any()),message:u.z.record(u.z.string(),u.z.any()),primary_type:u.z.string()})})}).merge(Li),Ji=u.z.discriminatedUnion("method",[Hi,qi,Ki,$i]),Xi=u.z.discriminatedUnion("method",[Wi,xi,Fi]),Qi=u.z.union([Ji,Xi]),Zi=u.z.object({method:u.z.literal("signTransaction"),data:u.z.object({signed_transaction:u.z.string(),encoding:u.z.literal("base64")})}),eo=u.z.object({method:u.z.literal("signAndSendTransaction"),data:u.z.object({hash:u.z.string(),caip2:Ni}).optional(),error:u.z.object({code:u.z.string(),message:u.z.string()}).optional()}),to=u.z.object({method:u.z.literal("signMessage"),data:u.z.object({signature:u.z.string(),encoding:u.z.literal("base64")})}),ao=u.z.object({method:u.z.literal("eth_signTransaction"),data:u.z.object({signed_transaction:u.z.string(),encoding:u.z.literal("rlp")})}),no=u.z.object({method:u.z.literal("eth_sendTransaction"),data:u.z.object({hash:u.z.string(),caip2:Ni}).optional(),error:u.z.object({code:u.z.string(),message:u.z.string()}).optional()}),ro=u.z.object({method:u.z.literal("personal_sign"),data:u.z.object({signature:u.z.string(),encoding:u.z.literal("hex")})}),io=u.z.object({method:u.z.literal("eth_signTypedData_v4"),data:u.z.object({signature:u.z.string(),encoding:u.z.literal("hex")})}),oo=u.z.discriminatedUnion("method",[Zi,eo,to,ao,no,ro,io]),so=u.z.object({public_key:u.z.string(),role:Mi.optional()}),lo=u.z.union([u.z.literal("solana"),u.z.literal("ethereum")]),uo=u.z.object({id:u.z.string(),address:u.z.string(),chain_type:lo}),co=u.z.object({chain_type:lo,policy_id:u.z.string().optional()}),po=u.z.object({wallet_id:u.z.string({required_error:"Wallet ID must be provided",invalid_type_error:"Wallet ID is not a valid string"}).min(1)}).catch((({error:e})=>{throw new f(e.message,b.INVALID_DATA)})),_o=u.z.object({id:u.z.string()});var mo={};S(mo,"MoonpayOnRampSignInput",(()=>yo)),S(mo,"MoonpayOnRampSignResponse",(()=>vo));let zo=u.z.enum(["ach_bank_transfer","credit_debit_card","gbp_bank_transfer","gbp_open_banking_payment","mobile_wallet","sepa_bank_transfer","sepa_open_banking_payment","pix_instant_payment","yellow_card_bank_transfer"]),go=u.z.enum(["AVAX_CCHAIN","CELO_CELO","CUSD_CELO","DAI_ETHEREUM","ETH_ETHEREUM","ETH_ARBITRUM","ETH_OPTIMISM","ETH_POLYGON","ETH_BASE","FIL_FVM","MATIC_ETHEREUM","MATIC_POLYGON","USDC_ETHEREUM","USDC_ARBITRUM","USDC_OPTIMISM","USDC_POLYGON","USDC_BASE","USDT_ETHEREUM","USDT_POLYGON","WETH_POLYGON","WBTC_ETHEREUM","BNB_BNB","BNB_BSC","CELO","CUSD","DAI","ETH","FIL","MATIC","USDC","USDT","WETH","WBTC"]),bo=u.z.object({quoteCurrencyAmount:u.z.number().optional(),email:vt.optional(),paymentMethod:zo.optional(),uiConfig:u.z.object({accentColor:u.z.string().optional(),theme:u.z.enum(["light","dark"]).optional()}).optional()}),ho=u.z.object({address:St,config:bo.extend({currencyCode:go.transform((e=>{switch(e){case"AVAX_CCHAIN":return"AVAX_CCHAIN";case"CELO_CELO":return"CELO";case"CUSD_CELO":return"CUSD";case"DAI_ETHEREUM":return"DAI";case"ETH_ETHEREUM":return"ETH";case"ETH_ARBITRUM":return"ETH_ARBITRUM";case"ETH_OPTIMISM":return"ETH_OPTIMISM";case"ETH_POLYGON":return"ETH_POLYGON";case"ETH_BASE":return"ETH_BASE";case"FIL_FVM":return"FIL";case"MATIC_ETHEREUM":return"MATIC";case"MATIC_POLYGON":return"MATIC_POLYGON";case"USDC_ETHEREUM":return"USDC";case"USDC_ARBITRUM":return"USDC_ARBITRUM";case"USDC_OPTIMISM":return"USDC_OPTIMISM";case"USDC_POLYGON":return"USDC_POLYGON";case"USDC_BASE":return"USDC_BASE";case"USDT_ETHEREUM":return"USDT";case"USDT_POLYGON":return"USDT_POLYGON";case"WETH_POLYGON":return"WETH";case"WBTC_ETHEREUM":return"WBTC";case"BNB_BNB":return"BNB";case"BNB_BSC":return"BNB_BSC";case"CELO":case"CUSD":case"DAI":case"ETH":case"FIL":case"MATIC":case"USDC":case"USDT":case"WETH":case"WBTC":return e;default:throw Error(`Invalid currency code: ${e}`)}})).optional()})}),fo=u.z.object({address:Tt,config:bo.extend({currencyCode:u.z.enum(["SOL","USDC_SOL"]).optional()})}),yo=u.z.union([ho,fo]).and(u.z.object({useSandbox:u.z.boolean().optional().default(!1)})),vo=u.z.object({signedUrl:u.z.string(),externalTransactionId:u.z.string()});I(zt,gt),I(zt,ht),I(zt,Rt),I(zt,Dt),I(zt,Vt),I(zt,ft),I(zt,Qt),I(zt,Nt),I(zt,ea),I(zt,aa),I(zt,da),I(zt,_a),I(zt,Ea),I(zt,Oa),I(zt,wa),I(zt,nr),I(zt,_r),I(zt,Or),I(zt,xr),I(zt,Gr),I(zt,mr),I(zt,Hr),I(zt,ti),I(zt,ui),I(zt,zi),I(zt,Ra),I(zt,Ii),I(zt,Pi),I(zt,Ca),I(zt,Ci),I(zt,Di),I(zt,mo);let Io={address:l.entryPoint06Address,version:"0.6"},So={address:l.entryPoint07Address,version:"0.7"},To=({owner:e,smartWalletType:t,publicClient:a})=>{switch(t){case Da:return o.toSafeSmartAccount({client:a,entryPoint:So,owners:[e],version:"1.4.1"});case Na:return o.toEcdsaKernelSmartAccount({client:a,version:"0.3.1",entryPoint:So,owners:[e]});case Ua:return o.toBiconomySmartAccount({client:a,owners:[e],entryPoint:Io});case La:return o.toLightSmartAccount({client:a,entryPoint:Io,owner:e,version:"1.1.0"});case Ma: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}.`)}},Eo=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const Ao=({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}))),ko=async({chain:e,paymasterContext:r,embeddedWallet:o,user:l,smartWalletsConfig:u,rpcConfig:d,privyAppId:c})=>{if(!u?.enabled||!l||!o)return;let p=await o.getEthereumProvider(),_=u?.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??u.smartWalletType,z=n.getJsonRpcEndpointFromChain(e,d,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:u})=>{let d=await To({owner:e,smartWalletType:a,publicClient:r}),c=s.createPimlicoClient({transport:t.http(o),entryPoint:d.entryPoint}),p=l?s.createPimlicoClient({transport:t.http(l),entryPoint:d.entryPoint}):void 0;return i.createSmartAccountClient({account:d,chain:n,paymaster:p,paymasterContext:u,bundlerTransport:t.http(o),userOperation:{estimateFeesPerGas:async()=>{if(Eo.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=Ao,exports.getSmartWalletClient=ko,exports.useSmartWalletsWrapper=({clientConfig:t,smartWalletsConfig:i})=>{let{noPromptOnSignature:o,openPrivyModal:s,appId:l}=a.usePrivyInternal(),u=n.useAppConfig(),{setModalData:d}=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 ko({chain:p.find((t=>t.id===e)),embeddedWallet:a,user:c,paymasterContext:t?.paymasterContext,smartWalletsConfig:i,rpcConfig:u.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===u.embeddedWallets.showWalletUIs?u.embeddedWallets.noPromptOnSignature:!u.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,u)=>{o.current=!0;let{entropyId:p,entropyIdVerifier:_}=a.getEntropyDetailsFromUser(c);d({connectWallet:{entropyId:p,entropyIdVerifier:_,onCompleteNavigateTo:r.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:Ao({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:u,uiOptions:{}}}),s(r.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{o.current=!1}))},signMessage:async({message:e})=>{let t=void 0===u.embeddedWallets.showWalletUIs?u.embeddedWallets.noPromptOnSignature:!u.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:u}=a.getEntropyDetailsFromUser(c);o.current=!0,d({connectWallet:{entropyId:l,entropyIdVerifier:u,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===u.embeddedWallets.showWalletUIs?u.embeddedWallets.noPromptOnSignature:!u.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:u}=a.getEntropyDetailsFromUser(c);d({connectWallet:{entropyId:l,entropyIdVerifier:u,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 +0,0 @@
1
- "use strict";var e=require("./privy-context-Cyf8aoOj.js"),t=require("eventemitter3"),a=require("@ethersproject/logger");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,r,o=s(t);(r=n||(n={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",r.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",r.INVALID_DATA="invalid_data",r.LINKED_TO_ANOTHER_USER="linked_to_another_user",r.ALLOWLIST_REJECTED="allowlist_rejected",r.OAUTH_USER_DENIED="oauth_user_denied",r.UNKNOWN_AUTH_ERROR="unknown_auth_error",r.USER_EXITED_AUTH_FLOW="exited_auth_flow",r.MUST_BE_AUTHENTICATED="must_be_authenticated",r.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",r.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",r.CLIENT_REQUEST_TIMEOUT="client_request_timeout",r.INVALID_CREDENTIALS="invalid_credentials";class i extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=a}}class l extends i{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let d={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};class c extends e.PrivyConnectorError{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class _ extends e.PrivyConnectorError{constructor(){super("User rejected connection"),this.type="wallet_error"}}const E=t=>{if(t instanceof e.PrivyConnectorError)return t;if(t?.code&&t?.reason){let e=new p(t);return t.code===a.ErrorCode.ACTION_REJECTED&&(e.details=d.E4001_USER_REJECTED_REQUEST),e}return t?.code?new p(t):new e.PrivyConnectorError("Unknown connector error",t)};class u extends e.PrivyError{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class p extends u{constructor(e){super(e.message,e.code,e.data);let t=Object.values(d).find((t=>t.eipCode===e.code));this.details=t||d.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=d.E32002_CONNECTION_ALREADY_PENDING:this.details=d.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=d.E32002_WALLET_LOCKED))}}const h={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...d};class y extends o.default{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const C=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","crypto.com_wallet_extension","crypto.com_onchain","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","privy","unknown","phantom","solflare","glow"];exports.ConnectorErrors=h,exports.PrivyProviderRpcError=p,exports.ProviderRpcError=u,exports.R=class extends l{constructor(e){super(e.message,e.code,e.data);let t=Object.values(d).find((t=>t.eipCode===e.code));this.details=t||d.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=d.E32002_CONNECTION_ALREADY_PENDING:this.details=d.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=d.E32002_WALLET_LOCKED))}},exports.SolanaWalletConnector=class extends y{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(t,a){let s,n,r;if("Installed"!==t.readyState||!t.publicKey)throw Error("Wallet is not connected.");return"signMessage"in t&&(s=async(...e)=>{if(!t.connected)throw Error("Wallet is not connected.");return await t.signMessage(e[0])}),"sendTransaction"in t&&(n=async(...e)=>await t.sendTransaction(e[0],e[1],e[2])),"signTransaction"in t&&(r=async e=>await t.signTransaction(e)),{type:"solana",address:t.publicKey.toBase58(),meta:a,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>t.connected,disconnect:()=>{try{t.disconnect()}catch(e){console.error("Wallet does not support programmatic disconnect")}},getProvider:e.notImplementedWithMessage(`${this.walletClientType||""} wallet does not support 'getProvider'`),signMessage:s??e.notImplementedWithMessage(`${this.walletClientType||""} wallet does not support 'signMessage'`),sendTransaction:n??e.notImplementedWithMessage(`${this.walletClientType||""} wallet does not support 'sendTransaction'`),signTransaction:r??e.notImplementedWithMessage(`${this.walletClientType||""} wallet does not support 'signTransaction'`)}}async syncAccounts(){if("Installed"===this.adapter.readyState&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((e=>this.adapter.publicKey&&e.address===this.adapter.publicKey.toBase58()))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,t){super(function(e){return C.includes(e)}(e.name.toLowerCase())?e.name.toLowerCase():"unknown"),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then((()=>this.onDisconnect())).catch((e=>console.error("Error disconnecting",e)))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(e){throw E(e)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=e=>{this.syncAccounts()},this.onError=e=>{this.syncAccounts()},this.onReadyStateChange=e=>{"Installed"!==e&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.shouldAutoConnect=t,this.wallets=[]}},exports.UserRejectedConnectionError=_,exports.WalletConnector=y,exports.WalletTimeoutError=c,exports.formatConnectorError=E,exports.isBaseConnectedSolanaWallet=function(e){return"solana"===e.type},exports.isSolanaWalletConnector=function(e){return"solana"===e.chainType},exports.n=d,exports.useSolanaWallets=()=>{let{embeddedSolanaWallet:t,exportSolanaWallet:a,createEmbeddedSolanaWallet:s,solanaWallets:n,delegateWallet:r}=e.usePrivyInternal(),{user:o}=e.usePrivyContext();return{createWallet:s,exportWallet:a,delegateWalletAction:async()=>{let t=e.getPrivySolanaWallet(o);if(!t)throw new e.PrivyClientError("User must have a solana wallet in order to delegate actions");return await r({address:t.address,chainType:"solana"})},wallets:n.concat(t?[t]:[])}};
@@ -1 +0,0 @@
1
- "use strict";var e=require("@ethersproject/providers"),t=require("./privy-context-Cyf8aoOj.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"}}},v={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"}}},C={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,v,C,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),v=F(i,.3),C=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:C.toHslString(),success:l.toHslString(),successDark:E.toHslString(),successLight:x.toHslString(),error:s.toHslString(),errorLight:w.toHslString(),warn:i.toHslString(),warnLight:v.toHslString()}}function D(e,t,r){let a,n,o,l,i,s,p,c,u,d,h,m,f,g,y,b,v=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 C=[a,n].filter(Boolean),E=[i,s,p,m,u,d,c,h,f,g,y].filter(Boolean),x=[l].filter(Boolean);if(C.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?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),k=!1):k||E.length+C.length!==0||(v("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&&v("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 e.solanaWalletAuth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{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.95.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=v,exports.optimismSepolia=C,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 +0,0 @@
1
- import{jsx as E,jsxs as _}from"react/jsx-runtime";import{useState as N,useEffect as A,useRef as S,useContext as T,createContext as R}from"react";import{A as C,aq as D}from"./useWallets--4nIqKdE.mjs";import{n as L}from"./privy-context-CrcnzDDK.mjs";function I({src:_,...N}){return E("img",{src:_,...N,style:{display:"none"}})}var O,e;(O=e||(e={})).LANDING="LANDING",O.CONNECT_OR_CREATE="CONNECT_OR_CREATE",O.AWAITING_CONNECTION="AWAITING_CONNECTION",O.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",O.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",O.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",O.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",O.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",O.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",O.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",O.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",O.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",O.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",O.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",O.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",O.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",O.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",O.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",O.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",O.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",O.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",O.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",O.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",O.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",O.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",O.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",O.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",O.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",O.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",O.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",O.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",O.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",O.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",O.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",O.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",O.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",O.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",O.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",O.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",O.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",O.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",O.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",O.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",O.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",O.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",O.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",O.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",O.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",O.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",O.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",O.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",O.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",O.CAPTCHA_SCREEN="CAPTCHA_SCREEN",O.ERROR_SCREEN="ERROR_SCREEN",O.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",O.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",O.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const a=R({ready:!1,app:D,currentScreen:null,lastScreen:null,navigate:L,navigateBack:L,resetNavigation:L,setModalData:L,onUserCloseViaDialogOrKeybindRef:void 0});let W=[e.LANDING,e.CONNECT_ONLY_LANDING_SCREEN,null];const M=T=>{let R=C(),D=T.authenticated,[L,O]=N(T.initialScreen);A((()=>{D||W.includes(T.initialScreen)||T.setInitialScreen(null)}),[D]);let e=S(null);A((()=>{T.open||(e.current=null)}),[T.open]),A((()=>{e.current=null}),[T.initialScreen]);let M={ready:!!R.id,app:R,data:T.data,setModalData:T.setModalData,currentScreen:T.initialScreen,lastScreen:L,navigate:(E,_=!0)=>{T.setInitialScreen(E),_&&O(T.initialScreen)},navigateBack:()=>{T.setInitialScreen(L)},resetNavigation:()=>{T.setInitialScreen(null),O(null)},onUserCloseViaDialogOrKeybindRef:e};return _(a.Provider,{value:M,children:[("string"==typeof R.appearance.logo||"img"===R.appearance.logo?.type)&&E(I,{src:"string"==typeof R.appearance.logo?R.appearance.logo:R.appearance.logo.props.src}),T.children]})},n=()=>T(a);function t(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null}export{e as M,M as a,t as g,n as u};
@@ -1 +0,0 @@
1
- import{FetchError as e}from"ofetch";import{getAddress as t}from"@ethersproject/address";import{createContext as i,useContext as a}from"react";var r;class s extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,i){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=i}}class l extends s{constructor(e,t,i,a,r,s){super(i,a,r),this.type=e,this.status=t,this.data=s}}class n extends s{constructor(e,t,i){super(e,t,i),this.type="client_error"}}class d extends n{constructor(){super("Request timed out",void 0,"client_request_timeout")}}class o extends s{constructor(e,t,i){super(e,t,i),this.type="connector_error"}}const _=t=>{if(t instanceof s)return t;if(!(t instanceof e))return u(t);if(!t.response)return new l("api_error",null,t.message,t);let{type:i,message:a,error:r,code:n}=t.data;return new l(i||"ApiError",t.response.status,a||r,t,n,t.data)},u=e=>e instanceof s?e:e instanceof Error?new n(e.message,e):new n(`Internal error: ${e}`);var c;(r=c||(c={})).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",r.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",r.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",r.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",r.INVALID_DATA="invalid_data",r.INVALID_CAPTCHA="invalid_captcha",r.LINKED_TO_ANOTHER_USER="linked_to_another_user",r.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",r.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",r.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",r.USER_EXITED_UPDATE_FLOW="exited_update_flow",r.ALLOWLIST_REJECTED="allowlist_rejected",r.OAUTH_USER_DENIED="oauth_user_denied",r.OAUTH_UNEXPECTED="oauth_unexpected",r.UNKNOWN_AUTH_ERROR="unknown_auth_error",r.USER_EXITED_AUTH_FLOW="exited_auth_flow",r.USER_EXITED_LINK_FLOW="exited_link_flow",r.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",r.MUST_BE_AUTHENTICATED="must_be_authenticated",r.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",r.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",r.CLIENT_REQUEST_TIMEOUT="client_request_timeout",r.INVALID_CREDENTIALS="invalid_credentials",r.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",r.UNKNOWN_MFA_ERROR="unknown_mfa_error",r.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",r.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",r.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",r.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",r.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",r.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",r.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",r.TRANSACTION_FAILURE="transaction_failure",r.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",r.NOT_SUPPORTED="not_supported",r.CAPTCHA_TIMEOUT="captcha_timeout",r.INVALID_MESSAGE="invalid_message",r.UNABLE_TO_SIGN="unable_to_sign",r.CAPTCHA_FAILURE="captcha_failure",r.CAPTCHA_DISABLED="captcha_disabled",r.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",r.TOO_MANY_REQUESTS="too_many_requests",r.USER_LIMIT_REACHED="max_accounts_reached",r.DISALLOWED_LOGIN_METHOD="disallowed_login_method",r.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",r.PASSKEY_NOT_ALLOWED="passkey_not_allowed",r.USER_DOES_NOT_EXIST="user_does_not_exist",r.INSUFFICIENT_BALANCE="insufficient_balance",r.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required";class p extends n{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}}class f extends n{constructor(e="Embedded wallet error",t){super(e,t,"unknown_embedded_wallet_error")}}class m extends n{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}}class h extends n{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}}const A=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},y=e=>()=>{throw Error(e.trim())};function E(e){return e?new Date(1e3*e):null}function v(e,t){return e.slice().sort(((e,t)=>(t.firstVerifiedAt??t.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime())).find((e=>e.type===t))}const T=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType&&0===e.walletIndex))||null,w=e=>e?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)),g=e=>w(e).reduce(((e,t)=>!e||e.walletIndex<t.walletIndex?t:e))||null,k=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType&&0===e.walletIndex))||null,b=e=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType))||null,S=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===t))||null,I=e=>T(e)??k(e),W=e=>{if("ethereum"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"ethereum-address-verifier"};if("solana"===e.chainType)return{entropyId:e.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},N=e=>{let t=I(e);if(!t)throw Error("Failed to find primary wallet");return W(t)},D=(e,i)=>{let a=(r=e,r?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&"ethereum"===e.chainType))).find((e=>t(e.address)===t(i)));var r;return{signingWallet:a,rootWallet:a?a.imported?a:T(e):void 0}},O=(e,t)=>{let i=(e=>e?.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType)))(e).find((e=>e.address.toLowerCase()===t.toLowerCase()));return{signingWallet:i,rootWallet:0===i?.walletIndex?i:k(e)}};const L=(e,t)=>!(T(e)||k(e)||"all-users"!==t&&("users-without-wallets"!==t||(e=>e.linkedAccounts.filter((e=>"wallet"===e.type)))(e)?.length));function C(e){if(!e)return null;let t=function(e){let t=[];for(let i of e){let e=i.type;switch(i.type){case"wallet":let a={address:i.address,type:i.type,imported:i.imported,delegated:i.delegated,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at),chainType:i.chain_type,chainId:i.chain_id,walletClient:"privy"===i.wallet_client_type?"privy":"unknown",walletClientType:i.wallet_client_type,connectorType:i.connector_type,recoveryMethod:i.recovery_method,walletIndex:i.wallet_index};t.push(a);break;case"smart_wallet":let r={address:i.address,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at),smartWalletType:i.smart_wallet_type};t.push(r);break;case"cross_app":let s={type:i.type,subject:i.subject,embeddedWallets:i.embedded_wallets,smartWallets:i.smart_wallets,providerApp:{id:i.provider_app_id},verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(s);break;case"email":let l={address:i.address,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(l);break;case"phone":let n={number:i.phoneNumber,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(n);break;case"google_oauth":let d={subject:i.subject,email:i.email,name:i.name,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(d);break;case"spotify_oauth":let o={subject:i.subject,email:i.email,name:i.name,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(o);break;case"instagram_oauth":let _={subject:i.subject,username:i.username,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(_);break;case"twitter_oauth":let u={subject:i.subject,username:i.username,name:i.name,type:i.type,profilePictureUrl:i.profile_picture_url,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(u);break;case"discord_oauth":let c={subject:i.subject,username:i.username,email:i.email,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(c);break;case"github_oauth":let p={subject:i.subject,username:i.username,name:i.name,email:i.email,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(p);break;case"tiktok_oauth":let f={subject:i.subject,username:i.username,name:i.name,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(f);break;case"linkedin_oauth":let m={subject:i.subject,name:i.name,email:i.email,vanityName:i.vanity_name,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(m);break;case"apple_oauth":let h={subject:i.subject,email:i.email,type:i.type,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(h);break;case"custom_auth":t.push({type:i.type,customUserId:i.custom_user_id,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)});break;case"farcaster":let A={type:i.type,fid:i.fid,ownerAddress:i.owner_address,displayName:i.display_name,username:i.username,bio:i.bio,pfp:i.profile_picture_url,url:i.homepage_url,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at),signerPublicKey:i.signer_public_key};t.push(A);break;case"passkey":let y={type:i.type,enrolledInMfa:i.enrolled_in_mfa,credentialId:i.credential_id,authenticatorName:i.authenticator_name,createdWithDevice:i.created_with_device,createdWithOs:i.created_with_os,createdWithBrowser:i.created_with_browser,verifiedAt:E(i.verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(y);break;case"telegram":let v={type:i.type,telegramUserId:i.telegram_user_id,firstName:i.first_name,lastName:i.last_name,username:i.username,photoUrl:i.photo_url,verifiedAt:E(i.first_verified_at),firstVerifiedAt:E(i.first_verified_at),latestVerifiedAt:E(i.latest_verified_at)};t.push(v);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),i=v(t,"wallet"),a=v(t,"smart_wallet"),r=v(t,"email"),s=v(t,"phone"),l=v(t,"google_oauth"),n=v(t,"twitter_oauth"),d=v(t,"discord_oauth"),o=v(t,"github_oauth"),_=v(t,"spotify_oauth"),u=v(t,"instagram_oauth"),c=v(t,"tiktok_oauth"),p=v(t,"linkedin_oauth"),f=v(t,"apple_oauth"),m=v(t,"farcaster"),h=v(t,"telegram"),A=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:E(t)})));return{id:e.id,createdAt:E(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:s&&{number:s?.number},wallet:i&&{address:i.address,chainType:i.chainType,chainId:i.chainId,walletClient:i.walletClient,walletClientType:i.walletClientType,connectorType:i.connectorType,recoveryMethod:i.recoveryMethod,imported:i.imported,delegated:i.delegated,walletIndex:i.walletIndex},smartWallet:a&&{address:a.address,smartWalletType:a.smartWalletType},google:l&&{subject:l.subject,email:l.email,name:l.name},twitter:n&&{subject:n.subject,username:n.username,name:n.name,profilePictureUrl:n.profilePictureUrl},discord:d&&{subject:d.subject,username:d.username,email:d.email},github:o&&{subject:o.subject,username:o.username,name:o.name,email:o.email},spotify:_&&{subject:_.subject,email:_.email,name:_.name},instagram:u&&{subject:u.subject,username:u.username},tiktok:c&&{subject:c.subject,username:c.username,name:c.name},linkedin:p&&{subject:p.subject,name:p.name,email:p.email,vanityName:p.vanityName},apple:f&&{subject:f.subject,email:f.email},farcaster:m&&{fid:m.fid,ownerAddress:m.ownerAddress,displayName:m.displayName,username:m.username,bio:m.bio,pfp:m.pfp,url:m.url,signerPublicKey:m.signerPublicKey},telegram:h&&{telegramUserId:h.telegramUserId,firstName:h.firstName,lastName:h.lastName,username:h.username,photoUrl:h.photoUrl},delegatedWallets:[],mfaMethods:A.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}const R=i({isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:A,initializeWalletProxy:A,getAuthMeta:A,getAuthFlow:A,closePrivyModal:A,openPrivyModal:A,connectWallet:A,initLoginWithWallet:A,loginWithWallet:A,initLoginWithFarcaster:A,loginWithFarcaster:A,loginWithCode:A,initLoginWithEmail:A,initLoginWithSms:A,initUpdateEmail:A,initUpdatePhone:A,resendEmailCode:A,resendSmsCode:A,initLoginWithHeadlessOAuth:A,loginWithHeadlessOAuth:A,crossAppAuthFlow:A,initLoginWithOAuth:A,recoveryOAuthFlow:A,loginWithOAuth:A,passkeyAuthState:{status:"initial"},setPasskeyAuthState:A,initLoginWithPasskey:A,loginWithPasskey:A,initLinkWithPasskey:A,linkWithPasskey:A,refreshUser:A,loginWithGuestAccountFlow:A,walletProxy:null,createAnalyticsEvent:A,acceptTerms:A,getUsdTokenPrice:A,getUsdPriceForSol:A,recoverPrimaryWallet:A,updateWallets:A,fundWallet:A,fundSolanaWallet:A,setReadyToTrue:A,requestFarcasterSignerStatus:A,initLoginWithTelegram:A,loginWithTelegram:A,generateSiweMessage:A,generateSiweMessageForSmartWallet:A,linkWithSiwe:A,linkSmartWallet:A,delegateWallet:A,revokeDelegatedWallets:A,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:A,exportSolanaWallet:A,solanaSignMessage:A,connectCoinbaseSmartWallet:A,initiateAccountTransfer:A,emailOtpState:{status:"initial"},setEmailOtpState:A,smsOtpState:{status:"initial"},setSmsOtpState:A,siweState:{status:"initial"},setSiweState:A,oAuthState:{status:"initial"},setOAuthState:A,isHeadlessOAuthLoading:!1}),U=()=>a(R),P=i({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:A,login:A,connectOrCreateWallet:A,linkEmail:A,linkPhone:A,linkFarcaster:A,linkWallet:A,startCrossAppAuthFlow:A,linkGoogle:A,linkTwitter:A,linkDiscord:A,linkGithub:A,linkSpotify:A,linkInstagram:A,linkTelegram:A,linkTiktok:A,linkLinkedIn:A,linkApple:A,linkPasskey:A,updateEmail:A,updatePhone:A,logout:A,getAccessToken:A,getEthereumProvider:A,getEthersProvider:A,getWeb3jsProvider:A,unlinkEmail:A,unlinkPhone:A,unlinkWallet:A,unlinkGoogle:A,unlinkTwitter:A,unlinkDiscord:A,unlinkGithub:A,unlinkSpotify:A,unlinkInstagram:A,unlinkTiktok:A,unlinkLinkedIn:A,unlinkApple:A,unlinkCrossAppAccount:A,unlinkFarcaster:A,unlinkTelegram:A,unlinkPasskey:A,setActiveWallet:A,forkSession:A,createWallet:A,signMessage:A,signTypedData:A,enrollInMfa:A,initEnrollmentWithSms:A,initEnrollmentWithTotp:A,initEnrollmentWithPasskey:A,promptMfa:A,init:A,submitEnrollmentWithSms:A,submitEnrollmentWithTotp:A,submitEnrollmentWithPasskey:A,unenroll:A,submit:A,cancel:A,sendTransaction:A,sendSolanaTransaction:A,exportWallet:A,setWalletPassword:A,setWalletRecovery:A,requestFarcasterSignerFromWarpcast:A,getFarcasterSignerPublicKey:A,signFarcasterMessage:A,createGuestAccount:A,signMessageWithCrossAppWallet:A,signTypedDataWithCrossAppWallet:A,sendTransactionWithCrossAppWallet:A,isModalOpen:!1,mfaMethods:[]}),V=()=>a(P);export{p as A,O as B,y as C,R as I,n as P,c as a,s as b,o as c,d,C as e,_ as f,W as g,u as h,l as i,V as j,h as k,S as l,T as m,A as n,k as o,f as p,I as q,m as r,L as s,P as t,U as u,b as v,N as w,w as x,g as y,D as z};
@@ -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-CrcnzDDK.mjs";import{U as c,A as p,a4 as d}from"./useWallets--4nIqKdE.mjs";import{u,g as _,M as m}from"./getEmbeddedConnectedWallet-DQ7twXmj.mjs";import{createSmartAccountClient as g}from"permissionless";import{toLightSmartAccount as b,toBiconomySmartAccount as h,toEcdsaKernelSmartAccount as y,toSafeSmartAccount as v}from"permissionless/accounts";import{createPimlicoClient as I}from"permissionless/clients/pimlico";import{toCoinbaseSmartAccount as f,entryPoint06Address as S,entryPoint07Address as T}from"viem/account-abstraction";import E,{z as A}from"zod";import k from"bs58";import{ethers as O}from"ethers";import{parsePhoneNumber as P}from"libphonenumber-js/max";let j;var w=((j=w||{}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",j.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",j.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",j.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",j.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",j.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",j.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",j.INVALID_DATA="invalid_data",j.INVALID_CREDENTIALS="invalid_credentials",j.INVALID_CAPTCHA="invalid_captcha",j.LINKED_TO_ANOTHER_USER="linked_to_another_user",j.ALLOWLIST_REJECTED="allowlist_rejected",j.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",j.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",j.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",j.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",j.TOO_MANY_REQUESTS="too_many_requests",j.INVALID_ORIGIN="invalid_origin",j.MISSING_ORIGIN="missing_origin",j.INVALID_NATIVE_APP_ID="invalid_native_app_id",j.TOKEN_ALREADY_USED="token_already_used",j.ALREADY_LOGGED_OUT="already_logged_out",j.NOT_SUPPORTED="not_supported",j.USER_UNSUBSCRIBED="user_unsubscribed",j.MAX_APPS_REACHED="max_apps_reached",j.USER_LIMIT_REACHED="max_accounts_reached",j.DEVICE_REVOKED="device_revoked",j.WALLET_PASSWORD_EXISTS="wallet_password_exists",j.OAUTH_STATE_MISMATCH="oauth_state_mismatch",j.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",j.DISALLOWED_LOGIN_METHOD="disallowed_login_method",j.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",j.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",j.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",j.CANNOT_SET_PASSWORD="cannot_set_password",j.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",j.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",j.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",j.USER_DOES_NOT_EXIST="user_does_not_exist",j.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",j.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",j.FEATURE_NOT_ENABLED="feature_not_enabled",j.INSUFFICIENT_FUNDS="insufficient_funds",j.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",j),C=class extends Error{toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a,n){super(t),this.code=a,this.status=e,this.responseData=n}},R=class extends C{constructor(e,t){super(400,e,t||"invalid_data")}},D=class extends C{constructor(e,t){super(401,e,t)}},N=class extends C{constructor(e,t){super(422,e,t)}};function U(e,t){return Object.keys(t).forEach((function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[a]}})})),e}function L(e,t,a,n){Object.defineProperty(e,t,{get:a,set:n,enumerable:!0,configurable:!0})}A.object({error:A.string(),cause:A.string().optional(),code:A.nativeEnum(w).optional()});var M={},W={};L(W,"AnalyticsEvent",(()=>x));let x={path:"/api/v1/analytics_events",method:"POST"};var F={};L(F,"AppConfig",(()=>G));let G={path:"/api/v1/apps/:app_id",method:"GET"};var V={};L(V,"CoinbaseOnRampInit",(()=>B)),L(V,"CoinbaseOnRampStatus",(()=>H));let B={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},H={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"};var Y={};L(Y,"GetCrossAppConnections",(()=>q));let q={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"};var K={};L(K,"CustomJWTAuthenticate",(()=>$));let $={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"};var z={};L(z,"FarcasterInit",(()=>X)),L(z,"FarcasterAuthenticate",(()=>J)),L(z,"FarcasterLink",(()=>Q)),L(z,"FarcasterUnlink",(()=>Z)),L(z,"FarcasterStatus",(()=>ee)),L(z,"FarcasterV2Init",(()=>te)),L(z,"FarcasterV2Authenticate",(()=>ae));let X={path:"/api/v1/farcaster/init",method:"POST"},J={path:"/api/v1/farcaster/authenticate",method:"POST"},Q={path:"/api/v1/farcaster/link",method:"POST"},Z={path:"/api/v1/farcaster/unlink",method:"POST"},ee={path:"/api/v1/farcaster/status",method:"GET"},te={path:"/api/v2/farcaster/init",method:"POST"},ae={path:"/api/v2/farcaster/authenticate",method:"POST"};var ne={};L(ne,"FarcasterSignerInit",(()=>re)),L(ne,"FarcasterSignerStatus",(()=>ie));let re={path:"/api/v1/farcaster/signer/init",method:"POST"},ie={path:"/api/v1/farcaster/signer/status",method:"POST"};var oe={};L(oe,"GuestAuthenticate",(()=>se));let se={path:"/api/v1/guest/authenticate",method:"POST"};var le={};L(le,"MfaPasskeyInit",(()=>ce)),L(le,"MfaPasskeyVerify",(()=>pe)),L(le,"MfaPasskeyEnrollment",(()=>de));let ce={path:"/api/v1/mfa/passkeys/init",method:"POST"},pe={path:"/api/v1/mfa/passkeys/verify",method:"POST"},de={path:"/api/v1/mfa/passkeys/enrollment",method:"POST"};var ue={};L(ue,"MfaPasswordlessSmsEnroll",(()=>_e)),L(ue,"MfaPasswordlessSmsVerify",(()=>me)),L(ue,"MfaPasswordlessSmsInit",(()=>ge)),L(ue,"MfaPasswordlessSmsUnenroll",(()=>be));let _e={path:"/api/v1/mfa/passwordless_sms/enroll",method:"POST"},me={path:"/api/v1/mfa/passwordless_sms/verify",method:"POST"},ge={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},be={path:"/api/v1/mfa/passwordless_sms/unenroll",method:"POST"};var he={};L(he,"MfaTotpEnroll",(()=>ye)),L(he,"MfaTotpVerify",(()=>ve)),L(he,"MfaTotpInit",(()=>Ie)),L(he,"MfaTotpUnenroll",(()=>fe));let ye={path:"/api/v1/mfa/totp/enroll",method:"POST"},ve={path:"/api/v1/mfa/totp/verify",method:"POST"},Ie={path:"/api/v1/mfa/totp/init",method:"POST"},fe={path:"/api/v1/mfa/totp/unenroll",method:"POST"};var Se={};L(Se,"OAuthAuthenticate",(()=>Te)),L(Se,"OAuthInit",(()=>Ee)),L(Se,"OAuthLink",(()=>Ae)),L(Se,"OAuthUnlink",(()=>ke));let Te={path:"/api/v1/oauth/authenticate",method:"POST"},Ee={path:"/api/v1/oauth/init",method:"POST"},Ae={path:"/api/v1/oauth/link",method:"POST"},ke={path:"/api/v1/oauth/unlink",method:"POST"};var Oe={};L(Oe,"OAuthProviderAuthorize",(()=>Pe)),L(Oe,"OAuthProviderVerify",(()=>je));let Pe={path:"/oauth/authorization_code",method:"POST"},je={path:"/oauth/verify",method:"POST"};var we={};L(we,"PasskeyLink",(()=>Ce)),L(we,"PasskeyAuthenticate",(()=>Re)),L(we,"PasskeyAuthenticateInit",(()=>De)),L(we,"PasskeyLinkInit",(()=>Ne)),L(we,"PasskeyUnlink",(()=>Ue));let Ce={path:"/api/v1/passkeys/link",method:"POST"},Re={path:"/api/v1/passkeys/authenticate",method:"POST"},De={path:"/api/v1/passkeys/authenticate/init",method:"POST"},Ne={path:"/api/v1/passkeys/link/init",method:"POST"},Ue={path:"/api/v1/passkeys/unlink",method:"POST"};var Le={};L(Le,"PasswordlessAuthenticate",(()=>Me)),L(Le,"PasswordlessInit",(()=>We)),L(Le,"PasswordlessLink",(()=>xe)),L(Le,"PasswordlessUnlink",(()=>Fe)),L(Le,"PasswordlessUpdate",(()=>Ge));let Me={path:"/api/v1/passwordless/authenticate",method:"POST"},We={path:"/api/v1/passwordless/init",method:"POST"},xe={path:"/api/v1/passwordless/link",method:"POST"},Fe={path:"/api/v1/passwordless/unlink",method:"POST"},Ge={path:"/api/v1/passwordless/update",method:"POST"};var Ve={};L(Ve,"PasswordlessSmsAuthenticate",(()=>Be)),L(Ve,"PasswordlessSmsInit",(()=>He)),L(Ve,"PasswordlessSmsLink",(()=>Ye)),L(Ve,"PasswordlessSmsUnlink",(()=>qe)),L(Ve,"PasswordlessSmsUpdate",(()=>Ke));let Be={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},He={path:"/api/v1/passwordless_sms/init",method:"POST"},Ye={path:"/api/v1/passwordless_sms/link",method:"POST"},qe={path:"/api/v1/passwordless_sms/unlink",method:"POST"},Ke={path:"/api/v1/passwordless_sms/update",method:"POST"};var $e={};L($e,"RecoveryKeyMaterial",(()=>ze)),L($e,"RecoveryOAuthInit",(()=>Xe)),L($e,"RecoveryOAuthAuthenticate",(()=>Je)),L($e,"RecoveryOAuthInitICloud",(()=>Qe)),L($e,"RecoveryOAuthCallbackICloudExpo",(()=>Ze)),L($e,"RecoveryConfigurationICloud",(()=>et));let ze={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},Xe={path:"/api/v1/recovery/oauth/init",method:"POST"},Je={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},Qe={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},Ze={path:"/api/v1/recovery/oauth/callback_icloud/:app_id/expo_ios",method:"GET"},et={path:"/api/v1/recovery/configuration_icloud",method:"POST"};var tt={};L(tt,"getPathWithParams",(()=>at));let at=(e,t)=>t?Object.entries(t).reduce(((e,[t,a])=>e.replace(`:${t}`,`${a}`)),e):e;var nt={};L(nt,"RefreshSession",(()=>rt)),L(nt,"Logout",(()=>it));let rt={path:"/api/v1/sessions",method:"POST"},it={path:"/api/v1/sessions/logout",method:"POST"};var ot={};L(ot,"GetSmartWalletConfig",(()=>st)),L(ot,"PostSmartWalletConfig",(()=>lt));let st={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},lt={path:"/api/v1/apps/:app_id/smart_wallets",method:"POST"};var ct={};L(ct,"SiweInit",(()=>pt)),L(ct,"SiweAuthenticate",(()=>dt)),L(ct,"SiweLink",(()=>ut)),L(ct,"SiweLinkSmartWallet",(()=>_t)),L(ct,"SiweUnlink",(()=>mt));let pt={path:"/api/v1/siwe/init",method:"POST"},dt={path:"/api/v1/siwe/authenticate",method:"POST"},ut={path:"/api/v1/siwe/link",method:"POST"},_t={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},mt={path:"/api/v1/siwe/unlink",method:"POST"};var gt={};L(gt,"SiwsInit",(()=>bt)),L(gt,"SiwsAuthenticate",(()=>ht)),L(gt,"SiwsLink",(()=>yt)),L(gt,"SiwsUnlink",(()=>vt));let bt={path:"/api/v1/siws/init",method:"POST"},ht={path:"/api/v1/siws/authenticate",method:"POST"},yt={path:"/api/v1/siws/link",method:"POST"},vt={path:"/api/v1/siws/unlink",method:"POST"};var It={};L(It,"AcceptTermsOnUser",(()=>ft));let ft={path:"/api/v1/users/me/accept_terms",method:"POST"};var St={};L(St,"TelegramAuthenticate",(()=>Tt)),L(St,"TelegramLink",(()=>Et)),L(St,"TelegramUnlink",(()=>At));let Tt={path:"/api/v1/telegram/authenticate",method:"POST"},Et={path:"/api/v1/telegram/link",method:"POST"},At={path:"/api/v1/telegram/unlink",method:"POST"};var kt={};L(kt,"MoonpayOnRampSign",(()=>Ot));let Ot={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"};U(M,W),U(M,F),U(M,V),U(M,Y),U(M,K),U(M,z),U(M,ne),U(M,oe),U(M,le),U(M,ue),U(M,he),U(M,Se),U(M,Oe),U(M,we),U(M,Le),U(M,Ve),U(M,$e),U(M,tt),U(M,nt),U(M,ot),U(M,ct),U(M,gt),U(M,It),U(M,St),U(M,kt);var Pt={},jt={};L(jt,"AnalyticsEventInput",(()=>wt));let wt=A.object({event_name:A.string().max(255),client_id:A.string().max(255).nullable(),payload:A.record(A.any()).optional()});var Ct={};L(Ct,"AccountIdFromPath",(()=>Bt)),L(Ct,"AppIdFromPath",(()=>Ht)),L(Ct,"Pagination",(()=>Yt));var Rt={};L(Rt,"UserId",(()=>Dt)),L(Rt,"Email",(()=>Nt)),L(Rt,"PasswordlessCode",(()=>Ut)),L(Rt,"WalletAddress",(()=>Lt)),L(Rt,"normalizeEthereumAddress",(()=>Gt)),L(Rt,"SolanaWalletAddress",(()=>Mt)),L(Rt,"PhoneNumber",(()=>Wt)),L(Rt,"normalizePhoneNumber",(()=>xt)),L(Rt,"isValidAddress",(()=>Ft)),L(Rt,"AuthenticateMode",(()=>Vt));let Dt=A.string({required_error:"Privy DID must be included",invalid_type_error:"Privy DID is not a valid string"}).min(1).transform((e=>e.replace("did:privy:",""))),Nt=A.string({required_error:"Email address must be provided",invalid_type_error:"Email address must be a valid string"}).email("Invalid email address").transform((e=>e.toLowerCase())),Ut=A.string({required_error:"Verification code must be provided",invalid_type_error:"Invalid verification code"}).length(6,"Verification code must have 6 digits."),Lt=A.string({required_error:"Ethereum address must be provided",invalid_type_error:"Invalid Ethereum address"}).transform(((e,t)=>Gt(e)||(t.addIssue({code:A.ZodIssueCode.custom,message:"Invalid Ethereum address"}),A.NEVER))),Mt=A.string({required_error:"Solana address must be provided",invalid_type_error:"Invalid Solana address"}).trim().transform(((e,t)=>{try{k.decode(e)}catch(e){return t.addIssue({code:A.ZodIssueCode.custom,message:"Invalid Solana address"}),A.NEVER}return e})),Wt=A.string({required_error:"Phone number must be included",invalid_type_error:"Phone number is not a valid string"}).refine((e=>{try{return void 0!==xt(e)}catch(e){return!1}}),{message:"Phone number is not valid"}).transform((e=>xt(e)||""));function xt(e){let t=P(e,"US");if(t?.isPossible())return t.formatInternational()}function Ft(e){return!!Gt(e)}function Gt(e){if("string"==typeof e)try{return O.utils.getAddress(e.trim())}catch(e){}}let Vt=A.object({mode:A.enum(["no-signup","login-or-sign-up"]).optional()}),Bt=A.object({account_id:A.string({required_error:"Account ID must be provided",invalid_type_error:"Account ID is not a valid string"}).min(1)}),Ht=A.object({app_id:A.string({required_error:"App ID must be provided",invalid_type_error:"App ID is not a valid string"}).min(1)}).transform((({app_id:e})=>({app_id:e,appId:e}))).catch((({error:e})=>{throw new R(e.message,w.MISSING_OR_INVALID_PRIVY_APP_ID)})),Yt=A.object({cursor:Dt.optional(),limit:A.coerce.number().max(100,{message:"Query limit can be at maximum 100 records."}).optional()});var qt={};L(qt,"AppResponseSchema",(()=>ta));var Kt={};L(Kt,"EmbeddedWalletConfigSchema",(()=>Xt)),L(Kt,"TelegramAuthConfigSchema",(()=>Jt)),L(Kt,"FundingMethodEnum",(()=>Qt)),L(Kt,"FundingMethodArraySchema",(()=>Zt)),L(Kt,"FundingConfigResponseSchema",(()=>ea));var $t={};L($t,"Currency",(()=>zt));let zt=E.object({chain:E.string(),asset:E.enum(["native-currency","USDC"]).optional()}),Xt=E.object({create_on_login:E.enum(["users-without-wallets","all-users","off"]),user_owned_recovery_options:E.array(E.enum(["user-passcode","google-drive","icloud"])),require_user_owned_recovery_on_create:E.boolean().optional(),require_user_password_on_create:E.boolean().optional()}),Jt=E.object({bot_id:E.string(),bot_name:E.string(),link_enabled:E.boolean(),seamless_auth_enabled:E.boolean()}),Qt=E.enum(["moonpay","coinbase-onramp","external"]),Zt=E.array(Qt),ea=E.object({default_recommended_currency:zt,default_recommended_amount:E.string(),methods:Zt,options:E.array(E.object({method:E.string(),provider:E.string()})),prompt_funding_on_wallet_creation:E.boolean(),cross_chain_bridging_enabled:E.boolean()}),ta=A.object({id:A.string(),name:A.string(),logo_url:A.string().nullable(),icon_url:A.string().nullable(),terms_and_conditions_url:A.string().nullable(),privacy_policy_url:A.string().nullable(),require_users_accept_terms:A.boolean().nullable(),theme:A.string(),accent_color:A.string().nullable(),show_wallet_login_first:A.boolean(),allowed_domains:A.array(A.string()),allowed_native_app_ids:A.array(A.string()),allowed_native_app_url_schemes:A.array(A.string()),wallet_auth:A.boolean(),email_auth:A.boolean(),sms_auth:A.boolean(),google_oauth:A.boolean(),twitter_oauth:A.boolean(),discord_oauth:A.boolean(),github_oauth:A.boolean(),spotify_oauth:A.boolean(),instagram_oauth:A.boolean(),tiktok_oauth:A.boolean(),linkedin_oauth:A.boolean(),apple_oauth:A.boolean(),farcaster_auth:A.boolean(),passkey_auth:A.boolean(),telegram_auth:A.boolean(),guest_auth:A.boolean(),solana_wallet_auth:A.boolean(),disable_plus_emails:A.boolean(),allowlist_enabled:A.boolean(),allowlist_config:A.object({error_title:A.string().nullable(),error_detail:A.string().nullable(),cta_text:A.string().nullable(),cta_link:A.string().nullable()}),wallet_connect_cloud_project_id:A.string().nullable(),custom_api_url:A.string().nullable(),embedded_wallet_config:Xt,enforce_wallet_uis:A.boolean(),legacy_wallet_ui_config:A.boolean(),fiat_on_ramp_enabled:A.boolean(),captcha_enabled:A.boolean(),twitter_oauth_on_mobile_enabled:A.boolean(),mfa_methods:A.array(A.enum(["sms","totp","passkey"])),captcha_site_key:A.string().optional(),verification_key:A.string(),telegram_auth_config:Jt.optional(),funding_config:ea.optional(),max_linked_wallets_per_user:A.number().nullable(),farcaster_link_wallets_enabled:A.boolean()});var aa={};L(aa,"CoinbaseOnRampInitInput",(()=>la)),L(aa,"CoinbaseOnRampInitResponse",(()=>ca)),L(aa,"CoinbaseOnRampStatusResponse",(()=>pa));let na=A.enum(["ethereum","bitcoin","base","avacchain","optimism","solana","polygon","arbitrum","stellar"]),ra=A.enum(["eth","ETH","USDC"]).transform((e=>e.toUpperCase())),ia=A.enum(["SOL","USDC"]).transform((e=>e.toUpperCase())),oa=A.object({addresses:A.array(A.object({address:Lt,blockchains:A.array(na)})).max(1).min(1),assets:A.array(ra).optional()}),sa=A.object({addresses:A.array(A.object({address:Mt,blockchains:A.array(na)})).max(1).min(1),assets:A.array(ia).optional()}),la=A.union([oa,sa]),ca=A.object({app_id:A.string(),session_token:A.string(),channel_id:A.string(),partner_user_id:A.string()}),pa=A.object({status:A.enum(["pending","success","failure"])});var da={};L(da,"CrossAppConnectionsResponse",(()=>ua));let ua=A.object({connections:A.array(A.object({provider_app_id:A.string(),provider_app_name:A.string(),provider_app_icon_url:A.string().url().nullable(),provider_app_custom_api_url:A.string().url().nullable(),read_only:A.boolean()}))});var _a={};L(_a,"AuthenticateJwtInput",(()=>ma));let ma=E.object({token:E.string().optional()});var ga={};L(ga,"VerifyEmailInput",(()=>ha)),L(ga,"AuthenticateEmailInput",(()=>ya)),L(ga,"InitEmailInput",(()=>va)),L(ga,"UnlinkEmailInput",(()=>Ia)),L(ga,"UpdateEmailInput",(()=>fa)),L(ga,"TransferEmailInput",(()=>Sa));let ba=A.object({nonce:A.string()}),ha=A.object({code:Ut,email:Nt}),ya=ha.merge(Vt),va=A.object({email:Nt,token:A.string().optional()}),Ia=A.object({address:Nt}),fa=A.object({oldAddress:Nt,newAddress:Nt,code:Ut}),Sa=ba.extend({email:Nt});var Ta={};L(Ta,"JsonWebKey",(()=>Ea)),L(Ta,"JsonWebKeySet",(()=>Aa));let Ea=A.object({kty:A.string(),use:A.enum(["sig","enc"]).optional(),key_ops:A.array(A.enum(["sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits"])).optional(),alg:A.enum(["RS256"]),kid:A.string().optional(),x5u:A.string().optional(),x5c:A.array(A.string()).optional(),x5t:A.string().optional(),"x5t#S256":A.string().optional(),n:A.string().optional(),e:A.string().optional(),d:A.string().optional()}),Aa=A.object({keys:A.array(Ea)});var ka={};L(ka,"FarcasterConnectInitResponse",(()=>Oa)),L(ka,"FarcasterConnectStatusCompletedResponse",(()=>Pa)),L(ka,"FarcasterConnectStatusPendingResponse",(()=>ja)),L(ka,"FarcasterAuthenticateInput",(()=>wa)),L(ka,"FarcasterLinkInput",(()=>Ca)),L(ka,"FarcasterInitInput",(()=>Ra)),L(ka,"FarcasterUnlinkInput",(()=>Da)),L(ka,"TransferFarcasterInput",(()=>Na)),L(ka,"FarcasterV2InitInput",(()=>Ua)),L(ka,"FarcasterV2InitResponse",(()=>La)),L(ka,"FarcasterV2AuthenticateInput",(()=>Ma));let Oa=A.object({channel_token:A.string(),connect_uri:A.string()}),Pa=A.object({state:A.literal("completed"),nonce:A.string(),message:A.string(),signature:A.string(),fid:A.number(),username:A.string(),display_name:A.string(),bio:A.string(),pfp_url:A.string()}),ja=A.object({state:A.literal("pending"),nonce:A.string()}),wa=A.object({channel_token:A.string(),message:A.string(),signature:A.string(),fid:A.number()}).merge(Vt),Ca=A.object({channel_token:A.string(),message:A.string(),signature:A.string(),fid:A.number()}),Ra=A.object({token:A.string().optional(),redirect_url:A.string().url().optional(),relying_party:A.string().optional()}),Da=A.object({fid:A.number()}),Na=ba.extend({farcaster_id:A.string(),farcaster_embedded_address:A.string()}),Ua=A.object({}),La=A.object({nonce:A.string(),expires_at:A.string()}),Ma=A.object({fid:A.number(),message:A.string(),signature:A.string()}).merge(Vt);var Wa={};L(Wa,"FarcasterSignerInitInput",(()=>xa)),L(Wa,"FarcasterSignerInitResponse",(()=>Fa)),L(Wa,"FarcasterSignerStatusResponse",(()=>Ga));let xa=A.object({ed25519_public_key:A.string().refine((e=>e.startsWith("0x")&&66===e.length)),deadline:A.bigint().optional().default((()=>BigInt(Math.floor(Date.now()/1e3)+3600)))}),Fa=A.discriminatedUnion("status",[A.object({public_key:A.string(),status:A.literal("pending_approval"),signer_approval_url:A.string()}),A.object({public_key:A.string(),status:A.literal("approved"),fid:A.bigint()}),A.object({public_key:A.string(),status:A.literal("revoked"),fid:A.bigint()})]),Ga=A.discriminatedUnion("status",[A.object({public_key:A.string(),status:A.literal("pending_approval")}),A.object({public_key:A.string(),status:A.literal("approved"),fid:A.bigint()}),A.object({public_key:A.string(),status:A.literal("revoked"),fid:A.bigint()})]);var Va={};L(Va,"AuthenticateGuestInput",(()=>Ba));let Ba=A.object({guest_credential:A.string().length(43)}).strict();var Ha={};L(Ha,"EmailIdTokenEntry",(()=>zn)),L(Ha,"PhoneIdTokenEntry",(()=>Xn)),L(Ha,"EthereumIdTokenEntry",(()=>Jn)),L(Ha,"SolanaIdTokenEntry",(()=>Qn)),L(Ha,"FarcasterIdTokenEntry",(()=>Zn)),L(Ha,"PasskeyIdTokenEntry",(()=>er)),L(Ha,"TelegramIdTokenEntry",(()=>tr)),L(Ha,"EthereumEmbeddedWalletIdTokenEntry",(()=>ar)),L(Ha,"SolanaEmbeddedWalletIdTokenEntry",(()=>nr)),L(Ha,"GoogleOauthIdTokenEntry",(()=>rr)),L(Ha,"TwitterOauthIdTokenEntry",(()=>ir)),L(Ha,"DiscordOauthIdTokenEntry",(()=>or)),L(Ha,"GithubOauthIdTokenEntry",(()=>sr)),L(Ha,"LinkedInOauthIdTokenEntry",(()=>lr)),L(Ha,"SpotifyOauthIdTokenEntry",(()=>cr)),L(Ha,"InstagramOauthIdTokenEntry",(()=>pr)),L(Ha,"TiktokOauthIdTokenEntry",(()=>dr)),L(Ha,"AppleOauthIdTokenEntry",(()=>ur)),L(Ha,"CustomJwtIdTokenEntry",(()=>_r)),L(Ha,"CrossAppIdTokenEntry",(()=>mr)),L(Ha,"SmartWalletIdTokenEntry",(()=>gr));var Ya={};L(Ya,"EmailAccount",(()=>ln)),L(Ya,"PhoneAccount",(()=>cn)),L(Ya,"BaseWalletAccount",(()=>pn)),L(Ya,"EthereumAccount",(()=>dn)),L(Ya,"SmartWalletAccount",(()=>un)),L(Ya,"SolanaAccount",(()=>_n)),L(Ya,"FarcasterAccount",(()=>mn)),L(Ya,"PasskeyAccount",(()=>gn)),L(Ya,"TelegramAccount",(()=>bn)),L(Ya,"EthereumEmbeddedWalletAccount",(()=>vn)),L(Ya,"SolanaEmbeddedWalletAccount",(()=>In)),L(Ya,"BitcoinSegwitEmbeddedWalletAccount",(()=>fn)),L(Ya,"BitcoinTaprootEmbeddedWalletAccount",(()=>Sn)),L(Ya,"GoogleOauthAccount",(()=>Tn)),L(Ya,"TwitterOauthAccount",(()=>En)),L(Ya,"DiscordOauthAccount",(()=>An)),L(Ya,"GithubOauthAccount",(()=>kn)),L(Ya,"LinkedInOauthAccount",(()=>On)),L(Ya,"SpotifyOauthAccount",(()=>Pn)),L(Ya,"InstagramOauthAccount",(()=>jn)),L(Ya,"TiktokOauthAccount",(()=>wn)),L(Ya,"AppleOauthAccount",(()=>Cn)),L(Ya,"CustomJwtAccount",(()=>Rn)),L(Ya,"CrossAppEmbeddedWallet",(()=>Dn)),L(Ya,"CrossAppSmartWallet",(()=>Nn)),L(Ya,"CrossAppAccount",(()=>Un)),L(Ya,"LinkedAccount",(()=>Ln)),L(Ya,"SmsMfaMethod",(()=>Mn)),L(Ya,"TotpMfaMethod",(()=>Wn)),L(Ya,"PasskeyMfaMethod",(()=>xn)),L(Ya,"LinkedMfaMethod",(()=>Fn)),L(Ya,"CustomMetadata",(()=>Gn)),L(Ya,"OAuthTokens",(()=>Vn)),L(Ya,"User",(()=>Bn)),L(Ya,"SessionUpdateActionEnum",(()=>Hn)),L(Ya,"AuthenticatedUser",(()=>Yn)),L(Ya,"LoggedOutUser",(()=>qn)),L(Ya,"MaybeUser",(()=>Kn));var qa={};L(qa,"SmartWalletProvider",(()=>Za)),L(qa,"AlchemyPaymasterContextSchema",(()=>tn)),L(qa,"SmartWalletNetworkConfigurationInputSchema",(()=>nn)),L(qa,"SmartWalletConfigurationSchema",(()=>rn)),L(qa,"SmartWalletConfigurationInputSchema",(()=>on)),L(qa,"SmartWalletConfigurationResponseSchema",(()=>sn)),L(qa,"SAFE",(()=>Ka)),L(qa,"KERNEL",(()=>$a)),L(qa,"LIGHT_ACCOUNT",(()=>Xa)),L(qa,"BICONOMY",(()=>za)),L(qa,"COINBASE_SMART_WALLET",(()=>Ja)),L(qa,"SUPPORTED_SMART_WALLET_TYPES",(()=>Qa));let Ka="safe",$a="kernel",za="biconomy",Xa="light_account",Ja="coinbase_smart_wallet",Qa=[Ka,$a,za,Xa,Ja],Za=A.enum(Qa,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),en=A.string().regex(/^eip155:\d+$/,"Chain ID must be an eip155 chain ID"),tn=A.object({policy_id:A.string().uuid()}),an=A.object({chain_id:en,bundler_url:A.string(),paymaster_url:A.string().optional(),rpc_url:A.string().optional(),chain_name:A.string().optional(),paymaster_context:tn.optional()}),nn=A.object({chain_id:en,bundler_url:A.string().optional(),paymaster_url:A.string().optional(),rpc_url:A.string().optional(),chain_name:A.string().optional(),paymaster_context:tn.optional()}),rn=A.discriminatedUnion("enabled",[A.object({enabled:A.literal(!1)}),A.object({enabled:A.literal(!0),smart_wallet_type:Za,configured_networks:A.array(an).min(1)})]),on=A.discriminatedUnion("enabled",[A.object({enabled:A.literal(!1)}),A.object({enabled:A.literal(!0),smart_wallet_type:Za,configured_networks:A.array(nn).min(1)})]),sn=rn,ln=A.object({type:A.literal("email"),address:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),cn=A.object({type:A.literal("phone"),phoneNumber:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),pn=A.object({type:A.enum(["wallet","smart_wallet"]),address:A.string(),chain_type:A.enum(["solana","ethereum"])}),dn=A.object({type:A.literal("wallet"),address:A.string(),chain_id:A.string().optional(),chain_type:A.literal("ethereum"),wallet_client:A.literal("unknown"),wallet_client_type:A.string().optional(),connector_type:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),un=A.object({type:A.literal("smart_wallet"),address:A.string(),smart_wallet_type:Za,verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),_n=A.object({type:A.literal("wallet"),address:A.string(),chain_type:A.literal("solana"),wallet_client:A.literal("unknown"),wallet_client_type:A.string().optional(),connector_type:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),mn=A.object({type:A.literal("farcaster"),fid:A.number(),owner_address:Lt,username:A.string().optional(),display_name:A.string().optional(),bio:A.string().optional(),profile_picture:A.string().optional(),profile_picture_url:A.string().optional(),homepage_url:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable(),signer_public_key:A.string().optional()}),gn=A.object({type:A.literal("passkey"),created_with_browser:A.string().optional(),created_with_os:A.string().optional(),created_with_device:A.string().optional(),credential_id:A.string(),authenticator_name:A.string().optional(),enrolled_in_mfa:A.boolean(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),bn=A.object({type:A.literal("telegram"),telegram_user_id:A.string(),first_name:A.string().nullish(),last_name:A.string().nullish(),username:A.string().nullish(),photo_url:A.string().nullish(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}).transform((e=>({...e,telegramUserId:e.telegram_user_id,firstName:e.first_name}))),hn=A.enum(["privy","user-passcode","google-drive","icloud"]),yn=A.object({type:A.literal("wallet"),address:A.string(),imported:A.boolean().default(!1),delegated:A.boolean().default(!1),wallet_index:A.number(),chain_id:A.string(),chain_type:A.string(),wallet_client:A.literal("privy"),wallet_client_type:A.literal("privy"),connector_type:A.literal("embedded"),recovery_method:hn,verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),vn=yn.merge(A.object({chain_type:A.literal("ethereum")})),In=yn.merge(A.object({chain_type:A.literal("solana"),public_key:A.string()})),fn=yn.merge(A.object({chain_type:A.literal("bitcoin-segwit"),public_key:A.string()})),Sn=yn.merge(A.object({chain_type:A.literal("bitcoin-taproot"),public_key:A.string()})),Tn=A.object({type:A.literal("google_oauth"),subject:A.string(),email:A.string(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),En=A.object({type:A.literal("twitter_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),profile_picture_url:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),An=A.object({type:A.literal("discord_oauth"),subject:A.string(),username:A.string().nullable(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),kn=A.object({type:A.literal("github_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),On=A.object({type:A.literal("linkedin_oauth"),subject:A.string(),name:A.string().optional(),email:A.string().nullable(),vanity_name:A.string().optional(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Pn=A.object({type:A.literal("spotify_oauth"),subject:A.string(),email:A.string().nullable(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),jn=A.object({type:A.literal("instagram_oauth"),subject:A.string(),username:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),wn=A.object({type:A.literal("tiktok_oauth"),subject:A.string(),username:A.string().nullable(),name:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Cn=A.object({type:A.literal("apple_oauth"),subject:A.string(),email:A.string().nullable(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Rn=A.object({type:A.literal("custom_auth"),custom_user_id:A.string(),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Dn=A.object({address:A.string()}),Nn=A.object({address:A.string()}),Un=A.object({type:A.literal("cross_app"),subject:A.string(),provider_app_id:A.string(),embedded_wallets:A.array(Dn),smart_wallets:A.array(Nn),verified_at:A.number(),first_verified_at:A.number().nullable(),latest_verified_at:A.number().nullable()}),Ln=A.union([ln,cn,dn,_n,un,vn,In,fn,Sn,Tn,En,An,kn,Pn,jn,wn,On,Cn,Rn,mn,gn,bn,Un]),Mn=A.object({type:A.literal("sms"),verified_at:A.number()}),Wn=A.object({type:A.literal("totp"),verified_at:A.number()}),xn=A.object({type:A.literal("passkey"),verified_at:A.number()}),Fn=A.union([Mn,Wn,xn]),Gn=A.record(A.string(),A.union([A.string(),A.number(),A.boolean()])),Vn=A.object({provider:A.string(),access_token:A.string(),access_token_expires_in_seconds:A.number().optional(),refresh_token:A.string().optional(),refresh_token_expires_in_seconds:A.number().optional(),scopes:A.array(A.string()).optional()}),Bn=A.object({id:A.string(),linked_accounts:A.array(Ln),mfa_methods:A.array(Fn),created_at:A.number(),has_accepted_terms:A.boolean(),is_guest:A.boolean(),custom_metadata:Gn.optional()}),Hn=A.enum(["set","ignore","clear"]),Yn=A.object({user:Bn,token:A.string().min(1).nullable(),privy_access_token:A.string().min(1).nullable(),refresh_token:A.string().min(1).nullable(),identity_token:A.string().min(1).optional(),is_new_user:A.boolean().optional(),oauth_tokens:Vn.optional(),oauth_provider_tokens:A.object({provider:A.string(),access_token:A.string(),access_token_expires_in_seconds:A.number().optional(),refresh_token:A.string().optional(),scopes:A.array(A.string()).optional()}).optional(),session_update_action:Hn}),qn=A.object({user:A.null(),token:A.null(),refresh_token:A.null(),session_update_action:A.literal(Hn.Values.clear)}),Kn=A.union([Yn,qn]),$n={lv:A.number().nullable()},zn=ln.pick({type:!0,address:!0}).extend($n),Xn=cn.pick({type:!0,phoneNumber:!0}).extend($n).transform((({phoneNumber:e,...t})=>({phone_number:e,...t}))),Jn=dn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),Qn=_n.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),Zn=mn.pick({type:!0,fid:!0,username:!0,owner_address:!0}).extend($n).transform((({owner_address:e,...t})=>({oa:e,...t}))),er=gn.pick({type:!0,credential_id:!0}).extend($n),tr=A.object({type:A.literal("telegram"),telegram_user_id:A.string(),username:A.string().nullish(),lv:A.number().nullable()}),ar=vn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),nr=In.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend($n),rr=Tn.pick({type:!0,subject:!0,email:!0}).extend($n),ir=En.pick({type:!0,subject:!0,username:!0}).extend($n),or=An.pick({type:!0,subject:!0,username:!0}).extend($n),sr=kn.pick({type:!0,subject:!0,username:!0}).extend($n),lr=On.pick({type:!0,subject:!0,email:!0}).extend($n),cr=Pn.pick({type:!0,subject:!0,email:!0}).extend($n),pr=jn.pick({type:!0,subject:!0,username:!0}).extend($n),dr=wn.pick({type:!0,subject:!0,username:!0}).extend($n),ur=Cn.pick({type:!0,subject:!0,email:!0}).extend($n),_r=Rn.pick({type:!0,custom_user_id:!0}).extend($n),mr=Un.pick({type:!0,subject:!0,provider_app_id:!0,embedded_wallets:!0,smart_wallets:!0}).extend($n),gr=un.pick({type:!0,smart_wallet_type:!0,address:!0}).extend($n);var br={};L(br,"MfaVerifyResponse",(()=>hr)),L(br,"MfaSmsInitInput",(()=>Ir)),L(br,"MfaSmsAuthenticateEnrollInput",(()=>fr)),L(br,"MfaSmsEnrollInput",(()=>Sr)),L(br,"MfaSmsVerifyInput",(()=>Tr)),L(br,"MfaTotpInput",(()=>Er)),L(br,"ResponseTotpInitMfa",(()=>Ar));let hr=E.object({token:E.string()}).strict(),yr=E.object({action:E.literal("verify")}).strict(),vr=E.object({action:E.literal("enroll"),phoneNumber:Wt}).strict(),Ir=E.union([yr,vr]),fr=E.object({action:E.literal("enroll").optional(),code:Ut,phoneNumber:Wt}).strict(),Sr=E.object({code:Ut,phoneNumber:Wt}).strict(),Tr=E.object({code:Ut}).strict(),Er=E.object({code:Ut}).strict(),Ar=E.object({totpSecret:E.string(),totpAuthUrl:E.string()}).strict();var kr={};L(kr,"MfaPasskeyInitInput",(()=>Wr)),L(kr,"ResponsePasskeyInitMfa",(()=>xr)),L(kr,"MfaPasskeyVerifyInput",(()=>Fr)),L(kr,"MfaEnrollmentPasskeyInput",(()=>Gr));var Or={};L(Or,"PasskeyAuthenticatorVerifyOptions",(()=>Pr)),L(Or,"PasskeyAuthenticatorEnrollmentOptions",(()=>jr)),L(Or,"PasskeyAuthenticatorVerifyResponse",(()=>wr)),L(Or,"PasskeyAuthenticatorEnrollmentResponse",(()=>Cr)),L(Or,"PasskeyInitInput",(()=>Rr)),L(Or,"ResponsePasskeyInitAuthenticate",(()=>Dr)),L(Or,"ResponsePasskeyInitLink",(()=>Nr)),L(Or,"PasskeyLinkInput",(()=>Ur)),L(Or,"PasskeyAuthenticateInput",(()=>Lr)),L(Or,"UnlinkPasskeyInput",(()=>Mr));let Pr=E.object({challenge:E.string(),timeout:E.number().optional(),rp_id:E.string().optional(),allow_credentials:E.array(E.object({id:E.string(),type:E.string(),transports:E.array(E.string()).optional()})).optional(),user_verification:E.string().optional(),extensions:E.object({app_id:E.string().optional(),cred_props:E.boolean().optional(),hmac_create_secret:E.boolean().optional()}).optional()}),jr=E.object({rp:E.object({name:E.string(),id:E.string().optional()}),user:E.object({id:E.string(),name:E.string(),display_name:E.string()}),challenge:E.string(),pub_key_cred_params:E.array(E.object({alg:E.number(),type:E.literal("public-key")})),timeout:E.number().optional(),exclude_credentials:E.array(E.object({id:E.string(),type:E.string(),transports:E.array(E.string()).optional()})).optional(),authenticator_selection:E.object({authenticator_attachment:E.string().optional(),require_resident_key:E.boolean().optional(),resident_key:E.string().optional(),user_verification:E.string().optional()}).optional(),attestation:E.string().optional(),extensions:E.object({app_id:E.string().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}).optional()}),wr=E.object({id:E.string(),raw_id:E.string(),response:E.object({client_data_json:E.string(),authenticator_data:E.string(),signature:E.string(),user_handle:E.string().optional()}),authenticator_attachment:E.string().optional(),client_extension_results:E.object({app_id:E.boolean().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}),type:E.literal("public-key")}),Cr=E.object({id:E.string(),raw_id:E.string(),response:E.object({client_data_json:E.string(),attestation_object:E.string(),authenticator_data:E.string().optional(),transports:E.array(E.any()).optional(),public_key_algorithm:E.number().optional(),public_key:E.string().optional()}),authenticator_attachment:E.string().optional(),client_extension_results:E.object({app_id:E.boolean().optional(),cred_props:E.object({rk:E.boolean().optional()}).optional(),hmac_create_secret:E.boolean().optional()}),type:E.literal("public-key")}),Rr=E.object({relying_party:E.string().url().optional(),token:E.string().optional()}).strict(),Dr=E.object({relying_party:E.string().url().optional(),options:Pr}).strict(),Nr=E.object({relying_party:E.string().url().optional(),options:jr}).strict(),Ur=E.object({relying_party:E.string().url().optional(),authenticator_response:Cr}).strict(),Lr=E.object({relying_party:E.string().url().optional(),challenge:E.string(),authenticator_response:wr}).strict(),Mr=E.object({credential_id:E.string()}),Wr=E.object({relying_party:E.string().url().optional()}).strict(),xr=E.object({options:Pr}).strict(),Fr=E.object({authenticator_response:wr,relying_party:E.string().url().optional()}).strict(),Gr=E.object({credential_ids:E.array(E.string())});var Vr={};L(Vr,"ExternalOAuthProvider",(()=>Hr)),L(Vr,"OAuthProvider",(()=>Yr)),L(Vr,"AuthenticateOauthInput",(()=>qr)),L(Vr,"OAuthInitInput",(()=>Kr)),L(Vr,"LinkOAuthInput",(()=>$r)),L(Vr,"OAuthUnlinkInput",(()=>zr)),L(Vr,"OAuthInitResponse",(()=>Xr)),L(Vr,"OAuthLinkResponse",(()=>Jr)),L(Vr,"TransferOAuthInput",(()=>Qr)),L(Vr,"SUPPORTED_OAUTH_PROVIDERS",(()=>Br));let Br=["google","discord","twitter","github","spotify","instagram","tiktok","linkedin","apple"],Hr=A.enum(Br,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Yr=Hr.or(A.custom((e=>"string"==typeof e&&/^privy:[a-z0-9]{25}$/i.test(e)),{message:"Please specify a supported provider."})),qr=A.object({authorization_code:A.string(),state_code:A.string(),code_verifier:A.string().min(43).max(128).optional(),code_type:A.enum(["raw"]).optional()}).merge(Vt).catch((()=>{throw new D("Please specify authorization_code and state_code.",w.INVALID_CREDENTIALS)})),Kr=A.object({redirect_to:A.string({required_error:"Please provide a redirect_to value."}),provider:Yr,token:A.string().optional(),state_code:A.string().optional(),code_challenge:A.string().optional()}),$r=A.object({authorization_code:A.string(),state_code:A.string(),code_verifier:A.string().min(43).max(128).optional(),code_type:A.enum(["raw"]).optional()}),zr=A.object({subject:A.string(),provider:Yr}),Xr=A.object({url:A.string()}),Jr=Bn.extend({oauth_tokens:Vn.optional()}),Qr=ba.extend({userInfo:A.object({subject:A.string(),name:A.string().optional(),username:A.string().optional(),profilePictureUrl:A.string().optional(),email:A.string().optional(),vanityName:A.string().optional()})});var Zr={};L(Zr,"AuthorizationCodeInput",(()=>ei));let ei=A.object({redirect_to:A.string(),state:A.string(),code_challenge:A.string()});var ti={};L(ti,"EmptyObject",(()=>ai)),L(ti,"SuccessObject",(()=>ni));let ai=A.record(A.string(),A.never()),ni=A.object({success:A.boolean()});var ri={};L(ri,"RecoveryKeyMaterialInput",(()=>ii)),L(ri,"RecoveryKeyMaterialResponse",(()=>oi)),L(ri,"OAuthAuthenticateRecoveryResponse",(()=>si)),L(ri,"OAuthInitRecoveryInput",(()=>li)),L(ri,"OAuthInitICloudRecoveryInput",(()=>ci)),L(ri,"OAuthCallbackICloudExpoInput",(()=>pi)),L(ri,"OAuthCallbackICloudExpoResponse",(()=>di)),L(ri,"RecoveryConfigurationICloudInput",(()=>ui)),L(ri,"RecoveryConfigurationICloudResponse",(()=>_i));let ii=A.object({chain_type:A.string().optional()}),oi=A.object({recovery_type:A.enum(["user_passcode_derived_recovery_key","privy_passcode_derived_recovery_key","privy_generated_recovery_key","google_drive_recovery_secret","icloud_recovery_secret"]),recovery_key_derivation_salt:A.string(),recovery_code:A.string(),recovery_key:A.string(),file_id:A.string(),icloud_record_name:A.string()}),si=A.object({access_token:A.string()}),li=A.object({redirect_to:A.string({required_error:"Please provide a redirect_to value."}),token:A.string().optional(),state_code:A.string().optional(),code_challenge:A.string().optional()}),ci=A.object({client_type:A.enum(["web","expo-ios"])}),pi=A.object({ckWebAuthToken:A.string()}).transform((e=>({ckWebAuthToken:e.ckWebAuthToken}))).catch((()=>{throw new D("Missing ckWebAuthToken.",w.INVALID_DATA)})),di=ai,ui=A.object({client_type:A.enum(["web","expo-ios"])}),_i=A.object({api_token:A.string(),container_identifier:A.string(),environment:A.string()});var mi={};L(mi,"SiweInput",(()=>gi)),L(mi,"SmartWalletSiweInput",(()=>bi)),L(mi,"AuthenticateSiweInput",(()=>hi)),L(mi,"SiweAddressInput",(()=>yi)),L(mi,"SiweInitInput",(()=>vi)),L(mi,"SiweNonce",(()=>Ii)),L(mi,"TransferSiweInput",(()=>fi));let gi=A.object({message:A.string({invalid_type_error:"Invalid SIWE message"}),signature:A.string({invalid_type_error:"Invalid SIWE signature"}),chainId:A.string().max(41).nullable().default(null),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)}),bi=A.object({message:A.string({invalid_type_error:"Invalid SIWE message"}),signature:A.string({invalid_type_error:"Invalid SIWE signature"}),smart_wallet_type:Za}),hi=gi.merge(Vt),yi=A.object({address:Lt}),vi=A.object({address:Lt,token:A.string().optional()}),Ii=A.object({nonce:A.string(),address:A.string(),expires_at:A.string()}),fi=ba.extend({address:Lt,chainId:A.string().max(41).nullable().default(null),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)});var Si={};L(Si,"SiwsInput",(()=>Ti)),L(Si,"AuthenticateSiwsInput",(()=>Ei)),L(Si,"SiwsAddressInput",(()=>Ai)),L(Si,"SiwsInitInput",(()=>ki)),L(Si,"SiwsNonce",(()=>Oi));let Ti=A.object({message:A.string({invalid_type_error:"Invalid SIWS message"}),signature:A.string({invalid_type_error:"Invalid SIWS signature"}),walletClientType:A.string().max(64).nullable().default(null),connectorType:A.string().max(64).nullable().default(null)}),Ei=Ti.merge(Vt),Ai=A.object({address:Mt}),ki=A.object({address:Mt,token:A.string().optional()}),Oi=A.object({nonce:A.string(),address:A.string(),expires_at:A.string()});var Pi={};L(Pi,"VerifyPhoneInput",(()=>ji)),L(Pi,"AuthenticatePhoneInput",(()=>wi)),L(Pi,"PasswordlessSmsPhoneInput",(()=>Ci)),L(Pi,"UnlinkPhoneInput",(()=>Ri)),L(Pi,"UpdatePhoneInput",(()=>Di)),L(Pi,"TransferPhoneInput",(()=>Ni));let ji=A.object({code:Ut.catch((()=>{throw new N("Invalid SMS verification code",w.INVALID_CREDENTIALS)})),phoneNumber:Wt.catch((()=>{throw new N("Invalid phone number",w.INVALID_CREDENTIALS)}))}),wi=ji.merge(Vt),Ci=A.object({phoneNumber:Wt.catch((()=>{throw new N("Invalid phone number, not formatted correctly",w.INVALID_DATA)})),token:A.string().optional()}),Ri=A.object({phoneNumber:Wt}),Di=A.object({old_phone_number:Wt,new_phone_number:Wt,code:Ut}),Ni=ba.extend({phoneNumber:Wt});var Ui={};L(Ui,"TelegramAuthenticateInput",(()=>Mi)),L(Ui,"TelegramLinkInput",(()=>Wi)),L(Ui,"TelegramUnlinkInput",(()=>xi)),L(Ui,"TransferTelegramInput",(()=>Fi));let Li=E.object({id:E.coerce.number(),first_name:E.string(),auth_date:E.coerce.number(),hash:E.string(),username:E.string().optional(),last_name:E.string().optional(),photo_url:E.string().optional()}),Mi=E.object({captcha_token:E.string().optional(),telegram_auth_result:Li.optional(),telegram_web_app_data:E.object({query_id:E.string().optional(),auth_date:E.coerce.number(),hash:E.string(),user:E.string(),chat_instance:E.string().optional(),chat_type:E.string().optional(),start_param:E.string().optional(),signature:E.string().optional()}).optional()}).merge(Vt),Wi=Mi.omit({telegram_web_app_data:!0}).required({telegram_auth_result:!0}),xi=E.object({telegram_user_id:E.string()}),Fi=ba.extend({telegram_auth_result:Li});var Gi={};L(Gi,"RefreshTokenInput",(()=>Vi)),L(Gi,"OptionalRefreshTokenInput",(()=>Bi)),L(Gi,"ForkedToken",(()=>Hi));let Vi=A.object({refresh_token:A.string()}),Bi=Vi.partial(),Hi=A.object({token:A.string(),refresh_token:A.string(),new_session_refresh_token:A.string()});var Yi={};L(Yi,"DelegatedActionsConsentInput",(()=>qi));let qi=A.object({encrypted_tee_share:A.string(),app_share:A.string(),delegated_addresses:A.array(A.object({chain_type:A.union([A.literal("solana"),A.literal("ethereum")]),address:A.string(),wallet_index:A.number().default(0)}))});var Ki={};L(Ki,"CAIP2",(()=>$i)),L(Ki,"AuthorizationKeyRole",(()=>Ji)),L(Ki,"WalletApiSolanaSignTransactionRpcInput",(()=>Qi)),L(Ki,"WalletApiSolanaSignAndSendTransactionRpcInput",(()=>Zi)),L(Ki,"WalletApiSolanaSignMessageRpcInput",(()=>eo)),L(Ki,"UnsignedEthereumTransaction",(()=>no)),L(Ki,"WalletApiEthereumSignTransactionRpcInput",(()=>ro)),L(Ki,"WalletApiEthereumSendTransactionRpcInput",(()=>io)),L(Ki,"WalletApiEthereumPersonalSignRpcInputParams",(()=>oo)),L(Ki,"WalletApiEthereumPersonalSignRpcInput",(()=>so)),L(Ki,"WalletApiEthereumSignTypedDataRpcInput",(()=>lo)),L(Ki,"WalletApiEthereumRpcInput",(()=>co)),L(Ki,"WalletApiSolanaRpcInput",(()=>po)),L(Ki,"WalletApiRpcInput",(()=>uo)),L(Ki,"WalletApiSolanaSignTransactionRpcResponse",(()=>_o)),L(Ki,"WalletApiSolanaSignAndSendTransactionRpcResponse",(()=>mo)),L(Ki,"WalletApiSolanaSignMessageRpcResponse",(()=>go)),L(Ki,"WalletApiEthereumSignTransactionRpcResponse",(()=>bo)),L(Ki,"WalletApiEthereumSendTransactionRpcResponse",(()=>ho)),L(Ki,"WalletApiEthereumPersonalSignRpcResponse",(()=>yo)),L(Ki,"WalletApiEthereumSignTypedDataRpcResponse",(()=>vo)),L(Ki,"WalletApiRpcResponse",(()=>Io)),L(Ki,"WalletApiRegisterAuthorizationKeyInput",(()=>fo)),L(Ki,"WalletResponse",(()=>To)),L(Ki,"WalletApiCreateInput",(()=>Eo)),L(Ki,"WalletIdFromPath",(()=>Ao)),L(Ki,"WalletApiRevokeAuthorizationKeyInput",(()=>ko));let $i=A.string().regex(/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/,"Chain ID must be a valid CAIP-2 chain ID, e.g. 'eip155:1'"),zi=A.object({address:Mt.optional(),chain_type:A.literal("solana").optional()}),Xi=A.object({address:Lt.optional(),chain_type:A.literal("ethereum").optional()}),Ji=A.enum(["root","manager"]).nullable(),Qi=A.object({method:A.literal("signTransaction"),params:A.object({transaction:A.string(),encoding:A.literal("base64")})}).merge(zi),Zi=A.object({method:A.literal("signAndSendTransaction"),caip2:$i,params:A.object({transaction:A.string(),encoding:A.literal("base64")})}).merge(zi),eo=A.object({method:A.literal("signMessage"),params:A.object({message:A.string(),encoding:A.literal("base64")})}).merge(zi),to=A.string().startsWith("0x"),ao=A.union([to,A.number()]),no=A.object({from:Lt.optional(),to:Lt.optional(),chain_id:ao.optional(),nonce:ao.optional(),data:to.optional(),value:ao.optional(),type:A.union([A.literal(0),A.literal(1),A.literal(2)]).optional(),gas_limit:ao.optional(),gas_price:ao.optional(),max_fee_per_gas:ao.optional(),max_priority_fee_per_gas:ao.optional()}),ro=A.object({method:A.literal("eth_signTransaction"),params:A.object({transaction:no})}).merge(Xi),io=A.object({method:A.literal("eth_sendTransaction"),caip2:$i,params:A.object({transaction:no})}).merge(Xi),oo=A.object({message:A.string(),encoding:A.union([A.literal("utf-8"),A.literal("hex")])}),so=A.object({method:A.literal("personal_sign"),params:oo}).merge(Xi),lo=A.object({method:A.literal("eth_signTypedData_v4"),params:A.object({typed_data:A.object({domain:A.record(A.string(),A.any()),types:A.record(A.string(),A.any()),message:A.record(A.string(),A.any()),primary_type:A.string()})})}).merge(Xi),co=A.discriminatedUnion("method",[ro,io,so,lo]),po=A.discriminatedUnion("method",[Qi,Zi,eo]),uo=A.union([co,po]),_o=A.object({method:A.literal("signTransaction"),data:A.object({signed_transaction:A.string(),encoding:A.literal("base64")})}),mo=A.object({method:A.literal("signAndSendTransaction"),data:A.object({hash:A.string(),caip2:$i}).optional(),error:A.object({code:A.string(),message:A.string()}).optional()}),go=A.object({method:A.literal("signMessage"),data:A.object({signature:A.string(),encoding:A.literal("base64")})}),bo=A.object({method:A.literal("eth_signTransaction"),data:A.object({signed_transaction:A.string(),encoding:A.literal("rlp")})}),ho=A.object({method:A.literal("eth_sendTransaction"),data:A.object({hash:A.string(),caip2:$i}).optional(),error:A.object({code:A.string(),message:A.string()}).optional()}),yo=A.object({method:A.literal("personal_sign"),data:A.object({signature:A.string(),encoding:A.literal("hex")})}),vo=A.object({method:A.literal("eth_signTypedData_v4"),data:A.object({signature:A.string(),encoding:A.literal("hex")})}),Io=A.discriminatedUnion("method",[_o,mo,go,bo,ho,yo,vo]),fo=A.object({public_key:A.string(),role:Ji.optional()}),So=A.union([A.literal("solana"),A.literal("ethereum")]),To=A.object({id:A.string(),address:A.string(),chain_type:So}),Eo=A.object({chain_type:So,policy_id:A.string().optional()}),Ao=A.object({wallet_id:A.string({required_error:"Wallet ID must be provided",invalid_type_error:"Wallet ID is not a valid string"}).min(1)}).catch((({error:e})=>{throw new R(e.message,w.INVALID_DATA)})),ko=A.object({id:A.string()});var Oo={};L(Oo,"MoonpayOnRampSignInput",(()=>Do)),L(Oo,"MoonpayOnRampSignResponse",(()=>No));let Po=A.enum(["ach_bank_transfer","credit_debit_card","gbp_bank_transfer","gbp_open_banking_payment","mobile_wallet","sepa_bank_transfer","sepa_open_banking_payment","pix_instant_payment","yellow_card_bank_transfer"]),jo=A.enum(["AVAX_CCHAIN","CELO_CELO","CUSD_CELO","DAI_ETHEREUM","ETH_ETHEREUM","ETH_ARBITRUM","ETH_OPTIMISM","ETH_POLYGON","ETH_BASE","FIL_FVM","MATIC_ETHEREUM","MATIC_POLYGON","USDC_ETHEREUM","USDC_ARBITRUM","USDC_OPTIMISM","USDC_POLYGON","USDC_BASE","USDT_ETHEREUM","USDT_POLYGON","WETH_POLYGON","WBTC_ETHEREUM","BNB_BNB","BNB_BSC","CELO","CUSD","DAI","ETH","FIL","MATIC","USDC","USDT","WETH","WBTC"]),wo=A.object({quoteCurrencyAmount:A.number().optional(),email:Nt.optional(),paymentMethod:Po.optional(),uiConfig:A.object({accentColor:A.string().optional(),theme:A.enum(["light","dark"]).optional()}).optional()}),Co=A.object({address:Lt,config:wo.extend({currencyCode:jo.transform((e=>{switch(e){case"AVAX_CCHAIN":return"AVAX_CCHAIN";case"CELO_CELO":return"CELO";case"CUSD_CELO":return"CUSD";case"DAI_ETHEREUM":return"DAI";case"ETH_ETHEREUM":return"ETH";case"ETH_ARBITRUM":return"ETH_ARBITRUM";case"ETH_OPTIMISM":return"ETH_OPTIMISM";case"ETH_POLYGON":return"ETH_POLYGON";case"ETH_BASE":return"ETH_BASE";case"FIL_FVM":return"FIL";case"MATIC_ETHEREUM":return"MATIC";case"MATIC_POLYGON":return"MATIC_POLYGON";case"USDC_ETHEREUM":return"USDC";case"USDC_ARBITRUM":return"USDC_ARBITRUM";case"USDC_OPTIMISM":return"USDC_OPTIMISM";case"USDC_POLYGON":return"USDC_POLYGON";case"USDC_BASE":return"USDC_BASE";case"USDT_ETHEREUM":return"USDT";case"USDT_POLYGON":return"USDT_POLYGON";case"WETH_POLYGON":return"WETH";case"WBTC_ETHEREUM":return"WBTC";case"BNB_BNB":return"BNB";case"BNB_BSC":return"BNB_BSC";case"CELO":case"CUSD":case"DAI":case"ETH":case"FIL":case"MATIC":case"USDC":case"USDT":case"WETH":case"WBTC":return e;default:throw Error(`Invalid currency code: ${e}`)}})).optional()})}),Ro=A.object({address:Mt,config:wo.extend({currencyCode:A.enum(["SOL","USDC_SOL"]).optional()})}),Do=A.union([Co,Ro]).and(A.object({useSandbox:A.boolean().optional().default(!1)})),No=A.object({signedUrl:A.string(),externalTransactionId:A.string()});U(Pt,jt),U(Pt,Ct),U(Pt,qt),U(Pt,Kt),U(Pt,aa),U(Pt,Rt),U(Pt,da),U(Pt,$t),U(Pt,_a),U(Pt,ga),U(Pt,Ta),U(Pt,ka),U(Pt,Wa),U(Pt,Va),U(Pt,Ha),U(Pt,br),U(Pt,kr),U(Pt,Vr),U(Pt,Zr),U(Pt,ti),U(Pt,Or),U(Pt,ri),U(Pt,mi),U(Pt,Si),U(Pt,Pi),U(Pt,qa),U(Pt,Ui),U(Pt,Gi),U(Pt,Ya),U(Pt,Yi),U(Pt,Ki),U(Pt,Oo);let Uo={address:S,version:"0.6"},Lo={address:T,version:"0.7"},Mo=({owner:e,smartWalletType:t,publicClient:a})=>{switch(t){case Ka:return v({client:a,entryPoint:Lo,owners:[e],version:"1.4.1"});case $a:return y({client:a,version:"0.3.1",entryPoint:Lo,owners:[e]});case za:return h({client:a,owners:[e],entryPoint:Uo});case Xa:return b({client:a,entryPoint:Uo,owner:e,version:"1.1.0"});case Ja:return async function({client:e,owner:t}){let[a]=await t.request({method:"eth_accounts"});if(!a)throw Error("Unable to request embedded owner for eth_accounts");return await f({client:e,owners:[{type:"local",source:"privy",address:a,sign:async({hash:e})=>await t.request({method:"secp256k1_sign",params:[e]})}]})}({client:a,owner:e});default:throw Error(`Invalid smart account type: ${t}.`)}},Wo=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const xo=({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}))),Fo=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 Mo({owner:e,smartWalletType:t,publicClient:r}),c=I({transport:n(i),entryPoint:l.entryPoint}),p=o?I({transport:n(o),entryPoint:l.entryPoint}):void 0;return g({account:l,chain:a,paymaster:p,paymasterContext:s,bundlerTransport:n(i),userOperation:{estimateFeesPerGas:async()=>{if(Wo.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},Go=({clientConfig:n,smartWalletsConfig:r})=>{let{noPromptOnSignature:c,openPrivyModal:g,appId:b}=o(),h=p(),{setModalData:y}=u(),{user:v}=s(),{chains:I}=p(),{chainId:f,clients:S,setChainId:T,chainIdState:E}=(()=>{let a=e(),[n,r]=t();return{clients:e({}),setChainId:e=>{a.current=e,r(e)},chainId:a,chainIdState:n}})(),A=I.find((e=>e.id===E)),{wallets:k}=d(),O=a((async()=>f.current),[f]),P=a((async({id:e})=>{if(!S.current[e]){let t=_(k),a=await Fo({chain:I.find((t=>t.id===e)),embeddedWallet:t,user:v,paymasterContext:n?.paymasterContext,smartWalletsConfig:r,rpcConfig:h.rpcConfig,privyAppId:b});a&&(S.current[e]=a)}T(e)}),[I,n,k,v,r]);return{wrapSmartAccountClient:e=>{S.current[e.chain.id]=e,E||T(e.chain.id);return{...e,sendTransaction:async e=>{let t=void 0===h.embeddedWallets.showWalletUIs?h.embeddedWallets.noPromptOnSignature:!h.embeddedWallets.showWalletUIs,a=S.current[f.current];if(!a)throw new i(`Smart wallet client for chain (eip155:${f.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:xo({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[f.current];if(!a)throw new i(`Smart wallet client for chain (eip155:${f.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[f.current];if(!a)throw new i(`Smart wallet client for chain (eip155:${f.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:O,chain:A,switchChain:P}}}};export{xo as c,Fo as g,Go as u};
@@ -1 +0,0 @@
1
- import{c as e,b as t,C as a,u as s,j as n,o as r,P as i}from"./privy-context-CrcnzDDK.mjs";import o from"eventemitter3";import{ErrorCode as l}from"@ethersproject/logger";var d,c;(c=d||(d={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",c.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",c.INVALID_DATA="invalid_data",c.LINKED_TO_ANOTHER_USER="linked_to_another_user",c.ALLOWLIST_REJECTED="allowlist_rejected",c.OAUTH_USER_DENIED="oauth_user_denied",c.UNKNOWN_AUTH_ERROR="unknown_auth_error",c.USER_EXITED_AUTH_FLOW="exited_auth_flow",c.MUST_BE_AUTHENTICATED="must_be_authenticated",c.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",c.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",c.CLIENT_REQUEST_TIMEOUT="client_request_timeout",c.INVALID_CREDENTIALS="invalid_credentials";class _ extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=a}}class E extends _{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let u={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};class h extends E{constructor(e){super(e.message,e.code,e.data);let t=Object.values(u).find((t=>t.eipCode===e.code));this.details=t||u.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=u.E32002_CONNECTION_ALREADY_PENDING:this.details=u.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=u.E32002_WALLET_LOCKED))}}class p extends e{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class y extends e{constructor(){super("User rejected connection"),this.type="wallet_error"}}const T=t=>{if(t instanceof e)return t;if(t?.code&&t?.reason){let e=new C(t);return t.code===l.ACTION_REJECTED&&(e.details=u.E4001_USER_REJECTED_REQUEST),e}return t?.code?new C(t):new e("Unknown connector error",t)};class m extends t{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class C extends m{constructor(e){super(e.message,e.code,e.data);let t=Object.values(u).find((t=>t.eipCode===e.code));this.details=t||u.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=u.E32002_CONNECTION_ALREADY_PENDING:this.details=u.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=u.E32002_WALLET_LOCKED))}}const g={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...u};class w extends o{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const R=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","crypto.com_wallet_extension","crypto.com_onchain","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","privy","unknown","phantom","solflare","glow"];function N(e){return"solana"===e.chainType}function A(e){return"solana"===e.type}class b extends w{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(e,t){let s,n,r;if("Installed"!==e.readyState||!e.publicKey)throw Error("Wallet is not connected.");return"signMessage"in e&&(s=async(...t)=>{if(!e.connected)throw Error("Wallet is not connected.");return await e.signMessage(t[0])}),"sendTransaction"in e&&(n=async(...t)=>await e.sendTransaction(t[0],t[1],t[2])),"signTransaction"in e&&(r=async t=>await e.signTransaction(t)),{type:"solana",address:e.publicKey.toBase58(),meta:t,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>e.connected,disconnect:()=>{try{e.disconnect()}catch(e){console.error("Wallet does not support programmatic disconnect")}},getProvider:a(`${this.walletClientType||""} wallet does not support 'getProvider'`),signMessage:s??a(`${this.walletClientType||""} wallet does not support 'signMessage'`),sendTransaction:n??a(`${this.walletClientType||""} wallet does not support 'sendTransaction'`),signTransaction:r??a(`${this.walletClientType||""} wallet does not support 'signTransaction'`)}}async syncAccounts(){if("Installed"===this.adapter.readyState&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((e=>this.adapter.publicKey&&e.address===this.adapter.publicKey.toBase58()))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,t){super(function(e){return R.includes(e)}(e.name.toLowerCase())?e.name.toLowerCase():"unknown"),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then((()=>this.onDisconnect())).catch((e=>console.error("Error disconnecting",e)))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(e){throw T(e)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=e=>{this.syncAccounts()},this.onError=e=>{this.syncAccounts()},this.onReadyStateChange=e=>{"Installed"!==e&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.shouldAutoConnect=t,this.wallets=[]}}const D=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:a,solanaWallets:o,delegateWallet:l}=s(),{user:d}=n();return{createWallet:a,exportWallet:t,delegateWalletAction:async()=>{let e=r(d);if(!e)throw new i("User must have a solana wallet in order to delegate actions");return await l({address:e.address,chainType:"solana"})},wallets:o.concat(e?[e]:[])}};export{g as C,C as P,h as R,b as S,y as U,p as W,w as a,m as b,A as c,T as f,N as i,u as n,D as u};