var P=Object.create;var i=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var f=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},x=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of I(e))!$.call(t,a)&&a!==o&&i(t,a,{get:()=>e[a],enumerable:!(r=v(e,a))||r.enumerable});return t};var E=(t,e,o)=>(o=t!=null?P(A(t)):{},x(e||!t||!t.__esModule?i(o,"default",{value:t,enumerable:!0}):o,t)),b=t=>x(i({},"__esModule",{value:!0}),t);var n=(t,e,o)=>new Promise((r,a)=>{var u=s=>{try{p(o.next(s))}catch(l){a(l)}},w=s=>{try{p(o.throw(s))}catch(l){a(l)}},p=s=>s.done?r(s.value):Promise.resolve(s.value).then(u,w);p((o=o.apply(t,e)).next())});var S={};f(S,{callBeforeMintWebhook:()=>B,fetchRecommendations:()=>X,getCollectionById:()=>C,getFeaturedCollectionById:()=>g,getRoadmapById:()=>K,updateMint:()=>Y,updateMintError:()=>_});module.exports=b(S);var h=require("react"),k=require("react/jsx-runtime"),D=(0,h.createContext)(void 0),m="production";var d=m==="development"?"https://qa-api-v2.bandit.network/sdk":"https://api-v2.bandit.network/sdk",y=m==="development"?"https://qa-api-v2.bandit.network/sdk":"https://event-api-v2.bandit.network/api";var c=E(require("axios"),1);var C=(t,e)=>n(void 0,null,function*(){try{return(yield c.default.get(`${d}/collection/${e}`,{headers:{"X-API-KEY":t}})).data}catch(o){throw new Error(o)}}),K=(t,e)=>n(void 0,null,function*(){try{return(yield c.default.get(`${d}/collection/roadmap/${e}`,{headers:{"X-API-KEY":t}})).data}catch(o){throw new Error(o)}}),g=t=>n(void 0,null,function*(){try{return(yield c.default.get(`${d}/collection/featured`,{headers:{"X-API-KEY":t}})).data}catch(e){throw new Error(e)}}),Y=(t,e,o,r=!1)=>n(void 0,null,function*(){try{return(yield c.default.post(`${d}/collection/mint/${t}`,o,{headers:{"X-API-KEY":e}})).data}catch(a){if(console.log(a),r)throw a}}),_=(t,e,o)=>n(void 0,null,function*(){try{return(yield c.default.post(`${d}/collection/${t}/mints/error`,o,{headers:{"X-API-KEY":e}})).data}catch(r){console.log(r)}}),B=(t,e,o)=>n(void 0,null,function*(){try{c.default.post(`${y}`,{address:t,chainId:e,action:"updateMaxSupply"},{headers:{"X-API-KEY":o}})}catch(r){console.log(r)}}),X=(t,e,o)=>n(void 0,null,function*(){try{let r=o?o[0]:"";return(yield c.default.get(`${d}/users/${t}/recommended?limit=10&tags=${r}`,{headers:{"X-API-KEY":e}})).data}catch(r){console.log(r)}});0&&(module.exports={callBeforeMintWebhook,fetchRecommendations,getCollectionById,getFeaturedCollectionById,getRoadmapById,updateMint,updateMintError});
