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