@monerium/sdk 2.0.2 → 2.0.3

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.
@@ -0,0 +1,780 @@
1
+ var ie = Object.defineProperty;
2
+ var oe = (e, t, i) =>
3
+ t in e
4
+ ? ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i })
5
+ : (e[t] = i);
6
+ var j = (e, t, i) => (oe(e, typeof t != "symbol" ? t + "" : t, i), i),
7
+ F = (e, t, i) => {
8
+ if (!t.has(e)) throw TypeError("Cannot " + i);
9
+ };
10
+ var E = (e, t, i) => (
11
+ F(e, t, "read from private field"), i ? i.call(e) : t.get(e)
12
+ ),
13
+ P = (e, t, i) => {
14
+ if (t.has(e))
15
+ throw TypeError("Cannot add the same private member more than once");
16
+ t instanceof WeakSet ? t.add(e) : t.set(e, i);
17
+ },
18
+ D = (e, t, i, c) => (
19
+ F(e, t, "write to private field"), c ? c.call(e, i) : t.set(e, i), i
20
+ );
21
+ var x = (e, t, i) => (F(e, t, "access private method"), i);
22
+ var U =
23
+ typeof globalThis < "u"
24
+ ? globalThis
25
+ : typeof window < "u"
26
+ ? window
27
+ : typeof global < "u"
28
+ ? global
29
+ : typeof self < "u"
30
+ ? self
31
+ : {};
32
+ function se(e) {
33
+ if (e.__esModule) return e;
34
+ var t = e.default;
35
+ if (typeof t == "function") {
36
+ var i = function c() {
37
+ if (this instanceof c) {
38
+ var y = [null];
39
+ y.push.apply(y, arguments);
40
+ var p = Function.bind.apply(t, y);
41
+ return new p();
42
+ }
43
+ return t.apply(this, arguments);
44
+ };
45
+ i.prototype = t.prototype;
46
+ } else i = {};
47
+ return (
48
+ Object.defineProperty(i, "__esModule", { value: !0 }),
49
+ Object.keys(e).forEach(function (c) {
50
+ var y = Object.getOwnPropertyDescriptor(e, c);
51
+ Object.defineProperty(
52
+ i,
53
+ c,
54
+ y.get
55
+ ? y
56
+ : {
57
+ enumerable: !0,
58
+ get: function () {
59
+ return e[c];
60
+ },
61
+ }
62
+ );
63
+ }),
64
+ i
65
+ );
66
+ }
67
+ var M = {},
68
+ ae = {
69
+ get exports() {
70
+ return M;
71
+ },
72
+ set exports(e) {
73
+ M = e;
74
+ },
75
+ };
76
+ function ce(e) {
77
+ throw new Error(
78
+ 'Could not dynamically require "' +
79
+ e +
80
+ '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'
81
+ );
82
+ }
83
+ var L = {},
84
+ ue = {
85
+ get exports() {
86
+ return L;
87
+ },
88
+ set exports(e) {
89
+ L = e;
90
+ },
91
+ };
92
+ const fe = {},
93
+ le = /* @__PURE__ */ Object.freeze(
94
+ /* @__PURE__ */ Object.defineProperty(
95
+ {
96
+ __proto__: null,
97
+ default: fe,
98
+ },
99
+ Symbol.toStringTag,
100
+ { value: "Module" }
101
+ )
102
+ ),
103
+ he = /* @__PURE__ */ se(le);
104
+ var Q;
105
+ function G() {
106
+ return (
107
+ Q ||
108
+ ((Q = 1),
109
+ (function (e, t) {
110
+ (function (i, c) {
111
+ e.exports = c();
112
+ })(U, function () {
113
+ var i =
114
+ i ||
115
+ (function (c, y) {
116
+ var p;
117
+ if (
118
+ (typeof window < "u" && window.crypto && (p = window.crypto),
119
+ typeof self < "u" && self.crypto && (p = self.crypto),
120
+ typeof globalThis < "u" &&
121
+ globalThis.crypto &&
122
+ (p = globalThis.crypto),
123
+ !p &&
124
+ typeof window < "u" &&
125
+ window.msCrypto &&
126
+ (p = window.msCrypto),
127
+ !p && typeof U < "u" && U.crypto && (p = U.crypto),
128
+ !p && typeof ce == "function")
129
+ )
130
+ try {
131
+ p = he;
132
+ } catch {}
133
+ var R = function () {
134
+ if (p) {
135
+ if (typeof p.getRandomValues == "function")
136
+ try {
137
+ return p.getRandomValues(new Uint32Array(1))[0];
138
+ } catch {}
139
+ if (typeof p.randomBytes == "function")
140
+ try {
141
+ return p.randomBytes(4).readInt32LE();
142
+ } catch {}
143
+ }
144
+ throw new Error(
145
+ "Native crypto module could not be used to get secure random number."
146
+ );
147
+ },
148
+ k =
149
+ Object.create ||
150
+ (function () {
151
+ function r() {}
152
+ return function (n) {
153
+ var s;
154
+ return (
155
+ (r.prototype = n),
156
+ (s = new r()),
157
+ (r.prototype = null),
158
+ s
159
+ );
160
+ };
161
+ })(),
162
+ a = {},
163
+ w = (a.lib = {}),
164
+ d = (w.Base = (function () {
165
+ return {
166
+ extend: function (r) {
167
+ var n = k(this);
168
+ return (
169
+ r && n.mixIn(r),
170
+ (!n.hasOwnProperty("init") || this.init === n.init) &&
171
+ (n.init = function () {
172
+ n.$super.init.apply(this, arguments);
173
+ }),
174
+ (n.init.prototype = n),
175
+ (n.$super = this),
176
+ n
177
+ );
178
+ },
179
+ create: function () {
180
+ var r = this.extend();
181
+ return r.init.apply(r, arguments), r;
182
+ },
183
+ init: function () {},
184
+ mixIn: function (r) {
185
+ for (var n in r) r.hasOwnProperty(n) && (this[n] = r[n]);
186
+ r.hasOwnProperty("toString") &&
187
+ (this.toString = r.toString);
188
+ },
189
+ clone: function () {
190
+ return this.init.prototype.extend(this);
191
+ },
192
+ };
193
+ })()),
194
+ l = (w.WordArray = d.extend({
195
+ init: function (r, n) {
196
+ (r = this.words = r || []),
197
+ n != y
198
+ ? (this.sigBytes = n)
199
+ : (this.sigBytes = r.length * 4);
200
+ },
201
+ toString: function (r) {
202
+ return (r || f).stringify(this);
203
+ },
204
+ concat: function (r) {
205
+ var n = this.words,
206
+ s = r.words,
207
+ u = this.sigBytes,
208
+ g = r.sigBytes;
209
+ if ((this.clamp(), u % 4))
210
+ for (var m = 0; m < g; m++) {
211
+ var b = (s[m >>> 2] >>> (24 - (m % 4) * 8)) & 255;
212
+ n[(u + m) >>> 2] |= b << (24 - ((u + m) % 4) * 8);
213
+ }
214
+ else
215
+ for (var B = 0; B < g; B += 4)
216
+ n[(u + B) >>> 2] = s[B >>> 2];
217
+ return (this.sigBytes += g), this;
218
+ },
219
+ clamp: function () {
220
+ var r = this.words,
221
+ n = this.sigBytes;
222
+ (r[n >>> 2] &= 4294967295 << (32 - (n % 4) * 8)),
223
+ (r.length = c.ceil(n / 4));
224
+ },
225
+ clone: function () {
226
+ var r = d.clone.call(this);
227
+ return (r.words = this.words.slice(0)), r;
228
+ },
229
+ random: function (r) {
230
+ for (var n = [], s = 0; s < r; s += 4) n.push(R());
231
+ return new l.init(n, r);
232
+ },
233
+ })),
234
+ _ = (a.enc = {}),
235
+ f = (_.Hex = {
236
+ stringify: function (r) {
237
+ for (
238
+ var n = r.words, s = r.sigBytes, u = [], g = 0;
239
+ g < s;
240
+ g++
241
+ ) {
242
+ var m = (n[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
243
+ u.push((m >>> 4).toString(16)),
244
+ u.push((m & 15).toString(16));
245
+ }
246
+ return u.join("");
247
+ },
248
+ parse: function (r) {
249
+ for (var n = r.length, s = [], u = 0; u < n; u += 2)
250
+ s[u >>> 3] |=
251
+ parseInt(r.substr(u, 2), 16) << (24 - (u % 8) * 4);
252
+ return new l.init(s, n / 2);
253
+ },
254
+ }),
255
+ v = (_.Latin1 = {
256
+ stringify: function (r) {
257
+ for (
258
+ var n = r.words, s = r.sigBytes, u = [], g = 0;
259
+ g < s;
260
+ g++
261
+ ) {
262
+ var m = (n[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
263
+ u.push(String.fromCharCode(m));
264
+ }
265
+ return u.join("");
266
+ },
267
+ parse: function (r) {
268
+ for (var n = r.length, s = [], u = 0; u < n; u++)
269
+ s[u >>> 2] |=
270
+ (r.charCodeAt(u) & 255) << (24 - (u % 4) * 8);
271
+ return new l.init(s, n);
272
+ },
273
+ }),
274
+ o = (_.Utf8 = {
275
+ stringify: function (r) {
276
+ try {
277
+ return decodeURIComponent(escape(v.stringify(r)));
278
+ } catch {
279
+ throw new Error("Malformed UTF-8 data");
280
+ }
281
+ },
282
+ parse: function (r) {
283
+ return v.parse(unescape(encodeURIComponent(r)));
284
+ },
285
+ }),
286
+ h = (w.BufferedBlockAlgorithm = d.extend({
287
+ reset: function () {
288
+ (this._data = new l.init()), (this._nDataBytes = 0);
289
+ },
290
+ _append: function (r) {
291
+ typeof r == "string" && (r = o.parse(r)),
292
+ this._data.concat(r),
293
+ (this._nDataBytes += r.sigBytes);
294
+ },
295
+ _process: function (r) {
296
+ var n,
297
+ s = this._data,
298
+ u = s.words,
299
+ g = s.sigBytes,
300
+ m = this.blockSize,
301
+ b = m * 4,
302
+ B = g / b;
303
+ r
304
+ ? (B = c.ceil(B))
305
+ : (B = c.max((B | 0) - this._minBufferSize, 0));
306
+ var W = B * m,
307
+ H = c.min(W * 4, g);
308
+ if (W) {
309
+ for (var $ = 0; $ < W; $ += m) this._doProcessBlock(u, $);
310
+ (n = u.splice(0, W)), (s.sigBytes -= H);
311
+ }
312
+ return new l.init(n, H);
313
+ },
314
+ clone: function () {
315
+ var r = d.clone.call(this);
316
+ return (r._data = this._data.clone()), r;
317
+ },
318
+ _minBufferSize: 0,
319
+ }));
320
+ w.Hasher = h.extend({
321
+ cfg: d.extend(),
322
+ init: function (r) {
323
+ (this.cfg = this.cfg.extend(r)), this.reset();
324
+ },
325
+ reset: function () {
326
+ h.reset.call(this), this._doReset();
327
+ },
328
+ update: function (r) {
329
+ return this._append(r), this._process(), this;
330
+ },
331
+ finalize: function (r) {
332
+ r && this._append(r);
333
+ var n = this._doFinalize();
334
+ return n;
335
+ },
336
+ blockSize: 16,
337
+ _createHelper: function (r) {
338
+ return function (n, s) {
339
+ return new r.init(s).finalize(n);
340
+ };
341
+ },
342
+ _createHmacHelper: function (r) {
343
+ return function (n, s) {
344
+ return new C.HMAC.init(r, s).finalize(n);
345
+ };
346
+ },
347
+ });
348
+ var C = (a.algo = {});
349
+ return a;
350
+ })(Math);
351
+ return i;
352
+ });
353
+ })(ue)),
354
+ L
355
+ );
356
+ }
357
+ (function (e, t) {
358
+ (function (i, c) {
359
+ e.exports = c(G());
360
+ })(U, function (i) {
361
+ return (
362
+ (function () {
363
+ var c = i,
364
+ y = c.lib,
365
+ p = y.WordArray,
366
+ R = c.enc;
367
+ R.Base64url = {
368
+ stringify: function (a, w = !0) {
369
+ var d = a.words,
370
+ l = a.sigBytes,
371
+ _ = w ? this._safe_map : this._map;
372
+ a.clamp();
373
+ for (var f = [], v = 0; v < l; v += 3)
374
+ for (
375
+ var o = (d[v >>> 2] >>> (24 - (v % 4) * 8)) & 255,
376
+ h = (d[(v + 1) >>> 2] >>> (24 - ((v + 1) % 4) * 8)) & 255,
377
+ C = (d[(v + 2) >>> 2] >>> (24 - ((v + 2) % 4) * 8)) & 255,
378
+ r = (o << 16) | (h << 8) | C,
379
+ n = 0;
380
+ n < 4 && v + n * 0.75 < l;
381
+ n++
382
+ )
383
+ f.push(_.charAt((r >>> (6 * (3 - n))) & 63));
384
+ var s = _.charAt(64);
385
+ if (s) for (; f.length % 4; ) f.push(s);
386
+ return f.join("");
387
+ },
388
+ parse: function (a, w = !0) {
389
+ var d = a.length,
390
+ l = w ? this._safe_map : this._map,
391
+ _ = this._reverseMap;
392
+ if (!_) {
393
+ _ = this._reverseMap = [];
394
+ for (var f = 0; f < l.length; f++) _[l.charCodeAt(f)] = f;
395
+ }
396
+ var v = l.charAt(64);
397
+ if (v) {
398
+ var o = a.indexOf(v);
399
+ o !== -1 && (d = o);
400
+ }
401
+ return k(a, d, _);
402
+ },
403
+ _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
404
+ _safe_map:
405
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
406
+ };
407
+ function k(a, w, d) {
408
+ for (var l = [], _ = 0, f = 0; f < w; f++)
409
+ if (f % 4) {
410
+ var v = d[a.charCodeAt(f - 1)] << ((f % 4) * 2),
411
+ o = d[a.charCodeAt(f)] >>> (6 - (f % 4) * 2),
412
+ h = v | o;
413
+ (l[_ >>> 2] |= h << (24 - (_ % 4) * 8)), _++;
414
+ }
415
+ return p.create(l, _);
416
+ }
417
+ })(),
418
+ i.enc.Base64url
419
+ );
420
+ });
421
+ })(ae);
422
+ var V = {},
423
+ pe = {
424
+ get exports() {
425
+ return V;
426
+ },
427
+ set exports(e) {
428
+ V = e;
429
+ },
430
+ };
431
+ (function (e, t) {
432
+ (function (i, c) {
433
+ e.exports = c(G());
434
+ })(U, function (i) {
435
+ return (
436
+ (function () {
437
+ if (typeof ArrayBuffer == "function") {
438
+ var c = i,
439
+ y = c.lib,
440
+ p = y.WordArray,
441
+ R = p.init,
442
+ k = (p.init = function (a) {
443
+ if (
444
+ (a instanceof ArrayBuffer && (a = new Uint8Array(a)),
445
+ (a instanceof Int8Array ||
446
+ (typeof Uint8ClampedArray < "u" &&
447
+ a instanceof Uint8ClampedArray) ||
448
+ a instanceof Int16Array ||
449
+ a instanceof Uint16Array ||
450
+ a instanceof Int32Array ||
451
+ a instanceof Uint32Array ||
452
+ a instanceof Float32Array ||
453
+ a instanceof Float64Array) &&
454
+ (a = new Uint8Array(a.buffer, a.byteOffset, a.byteLength)),
455
+ a instanceof Uint8Array)
456
+ ) {
457
+ for (var w = a.byteLength, d = [], l = 0; l < w; l++)
458
+ d[l >>> 2] |= a[l] << (24 - (l % 4) * 8);
459
+ R.call(this, d, w);
460
+ } else R.apply(this, arguments);
461
+ });
462
+ k.prototype = p;
463
+ }
464
+ })(),
465
+ i.lib.WordArray
466
+ );
467
+ });
468
+ })(pe);
469
+ var N = {},
470
+ ve = {
471
+ get exports() {
472
+ return N;
473
+ },
474
+ set exports(e) {
475
+ N = e;
476
+ },
477
+ };
478
+ (function (e, t) {
479
+ (function (i, c) {
480
+ e.exports = c(G());
481
+ })(U, function (i) {
482
+ return (
483
+ (function (c) {
484
+ var y = i,
485
+ p = y.lib,
486
+ R = p.WordArray,
487
+ k = p.Hasher,
488
+ a = y.algo,
489
+ w = [],
490
+ d = [];
491
+ (function () {
492
+ function f(C) {
493
+ for (var r = c.sqrt(C), n = 2; n <= r; n++) if (!(C % n)) return !1;
494
+ return !0;
495
+ }
496
+ function v(C) {
497
+ return ((C - (C | 0)) * 4294967296) | 0;
498
+ }
499
+ for (var o = 2, h = 0; h < 64; )
500
+ f(o) &&
501
+ (h < 8 && (w[h] = v(c.pow(o, 1 / 2))),
502
+ (d[h] = v(c.pow(o, 1 / 3))),
503
+ h++),
504
+ o++;
505
+ })();
506
+ var l = [],
507
+ _ = (a.SHA256 = k.extend({
508
+ _doReset: function () {
509
+ this._hash = new R.init(w.slice(0));
510
+ },
511
+ _doProcessBlock: function (f, v) {
512
+ for (
513
+ var o = this._hash.words,
514
+ h = o[0],
515
+ C = o[1],
516
+ r = o[2],
517
+ n = o[3],
518
+ s = o[4],
519
+ u = o[5],
520
+ g = o[6],
521
+ m = o[7],
522
+ b = 0;
523
+ b < 64;
524
+ b++
525
+ ) {
526
+ if (b < 16) l[b] = f[v + b] | 0;
527
+ else {
528
+ var B = l[b - 15],
529
+ W =
530
+ ((B << 25) | (B >>> 7)) ^
531
+ ((B << 14) | (B >>> 18)) ^
532
+ (B >>> 3),
533
+ H = l[b - 2],
534
+ $ =
535
+ ((H << 15) | (H >>> 17)) ^
536
+ ((H << 13) | (H >>> 19)) ^
537
+ (H >>> 10);
538
+ l[b] = W + l[b - 7] + $ + l[b - 16];
539
+ }
540
+ var Y = (s & u) ^ (~s & g),
541
+ ee = (h & C) ^ (h & r) ^ (C & r),
542
+ re =
543
+ ((h << 30) | (h >>> 2)) ^
544
+ ((h << 19) | (h >>> 13)) ^
545
+ ((h << 10) | (h >>> 22)),
546
+ te =
547
+ ((s << 26) | (s >>> 6)) ^
548
+ ((s << 21) | (s >>> 11)) ^
549
+ ((s << 7) | (s >>> 25)),
550
+ J = m + te + Y + d[b] + l[b],
551
+ ne = re + ee;
552
+ (m = g),
553
+ (g = u),
554
+ (u = s),
555
+ (s = (n + J) | 0),
556
+ (n = r),
557
+ (r = C),
558
+ (C = h),
559
+ (h = (J + ne) | 0);
560
+ }
561
+ (o[0] = (o[0] + h) | 0),
562
+ (o[1] = (o[1] + C) | 0),
563
+ (o[2] = (o[2] + r) | 0),
564
+ (o[3] = (o[3] + n) | 0),
565
+ (o[4] = (o[4] + s) | 0),
566
+ (o[5] = (o[5] + u) | 0),
567
+ (o[6] = (o[6] + g) | 0),
568
+ (o[7] = (o[7] + m) | 0);
569
+ },
570
+ _doFinalize: function () {
571
+ var f = this._data,
572
+ v = f.words,
573
+ o = this._nDataBytes * 8,
574
+ h = f.sigBytes * 8;
575
+ return (
576
+ (v[h >>> 5] |= 128 << (24 - (h % 32))),
577
+ (v[(((h + 64) >>> 9) << 4) + 14] = c.floor(o / 4294967296)),
578
+ (v[(((h + 64) >>> 9) << 4) + 15] = o),
579
+ (f.sigBytes = v.length * 4),
580
+ this._process(),
581
+ this._hash
582
+ );
583
+ },
584
+ clone: function () {
585
+ var f = k.clone.call(this);
586
+ return (f._hash = this._hash.clone()), f;
587
+ },
588
+ }));
589
+ (y.SHA256 = k._createHelper(_)),
590
+ (y.HmacSHA256 = k._createHmacHelper(_));
591
+ })(Math),
592
+ i.SHA256
593
+ );
594
+ });
595
+ })(ve);
596
+ const de = {
597
+ environments: {
598
+ production: {
599
+ api: "https://api.monerium.app",
600
+ web: "https://monerium.app",
601
+ },
602
+ sandbox: {
603
+ api: "https://api.monerium.dev",
604
+ web: "https://sandbox.monerium.dev",
605
+ },
606
+ },
607
+ };
608
+ var O, z, S, A, T, X, q, Z, I, K;
609
+ class Re {
610
+ constructor(t = "sandbox") {
611
+ P(this, S);
612
+ P(this, T);
613
+ P(this, q);
614
+ P(this, I);
615
+ P(this, O, void 0);
616
+ P(this, z, void 0);
617
+ j(this, "codeVerifier");
618
+ j(this, "bearerProfile");
619
+ D(this, O, de.environments[t]);
620
+ }
621
+ async auth(t) {
622
+ let i;
623
+ if (x(this, T, X).call(this, t))
624
+ i = { ...t, grant_type: "authorization_code" };
625
+ else if (x(this, q, Z).call(this, t))
626
+ i = { ...t, grant_type: "refresh_token" };
627
+ else if (x(this, I, K).call(this, t))
628
+ i = { ...t, grant_type: "client_credentials" };
629
+ else throw new Error("Authentication method could not be detected.");
630
+ (this.bearerProfile = await x(this, S, A).call(
631
+ this,
632
+ "post",
633
+ "auth/token",
634
+ new URLSearchParams(i),
635
+ !0
636
+ )),
637
+ D(this, z, `Bearer ${this.bearerProfile.access_token}`);
638
+ }
639
+ pkceRequest(t) {
640
+ this.codeVerifier = V.random(64).toString();
641
+ const i = M.stringify(N(this.codeVerifier)),
642
+ c = {
643
+ ...t,
644
+ code_challenge: i,
645
+ code_challenge_method: "S256",
646
+ response_type: "code",
647
+ };
648
+ return `${E(this, O).api}/auth?${new URLSearchParams(c)}`;
649
+ }
650
+ getAuthContext() {
651
+ return x(this, S, A).call(this, "get", "auth/context");
652
+ }
653
+ getProfile(t) {
654
+ return x(this, S, A).call(this, "get", `profiles/${t}`);
655
+ }
656
+ getBalances(t) {
657
+ return t
658
+ ? x(this, S, A).call(this, "get", `profiles/${t}/balances`)
659
+ : x(this, S, A).call(this, "get", "balances");
660
+ }
661
+ getOrders(t) {
662
+ const i = new URLSearchParams(t);
663
+ return x(this, S, A).call(this, "get", `orders?${i}`);
664
+ }
665
+ getOrder(t) {
666
+ return x(this, S, A).call(this, "get", `orders/${t}`);
667
+ }
668
+ getTokens() {
669
+ return x(this, S, A).call(this, "get", "tokens");
670
+ }
671
+ linkAddress(t, i) {
672
+ return x(this, S, A).call(
673
+ this,
674
+ "post",
675
+ `profiles/${t}/addresses`,
676
+ JSON.stringify(i)
677
+ );
678
+ }
679
+ placeOrder(t, i) {
680
+ return i
681
+ ? x(this, S, A).call(
682
+ this,
683
+ "post",
684
+ `profiles/${i}/orders`,
685
+ JSON.stringify(t)
686
+ )
687
+ : x(this, S, A).call(this, "post", "orders", JSON.stringify(t));
688
+ }
689
+ uploadSupportingDocument(t) {
690
+ const i = new URLSearchParams(t);
691
+ return x(this, S, A).call(this, "post", "files/supporting-document", i, !0);
692
+ }
693
+ }
694
+ (O = new WeakMap()),
695
+ (z = new WeakMap()),
696
+ (S = new WeakSet()),
697
+ (A = async function (t, i, c, y) {
698
+ const p = await fetch(`${E(this, O).api}/${i}`, {
699
+ method: t,
700
+ headers: {
701
+ "Content-Type": `application/${y ? "x-www-form-urlencoded" : "json"}`,
702
+ Authorization: E(this, z) || "",
703
+ },
704
+ body: c,
705
+ }),
706
+ R = await p.json();
707
+ if (p.ok) return R;
708
+ throw R;
709
+ }),
710
+ (T = new WeakSet()),
711
+ (X = function (t) {
712
+ return t.code != null;
713
+ }),
714
+ (q = new WeakSet()),
715
+ (Z = function (t) {
716
+ return t.refresh_token != null;
717
+ }),
718
+ (I = new WeakSet()),
719
+ (K = function (t) {
720
+ return t.client_secret != null;
721
+ });
722
+ var ge = /* @__PURE__ */ ((e) => (
723
+ (e.eur = "eur"), (e.usd = "usd"), (e.gbp = "gbp"), (e.isk = "isk"), e
724
+ ))(ge || {}),
725
+ ye = /* @__PURE__ */ ((e) => (
726
+ (e.corporate = "corporate"), (e.personal = "personal"), e
727
+ ))(ye || {}),
728
+ _e = /* @__PURE__ */ ((e) => ((e.read = "read"), (e.write = "write"), e))(
729
+ _e || {}
730
+ ),
731
+ me = /* @__PURE__ */ ((e) => (
732
+ (e.absent = "absent"),
733
+ (e.submitted = "submitted"),
734
+ (e.pending = "pending"),
735
+ (e.confirmed = "confirmed"),
736
+ e
737
+ ))(me || {}),
738
+ we = /* @__PURE__ */ ((e) => (
739
+ (e.approved = "approved"),
740
+ (e.rejected = "rejected"),
741
+ (e.unknown = "unknown"),
742
+ e
743
+ ))(we || {}),
744
+ be = /* @__PURE__ */ ((e) => ((e.iban = "iban"), (e.scan = "scan"), e))(
745
+ be || {}
746
+ ),
747
+ Be = /* @__PURE__ */ ((e) => (
748
+ (e.polygon = "polygon"), (e.ethereum = "ethereum"), (e.gnosis = "gnosis"), e
749
+ ))(Be || {}),
750
+ xe = /* @__PURE__ */ ((e) => (
751
+ (e.mainnet = "mainnet"),
752
+ (e.chiado = "chiado"),
753
+ (e.goerli = "goerli"),
754
+ (e.mumbai = "mumbai"),
755
+ e
756
+ ))(xe || {}),
757
+ Ce = /* @__PURE__ */ ((e) => ((e.redeem = "redeem"), (e.issue = "issue"), e))(
758
+ Ce || {}
759
+ ),
760
+ Se = /* @__PURE__ */ ((e) => (
761
+ (e.placed = "placed"),
762
+ (e.pending = "pending"),
763
+ (e.processed = "processed"),
764
+ (e.rejected = "rejected"),
765
+ e
766
+ ))(Se || {});
767
+ export {
768
+ Be as Chain,
769
+ ge as Currency,
770
+ we as KYCOutcome,
771
+ me as KYCState,
772
+ Re as MoneriumClient,
773
+ xe as Network,
774
+ Ce as OrderKind,
775
+ Se as OrderState,
776
+ be as PaymentStandard,
777
+ _e as Permission,
778
+ ye as ProfileType,
779
+ };
780
+ //# sourceMappingURL=index.es.js.map