import a from"axios";import{createContext as w,useMemo as y}from"react";import{jsx as I}from"react/jsx-runtime";var m=w(void 0),h="production";var r=h==="development"?"https://qa-api-v2.bandit.network/sdk":"https://api-v2.bandit.network/sdk";var K=async(n,t)=>{try{return(await a.post(`${r}/subscription`,{email:n},{headers:{"X-API-KEY":t}})).data}catch(e){throw new Error(e)}},k=async(n,t)=>{try{return(await a.get(`${r}/users/${n}`,{headers:{"X-API-KEY":t}})).data}catch(e){throw new Error(e)}},C=async(n,t,e,o,i,d,s,p)=>{try{let c=await a.post(`${r}/users/${t}/twitter/get-auth-url`,{signature:n,walletAddress:t,intentModuleId:o,intentCollectionId:parseInt(i),intentModuleTask:d,from:p?"MOBILE":"DESKTOP",chainId:s},{headers:{"X-API-KEY":e}});return p?window.location.href=c.data:window.open(c.data,"_blank","height=600,width=600"),null}catch(c){throw console.log(c),c}},Y=async(n,t,e)=>{try{let o=await a.post(`${r}/users/${t}/discord/getAuthUrl`,{signature:n,walletAddress:t},{headers:{"X-API-KEY":e}});return window.open(o.data,"_blank","height=600,width=600"),null}catch(o){throw console.log(o),o}},X=async(n,t,e)=>{try{return(await a.post(`${r}/users/${t}/twitter/disconnect`,{signature:n,walletAddress:t},{headers:{"X-API-KEY":e}})).data}catch(o){throw console.log(o),o}},D=async(n,t,e)=>{try{return(await a.post(`${r}/users/${t}/discord/disconnect`,{signature:n,walletAddress:t},{headers:{"X-API-KEY":e}})).data}catch(o){throw console.log(o),o}},_=async(n,t,e,o,i,d)=>{try{return(await a.post(`${r}/collection/contest/${i}/sendVerification`,{email:n,walletAddress:t,task:o,signature:d},{headers:{"X-API-KEY":e}})).data}catch(s){throw console.log(s),s}},N=async(n,t)=>{try{return(await a.post(`${r}/users/getNonce`,{walletAddress:n},{headers:{"X-API-KEY":t}})).data}catch(e){throw new Error(e)}};export{D as disconnectDiscord,X as disconnectTwitter,Y as getDiscordOAuthUrl,N as getNonce,C as getTwitterOAuthUrl,k as getUser,_ as sendEmailCodeVerification,K as subscribe};
