var x=Object.create;var d=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var o in t)d(e,o,{get:t[o],enumerable:!0})},u=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of m(t))!I.call(e,r)&&r!==o&&d(e,r,{get:()=>t[r],enumerable:!(n=y(t,r))||n.enumerable});return e};var v=(e,t,o)=>(o=e!=null?x(P(e)):{},u(t||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e)),E=e=>u(d({},"__esModule",{value:!0}),e);var D={};g(D,{disconnectDiscord:()=>C,disconnectTwitter:()=>k,getDiscordOAuthUrl:()=>K,getNonce:()=>X,getTwitterOAuthUrl:()=>f,getUser:()=>b,sendEmailCodeVerification:()=>Y,subscribe:()=>A});module.exports=E(D);var s=v(require("axios"),1);var h=require("react"),$=require("react/jsx-runtime"),S=(0,h.createContext)(void 0),l="production";var a=l==="development"?"https://qa-api-v2.bandit.network/sdk":"https://api-v2.bandit.network/sdk";var A=async(e,t)=>{try{return(await s.default.post(`${a}/subscription`,{email:e},{headers:{"X-API-KEY":t}})).data}catch(o){throw new Error(o)}},b=async(e,t)=>{try{return(await s.default.get(`${a}/users/${e}`,{headers:{"X-API-KEY":t}})).data}catch(o){throw new Error(o)}},f=async(e,t,o,n,r,p,c,w)=>{try{let i=await s.default.post(`${a}/users/${t}/twitter/get-auth-url`,{signature:e,walletAddress:t,intentModuleId:n,intentCollectionId:parseInt(r),intentModuleTask:p,from:w?"MOBILE":"DESKTOP",chainId:c},{headers:{"X-API-KEY":o}});return w?window.location.href=i.data:window.open(i.data,"_blank","height=600,width=600"),null}catch(i){throw console.log(i),i}},K=async(e,t,o)=>{try{let n=await s.default.post(`${a}/users/${t}/discord/getAuthUrl`,{signature:e,walletAddress:t},{headers:{"X-API-KEY":o}});return window.open(n.data,"_blank","height=600,width=600"),null}catch(n){throw console.log(n),n}},k=async(e,t,o)=>{try{return(await s.default.post(`${a}/users/${t}/twitter/disconnect`,{signature:e,walletAddress:t},{headers:{"X-API-KEY":o}})).data}catch(n){throw console.log(n),n}},C=async(e,t,o)=>{try{return(await s.default.post(`${a}/users/${t}/discord/disconnect`,{signature:e,walletAddress:t},{headers:{"X-API-KEY":o}})).data}catch(n){throw console.log(n),n}},Y=async(e,t,o,n,r,p)=>{try{return(await s.default.post(`${a}/collection/contest/${r}/sendVerification`,{email:e,walletAddress:t,task:n,signature:p},{headers:{"X-API-KEY":o}})).data}catch(c){throw console.log(c),c}},X=async(e,t)=>{try{return(await s.default.post(`${a}/users/getNonce`,{walletAddress:e},{headers:{"X-API-KEY":t}})).data}catch(o){throw new Error(o)}};0&&(module.exports={disconnectDiscord,disconnectTwitter,getDiscordOAuthUrl,getNonce,getTwitterOAuthUrl,getUser,sendEmailCodeVerification,subscribe});
