@fuul/sdk 6.1.1 → 7.0.0-beta.1

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.
package/dist/index.mjs CHANGED
@@ -331,12 +331,12 @@ function ae(e, t, n) {
331
331
  return a.isArrayBuffer(h) || a.isTypedArray(h) ? f && typeof Blob == "function" ? new Blob([h]) : Buffer.from(h) : h;
332
332
  }
333
333
  function l(h, y, p) {
334
- let w = h;
334
+ let b = h;
335
335
  if (h && !p && typeof h == "object") {
336
336
  if (a.endsWith(y, "{}"))
337
337
  y = r ? y : y.slice(0, -2), h = JSON.stringify(h);
338
- else if (a.isArray(h) && hn(h) || (a.isFileList(h) || a.endsWith(y, "[]")) && (w = a.toArray(h)))
339
- return y = it(y), w.forEach(function(C, U) {
338
+ else if (a.isArray(h) && hn(h) || (a.isFileList(h) || a.endsWith(y, "[]")) && (b = a.toArray(h)))
339
+ return y = it(y), b.forEach(function(C, U) {
340
340
  !(a.isUndefined(C) || C === null) && t.append(
341
341
  // eslint-disable-next-line no-nested-ternary
342
342
  i === !0 ? Ue([y], U, o) : i === null ? y : y + "[]",
@@ -351,24 +351,24 @@ function ae(e, t, n) {
351
351
  convertValue: u,
352
352
  isVisitable: ye
353
353
  });
354
- function E(h, y) {
354
+ function w(h, y) {
355
355
  if (!a.isUndefined(h)) {
356
356
  if (d.indexOf(h) !== -1)
357
357
  throw Error("Circular reference detected in " + y.join("."));
358
- d.push(h), a.forEach(h, function(w, S) {
359
- (!(a.isUndefined(w) || w === null) && s.call(
358
+ d.push(h), a.forEach(h, function(b, S) {
359
+ (!(a.isUndefined(b) || b === null) && s.call(
360
360
  t,
361
- w,
361
+ b,
362
362
  a.isString(S) ? S.trim() : S,
363
363
  y,
364
364
  g
365
- )) === !0 && E(w, y ? y.concat(S) : [S]);
365
+ )) === !0 && w(b, y ? y.concat(S) : [S]);
366
366
  }), d.pop();
367
367
  }
368
368
  }
369
369
  if (!a.isObject(e))
370
370
  throw new TypeError("data must be an object");
371
- return E(e), t;
371
+ return w(e), t;
372
372
  }
373
373
  function Le(e) {
374
374
  const t = {
@@ -852,8 +852,8 @@ function kn(e, t) {
852
852
  g += n[d++], d = d % e;
853
853
  if (s = (s + 1) % e, s === o && (o = (o + 1) % e), u - i < t)
854
854
  return;
855
- const E = l && u - l;
856
- return E ? Math.round(g * 1e3 / E) : void 0;
855
+ const w = l && u - l;
856
+ return w ? Math.round(g * 1e3 / w) : void 0;
857
857
  };
858
858
  }
859
859
  function Bn(e, t) {
@@ -1025,13 +1025,13 @@ const pt = (e) => {
1025
1025
  const s = pt(e);
1026
1026
  let o = s.data;
1027
1027
  const i = O.from(s.headers).normalize();
1028
- let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, g, E, h;
1028
+ let { responseType: c, onUploadProgress: f, onDownloadProgress: u } = s, l, d, g, w, h;
1029
1029
  function y() {
1030
- E && E(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
1030
+ w && w(), h && h(), s.cancelToken && s.cancelToken.unsubscribe(l), s.signal && s.signal.removeEventListener("abort", l);
1031
1031
  }
1032
1032
  let p = new XMLHttpRequest();
1033
1033
  p.open(s.method.toUpperCase(), s.url, !0), p.timeout = s.timeout;
1034
- function w() {
1034
+ function b() {
1035
1035
  if (!p)
1036
1036
  return;
1037
1037
  const C = O.from(
@@ -1050,8 +1050,8 @@ const pt = (e) => {
1050
1050
  r(D), y();
1051
1051
  }, A), p = null;
1052
1052
  }
1053
- "onloadend" in p ? p.onloadend = w : p.onreadystatechange = function() {
1054
- !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(w);
1053
+ "onloadend" in p ? p.onloadend = b : p.onreadystatechange = function() {
1054
+ !p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(b);
1055
1055
  }, p.onabort = function() {
1056
1056
  p && (r(new m("Request aborted", m.ECONNABORTED, e, p)), p = null);
1057
1057
  }, p.onerror = function() {
@@ -1067,7 +1067,7 @@ const pt = (e) => {
1067
1067
  )), p = null;
1068
1068
  }, o === void 0 && i.setContentType(null), "setRequestHeader" in p && a.forEach(i.toJSON(), function(U, A) {
1069
1069
  p.setRequestHeader(A, U);
1070
- }), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([g, h] = ne(u, !0), p.addEventListener("progress", g)), f && p.upload && ([d, E] = ne(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", E)), (s.cancelToken || s.signal) && (l = (C) => {
1070
+ }), a.isUndefined(s.withCredentials) || (p.withCredentials = !!s.withCredentials), c && c !== "json" && (p.responseType = s.responseType), u && ([g, h] = ne(u, !0), p.addEventListener("progress", g)), f && p.upload && ([d, w] = ne(f), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", w)), (s.cancelToken || s.signal) && (l = (C) => {
1071
1071
  p && (r(!C || C.type ? new M(null, e, p) : C), p.abort(), p = null);
1072
1072
  }, s.cancelToken && s.cancelToken.subscribe(l), s.signal && (s.signal.aborted ? l() : s.signal.addEventListener("abort", l)));
1073
1073
  const S = Dn(s.url);
@@ -1216,9 +1216,9 @@ const Qn = async (e) => {
1216
1216
  fetchOptions: g
1217
1217
  } = pt(e);
1218
1218
  u = u ? (u + "").toLowerCase() : "text";
1219
- let E = Hn([s, o && o.toAbortSignal()], i), h;
1220
- const y = E && E.unsubscribe && (() => {
1221
- E.unsubscribe();
1219
+ let w = Hn([s, o && o.toAbortSignal()], i), h;
1220
+ const y = w && w.unsubscribe && (() => {
1221
+ w.unsubscribe();
1222
1222
  });
1223
1223
  let p;
1224
1224
  try {
@@ -1237,15 +1237,15 @@ const Qn = async (e) => {
1237
1237
  }
1238
1238
  }
1239
1239
  a.isString(d) || (d = d ? "include" : "omit");
1240
- const w = "credentials" in Request.prototype;
1240
+ const b = "credentials" in Request.prototype;
1241
1241
  h = new Request(t, {
1242
1242
  ...g,
1243
- signal: E,
1243
+ signal: w,
1244
1244
  method: n.toUpperCase(),
1245
1245
  headers: l.normalize().toJSON(),
1246
1246
  body: r,
1247
1247
  duplex: "half",
1248
- credentials: w ? d : void 0
1248
+ credentials: b ? d : void 0
1249
1249
  });
1250
1250
  let S = await fetch(h, g);
1251
1251
  const C = we && (u === "stream" || u === "response");
@@ -1277,13 +1277,13 @@ const Qn = async (e) => {
1277
1277
  request: h
1278
1278
  });
1279
1279
  });
1280
- } catch (w) {
1281
- throw y && y(), w && w.name === "TypeError" && /Load failed|fetch/i.test(w.message) ? Object.assign(
1280
+ } catch (b) {
1281
+ throw y && y(), b && b.name === "TypeError" && /Load failed|fetch/i.test(b.message) ? Object.assign(
1282
1282
  new m("Network Error", m.ERR_NETWORK, e, h),
1283
1283
  {
1284
- cause: w.cause || w
1284
+ cause: b.cause || b
1285
1285
  }
1286
- ) : m.from(w, w && w.code, e, h);
1286
+ ) : m.from(b, b && b.code, e, h);
1287
1287
  }
1288
1288
  }), be = {
1289
1289
  http: dn,
@@ -1476,18 +1476,18 @@ let q = class {
1476
1476
  return l;
1477
1477
  }
1478
1478
  g = c.length;
1479
- let E = n;
1479
+ let w = n;
1480
1480
  for (d = 0; d < g; ) {
1481
1481
  const h = c[d++], y = c[d++];
1482
1482
  try {
1483
- E = h(E);
1483
+ w = h(w);
1484
1484
  } catch (p) {
1485
1485
  y.call(this, p);
1486
1486
  break;
1487
1487
  }
1488
1488
  }
1489
1489
  try {
1490
- l = Me.call(this, E);
1490
+ l = Me.call(this, w);
1491
1491
  } catch (h) {
1492
1492
  return Promise.reject(h);
1493
1493
  }
@@ -1680,44 +1680,44 @@ function Et(e) {
1680
1680
  return Et(I(e, s));
1681
1681
  }, n;
1682
1682
  }
1683
- const b = Et(X);
1684
- b.Axios = q;
1685
- b.CanceledError = M;
1686
- b.CancelToken = er;
1687
- b.isCancel = ft;
1688
- b.VERSION = wt;
1689
- b.toFormData = ae;
1690
- b.AxiosError = m;
1691
- b.Cancel = b.CanceledError;
1692
- b.all = function(t) {
1683
+ const E = Et(X);
1684
+ E.Axios = q;
1685
+ E.CanceledError = M;
1686
+ E.CancelToken = er;
1687
+ E.isCancel = ft;
1688
+ E.VERSION = wt;
1689
+ E.toFormData = ae;
1690
+ E.AxiosError = m;
1691
+ E.Cancel = E.CanceledError;
1692
+ E.all = function(t) {
1693
1693
  return Promise.all(t);
1694
1694
  };
1695
- b.spread = tr;
1696
- b.isAxiosError = nr;
1697
- b.mergeConfig = I;
1698
- b.AxiosHeaders = O;
1699
- b.formToJSON = (e) => lt(a.isHTMLForm(e) ? new FormData(e) : e);
1700
- b.getAdapter = gt.getAdapter;
1701
- b.HttpStatusCode = Ee;
1702
- b.default = b;
1695
+ E.spread = tr;
1696
+ E.isAxiosError = nr;
1697
+ E.mergeConfig = I;
1698
+ E.AxiosHeaders = O;
1699
+ E.formToJSON = (e) => lt(a.isHTMLForm(e) ? new FormData(e) : e);
1700
+ E.getAdapter = gt.getAdapter;
1701
+ E.HttpStatusCode = Ee;
1702
+ E.default = E;
1703
1703
  const {
1704
- Axios: Zr,
1704
+ Axios: es,
1705
1705
  AxiosError: G,
1706
- CanceledError: es,
1707
- isCancel: ts,
1708
- CancelToken: ns,
1709
- VERSION: rs,
1710
- all: ss,
1711
- Cancel: os,
1712
- isAxiosError: is,
1713
- spread: as,
1714
- toFormData: cs,
1715
- AxiosHeaders: us,
1716
- HttpStatusCode: ls,
1717
- formToJSON: fs,
1718
- getAdapter: ds,
1719
- mergeConfig: hs
1720
- } = b;
1706
+ CanceledError: ts,
1707
+ isCancel: ns,
1708
+ CancelToken: rs,
1709
+ VERSION: ss,
1710
+ all: os,
1711
+ Cancel: is,
1712
+ isAxiosError: as,
1713
+ spread: cs,
1714
+ toFormData: us,
1715
+ AxiosHeaders: ls,
1716
+ HttpStatusCode: fs,
1717
+ formToJSON: ds,
1718
+ getAdapter: hs,
1719
+ mergeConfig: ps
1720
+ } = E;
1721
1721
  class He extends Error {
1722
1722
  constructor(n) {
1723
1723
  super(n.join(", "));
@@ -1757,7 +1757,7 @@ class rr {
1757
1757
  path: "/affiliates",
1758
1758
  postData: {
1759
1759
  address: t,
1760
- blockchain: n,
1760
+ identifier_type: n,
1761
1761
  name: r,
1762
1762
  code: r,
1763
1763
  signature: s,
@@ -1783,8 +1783,8 @@ class rr {
1783
1783
  path: `/affiliates/${t}`,
1784
1784
  postData: {
1785
1785
  code: r,
1786
- address: t,
1787
- blockchain: n,
1786
+ user_identifier: t,
1787
+ identifier_type: n,
1788
1788
  signature: s,
1789
1789
  account_chain_id: o
1790
1790
  }
@@ -1814,7 +1814,7 @@ class rr {
1814
1814
  async getCode(t, n) {
1815
1815
  var r;
1816
1816
  try {
1817
- return (await this.httpClient.get({ path: `/affiliates/${t}`, queryParams: { blockchain: n } })).data.code;
1817
+ return (await this.httpClient.get({ path: `/affiliates/${t}`, queryParams: { identifier_type: n } })).data.code;
1818
1818
  } catch (s) {
1819
1819
  if (s instanceof G && ((r = s.response) == null ? void 0 : r.status) === 404)
1820
1820
  return null;
@@ -1868,6 +1868,7 @@ class ur {
1868
1868
  this.debug && console.debug(`Fuul SDK: Sent '${t.name}' event`), this.saveSentEvent(t);
1869
1869
  }
1870
1870
  isDuplicate(t) {
1871
+ var l, d, g, w;
1871
1872
  const n = `${Je}_${t.name}`, r = localStorage.getItem(n);
1872
1873
  if (!r)
1873
1874
  return !1;
@@ -1875,7 +1876,7 @@ class ur {
1875
1876
  if (this.getCurrentTimestamp() - s.timestamp > ar)
1876
1877
  return !1;
1877
1878
  let f = !1;
1878
- t.metadata && (f = s.metadata.tracking_id === t.metadata.tracking_id && s.metadata.project_id === t.metadata.project_id && s.metadata.referrer === t.metadata.referrer && s.metadata.source === t.metadata.source && s.metadata.category === t.metadata.category && s.metadata.title === t.metadata.title && s.metadata.tag === t.metadata.tag && s.user_address === t.user_address && s.signature === t.signature && s.signature_message === t.signature_message);
1879
+ t.metadata && (f = s.metadata.tracking_id === t.metadata.tracking_id && s.metadata.project_id === t.metadata.project_id && s.metadata.referrer === t.metadata.referrer && s.metadata.source === t.metadata.source && s.metadata.category === t.metadata.category && s.metadata.title === t.metadata.title && s.metadata.tag === t.metadata.tag && s.user_address === t.user_address && ((l = s.user) == null ? void 0 : l.identifier) === ((d = t.user) == null ? void 0 : d.identifier) && ((g = s.user) == null ? void 0 : g.identifier_type) === ((w = t.user) == null ? void 0 : w.identifier_type) && s.signature === t.signature && s.signature_message === t.signature_message);
1879
1880
  let u = !1;
1880
1881
  return t.args && s.args && (u = s.args.page === t.args.page), u && f;
1881
1882
  }
@@ -1883,27 +1884,32 @@ class ur {
1883
1884
  return Date.now() / 1e3;
1884
1885
  }
1885
1886
  saveSentEvent(t) {
1886
- var i, c;
1887
+ var i, c, f, u;
1887
1888
  const n = `${Je}_${t.name}`, r = `${n}_all`, s = this.getCurrentTimestamp(), o = { ...t, timestamp: s };
1888
1889
  if (localStorage.setItem(n, JSON.stringify(o)), t.name === cr) {
1889
- const f = JSON.parse(localStorage.getItem(r) || "[]"), u = {
1890
+ const l = JSON.parse(localStorage.getItem(r) || "[]"), d = {
1890
1891
  name: t.name,
1891
- user_address: t.user_address,
1892
- tracking_id: (i = t.metadata) == null ? void 0 : i.tracking_id,
1893
- page: (c = t.args) == null ? void 0 : c.page
1894
- }, l = [...f, u];
1895
- l.length > We && l.splice(0, l.length - We), localStorage.setItem(r, JSON.stringify(l));
1892
+ user: {
1893
+ identifier: (i = t.user) == null ? void 0 : i.identifier,
1894
+ identifier_type: (c = t.user) == null ? void 0 : c.identifier_type
1895
+ },
1896
+ tracking_id: (f = t.metadata) == null ? void 0 : f.tracking_id,
1897
+ page: (u = t.args) == null ? void 0 : u.page
1898
+ };
1899
+ "user_address" in t && (d.user_address = t.user_address);
1900
+ const g = [...l, d];
1901
+ g.length > We && g.splice(0, g.length - We), localStorage.setItem(r, JSON.stringify(g));
1896
1902
  }
1897
1903
  }
1898
1904
  }
1899
- const lr = "6.1.1", fr = {
1905
+ const lr = "7.0.0-beta.1", fr = {
1900
1906
  version: lr
1901
1907
  };
1902
1908
  class dr {
1903
1909
  constructor(t) {
1904
1910
  R(this, "client");
1905
1911
  R(this, "defaultQueryParams");
1906
- this.client = b.create({
1912
+ this.client = E.create({
1907
1913
  ...t,
1908
1914
  headers: {
1909
1915
  Authorization: `Bearer ${t.apiKey}`,
@@ -2007,8 +2013,14 @@ class pr {
2007
2013
  })).data;
2008
2014
  }
2009
2015
  }
2010
- let mr = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, n) => (n &= 63, n < 36 ? t += n.toString(36) : n < 62 ? t += (n - 26).toString(36).toUpperCase() : n > 62 ? t += "-" : t += "_", t), "");
2011
- const yr = "fuul.tracking_id", Ae = () => Cr(yr, () => mr()), Qe = () => v("af") || v("referrer"), gr = () => document.referrer, wr = () => Rr(), br = () => v("category"), Er = () => v("title"), Sr = () => v("tag"), Cr = (e, t) => {
2016
+ const mr = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2017
+ let yr = (e = 21) => {
2018
+ let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
2019
+ for (; e--; )
2020
+ t += mr[n[e] & 63];
2021
+ return t;
2022
+ };
2023
+ const gr = "fuul.tracking_id", Ae = () => Rr(gr, () => yr()), Qe = () => v("af") || v("referrer"), wr = () => document.referrer, br = () => Tr(), Er = () => v("category"), Sr = () => v("title"), Cr = () => v("tag"), Rr = (e, t) => {
2012
2024
  const n = localStorage.getItem(e);
2013
2025
  if (n)
2014
2026
  return n;
@@ -2016,30 +2028,30 @@ const yr = "fuul.tracking_id", Ae = () => Cr(yr, () => mr()), Qe = () => v("af")
2016
2028
  const r = t();
2017
2029
  return r ? localStorage.setItem(e, r) : localStorage.removeItem(e), r;
2018
2030
  }
2019
- }, v = (e) => new URLSearchParams(window.location.search).get(e), Rr = () => {
2031
+ }, v = (e) => new URLSearchParams(window.location.search).get(e), Tr = () => {
2020
2032
  const e = v("source");
2021
2033
  if (e)
2022
2034
  return e;
2023
- }, Tr = "/user";
2024
- class Ar {
2035
+ }, Ar = "/user";
2036
+ class _r {
2025
2037
  constructor(t) {
2026
2038
  R(this, "httpClient");
2027
2039
  this.httpClient = t.httpClient;
2028
2040
  }
2029
2041
  async getUserAffiliates(t) {
2030
- return (await this.httpClient.get({ path: Tr, queryParams: { ...t } })).data.affiliates;
2042
+ return (await this.httpClient.get({ path: Ar, queryParams: { ...t } })).data.affiliates;
2031
2043
  }
2032
2044
  }
2033
- const _r = "https://api.fuul.xyz/api/v1/";
2045
+ const Or = "https://api.fuul.xyz/api/v1/";
2034
2046
  let k = !1, Se = !1, _e, F, St, Ct, $, le, H, Rt, fe;
2035
- function Or(e) {
2036
- k = !!e.debug, !Se && (_e = e.apiKey, Jr(), F = Wr(e.baseApiUrl ?? _r, e.defaultQueryParams ?? {}), St = new ir({ httpClient: F, debug: k }), le = new ur({ httpClient: F, debug: k }), $ = new rr({ httpClient: F, debug: k }), H = new pr({ httpClient: F, debug: k }), Ct = new Ar({ httpClient: F }), Rt = new or({ httpClient: F, debug: k }), fe = new hr({ httpClient: F }), Se = !0, k && console.debug("Fuul SDK: init() complete"));
2047
+ function Pr(e) {
2048
+ k = !!e.debug, !Se && (_e = e.apiKey, Wr(), F = Qr(e.baseApiUrl ?? Or, e.defaultQueryParams ?? {}), St = new ir({ httpClient: F, debug: k }), le = new ur({ httpClient: F, debug: k }), $ = new rr({ httpClient: F, debug: k }), H = new pr({ httpClient: F, debug: k }), Ct = new _r({ httpClient: F }), Rt = new or({ httpClient: F, debug: k }), fe = new hr({ httpClient: F }), Se = !0, k && console.debug("Fuul SDK: init() complete"));
2037
2049
  }
2038
2050
  function N() {
2039
2051
  if (!Se)
2040
2052
  throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods");
2041
2053
  }
2042
- async function Pr(e, t) {
2054
+ async function Nr(e, t) {
2043
2055
  N(), Oe(), Pe();
2044
2056
  const n = {
2045
2057
  name: e,
@@ -2050,7 +2062,7 @@ async function Pr(e, t) {
2050
2062
  };
2051
2063
  await le.sendEvent(n);
2052
2064
  }
2053
- async function Nr(e, t) {
2065
+ async function xr(e, t) {
2054
2066
  N(), Oe(), Pe();
2055
2067
  const n = {
2056
2068
  name: "pageview",
@@ -2060,23 +2072,25 @@ async function Nr(e, t) {
2060
2072
  },
2061
2073
  metadata: {
2062
2074
  tracking_id: Ae(),
2063
- referrer_url: gr(),
2064
- source: wr(),
2075
+ referrer_url: wr(),
2076
+ source: br(),
2065
2077
  affiliate_id: Qe() ?? void 0,
2066
2078
  referrer: Qe() ?? void 0,
2067
- category: br() ?? void 0,
2068
- title: Er() ?? void 0,
2069
- tag: Sr() ?? void 0
2079
+ category: Er() ?? void 0,
2080
+ title: Sr() ?? void 0,
2081
+ tag: Cr() ?? void 0
2070
2082
  }
2071
2083
  };
2072
2084
  await le.sendEvent(n, t);
2073
2085
  }
2074
- async function xr(e, t) {
2086
+ async function Ur(e, t) {
2075
2087
  N(), Oe(), Pe();
2076
2088
  const n = {
2077
2089
  name: "connect_wallet",
2078
- user_address: e.address,
2079
- blockchain: e.blockchain,
2090
+ user: {
2091
+ identifier: e.identifier,
2092
+ identifier_type: e.identifierType
2093
+ },
2080
2094
  args: {
2081
2095
  page: document.location.pathname,
2082
2096
  locationOrigin: document.location.origin
@@ -2087,56 +2101,56 @@ async function xr(e, t) {
2087
2101
  };
2088
2102
  e != null && e.signature && (n.signature = e == null ? void 0 : e.signature, n.signature_message = e == null ? void 0 : e.message), e != null && e.accountChainId && (n.account_chain_id = e.accountChainId), await le.sendEvent(n, t);
2089
2103
  }
2090
- async function Ur(e) {
2091
- N(), await $.create(e.address, e.blockchain, e.code, e.signature, e.accountChainId);
2092
- }
2093
2104
  async function Lr(e) {
2094
- N(), await $.update(e.address, e.blockchain, e.code, e.signature, e.accountChainId);
2105
+ N(), await $.create(e.userIdentifier, e.identifierType, e.code, e.signature, e.accountChainId);
2095
2106
  }
2096
- async function Fr(e, t) {
2107
+ async function Fr(e) {
2108
+ N(), await $.update(e.userIdentifier, e.identifierType, e.code, e.signature, e.accountChainId);
2109
+ }
2110
+ async function Dr(e, t) {
2097
2111
  return N(), await $.getCode(e, t);
2098
2112
  }
2099
- async function Dr(e) {
2113
+ async function kr(e) {
2100
2114
  return N(), await $.isCodeFree(e);
2101
2115
  }
2102
- async function kr(e, t, n, r) {
2116
+ async function Br(e, t, n, r) {
2103
2117
  N();
2104
2118
  const s = await $.getCode(t, n), o = new URLSearchParams({
2105
2119
  af: s ?? t
2106
2120
  });
2107
2121
  return r != null && r.title && o.append("af_title", r.title), r != null && r.format && o.append("af_format", r.format), r != null && r.place && o.append("af_place", r.place), `${e}?${o.toString()}`;
2108
2122
  }
2109
- function Br(e) {
2123
+ function qr(e) {
2110
2124
  return fe.getPayoutsLeaderboard(e);
2111
2125
  }
2112
- function qr(e) {
2126
+ function Ir(e) {
2113
2127
  return fe.getPointsLeaderboard(e);
2114
2128
  }
2115
- function Ir(e) {
2129
+ function vr(e) {
2116
2130
  return fe.getReferredUsersLeaderboard(e);
2117
2131
  }
2118
- function vr(e) {
2132
+ function jr(e) {
2119
2133
  return H.getVolumeLeaderboard(e);
2120
2134
  }
2121
- function jr(e) {
2135
+ function Mr(e) {
2122
2136
  return H.getUserPayoutsByConversion(e);
2123
2137
  }
2124
- function Mr(e) {
2138
+ function $r(e) {
2125
2139
  return H.getUserPointsByConversion(e);
2126
2140
  }
2127
- function $r(e) {
2141
+ function Hr(e) {
2128
2142
  return H.getUserPayoutMovements(e);
2129
2143
  }
2130
- function Hr(e) {
2144
+ function Vr(e) {
2131
2145
  return H.getUserPointsMovements(e);
2132
2146
  }
2133
- async function Vr(e) {
2147
+ async function Kr(e) {
2134
2148
  return N(), St.getAll(e);
2135
2149
  }
2136
- async function Kr(e) {
2150
+ async function zr(e) {
2137
2151
  return N(), Ct.getUserAffiliates(e);
2138
2152
  }
2139
- async function zr(e) {
2153
+ async function Jr(e) {
2140
2154
  return N(), Rt.getUserAudiences(e);
2141
2155
  }
2142
2156
  function Oe() {
@@ -2147,11 +2161,11 @@ function Pe() {
2147
2161
  if (navigator.webdriver)
2148
2162
  throw new Error("Fuul SDK: You are using a browser automation tool");
2149
2163
  }
2150
- function Jr() {
2164
+ function Wr() {
2151
2165
  if (!_e)
2152
2166
  throw new Error("Fuul SDK: Invalid API key");
2153
2167
  }
2154
- function Wr(e, t) {
2168
+ function Qr(e, t) {
2155
2169
  return new dr({
2156
2170
  baseURL: e,
2157
2171
  timeout: 3e4,
@@ -2159,34 +2173,34 @@ function Wr(e, t) {
2159
2173
  queryParams: t
2160
2174
  });
2161
2175
  }
2162
- const ps = {
2163
- init: Or,
2164
- sendEvent: Pr,
2165
- sendPageview: Nr,
2166
- sendConnectWallet: xr,
2167
- generateTrackingLink: kr,
2168
- getConversions: Vr,
2169
- createAffiliateCode: Ur,
2170
- updateAffiliateCode: Lr,
2171
- getAffiliateCode: Fr,
2172
- isAffiliateCodeFree: Dr,
2173
- getPayoutsLeaderboard: Br,
2174
- getPointsLeaderboard: qr,
2175
- getReferredUsersLeaderboard: Ir,
2176
- getUserAudiences: zr,
2177
- getUserPayoutsByConversion: jr,
2178
- getUserPointsByConversion: Mr,
2179
- getUserPointsMovements: Hr,
2180
- getUserPayoutMovements: $r,
2181
- getUserAffiliates: Kr,
2182
- getVolumeLeaderboard: vr
2176
+ const ms = {
2177
+ init: Pr,
2178
+ sendEvent: Nr,
2179
+ sendPageview: xr,
2180
+ identifyUser: Ur,
2181
+ generateTrackingLink: Br,
2182
+ getConversions: Kr,
2183
+ createAffiliateCode: Lr,
2184
+ updateAffiliateCode: Fr,
2185
+ getAffiliateCode: Dr,
2186
+ isAffiliateCodeFree: kr,
2187
+ getPayoutsLeaderboard: qr,
2188
+ getPointsLeaderboard: Ir,
2189
+ getReferredUsersLeaderboard: vr,
2190
+ getUserAudiences: Jr,
2191
+ getUserPayoutsByConversion: Mr,
2192
+ getUserPointsByConversion: $r,
2193
+ getUserPointsMovements: Vr,
2194
+ getUserPayoutMovements: Hr,
2195
+ getUserAffiliates: zr,
2196
+ getVolumeLeaderboard: jr
2183
2197
  };
2184
- var Qr = /* @__PURE__ */ ((e) => (e.Ethereum = "ethereum", e.Solana = "solana", e))(Qr || {});
2198
+ var Xr = /* @__PURE__ */ ((e) => (e.EvmAddress = "evm_address", e.SolanaAddress = "solana_address", e.Email = "email", e))(Xr || {});
2185
2199
  export {
2186
2200
  Ve as AddressInUseError,
2187
- Qr as BlockchainType,
2188
2201
  Ke as CodeInUseError,
2189
- ps as Fuul,
2202
+ ms as Fuul,
2190
2203
  ze as InvalidSignatureError,
2204
+ Xr as UserIdentifierType,
2191
2205
  He as ValidationError
2192
2206
  };