@monerium/sdk 2.0.17 → 2.0.18

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.
@@ -3,7 +3,7 @@ var oe = (e, t, o) =>
3
3
  t in e
4
4
  ? ne(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o })
5
5
  : (e[t] = o);
6
- var L = (e, t, o) => (oe(e, typeof t != "symbol" ? t + "" : t, o), o),
6
+ var E = (e, t, o) => (oe(e, typeof t != "symbol" ? t + "" : t, o), o),
7
7
  I = (e, t, o) => {
8
8
  if (!t.has(e)) throw TypeError("Cannot " + o);
9
9
  };
@@ -19,7 +19,7 @@ var U = (e, t, o) => (
19
19
  I(e, t, "write to private field"), a ? a.call(e, o) : t.set(e, o), o
20
20
  );
21
21
  var B = (e, t, o) => (I(e, t, "access private method"), o);
22
- var z =
22
+ var O =
23
23
  typeof globalThis < "u"
24
24
  ? globalThis
25
25
  : typeof window < "u"
@@ -35,9 +35,9 @@ function ie(e) {
35
35
  if (typeof t == "function") {
36
36
  var o = function a() {
37
37
  if (this instanceof a) {
38
- var _ = [null];
39
- _.push.apply(_, arguments);
40
- var l = Function.bind.apply(t, _);
38
+ var w = [null];
39
+ w.push.apply(w, arguments);
40
+ var l = Function.bind.apply(t, w);
41
41
  return new l();
42
42
  }
43
43
  return t.apply(this, arguments);
@@ -47,12 +47,12 @@ function ie(e) {
47
47
  return (
48
48
  Object.defineProperty(o, "__esModule", { value: !0 }),
49
49
  Object.keys(e).forEach(function (a) {
50
- var _ = Object.getOwnPropertyDescriptor(e, a);
50
+ var w = Object.getOwnPropertyDescriptor(e, a);
51
51
  Object.defineProperty(
52
52
  o,
53
53
  a,
54
- _.get
55
- ? _
54
+ w.get
55
+ ? w
56
56
  : {
57
57
  enumerable: !0,
58
58
  get: function () {
@@ -80,13 +80,13 @@ function ae(e) {
80
80
  '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'
81
81
  );
82
82
  }
83
- var j = {},
83
+ var q = {},
84
84
  ce = {
85
85
  get exports() {
86
- return j;
86
+ return q;
87
87
  },
88
88
  set exports(e) {
89
- j = e;
89
+ q = e;
90
90
  },
91
91
  };
92
92
  const ue = {},
@@ -109,10 +109,10 @@ function J() {
109
109
  (function (e, t) {
110
110
  (function (o, a) {
111
111
  e.exports = a();
112
- })(z, function () {
112
+ })(O, function () {
113
113
  var o =
114
114
  o ||
115
- (function (a, _) {
115
+ (function (a, w) {
116
116
  var l;
117
117
  if (
118
118
  (typeof window < "u" && window.crypto && (l = window.crypto),
@@ -124,13 +124,13 @@ function J() {
124
124
  typeof window < "u" &&
125
125
  window.msCrypto &&
126
126
  (l = window.msCrypto),
127
- !l && typeof z < "u" && z.crypto && (l = z.crypto),
127
+ !l && typeof O < "u" && O.crypto && (l = O.crypto),
128
128
  !l && typeof ae == "function")
129
129
  )
130
130
  try {
131
131
  l = he;
132
132
  } catch {}
133
- var R = function () {
133
+ var S = function () {
134
134
  if (l) {
135
135
  if (typeof l.getRandomValues == "function")
136
136
  try {
@@ -159,8 +159,8 @@ function J() {
159
159
  );
160
160
  };
161
161
  })(),
162
- w = {},
163
- C = (w.lib = {}),
162
+ _ = {},
163
+ C = (_.lib = {}),
164
164
  y = (C.Base = (function () {
165
165
  return {
166
166
  extend: function (r) {
@@ -191,10 +191,10 @@ function J() {
191
191
  },
192
192
  };
193
193
  })()),
194
- p = (C.WordArray = y.extend({
194
+ d = (C.WordArray = y.extend({
195
195
  init: function (r, n) {
196
196
  (r = this.words = r || []),
197
- n != _
197
+ n != w
198
198
  ? (this.sigBytes = n)
199
199
  : (this.sigBytes = r.length * 4);
200
200
  },
@@ -205,16 +205,16 @@ function J() {
205
205
  var n = this.words,
206
206
  s = r.words,
207
207
  c = this.sigBytes,
208
- d = r.sigBytes;
208
+ p = r.sigBytes;
209
209
  if ((this.clamp(), c % 4))
210
- for (var g = 0; g < d; g++) {
210
+ for (var g = 0; g < p; g++) {
211
211
  var m = (s[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
212
212
  n[(c + g) >>> 2] |= m << (24 - ((c + g) % 4) * 8);
213
213
  }
214
214
  else
215
- for (var b = 0; b < d; b += 4)
215
+ for (var b = 0; b < p; b += 4)
216
216
  n[(c + b) >>> 2] = s[b >>> 2];
217
- return (this.sigBytes += d), this;
217
+ return (this.sigBytes += p), this;
218
218
  },
219
219
  clamp: function () {
220
220
  var r = this.words,
@@ -227,19 +227,19 @@ function J() {
227
227
  return (r.words = this.words.slice(0)), r;
228
228
  },
229
229
  random: function (r) {
230
- for (var n = [], s = 0; s < r; s += 4) n.push(R());
231
- return new p.init(n, r);
230
+ for (var n = [], s = 0; s < r; s += 4) n.push(S());
231
+ return new d.init(n, r);
232
232
  },
233
233
  })),
234
- v = (w.enc = {}),
234
+ v = (_.enc = {}),
235
235
  u = (v.Hex = {
236
236
  stringify: function (r) {
237
237
  for (
238
- var n = r.words, s = r.sigBytes, c = [], d = 0;
239
- d < s;
240
- d++
238
+ var n = r.words, s = r.sigBytes, c = [], p = 0;
239
+ p < s;
240
+ p++
241
241
  ) {
242
- var g = (n[d >>> 2] >>> (24 - (d % 4) * 8)) & 255;
242
+ var g = (n[p >>> 2] >>> (24 - (p % 4) * 8)) & 255;
243
243
  c.push((g >>> 4).toString(16)),
244
244
  c.push((g & 15).toString(16));
245
245
  }
@@ -249,17 +249,17 @@ function J() {
249
249
  for (var n = r.length, s = [], c = 0; c < n; c += 2)
250
250
  s[c >>> 3] |=
251
251
  parseInt(r.substr(c, 2), 16) << (24 - (c % 8) * 4);
252
- return new p.init(s, n / 2);
252
+ return new d.init(s, n / 2);
253
253
  },
254
254
  }),
255
255
  h = (v.Latin1 = {
256
256
  stringify: function (r) {
257
257
  for (
258
- var n = r.words, s = r.sigBytes, c = [], d = 0;
259
- d < s;
260
- d++
258
+ var n = r.words, s = r.sigBytes, c = [], p = 0;
259
+ p < s;
260
+ p++
261
261
  ) {
262
- var g = (n[d >>> 2] >>> (24 - (d % 4) * 8)) & 255;
262
+ var g = (n[p >>> 2] >>> (24 - (p % 4) * 8)) & 255;
263
263
  c.push(String.fromCharCode(g));
264
264
  }
265
265
  return c.join("");
@@ -268,7 +268,7 @@ function J() {
268
268
  for (var n = r.length, s = [], c = 0; c < n; c++)
269
269
  s[c >>> 2] |=
270
270
  (r.charCodeAt(c) & 255) << (24 - (c % 4) * 8);
271
- return new p.init(s, n);
271
+ return new d.init(s, n);
272
272
  },
273
273
  }),
274
274
  i = (v.Utf8 = {
@@ -285,7 +285,7 @@ function J() {
285
285
  }),
286
286
  f = (C.BufferedBlockAlgorithm = y.extend({
287
287
  reset: function () {
288
- (this._data = new p.init()), (this._nDataBytes = 0);
288
+ (this._data = new d.init()), (this._nDataBytes = 0);
289
289
  },
290
290
  _append: function (r) {
291
291
  typeof r == "string" && (r = i.parse(r)),
@@ -296,20 +296,20 @@ function J() {
296
296
  var n,
297
297
  s = this._data,
298
298
  c = s.words,
299
- d = s.sigBytes,
299
+ p = s.sigBytes,
300
300
  g = this.blockSize,
301
301
  m = g * 4,
302
- b = d / m;
302
+ b = p / m;
303
303
  r
304
304
  ? (b = a.ceil(b))
305
305
  : (b = a.max((b | 0) - this._minBufferSize, 0));
306
- var $ = b * g,
307
- H = a.min($ * 4, d);
308
- if ($) {
309
- for (var W = 0; W < $; W += g) this._doProcessBlock(c, W);
310
- (n = c.splice(0, $)), (s.sigBytes -= H);
306
+ var z = b * g,
307
+ H = a.min(z * 4, p);
308
+ if (z) {
309
+ for (var L = 0; L < z; L += g) this._doProcessBlock(c, L);
310
+ (n = c.splice(0, z)), (s.sigBytes -= H);
311
311
  }
312
- return new p.init(n, H);
312
+ return new d.init(n, H);
313
313
  },
314
314
  clone: function () {
315
315
  var r = y.clone.call(this);
@@ -345,39 +345,39 @@ function J() {
345
345
  };
346
346
  },
347
347
  });
348
- var x = (w.algo = {});
349
- return w;
348
+ var x = (_.algo = {});
349
+ return _;
350
350
  })(Math);
351
351
  return o;
352
352
  });
353
353
  })(ce)),
354
- j
354
+ q
355
355
  );
356
356
  }
357
357
  (function (e, t) {
358
358
  (function (o, a) {
359
359
  e.exports = a(J());
360
- })(z, function (o) {
360
+ })(O, function (o) {
361
361
  return (
362
362
  (function () {
363
363
  var a = o,
364
- _ = a.lib,
365
- l = _.WordArray,
366
- R = a.enc;
367
- R.Base64url = {
368
- stringify: function (w, C = !0) {
369
- var y = w.words,
370
- p = w.sigBytes,
364
+ w = a.lib,
365
+ l = w.WordArray,
366
+ S = a.enc;
367
+ S.Base64url = {
368
+ stringify: function (_, C = !0) {
369
+ var y = _.words,
370
+ d = _.sigBytes,
371
371
  v = C ? this._safe_map : this._map;
372
- w.clamp();
373
- for (var u = [], h = 0; h < p; h += 3)
372
+ _.clamp();
373
+ for (var u = [], h = 0; h < d; h += 3)
374
374
  for (
375
375
  var i = (y[h >>> 2] >>> (24 - (h % 4) * 8)) & 255,
376
376
  f = (y[(h + 1) >>> 2] >>> (24 - ((h + 1) % 4) * 8)) & 255,
377
377
  x = (y[(h + 2) >>> 2] >>> (24 - ((h + 2) % 4) * 8)) & 255,
378
378
  r = (i << 16) | (f << 8) | x,
379
379
  n = 0;
380
- n < 4 && h + n * 0.75 < p;
380
+ n < 4 && h + n * 0.75 < d;
381
381
  n++
382
382
  )
383
383
  u.push(v.charAt((r >>> (6 * (3 - n))) & 63));
@@ -385,34 +385,34 @@ function J() {
385
385
  if (s) for (; u.length % 4; ) u.push(s);
386
386
  return u.join("");
387
387
  },
388
- parse: function (w, C = !0) {
389
- var y = w.length,
390
- p = C ? this._safe_map : this._map,
388
+ parse: function (_, C = !0) {
389
+ var y = _.length,
390
+ d = C ? this._safe_map : this._map,
391
391
  v = this._reverseMap;
392
392
  if (!v) {
393
393
  v = this._reverseMap = [];
394
- for (var u = 0; u < p.length; u++) v[p.charCodeAt(u)] = u;
394
+ for (var u = 0; u < d.length; u++) v[d.charCodeAt(u)] = u;
395
395
  }
396
- var h = p.charAt(64);
396
+ var h = d.charAt(64);
397
397
  if (h) {
398
- var i = w.indexOf(h);
398
+ var i = _.indexOf(h);
399
399
  i !== -1 && (y = i);
400
400
  }
401
- return k(w, y, v);
401
+ return k(_, y, v);
402
402
  },
403
403
  _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
404
404
  _safe_map:
405
405
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
406
406
  };
407
- function k(w, C, y) {
408
- for (var p = [], v = 0, u = 0; u < C; u++)
407
+ function k(_, C, y) {
408
+ for (var d = [], v = 0, u = 0; u < C; u++)
409
409
  if (u % 4) {
410
- var h = y[w.charCodeAt(u - 1)] << ((u % 4) * 2),
411
- i = y[w.charCodeAt(u)] >>> (6 - (u % 4) * 2),
410
+ var h = y[_.charCodeAt(u - 1)] << ((u % 4) * 2),
411
+ i = y[_.charCodeAt(u)] >>> (6 - (u % 4) * 2),
412
412
  f = h | i;
413
- (p[v >>> 2] |= f << (24 - (v % 4) * 8)), v++;
413
+ (d[v >>> 2] |= f << (24 - (v % 4) * 8)), v++;
414
414
  }
415
- return l.create(p, v);
415
+ return l.create(d, v);
416
416
  }
417
417
  })(),
418
418
  o.enc.Base64url
@@ -431,14 +431,14 @@ var V = {},
431
431
  (function (e, t) {
432
432
  (function (o, a) {
433
433
  e.exports = a(J());
434
- })(z, function (o) {
434
+ })(O, function (o) {
435
435
  return (
436
436
  (function (a) {
437
- var _ = o,
438
- l = _.lib,
439
- R = l.WordArray,
437
+ var w = o,
438
+ l = w.lib,
439
+ S = l.WordArray,
440
440
  k = l.Hasher,
441
- w = _.algo,
441
+ _ = w.algo,
442
442
  C = [],
443
443
  y = [];
444
444
  (function () {
@@ -456,10 +456,10 @@ var V = {},
456
456
  f++),
457
457
  i++;
458
458
  })();
459
- var p = [],
460
- v = (w.SHA256 = k.extend({
459
+ var d = [],
460
+ v = (_.SHA256 = k.extend({
461
461
  _doReset: function () {
462
- this._hash = new R.init(C.slice(0));
462
+ this._hash = new S.init(C.slice(0));
463
463
  },
464
464
  _doProcessBlock: function (u, h) {
465
465
  for (
@@ -470,27 +470,27 @@ var V = {},
470
470
  n = i[3],
471
471
  s = i[4],
472
472
  c = i[5],
473
- d = i[6],
473
+ p = i[6],
474
474
  g = i[7],
475
475
  m = 0;
476
476
  m < 64;
477
477
  m++
478
478
  ) {
479
- if (m < 16) p[m] = u[h + m] | 0;
479
+ if (m < 16) d[m] = u[h + m] | 0;
480
480
  else {
481
- var b = p[m - 15],
482
- $ =
481
+ var b = d[m - 15],
482
+ z =
483
483
  ((b << 25) | (b >>> 7)) ^
484
484
  ((b << 14) | (b >>> 18)) ^
485
485
  (b >>> 3),
486
- H = p[m - 2],
487
- W =
486
+ H = d[m - 2],
487
+ L =
488
488
  ((H << 15) | (H >>> 17)) ^
489
489
  ((H << 13) | (H >>> 19)) ^
490
490
  (H >>> 10);
491
- p[m] = $ + p[m - 7] + W + p[m - 16];
491
+ d[m] = z + d[m - 7] + L + d[m - 16];
492
492
  }
493
- var K = (s & c) ^ (~s & d),
493
+ var K = (s & c) ^ (~s & p),
494
494
  Y = (f & x) ^ (f & r) ^ (x & r),
495
495
  ee =
496
496
  ((f << 30) | (f >>> 2)) ^
@@ -500,10 +500,10 @@ var V = {},
500
500
  ((s << 26) | (s >>> 6)) ^
501
501
  ((s << 21) | (s >>> 11)) ^
502
502
  ((s << 7) | (s >>> 25)),
503
- N = g + re + K + y[m] + p[m],
503
+ N = g + re + K + y[m] + d[m],
504
504
  te = ee + Y;
505
- (g = d),
506
- (d = c),
505
+ (g = p),
506
+ (p = c),
507
507
  (c = s),
508
508
  (s = (n + N) | 0),
509
509
  (n = r),
@@ -517,7 +517,7 @@ var V = {},
517
517
  (i[3] = (i[3] + n) | 0),
518
518
  (i[4] = (i[4] + s) | 0),
519
519
  (i[5] = (i[5] + c) | 0),
520
- (i[6] = (i[6] + d) | 0),
520
+ (i[6] = (i[6] + p) | 0),
521
521
  (i[7] = (i[7] + g) | 0);
522
522
  },
523
523
  _doFinalize: function () {
@@ -539,61 +539,67 @@ var V = {},
539
539
  return (u._hash = this._hash.clone()), u;
540
540
  },
541
541
  }));
542
- (_.SHA256 = k._createHelper(v)),
543
- (_.HmacSHA256 = k._createHmacHelper(v));
542
+ (w.SHA256 = k._createHelper(v)),
543
+ (w.HmacSHA256 = k._createHmacHelper(v));
544
544
  })(Math),
545
545
  o.SHA256
546
546
  );
547
547
  });
548
548
  })(le);
549
- const pe = {
550
- environments: {
551
- production: {
552
- api: "https://api.monerium.app",
553
- web: "https://monerium.app",
554
- },
555
- sandbox: {
556
- api: "https://api.monerium.dev",
557
- web: "https://sandbox.monerium.dev",
558
- },
549
+ const de = () => {
550
+ let e = "";
551
+ const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
552
+ o = t.length;
553
+ let a = 0;
554
+ for (; a < 128; ) (e += t.charAt(Math.floor(Math.random() * o))), (a += 1);
555
+ return e;
559
556
  },
560
- };
561
- var O, E, A, S, q, Q, T, X, F, Z;
562
- class Ce {
557
+ pe = {
558
+ environments: {
559
+ production: {
560
+ api: "https://api.monerium.app",
561
+ web: "https://monerium.app",
562
+ },
563
+ sandbox: {
564
+ api: "https://api.monerium.dev",
565
+ web: "https://sandbox.monerium.dev",
566
+ },
567
+ },
568
+ };
569
+ var $, W, A, R, T, Q, j, X, F, Z;
570
+ class Re {
563
571
  constructor(t = "sandbox") {
564
572
  P(this, A);
565
- P(this, q);
566
573
  P(this, T);
574
+ P(this, j);
567
575
  P(this, F);
568
- P(this, O, void 0);
569
- P(this, E, void 0);
570
- L(this, "codeVerifier");
571
- L(this, "bearerProfile");
572
- L(this, "pkceRequest", (t) => this.getAuthFlowURI(t));
573
- M(this, O, pe.environments[t]);
576
+ P(this, $, void 0);
577
+ P(this, W, void 0);
578
+ E(this, "codeVerifier");
579
+ E(this, "bearerProfile");
580
+ E(this, "pkceRequest", (t) => this.getAuthFlowURI(t));
581
+ M(this, $, pe.environments[t]);
574
582
  }
575
583
  async auth(t) {
576
584
  let o;
577
- if (B(this, q, Q).call(this, t))
585
+ if (B(this, T, Q).call(this, t))
578
586
  o = { ...t, grant_type: "authorization_code" };
579
- else if (B(this, T, X).call(this, t))
587
+ else if (B(this, j, X).call(this, t))
580
588
  o = { ...t, grant_type: "refresh_token" };
581
589
  else if (B(this, F, Z).call(this, t))
582
590
  o = { ...t, grant_type: "client_credentials" };
583
591
  else throw new Error("Authentication method could not be detected.");
584
- (this.bearerProfile = await B(this, A, S).call(
592
+ (this.bearerProfile = await B(this, A, R).call(
585
593
  this,
586
594
  "post",
587
595
  "auth/token",
588
596
  new URLSearchParams(o),
589
597
  !0
590
598
  )),
591
- M(this, E, `Bearer ${this.bearerProfile.access_token}`);
599
+ M(this, W, `Bearer ${this.bearerProfile.access_token}`);
592
600
  }
593
601
  getAuthFlowURI(t) {
594
- this.codeVerifier = new Array(128).join().replace(/(.|$)/g, function () {
595
- return ((Math.random() * 36) | 0).toString(36);
596
- });
602
+ this.codeVerifier = de();
597
603
  const o = D.stringify(V(this.codeVerifier)),
598
604
  a = {
599
605
  ...t,
@@ -602,31 +608,31 @@ class Ce {
602
608
  code_challenge_method: "S256",
603
609
  response_type: "code",
604
610
  };
605
- return `${U(this, O).api}/auth?${new URLSearchParams(a)}`;
611
+ return `${U(this, $).api}/auth?${new URLSearchParams(a)}`;
606
612
  }
607
613
  getAuthContext() {
608
- return B(this, A, S).call(this, "get", "auth/context");
614
+ return B(this, A, R).call(this, "get", "auth/context");
609
615
  }
610
616
  getProfile(t) {
611
- return B(this, A, S).call(this, "get", `profiles/${t}`);
617
+ return B(this, A, R).call(this, "get", `profiles/${t}`);
612
618
  }
613
619
  getBalances(t) {
614
620
  return t
615
- ? B(this, A, S).call(this, "get", `profiles/${t}/balances`)
616
- : B(this, A, S).call(this, "get", "balances");
621
+ ? B(this, A, R).call(this, "get", `profiles/${t}/balances`)
622
+ : B(this, A, R).call(this, "get", "balances");
617
623
  }
618
624
  getOrders(t) {
619
625
  const o = new URLSearchParams(t);
620
- return B(this, A, S).call(this, "get", `orders?${o}`);
626
+ return B(this, A, R).call(this, "get", `orders?${o}`);
621
627
  }
622
628
  getOrder(t) {
623
- return B(this, A, S).call(this, "get", `orders/${t}`);
629
+ return B(this, A, R).call(this, "get", `orders/${t}`);
624
630
  }
625
631
  getTokens() {
626
- return B(this, A, S).call(this, "get", "tokens");
632
+ return B(this, A, R).call(this, "get", "tokens");
627
633
  }
628
634
  linkAddress(t, o) {
629
- return B(this, A, S).call(
635
+ return B(this, A, R).call(
630
636
  this,
631
637
  "post",
632
638
  `profiles/${t}/addresses`,
@@ -635,40 +641,45 @@ class Ce {
635
641
  }
636
642
  placeOrder(t, o) {
637
643
  return o
638
- ? B(this, A, S).call(
644
+ ? B(this, A, R).call(
639
645
  this,
640
646
  "post",
641
647
  `profiles/${o}/orders`,
642
648
  JSON.stringify(t)
643
649
  )
644
- : B(this, A, S).call(this, "post", "orders", JSON.stringify(t));
650
+ : B(this, A, R).call(this, "post", "orders", JSON.stringify(t));
645
651
  }
646
652
  uploadSupportingDocument(t) {
647
653
  const o = new URLSearchParams(t);
648
- return B(this, A, S).call(this, "post", "files/supporting-document", o, !0);
654
+ return B(this, A, R).call(this, "post", "files/supporting-document", o, !0);
649
655
  }
650
656
  }
651
- (O = new WeakMap()),
652
- (E = new WeakMap()),
657
+ ($ = new WeakMap()),
658
+ (W = new WeakMap()),
653
659
  (A = new WeakSet()),
654
- (S = async function (t, o, a, _) {
655
- const l = await fetch(`${U(this, O).api}/${o}`, {
656
- method: t,
657
- headers: {
658
- "Content-Type": `application/${_ ? "x-www-form-urlencoded" : "json"}`,
659
- Authorization: U(this, E) || "",
660
- },
661
- body: a,
662
- }),
663
- R = await l.json();
664
- if (l.ok) return R;
665
- throw R;
660
+ (R = async function (t, o, a, w) {
661
+ const l = await fetch(`${U(this, $).api}/${o}`, {
662
+ method: t,
663
+ headers: {
664
+ "Content-Type": `application/${w ? "x-www-form-urlencoded" : "json"}`,
665
+ Authorization: U(this, W) || "",
666
+ },
667
+ body: a,
668
+ });
669
+ let S;
670
+ try {
671
+ S = await l.json();
672
+ } catch {
673
+ throw await l.text();
674
+ }
675
+ if (l.ok) return S;
676
+ throw S;
666
677
  }),
667
- (q = new WeakSet()),
678
+ (T = new WeakSet()),
668
679
  (Q = function (t) {
669
680
  return t.code != null;
670
681
  }),
671
- (T = new WeakSet()),
682
+ (j = new WeakSet()),
672
683
  (X = function (t) {
673
684
  return t.refresh_token != null;
674
685
  }),
@@ -676,62 +687,62 @@ class Ce {
676
687
  (Z = function (t) {
677
688
  return t.client_secret != null;
678
689
  });
679
- var de = /* @__PURE__ */ ((e) => (
690
+ var ve = /* @__PURE__ */ ((e) => (
680
691
  (e.eur = "eur"), (e.usd = "usd"), (e.gbp = "gbp"), (e.isk = "isk"), e
681
- ))(de || {}),
682
- ve = /* @__PURE__ */ ((e) => (
683
- (e.corporate = "corporate"), (e.personal = "personal"), e
684
692
  ))(ve || {}),
685
- ge = /* @__PURE__ */ ((e) => ((e.read = "read"), (e.write = "write"), e))(
686
- ge || {}
693
+ ge = /* @__PURE__ */ ((e) => (
694
+ (e.corporate = "corporate"), (e.personal = "personal"), e
695
+ ))(ge || {}),
696
+ ye = /* @__PURE__ */ ((e) => ((e.read = "read"), (e.write = "write"), e))(
697
+ ye || {}
687
698
  ),
688
- ye = /* @__PURE__ */ ((e) => (
699
+ we = /* @__PURE__ */ ((e) => (
689
700
  (e.absent = "absent"),
690
701
  (e.submitted = "submitted"),
691
702
  (e.pending = "pending"),
692
703
  (e.confirmed = "confirmed"),
693
704
  e
694
- ))(ye || {}),
705
+ ))(we || {}),
695
706
  _e = /* @__PURE__ */ ((e) => (
696
707
  (e.approved = "approved"),
697
708
  (e.rejected = "rejected"),
698
709
  (e.unknown = "unknown"),
699
710
  e
700
711
  ))(_e || {}),
701
- we = /* @__PURE__ */ ((e) => ((e.iban = "iban"), (e.scan = "scan"), e))(
702
- we || {}
712
+ me = /* @__PURE__ */ ((e) => ((e.iban = "iban"), (e.scan = "scan"), e))(
713
+ me || {}
703
714
  ),
704
- me = /* @__PURE__ */ ((e) => (
705
- (e.polygon = "polygon"), (e.ethereum = "ethereum"), (e.gnosis = "gnosis"), e
706
- ))(me || {}),
707
715
  be = /* @__PURE__ */ ((e) => (
716
+ (e.polygon = "polygon"), (e.ethereum = "ethereum"), (e.gnosis = "gnosis"), e
717
+ ))(be || {}),
718
+ Be = /* @__PURE__ */ ((e) => (
708
719
  (e.mainnet = "mainnet"),
709
720
  (e.chiado = "chiado"),
710
721
  (e.goerli = "goerli"),
711
722
  (e.mumbai = "mumbai"),
712
723
  e
713
- ))(be || {}),
714
- Be = /* @__PURE__ */ ((e) => ((e.redeem = "redeem"), (e.issue = "issue"), e))(
715
- Be || {}
724
+ ))(Be || {}),
725
+ xe = /* @__PURE__ */ ((e) => ((e.redeem = "redeem"), (e.issue = "issue"), e))(
726
+ xe || {}
716
727
  ),
717
- xe = /* @__PURE__ */ ((e) => (
728
+ Ae = /* @__PURE__ */ ((e) => (
718
729
  (e.placed = "placed"),
719
730
  (e.pending = "pending"),
720
731
  (e.processed = "processed"),
721
732
  (e.rejected = "rejected"),
722
733
  e
723
- ))(xe || {});
734
+ ))(Ae || {});
724
735
  export {
725
- me as Chain,
726
- de as Currency,
736
+ be as Chain,
737
+ ve as Currency,
727
738
  _e as KYCOutcome,
728
- ye as KYCState,
729
- Ce as MoneriumClient,
730
- be as Network,
731
- Be as OrderKind,
732
- xe as OrderState,
733
- we as PaymentStandard,
734
- ge as Permission,
735
- ve as ProfileType,
739
+ we as KYCState,
740
+ Re as MoneriumClient,
741
+ Be as Network,
742
+ xe as OrderKind,
743
+ Ae as OrderState,
744
+ me as PaymentStandard,
745
+ ye as Permission,
746
+ ge as ProfileType,
736
747
  };
737
- //# sourceMappingURL=index.es.js.map
748
+ //# sourceMappingURL=index.mjs.map