@fuul/sdk 7.17.1 → 7.18.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ClaimCheckService.d.ts","sourceRoot":"","sources":["../../src/claim-checks/ClaimCheckService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEvI,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAIF;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAEjC,QAAQ,EAAE,yBAAyB;IAK/C;;;;;;OAMG;IACU,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAWtG;;;;;;OAMG;IACU,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAU1G"}
1
+ {"version":3,"file":"ClaimCheckService.d.ts","sourceRoot":"","sources":["../../src/claim-checks/ClaimCheckService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEvI,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAIF;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAEjC,QAAQ,EAAE,yBAAyB;IAK/C;;;;;;OAMG;IACU,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAWtG;;;;;;OAMG;IACU,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC;CAW1G"}
@@ -41,6 +41,7 @@ export type GetClaimableChecksResponse = ClaimResponse[];
41
41
  export interface GetClaimCheckTotalsParams {
42
42
  user_identifier: string;
43
43
  user_identifier_type: UserIdentifierType;
44
+ status?: 'claimed' | 'unclaimed';
44
45
  }
45
46
  export interface ClaimCheckTotalItem {
46
47
  currency_address: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/claim-checks/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAED,oBAAY,gBAAgB;IAC1B,eAAe,IAAI;IACnB,aAAa,IAAI;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,0BAA0B,GAAG,aAAa,EAAE,CAAC;AAEzD,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAED,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,SAAS,EAAE,mBAAmB,EAAE,CAAC;CAClC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/claim-checks/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C;AAED,oBAAY,gBAAgB;IAC1B,eAAe,IAAI;IACnB,aAAa,IAAI;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,gBAAgB,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,0BAA0B,GAAG,aAAa,EAAE,CAAC;AAEzD,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,kBAAkB,CAAC;IACzC,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,SAAS,EAAE,mBAAmB,EAAE,CAAC;CAClC"}
package/dist/index.mjs CHANGED
@@ -2072,7 +2072,8 @@ class Un {
2072
2072
  path: `${yt}/totals`,
2073
2073
  queryParams: {
2074
2074
  user_identifier: e.user_identifier,
2075
- user_identifier_type: e.user_identifier_type
2075
+ user_identifier_type: e.user_identifier_type,
2076
+ ...e.status && { status: e.status }
2076
2077
  }
2077
2078
  })).data;
2078
2079
  }
