@privy-io/react-auth 1.95.2 → 1.95.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/context-Unj5mD8K.js +1 -0
- package/dist/cjs/getEmbeddedConnectedWallet-DMZM38WV.js +1 -0
- package/dist/cjs/index.js +154 -150
- package/dist/cjs/smart-wallets-D_pDHYlr.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +16 -10
- package/dist/cjs/{useFundWallet-BHF-4PZu.js → useFundWallet-BIeYj1if.js} +3 -2
- package/dist/cjs/useSolanaWallets-CRYEB54t.js +1 -0
- package/dist/cjs/{privy-context-BOQWqAyX.js → useWallets-BXXojOrQ.js} +1 -1
- package/dist/dts/index.d.mts +7 -4
- package/dist/dts/index.d.ts +7 -4
- package/dist/dts/{solana-D5xAHDt7.d.mts → solana-ByUtVSFD.d.mts} +5 -1
- package/dist/dts/{solana-D5xAHDt7.d.ts → solana-ByUtVSFD.d.ts} +5 -1
- package/dist/dts/solana.d.mts +2 -2
- package/dist/dts/solana.d.ts +2 -2
- package/dist/dts/{types-BwcPm4mZ.d.mts → types-CJoUyidF.d.mts} +1 -1
- package/dist/dts/{types-BwcPm4mZ.d.ts → types-CJoUyidF.d.ts} +1 -1
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-BXivPMz8.mjs +1 -0
- package/dist/esm/getEmbeddedConnectedWallet-ComEChZh.mjs +1 -0
- package/dist/esm/index.mjs +211 -207
- package/dist/esm/smart-wallets-Cf_4SaVH.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +30 -24
- package/dist/esm/{useFundWallet-BmJ1B36W.mjs → useFundWallet-CQLW4Zdx.mjs} +6 -5
- package/dist/esm/useSolanaWallets-D4OrykNN.mjs +1 -0
- package/dist/esm/{privy-context-DffpuNH1.mjs → useWallets-BfKlC62m.mjs} +1 -1
- package/package.json +5 -5
- package/dist/cjs/getEmbeddedConnectedWallet-DGmyS1bb.js +0 -1
- package/dist/cjs/smart-wallets-D1j3W4UB.js +0 -1
- package/dist/cjs/useSolanaWallets-DvYv01E-.js +0 -1
- package/dist/cjs/useWallets-7cJEdKfK.js +0 -1
- package/dist/esm/getEmbeddedConnectedWallet-CqgZB8tC.mjs +0 -1
- package/dist/esm/smart-wallets-BoKTDMNm.mjs +0 -1
- package/dist/esm/useSolanaWallets-DhN1MwR8.mjs +0 -1
- package/dist/esm/useWallets-BxVlmjSu.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo as a,useCallback as c}from"react";import{jsx as i,jsxs as
|
|
1
|
+
import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo as a,useCallback as c}from"react";import{jsx as i,jsxs as n,Fragment as l}from"react/jsx-runtime";import{styled as s,keyframes as d,css as h}from"styled-components";import{G as v,A as p,an as u,U as g}from"./context-BXivPMz8.mjs";import{u as m}from"./events-context-2ZF4RQWB.mjs";import{m as y,u as f}from"./useWallets-BfKlC62m.mjs";import w from"@heroicons/react/24/outline/Square2StackIcon";import{BigNumber as b}from"@ethersproject/bignumber";import{formatEther as x}from"@ethersproject/units";import{createPublicClient as $,http as M}from"viem";let k=r=>b.from(r);function V(r){if("number"==typeof r||"bigint"==typeof r||"string"==typeof r)return r;if("function"==typeof r.toHexString)return r.toHexString();throw Error(`Expected numeric value but received ${r}`)}function Z(r){let e={};return void 0!==r.to&&(e.to=r.to),void 0!==r.data&&(e.data=r.data),void 0!==r.chainId&&(e.chainId=r.chainId),void 0!==r.type&&(e.type=r.type),void 0!==r.accessList&&(e.accessList=r.accessList),void 0!==r.nonce&&(e.nonce=k(r.nonce).toNumber()),void 0!==r.gasLimit&&(e.gasLimit=k(r.gasLimit)),void 0!==r.gasPrice&&(e.gasPrice=k(r.gasPrice)),void 0!==r.value&&(e.value=k(r.value)),void 0!==r.maxFeePerGas&&(e.maxFeePerGas=k(r.maxFeePerGas)),void 0!==r.maxPriorityFeePerGas&&(e.maxPriorityFeePerGas=k(r.maxPriorityFeePerGas)),e}class L{get(r){let e=localStorage.getItem(r);return null===e?void 0:JSON.parse(e)}put(r,e){void 0!==e?localStorage.setItem(r,JSON.stringify(e)):this.del(r)}del(r){localStorage.removeItem(r)}getKeys(){return Object.entries(localStorage).map((([r])=>r))}}function P(){try{let r="privy:__session_storage__test",e=new L;return e.put(r,"blobby"),e.del(r),!0}catch(r){return!1}}var T="undefined"!=typeof window&&window.localStorage?new L:new class{get(r){return this._cache[r]}put(r,e){void 0!==e?this._cache[r]=e:this.del(r)}del(r){delete this._cache[r]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};const C=o=>{let[t,a]=r("auto");return e((()=>{let r=new ResizeObserver((r=>{a(r[0]?.contentRect.height??"auto")}));return o.current&&r.observe(o.current),()=>{o.current&&r.unobserve(o.current)}}),[o.current]),t},S=({success:r,fail:e})=>n(l,{children:[i(_,{className:r?"success":e?"fail":""}),i(H,{className:r?"success":e?"fail":""})]}),_=s.span`
|
|
2
2
|
&& {
|
|
3
3
|
width: 82px;
|
|
4
4
|
height: 82px;
|
|
@@ -56,7 +56,7 @@ import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo a
|
|
|
56
56
|
&& > a {
|
|
57
57
|
color: var(--privy-color-accent);
|
|
58
58
|
}
|
|
59
|
-
`;function A(r){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:o,requireUsersAcceptTerms:t}}=r.app;if(t&&!r.alwaysShowImplicitConsent||!o&&!e)return i(N,{});let a=!(!e||!o);return
|
|
59
|
+
`;function A(r){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:o,requireUsersAcceptTerms:t}}=r.app;if(t&&!r.alwaysShowImplicitConsent||!o&&!e)return i(N,{});let a=!(!e||!o);return n(N,{children:["By logging in I agree to the"," ",o&&i("a",{href:o,target:"_blank",children:a?"Terms":"Terms of Service"}),a&&" & ",e&&i("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const z=()=>i(W,{children:i("a",{href:"https://www.privy.io/",target:"_blank",children:i(F,{height:13,width:150})})}),W=s.div`
|
|
60
60
|
display: flex;
|
|
61
61
|
align-items: center;
|
|
62
62
|
justify-content: center;
|
|
@@ -77,7 +77,7 @@ import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo a
|
|
|
77
77
|
@media all and (display-mode: standalone) {
|
|
78
78
|
padding-bottom: 30px;
|
|
79
79
|
}
|
|
80
|
-
`,B=({address:r,showCopyIcon:e,url:o,className:t})=>o?i("a",{title:r,className:t,href:`${o}/address/${r}`,target:"_blank",children:v(r)}):
|
|
80
|
+
`,B=({address:r,showCopyIcon:e,url:o,className:t})=>o?i("a",{title:r,className:t,href:`${o}/address/${r}`,target:"_blank",children:v(r)}):n("button",{title:r,className:t,onClick:()=>navigator.clipboard.writeText(r).catch(console.error),children:[v(r),e&&i(G,{})]});let G=s(w)`
|
|
81
81
|
&& {
|
|
82
82
|
display: inline;
|
|
83
83
|
}
|
|
@@ -108,7 +108,8 @@ import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo a
|
|
|
108
108
|
font-weight: 500;
|
|
109
109
|
line-height: 1.125rem; /* 150% */
|
|
110
110
|
border-radius: var(--privy-border-radius-sm);
|
|
111
|
-
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
112
113
|
${r=>{let e,o;"green"===r.$color&&(e="var(--privy-color-success-dark)",o="var(--privy-color-success-light)"),"red"===r.$color&&(e="var(--privy-color-error)",o="var(--privy-color-error-light)"),"gray"===r.$color&&(e="var(--privy-color-foreground-2)",o="var(--privy-color-background-2)");let t=d`
|
|
113
114
|
from, to {
|
|
114
115
|
background-color: ${o};
|
|
@@ -158,4 +159,4 @@ import{useState as r,useEffect as e,createContext as o,useContext as t,useMemo a
|
|
|
158
159
|
${r=>"error"===r.$state?"border-color: var(--privy-color-error);":""}
|
|
159
160
|
`,ar=s.div`
|
|
160
161
|
${tr}
|
|
161
|
-
`,cr=({errMsg:r,balance:e,address:o,isLoading:t,className:a,title:c,isPulsing:s,showIcon:d,statusColor:h="green"})=>{let v;return v=h||(r?"red":"green"),l
|
|
162
|
+
`,cr=({errMsg:r,balance:e,address:o,isLoading:t,className:a,title:c,isPulsing:s,showIcon:d,statusColor:h="green"})=>{let v;return v=h||(r?"red":"green"),n(l,{children:[n(ar,{className:a,$state:r?"error":void 0,children:[n(rr,{children:[i(or,{children:c||"Pay with"}),i(B,{address:o,showCopyIcon:d||!!r})]}),void 0!==e&&i(R,{isLoading:t,isPulsing:s,color:v,children:e})]}),r&&i(er,{style:{marginTop:"0.25rem"},children:r})]})},ir=({color:r,...e})=>i("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...e,children:i("g",{children:i("path",{fill:r||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});let nr=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),lr=r=>nr.format(r);const sr=(r,e)=>{let o=lr(e*parseFloat(r));return"$0.00"!==o?o:"<$0.01"},dr=(r,e)=>{let o=lr(e*parseFloat(x(r)));return"$0.00"===o?"<$0.01":o},hr=(r,e,o=6,t=!1)=>{let a=parseFloat(x(r)).toFixed(o).replace(/0+$/,"").replace(/\.$/,"");return t?`${a} ${e}`:`${"0"===a?"<0.001":a} ${e}`},vr=r=>r.map(k).reduce(((r,e)=>r.add(e)),b.from(0)).toHexString(),pr=(r,e)=>{let{chains:o}=f(),t=`https://etherscan.io/address/${e}`,a=`${u(r,o)}/address/${e}`;if(!a)return t;try{new URL(a)}catch{return t}return a},ur=({...r})=>n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...r,children:[i("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),i("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),i("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]});function gr({rpcConfig:o,appId:t,address:i,chain:n}){let{chains:l}=f(),[s,d]=r(0n),[h,v]=r(!1),p=a((()=>{let r=n||l[0];if(r)return $({chain:n,transport:M(g(r,o,t))})}),[n,o,t]),u=c((async()=>{if(!i||!p)return;v(!0);let r=await p.getBalance({address:i}).catch(console.error);return r?(d(r),v(!1),r):void 0}),[p,i,d]);return e((()=>{u().catch(console.error)}),[]),{balance:s,isLoading:h,reloadBalance:u}}function mr(r){let{login:e}=t(y);return m("login",r),{login:e}}function yr(r){let{connectWallet:e}=t(y);return m("connectWallet",r),{connectWallet:e}}const fr=r=>{m("fundWallet",r);let{fundWallet:e}=f();return{fundWallet:e}};export{B as A,I as B,S as C,er as E,_ as L,W as M,D as R,A as T,cr as W,T as a,z as b,R as c,Y as d,P as e,ir as f,U as g,ar as h,k as i,tr as j,hr as k,sr as l,dr as m,H as n,ur as o,gr as p,pr as q,Z as r,vr as s,V as t,Q as u,C as v,mr as w,yr as x,fr as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,b as t,p as a,u as s,l as n,h as r,P as i}from"./useWallets-BfKlC62m.mjs";import o from"eventemitter3";import{ErrorCode as l}from"@ethersproject/logger";import{d}from"./user-EiUNCG17.mjs";var c,_;(_=c||(c={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",_.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",_.INVALID_DATA="invalid_data",_.LINKED_TO_ANOTHER_USER="linked_to_another_user",_.ALLOWLIST_REJECTED="allowlist_rejected",_.OAUTH_USER_DENIED="oauth_user_denied",_.UNKNOWN_AUTH_ERROR="unknown_auth_error",_.USER_EXITED_AUTH_FLOW="exited_auth_flow",_.MUST_BE_AUTHENTICATED="must_be_authenticated",_.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",_.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",_.CLIENT_REQUEST_TIMEOUT="client_request_timeout",_.INVALID_CREDENTIALS="invalid_credentials";class u extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=a}}class E extends u{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}let h={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 p extends E{constructor(e){super(e.message,e.code,e.data);let t=Object.values(h).find((t=>t.eipCode===e.code));this.details=t||h.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=h.E32002_CONNECTION_ALREADY_PENDING:this.details=h.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=h.E32002_WALLET_LOCKED))}}class y extends e{constructor(){super("Wallet timeout"),this.type="wallet_error"}}class m extends e{constructor(){super("User rejected connection"),this.type="wallet_error"}}const T=t=>{if(t instanceof e)return t;if(t?.code&&t?.reason){let e=new w(t);return t.code===l.ACTION_REJECTED&&(e.details=h.E4001_USER_REJECTED_REQUEST),e}return t?.code?new w(t):new e("Unknown connector error",t)};class g extends t{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class w extends g{constructor(e){super(e.message,e.code,e.data);let t=Object.values(h).find((t=>t.eipCode===e.code));this.details=t||h.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=h.E32002_CONNECTION_ALREADY_PENDING:this.details=h.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=h.E32002_WALLET_LOCKED))}}const C={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},...h};class R extends o{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const N=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","crypto.com_wallet_extension","crypto.com_onchain","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","privy","unknown","phantom","solflare","glow"];function A(e){return"solana"===e.chainType}function b(e){return"solana"===e.type}class D extends R{get isInstalled(){return"Installed"===this.adapter.readyState}buildConnectedWallet(e,t){let s,n,r;if("Installed"!==e.readyState||!e.publicKey)throw Error("Wallet is not connected.");return"signMessage"in e&&(s=async(...t)=>{if(!e.connected)throw Error("Wallet is not connected.");return await e.signMessage(t[0])}),"sendTransaction"in e&&(n=async(...t)=>await e.sendTransaction(t[0],t[1],t[2])),"signTransaction"in e&&(r=async t=>await e.signTransaction(t)),{type:"solana",address:e.publicKey.toBase58(),meta:t,imported:!1,connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:async()=>e.connected,disconnect:()=>{try{e.disconnect()}catch(e){console.error("Wallet does not support programmatic disconnect")}},getProvider:a(`${this.walletClientType||""} wallet does not support 'getProvider'`),signMessage:s??a(`${this.walletClientType||""} wallet does not support 'signMessage'`),sendTransaction:n??a(`${this.walletClientType||""} wallet does not support 'sendTransaction'`),signTransaction:r??a(`${this.walletClientType||""} wallet does not support 'signTransaction'`)}}async syncAccounts(){if("Installed"===this.adapter.readyState&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((e=>this.adapter.publicKey&&e.address===this.adapter.publicKey.toBase58()))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,t){super(function(e){return N.includes(e)}(e.name.toLowerCase())?e.name.toLowerCase():"unknown"),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=()=>{this.adapter.disconnect().then((()=>this.onDisconnect())).catch((e=>console.error("Error disconnecting",e)))},this.promptConnection=async()=>{try{await this.adapter.connect()}catch(e){throw T(e)}},this.onDisconnect=()=>{this.syncAccounts()},this.onConnect=e=>{this.syncAccounts()},this.onError=e=>{this.syncAccounts()},this.onReadyStateChange=e=>{"Installed"!==e&&(this.connected=!1),this.syncAccounts()},this.adapter=e,this.shouldAutoConnect=t,this.wallets=[]}}const U=()=>{let{embeddedSolanaWallet:e,exportSolanaWallet:t,createEmbeddedSolanaWallet:a,solanaWallets:o,delegateWallet:l}=s(),{ready:c}=n(),{user:_}=r();return{ready:c,createWallet:a,exportWallet:t,delegateWalletAction:async()=>{let e=d(_);if(!e)throw new i("User must have a solana wallet in order to delegate actions");return await l({address:e.address,chainType:"solana"})},wallets:o.concat(e?[e]:[])}};export{C,w as P,p as R,D as S,m as U,y as W,R as a,g as b,b as c,T as f,A as i,h as n,U as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FetchError as e}from"ofetch";import{createContext as t,useContext as n}from"react";var a;class i extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,n){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=n}}class s extends i{constructor(e,t,n,a,i,s){super(n,a,i),this.type=e,this.status=t,this.data=s}}class r extends i{constructor(e,t,n){super(e,t,n),this.type="client_error"}}class l extends r{constructor(){super("Request timed out",void 0,"client_request_timeout")}}class o extends i{constructor(e,t,n){super(e,t,n),this.type="connector_error"}}const _=t=>{if(t instanceof i)return t;if(!(t instanceof e))return u(t);if(!t.response)return new s("api_error",null,t.message,t);let{type:n,message:a,error:r,code:l}=t.data;return new s(n||"ApiError",t.response.status,a||r,t,l,t.data)},u=e=>e instanceof i?e:e instanceof Error?new r(e.message,e):new r(`Internal error: ${e}`);var d;(a=d||(d={})).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",a.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",a.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",a.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",a.INVALID_DATA="invalid_data",a.INVALID_CAPTCHA="invalid_captcha",a.LINKED_TO_ANOTHER_USER="linked_to_another_user",a.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",a.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",a.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",a.USER_EXITED_UPDATE_FLOW="exited_update_flow",a.ALLOWLIST_REJECTED="allowlist_rejected",a.OAUTH_USER_DENIED="oauth_user_denied",a.OAUTH_UNEXPECTED="oauth_unexpected",a.UNKNOWN_AUTH_ERROR="unknown_auth_error",a.USER_EXITED_AUTH_FLOW="exited_auth_flow",a.USER_EXITED_LINK_FLOW="exited_link_flow",a.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",a.MUST_BE_AUTHENTICATED="must_be_authenticated",a.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",a.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",a.CLIENT_REQUEST_TIMEOUT="client_request_timeout",a.INVALID_CREDENTIALS="invalid_credentials",a.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",a.UNKNOWN_MFA_ERROR="unknown_mfa_error",a.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",a.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",a.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",a.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",a.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",a.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",a.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",a.TRANSACTION_FAILURE="transaction_failure",a.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",a.NOT_SUPPORTED="not_supported",a.CAPTCHA_TIMEOUT="captcha_timeout",a.INVALID_MESSAGE="invalid_message",a.UNABLE_TO_SIGN="unable_to_sign",a.CAPTCHA_FAILURE="captcha_failure",a.CAPTCHA_DISABLED="captcha_disabled",a.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",a.TOO_MANY_REQUESTS="too_many_requests",a.USER_LIMIT_REACHED="max_accounts_reached",a.DISALLOWED_LOGIN_METHOD="disallowed_login_method",a.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",a.PASSKEY_NOT_ALLOWED="passkey_not_allowed",a.USER_DOES_NOT_EXIST="user_does_not_exist",a.INSUFFICIENT_BALANCE="insufficient_balance",a.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required";class c extends r{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}}class E extends r{constructor(e="Embedded wallet error",t){super(e,t,"unknown_embedded_wallet_error")}}class A extends r{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}}class p extends r{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}}const T=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},S=e=>()=>{throw Error(e.trim())},h=t({isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,initUpdatePhone:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,passkeyAuthState:{status:"initial"},setPasskeyAuthState:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,loginWithGuestAccountFlow:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,getUsdPriceForSol:T,recoverPrimaryWallet:T,updateWallets:T,fundWallet:T,fundSolanaWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T,generateSiweMessage:T,generateSiweMessageForSmartWallet:T,linkWithSiwe:T,linkSmartWallet:T,delegateWallet:T,revokeDelegatedWallets:T,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:T,exportSolanaWallet:T,solanaSignMessage:T,connectCoinbaseSmartWallet:T,initiateAccountTransfer:T,emailOtpState:{status:"initial"},setEmailOtpState:T,smsOtpState:{status:"initial"},setSmsOtpState:T,siweState:{status:"initial"},setSiweState:T,oAuthState:{status:"initial"},setOAuthState:T,isHeadlessOAuthLoading:!1}),m=()=>n(h),W=t({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,startCrossAppAuthFlow:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,updatePhone:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkCrossAppAccount:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,sendSolanaTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,createGuestAccount:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isModalOpen:!1,mfaMethods:[]}),I=()=>n(W);export{h as I,r as P,d as a,i as b,o as c,l as d,u as e,_ as f,s as g,I as h,p as i,E as j,A as k,
|
|
1
|
+
import{FetchError as e}from"ofetch";import{createContext as t,useContext as n}from"react";var a;class i extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,n){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=n}}class s extends i{constructor(e,t,n,a,i,s){super(n,a,i),this.type=e,this.status=t,this.data=s}}class r extends i{constructor(e,t,n){super(e,t,n),this.type="client_error"}}class l extends r{constructor(){super("Request timed out",void 0,"client_request_timeout")}}class o extends i{constructor(e,t,n){super(e,t,n),this.type="connector_error"}}const _=t=>{if(t instanceof i)return t;if(!(t instanceof e))return u(t);if(!t.response)return new s("api_error",null,t.message,t);let{type:n,message:a,error:r,code:l}=t.data;return new s(n||"ApiError",t.response.status,a||r,t,l,t.data)},u=e=>e instanceof i?e:e instanceof Error?new r(e.message,e):new r(`Internal error: ${e}`);var d;(a=d||(d={})).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",a.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",a.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",a.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",a.INVALID_DATA="invalid_data",a.INVALID_CAPTCHA="invalid_captcha",a.LINKED_TO_ANOTHER_USER="linked_to_another_user",a.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",a.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",a.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",a.USER_EXITED_UPDATE_FLOW="exited_update_flow",a.ALLOWLIST_REJECTED="allowlist_rejected",a.OAUTH_USER_DENIED="oauth_user_denied",a.OAUTH_UNEXPECTED="oauth_unexpected",a.UNKNOWN_AUTH_ERROR="unknown_auth_error",a.USER_EXITED_AUTH_FLOW="exited_auth_flow",a.USER_EXITED_LINK_FLOW="exited_link_flow",a.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",a.MUST_BE_AUTHENTICATED="must_be_authenticated",a.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",a.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",a.CLIENT_REQUEST_TIMEOUT="client_request_timeout",a.INVALID_CREDENTIALS="invalid_credentials",a.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",a.UNKNOWN_MFA_ERROR="unknown_mfa_error",a.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",a.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",a.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",a.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",a.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",a.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",a.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",a.TRANSACTION_FAILURE="transaction_failure",a.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",a.NOT_SUPPORTED="not_supported",a.CAPTCHA_TIMEOUT="captcha_timeout",a.INVALID_MESSAGE="invalid_message",a.UNABLE_TO_SIGN="unable_to_sign",a.CAPTCHA_FAILURE="captcha_failure",a.CAPTCHA_DISABLED="captcha_disabled",a.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",a.TOO_MANY_REQUESTS="too_many_requests",a.USER_LIMIT_REACHED="max_accounts_reached",a.DISALLOWED_LOGIN_METHOD="disallowed_login_method",a.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",a.PASSKEY_NOT_ALLOWED="passkey_not_allowed",a.USER_DOES_NOT_EXIST="user_does_not_exist",a.INSUFFICIENT_BALANCE="insufficient_balance",a.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required";class c extends r{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}}class E extends r{constructor(e="Embedded wallet error",t){super(e,t,"unknown_embedded_wallet_error")}}class A extends r{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}}class p extends r{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}}const T=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},S=e=>()=>{throw Error(e.trim())},h=t({isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:T,initializeWalletProxy:T,getAuthMeta:T,getAuthFlow:T,closePrivyModal:T,openPrivyModal:T,connectWallet:T,initLoginWithWallet:T,loginWithWallet:T,initLoginWithFarcaster:T,loginWithFarcaster:T,loginWithCode:T,initLoginWithEmail:T,initLoginWithSms:T,initUpdateEmail:T,initUpdatePhone:T,resendEmailCode:T,resendSmsCode:T,initLoginWithHeadlessOAuth:T,loginWithHeadlessOAuth:T,crossAppAuthFlow:T,initLoginWithOAuth:T,recoveryOAuthFlow:T,loginWithOAuth:T,passkeyAuthState:{status:"initial"},setPasskeyAuthState:T,initLoginWithPasskey:T,loginWithPasskey:T,initLinkWithPasskey:T,linkWithPasskey:T,refreshUser:T,loginWithGuestAccountFlow:T,walletProxy:null,createAnalyticsEvent:T,acceptTerms:T,getUsdTokenPrice:T,getUsdPriceForSol:T,recoverPrimaryWallet:T,updateWallets:T,fundWallet:T,fundSolanaWallet:T,setReadyToTrue:T,requestFarcasterSignerStatus:T,initLoginWithTelegram:T,loginWithTelegram:T,generateSiweMessage:T,generateSiweMessageForSmartWallet:T,linkWithSiwe:T,linkSmartWallet:T,delegateWallet:T,revokeDelegatedWallets:T,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:T,exportSolanaWallet:T,solanaSignMessage:T,connectCoinbaseSmartWallet:T,initiateAccountTransfer:T,emailOtpState:{status:"initial"},setEmailOtpState:T,smsOtpState:{status:"initial"},setSmsOtpState:T,siweState:{status:"initial"},setSiweState:T,oAuthState:{status:"initial"},setOAuthState:T,isHeadlessOAuthLoading:!1}),m=()=>n(h),W=t({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:T,login:T,connectOrCreateWallet:T,linkEmail:T,linkPhone:T,linkFarcaster:T,linkWallet:T,startCrossAppAuthFlow:T,linkGoogle:T,linkTwitter:T,linkDiscord:T,linkGithub:T,linkSpotify:T,linkInstagram:T,linkTelegram:T,linkTiktok:T,linkLinkedIn:T,linkApple:T,linkPasskey:T,updateEmail:T,updatePhone:T,logout:T,getAccessToken:T,getEthereumProvider:T,getEthersProvider:T,getWeb3jsProvider:T,unlinkEmail:T,unlinkPhone:T,unlinkWallet:T,unlinkGoogle:T,unlinkTwitter:T,unlinkDiscord:T,unlinkGithub:T,unlinkSpotify:T,unlinkInstagram:T,unlinkTiktok:T,unlinkLinkedIn:T,unlinkApple:T,unlinkCrossAppAccount:T,unlinkFarcaster:T,unlinkTelegram:T,unlinkPasskey:T,setActiveWallet:T,forkSession:T,createWallet:T,signMessage:T,signTypedData:T,enrollInMfa:T,initEnrollmentWithSms:T,initEnrollmentWithTotp:T,initEnrollmentWithPasskey:T,promptMfa:T,init:T,submitEnrollmentWithSms:T,submitEnrollmentWithTotp:T,submitEnrollmentWithPasskey:T,unenroll:T,submit:T,cancel:T,sendTransaction:T,sendSolanaTransaction:T,exportWallet:T,setWalletPassword:T,setWalletRecovery:T,requestFarcasterSignerFromWarpcast:T,getFarcasterSignerPublicKey:T,signFarcasterMessage:T,createGuestAccount:T,signMessageWithCrossAppWallet:T,signTypedDataWithCrossAppWallet:T,sendTransactionWithCrossAppWallet:T,isModalOpen:!1,mfaMethods:[]}),I=()=>n(W),g=t(null);function D(){let e=n(g);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e}export{h as I,r as P,g as U,d as a,i as b,o as c,l as d,u as e,_ as f,s as g,I as h,p as i,E as j,A as k,D as l,W as m,T as n,c as o,S as p,m as u};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@privy-io/react-auth",
|
|
3
|
-
"version": "1.95.
|
|
3
|
+
"version": "1.95.3",
|
|
4
4
|
"description": "React client for the Privy Auth API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"@heroicons/react": "^2.1.1",
|
|
134
134
|
"@marsidev/react-turnstile": "^0.4.1",
|
|
135
135
|
"@metamask/eth-sig-util": "^6.0.0",
|
|
136
|
-
"@privy-io/js-sdk-core": "0.35.
|
|
136
|
+
"@privy-io/js-sdk-core": "0.35.2",
|
|
137
137
|
"@simplewebauthn/browser": "^9.0.1",
|
|
138
138
|
"@solana/wallet-adapter-base": "^0.9.23",
|
|
139
139
|
"@solana/wallet-standard-wallet-adapter-base": "^1.1.2",
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"@babel/preset-typescript": "^7.24.7",
|
|
173
173
|
"@jest/globals": "^29.7.0",
|
|
174
174
|
"@privy-io/eslint-config-custom": "*",
|
|
175
|
-
"@privy-io/public-api": "2.15.
|
|
175
|
+
"@privy-io/public-api": "2.15.3",
|
|
176
176
|
"@privy-io/testing": "*",
|
|
177
177
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
178
178
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
@@ -181,7 +181,7 @@
|
|
|
181
181
|
"@rollup/plugin-terser": "^0.4.4",
|
|
182
182
|
"@saithodev/semantic-release-backmerge": "^2.1.2",
|
|
183
183
|
"@semantic-release/git": "^10.0.1",
|
|
184
|
-
"@solana/web3.js": "^1.95.
|
|
184
|
+
"@solana/web3.js": "^1.95.8",
|
|
185
185
|
"@storylite/storylite": "^0.15.1",
|
|
186
186
|
"@storylite/vite-plugin": "^0.15.0",
|
|
187
187
|
"@swc/core": "^1.7.26",
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
},
|
|
218
218
|
"peerDependencies": {
|
|
219
219
|
"@abstract-foundation/agw-client": "^0.0.1-beta.17",
|
|
220
|
-
"@solana/web3.js": "^1.95.
|
|
220
|
+
"@solana/web3.js": "^1.95.8",
|
|
221
221
|
"permissionless": "^0.2.10",
|
|
222
222
|
"react": "^18 || ^19",
|
|
223
223
|
"react-dom": "^18 || ^19"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var E,_=require("react/jsx-runtime"),N=require("react"),A=require("./useWallets-7cJEdKfK.js"),S=require("./privy-context-BOQWqAyX.js");function T({src:E,...N}){return _.jsx("img",{src:E,...N,style:{display:"none"}})}exports.ModalScreen=void 0,(E=exports.ModalScreen||(exports.ModalScreen={})).LANDING="LANDING",E.CONNECT_OR_CREATE="CONNECT_OR_CREATE",E.AWAITING_CONNECTION="AWAITING_CONNECTION",E.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",E.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",E.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",E.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",E.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",E.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",E.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",E.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",E.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",E.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",E.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",E.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",E.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",E.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",E.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",E.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",E.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",E.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",E.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",E.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",E.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",E.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",E.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",E.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",E.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",E.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",E.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",E.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",E.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",E.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",E.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",E.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",E.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",E.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",E.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",E.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",E.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",E.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",E.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",E.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",E.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",E.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",E.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",E.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",E.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",E.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",E.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",E.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",E.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",E.CAPTCHA_SCREEN="CAPTCHA_SCREEN",E.ERROR_SCREEN="ERROR_SCREEN",E.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",E.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",E.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const R=N.createContext({ready:!1,app:A.DEFAULT_APP_CONFIG,currentScreen:null,lastScreen:null,navigate:S.notImplemented,navigateBack:S.notImplemented,resetNavigation:S.notImplemented,setModalData:S.notImplemented,onUserCloseViaDialogOrKeybindRef:void 0});let C=[exports.ModalScreen.LANDING,exports.ModalScreen.CONNECT_ONLY_LANDING_SCREEN,null];exports.ModalProvider=E=>{let S=A.useAppConfig(),D=E.authenticated,[L,e]=N.useState(E.initialScreen);N.useEffect((()=>{D||C.includes(E.initialScreen)||E.setInitialScreen(null)}),[D]);let I=N.useRef(null);N.useEffect((()=>{E.open||(I.current=null)}),[E.open]),N.useEffect((()=>{I.current=null}),[E.initialScreen]);let O={ready:!!S.id,app:S,data:E.data,setModalData:E.setModalData,currentScreen:E.initialScreen,lastScreen:L,navigate:(_,N=!0)=>{E.setInitialScreen(_),N&&e(E.initialScreen)},navigateBack:()=>{E.setInitialScreen(L)},resetNavigation:()=>{E.setInitialScreen(null),e(null)},onUserCloseViaDialogOrKeybindRef:I};return _.jsxs(R.Provider,{value:O,children:[("string"==typeof S.appearance.logo||"img"===S.appearance.logo?.type)&&_.jsx(T,{src:"string"==typeof S.appearance.logo?S.appearance.logo:S.appearance.logo.props.src}),E.children]})},exports.getEmbeddedConnectedWallet=function(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null},exports.usePrivyModal=()=>N.useContext(R);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("viem"),a=require("./user-BXtysx2D.js"),n=require("./useWallets-7cJEdKfK.js"),r=require("./privy-context-BOQWqAyX.js"),i=require("./getEmbeddedConnectedWallet-DGmyS1bb.js"),o=require("permissionless"),s=require("permissionless/accounts"),l=require("permissionless/clients/pimlico"),u=require("viem/account-abstraction"),d=require("zod"),c=require("bs58"),p=require("ethers"),_=require("libphonenumber-js/max");function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var z=m(d),g=m(c);let b;var h=((b=h||{}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",b.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",b.MISSING_OR_INVALID_PRIVY_CLIENT_ID="missing_or_invalid_privy_client_id",b.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",b.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",b.MISSING_OR_INVALID_MFA="missing_or_invalid_mfa",b.EXPIRED_OR_INVALID_MFA_TOKEN="expired_or_invalid_mfa_token",b.INVALID_DATA="invalid_data",b.INVALID_CREDENTIALS="invalid_credentials",b.INVALID_CAPTCHA="invalid_captcha",b.LINKED_TO_ANOTHER_USER="linked_to_another_user",b.ALLOWLIST_REJECTED="allowlist_rejected",b.CANNOT_UNLINK_EMBEDDED_WALLET="cannot_unlink_embedded_wallet",b.CANNOT_UNLINK_SOLE_ACCOUNT="cannot_unlink_sole_account",b.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",b.LINKED_ACCOUNT_NOT_FOUND="linked_account_not_found",b.TOO_MANY_REQUESTS="too_many_requests",b.INVALID_ORIGIN="invalid_origin",b.MISSING_ORIGIN="missing_origin",b.INVALID_NATIVE_APP_ID="invalid_native_app_id",b.TOKEN_ALREADY_USED="token_already_used",b.ALREADY_LOGGED_OUT="already_logged_out",b.NOT_SUPPORTED="not_supported",b.USER_UNSUBSCRIBED="user_unsubscribed",b.MAX_APPS_REACHED="max_apps_reached",b.USER_LIMIT_REACHED="max_accounts_reached",b.DEVICE_REVOKED="device_revoked",b.WALLET_PASSWORD_EXISTS="wallet_password_exists",b.OAUTH_STATE_MISMATCH="oauth_state_mismatch",b.MAX_DENYLIST_ENTRIES_REACHED="max_denylist_entries_reached",b.DISALLOWED_LOGIN_METHOD="disallowed_login_method",b.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",b.DISALLOWED_RECOVERY_METHOD="disallowed_recovery_method",b.LEGACY_DASHBOARD_LOGIN_CONFIGURATION="legacy_dashboard_login_configuration",b.CANNOT_SET_PASSWORD="cannot_set_password",b.INVALID_PKCE_PARAMETERS="invalid_pkce_parameters",b.INVALID_APP_URL_SCHEME_CONFIGURATION="invalid_app_url_scheme_configuration",b.CROSS_APP_CONNECTION_NOT_ALLOWED="cross_app_connection_not_allowed",b.USER_DOES_NOT_EXIST="user_does_not_exist",b.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",b.USER_HAS_NOT_DELEGATED_WALLET="user_has_not_delegated_wallet",b.FEATURE_NOT_ENABLED="feature_not_enabled",b.INSUFFICIENT_FUNDS="insufficient_funds",b.TRANSACTION_BROADCAST_FAILURE="transaction_broadcast_failure",b),f=class extends Error{toString(){return`${this.constructor.name}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,a,n){super(t),this.code=a,this.status=e,this.responseData=n}},y=class extends f{constructor(e,t){super(400,e,t||"invalid_data")}},v=class extends f{constructor(e,t){super(401,e,t)}},I=class extends f{constructor(e,t){super(422,e,t)}};function S(e,t){return Object.keys(t).forEach((function(a){"default"===a||"__esModule"===a||Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[a]}})})),e}function T(e,t,a,n){Object.defineProperty(e,t,{get:a,set:n,enumerable:!0,configurable:!0})}d.z.object({error:d.z.string(),cause:d.z.string().optional(),code:d.z.nativeEnum(h).optional()});var E={},A={};T(A,"AnalyticsEvent",(()=>k));let k={path:"/api/v1/analytics_events",method:"POST"};var P={};T(P,"AppConfig",(()=>O));let O={path:"/api/v1/apps/:app_id",method:"GET"};var j={};T(j,"CoinbaseOnRampInit",(()=>w)),T(j,"CoinbaseOnRampStatus",(()=>C));let w={path:"/api/v1/funding/coinbase_on_ramp/init",method:"POST"},C={path:"/api/v1/funding/coinbase_on_ramp/status",method:"GET"};var R={};T(R,"GetCrossAppConnections",(()=>D));let D={path:"/api/v1/apps/:app_id/cross-app/connections",method:"GET"};var N={};T(N,"CustomJWTAuthenticate",(()=>U));let U={path:"/api/v1/custom_jwt_account/authenticate",method:"POST"};var L={};T(L,"FarcasterInit",(()=>M)),T(L,"FarcasterAuthenticate",(()=>W)),T(L,"FarcasterLink",(()=>x)),T(L,"FarcasterUnlink",(()=>F)),T(L,"FarcasterStatus",(()=>G)),T(L,"FarcasterV2Init",(()=>V)),T(L,"FarcasterV2Authenticate",(()=>B));let M={path:"/api/v1/farcaster/init",method:"POST"},W={path:"/api/v1/farcaster/authenticate",method:"POST"},x={path:"/api/v1/farcaster/link",method:"POST"},F={path:"/api/v1/farcaster/unlink",method:"POST"},G={path:"/api/v1/farcaster/status",method:"GET"},V={path:"/api/v2/farcaster/init",method:"POST"},B={path:"/api/v2/farcaster/authenticate",method:"POST"};var H={};T(H,"FarcasterSignerInit",(()=>q)),T(H,"FarcasterSignerStatus",(()=>Y));let q={path:"/api/v1/farcaster/signer/init",method:"POST"},Y={path:"/api/v1/farcaster/signer/status",method:"POST"};var K={};T(K,"GuestAuthenticate",(()=>$));let $={path:"/api/v1/guest/authenticate",method:"POST"};var J={};T(J,"MfaPasskeyInit",(()=>X)),T(J,"MfaPasskeyVerify",(()=>Q)),T(J,"MfaPasskeyEnrollment",(()=>Z));let X={path:"/api/v1/mfa/passkeys/init",method:"POST"},Q={path:"/api/v1/mfa/passkeys/verify",method:"POST"},Z={path:"/api/v1/mfa/passkeys/enrollment",method:"POST"};var ee={};T(ee,"MfaPasswordlessSmsEnroll",(()=>te)),T(ee,"MfaPasswordlessSmsVerify",(()=>ae)),T(ee,"MfaPasswordlessSmsInit",(()=>ne)),T(ee,"MfaPasswordlessSmsUnenroll",(()=>re));let te={path:"/api/v1/mfa/passwordless_sms/enroll",method:"POST"},ae={path:"/api/v1/mfa/passwordless_sms/verify",method:"POST"},ne={path:"/api/v1/mfa/passwordless_sms/init",method:"POST"},re={path:"/api/v1/mfa/passwordless_sms/unenroll",method:"POST"};var ie={};T(ie,"MfaTotpEnroll",(()=>oe)),T(ie,"MfaTotpVerify",(()=>se)),T(ie,"MfaTotpInit",(()=>le)),T(ie,"MfaTotpUnenroll",(()=>ue));let oe={path:"/api/v1/mfa/totp/enroll",method:"POST"},se={path:"/api/v1/mfa/totp/verify",method:"POST"},le={path:"/api/v1/mfa/totp/init",method:"POST"},ue={path:"/api/v1/mfa/totp/unenroll",method:"POST"};var de={};T(de,"OAuthAuthenticate",(()=>ce)),T(de,"OAuthInit",(()=>pe)),T(de,"OAuthLink",(()=>_e)),T(de,"OAuthUnlink",(()=>me));let ce={path:"/api/v1/oauth/authenticate",method:"POST"},pe={path:"/api/v1/oauth/init",method:"POST"},_e={path:"/api/v1/oauth/link",method:"POST"},me={path:"/api/v1/oauth/unlink",method:"POST"};var ze={};T(ze,"OAuthProviderAuthorize",(()=>ge)),T(ze,"OAuthProviderVerify",(()=>be));let ge={path:"/oauth/authorization_code",method:"POST"},be={path:"/oauth/verify",method:"POST"};var he={};T(he,"PasskeyLink",(()=>fe)),T(he,"PasskeyAuthenticate",(()=>ye)),T(he,"PasskeyAuthenticateInit",(()=>ve)),T(he,"PasskeyLinkInit",(()=>Ie)),T(he,"PasskeyUnlink",(()=>Se));let fe={path:"/api/v1/passkeys/link",method:"POST"},ye={path:"/api/v1/passkeys/authenticate",method:"POST"},ve={path:"/api/v1/passkeys/authenticate/init",method:"POST"},Ie={path:"/api/v1/passkeys/link/init",method:"POST"},Se={path:"/api/v1/passkeys/unlink",method:"POST"};var Te={};T(Te,"PasswordlessAuthenticate",(()=>Ee)),T(Te,"PasswordlessInit",(()=>Ae)),T(Te,"PasswordlessLink",(()=>ke)),T(Te,"PasswordlessUnlink",(()=>Pe)),T(Te,"PasswordlessUpdate",(()=>Oe));let Ee={path:"/api/v1/passwordless/authenticate",method:"POST"},Ae={path:"/api/v1/passwordless/init",method:"POST"},ke={path:"/api/v1/passwordless/link",method:"POST"},Pe={path:"/api/v1/passwordless/unlink",method:"POST"},Oe={path:"/api/v1/passwordless/update",method:"POST"};var je={};T(je,"PasswordlessSmsAuthenticate",(()=>we)),T(je,"PasswordlessSmsInit",(()=>Ce)),T(je,"PasswordlessSmsLink",(()=>Re)),T(je,"PasswordlessSmsUnlink",(()=>De)),T(je,"PasswordlessSmsUpdate",(()=>Ne));let we={path:"/api/v1/passwordless_sms/authenticate",method:"POST"},Ce={path:"/api/v1/passwordless_sms/init",method:"POST"},Re={path:"/api/v1/passwordless_sms/link",method:"POST"},De={path:"/api/v1/passwordless_sms/unlink",method:"POST"},Ne={path:"/api/v1/passwordless_sms/update",method:"POST"};var Ue={};T(Ue,"RecoveryKeyMaterial",(()=>Le)),T(Ue,"RecoveryOAuthInit",(()=>Me)),T(Ue,"RecoveryOAuthAuthenticate",(()=>We)),T(Ue,"RecoveryOAuthInitICloud",(()=>xe)),T(Ue,"RecoveryOAuthCallbackICloudExpo",(()=>Fe)),T(Ue,"RecoveryConfigurationICloud",(()=>Ge));let Le={path:"/api/v1/embedded_wallets/:address/recovery/key_material",method:"POST"},Me={path:"/api/v1/recovery/oauth/init",method:"POST"},We={path:"/api/v1/recovery/oauth/authenticate",method:"POST"},xe={path:"/api/v1/recovery/oauth/init_icloud",method:"POST"},Fe={path:"/api/v1/recovery/oauth/callback_icloud/:app_id/expo_ios",method:"GET"},Ge={path:"/api/v1/recovery/configuration_icloud",method:"POST"};var Ve={};T(Ve,"getPathWithParams",(()=>Be));let Be=(e,t)=>t?Object.entries(t).reduce(((e,[t,a])=>e.replace(`:${t}`,`${a}`)),e):e;var He={};T(He,"RefreshSession",(()=>qe)),T(He,"Logout",(()=>Ye));let qe={path:"/api/v1/sessions",method:"POST"},Ye={path:"/api/v1/sessions/logout",method:"POST"};var Ke={};T(Ke,"GetSmartWalletConfig",(()=>$e)),T(Ke,"PostSmartWalletConfig",(()=>Je));let $e={path:"/api/v1/apps/:app_id/smart_wallets",method:"GET"},Je={path:"/api/v1/apps/:app_id/smart_wallets",method:"POST"};var Xe={};T(Xe,"SiweInit",(()=>Qe)),T(Xe,"SiweAuthenticate",(()=>Ze)),T(Xe,"SiweLink",(()=>et)),T(Xe,"SiweLinkSmartWallet",(()=>tt)),T(Xe,"SiweUnlink",(()=>at));let Qe={path:"/api/v1/siwe/init",method:"POST"},Ze={path:"/api/v1/siwe/authenticate",method:"POST"},et={path:"/api/v1/siwe/link",method:"POST"},tt={path:"/api/v1/siwe/link_smart_wallet",method:"POST"},at={path:"/api/v1/siwe/unlink",method:"POST"};var nt={};T(nt,"SiwsInit",(()=>rt)),T(nt,"SiwsAuthenticate",(()=>it)),T(nt,"SiwsLink",(()=>ot)),T(nt,"SiwsUnlink",(()=>st));let rt={path:"/api/v1/siws/init",method:"POST"},it={path:"/api/v1/siws/authenticate",method:"POST"},ot={path:"/api/v1/siws/link",method:"POST"},st={path:"/api/v1/siws/unlink",method:"POST"};var lt={};T(lt,"AcceptTermsOnUser",(()=>ut));let ut={path:"/api/v1/users/me/accept_terms",method:"POST"};var dt={};T(dt,"TelegramAuthenticate",(()=>ct)),T(dt,"TelegramLink",(()=>pt)),T(dt,"TelegramUnlink",(()=>_t));let ct={path:"/api/v1/telegram/authenticate",method:"POST"},pt={path:"/api/v1/telegram/link",method:"POST"},_t={path:"/api/v1/telegram/unlink",method:"POST"};var mt={};T(mt,"MoonpayOnRampSign",(()=>zt));let zt={path:"/api/v1/plugins/moonpay_on_ramp/sign",method:"POST"};S(E,A),S(E,P),S(E,j),S(E,R),S(E,N),S(E,L),S(E,H),S(E,K),S(E,J),S(E,ee),S(E,ie),S(E,de),S(E,ze),S(E,he),S(E,Te),S(E,je),S(E,Ue),S(E,Ve),S(E,He),S(E,Ke),S(E,Xe),S(E,nt),S(E,lt),S(E,dt),S(E,mt);var gt={},bt={};T(bt,"AnalyticsEventInput",(()=>ht));let ht=d.z.object({event_name:d.z.string().max(255),client_id:d.z.string().max(255).nullable(),payload:d.z.record(d.z.any()).optional()});var ft={};T(ft,"AccountIdFromPath",(()=>wt)),T(ft,"AppIdFromPath",(()=>Ct)),T(ft,"Pagination",(()=>Rt));var yt={};T(yt,"UserId",(()=>vt)),T(yt,"Email",(()=>It)),T(yt,"PasswordlessCode",(()=>St)),T(yt,"WalletAddress",(()=>Tt)),T(yt,"normalizeEthereumAddress",(()=>Ot)),T(yt,"SolanaWalletAddress",(()=>Et)),T(yt,"PhoneNumber",(()=>At)),T(yt,"normalizePhoneNumber",(()=>kt)),T(yt,"isValidAddress",(()=>Pt)),T(yt,"AuthenticateMode",(()=>jt));let vt=d.z.string({required_error:"Privy DID must be included",invalid_type_error:"Privy DID is not a valid string"}).min(1).transform((e=>e.replace("did:privy:",""))),It=d.z.string({required_error:"Email address must be provided",invalid_type_error:"Email address must be a valid string"}).email("Invalid email address").transform((e=>e.toLowerCase())),St=d.z.string({required_error:"Verification code must be provided",invalid_type_error:"Invalid verification code"}).length(6,"Verification code must have 6 digits."),Tt=d.z.string({required_error:"Ethereum address must be provided",invalid_type_error:"Invalid Ethereum address"}).transform(((e,t)=>Ot(e)||(t.addIssue({code:d.z.ZodIssueCode.custom,message:"Invalid Ethereum address"}),d.z.NEVER))),Et=d.z.string({required_error:"Solana address must be provided",invalid_type_error:"Invalid Solana address"}).trim().transform(((e,t)=>{try{g.default.decode(e)}catch(e){return t.addIssue({code:d.z.ZodIssueCode.custom,message:"Invalid Solana address"}),d.z.NEVER}return e})),At=d.z.string({required_error:"Phone number must be included",invalid_type_error:"Phone number is not a valid string"}).refine((e=>{try{return void 0!==kt(e)}catch(e){return!1}}),{message:"Phone number is not valid"}).transform((e=>kt(e)||""));function kt(e){let t=_.parsePhoneNumber(e,"US");if(t?.isPossible())return t.formatInternational()}function Pt(e){return!!Ot(e)}function Ot(e){if("string"==typeof e)try{return p.ethers.utils.getAddress(e.trim())}catch(e){}}let jt=d.z.object({mode:d.z.enum(["no-signup","login-or-sign-up"]).optional()}),wt=d.z.object({account_id:d.z.string({required_error:"Account ID must be provided",invalid_type_error:"Account ID is not a valid string"}).min(1)}),Ct=d.z.object({app_id:d.z.string({required_error:"App ID must be provided",invalid_type_error:"App ID is not a valid string"}).min(1)}).transform((({app_id:e})=>({app_id:e,appId:e}))).catch((({error:e})=>{throw new y(e.message,h.MISSING_OR_INVALID_PRIVY_APP_ID)})),Rt=d.z.object({cursor:vt.optional(),limit:d.z.coerce.number().max(100,{message:"Query limit can be at maximum 100 records."}).optional()});var Dt={};T(Dt,"AppResponseSchema",(()=>Vt));var Nt={};T(Nt,"EmbeddedWalletConfigSchema",(()=>Mt)),T(Nt,"TelegramAuthConfigSchema",(()=>Wt)),T(Nt,"FundingMethodEnum",(()=>xt)),T(Nt,"FundingMethodArraySchema",(()=>Ft)),T(Nt,"FundingConfigResponseSchema",(()=>Gt));var Ut={};T(Ut,"Currency",(()=>Lt));let Lt=z.default.object({chain:z.default.string(),asset:z.default.enum(["native-currency","USDC"]).optional()}),Mt=z.default.object({create_on_login:z.default.enum(["users-without-wallets","all-users","off"]),user_owned_recovery_options:z.default.array(z.default.enum(["user-passcode","google-drive","icloud"])),require_user_owned_recovery_on_create:z.default.boolean().optional(),require_user_password_on_create:z.default.boolean().optional()}),Wt=z.default.object({bot_id:z.default.string(),bot_name:z.default.string(),link_enabled:z.default.boolean(),seamless_auth_enabled:z.default.boolean()}),xt=z.default.enum(["moonpay","coinbase-onramp","external"]),Ft=z.default.array(xt),Gt=z.default.object({default_recommended_currency:Lt,default_recommended_amount:z.default.string(),methods:Ft,options:z.default.array(z.default.object({method:z.default.string(),provider:z.default.string()})),prompt_funding_on_wallet_creation:z.default.boolean(),cross_chain_bridging_enabled:z.default.boolean()}),Vt=d.z.object({id:d.z.string(),name:d.z.string(),logo_url:d.z.string().nullable(),icon_url:d.z.string().nullable(),terms_and_conditions_url:d.z.string().nullable(),privacy_policy_url:d.z.string().nullable(),require_users_accept_terms:d.z.boolean().nullable(),theme:d.z.string(),accent_color:d.z.string().nullable(),show_wallet_login_first:d.z.boolean(),allowed_domains:d.z.array(d.z.string()),allowed_native_app_ids:d.z.array(d.z.string()),allowed_native_app_url_schemes:d.z.array(d.z.string()),wallet_auth:d.z.boolean(),email_auth:d.z.boolean(),sms_auth:d.z.boolean(),google_oauth:d.z.boolean(),twitter_oauth:d.z.boolean(),discord_oauth:d.z.boolean(),github_oauth:d.z.boolean(),spotify_oauth:d.z.boolean(),instagram_oauth:d.z.boolean(),tiktok_oauth:d.z.boolean(),linkedin_oauth:d.z.boolean(),apple_oauth:d.z.boolean(),farcaster_auth:d.z.boolean(),passkey_auth:d.z.boolean(),telegram_auth:d.z.boolean(),guest_auth:d.z.boolean(),solana_wallet_auth:d.z.boolean(),disable_plus_emails:d.z.boolean(),allowlist_enabled:d.z.boolean(),allowlist_config:d.z.object({error_title:d.z.string().nullable(),error_detail:d.z.string().nullable(),cta_text:d.z.string().nullable(),cta_link:d.z.string().nullable()}),wallet_connect_cloud_project_id:d.z.string().nullable(),custom_api_url:d.z.string().nullable(),embedded_wallet_config:Mt,enforce_wallet_uis:d.z.boolean(),legacy_wallet_ui_config:d.z.boolean(),fiat_on_ramp_enabled:d.z.boolean(),captcha_enabled:d.z.boolean(),twitter_oauth_on_mobile_enabled:d.z.boolean(),mfa_methods:d.z.array(d.z.enum(["sms","totp","passkey"])),captcha_site_key:d.z.string().optional(),verification_key:d.z.string(),telegram_auth_config:Wt.optional(),funding_config:Gt.optional(),max_linked_wallets_per_user:d.z.number().nullable(),farcaster_link_wallets_enabled:d.z.boolean()});var Bt={};T(Bt,"CoinbaseOnRampInitInput",(()=>Jt)),T(Bt,"CoinbaseOnRampInitResponse",(()=>Xt)),T(Bt,"CoinbaseOnRampStatusResponse",(()=>Qt));let Ht=d.z.enum(["ethereum","bitcoin","base","avacchain","optimism","solana","polygon","arbitrum","stellar"]),qt=d.z.enum(["eth","ETH","USDC"]).transform((e=>e.toUpperCase())),Yt=d.z.enum(["SOL","USDC"]).transform((e=>e.toUpperCase())),Kt=d.z.object({addresses:d.z.array(d.z.object({address:Tt,blockchains:d.z.array(Ht)})).max(1).min(1),assets:d.z.array(qt).optional()}),$t=d.z.object({addresses:d.z.array(d.z.object({address:Et,blockchains:d.z.array(Ht)})).max(1).min(1),assets:d.z.array(Yt).optional()}),Jt=d.z.union([Kt,$t]),Xt=d.z.object({app_id:d.z.string(),session_token:d.z.string(),channel_id:d.z.string(),partner_user_id:d.z.string()}),Qt=d.z.object({status:d.z.enum(["pending","success","failure"])});var Zt={};T(Zt,"CrossAppConnectionsResponse",(()=>ea));let ea=d.z.object({connections:d.z.array(d.z.object({provider_app_id:d.z.string(),provider_app_name:d.z.string(),provider_app_icon_url:d.z.string().url().nullable(),provider_app_custom_api_url:d.z.string().url().nullable(),read_only:d.z.boolean()}))});var ta={};T(ta,"AuthenticateJwtInput",(()=>aa));let aa=z.default.object({token:z.default.string().optional()});var na={};T(na,"VerifyEmailInput",(()=>ia)),T(na,"AuthenticateEmailInput",(()=>oa)),T(na,"InitEmailInput",(()=>sa)),T(na,"UnlinkEmailInput",(()=>la)),T(na,"UpdateEmailInput",(()=>ua)),T(na,"TransferEmailInput",(()=>da));let ra=d.z.object({nonce:d.z.string()}),ia=d.z.object({code:St,email:It}),oa=ia.merge(jt),sa=d.z.object({email:It,token:d.z.string().optional()}),la=d.z.object({address:It}),ua=d.z.object({oldAddress:It,newAddress:It,code:St}),da=ra.extend({email:It});var ca={};T(ca,"JsonWebKey",(()=>pa)),T(ca,"JsonWebKeySet",(()=>_a));let pa=d.z.object({kty:d.z.string(),use:d.z.enum(["sig","enc"]).optional(),key_ops:d.z.array(d.z.enum(["sign","verify","encrypt","decrypt","wrapKey","unwrapKey","deriveKey","deriveBits"])).optional(),alg:d.z.enum(["RS256"]),kid:d.z.string().optional(),x5u:d.z.string().optional(),x5c:d.z.array(d.z.string()).optional(),x5t:d.z.string().optional(),"x5t#S256":d.z.string().optional(),n:d.z.string().optional(),e:d.z.string().optional(),d:d.z.string().optional()}),_a=d.z.object({keys:d.z.array(pa)});var ma={};T(ma,"FarcasterConnectInitResponse",(()=>za)),T(ma,"FarcasterConnectStatusCompletedResponse",(()=>ga)),T(ma,"FarcasterConnectStatusPendingResponse",(()=>ba)),T(ma,"FarcasterAuthenticateInput",(()=>ha)),T(ma,"FarcasterLinkInput",(()=>fa)),T(ma,"FarcasterInitInput",(()=>ya)),T(ma,"FarcasterUnlinkInput",(()=>va)),T(ma,"TransferFarcasterInput",(()=>Ia)),T(ma,"FarcasterV2InitInput",(()=>Sa)),T(ma,"FarcasterV2InitResponse",(()=>Ta)),T(ma,"FarcasterV2AuthenticateInput",(()=>Ea));let za=d.z.object({channel_token:d.z.string(),connect_uri:d.z.string()}),ga=d.z.object({state:d.z.literal("completed"),nonce:d.z.string(),message:d.z.string(),signature:d.z.string(),fid:d.z.number(),username:d.z.string(),display_name:d.z.string(),bio:d.z.string(),pfp_url:d.z.string()}),ba=d.z.object({state:d.z.literal("pending"),nonce:d.z.string()}),ha=d.z.object({channel_token:d.z.string(),message:d.z.string(),signature:d.z.string(),fid:d.z.number()}).merge(jt),fa=d.z.object({channel_token:d.z.string(),message:d.z.string(),signature:d.z.string(),fid:d.z.number()}),ya=d.z.object({token:d.z.string().optional(),redirect_url:d.z.string().url().optional(),relying_party:d.z.string().optional()}),va=d.z.object({fid:d.z.number()}),Ia=ra.extend({farcaster_id:d.z.string(),farcaster_embedded_address:d.z.string()}),Sa=d.z.object({}),Ta=d.z.object({nonce:d.z.string(),expires_at:d.z.string()}),Ea=d.z.object({fid:d.z.number(),message:d.z.string(),signature:d.z.string()}).merge(jt);var Aa={};T(Aa,"FarcasterSignerInitInput",(()=>ka)),T(Aa,"FarcasterSignerInitResponse",(()=>Pa)),T(Aa,"FarcasterSignerStatusResponse",(()=>Oa));let ka=d.z.object({ed25519_public_key:d.z.string().refine((e=>e.startsWith("0x")&&66===e.length)),deadline:d.z.bigint().optional().default((()=>BigInt(Math.floor(Date.now()/1e3)+3600)))}),Pa=d.z.discriminatedUnion("status",[d.z.object({public_key:d.z.string(),status:d.z.literal("pending_approval"),signer_approval_url:d.z.string()}),d.z.object({public_key:d.z.string(),status:d.z.literal("approved"),fid:d.z.bigint()}),d.z.object({public_key:d.z.string(),status:d.z.literal("revoked"),fid:d.z.bigint()})]),Oa=d.z.discriminatedUnion("status",[d.z.object({public_key:d.z.string(),status:d.z.literal("pending_approval")}),d.z.object({public_key:d.z.string(),status:d.z.literal("approved"),fid:d.z.bigint()}),d.z.object({public_key:d.z.string(),status:d.z.literal("revoked"),fid:d.z.bigint()})]);var ja={};T(ja,"AuthenticateGuestInput",(()=>wa));let wa=d.z.object({guest_credential:d.z.string().length(43)}).strict();var Ca={};T(Ca,"EmailIdTokenEntry",(()=>Ln)),T(Ca,"PhoneIdTokenEntry",(()=>Mn)),T(Ca,"EthereumIdTokenEntry",(()=>Wn)),T(Ca,"SolanaIdTokenEntry",(()=>xn)),T(Ca,"FarcasterIdTokenEntry",(()=>Fn)),T(Ca,"PasskeyIdTokenEntry",(()=>Gn)),T(Ca,"TelegramIdTokenEntry",(()=>Vn)),T(Ca,"EthereumEmbeddedWalletIdTokenEntry",(()=>Bn)),T(Ca,"SolanaEmbeddedWalletIdTokenEntry",(()=>Hn)),T(Ca,"GoogleOauthIdTokenEntry",(()=>qn)),T(Ca,"TwitterOauthIdTokenEntry",(()=>Yn)),T(Ca,"DiscordOauthIdTokenEntry",(()=>Kn)),T(Ca,"GithubOauthIdTokenEntry",(()=>$n)),T(Ca,"LinkedInOauthIdTokenEntry",(()=>Jn)),T(Ca,"SpotifyOauthIdTokenEntry",(()=>Xn)),T(Ca,"InstagramOauthIdTokenEntry",(()=>Qn)),T(Ca,"TiktokOauthIdTokenEntry",(()=>Zn)),T(Ca,"AppleOauthIdTokenEntry",(()=>er)),T(Ca,"CustomJwtIdTokenEntry",(()=>tr)),T(Ca,"CrossAppIdTokenEntry",(()=>ar)),T(Ca,"SmartWalletIdTokenEntry",(()=>nr));var Ra={};T(Ra,"EmailAccount",(()=>$a)),T(Ra,"PhoneAccount",(()=>Ja)),T(Ra,"BaseWalletAccount",(()=>Xa)),T(Ra,"EthereumAccount",(()=>Qa)),T(Ra,"SmartWalletAccount",(()=>Za)),T(Ra,"SolanaAccount",(()=>en)),T(Ra,"FarcasterAccount",(()=>tn)),T(Ra,"PasskeyAccount",(()=>an)),T(Ra,"TelegramAccount",(()=>nn)),T(Ra,"EthereumEmbeddedWalletAccount",(()=>sn)),T(Ra,"SolanaEmbeddedWalletAccount",(()=>ln)),T(Ra,"BitcoinSegwitEmbeddedWalletAccount",(()=>un)),T(Ra,"BitcoinTaprootEmbeddedWalletAccount",(()=>dn)),T(Ra,"GoogleOauthAccount",(()=>cn)),T(Ra,"TwitterOauthAccount",(()=>pn)),T(Ra,"DiscordOauthAccount",(()=>_n)),T(Ra,"GithubOauthAccount",(()=>mn)),T(Ra,"LinkedInOauthAccount",(()=>zn)),T(Ra,"SpotifyOauthAccount",(()=>gn)),T(Ra,"InstagramOauthAccount",(()=>bn)),T(Ra,"TiktokOauthAccount",(()=>hn)),T(Ra,"AppleOauthAccount",(()=>fn)),T(Ra,"CustomJwtAccount",(()=>yn)),T(Ra,"CrossAppEmbeddedWallet",(()=>vn)),T(Ra,"CrossAppSmartWallet",(()=>In)),T(Ra,"CrossAppAccount",(()=>Sn)),T(Ra,"LinkedAccount",(()=>Tn)),T(Ra,"SmsMfaMethod",(()=>En)),T(Ra,"TotpMfaMethod",(()=>An)),T(Ra,"PasskeyMfaMethod",(()=>kn)),T(Ra,"LinkedMfaMethod",(()=>Pn)),T(Ra,"CustomMetadata",(()=>On)),T(Ra,"OAuthTokens",(()=>jn)),T(Ra,"User",(()=>wn)),T(Ra,"SessionUpdateActionEnum",(()=>Cn)),T(Ra,"AuthenticatedUser",(()=>Rn)),T(Ra,"LoggedOutUser",(()=>Dn)),T(Ra,"MaybeUser",(()=>Nn));var Da={};T(Da,"SmartWalletProvider",(()=>Fa)),T(Da,"AlchemyPaymasterContextSchema",(()=>Va)),T(Da,"SmartWalletNetworkConfigurationInputSchema",(()=>Ha)),T(Da,"SmartWalletConfigurationSchema",(()=>qa)),T(Da,"SmartWalletConfigurationInputSchema",(()=>Ya)),T(Da,"SmartWalletConfigurationResponseSchema",(()=>Ka)),T(Da,"SAFE",(()=>Na)),T(Da,"KERNEL",(()=>Ua)),T(Da,"LIGHT_ACCOUNT",(()=>Ma)),T(Da,"BICONOMY",(()=>La)),T(Da,"COINBASE_SMART_WALLET",(()=>Wa)),T(Da,"SUPPORTED_SMART_WALLET_TYPES",(()=>xa));let Na="safe",Ua="kernel",La="biconomy",Ma="light_account",Wa="coinbase_smart_wallet",xa=[Na,Ua,La,Ma,Wa],Fa=d.z.enum(xa,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Ga=d.z.string().regex(/^eip155:\d+$/,"Chain ID must be an eip155 chain ID"),Va=d.z.object({policy_id:d.z.string().uuid()}),Ba=d.z.object({chain_id:Ga,bundler_url:d.z.string(),paymaster_url:d.z.string().optional(),rpc_url:d.z.string().optional(),chain_name:d.z.string().optional(),paymaster_context:Va.optional()}),Ha=d.z.object({chain_id:Ga,bundler_url:d.z.string().optional(),paymaster_url:d.z.string().optional(),rpc_url:d.z.string().optional(),chain_name:d.z.string().optional(),paymaster_context:Va.optional()}),qa=d.z.discriminatedUnion("enabled",[d.z.object({enabled:d.z.literal(!1)}),d.z.object({enabled:d.z.literal(!0),smart_wallet_type:Fa,configured_networks:d.z.array(Ba).min(1)})]),Ya=d.z.discriminatedUnion("enabled",[d.z.object({enabled:d.z.literal(!1)}),d.z.object({enabled:d.z.literal(!0),smart_wallet_type:Fa,configured_networks:d.z.array(Ha).min(1)})]),Ka=qa,$a=d.z.object({type:d.z.literal("email"),address:d.z.string(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Ja=d.z.object({type:d.z.literal("phone"),phoneNumber:d.z.string(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Xa=d.z.object({type:d.z.enum(["wallet","smart_wallet"]),address:d.z.string(),chain_type:d.z.enum(["solana","ethereum"])}),Qa=d.z.object({type:d.z.literal("wallet"),address:d.z.string(),chain_id:d.z.string().optional(),chain_type:d.z.literal("ethereum"),wallet_client:d.z.literal("unknown"),wallet_client_type:d.z.string().optional(),connector_type:d.z.string().optional(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Za=d.z.object({type:d.z.literal("smart_wallet"),address:d.z.string(),smart_wallet_type:Fa,verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),en=d.z.object({type:d.z.literal("wallet"),address:d.z.string(),chain_type:d.z.literal("solana"),wallet_client:d.z.literal("unknown"),wallet_client_type:d.z.string().optional(),connector_type:d.z.string().optional(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),tn=d.z.object({type:d.z.literal("farcaster"),fid:d.z.number(),owner_address:Tt,username:d.z.string().optional(),display_name:d.z.string().optional(),bio:d.z.string().optional(),profile_picture:d.z.string().optional(),profile_picture_url:d.z.string().optional(),homepage_url:d.z.string().optional(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable(),signer_public_key:d.z.string().optional()}),an=d.z.object({type:d.z.literal("passkey"),created_with_browser:d.z.string().optional(),created_with_os:d.z.string().optional(),created_with_device:d.z.string().optional(),credential_id:d.z.string(),authenticator_name:d.z.string().optional(),enrolled_in_mfa:d.z.boolean(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),nn=d.z.object({type:d.z.literal("telegram"),telegram_user_id:d.z.string(),first_name:d.z.string().nullish(),last_name:d.z.string().nullish(),username:d.z.string().nullish(),photo_url:d.z.string().nullish(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}).transform((e=>({...e,telegramUserId:e.telegram_user_id,firstName:e.first_name}))),rn=d.z.enum(["privy","user-passcode","google-drive","icloud"]),on=d.z.object({type:d.z.literal("wallet"),address:d.z.string(),imported:d.z.boolean().default(!1),delegated:d.z.boolean().default(!1),wallet_index:d.z.number(),chain_id:d.z.string(),chain_type:d.z.string(),wallet_client:d.z.literal("privy"),wallet_client_type:d.z.literal("privy"),connector_type:d.z.literal("embedded"),recovery_method:rn,verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),sn=on.merge(d.z.object({chain_type:d.z.literal("ethereum")})),ln=on.merge(d.z.object({chain_type:d.z.literal("solana"),public_key:d.z.string()})),un=on.merge(d.z.object({chain_type:d.z.literal("bitcoin-segwit"),public_key:d.z.string()})),dn=on.merge(d.z.object({chain_type:d.z.literal("bitcoin-taproot"),public_key:d.z.string()})),cn=d.z.object({type:d.z.literal("google_oauth"),subject:d.z.string(),email:d.z.string(),name:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),pn=d.z.object({type:d.z.literal("twitter_oauth"),subject:d.z.string(),username:d.z.string().nullable(),name:d.z.string().nullable(),profile_picture_url:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),_n=d.z.object({type:d.z.literal("discord_oauth"),subject:d.z.string(),username:d.z.string().nullable(),email:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),mn=d.z.object({type:d.z.literal("github_oauth"),subject:d.z.string(),username:d.z.string().nullable(),name:d.z.string().nullable(),email:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),zn=d.z.object({type:d.z.literal("linkedin_oauth"),subject:d.z.string(),name:d.z.string().optional(),email:d.z.string().nullable(),vanity_name:d.z.string().optional(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),gn=d.z.object({type:d.z.literal("spotify_oauth"),subject:d.z.string(),email:d.z.string().nullable(),name:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),bn=d.z.object({type:d.z.literal("instagram_oauth"),subject:d.z.string(),username:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),hn=d.z.object({type:d.z.literal("tiktok_oauth"),subject:d.z.string(),username:d.z.string().nullable(),name:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),fn=d.z.object({type:d.z.literal("apple_oauth"),subject:d.z.string(),email:d.z.string().nullable(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),yn=d.z.object({type:d.z.literal("custom_auth"),custom_user_id:d.z.string(),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),vn=d.z.object({address:d.z.string()}),In=d.z.object({address:d.z.string()}),Sn=d.z.object({type:d.z.literal("cross_app"),subject:d.z.string(),provider_app_id:d.z.string(),embedded_wallets:d.z.array(vn),smart_wallets:d.z.array(In),verified_at:d.z.number(),first_verified_at:d.z.number().nullable(),latest_verified_at:d.z.number().nullable()}),Tn=d.z.union([$a,Ja,Qa,en,Za,sn,ln,un,dn,cn,pn,_n,mn,gn,bn,hn,zn,fn,yn,tn,an,nn,Sn]),En=d.z.object({type:d.z.literal("sms"),verified_at:d.z.number()}),An=d.z.object({type:d.z.literal("totp"),verified_at:d.z.number()}),kn=d.z.object({type:d.z.literal("passkey"),verified_at:d.z.number()}),Pn=d.z.union([En,An,kn]),On=d.z.record(d.z.string(),d.z.union([d.z.string(),d.z.number(),d.z.boolean()])),jn=d.z.object({provider:d.z.string(),access_token:d.z.string(),access_token_expires_in_seconds:d.z.number().optional(),refresh_token:d.z.string().optional(),refresh_token_expires_in_seconds:d.z.number().optional(),scopes:d.z.array(d.z.string()).optional()}),wn=d.z.object({id:d.z.string(),linked_accounts:d.z.array(Tn),mfa_methods:d.z.array(Pn),created_at:d.z.number(),has_accepted_terms:d.z.boolean(),is_guest:d.z.boolean(),custom_metadata:On.optional()}),Cn=d.z.enum(["set","ignore","clear"]),Rn=d.z.object({user:wn,token:d.z.string().min(1).nullable(),privy_access_token:d.z.string().min(1).nullable(),refresh_token:d.z.string().min(1).nullable(),identity_token:d.z.string().min(1).optional(),is_new_user:d.z.boolean().optional(),oauth_tokens:jn.optional(),oauth_provider_tokens:d.z.object({provider:d.z.string(),access_token:d.z.string(),access_token_expires_in_seconds:d.z.number().optional(),refresh_token:d.z.string().optional(),scopes:d.z.array(d.z.string()).optional()}).optional(),session_update_action:Cn}),Dn=d.z.object({user:d.z.null(),token:d.z.null(),refresh_token:d.z.null(),session_update_action:d.z.literal(Cn.Values.clear)}),Nn=d.z.union([Rn,Dn]),Un={lv:d.z.number().nullable()},Ln=$a.pick({type:!0,address:!0}).extend(Un),Mn=Ja.pick({type:!0,phoneNumber:!0}).extend(Un).transform((({phoneNumber:e,...t})=>({phone_number:e,...t}))),Wn=Qa.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Un),xn=en.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Un),Fn=tn.pick({type:!0,fid:!0,username:!0,owner_address:!0}).extend(Un).transform((({owner_address:e,...t})=>({oa:e,...t}))),Gn=an.pick({type:!0,credential_id:!0}).extend(Un),Vn=d.z.object({type:d.z.literal("telegram"),telegram_user_id:d.z.string(),username:d.z.string().nullish(),lv:d.z.number().nullable()}),Bn=sn.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Un),Hn=ln.pick({type:!0,address:!0,chain_type:!0,wallet_client_type:!0}).extend(Un),qn=cn.pick({type:!0,subject:!0,email:!0}).extend(Un),Yn=pn.pick({type:!0,subject:!0,username:!0}).extend(Un),Kn=_n.pick({type:!0,subject:!0,username:!0}).extend(Un),$n=mn.pick({type:!0,subject:!0,username:!0}).extend(Un),Jn=zn.pick({type:!0,subject:!0,email:!0}).extend(Un),Xn=gn.pick({type:!0,subject:!0,email:!0}).extend(Un),Qn=bn.pick({type:!0,subject:!0,username:!0}).extend(Un),Zn=hn.pick({type:!0,subject:!0,username:!0}).extend(Un),er=fn.pick({type:!0,subject:!0,email:!0}).extend(Un),tr=yn.pick({type:!0,custom_user_id:!0}).extend(Un),ar=Sn.pick({type:!0,subject:!0,provider_app_id:!0,embedded_wallets:!0,smart_wallets:!0}).extend(Un),nr=Za.pick({type:!0,smart_wallet_type:!0,address:!0}).extend(Un);var rr={};T(rr,"MfaVerifyResponse",(()=>ir)),T(rr,"MfaSmsInitInput",(()=>lr)),T(rr,"MfaSmsAuthenticateEnrollInput",(()=>ur)),T(rr,"MfaSmsEnrollInput",(()=>dr)),T(rr,"MfaSmsVerifyInput",(()=>cr)),T(rr,"MfaTotpInput",(()=>pr)),T(rr,"ResponseTotpInitMfa",(()=>_r));let ir=z.default.object({token:z.default.string()}).strict(),or=z.default.object({action:z.default.literal("verify")}).strict(),sr=z.default.object({action:z.default.literal("enroll"),phoneNumber:At}).strict(),lr=z.default.union([or,sr]),ur=z.default.object({action:z.default.literal("enroll").optional(),code:St,phoneNumber:At}).strict(),dr=z.default.object({code:St,phoneNumber:At}).strict(),cr=z.default.object({code:St}).strict(),pr=z.default.object({code:St}).strict(),_r=z.default.object({totpSecret:z.default.string(),totpAuthUrl:z.default.string()}).strict();var mr={};T(mr,"MfaPasskeyInitInput",(()=>Ar)),T(mr,"ResponsePasskeyInitMfa",(()=>kr)),T(mr,"MfaPasskeyVerifyInput",(()=>Pr)),T(mr,"MfaEnrollmentPasskeyInput",(()=>Or));var zr={};T(zr,"PasskeyAuthenticatorVerifyOptions",(()=>gr)),T(zr,"PasskeyAuthenticatorEnrollmentOptions",(()=>br)),T(zr,"PasskeyAuthenticatorVerifyResponse",(()=>hr)),T(zr,"PasskeyAuthenticatorEnrollmentResponse",(()=>fr)),T(zr,"PasskeyInitInput",(()=>yr)),T(zr,"ResponsePasskeyInitAuthenticate",(()=>vr)),T(zr,"ResponsePasskeyInitLink",(()=>Ir)),T(zr,"PasskeyLinkInput",(()=>Sr)),T(zr,"PasskeyAuthenticateInput",(()=>Tr)),T(zr,"UnlinkPasskeyInput",(()=>Er));let gr=z.default.object({challenge:z.default.string(),timeout:z.default.number().optional(),rp_id:z.default.string().optional(),allow_credentials:z.default.array(z.default.object({id:z.default.string(),type:z.default.string(),transports:z.default.array(z.default.string()).optional()})).optional(),user_verification:z.default.string().optional(),extensions:z.default.object({app_id:z.default.string().optional(),cred_props:z.default.boolean().optional(),hmac_create_secret:z.default.boolean().optional()}).optional()}),br=z.default.object({rp:z.default.object({name:z.default.string(),id:z.default.string().optional()}),user:z.default.object({id:z.default.string(),name:z.default.string(),display_name:z.default.string()}),challenge:z.default.string(),pub_key_cred_params:z.default.array(z.default.object({alg:z.default.number(),type:z.default.literal("public-key")})),timeout:z.default.number().optional(),exclude_credentials:z.default.array(z.default.object({id:z.default.string(),type:z.default.string(),transports:z.default.array(z.default.string()).optional()})).optional(),authenticator_selection:z.default.object({authenticator_attachment:z.default.string().optional(),require_resident_key:z.default.boolean().optional(),resident_key:z.default.string().optional(),user_verification:z.default.string().optional()}).optional(),attestation:z.default.string().optional(),extensions:z.default.object({app_id:z.default.string().optional(),cred_props:z.default.object({rk:z.default.boolean().optional()}).optional(),hmac_create_secret:z.default.boolean().optional()}).optional()}),hr=z.default.object({id:z.default.string(),raw_id:z.default.string(),response:z.default.object({client_data_json:z.default.string(),authenticator_data:z.default.string(),signature:z.default.string(),user_handle:z.default.string().optional()}),authenticator_attachment:z.default.string().optional(),client_extension_results:z.default.object({app_id:z.default.boolean().optional(),cred_props:z.default.object({rk:z.default.boolean().optional()}).optional(),hmac_create_secret:z.default.boolean().optional()}),type:z.default.literal("public-key")}),fr=z.default.object({id:z.default.string(),raw_id:z.default.string(),response:z.default.object({client_data_json:z.default.string(),attestation_object:z.default.string(),authenticator_data:z.default.string().optional(),transports:z.default.array(z.default.any()).optional(),public_key_algorithm:z.default.number().optional(),public_key:z.default.string().optional()}),authenticator_attachment:z.default.string().optional(),client_extension_results:z.default.object({app_id:z.default.boolean().optional(),cred_props:z.default.object({rk:z.default.boolean().optional()}).optional(),hmac_create_secret:z.default.boolean().optional()}),type:z.default.literal("public-key")}),yr=z.default.object({relying_party:z.default.string().url().optional(),token:z.default.string().optional()}).strict(),vr=z.default.object({relying_party:z.default.string().url().optional(),options:gr}).strict(),Ir=z.default.object({relying_party:z.default.string().url().optional(),options:br}).strict(),Sr=z.default.object({relying_party:z.default.string().url().optional(),authenticator_response:fr}).strict(),Tr=z.default.object({relying_party:z.default.string().url().optional(),challenge:z.default.string(),authenticator_response:hr}).strict(),Er=z.default.object({credential_id:z.default.string()}),Ar=z.default.object({relying_party:z.default.string().url().optional()}).strict(),kr=z.default.object({options:gr}).strict(),Pr=z.default.object({authenticator_response:hr,relying_party:z.default.string().url().optional()}).strict(),Or=z.default.object({credential_ids:z.default.array(z.default.string())});var jr={};T(jr,"ExternalOAuthProvider",(()=>Cr)),T(jr,"OAuthProvider",(()=>Rr)),T(jr,"AuthenticateOauthInput",(()=>Dr)),T(jr,"OAuthInitInput",(()=>Nr)),T(jr,"LinkOAuthInput",(()=>Ur)),T(jr,"OAuthUnlinkInput",(()=>Lr)),T(jr,"OAuthInitResponse",(()=>Mr)),T(jr,"OAuthLinkResponse",(()=>Wr)),T(jr,"TransferOAuthInput",(()=>xr)),T(jr,"SUPPORTED_OAUTH_PROVIDERS",(()=>wr));let wr=["google","discord","twitter","github","spotify","instagram","tiktok","linkedin","apple"],Cr=d.z.enum(wr,{invalid_type_error:"Please specify a supported provider.",required_error:"Please specify a supported provider."}),Rr=Cr.or(d.z.custom((e=>"string"==typeof e&&/^privy:[a-z0-9]{25}$/i.test(e)),{message:"Please specify a supported provider."})),Dr=d.z.object({authorization_code:d.z.string(),state_code:d.z.string(),code_verifier:d.z.string().min(43).max(128).optional(),code_type:d.z.enum(["raw"]).optional()}).merge(jt).catch((()=>{throw new v("Please specify authorization_code and state_code.",h.INVALID_CREDENTIALS)})),Nr=d.z.object({redirect_to:d.z.string({required_error:"Please provide a redirect_to value."}),provider:Rr,token:d.z.string().optional(),state_code:d.z.string().optional(),code_challenge:d.z.string().optional()}),Ur=d.z.object({authorization_code:d.z.string(),state_code:d.z.string(),code_verifier:d.z.string().min(43).max(128).optional(),code_type:d.z.enum(["raw"]).optional()}),Lr=d.z.object({subject:d.z.string(),provider:Rr}),Mr=d.z.object({url:d.z.string()}),Wr=wn.extend({oauth_tokens:jn.optional()}),xr=ra.extend({userInfo:d.z.object({subject:d.z.string(),name:d.z.string().optional(),username:d.z.string().optional(),profilePictureUrl:d.z.string().optional(),email:d.z.string().optional(),vanityName:d.z.string().optional()})});var Fr={};T(Fr,"AuthorizationCodeInput",(()=>Gr));let Gr=d.z.object({redirect_to:d.z.string(),state:d.z.string(),code_challenge:d.z.string()});var Vr={};T(Vr,"EmptyObject",(()=>Br)),T(Vr,"SuccessObject",(()=>Hr));let Br=d.z.record(d.z.string(),d.z.never()),Hr=d.z.object({success:d.z.boolean()});var qr={};T(qr,"RecoveryKeyMaterialInput",(()=>Yr)),T(qr,"RecoveryKeyMaterialResponse",(()=>Kr)),T(qr,"OAuthAuthenticateRecoveryResponse",(()=>$r)),T(qr,"OAuthInitRecoveryInput",(()=>Jr)),T(qr,"OAuthInitICloudRecoveryInput",(()=>Xr)),T(qr,"OAuthCallbackICloudExpoInput",(()=>Qr)),T(qr,"OAuthCallbackICloudExpoResponse",(()=>Zr)),T(qr,"RecoveryConfigurationICloudInput",(()=>ei)),T(qr,"RecoveryConfigurationICloudResponse",(()=>ti));let Yr=d.z.object({chain_type:d.z.string().optional()}),Kr=d.z.object({recovery_type:d.z.enum(["user_passcode_derived_recovery_key","privy_passcode_derived_recovery_key","privy_generated_recovery_key","google_drive_recovery_secret","icloud_recovery_secret"]),recovery_key_derivation_salt:d.z.string(),recovery_code:d.z.string(),recovery_key:d.z.string(),file_id:d.z.string(),icloud_record_name:d.z.string()}),$r=d.z.object({access_token:d.z.string()}),Jr=d.z.object({redirect_to:d.z.string({required_error:"Please provide a redirect_to value."}),token:d.z.string().optional(),state_code:d.z.string().optional(),code_challenge:d.z.string().optional()}),Xr=d.z.object({client_type:d.z.enum(["web","expo-ios"])}),Qr=d.z.object({ckWebAuthToken:d.z.string()}).transform((e=>({ckWebAuthToken:e.ckWebAuthToken}))).catch((()=>{throw new v("Missing ckWebAuthToken.",h.INVALID_DATA)})),Zr=Br,ei=d.z.object({client_type:d.z.enum(["web","expo-ios"])}),ti=d.z.object({api_token:d.z.string(),container_identifier:d.z.string(),environment:d.z.string()});var ai={};T(ai,"SiweInput",(()=>ni)),T(ai,"SmartWalletSiweInput",(()=>ri)),T(ai,"AuthenticateSiweInput",(()=>ii)),T(ai,"SiweAddressInput",(()=>oi)),T(ai,"SiweInitInput",(()=>si)),T(ai,"SiweNonce",(()=>li)),T(ai,"TransferSiweInput",(()=>ui));let ni=d.z.object({message:d.z.string({invalid_type_error:"Invalid SIWE message"}),signature:d.z.string({invalid_type_error:"Invalid SIWE signature"}),chainId:d.z.string().max(41).nullable().default(null),walletClientType:d.z.string().max(64).nullable().default(null),connectorType:d.z.string().max(64).nullable().default(null)}),ri=d.z.object({message:d.z.string({invalid_type_error:"Invalid SIWE message"}),signature:d.z.string({invalid_type_error:"Invalid SIWE signature"}),smart_wallet_type:Fa}),ii=ni.merge(jt),oi=d.z.object({address:Tt}),si=d.z.object({address:Tt,token:d.z.string().optional()}),li=d.z.object({nonce:d.z.string(),address:d.z.string(),expires_at:d.z.string()}),ui=ra.extend({address:Tt,chainId:d.z.string().max(41).nullable().default(null),walletClientType:d.z.string().max(64).nullable().default(null),connectorType:d.z.string().max(64).nullable().default(null)});var di={};T(di,"SiwsInput",(()=>ci)),T(di,"AuthenticateSiwsInput",(()=>pi)),T(di,"SiwsAddressInput",(()=>_i)),T(di,"SiwsInitInput",(()=>mi)),T(di,"SiwsNonce",(()=>zi));let ci=d.z.object({message:d.z.string({invalid_type_error:"Invalid SIWS message"}),signature:d.z.string({invalid_type_error:"Invalid SIWS signature"}),walletClientType:d.z.string().max(64).nullable().default(null),connectorType:d.z.string().max(64).nullable().default(null)}),pi=ci.merge(jt),_i=d.z.object({address:Et}),mi=d.z.object({address:Et,token:d.z.string().optional()}),zi=d.z.object({nonce:d.z.string(),address:d.z.string(),expires_at:d.z.string()});var gi={};T(gi,"VerifyPhoneInput",(()=>bi)),T(gi,"AuthenticatePhoneInput",(()=>hi)),T(gi,"PasswordlessSmsPhoneInput",(()=>fi)),T(gi,"UnlinkPhoneInput",(()=>yi)),T(gi,"UpdatePhoneInput",(()=>vi)),T(gi,"TransferPhoneInput",(()=>Ii));let bi=d.z.object({code:St.catch((()=>{throw new I("Invalid SMS verification code",h.INVALID_CREDENTIALS)})),phoneNumber:At.catch((()=>{throw new I("Invalid phone number",h.INVALID_CREDENTIALS)}))}),hi=bi.merge(jt),fi=d.z.object({phoneNumber:At.catch((()=>{throw new I("Invalid phone number, not formatted correctly",h.INVALID_DATA)})),token:d.z.string().optional()}),yi=d.z.object({phoneNumber:At}),vi=d.z.object({old_phone_number:At,new_phone_number:At,code:St}),Ii=ra.extend({phoneNumber:At});var Si={};T(Si,"TelegramAuthenticateInput",(()=>Ei)),T(Si,"TelegramLinkInput",(()=>Ai)),T(Si,"TelegramUnlinkInput",(()=>ki)),T(Si,"TransferTelegramInput",(()=>Pi));let Ti=z.default.object({id:z.default.coerce.number(),first_name:z.default.string(),auth_date:z.default.coerce.number(),hash:z.default.string(),username:z.default.string().optional(),last_name:z.default.string().optional(),photo_url:z.default.string().optional()}),Ei=z.default.object({captcha_token:z.default.string().optional(),telegram_auth_result:Ti.optional(),telegram_web_app_data:z.default.object({query_id:z.default.string().optional(),auth_date:z.default.coerce.number(),hash:z.default.string(),user:z.default.string(),chat_instance:z.default.string().optional(),chat_type:z.default.string().optional(),start_param:z.default.string().optional(),signature:z.default.string().optional()}).optional()}).merge(jt),Ai=Ei.omit({telegram_web_app_data:!0}).required({telegram_auth_result:!0}),ki=z.default.object({telegram_user_id:z.default.string()}),Pi=ra.extend({telegram_auth_result:Ti});var Oi={};T(Oi,"RefreshTokenInput",(()=>ji)),T(Oi,"OptionalRefreshTokenInput",(()=>wi)),T(Oi,"ForkedToken",(()=>Ci));let ji=d.z.object({refresh_token:d.z.string()}),wi=ji.partial(),Ci=d.z.object({token:d.z.string(),refresh_token:d.z.string(),new_session_refresh_token:d.z.string()});var Ri={};T(Ri,"DelegatedActionsConsentInput",(()=>Di));let Di=d.z.object({encrypted_tee_share:d.z.string(),app_share:d.z.string(),delegated_addresses:d.z.array(d.z.object({chain_type:d.z.union([d.z.literal("solana"),d.z.literal("ethereum")]),address:d.z.string(),wallet_index:d.z.number().default(0)}))});var Ni={};T(Ni,"CAIP2",(()=>Ui)),T(Ni,"AuthorizationKeyRole",(()=>Wi)),T(Ni,"WalletApiSolanaSignTransactionRpcInput",(()=>xi)),T(Ni,"WalletApiSolanaSignAndSendTransactionRpcInput",(()=>Fi)),T(Ni,"WalletApiSolanaSignMessageRpcInput",(()=>Gi)),T(Ni,"UnsignedEthereumTransaction",(()=>Hi)),T(Ni,"WalletApiEthereumSignTransactionRpcInput",(()=>qi)),T(Ni,"WalletApiEthereumSendTransactionRpcInput",(()=>Yi)),T(Ni,"WalletApiEthereumPersonalSignRpcInputParams",(()=>Ki)),T(Ni,"WalletApiEthereumPersonalSignRpcInput",(()=>$i)),T(Ni,"WalletApiEthereumSignTypedDataRpcInput",(()=>Ji)),T(Ni,"WalletApiEthereumRpcInput",(()=>Xi)),T(Ni,"WalletApiSolanaRpcInput",(()=>Qi)),T(Ni,"WalletApiRpcInput",(()=>Zi)),T(Ni,"WalletApiSolanaSignTransactionRpcResponse",(()=>eo)),T(Ni,"WalletApiSolanaSignAndSendTransactionRpcResponse",(()=>to)),T(Ni,"WalletApiSolanaSignMessageRpcResponse",(()=>ao)),T(Ni,"WalletApiEthereumSignTransactionRpcResponse",(()=>no)),T(Ni,"WalletApiEthereumSendTransactionRpcResponse",(()=>ro)),T(Ni,"WalletApiEthereumPersonalSignRpcResponse",(()=>io)),T(Ni,"WalletApiEthereumSignTypedDataRpcResponse",(()=>oo)),T(Ni,"WalletApiRpcResponse",(()=>so)),T(Ni,"WalletApiRegisterAuthorizationKeyInput",(()=>lo)),T(Ni,"WalletResponse",(()=>co)),T(Ni,"WalletApiCreateInput",(()=>po)),T(Ni,"WalletIdFromPath",(()=>_o)),T(Ni,"WalletApiRevokeAuthorizationKeyInput",(()=>mo));let Ui=d.z.string().regex(/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/,"Chain ID must be a valid CAIP-2 chain ID, e.g. 'eip155:1'"),Li=d.z.object({address:Et.optional(),chain_type:d.z.literal("solana").optional()}),Mi=d.z.object({address:Tt.optional(),chain_type:d.z.literal("ethereum").optional()}),Wi=d.z.enum(["root","manager"]).nullable(),xi=d.z.object({method:d.z.literal("signTransaction"),params:d.z.object({transaction:d.z.string(),encoding:d.z.literal("base64")})}).merge(Li),Fi=d.z.object({method:d.z.literal("signAndSendTransaction"),caip2:Ui,params:d.z.object({transaction:d.z.string(),encoding:d.z.literal("base64")})}).merge(Li),Gi=d.z.object({method:d.z.literal("signMessage"),params:d.z.object({message:d.z.string(),encoding:d.z.literal("base64")})}).merge(Li),Vi=d.z.string().startsWith("0x"),Bi=d.z.union([Vi,d.z.number()]),Hi=d.z.object({from:Tt.optional(),to:Tt.optional(),chain_id:Bi.optional(),nonce:Bi.optional(),data:Vi.optional(),value:Bi.optional(),type:d.z.union([d.z.literal(0),d.z.literal(1),d.z.literal(2)]).optional(),gas_limit:Bi.optional(),gas_price:Bi.optional(),max_fee_per_gas:Bi.optional(),max_priority_fee_per_gas:Bi.optional()}),qi=d.z.object({method:d.z.literal("eth_signTransaction"),params:d.z.object({transaction:Hi})}).merge(Mi),Yi=d.z.object({method:d.z.literal("eth_sendTransaction"),caip2:Ui,params:d.z.object({transaction:Hi})}).merge(Mi),Ki=d.z.object({message:d.z.string(),encoding:d.z.union([d.z.literal("utf-8"),d.z.literal("hex")])}),$i=d.z.object({method:d.z.literal("personal_sign"),params:Ki}).merge(Mi),Ji=d.z.object({method:d.z.literal("eth_signTypedData_v4"),params:d.z.object({typed_data:d.z.object({domain:d.z.record(d.z.string(),d.z.any()),types:d.z.record(d.z.string(),d.z.any()),message:d.z.record(d.z.string(),d.z.any()),primary_type:d.z.string()})})}).merge(Mi),Xi=d.z.discriminatedUnion("method",[qi,Yi,$i,Ji]),Qi=d.z.discriminatedUnion("method",[xi,Fi,Gi]),Zi=d.z.union([Xi,Qi]),eo=d.z.object({method:d.z.literal("signTransaction"),data:d.z.object({signed_transaction:d.z.string(),encoding:d.z.literal("base64")})}),to=d.z.object({method:d.z.literal("signAndSendTransaction"),data:d.z.object({hash:d.z.string(),caip2:Ui}).optional(),error:d.z.object({code:d.z.string(),message:d.z.string()}).optional()}),ao=d.z.object({method:d.z.literal("signMessage"),data:d.z.object({signature:d.z.string(),encoding:d.z.literal("base64")})}),no=d.z.object({method:d.z.literal("eth_signTransaction"),data:d.z.object({signed_transaction:d.z.string(),encoding:d.z.literal("rlp")})}),ro=d.z.object({method:d.z.literal("eth_sendTransaction"),data:d.z.object({hash:d.z.string(),caip2:Ui}).optional(),error:d.z.object({code:d.z.string(),message:d.z.string()}).optional()}),io=d.z.object({method:d.z.literal("personal_sign"),data:d.z.object({signature:d.z.string(),encoding:d.z.literal("hex")})}),oo=d.z.object({method:d.z.literal("eth_signTypedData_v4"),data:d.z.object({signature:d.z.string(),encoding:d.z.literal("hex")})}),so=d.z.discriminatedUnion("method",[eo,to,ao,no,ro,io,oo]),lo=d.z.object({public_key:d.z.string(),role:Wi.optional()}),uo=d.z.union([d.z.literal("solana"),d.z.literal("ethereum")]),co=d.z.object({id:d.z.string(),address:d.z.string(),chain_type:uo}),po=d.z.object({chain_type:uo,policy_id:d.z.string().optional()}),_o=d.z.object({wallet_id:d.z.string({required_error:"Wallet ID must be provided",invalid_type_error:"Wallet ID is not a valid string"}).min(1)}).catch((({error:e})=>{throw new y(e.message,h.INVALID_DATA)})),mo=d.z.object({id:d.z.string()});var zo={};T(zo,"MoonpayOnRampSignInput",(()=>vo)),T(zo,"MoonpayOnRampSignResponse",(()=>Io));let go=d.z.enum(["ach_bank_transfer","credit_debit_card","gbp_bank_transfer","gbp_open_banking_payment","mobile_wallet","sepa_bank_transfer","sepa_open_banking_payment","pix_instant_payment","yellow_card_bank_transfer"]),bo=d.z.enum(["AVAX_CCHAIN","CELO_CELO","CUSD_CELO","DAI_ETHEREUM","ETH_ETHEREUM","ETH_ARBITRUM","ETH_OPTIMISM","ETH_POLYGON","ETH_BASE","FIL_FVM","MATIC_ETHEREUM","MATIC_POLYGON","USDC_ETHEREUM","USDC_ARBITRUM","USDC_OPTIMISM","USDC_POLYGON","USDC_BASE","USDT_ETHEREUM","USDT_POLYGON","WETH_POLYGON","WBTC_ETHEREUM","BNB_BNB","BNB_BSC","CELO","CUSD","DAI","ETH","FIL","MATIC","USDC","USDT","WETH","WBTC"]),ho=d.z.object({quoteCurrencyAmount:d.z.number().optional(),email:It.optional(),paymentMethod:go.optional(),uiConfig:d.z.object({accentColor:d.z.string().optional(),theme:d.z.enum(["light","dark"]).optional()}).optional()}),fo=d.z.object({address:Tt,config:ho.extend({currencyCode:bo.transform((e=>{switch(e){case"AVAX_CCHAIN":return"AVAX_CCHAIN";case"CELO_CELO":return"CELO";case"CUSD_CELO":return"CUSD";case"DAI_ETHEREUM":return"DAI";case"ETH_ETHEREUM":return"ETH";case"ETH_ARBITRUM":return"ETH_ARBITRUM";case"ETH_OPTIMISM":return"ETH_OPTIMISM";case"ETH_POLYGON":return"ETH_POLYGON";case"ETH_BASE":return"ETH_BASE";case"FIL_FVM":return"FIL";case"MATIC_ETHEREUM":return"MATIC";case"MATIC_POLYGON":return"MATIC_POLYGON";case"USDC_ETHEREUM":return"USDC";case"USDC_ARBITRUM":return"USDC_ARBITRUM";case"USDC_OPTIMISM":return"USDC_OPTIMISM";case"USDC_POLYGON":return"USDC_POLYGON";case"USDC_BASE":return"USDC_BASE";case"USDT_ETHEREUM":return"USDT";case"USDT_POLYGON":return"USDT_POLYGON";case"WETH_POLYGON":return"WETH";case"WBTC_ETHEREUM":return"WBTC";case"BNB_BNB":return"BNB";case"BNB_BSC":return"BNB_BSC";case"CELO":case"CUSD":case"DAI":case"ETH":case"FIL":case"MATIC":case"USDC":case"USDT":case"WETH":case"WBTC":return e;default:throw Error(`Invalid currency code: ${e}`)}})).optional()})}),yo=d.z.object({address:Et,config:ho.extend({currencyCode:d.z.enum(["SOL","USDC_SOL"]).optional()})}),vo=d.z.union([fo,yo]).and(d.z.object({useSandbox:d.z.boolean().optional().default(!1)})),Io=d.z.object({signedUrl:d.z.string(),externalTransactionId:d.z.string()});S(gt,bt),S(gt,ft),S(gt,Dt),S(gt,Nt),S(gt,Bt),S(gt,yt),S(gt,Zt),S(gt,Ut),S(gt,ta),S(gt,na),S(gt,ca),S(gt,ma),S(gt,Aa),S(gt,ja),S(gt,Ca),S(gt,rr),S(gt,mr),S(gt,jr),S(gt,Fr),S(gt,Vr),S(gt,zr),S(gt,qr),S(gt,ai),S(gt,di),S(gt,gi),S(gt,Da),S(gt,Si),S(gt,Oi),S(gt,Ra),S(gt,Ri),S(gt,Ni),S(gt,zo);let So={address:u.entryPoint06Address,version:"0.6"},To={address:u.entryPoint07Address,version:"0.7"},Eo=({owner:e,smartWalletType:t,publicClient:a})=>{switch(t){case Na:return s.toSafeSmartAccount({client:a,entryPoint:To,owners:[e],version:"1.4.1"});case Ua:return s.toEcdsaKernelSmartAccount({client:a,version:"0.3.1",entryPoint:To,owners:[e]});case La:return s.toBiconomySmartAccount({client:a,owners:[e],entryPoint:So});case Ma:return s.toLightSmartAccount({client:a,entryPoint:So,owner:e,version:"1.1.0"});case Wa:return async function({client:e,owner:t}){let[a]=await t.request({method:"eth_accounts"});if(!a)throw Error("Unable to request embedded owner for eth_accounts");return await u.toCoinbaseSmartAccount({client:e,owners:[{type:"local",source:"privy",address:a,sign:async({hash:e})=>await t.request({method:"secp256k1_sign",params:[e]})}]})}({client:a,owner:e});default:throw Error(`Invalid smart account type: ${t}.`)}},Ao=["rpc.zerodev.app","public.pimlico.io","api.pimlico.io"];const ko=({calls:e,chain:t,maxPriorityFeePerGas:a,maxFeePerGas:n,nonce:r})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:r,maxFeePerGas:n,maxPriorityFeePerGas:a}))),Po=async({chain:e,paymasterContext:a,embeddedWallet:i,user:s,smartWalletsConfig:u,rpcConfig:d,privyAppId:c})=>{if(!u?.enabled||!s||!i)return;let p=await i.getEthereumProvider(),_=u?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!_)throw new r.PrivyClientError(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let m=s.smartWallet?.smartWalletType??u.smartWalletType,z=n.getJsonRpcEndpointFromChain(e,d,c),g=t.createPublicClient({chain:e,transport:t.http(z)}),b=a??_.paymasterContext,h=await(async({owner:e,smartWalletType:a,chain:n,publicClient:r,bundlerUrl:i,paymasterUrl:s,paymasterContext:u})=>{let d=await Eo({owner:e,smartWalletType:a,publicClient:r}),c=l.createPimlicoClient({transport:t.http(i),entryPoint:d.entryPoint}),p=s?l.createPimlicoClient({transport:t.http(s),entryPoint:d.entryPoint}):void 0;return o.createSmartAccountClient({account:d,chain:n,paymaster:p,paymasterContext:u,bundlerTransport:t.http(i),userOperation:{estimateFeesPerGas:async()=>{if(Ao.some((e=>i.includes(e))))return await c.getUserOperationGasPrice().then((e=>e.fast));{let e=await r.estimateFeesPerGas(),t=i.includes("api.developer.coinbase.com")?175n:150n;return{...e,maxFeePerGas:e.maxFeePerGas*t/100n,maxPriorityFeePerGas:e.maxPriorityFeePerGas*t/100n}}}}})})({owner:p,smartWalletType:m,chain:e,publicClient:g,paymasterContext:b,..._});if(!h)throw new r.PrivyClientError(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return h};exports.callsToTransactionRequests=ko,exports.getSmartWalletClient=Po,exports.useSmartWalletsWrapper=({clientConfig:t,smartWalletsConfig:o})=>{let{noPromptOnSignature:s,openPrivyModal:l,appId:u}=r.usePrivyInternal(),d=n.useAppConfig(),{setModalData:c}=i.usePrivyModal(),{user:p}=r.usePrivyContext(),{chains:_}=n.useAppConfig(),{chainId:m,clients:z,setChainId:g,chainIdState:b}=(()=>{let t=e.useRef(),[a,n]=e.useState();return{clients:e.useRef({}),setChainId:e=>{t.current=e,n(e)},chainId:t,chainIdState:a}})(),h=_.find((e=>e.id===b)),{wallets:f}=n.useWallets(),y=e.useCallback((async()=>m.current),[m]),v=e.useCallback((async({id:e})=>{if(!z.current[e]){let a=i.getEmbeddedConnectedWallet(f),n=await Po({chain:_.find((t=>t.id===e)),embeddedWallet:a,user:p,paymasterContext:t?.paymasterContext,smartWalletsConfig:o,rpcConfig:d.rpcConfig,privyAppId:u});n&&(z.current[e]=n)}g(e)}),[_,t,f,p,o]);return{wrapSmartAccountClient:e=>{z.current[e.chain.id]=e,b||g(e.chain.id);return{...e,sendTransaction:async e=>{let t=void 0===d.embeddedWallets.showWalletUIs?d.embeddedWallets.noPromptOnSignature:!d.embeddedWallets.showWalletUIs,n=z.current[m.current];if(!n)throw new r.PrivyClientError(`Smart wallet client for chain (eip155:${m.current}) not found`);if(t)return s.current=!0,await n.sendTransaction(e).finally((()=>s.current=!1));let o=[];"calls"in e&&void 0!==e.calls?o=[...e.calls]:"to"in e&&(o=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let u=async()=>{if(!n.paymaster)return!1;let{paymasterAndData:t,paymasterData:a}=await n.prepareUserOperation({calls:o,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return Number(t??a??0)>0};return new Promise((async(t,r)=>{s.current=!0;let{entropyId:d,entropyIdVerifier:_}=a.getEntropyDetailsFromUser(p);c({connectWallet:{entropyId:d,entropyIdVerifier:_,onCompleteNavigateTo:i.ModalScreen.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:()=>{}},sendTransaction:{transactionRequests:ko({calls:o,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:d,entropyIdVerifier:_,transactingWallet:{address:n.account.address,walletIndex:null},getIsSponsored:u,onConfirm:()=>n.sendTransaction(e),onSuccess:e=>t(e.hash),onFailure:r,uiOptions:{}}}),l(i.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{s.current=!1}))},signMessage:async({message:e})=>{let t=void 0===d.embeddedWallets.showWalletUIs?d.embeddedWallets.noPromptOnSignature:!d.embeddedWallets.showWalletUIs,n=z.current[m.current];if(!n)throw new r.PrivyClientError(`Smart wallet client for chain (eip155:${m.current}) not found`);return t?(s.current=!0,await n.signMessage({message:e}).finally((()=>s.current=!1))):new Promise((async(t,r)=>{let{entropyId:o,entropyIdVerifier:u}=a.getEntropyDetailsFromUser(p);s.current=!0,c({connectWallet:{entropyId:o,entropyIdVerifier:u,onCompleteNavigateTo:i.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>n.signMessage({message:e}),onSuccess:e=>t(e),onFailure:r,uiOptions:{}}}),l(i.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{s.current=!1}))},signTypedData:async e=>{let t=void 0===d.embeddedWallets.showWalletUIs?d.embeddedWallets.noPromptOnSignature:!d.embeddedWallets.showWalletUIs,n=z.current[m.current];if(!n)throw new r.PrivyClientError(`Smart wallet client for chain (eip155:${m.current}) not found`);return t?(s.current=!0,await n.signTypedData(e).finally((()=>s.current=!1))):new Promise((async(t,r)=>{s.current=!0;let{entropyId:o,entropyIdVerifier:u}=a.getEntropyDetailsFromUser(p);c({connectWallet:{entropyId:o,entropyIdVerifier:u,onCompleteNavigateTo:i.ModalScreen.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>n.signTypedData(e),onSuccess:e=>t(e),onFailure:r,uiOptions:{}}}),l(i.ModalScreen.EMBEDDED_WALLET_CONNECTING_SCREEN)})).finally((()=>{s.current=!1}))},getChainId:y,chain:h,switchChain:v}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./privy-context-BOQWqAyX.js"),t=require("eventemitter3"),a=require("@ethersproject/logger"),s=require("./user-BXtysx2D.js");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n,o,i=r(t);(o=n||(n={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",o.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",o.INVALID_DATA="invalid_data",o.LINKED_TO_ANOTHER_USER="linked_to_another_user",o.ALLOWLIST_REJECTED="allowlist_rejected",o.OAUTH_USER_DENIED="oauth_user_denied",o.UNKNOWN_AUTH_ERROR="unknown_auth_error",o.USER_EXITED_AUTH_FLOW="exited_auth_flow",o.MUST_BE_AUTHENTICATED="must_be_authenticated",o.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",o.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",o.CLIENT_REQUEST_TIMEOUT="client_request_timeout",o.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=t=>{if(t instanceof e.PrivyConnectorError)return t;if(t?.code&&t?.reason){let e=new h(t);return t.code===a.ErrorCode.ACTION_REJECTED&&(e.details=c.E4001_USER_REJECTED_REQUEST),e}return t?.code?new h(t):new e.PrivyConnectorError("Unknown connector error",t)};class p extends e.PrivyError{constructor(e,t,a){super(e),this.type="provider_error",this.code=t,this.data=a}}class h extends p{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 i.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","crypto.com_onchain","coinbase_wallet","coinbase_smart_wallet","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitkeep","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","privy","unknown","phantom","solflare","glow"];exports.ConnectorErrors=y,exports.PrivyProviderRpcError=h,exports.ProviderRpcError=p,exports.R=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.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.notImplementedWithMessage(`${this.walletClientType||""} wallet does not support 'getProvider'`),signMessage:s??e.notImplementedWithMessage(`${this.walletClientType||""} wallet does not support 'signMessage'`),sendTransaction:r??e.notImplementedWithMessage(`${this.walletClientType||""} wallet does not support 'sendTransaction'`),signTransaction:n??e.notImplementedWithMessage(`${this.walletClientType||""} wallet does not support 'signTransaction'`)}}async syncAccounts(){if("Installed"===this.adapter.readyState&&this.adapter.publicKey){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};this.wallets.find((e=>this.adapter.publicKey&&e.address===this.adapter.publicKey.toBase58()))||(this.wallets=[this.buildConnectedWallet(this.adapter,e)],this.emit("walletsUpdated"))}else this.wallets.length>0&&(this.wallets=[],this.emit("walletsUpdated"))}get walletBranding(){return{id:this.adapter.name,name:this.adapter.name,icon:this.adapter.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAutoConnect&&await this.adapter.autoConnect().catch(console.error),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this.adapter.connected&&["Installed"].includes(this.adapter.readyState)}subscribeListeners(){this.adapter.addListener("disconnect",this.onDisconnect),this.adapter.addListener("connect",this.onConnect),this.adapter.addListener("error",this.onError),this.adapter.addListener("readyStateChange",this.onReadyStateChange)}unsubscribeListeners(){this.adapter.removeAllListeners()}constructor(e,t){super(function(e){return 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.n=c,exports.useSolanaWallets=()=>{let{embeddedSolanaWallet:t,exportSolanaWallet:a,createEmbeddedSolanaWallet:r,solanaWallets:n,delegateWallet:o}=e.usePrivyInternal(),{user:i}=e.usePrivyContext();return{createWallet:r,exportWallet:a,delegateWalletAction:async()=>{let t=s.getPrivySolanaWallet(i);if(!t)throw new e.PrivyClientError("User must have a solana wallet in order to delegate actions");return await o({address:t.address,chainType:"solana"})},wallets:n.concat(t?[t]:[])}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@ethersproject/providers"),t=require("./privy-context-BOQWqAyX.js"),r=require("react/jsx-runtime"),a=require("react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(require("tinycolor2"));const l=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,i=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==l(e))return!1;if(e.providers)for(let t of e.providers)if(!i(t))return!1;return!0},s=(e,t=3,r=4,a="ethereum")=>{if(!e)return"";let n="ethereum"===a?2:0;return t+r+n+3>=e.length?e:`${e.slice(0,n+t)}...${e.slice(e.length-r,e.length)}`},p=e=>new Promise((t=>setTimeout(t,e)));const c=(e,r,a)=>{let n,o=e.id,l=Number(e.id);if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])n=e.rpcUrls.privyWalletOverride.http[0];else if(r.rpcUrls&&r.rpcUrls[l])n=r.rpcUrls[l];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",a),n=t.toString()}else n=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!n)throw new t.PrivyConnectorError(`No RPC url found for ${o}`);return n};const u={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},d={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},h={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},m={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},f={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},g={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},y={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},b={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},w={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},v={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},C={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},E={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},x={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},k={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},S={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},O=[u,d,k,w,v,C,E,x,y,{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},f,g,{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},b,{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},h,m,S,{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}}],A=new Set(O.map((e=>e.id))),_={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},embeddedWallets:{extendedCalldataDecoding:!1},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let U=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),T=e=>U.has(e),W=(e,t,r)=>r.indexOf(e)===t;const P=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(T).filter(W):e?e.filter(T).filter(W):_.appearance.walletList;function M(e,t){return{...e,rpcUrls:{...e.rpcUrls,privy:{http:[t]}}}}let I="#FFFFFF";function F(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return o.default({...e.toHsl(),l:r})}function L({backgroundTheme:e,accentHex:t}){let r;switch(e){case"light":r=I;break;case"dark":r="#1E1E1D";break;default:r=e}let a=o.default(r),n=o.default(t),l=o.default("#51BA81"),i=o.default("#FFB74D"),s=o.default("#EC6351"),p=function(e){return e<.8&&e>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),e>.5?"light":"dark"}(a.getLuminance()),c=F(a,"light"===p?-.04:.11),u=F(a,"light"===p?-.88:.87),d=F(a,"light"===p?-.7:.75),h=F(a,"light"===p?-.43:.45).desaturate("light"===p?60:20),m=F(a,"light"===p?-.08:.25).desaturate("light"===p?60:20),f=F(n,.15),g=F(n,.25),y=F(n,-.06),b=F(n,-.6),w=F(s,.3),v=F(i,.3),C=o.default(n.getLuminance()>.5?"#040217":I),E=F(l,-.16),x=F(l,.4);return{colorScheme:p,background:a.toHslString(),background2:c.toHslString(),foreground:u.toHslString(),foreground2:d.toHslString(),foreground3:h.toHslString(),foreground4:m.toHslString(),accent:n.toHslString(),accentLight:f.toHslString(),accentLightest:g.toHslString(),accentDark:y.toHslString(),accentDarkest:b.toHslString(),foregroundAccent:C.toHslString(),success:l.toHslString(),successDark:E.toHslString(),successLight:x.toHslString(),error:s.toHslString(),errorLight:w.toHslString(),warn:i.toHslString(),warnLight:v.toHslString()}}function D(e,t,r){let a,n,o,l,i,s,p,c,u,d,h,m,f,g,y,b,v=r?console.warn:()=>{};t?.loginMethods?(a=t.loginMethods.includes("email"),n=t.loginMethods.includes("sms"),l=t.loginMethods.includes("wallet"),i=t.loginMethods.includes("google"),s=t.loginMethods.includes("twitter"),p=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),d=t.loginMethods.includes("instagram"),c=t.loginMethods.includes("tiktok"),m=t.loginMethods.includes("github"),h=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),g=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram")):(a=e.emailAuth,n=e.smsAuth,l=e.walletAuth||e.solanaWalletAuth,i=e.googleOAuth,s=e.twitterOAuth,p=e.discordOAuth,m=e.githubOAuth,u=e.spotifyOAuth,d=e.instagramOAuth,c=e.tiktokOAuth,h=e.linkedinOAuth,f=e.appleOAuth,g=e.farcasterAuth,y=e.telegramAuth),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let C=[a,n].filter(Boolean),E=[i,s,p,m,u,d,c,h,f,g,y].filter(Boolean),x=[l].filter(Boolean);if(C.length+E.length+x.length===0)throw Error("You must enable at least one login method");let k=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;k&&0===x.length?(v("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),k=!1):k||E.length+C.length!==0||(v("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),k=!0);let S=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&v("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let A=P({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),U=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let a of e.overflow??[])t.includes(a)||r.includes(a)?console.warn(`Duplicated login method: ${a}`):r.push(a);return{primary:t,overflow:r}})({input:t?.loginMethodsAndOrder}),T=t?.intl?.defaultCountry??"US",{chains:W,defaultChain:I}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:a}){let n;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter((e=>e.rpcUrls.privyWalletOverride)).length>0&&a&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),n=t.map((e=>{if(e.rpcUrls.privyWalletOverride)return e;let t=O.find((t=>t.id===e.id)),r=t?.rpcUrls.privy?.http[0];return r?M(e,r):e}))}else n=O.concat(e??[]);let o=t?n[0]:w,l=r??o;if(!n.find((e=>e.id===l.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:l}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),F=!!t?.defaultChain,D=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=!(e.enforceWalletUis??1);if(b=e.legacyWalletUiConfig??1?D?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??R:R,!1===t?.embeddedWallets?.waitForTransactionConfirmation&&!0!==b)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:H,...K}=t?.embeddedWallets??{};return e.solanaWalletAuth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??_.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:L({backgroundTheme:t?.appearance?.theme??_.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??_.appearance.accentColor}),loginGroupPriority:k?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:A,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.walletAuth??!1,solanaWalletAuth:e.solanaWalletAuth??!1})},loginMethods:{wallet:l,email:a,sms:n,passkey:o,google:i,twitter:s,discord:p,github:m,spotify:u,instagram:d,tiktok:c,linkedin:h,apple:f,farcaster:g,telegram:y},disablePlusEmails:e.disablePlusEmails,loginMethodsAndOrder:U,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??_.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??_.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??_.rpcConfig.rpcTimeouts},chains:W,defaultChain:I,intl:{defaultCountry:T},shouldEnforceDefaultChainOnConnect:F,captchaEnabled:e.captchaEnabled??_.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??_.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:S},solana:{connectors:t?.externalWallets?.solana?.connectors}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof H?{requireUserOwnedRecoveryOnCreate:H}:{},...D?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...K,noPromptOnSignature:b,showWalletUIs:t?.embeddedWallets?.showWalletUIs,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:D?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??_._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??_.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??_.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??_.fundingMethodConfig.moonpay.useSandbox}}}}let R={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""};const H=D(R,void 0,!1);let K=a.createContext({appConfig:H,isServerConfigLoaded:!1});const N=a.createContext(null);exports.CHAIN_ID_MAINNET=1,exports.CLIENT_ANALYTICS_ID_KEY="privy:caid",exports.CODE_VERIFIER_KEY="privy:code_verifier",exports.CONNECTIONS_HISTORY_KEY="privy:connections",exports.CONNECTORS_STATE_KEY="privy:connectors",exports.CUSTOMER_ACCESS_TOKEN_COOKIE_KEY="privy-token",exports.CUSTOMER_ACCESS_TOKEN_STORAGE_KEY="privy:token",exports.DEFAULT_API_TIMEOUT_MS=2e4,exports.DEFAULT_APP_CONFIG=H,exports.DEFAULT_NETWORK="0x1",exports.DEFAULT_PRIVY_API_URL="https://auth.privy.io",exports.DEFAULT_RPC_TIMEOUT=12e4,exports.DEFAULT_SUCCESS_SCREEN_DURATION_MS=1400,exports.DEFAULT_SUCCESS_SCREEN_EXTRA_LONG_DURATION_MS=4e3,exports.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS=2500,exports.DEFAULT_SUPPORTED_CHAINS=O,exports.DEFAULT_SUPPORTED_CHAIN_IDS=A,exports.DEPRECATED_REFRESH_TOKEN="deprecated",exports.FORKED_TOKEN_STORAGE_KEY="privy:session_transfer_token",exports.HEADLESS_OAUTH_KEY="privy:headless_oauth",exports.IDENTITY_TOKEN_COOKIE_KEY="privy-id-token",exports.IDENTITY_TOKEN_STORAGE_KEY="privy:id_token",exports.MOONPAY_API_URL="https://api.moonpay.com/v1",exports.MOONPAY_API_URL_SANDBOX="https://api.moonpay.com/v1",exports.MOONPAY_PUBLIC_KEY="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",exports.MOONPAY_PUBLIC_KEY_SANDBOX="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",exports.OAUTH_DISABLE_SIGNUP_KEY="privy:oauth_disable_signup",exports.PRIVY_ACCESS_TOKEN_STORAGE_KEY="privy:pat",exports.PrivyAppConfigProvider=({children:e,legacyCreateEmbeddedWalletFlag:t,client:n,clientConfig:o})=>{let[l,i]=a.useState(null),s=a.useMemo((()=>D(l??R,o,!!l)),[l,o]);return a.useEffect((()=>{if(!l)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:a,supportedChains:n,defaultChain:o,externalWallets:l,...i}=e;return{...i,...a?{additionalChains:a.map((e=>e.id))}:void 0,...n?{supportedChains:n.map((e=>e.id))}:void 0,...o?{defaultChain:o.id}:void 0,...l?{walletConnect:l.walletConnect,coinbaseWallet:l.coinbaseWallet,solana:{connectors:l.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0,legacyCreateEmbeddedWalletFlag:t}}(o,t),r=function(e,t=0){let r=3735928559^t,a=1103547991^t;for(let t,n=0;n<e.length;n++)r=Math.imul(r^(t=e.charCodeAt(n)),2654435761),a=Math.imul(a^t,1597334677);return r=Math.imul(r^r>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${l.id}:${r}`;localStorage.getItem(a)||(n.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[o,t,l]),a.useEffect((()=>{l||(async()=>{try{let e=await n.getServerConfig();e.customApiUrl&&n.updateApiUrl(e.customApiUrl),i(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),r.jsx(K.Provider,{value:{appConfig:s,isServerConfigLoaded:!!l},children:e})},exports.REFRESH_TOKEN_COOKIE_KEY="privy-refresh-token",exports.REFRESH_TOKEN_STORAGE_KEY="privy:refresh_token",exports.SESSION_COOKIE_KEY="privy-session",exports.STATE_CODE_KEY="privy:state_code",exports.UseWalletsContext=N,exports.VERSION="1.95.2",exports.WALLET_PROXY_TIMEOUT=3e4,exports.addPrivyRpcToChain=M,exports.addRpcUrlOverrideToChain=function(e,t){return{...e,rpcUrls:{...e.rpcUrls,privyWalletOverride:{http:[t]}}}},exports.addToDefaultChains=function(e){let t=e.filter((e=>!A.has(e.id)));return O.concat(t)},exports.arbitrum=u,exports.arbitrumSepolia=d,exports.avalanche=h,exports.avalancheFuji=m,exports.base=f,exports.baseSepolia=g,exports.celo=y,exports.clamp=function(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)},exports.constructURL=(e,t,r={},a={})=>{let n=new URL(t,e);for(let[e,t]of Object.entries(r))void 0!==t&&n.searchParams.set(e,t);let o=Object.entries(a);if(o.length>0){let e=new URLSearchParams;for(let[t,r]of o)e.append(t,r);n.hash=e.toString()}return n.href},exports.convert1dTo2dArray=(e,t)=>{let r=e.slice(0),a=[];for(;r.length;)a.push(r.splice(0,t));return a},exports.detectInjectedConnectors=async function({store:e,walletList:t,externalWalletConfig:r,walletChainType:a,timeout:n=3e3}){let o=!1,s=window;return new Promise((p=>{function c(){if(o)return;o=!0,window.removeEventListener("ethereum#initialized",c);let n=e.getProviders();console.debug("Detected injected providers:",n.map((e=>e.info)));let s=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===a&&"app.phantom"===e.info.rdns||s.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==a)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=l(e);if(!n.some((e=>e.info.name===t))){if(i(e,!0)&&!s.find((e=>"metamask"===e.type))){s.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!s.find((e=>"phantom"===e.type))){s.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!s.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==r.coinbaseWallet?.connectionOptions))){s.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}s.find((e=>"unknown_browser_extension"===e.type))||s.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}p(s)}s.ethereum?c():(window.addEventListener("ethereum#initialized",c,{once:!0}),setTimeout((()=>{c()}),n))}))},exports.formatChainIdToCAIP2=function(e){return`eip155:${String(Number(e))}`},exports.formatSolanaWalletAddress=(e,t=3,r=4)=>s(e,t,r,"solana"),exports.formatWalletAddress=s,exports.generateTypedDataWithDomainType=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map((([e,r])=>{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:r}}},exports.getBlockExplorer=(e,r)=>{let a=Number(e),n=r.find((e=>e.id===a));if(!n)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},exports.getGuestCredentialStorageKey=e=>`privy:guest:${e}`,exports.getJsonRpcEndpoint=(e,r,a,n)=>{let o=Number(e),l=r.find((e=>e.id===o));if(!l)throw new t.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return c(l,a,n)},exports.getJsonRpcEndpointFromChain=c,exports.getJsonRpcProvider=(r,a,n,o)=>{let l=Number(r),i=a.find((e=>e.id===l));if(!i)throw new t.PrivyConnectorError(`Unsupported chainId ${r}`,4901);return new e.StaticJsonRpcProvider(i.rpcUrls.privyWalletOverride&&i.rpcUrls.privyWalletOverride.http[0]?i.rpcUrls.privyWalletOverride.http[0]:n.rpcUrls&&n.rpcUrls[l]?n.rpcUrls[l]:i.rpcUrls.privy?.http[0]?{url:i.rpcUrls.privy.http[0],headers:{"privy-app-id":o.appId}}:i.rpcUrls.public?.http[0]?i.rpcUrls.public.http[0]:i.rpcUrls.default?.http[0])},exports.getPrivyWalletKey=e=>`privy:wallet:${e}`,exports.getProviderAccessTokenStorageKey=e=>`privy:cross-app:${e}`,exports.invokeUntilSettled=(e,t={})=>{let r=t.delayMs||150,a=t.maxAttempts||270;return new Promise((async(n,o)=>{let l=!1,i=0;for(;!l&&i<a;){if(t.abortSignal?.aborted)return;e().then((e=>{l=!0,n(e)}),((...e)=>{l=!0,o(...e)})),i+=1,await p(r)}l||o(Error("Exceeded max attempts before resolving function"))}))},exports.isCoinbaseWalletInstalled=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},exports.isPhantomInstalled=()=>{if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId)return!0}return!1},exports.linea=b,exports.mainnet=w,exports.optimism=v,exports.optimismSepolia=C,exports.pollForResult=function(e,{interval:t=100,timeout:r=5e3}={}){return new Promise(((a,n)=>{let o,l=0,i=()=>{l>=r?n("Max attempts reached without result"):(o=e(),l+=t,null==o?setTimeout(i,t):a(o))};i()}))},exports.polygon=E,exports.polygonAmoy=x,exports.sepolia=k,exports.sleep=p,exports.splitAtIndex=(e,t)=>{let r=[],a=[];for(let[n,o]of e.entries())n<t?r.push(o):a.push(o);return[r,a]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.useAppConfig=()=>{let{appConfig:e}=a.useContext(K);return e},exports.useIsServerConfigLoaded=()=>{let{isServerConfigLoaded:e}=a.useContext(K);return e},exports.useWallets=function(){let e=a.useContext(N);return null===e?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):e},exports.validateEmail=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),exports.zora=S;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as E,jsxs as _}from"react/jsx-runtime";import{useState as N,useEffect as A,useRef as S,useContext as T,createContext as R}from"react";import{A as C,aq as D}from"./useWallets-BxVlmjSu.mjs";import{n as L}from"./privy-context-DffpuNH1.mjs";function I({src:_,...N}){return E("img",{src:_,...N,style:{display:"none"}})}var O,e;(O=e||(e={})).LANDING="LANDING",O.CONNECT_OR_CREATE="CONNECT_OR_CREATE",O.AWAITING_CONNECTION="AWAITING_CONNECTION",O.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",O.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",O.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",O.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",O.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",O.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",O.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",O.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",O.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",O.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",O.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",O.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",O.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",O.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",O.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",O.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",O.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",O.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",O.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",O.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",O.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",O.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",O.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",O.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",O.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",O.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",O.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",O.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",O.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",O.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",O.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",O.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",O.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",O.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",O.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",O.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",O.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",O.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",O.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",O.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",O.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",O.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",O.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",O.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",O.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",O.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",O.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",O.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",O.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",O.CAPTCHA_SCREEN="CAPTCHA_SCREEN",O.ERROR_SCREEN="ERROR_SCREEN",O.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",O.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",O.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN";const a=R({ready:!1,app:D,currentScreen:null,lastScreen:null,navigate:L,navigateBack:L,resetNavigation:L,setModalData:L,onUserCloseViaDialogOrKeybindRef:void 0});let W=[e.LANDING,e.CONNECT_ONLY_LANDING_SCREEN,null];const M=T=>{let R=C(),D=T.authenticated,[L,O]=N(T.initialScreen);A((()=>{D||W.includes(T.initialScreen)||T.setInitialScreen(null)}),[D]);let e=S(null);A((()=>{T.open||(e.current=null)}),[T.open]),A((()=>{e.current=null}),[T.initialScreen]);let M={ready:!!R.id,app:R,data:T.data,setModalData:T.setModalData,currentScreen:T.initialScreen,lastScreen:L,navigate:(E,_=!0)=>{T.setInitialScreen(E),_&&O(T.initialScreen)},navigateBack:()=>{T.setInitialScreen(L)},resetNavigation:()=>{T.setInitialScreen(null),O(null)},onUserCloseViaDialogOrKeybindRef:e};return _(a.Provider,{value:M,children:[("string"==typeof R.appearance.logo||"img"===R.appearance.logo?.type)&&E(I,{src:"string"==typeof R.appearance.logo?R.appearance.logo:R.appearance.logo.props.src}),T.children]})},n=()=>T(a);function t(E){return E.find((E=>"privy"===E.walletClientType&&"embedded"===E.connectorType&&!E.imported))??null}export{e as M,M as a,t as g,n as u};
|