@privy-io/react-auth 1.88.4 → 1.88.5-beta-20241007195314

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("./useWallets.js"),a=require("./privy-context.js"),n=require("./getEmbeddedConnectedWallet.js"),i=require("permissionless"),s=require("permissionless/accounts"),o=require("permissionless/clients/pimlico"),l=require("viem"),c=require("viem/account-abstraction");require("tinycolor2"),require("ofetch");let u=({calls:e,chain:t,maxPriorityFeePerGas:r,maxFeePerGas:a,nonce:n})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:n,maxFeePerGas:a,maxPriorityFeePerGas:r})));let d={address:c.entryPoint06Address,version:"0.6"},m={address:c.entryPoint07Address,version:"0.7"},y=async({owner:e,smartWalletType:t,chain:r,bundlerUrl:a,paymasterUrl:n,paymasterContext:c})=>{let u=l.createPublicClient({chain:r,transport:l.http()}),y=await(({owner:e,smartWalletType:t,chain:r})=>{let a=l.createPublicClient({chain:r,transport:l.http()});switch(t){case"safe":return s.toSafeSmartAccount({client:a,entryPoint:m,owners:[e],version:"1.4.1"});case"kernel":return s.toEcdsaKernelSmartAccount({client:a,version:"0.3.1",entryPoint:m,owners:[e]});case"biconomy":return s.toBiconomySmartAccount({client:a,owners:[e],entryPoint:d});case"light_account":return s.toLightSmartAccount({client:a,entryPoint:d,owner:e,version:"1.1.0"});default:throw Error(`Invalid smart account type: ${t}.`)}})({owner:e,smartWalletType:t,chain:r}),p=n?o.createPimlicoClient({transport:l.http(n),entryPoint:y.entryPoint}):void 0;return i.createSmartAccountClient({account:y,chain:r,paymaster:p,paymasterContext:c,bundlerTransport:l.http(a),userOperation:{estimateFeesPerGas:async()=>{let e=await u.estimateFeesPerGas();return{...e,maxFeePerGas:125n*e.maxFeePerGas/100n,maxPriorityFeePerGas:125n*e.maxPriorityFeePerGas/100n}}}})};let p=t.createContext({client:void 0});let g=t.createContext({config:void 0}),P=()=>{let{config:e}=t.useContext(g);return{config:e}},E=({children:r})=>{let[n,i]=t.useState(void 0),{client:s}=a.usePrivyInternal();return t.useEffect((()=>{!n&&s&&(async()=>{try{if(!s)return void console.warn("No client found");let e=await s.getSmartWalletsConfig();i(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!s]),e.jsx(g.Provider,{value:{config:n},children:r})},h=({config:i,children:s})=>{let{config:o}=P(),{defaultChain:l}=r.useAppConfig(),[c]=t.useState(l),{wallets:u}=r.useWallets(),{user:d}=a.usePrivy(),[m,p]=t.useState(),g=n.getEmbeddedConnectedWallet(u);return t.useEffect((()=>{(async()=>{if(!o?.enabled||!d||!g)return void p(void 0);if(m&&m.chain.id===c.id)return;let e=o.configuredNetworks.find((e=>e.chainId===`eip155:${c.id}`));if(!e)throw new a.PrivyClientError(`The chain ${c.name} (eip155:${c.id}) must be configured in the smart wallet configuration in your dashboard`);let t=d.smartWallet?.smartWalletType??o.smartWalletType;try{let r=await(async(e,t,r,a,n)=>{let i=await e.getEthereumProvider();return await y({owner:i,smartWalletType:r,chain:t,paymasterContext:n,...a})})(g,c,t,e,i?.paymasterContext);p(r)}catch(e){console.error("Error loading smart wallet:",e)}})()}),[!!o?.enabled,!!d?.smartWallet,!!g]),e.jsx(v.Provider,{value:{client:m},children:s})},v=t.createContext({client:void 0}),S=({children:i})=>{let{client:s}=(()=>{let{client:e}=t.useContext(v);return{client:e}})(),{config:o}=P(),{wrapSmartAccountClient:l}=(()=>{let{noPromptOnSignature:e,openPrivyModal:t}=a.usePrivyInternal(),i=r.useAppConfig(),{setModalData:s}=n.usePrivyModal();return{wrapSmartAccountClient:r=>{let{sendTransaction:a,signMessage:o,signTypedData:l,...c}=r;return{...c,sendTransaction:async r=>{if(i.embeddedWallets.noPromptOnSignature||e.current)return await a(r);let o=[];"calls"in r&&void 0!==r.calls?o=[...r.calls]:"to"in r&&(o=[{to:r.to,value:r.value||BigInt(0),data:r.data||"0x"}]);let l=async()=>{if(!c.paymaster)return!1;let{paymasterAndData:e,paymasterData:t}=await c.prepareUserOperation({calls:o,maxFeePerGas:r.maxFeePerGas,maxPriorityFeePerGas:r.maxPriorityFeePerGas,nonce:r.nonce?BigInt(r.nonce):void 0});return Number(e??t??0)>0};return new Promise((async(i,d)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:u({calls:o,chain:c.chain,maxPriorityFeePerGas:r.maxPriorityFeePerGas,maxFeePerGas:r.maxFeePerGas,nonce:r.nonce?BigInt(r.nonce):void 0}),rootWallet:{address:c.account.address},transactingWallet:{address:c.account.address,walletIndex:null},getIsSponsored:l,onConfirm:()=>a(r),onSuccess:e=>i(e.hash),onFailure:d,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signMessage:async({message:r})=>i.embeddedWallets.noPromptOnSignature||e.current?await o({message:r}):new Promise((async(a,i)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:r,confirmAndSign:()=>o({message:r}),onSuccess:e=>a(e),onFailure:i,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1})),signTypedData:async r=>e.current?await l(r):new Promise((async(a,i)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:r,confirmAndSign:()=>l(r),onSuccess:e=>a(e),onFailure:i,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))}}}})(),{user:c}=a.usePrivy(),{generateSiweMessageForSmartWallet:d,linkSmartWallet:m,noPromptOnSignature:y}=a.usePrivyInternal();return t.useEffect((()=>{(async()=>{if(s&&!c?.smartWallet&&o?.enabled)try{let e=await d({address:s.account.address,chainId:`eip155:${s.chain.id}`});y.current=!0;let t=await s.signMessage({message:e});await m({signature:t,message:e,smartWalletType:o.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{y.current=!1}})()}),[!!s,!!c?.smartWallet,!!o?.enabled]),e.jsx(p.Provider,{value:{client:c?.smartWallet&&s?l(s):void 0},children:i})};exports.SmartWalletsProvider=({config:t,children:r})=>e.jsx(E,{children:e.jsx(h,{config:t,children:e.jsx(S,{children:r})})}),exports.useSmartWallets=()=>{let{client:e}=t.useContext(p);return{client:e}};
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),a=require("./useWallets.js"),r=require("./privy-context.js"),n=require("./getEmbeddedConnectedWallet.js"),i=require("permissionless"),s=require("permissionless/accounts"),l=require("permissionless/clients/pimlico"),o=require("viem"),c=require("viem/account-abstraction");require("tinycolor2"),require("ofetch");let d=({calls:e,chain:t,maxPriorityFeePerGas:a,maxFeePerGas:r,nonce:n})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:n,maxFeePerGas:r,maxPriorityFeePerGas:a})));let u={address:c.entryPoint06Address,version:"0.6"},m={address:c.entryPoint07Address,version:"0.7"},y=async({owner:e,smartWalletType:t,chain:a,bundlerUrl:r,paymasterUrl:n,paymasterContext:c})=>{let d=o.createPublicClient({chain:a,transport:o.http()}),y=await(({owner:e,smartWalletType:t,chain:a})=>{let r=o.createPublicClient({chain:a,transport:o.http()});switch(t){case"safe":return s.toSafeSmartAccount({client:r,entryPoint:m,owners:[e],version:"1.4.1"});case"kernel":return s.toEcdsaKernelSmartAccount({client:r,version:"0.3.1",entryPoint:m,owners:[e]});case"biconomy":return s.toBiconomySmartAccount({client:r,owners:[e],entryPoint:u});case"light_account":return s.toLightSmartAccount({client:r,entryPoint:u,owner:e,version:"1.1.0"});default:throw Error(`Invalid smart account type: ${t}.`)}})({owner:e,smartWalletType:t,chain:a}),p=n?l.createPimlicoClient({transport:o.http(n),entryPoint:y.entryPoint}):void 0;return i.createSmartAccountClient({account:y,chain:a,paymaster:p,paymasterContext:c,bundlerTransport:o.http(r),userOperation:{estimateFeesPerGas:async()=>{let e=await d.estimateFeesPerGas();return{...e,maxFeePerGas:125n*e.maxFeePerGas/100n,maxPriorityFeePerGas:125n*e.maxPriorityFeePerGas/100n}}}})};let p=t.createContext({client:void 0});let g=t.createContext({config:void 0}),P=()=>{let{config:e}=t.useContext(g);return{config:e}},E=({children:a})=>{let[n,i]=t.useState(void 0),{client:s}=r.usePrivyInternal();return t.useEffect((()=>{!n&&s&&(async()=>{try{if(!s)return void console.warn("No client found");let e=await s.getSmartWalletsConfig();i(e)}catch(e){console.warn("Error generating smart wallet config: ",e)}})()}),[!!s]),e.jsx(g.Provider,{value:{config:n},children:a})},h=({config:i,children:s})=>{let{config:l}=P(),{defaultChain:o}=a.useAppConfig(),[c]=t.useState(o),{wallets:d}=a.useWallets(),{user:u}=r.usePrivy(),[m,p]=t.useState(),g=n.getEmbeddedConnectedWallet(d);return t.useEffect((()=>{(async()=>{if(!l?.enabled||!u||!g)return void p(void 0);if(m&&m.chain.id===c.id)return;let e=l.configuredNetworks.find((e=>e.chainId===`eip155:${c.id}`));if(!e)throw new r.PrivyClientError(`The chain ${c.name} (eip155:${c.id}) must be configured in the smart wallet configuration in your dashboard`);let t=u.smartWallet?.smartWalletType??l.smartWalletType;try{let a=await(async(e,t,a,r,n)=>{let i=await e.getEthereumProvider();return await y({owner:i,smartWalletType:a,chain:t,paymasterContext:n,...r})})(g,c,t,e,i?.paymasterContext);p(a)}catch(e){console.error("Error loading smart wallet:",e)}})()}),[!!l?.enabled,!!u?.smartWallet,!!g]),e.jsx(v.Provider,{value:{client:m},children:s})},v=t.createContext({client:void 0}),W=({children:i})=>{let{client:s}=(()=>{let{client:e}=t.useContext(v);return{client:e}})(),{config:l}=P(),{wrapSmartAccountClient:o}=(()=>{let{noPromptOnSignature:e,openPrivyModal:t}=r.usePrivyInternal(),i=a.useAppConfig(),{setModalData:s}=n.usePrivyModal();return{wrapSmartAccountClient:a=>{let{sendTransaction:r,signMessage:l,signTypedData:o,...c}=a;return{...c,sendTransaction:async a=>{let l=void 0===i.embeddedWallets.showWalletUis?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUis,o=e.current;if(l||o)return await r(a);let u=[];"calls"in a&&void 0!==a.calls?u=[...a.calls]:"to"in a&&(u=[{to:a.to,value:a.value||BigInt(0),data:a.data||"0x"}]);let m=async()=>{if(!c.paymaster)return!1;let{paymasterAndData:e,paymasterData:t}=await c.prepareUserOperation({calls:u,maxFeePerGas:a.maxFeePerGas,maxPriorityFeePerGas:a.maxPriorityFeePerGas,nonce:a.nonce?BigInt(a.nonce):void 0});return Number(e??t??0)>0};return new Promise((async(i,l)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:d({calls:u,chain:c.chain,maxPriorityFeePerGas:a.maxPriorityFeePerGas,maxFeePerGas:a.maxFeePerGas,nonce:a.nonce?BigInt(a.nonce):void 0}),rootWallet:{address:c.account.address},transactingWallet:{address:c.account.address,walletIndex:null},getIsSponsored:m,onConfirm:()=>r(a),onSuccess:e=>i(e.hash),onFailure:l,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signMessage:async({message:a})=>{let r=void 0===i.embeddedWallets.showWalletUis?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUis,o=e.current;return r||o?await l({message:a}):new Promise((async(r,i)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:a,confirmAndSign:()=>l({message:a}),onSuccess:e=>r(e),onFailure:i,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))},signTypedData:async a=>{let r=void 0===i.embeddedWallets.showWalletUis?i.embeddedWallets.noPromptOnSignature:!i.embeddedWallets.showWalletUis,l=e.current;return r||l?await o(a):new Promise((async(r,i)=>{e.current=!0,s({connectWallet:{onCompleteNavigateTo:n.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:a,confirmAndSign:()=>o(a),onSuccess:e=>r(e),onFailure:i,uiOptions:{}}}),t(n.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{e.current=!1}))}}}}})(),{user:c}=r.usePrivy(),{generateSiweMessageForSmartWallet:u,linkSmartWallet:m,noPromptOnSignature:y}=r.usePrivyInternal();return t.useEffect((()=>{(async()=>{if(s&&!c?.smartWallet&&l?.enabled)try{let e=await u({address:s.account.address,chainId:`eip155:${s.chain.id}`});y.current=!0;let t=await s.signMessage({message:e});await m({signature:t,message:e,smartWalletType:l.smartWalletType})}catch(e){console.error("Error creating smart wallet:",e)}finally{y.current=!1}})()}),[!!s,!!c?.smartWallet,!!l?.enabled]),e.jsx(p.Provider,{value:{client:c?.smartWallet&&s?o(s):void 0},children:i})};exports.SmartWalletsProvider=({config:t,children:a})=>e.jsx(E,{children:e.jsx(h,{config:t,children:e.jsx(W,{children:a})})}),exports.useSmartWallets=()=>{let{client:e}=t.useContext(p);return{client:e}};
@@ -1 +1 @@
1
- "use strict";var e=require("./privy-context.js"),t=require("@ethersproject/logger"),a=require("eventemitter3"),s=require("./user.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,i,o=r(a);(i=n||(n={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",i.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",i.INVALID_DATA="invalid_data",i.LINKED_TO_ANOTHER_USER="linked_to_another_user",i.ALLOWLIST_REJECTED="allowlist_rejected",i.OAUTH_USER_DENIED="oauth_user_denied",i.UNKNOWN_AUTH_ERROR="unknown_auth_error",i.USER_EXITED_AUTH_FLOW="exited_auth_flow",i.MUST_BE_AUTHENTICATED="must_be_authenticated",i.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",i.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",i.CLIENT_REQUEST_TIMEOUT="client_request_timeout",i.INVALID_CREDENTIALS="invalid_credentials";class l 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 d extends l{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let c={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 E 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 u=a=>{if(a instanceof e.PrivyConnectorError)return a;if(a?.code&&a?.reason){let e=new p(a);return a.code===t.ErrorCode.ACTION_REJECTED&&(e.details=c.E4001_USER_REJECTED_REQUEST),e}return a?.code?new p(a):new e.PrivyConnectorError("Unknown connector error",a)};class h extends e.PrivyError{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class p extends h{constructor(e){super(e.message,e.code,e.data);let t=Object.values(c).find((t=>t.eipCode===e.code));this.details=t||c.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=c.E32002_CONNECTION_ALREADY_PENDING:this.details=c.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=c.E32002_WALLET_LOCKED))}}const y={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},...c};class C extends o.default{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const T=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","crypto.com_wallet_extension","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","privy","unknown","phantom","solflare","glow"];exports.ConnectorErrors=y,exports.E=c,exports.PrivyProviderRpcError=p,exports.ProviderRpcError=h,exports.SolanaWalletConnector=class extends C{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(t,a){let s,r,n;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&&(r=async(...e)=>await t.sendTransaction(e[0],e[1],e[2])),"signTransaction"in t&&(n=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.notImplemented,signMessage:s,sendTransaction:r,signTransaction:n}}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 T.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 u(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=C,exports.WalletTimeoutError=E,exports.formatConnectorError=u,exports.isBaseConnectedSolanaWallet=function(e){return"solana"===e.type},exports.isSolanaWalletConnector=function(e){return"solana"===e.chainType},exports.l=class extends d{constructor(e){super(e.message,e.code,e.data);let t=Object.values(c).find((t=>t.eipCode===e.code));this.details=t||c.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=c.E32002_CONNECTION_ALREADY_PENDING:this.details=c.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=c.E32002_WALLET_LOCKED))}},exports.useSolanaWallets=()=>{let{embeddedSolanaWallet:t,exportSolanaWallet:a,createEmbeddedSolanaWallet:r,solanaWallets:n,initDelegateAction:i}=e.usePrivyInternal(),{user:o}=e.usePrivy();return{createWallet:r,exportWallet:a,delegateWalletAction:async()=>{let t=s.getPrivySolanaWallet(o);if(!t)throw new e.PrivyClientError("User must have a solana wallet in order to delegate actions");return await i({address:t.address})},wallets:n.concat(t?[t]:[])}};
1
+ "use strict";var e=require("./privy-context.js"),t=require("@ethersproject/logger"),a=require("eventemitter3"),s=require("./user.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,i,o=r(a);(i=n||(n={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",i.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",i.INVALID_DATA="invalid_data",i.LINKED_TO_ANOTHER_USER="linked_to_another_user",i.ALLOWLIST_REJECTED="allowlist_rejected",i.OAUTH_USER_DENIED="oauth_user_denied",i.UNKNOWN_AUTH_ERROR="unknown_auth_error",i.USER_EXITED_AUTH_FLOW="exited_auth_flow",i.MUST_BE_AUTHENTICATED="must_be_authenticated",i.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",i.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",i.CLIENT_REQUEST_TIMEOUT="client_request_timeout",i.INVALID_CREDENTIALS="invalid_credentials";class l 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 d extends l{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let c={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 _ extends e.PrivyConnectorError{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class E extends e.PrivyConnectorError{constructor(){super("User rejected connection"),this.type="wallet_error"}}const u=a=>{if(a instanceof e.PrivyConnectorError)return a;if(a?.code&&a?.reason){let e=new p(a);return a.code===t.ErrorCode.ACTION_REJECTED&&(e.details=c.E4001_USER_REJECTED_REQUEST),e}return a?.code?new p(a):new e.PrivyConnectorError("Unknown connector error",a)};class h extends e.PrivyError{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class p extends h{constructor(e){super(e.message,e.code,e.data);let t=Object.values(c).find((t=>t.eipCode===e.code));this.details=t||c.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=c.E32002_CONNECTION_ALREADY_PENDING:this.details=c.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=c.E32002_WALLET_LOCKED))}}const y={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},...c};class C extends o.default{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const T=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","crypto.com_wallet_extension","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=y,exports.E=c,exports.PrivyProviderRpcError=p,exports.ProviderRpcError=h,exports.SolanaWalletConnector=class extends C{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(t,a){let s,r,n;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&&(r=async(...e)=>await t.sendTransaction(e[0],e[1],e[2])),"signTransaction"in t&&(n=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.notImplemented,signMessage:s,sendTransaction:r,signTransaction:n}}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 T.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 u(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=E,exports.WalletConnector=C,exports.WalletTimeoutError=_,exports.formatConnectorError=u,exports.isBaseConnectedSolanaWallet=function(e){return"solana"===e.type},exports.isSolanaWalletConnector=function(e){return"solana"===e.chainType},exports.l=class extends d{constructor(e){super(e.message,e.code,e.data);let t=Object.values(c).find((t=>t.eipCode===e.code));this.details=t||c.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=c.E32002_CONNECTION_ALREADY_PENDING:this.details=c.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=c.E32002_WALLET_LOCKED))}},exports.useSolanaWallets=()=>{let{embeddedSolanaWallet:t,exportSolanaWallet:a,createEmbeddedSolanaWallet:r,solanaWallets:n,initDelegateAction:i}=e.usePrivyInternal(),{user:o}=e.usePrivy();return{createWallet:r,exportWallet:a,delegateWalletAction:async()=>{let t=s.getPrivySolanaWallet(o);if(!t)throw new e.PrivyClientError("User must have a solana wallet in order to delegate actions");return await i({address:t.address})},wallets:n.concat(t?[t]:[])}};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(require("tinycolor2"));const a={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"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let n=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),l=e=>n.has(e),i=(e,t,r)=>r.indexOf(e)===t;const s=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(l).filter(i):e?e.filter(l).filter(i):a.appearance.walletList,p={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"}}},c={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"}}},u={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},d={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"}}},m={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},g={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},f={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},y={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"}}},b={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},w={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"}}},E={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},v={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},k={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"}}},x=[p,c,v,y,b,C,w,E,g,{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"}}},d,m,{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"}}},f,{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,u,k,{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"}}}],S=new Set(x.map((e=>e.id)));function O(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let A="#FFFFFF";function _(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function T({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=A;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=_(a,"light"===p?-.04:.11),h=_(a,"light"===p?-.88:.87),u=_(a,"light"===p?-.7:.75),d=_(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=_(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=_(n,.15),f=_(n,-.06),y=_(s,.3),b=_(i,.3),C=o.default(n.getLuminance()>.5?"#040217":A),w=_(l,-.16),E=_(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:C.toHslString(),success:l.toHslString(),successDark:w.toHslString(),successLight:E.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function U(e,t,r){let o,n,l,i,p,c,h,u,d,m,g,f,b,C,w,E,v=r?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),p=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),h=t.loginMethods.includes("discord"),d=t.loginMethods.includes("spotify"),m=t.loginMethods.includes("instagram"),u=t.loginMethods.includes("tiktok"),f=t.loginMethods.includes("github"),g=t.loginMethods.includes("linkedin"),b=t.loginMethods.includes("apple"),C=t.loginMethods.includes("farcaster"),w=t.loginMethods.includes("telegram")):(o=e.emailAuth,n=e.smsAuth,i=e.walletAuth,p=e.googleOAuth,c=e.twitterOAuth,h=e.discordOAuth,f=e.githubOAuth,d=e.spotifyOAuth,m=e.instagramOAuth,u=e.tiktokOAuth,g=e.linkedinOAuth,b=e.appleOAuth,C=e.farcasterAuth,w=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let k=[o,n].filter(Boolean),S=[p,c,h,f,d,m,u,g,b,C,w].filter(Boolean),A=[i].filter(Boolean);if(k.length+S.length+A.length===0)throw Error("You must enable at least one login method");let _=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;_&&0===A.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),_=!1):_||S.length+k.length!==0||(v("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),_=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let L=s({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),M=(({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 o of e.overflow??[])t.includes(o)||r.includes(o)?console.warn(`Duplicated login method: ${o}`):r.push(o);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),H=t?.intl?.defaultCountry??"US",{chains:F,defaultChain:P}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let a;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&&o&&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`."),a=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=x.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?O(e,r):e}))}else a=x.concat(e??[]);let n=t?a[0]:y,l=r??n;if(!a.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),I=!!t?.defaultChain,W=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=!(e.enforceWalletUis??1);if(E=e.legacyWalletUiConfig??1?W?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??R:R,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==E)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:K,...N}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??a.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:T({backgroundTheme:t?.appearance?.theme??a.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??a.appearance.accentColor}),loginGroupPriority:_?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:L,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:i,email:o,sms:n,passkey:l,google:p,twitter:c,discord:h,github:f,spotify:d,instagram:m,tiktok:u,linkedin:g,apple:b,farcaster:C,telegram:w},loginMethodsAndOrder:M,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??a.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??a.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??a.rpcConfig.rpcTimeouts},chains:F,defaultChain:P,intl:{defaultCountry:H},shouldEnforceDefaultChainOnConnect:I,captchaEnabled:e.captchaEnabled??a.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??a.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof K?{requireUserOwnedRecoveryOnCreate:K}:{},...W?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...N,noPromptOnSignature:E},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:W?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??a._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??a.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??a.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??a.fundingMethodConfig.moonpay.useSandbox}}}}let L={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,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const M=U(L,void 0,!1);let H=t.createContext({appConfig:M,isServerConfigLoaded:!1});const F=t.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.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=M,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=x,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.PrivyAppConfigProvider=({children:r,legacyCreateEmbeddedWalletFlag:o,client:a,clientConfig:n})=>{let[l,i]=t.useState(null),s=t.useMemo((()=>U(l??L,n,!!l)),[l,n]);return t.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:a,defaultChain:n,externalWallets:l,...i}=e;return{...i,...o?{additionalChains:o.map((e=>e.id))}:void 0,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(n,o),t=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let t,a=0;a<e.length;a++)r=Math.imul(r^(t=e.charCodeAt(a)),2654435761),o=Math.imul(o^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),r=`privy:sent:${l.id}:${t}`;localStorage.getItem(r)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(r,"t"))}),[n,o,l]),t.useEffect((()=>{l||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e.jsx(H.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:r})},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.TOKEN_COOKIE_KEY="privy-token",exports.TOKEN_STORAGE_KEY="privy:token",exports.UseWalletsContext=F,exports.VERSION="1.88.4",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=O,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!S.has(e.id)));return x.concat(t)},exports.arbitrum=p,exports.arbitrumSepolia=c,exports.avalanche=h,exports.avalancheFuji=u,exports.base=d,exports.baseSepolia=m,exports.celo=g,exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.linea=f,exports.mainnet=y,exports.optimism=b,exports.optimismSepolia=C,exports.polygon=w,exports.polygonAmoy=E,exports.sepolia=v,exports.useAppConfig=()=>{let{appConfig:e}=t.useContext(H);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=t.useContext(H);return e},exports.useWallets=function(){let e=t.useContext(F);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.zora=k;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=r(require("tinycolor2"));const a={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"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let n=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"]),l=e=>n.has(e),i=(e,t,r)=>r.indexOf(e)===t;const s=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(l).filter(i):e?e.filter(l).filter(i):a.appearance.walletList,p={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"}}},c={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"}}},u={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},d={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"}}},m={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},g={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},f={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},y={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"}}},b={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"}}},w={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},C={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"}}},E={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},v={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},k={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"}}},x=[p,c,v,y,b,w,C,E,g,{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"}}},d,m,{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"}}},f,{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,u,k,{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"}}}],S=new Set(x.map((e=>e.id)));function O(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let A="#FFFFFF";function _(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function T({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=A;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=_(a,"light"===p?-.04:.11),h=_(a,"light"===p?-.88:.87),u=_(a,"light"===p?-.7:.75),d=_(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=_(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),g=_(n,.15),f=_(n,-.06),y=_(s,.3),b=_(i,.3),w=o.default(n.getLuminance()>.5?"#040217":A),C=_(l,-.16),E=_(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:d.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:w.toHslString(),success:l.toHslString(),successDark:C.toHslString(),successLight:E.toHslString(),error:s.toHslString(),errorLight:y.toHslString(),warn:i.toHslString(),warnLight:b.toHslString()}}function U(e,t,r){let o,n,l,i,p,c,h,u,d,m,g,f,b,w,C,E,v=r?console.warn:()=>{};t?.loginMethods?(o=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),i=t.loginMethods.includes("wallet"),p=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),h=t.loginMethods.includes("discord"),d=t.loginMethods.includes("spotify"),m=t.loginMethods.includes("instagram"),u=t.loginMethods.includes("tiktok"),f=t.loginMethods.includes("github"),g=t.loginMethods.includes("linkedin"),b=t.loginMethods.includes("apple"),w=t.loginMethods.includes("farcaster"),C=t.loginMethods.includes("telegram")):(o=e.emailAuth,n=e.smsAuth,i=e.walletAuth,p=e.googleOAuth,c=e.twitterOAuth,h=e.discordOAuth,f=e.githubOAuth,d=e.spotifyOAuth,m=e.instagramOAuth,u=e.tiktokOAuth,g=e.linkedinOAuth,b=e.appleOAuth,w=e.farcasterAuth,C=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?l=!1:e.passkeyAuth&&(l=!0);let k=[o,n].filter(Boolean),S=[p,c,h,f,d,m,u,g,b,w,C].filter(Boolean),A=[i].filter(Boolean);if(k.length+S.length+A.length===0)throw Error("You must enable at least one login method");let _=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;_&&0===A.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),_=!1):_||S.length+k.length!==0||(v("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),_=!0);let U=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let L=s({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),M=(({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 o of e.overflow??[])t.includes(o)||r.includes(o)?console.warn(`Duplicated login method: ${o}`):r.push(o);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),H=t?.intl?.defaultCountry??"US",{chains:F,defaultChain:P}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:o}){let a;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&&o&&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`."),a=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=x.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?O(e,r):e}))}else a=x.concat(e??[]);let n=t?a[0]:y,l=r??n;if(!a.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),W=!!t?.defaultChain,I=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=!(e.enforceWalletUis??1);if(E=e.legacyWalletUiConfig??1?I?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??R:R,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==E)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:K,...N}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??a.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:T({backgroundTheme:t?.appearance?.theme??a.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??a.appearance.accentColor}),loginGroupPriority:_?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:L,walletChainType:t?.appearance?.walletChainType??"ethereum-only"},loginMethods:{wallet:i,email:o,sms:n,passkey:l,google:p,twitter:c,discord:h,github:f,spotify:d,instagram:m,tiktok:u,linkedin:g,apple:b,farcaster:w,telegram:C},loginMethodsAndOrder:M,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??a.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??a.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??a.rpcConfig.rpcTimeouts},chains:F,defaultChain:P,intl:{defaultCountry:H},shouldEnforceDefaultChainOnConnect:W,captchaEnabled:e.captchaEnabled??a.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??a.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:U},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof K?{requireUserOwnedRecoveryOnCreate:K}:{},...I?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...N,noPromptOnSignature:E,showWalletUis:t?.embeddedWallets?.showWalletUis},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:I?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??a._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??a.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??a.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??a.fundingMethodConfig.moonpay.useSandbox}}}}let L={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,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const M=U(L,void 0,!1);let H=t.createContext({appConfig:M,isServerConfigLoaded:!1});const F=t.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.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=M,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=x,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.PrivyAppConfigProvider=({children:r,legacyCreateEmbeddedWalletFlag:o,client:a,clientConfig:n})=>{let[l,i]=t.useState(null),s=t.useMemo((()=>U(l??L,n,!!l)),[l,n]);return t.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:o,supportedChains:a,defaultChain:n,externalWallets:l,...i}=e;return{...i,...o?{additionalChains:o.map((e=>e.id))}:void 0,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(n,o),t=function(e,t=0){let r=3735928559^t,o=1103547991^t;for(let t,a=0;a<e.length;a++)r=Math.imul(r^(t=e.charCodeAt(a)),2654435761),o=Math.imul(o^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),4294967296*(2097151&(o=Math.imul(o^o>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),r=`privy:sent:${l.id}:${t}`;localStorage.getItem(r)||(a.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(r,"t"))}),[n,o,l]),t.useEffect((()=>{l||(async()=>{try{let e=await a.getServerConfig();e.customApiUrl&&a.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),e.jsx(H.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:r})},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.TOKEN_COOKIE_KEY="privy-token",exports.TOKEN_STORAGE_KEY="privy:token",exports.UseWalletsContext=F,exports.VERSION="1.88.5-beta-20241007195314",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=O,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!S.has(e.id)));return x.concat(t)},exports.arbitrum=p,exports.arbitrumSepolia=c,exports.avalanche=h,exports.avalancheFuji=u,exports.base=d,exports.baseSepolia=m,exports.celo=g,exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.linea=f,exports.mainnet=y,exports.optimism=b,exports.optimismSepolia=w,exports.polygon=C,exports.polygonAmoy=E,exports.sepolia=v,exports.useAppConfig=()=>{let{appConfig:e}=t.useContext(H);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=t.useContext(H);return e},exports.useWallets=function(){let e=t.useContext(F);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e},exports.zora=k;
@@ -1100,7 +1100,7 @@ interface PrivyInterface {
1100
1100
  *
1101
1101
  * This method will error if the user is not authenticated or does not have an embedded wallet.
1102
1102
  *
1103
- * If the `config.embeddedWallets.noPromptOnSignature` property is set to true, the signature will
1103
+ * If the `config.embeddedWallets.showWalletUis` property is set to false, the signature will
1104
1104
  * be computed without prompting the user. Otherwise (the default), Privy will show the user a modal
1105
1105
  * to prompt them for a signature. This can be customized via the {@link SignMessageModalUIOptions}.
1106
1106
  *
@@ -1239,7 +1239,7 @@ interface PrivyInterface {
1239
1239
  * If no `chainId` is specified as part of the {@link UnsignedTransactionRequest}, Privy will default
1240
1240
  * to the embedded wallet's current chain ID.
1241
1241
  *
1242
- * If the `config.embeddedWallets.noPromptOnSignature` property is set to true, the wallet will
1242
+ * If the `config.embeddedWallets.showWalletUis` property is set to false, the wallet will
1243
1243
  * attempt to send the transaction without prompting the user. Otherwise (the default), Privy
1244
1244
  * will show the user a modal to have them confirm the transaction. This can be customized via
1245
1245
  * the {@link SendTransactionModalUIOptions}.
@@ -1257,7 +1257,7 @@ interface PrivyInterface {
1257
1257
  *
1258
1258
  * This method will error if the user is not authenticated or does not have a solana embedded wallet.
1259
1259
  *
1260
- * If the `config.embeddedWallets.noPromptOnSignature` property is set to true, the wallet will attempt to send
1260
+ * If the `config.embeddedWallets.showWalletUis` property is set to false, the wallet will attempt to send
1261
1261
  * the transaction without prompting the user. Otherwise (the default), Privy will show the user a modal to have
1262
1262
  * them confirm the transaction. This can be customized via the {@link SendTransactionModalUIOptions}.
1263
1263
  *
@@ -1100,7 +1100,7 @@ interface PrivyInterface {
1100
1100
  *
1101
1101
  * This method will error if the user is not authenticated or does not have an embedded wallet.
1102
1102
  *
1103
- * If the `config.embeddedWallets.noPromptOnSignature` property is set to true, the signature will
1103
+ * If the `config.embeddedWallets.showWalletUis` property is set to false, the signature will
1104
1104
  * be computed without prompting the user. Otherwise (the default), Privy will show the user a modal
1105
1105
  * to prompt them for a signature. This can be customized via the {@link SignMessageModalUIOptions}.
1106
1106
  *
@@ -1239,7 +1239,7 @@ interface PrivyInterface {
1239
1239
  * If no `chainId` is specified as part of the {@link UnsignedTransactionRequest}, Privy will default
1240
1240
  * to the embedded wallet's current chain ID.
1241
1241
  *
1242
- * If the `config.embeddedWallets.noPromptOnSignature` property is set to true, the wallet will
1242
+ * If the `config.embeddedWallets.showWalletUis` property is set to false, the wallet will
1243
1243
  * attempt to send the transaction without prompting the user. Otherwise (the default), Privy
1244
1244
  * will show the user a modal to have them confirm the transaction. This can be customized via
1245
1245
  * the {@link SendTransactionModalUIOptions}.
@@ -1257,7 +1257,7 @@ interface PrivyInterface {
1257
1257
  *
1258
1258
  * This method will error if the user is not authenticated or does not have a solana embedded wallet.
1259
1259
  *
1260
- * If the `config.embeddedWallets.noPromptOnSignature` property is set to true, the wallet will attempt to send
1260
+ * If the `config.embeddedWallets.showWalletUis` property is set to false, the wallet will attempt to send
1261
1261
  * the transaction without prompting the user. Otherwise (the default), Privy will show the user a modal to have
1262
1262
  * them confirm the transaction. This can be customized via the {@link SendTransactionModalUIOptions}.
1263
1263
  *
@@ -768,7 +768,7 @@ type LoginWithCode = {
768
768
  };
769
769
  declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
770
770
  type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
771
- declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "crypto.com_wallet_extension"];
771
+ declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "crypto.com_wallet_extension"];
772
772
  type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
773
773
  declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet"];
774
774
  type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
@@ -1436,7 +1436,7 @@ type PriceDisplayOptions = {
1436
1436
  };
1437
1437
  type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
1438
1438
  /** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
1439
- | 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'safe';
1439
+ | 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'safe';
1440
1440
  type NonEmptyArray<T> = [T, ...T[]];
1441
1441
  type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | 'farcaster' | 'telegram';
1442
1442
  type ExternalWalletsConfig = {
@@ -1710,18 +1710,28 @@ interface PrivyClientConfig {
1710
1710
  requireUserPasswordOnCreate?: boolean;
1711
1711
  /**
1712
1712
  * @deprecated. Instead, use the server-driven configuration found in the Privy console: https://dashboard.privy.io/apps/YOUR_APP_ID/embedded.
1713
+ * or the client-side 'embeddedWallets.showWalletUis' configuration.
1713
1714
  * If true, Privy will not prompt or instantiate any UI for embedded wallet signatures and transactions.
1714
1715
  * If false, embedded wallet actions will raise a modal and require user confirmation to proceed.
1715
1716
  *
1716
1717
  * Defaults to false.
1717
1718
  */
1718
1719
  noPromptOnSignature?: boolean;
1720
+ /**
1721
+ * Override any settings for the embedded wallet's UI to show or hide the wallet UIs.
1722
+ *
1723
+ * If true, wallet UIs will always be shown.
1724
+ * If false, wallet UIs will always be hidden.
1725
+ *
1726
+ * If not set, the default behavior will match the server configuration.
1727
+ */
1728
+ showWalletUis?: boolean;
1719
1729
  /**
1720
1730
  * @experimental
1721
1731
  *
1722
1732
  * **This setting is only honored when using the EIP-1193 Ethereum Provider to interface
1723
1733
  * with the embedded wallet, i.e. using `getEthereumProvider` or `getEthersProvider`.
1724
- * This setting is only honored when used alongside `noPromptOnSignature: true`**
1734
+ * This setting is only honored when used alongside `showWalletUis: false`**
1725
1735
  *
1726
1736
  * If true, calls to `sendTransaction` will wait for the transaction to be confirmed before resolving.
1727
1737
  * If false, calls to `sendTransaction` will resolve once the transaction has been submitted.
@@ -1732,7 +1742,7 @@ interface PrivyClientConfig {
1732
1742
  * <PrivyProvider
1733
1743
  * config={{
1734
1744
  * embeddedWallets: {
1735
- * noPromptOnSignature: true,
1745
+ * showWalletUis: false,
1736
1746
  * waitForTransactionConfirmation: false,
1737
1747
  * },
1738
1748
  * }}
@@ -768,7 +768,7 @@ type LoginWithCode = {
768
768
  };
769
769
  declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
770
770
  type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
771
- declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "crypto.com_wallet_extension"];
771
+ declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "crypto.com_wallet_extension"];
772
772
  type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
773
773
  declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet"];
774
774
  type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
@@ -1436,7 +1436,7 @@ type PriceDisplayOptions = {
1436
1436
  };
1437
1437
  type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
1438
1438
  /** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
1439
- | 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'safe';
1439
+ | 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'safe';
1440
1440
  type NonEmptyArray<T> = [T, ...T[]];
1441
1441
  type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | 'farcaster' | 'telegram';
1442
1442
  type ExternalWalletsConfig = {
@@ -1710,18 +1710,28 @@ interface PrivyClientConfig {
1710
1710
  requireUserPasswordOnCreate?: boolean;
1711
1711
  /**
1712
1712
  * @deprecated. Instead, use the server-driven configuration found in the Privy console: https://dashboard.privy.io/apps/YOUR_APP_ID/embedded.
1713
+ * or the client-side 'embeddedWallets.showWalletUis' configuration.
1713
1714
  * If true, Privy will not prompt or instantiate any UI for embedded wallet signatures and transactions.
1714
1715
  * If false, embedded wallet actions will raise a modal and require user confirmation to proceed.
1715
1716
  *
1716
1717
  * Defaults to false.
1717
1718
  */
1718
1719
  noPromptOnSignature?: boolean;
1720
+ /**
1721
+ * Override any settings for the embedded wallet's UI to show or hide the wallet UIs.
1722
+ *
1723
+ * If true, wallet UIs will always be shown.
1724
+ * If false, wallet UIs will always be hidden.
1725
+ *
1726
+ * If not set, the default behavior will match the server configuration.
1727
+ */
1728
+ showWalletUis?: boolean;
1719
1729
  /**
1720
1730
  * @experimental
1721
1731
  *
1722
1732
  * **This setting is only honored when using the EIP-1193 Ethereum Provider to interface
1723
1733
  * with the embedded wallet, i.e. using `getEthereumProvider` or `getEthersProvider`.
1724
- * This setting is only honored when used alongside `noPromptOnSignature: true`**
1734
+ * This setting is only honored when used alongside `showWalletUis: false`**
1725
1735
  *
1726
1736
  * If true, calls to `sendTransaction` will wait for the transaction to be confirmed before resolving.
1727
1737
  * If false, calls to `sendTransaction` will resolve once the transaction has been submitted.
@@ -1732,7 +1742,7 @@ interface PrivyClientConfig {
1732
1742
  * <PrivyProvider
1733
1743
  * config={{
1734
1744
  * embeddedWallets: {
1735
- * noPromptOnSignature: true,
1745
+ * showWalletUis: false,
1736
1746
  * waitForTransactionConfirmation: false,
1737
1747
  * },
1738
1748
  * }}