package/dist/index.umd.js CHANGED
@@ -3,4 +3,4 @@
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(s=>n.set(s)),n}static accessor(e){const n=(this[ft]=this[ft]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=se(o);n[c]||(Gr(s,o),n[c]=!0)}return a.isArray(e)?e.forEach(i):i(e),this}};O.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(O.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}}),a.freezeMethods(O);function xe(t,e){const r=this||ne,n=e||r,s=O.from(n.headers);let i=n.data;return a.forEach(t,function(c){i=c.call(r,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function ht(t){return!!(t&&t.__CANCEL__)}let ie=class extends y{constructor(e,r,n){super(e??"canceled",y.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function pt(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new y("Request failed with status code "+r.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Zr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function en(t,e){t=t||10;const r=new Array(t),n=new Array(t);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(f){const l=Date.now(),u=n[i];o||(o=l),r[s]=f,n[s]=l;let h=i,g=0;for(;h!==s;)g+=r[h++],h=h%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),l-o<e)return;const R=u&&l-u;return R?Math.round(g*1e3/R):void 0}}function tn(t,e){let r=0,n=1e3/e,s,i;const o=(l,u=Date.now())=>{r=u,s=null,i&&(clearTimeout(i),i=null),t(...l)};return[(...l)=>{const u=Date.now(),h=u-r;h>=n?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},n-h)))},()=>s&&o(s)]}const pe=(t,e,r=3)=>{let n=0;const s=en(50,250);return tn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-n,l=s(f),u=o<=c;n=o;const h={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(h)},r)},mt=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},yt=t=>(...e)=>a.asap(()=>t(...e)),rn=A.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,A.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,nn=A.hasStandardBrowserEnv?{write(t,e,r,n,s,i,o){if(typeof document>"u")return;const c=[`${t}=${encodeURIComponent(e)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function sn(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function on(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function gt(t,e,r){let n=!sn(e);return t&&(n||r==!1)?on(t,e):e}const bt=t=>t instanceof O?{...t}:t;function M(t,e){e=e||{};const r={};function n(l,u,h,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,h,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l,h,g)}else return n(l,u,h,g)}function i(l,u){if(!a.isUndefined(u))return n(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function c(l,u,h){if(h in e)return n(l,u);if(h in t)return n(void 0,l)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,h)=>s(bt(l),bt(u),h,!0)};return a.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=a.hasOwnProp(f,u)?f[u]:s,g=h(t[u],e[u],u);a.isUndefined(g)&&h!==c||(r[u]=g)}),r}const wt=t=>{const e=M({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=e;if(e.headers=o=O.from(o),e.url=ut(gt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(r.getHeaders)){const f=r.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,h])=>{l.includes(u.toLowerCase())&&o.set(u,h)})}}if(A.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(e)),n||n!==!1&&rn(e.url))){const f=s&&i&&nn.read(i);f&&o.set(s,f)}return e},an=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){const s=wt(t);let i=s.data;const o=O.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:l}=s,u,h,g,R,d;function m(){R&&R(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function E(){if(!p)return;const C=O.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),v={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:C,config:t,request:p};pt(function(L){r(L),m()},function(L){n(L),m()},v),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(n(new y("Request aborted",y.ECONNABORTED,t,p)),p=null)},p.onerror=function(N){const v=N&&N.message?N.message:"Network Error",z=new y(v,y.ERR_NETWORK,t,p);z.event=N||null,n(z),p=null},p.ontimeout=function(){let N=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const v=s.transitional||Pe;s.timeoutErrorMessage&&(N=s.timeoutErrorMessage),n(new y(N,v.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,t,p)),p=null},i===void 0&&o.setContentType(null),"setRequestHeader"in p&&a.forEach(o.toJSON(),function(N,v){p.setRequestHeader(v,N)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),l&&([g,d]=pe(l,!0),p.addEventListener("progress",g)),f&&p.upload&&([h,R]=pe(f),p.upload.addEventListener("progress",h),p.upload.addEventListener("loadend",R)),(s.cancelToken||s.signal)&&(u=C=>{p&&(n(!C||C.type?new ie(null,t,p):C),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const D=Zr(s.url);if(D&&A.protocols.indexOf(D)===-1){n(new y("Unsupported protocol "+D+":",y.ERR_BAD_REQUEST,t));return}p.send(i||null)})},cn=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;n.abort(u instanceof y?u:new ie(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,i(new y(`timeout of ${e}ms exceeded`,y.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),t=null)};t.forEach(l=>l.addEventListener("abort",i));const{signal:f}=n;return f.unsubscribe=()=>a.asap(c),f}},un=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let n=0,s;for(;n<r;)s=n+e,yield t.slice(n,s),n=s},ln=async function*(t,e){for await(const r of dn(t))yield*un(r,e)},dn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},_t=(t,e,r,n)=>{const s=ln(t,e);let i=0,o,c=f=>{o||(o=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await s.next();if(l){c(),f.close();return}let h=u.byteLength;if(r){let g=i+=h;r(g)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Et=64*1024,{isFunction:me}=a,fn=(({Request:t,Response:e})=>({Request:t,Response:e}))(a.global),{ReadableStream:Rt,TextEncoder:Ct}=a.global,St=(t,...e)=>{try{return!!t(...e)}catch{return!1}},hn=t=>{t=a.merge.call({skipUndefined:!0},fn,t);const{fetch:e,Request:r,Response:n}=t,s=e?me(e):typeof fetch=="function",i=me(r),o=me(n);if(!s)return!1;const c=s&&me(Rt),f=s&&(typeof Ct=="function"?(d=>m=>d.encode(m))(new Ct):async d=>new Uint8Array(await new r(d).arrayBuffer())),l=i&&c&&St(()=>{let d=!1;const m=new r(A.origin,{body:new Rt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!m}),u=o&&c&&St(()=>a.isReadableStream(new n("").body)),h={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(m,p)=>{let E=m&&m[d];if(E)return E.call(m);throw new y(`Response type '${d}' is not supported`,y.ERR_NOT_SUPPORT,p)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new r(A.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},R=async(d,m)=>{const p=a.toFiniteNumber(d.getContentLength());return p??g(m)};return async d=>{let{url:m,method:p,data:E,signal:D,cancelToken:C,timeout:N,onDownloadProgress:v,onUploadProgress:z,responseType:L,headers:Je,withCredentials:we="same-origin",fetchOptions:jt}=wt(d),$t=e||fetch;L=L?(L+"").toLowerCase():"text";let _e=cn([D,C&&C.toAbortSignal()],N),ae=null;const J=_e&&_e.unsubscribe&&(()=>{_e.unsubscribe()});let Mt;try{if(z&&l&&p!=="get"&&p!=="head"&&(Mt=await R(Je,E))!==0){let j=new r(m,{method:"POST",body:E,duplex:"half"}),Z;if(a.isFormData(E)&&(Z=j.headers.get("content-type"))&&Je.setContentType(Z),j.body){const[We,Ee]=mt(Mt,pe(yt(z)));E=_t(j.body,Et,We,Ee)}}a.isString(we)||(we=we?"include":"omit");const U=i&&"credentials"in r.prototype,Ht={...jt,signal:_e,method:p.toUpperCase(),headers:Je.normalize().toJSON(),body:E,duplex:"half",credentials:U?we:void 0};ae=i&&new r(m,Ht);let q=await(i?$t(ae,jt):$t(m,Ht));const Vt=u&&(L==="stream"||L==="response");if(u&&(v||Vt&&J)){const j={};["status","statusText","headers"].forEach(Kt=>{j[Kt]=q[Kt]});const Z=a.toFiniteNumber(q.headers.get("content-length")),[We,Ee]=v&&mt(Z,pe(yt(v),!0))||[];q=new n(_t(q.body,Et,We,()=>{Ee&&Ee(),J&&J()}),j)}L=L||"text";let xs=await h[a.findKey(h,L)||"text"](q,d);return!Vt&&J&&J(),await new Promise((j,Z)=>{pt(j,Z,{data:xs,headers:O.from(q.headers),status:q.status,statusText:q.statusText,config:d,request:ae})})}catch(U){throw J&&J(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,d,ae,U&&U.response),{cause:U.cause||U}):y.from(U,U&&U.code,d,ae,U&&U.response)}}},pn=new Map,At=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:s}=e,i=[n,s,r];let o=i.length,c=o,f,l,u=pn;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:hn(e)),u=l;return l};At();const De={http:kr,xhr:an,fetch:{get:At}};a.forEach(De,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Tt=t=>`- ${t}`,mn=t=>a.isFunction(t)||t===null||t===!1;function yn(t,e){t=a.isArray(t)?t:[t];const{length:r}=t;let n,s;const i={};for(let o=0;o<r;o++){n=t[o];let c;if(s=n,!mn(n)&&(s=De[(c=String(n)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(e))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=r?o.length>1?`since :
4
4
  `+o.map(Tt).join(`
5
5
  `):" "+Tt(o[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Pt={getAdapter:yn,adapters:De};function Le(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ie(null,t)}function Ot(t){return Le(t),t.headers=O.from(t.headers),t.data=xe.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Pt.getAdapter(t.adapter||ne.adapter,t)(t).then(function(n){return Le(t),n.data=xe.call(t,t.transformResponse,n),n.headers=O.from(n.headers),n},function(n){return ht(n)||(Le(t),n&&n.response&&(n.response.data=xe.call(t,t.transformResponse,n.response),n.response.headers=O.from(n.response.headers))),Promise.reject(n)})}const Nt="1.13.6",ye={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ye[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Ut={};ye.transitional=function(e,r,n){function s(i,o){return"[Axios v"+Nt+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,c)=>{if(e===!1)throw new y(s(o," has been removed"+(r?" in "+r:"")),y.ERR_DEPRECATED);return r&&!Ut[o]&&(Ut[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,o,c):!0}},ye.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function gn(t,e,r){if(typeof t!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let s=n.length;for(;s-- >0;){const i=n[s],o=e[i];if(o){const c=t[i],f=c===void 0||o(c,i,t);if(f!==!0)throw new y("option "+i+" must be "+f,y.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new y("Unknown option "+i,y.ERR_BAD_OPTION)}}const ge={assertOptions:gn,validators:ye},x=ge.validators;let H=class{constructor(e){this.defaults=e||{},this.interceptors={request:new lt,response:new lt}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
6
- `+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=M(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&ge.assertOptions(n,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean),legacyInterceptorReqResOrdering:x.transitional(x.boolean)},!1),s!=null&&(a.isFunction(s)?r.paramsSerializer={serialize:s}:ge.assertOptions(s,{encode:x.function,serialize:x.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ge.assertOptions(r,{baseUrl:x.spelling("baseURL"),withXsrfToken:x.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[r.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=O.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(m){if(typeof m.runWhen=="function"&&m.runWhen(r)===!1)return;f=f&&m.synchronous;const p=r.transitional||Pe;p&&p.legacyInterceptorReqResOrdering?c.unshift(m.fulfilled,m.rejected):c.push(m.fulfilled,m.rejected)});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,h=0,g;if(!f){const d=[Ot.bind(this),void 0];for(d.unshift(...c),d.push(...l),g=d.length,u=Promise.resolve(r);h<g;)u=u.then(d[h++],d[h++]);return u}g=c.length;let R=r;for(;h<g;){const d=c[h++],m=c[h++];try{R=d(R)}catch(p){m.call(this,p);break}}try{u=Ot.call(this,R)}catch(d){return Promise.reject(d)}for(h=0,g=l.length;h<g;)u=u.then(l[h++],l[h++]);return u}getUri(e){e=M(this.defaults,e);const r=gt(e.baseURL,e.url,e.allowAbsoluteUrls);return ut(r,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){H.prototype[e]=function(r,n){return this.request(M(n||{},{method:e,url:r,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(e){function r(n){return function(i,o,c){return this.request(M(c||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}H.prototype[e]=r(),H.prototype[e+"Form"]=r(!0)});let bn=class Jt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{n.subscribe(c),i=c}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,c){n.reason||(n.reason=new ie(i,o,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Jt(function(s){e=s}),cancel:e}}};function wn(t){return function(r){return t.apply(null,r)}}function _n(t){return a.isObject(t)&&t.isAxiosError===!0}const Fe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Fe).forEach(([t,e])=>{Fe[e]=t});function xt(t){const e=new H(t),r=Qe(H.prototype.request,e);return a.extend(r,H.prototype,e,{allOwnKeys:!0}),a.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return xt(M(t,s))},r}const _=xt(ne);_.Axios=H,_.CanceledError=ie,_.CancelToken=bn,_.isCancel=ht,_.VERSION=Nt,_.toFormData=fe,_.AxiosError=y,_.Cancel=_.CanceledError,_.all=function(e){return Promise.all(e)},_.spread=wn,_.isAxiosError=_n,_.mergeConfig=M,_.AxiosHeaders=O,_.formToJSON=t=>dt(a.isHTMLForm(t)?new FormData(t):t),_.getAdapter=Pt.getAdapter,_.HttpStatusCode=Fe,_.default=_;const{Axios:js,AxiosError:ke,CanceledError:$s,isCancel:Ms,CancelToken:Hs,VERSION:Vs,all:Ks,Cancel:zs,isAxiosError:Js,spread:Ws,toFormData:Qs,AxiosHeaders:Xs,HttpStatusCode:Ys,formToJSON:Gs,getAdapter:Zs,mergeConfig:ei}=_;class ve extends Error{constructor(r){super(r.join(", "));w(this,"errors");this.name="ValidationError",this.errors=r}}class Be extends Error{constructor(r){super("Address already registered.");w(this,"address");this.name="AddressInUseError",this.address=r}}class Ie extends Error{constructor(r){super("Code already registered.");w(this,"code");this.name="CodeInUseError",this.code=r}}class qe extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class En{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async create(e,r,n,s,i,o,c){var f;try{await this.httpClient.post({path:"/affiliates",postData:{address:e,identifier_type:r,name:n,code:n,signature:s,signature_public_key:i,account_chain_id:o,user_rebate_rate:c}})}catch(l){if(l instanceof ke){const u=(f=l.response)==null?void 0:f.data;if(typeof(u==null?void 0:u.message)=="string"){const h=u.message.toLowerCase();throw h=="invalid signature"?new qe:h=="address in use"?new Be(e):h=="code in use"?new Ie(n):new Error(h)}else if((u==null?void 0:u.message)instanceof Array)throw new ve(u.message)}throw l}}async update(e,r,n,s,i,o,c){var f;try{await this.httpClient.post({path:`/affiliates/${e}`,postData:{code:n,user_identifier:e,identifier_type:r,signature:s,signature_public_key:i,account_chain_id:o,user_rebate_rate:c}})}catch(l){if(l instanceof ke){const u=(f=l.response)==null?void 0:f.data;if(typeof(u==null?void 0:u.message)=="string"){const h=u.message.toLowerCase();throw h=="invalid signature"?new qe:h=="address in use"?new Be(e):h=="code in use"?new Ie(n):new Error(h)}else if((u==null?void 0:u.message)instanceof Array)throw new ve(u.message)}throw l}}async isCodeFree(e){try{return(await this.httpClient.get({path:`/affiliates/codes/${e}`})).data.free}catch(r){throw console.error("Fuul SDK: Could not check affiliate code",r),r}}async isCodeAvailable(e){try{return(await this.httpClient.get({path:`/affiliates/codes/${e}/availability`})).data.available}catch(r){throw console.error("Fuul SDK: Could not check affiliate code availability",r),r}}async getCode(e,r){var n;try{return(await this.httpClient.get({path:`/affiliates/${e}`,queryParams:{identifier_type:r}})).data}catch(s){if(s instanceof ke&&((n=s.response)==null?void 0:n.status)===404)return null;throw console.error("Fuul SDK: Could not get affiliate code",s),s}}}const Rn="/audiences";class Cn{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getUserAudiences(e){return(await this.httpClient.get({path:`${Rn}/audience-segments/user`,queryParams:{...e}})).data}}const Dt="/claim-checks";class Sn{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getClaimableChecks(e){return(await this.httpClient.post({path:`${Dt}/claim`,postData:{userIdentifier:e.user_identifier,userIdentifierType:e.user_identifier_type}})).data}async getClaimCheckTotals(e){return(await this.httpClient.get({path:`${Dt}/totals`,queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}}class An{constructor(e){w(this,"httpClient");this.httpClient=e.httpClient}async getAll(e){const{data:r}=await this.httpClient.get({path:"conversions",queryParams:{...e}});return r}}const Lt="fuul.sent",Tn=60,Pn="connect_wallet",Ft=10;class On{constructor(e){w(this,"debug");w(this,"httpClient");this.httpClient=e.httpClient,this.debug=!!e.debug}async sendEvent(e,r){if(this.isDuplicate(e)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}if(!r||!Array.isArray(r)||r.length===0)await this.httpClient.post({path:"events",postData:e});else for(const n of r){const s=structuredClone({...e,project_id:n});s.metadata.project_id=n,await this.httpClient.post({path:"events",postData:s,queryParams:{project_id:n}})}this.debug&&console.debug(`Fuul SDK: Sent '${e.name}' event`),this.saveSentEvent(e)}isDuplicate(e){var u,h,g,R;const r=`${Lt}_${e.name}`,n=localStorage.getItem(r);if(!n)return!1;const s=JSON.parse(n);if(this.getCurrentTimestamp()-s.timestamp>Tn)return!1;let f=!1;e.metadata&&(f=s.metadata.tracking_id===e.metadata.tracking_id&&s.metadata.project_id===e.metadata.project_id&&s.metadata.referrer===e.metadata.referrer&&s.metadata.source===e.metadata.source&&s.metadata.category===e.metadata.category&&s.metadata.title===e.metadata.title&&s.metadata.tag===e.metadata.tag&&s.user_address===e.user_address&&((u=s.user)==null?void 0:u.identifier)===((h=e.user)==null?void 0:h.identifier)&&((g=s.user)==null?void 0:g.identifier_type)===((R=e.user)==null?void 0:R.identifier_type)&&s.signature===e.signature&&s.signature_message===e.signature_message);let l=!1;return e.args&&s.args&&(l=s.args.page===e.args.page),l&&f}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(e){var o,c,f,l;const r=`${Lt}_${e.name}`,n=`${r}_all`,s=this.getCurrentTimestamp(),i={...e,timestamp:s};if(localStorage.setItem(r,JSON.stringify(i)),e.name===Pn){const u=JSON.parse(localStorage.getItem(n)||"[]"),h={name:e.name,user:{identifier:(o=e.user)==null?void 0:o.identifier,identifier_type:(c=e.user)==null?void 0:c.identifier_type},tracking_id:(f=e.metadata)==null?void 0:f.tracking_id,page:(l=e.args)==null?void 0:l.page};"user_address"in e&&(h.user_address=e.user_address);const g=[...u,h];g.length>Ft&&g.splice(0,g.length-Ft),localStorage.setItem(n,JSON.stringify(g))}}}const Nn={version:"0.0.0"};class Un{constructor(e){w(this,"client");w(this,"defaultQueryParams");this.client=_.create({...e,headers:{Authorization:`Bearer ${e.apiKey}`,"X-Fuul-Sdk-Version":Nn.version}}),this.defaultQueryParams=e.queryParams||{}}makeQueryParams(e){return Object.assign({},this.defaultQueryParams||{},e||{})}async get(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),method:"GET"})}async post(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"POST"})}async put(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"PUT"})}async patch(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"PATCH"})}async delete(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"DELETE"})}}class xn{constructor(e){w(this,"httpClient");this.httpClient=e.httpClient}async getPayoutsLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,user_identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/payouts",queryParams:i})).data}async getPointsLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,user_identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/points",queryParams:i})).data}async getVolumeLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/volume",queryParams:i})).data}async getReferredUsersLeaderboard(e){return(await this.httpClient.get({path:"/leaderboard/referred",queryParams:{...e}})).data}async getReferredVolume(e){const{user_identifiers:r,...n}=e;return(await this.httpClient.get({path:"/payouts/leaderboard/referred-volume",queryParams:{...n,user_identifiers:r.join(",")}})).data}async getRevenueLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/revenue",queryParams:i})).data}}const oe="/payouts";class Dn{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getUserPayoutsByConversion(e){return(await this.httpClient.get({path:oe,queryParams:{...e,type:"onchain-currency"}})).data}async getUserPointsByConversion(e){return(await this.httpClient.get({path:oe,queryParams:{...e,type:"point"}})).data}async getUserPayoutMovements(e){return(await this.httpClient.get({path:`${oe}/movements`,queryParams:{...e,type:"onchain-currency"}})).data}async getUserPointsMovements(e){return(await this.httpClient.get({path:`${oe}/movements`,queryParams:{...e,type:"point"}})).data}async getPayoutsByReferrer(e){return(await this.httpClient.get({path:`${oe}/by-referrer`,queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}}class Ln{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async listUserReferralCodes(e){return(await this.httpClient.get({path:"/referral_codes",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,page:e.page,page_size:e.page_size}})).data}async generateReferralCodes(e){return(await this.httpClient.post({path:"/referral_codes",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,quantity:e.quantity,max_uses:e.max_uses}})).data}async getReferralStatus(e){return(await this.httpClient.get({path:"/referral_codes/status",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}async getReferralCode(e){return(await this.httpClient.get({path:`/referral_codes/${e.code}`})).data}async useReferralCode(e){const{code:r,user_identifier:n,user_identifier_type:s,signature:i,signature_message:o,chain_id:c,account_chain_id:f}=e;await this.httpClient.patch({path:`/referral_codes/${r}/use`,queryParams:{user_identifier:n,user_identifier_type:s,chain_id:c,account_chain_id:f},postData:{signature:i,signature_message:o}})}async updateReferralCode(e){await this.httpClient.patch({path:`/referral_codes/${e.code}`,postData:{max_uses:e.max_uses}})}async deleteReferral(e){const{code:r,user_identifier:n,user_identifier_type:s,referrer_identifier:i,referrer_identifier_type:o,signature:c,signature_message:f,chain_id:l}=e;await this.httpClient.delete({path:`/referral_codes/${r}/referrals`,queryParams:{user_identifier:n,user_identifier_type:s,referrer_identifier:i,referrer_identifier_type:o},postData:{signature:c,signature_message:f,chain_id:l}})}}const Fn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let kn=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Fn[r[t]&63];return e};const vn="fuul.tracking_id",je=()=>Mn(vn,()=>kn()),kt=()=>Y("af")||Y("referrer"),Bn=()=>document.referrer,In=()=>Hn(),qn=()=>Y("category"),jn=()=>Y("title"),$n=()=>Y("tag"),Mn=(t,e)=>{const r=localStorage.getItem(t);if(r)return r;{const n=e();return n?localStorage.setItem(t,n):localStorage.removeItem(t),n}},Y=t=>new URLSearchParams(window.location.search).get(t),Hn=()=>{const t=Y("source");if(t)return t},Vn="/user";class Kn{constructor(e){w(this,"httpClient");this.httpClient=e.httpClient}async getUserReferrer(e){return(await this.httpClient.get({path:`${Vn}/referrer`,queryParams:{...e}})).data}}const zn="https://api.fuul.xyz/api/v1/";let B=!1,$e=!1,Me,k,vt,Bt,V,He,be,G,It,K,I,Ve;function Jn(t){B=!!t.debug,!$e&&(Me=t.apiKey,Os(),k=Ns(t.baseApiUrl??zn,t.defaultQueryParams??{}),vt=new An({httpClient:k,debug:B}),be=new On({httpClient:k,debug:B}),V=new En({httpClient:k,debug:B}),He=new W({httpClient:k}),G=new Dn({httpClient:k,debug:B}),Bt=new Kn({httpClient:k}),It=new Cn({httpClient:k,debug:B}),K=new xn({httpClient:k}),I=new Ln({httpClient:k,debug:B}),Ve=new Sn({httpClient:k,debug:B}),$e=!0,B&&console.debug("Fuul SDK: init() complete"))}function b(){if(!$e)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Wn(t,e){b(),Ke(),ze();const r={name:t,args:e??{},metadata:{tracking_id:je()}};await be.sendEvent(r)}async function Qn(t,e){b(),Ke(),ze();const r={name:"pageview",args:{page:t??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:je(),referrer_url:Bn(),source:In(),affiliate_id:kt()??void 0,referrer:kt()??void 0,category:qn()??void 0,title:jn()??void 0,tag:$n()??void 0}};await be.sendEvent(r,e)}async function Xn(t,e){b(),Ke(),ze();const r={name:"connect_wallet",user:{identifier:t.identifier,identifier_type:t.identifierType},args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:je()}};t!=null&&t.signature&&(r.signature=t==null?void 0:t.signature,r.signature_message=t==null?void 0:t.message),t!=null&&t.signaturePublicKey&&(r.signature_public_key=t.signaturePublicKey),t!=null&&t.accountChainId&&(r.account_chain_id=t.accountChainId),await be.sendEvent(r,e)}async function Yn(t){b(),await V.create(t.userIdentifier,t.identifierType,t.code,t.signature,t.signaturePublicKey,t.accountChainId,t.userRebateRate)}async function Gn(t){b(),await V.update(t.userIdentifier,t.identifierType,t.code,t.signature,t.signaturePublicKey,t.accountChainId,t.userRebateRate)}async function Zn(t,e){return b(),await V.getCode(t,e)}async function es(t){return b(),await V.isCodeFree(t)}async function ts(t){return b(),await V.isCodeAvailable(t)}async function rs(t,e,r,n){b();const s=await V.getCode(e,r),i=new URLSearchParams({af:(s==null?void 0:s.code)??e});return n!=null&&n.title&&i.append("af_title",n.title),n!=null&&n.format&&i.append("af_format",n.format),n!=null&&n.place&&i.append("af_place",n.place),`${t}?${i.toString()}`}function ns(t){return K.getPayoutsLeaderboard(t)}function ss(t){return K.getPointsLeaderboard(t)}function is(t){return K.getReferredUsersLeaderboard(t)}function os(t){return b(),K.getReferredVolume(t)}function as(t){return b(),K.getVolumeLeaderboard(t)}function cs(t){return b(),K.getRevenueLeaderboard(t)}function us(t){return G.getUserPayoutsByConversion(t)}function ls(t){return G.getUserPointsByConversion(t)}function ds(t){return G.getUserPayoutMovements(t)}function fs(t){return G.getUserPointsMovements(t)}function hs(t){return b(),G.getPayoutsByReferrer(t)}async function ps(t){return b(),vt.getAll(t)}async function ms(t){return b(),Bt.getUserReferrer(t)}async function ys(t){return b(),It.getUserAudiences(t)}async function gs(t){return b(),I.listUserReferralCodes(t)}async function bs(t){return b(),I.generateReferralCodes(t)}async function ws(t){return b(),I.getReferralStatus(t)}async function _s(t){return b(),I.getReferralCode(t)}async function Es(t){return b(),I.useReferralCode(t)}async function Rs(t){return b(),I.updateReferralCode(t)}async function Cs(t){return b(),I.deleteReferral(t)}async function Ss(t){return b(),He.getAffiliateStats(t)}async function As(t){return b(),He.getAffiliateNewTraders(t)}async function Ts(t){return b(),Ve.getClaimableChecks(t)}async function Ps(t){return b(),Ve.getClaimCheckTotals(t)}function Ke(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function ze(){if(navigator.webdriver)throw new Error("Fuul SDK: Error")}function Os(){if(!Me)throw new Error("Fuul SDK: Invalid API key")}function Ns(t,e){return new Un({baseURL:t,timeout:3e4,apiKey:Me,queryParams:e})}const Us={init:Jn,sendEvent:Wn,sendPageview:Qn,identifyUser:Xn,generateTrackingLink:rs,getConversions:ps,createAffiliateCode:Yn,updateAffiliateCode:Gn,getAffiliateCode:Zn,isAffiliateCodeFree:es,isAffiliateCodeAvailable:ts,getPayoutsLeaderboard:ns,getPointsLeaderboard:ss,getReferredUsersLeaderboard:is,getReferredVolume:os,getUserAudiences:ys,getUserPayoutsByConversion:us,getUserPointsByConversion:ls,getUserPointsMovements:fs,getUserPayoutMovements:ds,getPayoutsByReferrer:hs,getUserReferrer:ms,getVolumeLeaderboard:as,getRevenueLeaderboard:cs,listUserReferralCodes:gs,generateReferralCodes:bs,getReferralStatus:ws,getReferralCode:_s,useReferralCode:Es,updateReferralCode:Rs,deleteReferral:Cs,getAffiliateStats:Ss,getAffiliateNewTraders:As,getClaimableChecks:Ts,getClaimCheckTotals:Ps};var qt=(t=>(t.EvmAddress="evm_address",t.SolanaAddress="solana_address",t.XRPLAddress="xrpl_address",t.SuiAddress="sui_address",t.Email="email",t))(qt||{});S.AddressInUseError=Be,S.CodeInUseError=Ie,S.Fuul=Us,S.InvalidSignatureError=qe,S.UserIdentifierType=qt,S.ValidationError=ve,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})}));
6
+ `+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=M(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&ge.assertOptions(n,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean),legacyInterceptorReqResOrdering:x.transitional(x.boolean)},!1),s!=null&&(a.isFunction(s)?r.paramsSerializer={serialize:s}:ge.assertOptions(s,{encode:x.function,serialize:x.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ge.assertOptions(r,{baseUrl:x.spelling("baseURL"),withXsrfToken:x.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[r.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=O.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(m){if(typeof m.runWhen=="function"&&m.runWhen(r)===!1)return;f=f&&m.synchronous;const p=r.transitional||Pe;p&&p.legacyInterceptorReqResOrdering?c.unshift(m.fulfilled,m.rejected):c.push(m.fulfilled,m.rejected)});const l=[];this.interceptors.response.forEach(function(m){l.push(m.fulfilled,m.rejected)});let u,h=0,g;if(!f){const d=[Ot.bind(this),void 0];for(d.unshift(...c),d.push(...l),g=d.length,u=Promise.resolve(r);h<g;)u=u.then(d[h++],d[h++]);return u}g=c.length;let R=r;for(;h<g;){const d=c[h++],m=c[h++];try{R=d(R)}catch(p){m.call(this,p);break}}try{u=Ot.call(this,R)}catch(d){return Promise.reject(d)}for(h=0,g=l.length;h<g;)u=u.then(l[h++],l[h++]);return u}getUri(e){e=M(this.defaults,e);const r=gt(e.baseURL,e.url,e.allowAbsoluteUrls);return ut(r,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){H.prototype[e]=function(r,n){return this.request(M(n||{},{method:e,url:r,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(e){function r(n){return function(i,o,c){return this.request(M(c||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}H.prototype[e]=r(),H.prototype[e+"Form"]=r(!0)});let bn=class Jt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{n.subscribe(c),i=c}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,c){n.reason||(n.reason=new ie(i,o,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Jt(function(s){e=s}),cancel:e}}};function wn(t){return function(r){return t.apply(null,r)}}function _n(t){return a.isObject(t)&&t.isAxiosError===!0}const Fe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Fe).forEach(([t,e])=>{Fe[e]=t});function xt(t){const e=new H(t),r=Qe(H.prototype.request,e);return a.extend(r,H.prototype,e,{allOwnKeys:!0}),a.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return xt(M(t,s))},r}const _=xt(ne);_.Axios=H,_.CanceledError=ie,_.CancelToken=bn,_.isCancel=ht,_.VERSION=Nt,_.toFormData=fe,_.AxiosError=y,_.Cancel=_.CanceledError,_.all=function(e){return Promise.all(e)},_.spread=wn,_.isAxiosError=_n,_.mergeConfig=M,_.AxiosHeaders=O,_.formToJSON=t=>dt(a.isHTMLForm(t)?new FormData(t):t),_.getAdapter=Pt.getAdapter,_.HttpStatusCode=Fe,_.default=_;const{Axios:js,AxiosError:ke,CanceledError:$s,isCancel:Ms,CancelToken:Hs,VERSION:Vs,all:Ks,Cancel:zs,isAxiosError:Js,spread:Ws,toFormData:Qs,AxiosHeaders:Xs,HttpStatusCode:Ys,formToJSON:Gs,getAdapter:Zs,mergeConfig:ei}=_;class ve extends Error{constructor(r){super(r.join(", "));w(this,"errors");this.name="ValidationError",this.errors=r}}class Be extends Error{constructor(r){super("Address already registered.");w(this,"address");this.name="AddressInUseError",this.address=r}}class Ie extends Error{constructor(r){super("Code already registered.");w(this,"code");this.name="CodeInUseError",this.code=r}}class qe extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class En{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async create(e,r,n,s,i,o,c){var f;try{await this.httpClient.post({path:"/affiliates",postData:{address:e,identifier_type:r,name:n,code:n,signature:s,signature_public_key:i,account_chain_id:o,user_rebate_rate:c}})}catch(l){if(l instanceof ke){const u=(f=l.response)==null?void 0:f.data;if(typeof(u==null?void 0:u.message)=="string"){const h=u.message.toLowerCase();throw h=="invalid signature"?new qe:h=="address in use"?new Be(e):h=="code in use"?new Ie(n):new Error(h)}else if((u==null?void 0:u.message)instanceof Array)throw new ve(u.message)}throw l}}async update(e,r,n,s,i,o,c){var f;try{await this.httpClient.post({path:`/affiliates/${e}`,postData:{code:n,user_identifier:e,identifier_type:r,signature:s,signature_public_key:i,account_chain_id:o,user_rebate_rate:c}})}catch(l){if(l instanceof ke){const u=(f=l.response)==null?void 0:f.data;if(typeof(u==null?void 0:u.message)=="string"){const h=u.message.toLowerCase();throw h=="invalid signature"?new qe:h=="address in use"?new Be(e):h=="code in use"?new Ie(n):new Error(h)}else if((u==null?void 0:u.message)instanceof Array)throw new ve(u.message)}throw l}}async isCodeFree(e){try{return(await this.httpClient.get({path:`/affiliates/codes/${e}`})).data.free}catch(r){throw console.error("Fuul SDK: Could not check affiliate code",r),r}}async isCodeAvailable(e){try{return(await this.httpClient.get({path:`/affiliates/codes/${e}/availability`})).data.available}catch(r){throw console.error("Fuul SDK: Could not check affiliate code availability",r),r}}async getCode(e,r){var n;try{return(await this.httpClient.get({path:`/affiliates/${e}`,queryParams:{identifier_type:r}})).data}catch(s){if(s instanceof ke&&((n=s.response)==null?void 0:n.status)===404)return null;throw console.error("Fuul SDK: Could not get affiliate code",s),s}}}const Rn="/audiences";class Cn{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getUserAudiences(e){return(await this.httpClient.get({path:`${Rn}/audience-segments/user`,queryParams:{...e}})).data}}const Dt="/claim-checks";class Sn{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getClaimableChecks(e){return(await this.httpClient.post({path:`${Dt}/claim`,postData:{userIdentifier:e.user_identifier,userIdentifierType:e.user_identifier_type}})).data}async getClaimCheckTotals(e){return(await this.httpClient.get({path:`${Dt}/totals`,queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,...e.status&&{status:e.status}}})).data}}class An{constructor(e){w(this,"httpClient");this.httpClient=e.httpClient}async getAll(e){const{data:r}=await this.httpClient.get({path:"conversions",queryParams:{...e}});return r}}const Lt="fuul.sent",Tn=60,Pn="connect_wallet",Ft=10;class On{constructor(e){w(this,"debug");w(this,"httpClient");this.httpClient=e.httpClient,this.debug=!!e.debug}async sendEvent(e,r){if(this.isDuplicate(e)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}if(!r||!Array.isArray(r)||r.length===0)await this.httpClient.post({path:"events",postData:e});else for(const n of r){const s=structuredClone({...e,project_id:n});s.metadata.project_id=n,await this.httpClient.post({path:"events",postData:s,queryParams:{project_id:n}})}this.debug&&console.debug(`Fuul SDK: Sent '${e.name}' event`),this.saveSentEvent(e)}isDuplicate(e){var u,h,g,R;const r=`${Lt}_${e.name}`,n=localStorage.getItem(r);if(!n)return!1;const s=JSON.parse(n);if(this.getCurrentTimestamp()-s.timestamp>Tn)return!1;let f=!1;e.metadata&&(f=s.metadata.tracking_id===e.metadata.tracking_id&&s.metadata.project_id===e.metadata.project_id&&s.metadata.referrer===e.metadata.referrer&&s.metadata.source===e.metadata.source&&s.metadata.category===e.metadata.category&&s.metadata.title===e.metadata.title&&s.metadata.tag===e.metadata.tag&&s.user_address===e.user_address&&((u=s.user)==null?void 0:u.identifier)===((h=e.user)==null?void 0:h.identifier)&&((g=s.user)==null?void 0:g.identifier_type)===((R=e.user)==null?void 0:R.identifier_type)&&s.signature===e.signature&&s.signature_message===e.signature_message);let l=!1;return e.args&&s.args&&(l=s.args.page===e.args.page),l&&f}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(e){var o,c,f,l;const r=`${Lt}_${e.name}`,n=`${r}_all`,s=this.getCurrentTimestamp(),i={...e,timestamp:s};if(localStorage.setItem(r,JSON.stringify(i)),e.name===Pn){const u=JSON.parse(localStorage.getItem(n)||"[]"),h={name:e.name,user:{identifier:(o=e.user)==null?void 0:o.identifier,identifier_type:(c=e.user)==null?void 0:c.identifier_type},tracking_id:(f=e.metadata)==null?void 0:f.tracking_id,page:(l=e.args)==null?void 0:l.page};"user_address"in e&&(h.user_address=e.user_address);const g=[...u,h];g.length>Ft&&g.splice(0,g.length-Ft),localStorage.setItem(n,JSON.stringify(g))}}}const Nn={version:"0.0.0"};class Un{constructor(e){w(this,"client");w(this,"defaultQueryParams");this.client=_.create({...e,headers:{Authorization:`Bearer ${e.apiKey}`,"X-Fuul-Sdk-Version":Nn.version}}),this.defaultQueryParams=e.queryParams||{}}makeQueryParams(e){return Object.assign({},this.defaultQueryParams||{},e||{})}async get(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),method:"GET"})}async post(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"POST"})}async put(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"PUT"})}async patch(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"PATCH"})}async delete(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"DELETE"})}}class xn{constructor(e){w(this,"httpClient");this.httpClient=e.httpClient}async getPayoutsLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,user_identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/payouts",queryParams:i})).data}async getPointsLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,user_identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/points",queryParams:i})).data}async getVolumeLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/volume",queryParams:i})).data}async getReferredUsersLeaderboard(e){return(await this.httpClient.get({path:"/leaderboard/referred",queryParams:{...e}})).data}async getReferredVolume(e){const{user_identifiers:r,...n}=e;return(await this.httpClient.get({path:"/payouts/leaderboard/referred-volume",queryParams:{...n,user_identifiers:r.join(",")}})).data}async getRevenueLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/revenue",queryParams:i})).data}}const oe="/payouts";class Dn{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getUserPayoutsByConversion(e){return(await this.httpClient.get({path:oe,queryParams:{...e,type:"onchain-currency"}})).data}async getUserPointsByConversion(e){return(await this.httpClient.get({path:oe,queryParams:{...e,type:"point"}})).data}async getUserPayoutMovements(e){return(await this.httpClient.get({path:`${oe}/movements`,queryParams:{...e,type:"onchain-currency"}})).data}async getUserPointsMovements(e){return(await this.httpClient.get({path:`${oe}/movements`,queryParams:{...e,type:"point"}})).data}async getPayoutsByReferrer(e){return(await this.httpClient.get({path:`${oe}/by-referrer`,queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}}class Ln{constructor(e){w(this,"httpClient");w(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async listUserReferralCodes(e){return(await this.httpClient.get({path:"/referral_codes",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,page:e.page,page_size:e.page_size}})).data}async generateReferralCodes(e){return(await this.httpClient.post({path:"/referral_codes",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,quantity:e.quantity,max_uses:e.max_uses}})).data}async getReferralStatus(e){return(await this.httpClient.get({path:"/referral_codes/status",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}async getReferralCode(e){return(await this.httpClient.get({path:`/referral_codes/${e.code}`})).data}async useReferralCode(e){const{code:r,user_identifier:n,user_identifier_type:s,signature:i,signature_message:o,chain_id:c,account_chain_id:f}=e;await this.httpClient.patch({path:`/referral_codes/${r}/use`,queryParams:{user_identifier:n,user_identifier_type:s,chain_id:c,account_chain_id:f},postData:{signature:i,signature_message:o}})}async updateReferralCode(e){await this.httpClient.patch({path:`/referral_codes/${e.code}`,postData:{max_uses:e.max_uses}})}async deleteReferral(e){const{code:r,user_identifier:n,user_identifier_type:s,referrer_identifier:i,referrer_identifier_type:o,signature:c,signature_message:f,chain_id:l}=e;await this.httpClient.delete({path:`/referral_codes/${r}/referrals`,queryParams:{user_identifier:n,user_identifier_type:s,referrer_identifier:i,referrer_identifier_type:o},postData:{signature:c,signature_message:f,chain_id:l}})}}const Fn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let kn=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Fn[r[t]&63];return e};const vn="fuul.tracking_id",je=()=>Mn(vn,()=>kn()),kt=()=>Y("af")||Y("referrer"),Bn=()=>document.referrer,In=()=>Hn(),qn=()=>Y("category"),jn=()=>Y("title"),$n=()=>Y("tag"),Mn=(t,e)=>{const r=localStorage.getItem(t);if(r)return r;{const n=e();return n?localStorage.setItem(t,n):localStorage.removeItem(t),n}},Y=t=>new URLSearchParams(window.location.search).get(t),Hn=()=>{const t=Y("source");if(t)return t},Vn="/user";class Kn{constructor(e){w(this,"httpClient");this.httpClient=e.httpClient}async getUserReferrer(e){return(await this.httpClient.get({path:`${Vn}/referrer`,queryParams:{...e}})).data}}const zn="https://api.fuul.xyz/api/v1/";let B=!1,$e=!1,Me,k,vt,Bt,V,He,be,G,It,K,I,Ve;function Jn(t){B=!!t.debug,!$e&&(Me=t.apiKey,Os(),k=Ns(t.baseApiUrl??zn,t.defaultQueryParams??{}),vt=new An({httpClient:k,debug:B}),be=new On({httpClient:k,debug:B}),V=new En({httpClient:k,debug:B}),He=new W({httpClient:k}),G=new Dn({httpClient:k,debug:B}),Bt=new Kn({httpClient:k}),It=new Cn({httpClient:k,debug:B}),K=new xn({httpClient:k}),I=new Ln({httpClient:k,debug:B}),Ve=new Sn({httpClient:k,debug:B}),$e=!0,B&&console.debug("Fuul SDK: init() complete"))}function b(){if(!$e)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Wn(t,e){b(),Ke(),ze();const r={name:t,args:e??{},metadata:{tracking_id:je()}};await be.sendEvent(r)}async function Qn(t,e){b(),Ke(),ze();const r={name:"pageview",args:{page:t??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:je(),referrer_url:Bn(),source:In(),affiliate_id:kt()??void 0,referrer:kt()??void 0,category:qn()??void 0,title:jn()??void 0,tag:$n()??void 0}};await be.sendEvent(r,e)}async function Xn(t,e){b(),Ke(),ze();const r={name:"connect_wallet",user:{identifier:t.identifier,identifier_type:t.identifierType},args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:je()}};t!=null&&t.signature&&(r.signature=t==null?void 0:t.signature,r.signature_message=t==null?void 0:t.message),t!=null&&t.signaturePublicKey&&(r.signature_public_key=t.signaturePublicKey),t!=null&&t.accountChainId&&(r.account_chain_id=t.accountChainId),await be.sendEvent(r,e)}async function Yn(t){b(),await V.create(t.userIdentifier,t.identifierType,t.code,t.signature,t.signaturePublicKey,t.accountChainId,t.userRebateRate)}async function Gn(t){b(),await V.update(t.userIdentifier,t.identifierType,t.code,t.signature,t.signaturePublicKey,t.accountChainId,t.userRebateRate)}async function Zn(t,e){return b(),await V.getCode(t,e)}async function es(t){return b(),await V.isCodeFree(t)}async function ts(t){return b(),await V.isCodeAvailable(t)}async function rs(t,e,r,n){b();const s=await V.getCode(e,r),i=new URLSearchParams({af:(s==null?void 0:s.code)??e});return n!=null&&n.title&&i.append("af_title",n.title),n!=null&&n.format&&i.append("af_format",n.format),n!=null&&n.place&&i.append("af_place",n.place),`${t}?${i.toString()}`}function ns(t){return K.getPayoutsLeaderboard(t)}function ss(t){return K.getPointsLeaderboard(t)}function is(t){return K.getReferredUsersLeaderboard(t)}function os(t){return b(),K.getReferredVolume(t)}function as(t){return b(),K.getVolumeLeaderboard(t)}function cs(t){return b(),K.getRevenueLeaderboard(t)}function us(t){return G.getUserPayoutsByConversion(t)}function ls(t){return G.getUserPointsByConversion(t)}function ds(t){return G.getUserPayoutMovements(t)}function fs(t){return G.getUserPointsMovements(t)}function hs(t){return b(),G.getPayoutsByReferrer(t)}async function ps(t){return b(),vt.getAll(t)}async function ms(t){return b(),Bt.getUserReferrer(t)}async function ys(t){return b(),It.getUserAudiences(t)}async function gs(t){return b(),I.listUserReferralCodes(t)}async function bs(t){return b(),I.generateReferralCodes(t)}async function ws(t){return b(),I.getReferralStatus(t)}async function _s(t){return b(),I.getReferralCode(t)}async function Es(t){return b(),I.useReferralCode(t)}async function Rs(t){return b(),I.updateReferralCode(t)}async function Cs(t){return b(),I.deleteReferral(t)}async function Ss(t){return b(),He.getAffiliateStats(t)}async function As(t){return b(),He.getAffiliateNewTraders(t)}async function Ts(t){return b(),Ve.getClaimableChecks(t)}async function Ps(t){return b(),Ve.getClaimCheckTotals(t)}function Ke(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function ze(){if(navigator.webdriver)throw new Error("Fuul SDK: Error")}function Os(){if(!Me)throw new Error("Fuul SDK: Invalid API key")}function Ns(t,e){return new Un({baseURL:t,timeout:3e4,apiKey:Me,queryParams:e})}const Us={init:Jn,sendEvent:Wn,sendPageview:Qn,identifyUser:Xn,generateTrackingLink:rs,getConversions:ps,createAffiliateCode:Yn,updateAffiliateCode:Gn,getAffiliateCode:Zn,isAffiliateCodeFree:es,isAffiliateCodeAvailable:ts,getPayoutsLeaderboard:ns,getPointsLeaderboard:ss,getReferredUsersLeaderboard:is,getReferredVolume:os,getUserAudiences:ys,getUserPayoutsByConversion:us,getUserPointsByConversion:ls,getUserPointsMovements:fs,getUserPayoutMovements:ds,getPayoutsByReferrer:hs,getUserReferrer:ms,getVolumeLeaderboard:as,getRevenueLeaderboard:cs,listUserReferralCodes:gs,generateReferralCodes:bs,getReferralStatus:ws,getReferralCode:_s,useReferralCode:Es,updateReferralCode:Rs,deleteReferral:Cs,getAffiliateStats:Ss,getAffiliateNewTraders:As,getClaimableChecks:Ts,getClaimCheckTotals:Ps};var qt=(t=>(t.EvmAddress="evm_address",t.SolanaAddress="solana_address",t.XRPLAddress="xrpl_address",t.SuiAddress="sui_address",t.Email="email",t))(qt||{});S.AddressInUseError=Be,S.CodeInUseError=Ie,S.Fuul=Us,S.InvalidSignatureError=qe,S.UserIdentifierType=qt,S.ValidationError=ve,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuul/sdk",
3
- "version": "7.17.1",
3
+ "version": "7.18.0",
4
4
  "description": "Fuul SDK",
5
5
  "keywords": [
6
6
  "Fuul",