@monerium/sdk 2.0.0-alpha.2 → 2.0.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.
@@ -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
+ const se = {
23
+ environments: {
24
+ production: {
25
+ api: "https://api.monerium.app",
26
+ web: "https://monerium.app",
27
+ },
28
+ sandbox: {
29
+ api: "https://api.monerium.dev",
30
+ web: "https://sandbox.monerium.dev",
31
+ },
32
+ },
33
+ };
34
+ var U =
35
+ typeof globalThis < "u"
36
+ ? globalThis
37
+ : typeof window < "u"
38
+ ? window
39
+ : typeof global < "u"
40
+ ? global
41
+ : typeof self < "u"
42
+ ? self
43
+ : {};
44
+ function ae(e) {
45
+ if (e.__esModule) return e;
46
+ var t = e.default;
47
+ if (typeof t == "function") {
48
+ var i = function c() {
49
+ if (this instanceof c) {
50
+ var y = [null];
51
+ y.push.apply(y, arguments);
52
+ var p = Function.bind.apply(t, y);
53
+ return new p();
54
+ }
55
+ return t.apply(this, arguments);
56
+ };
57
+ i.prototype = t.prototype;
58
+ } else i = {};
59
+ return (
60
+ Object.defineProperty(i, "__esModule", { value: !0 }),
61
+ Object.keys(e).forEach(function (c) {
62
+ var y = Object.getOwnPropertyDescriptor(e, c);
63
+ Object.defineProperty(
64
+ i,
65
+ c,
66
+ y.get
67
+ ? y
68
+ : {
69
+ enumerable: !0,
70
+ get: function () {
71
+ return e[c];
72
+ },
73
+ }
74
+ );
75
+ }),
76
+ i
77
+ );
78
+ }
79
+ var M = {},
80
+ ce = {
81
+ get exports() {
82
+ return M;
83
+ },
84
+ set exports(e) {
85
+ M = e;
86
+ },
87
+ };
88
+ function ue(e) {
89
+ throw new Error(
90
+ 'Could not dynamically require "' +
91
+ e +
92
+ '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'
93
+ );
94
+ }
95
+ var L = {},
96
+ fe = {
97
+ get exports() {
98
+ return L;
99
+ },
100
+ set exports(e) {
101
+ L = e;
102
+ },
103
+ };
104
+ const le = {},
105
+ he = /* @__PURE__ */ Object.freeze(
106
+ /* @__PURE__ */ Object.defineProperty(
107
+ {
108
+ __proto__: null,
109
+ default: le,
110
+ },
111
+ Symbol.toStringTag,
112
+ { value: "Module" }
113
+ )
114
+ ),
115
+ pe = /* @__PURE__ */ ae(he);
116
+ var Q;
117
+ function G() {
118
+ return (
119
+ Q ||
120
+ ((Q = 1),
121
+ (function (e, t) {
122
+ (function (i, c) {
123
+ e.exports = c();
124
+ })(U, function () {
125
+ var i =
126
+ i ||
127
+ (function (c, y) {
128
+ var p;
129
+ if (
130
+ (typeof window < "u" && window.crypto && (p = window.crypto),
131
+ typeof self < "u" && self.crypto && (p = self.crypto),
132
+ typeof globalThis < "u" &&
133
+ globalThis.crypto &&
134
+ (p = globalThis.crypto),
135
+ !p &&
136
+ typeof window < "u" &&
137
+ window.msCrypto &&
138
+ (p = window.msCrypto),
139
+ !p && typeof U < "u" && U.crypto && (p = U.crypto),
140
+ !p && typeof ue == "function")
141
+ )
142
+ try {
143
+ p = pe;
144
+ } catch {}
145
+ var R = function () {
146
+ if (p) {
147
+ if (typeof p.getRandomValues == "function")
148
+ try {
149
+ return p.getRandomValues(new Uint32Array(1))[0];
150
+ } catch {}
151
+ if (typeof p.randomBytes == "function")
152
+ try {
153
+ return p.randomBytes(4).readInt32LE();
154
+ } catch {}
155
+ }
156
+ throw new Error(
157
+ "Native crypto module could not be used to get secure random number."
158
+ );
159
+ },
160
+ k =
161
+ Object.create ||
162
+ (function () {
163
+ function r() {}
164
+ return function (n) {
165
+ var s;
166
+ return (
167
+ (r.prototype = n),
168
+ (s = new r()),
169
+ (r.prototype = null),
170
+ s
171
+ );
172
+ };
173
+ })(),
174
+ a = {},
175
+ w = (a.lib = {}),
176
+ d = (w.Base = (function () {
177
+ return {
178
+ extend: function (r) {
179
+ var n = k(this);
180
+ return (
181
+ r && n.mixIn(r),
182
+ (!n.hasOwnProperty("init") || this.init === n.init) &&
183
+ (n.init = function () {
184
+ n.$super.init.apply(this, arguments);
185
+ }),
186
+ (n.init.prototype = n),
187
+ (n.$super = this),
188
+ n
189
+ );
190
+ },
191
+ create: function () {
192
+ var r = this.extend();
193
+ return r.init.apply(r, arguments), r;
194
+ },
195
+ init: function () {},
196
+ mixIn: function (r) {
197
+ for (var n in r) r.hasOwnProperty(n) && (this[n] = r[n]);
198
+ r.hasOwnProperty("toString") &&
199
+ (this.toString = r.toString);
200
+ },
201
+ clone: function () {
202
+ return this.init.prototype.extend(this);
203
+ },
204
+ };
205
+ })()),
206
+ l = (w.WordArray = d.extend({
207
+ init: function (r, n) {
208
+ (r = this.words = r || []),
209
+ n != y
210
+ ? (this.sigBytes = n)
211
+ : (this.sigBytes = r.length * 4);
212
+ },
213
+ toString: function (r) {
214
+ return (r || f).stringify(this);
215
+ },
216
+ concat: function (r) {
217
+ var n = this.words,
218
+ s = r.words,
219
+ u = this.sigBytes,
220
+ g = r.sigBytes;
221
+ if ((this.clamp(), u % 4))
222
+ for (var m = 0; m < g; m++) {
223
+ var b = (s[m >>> 2] >>> (24 - (m % 4) * 8)) & 255;
224
+ n[(u + m) >>> 2] |= b << (24 - ((u + m) % 4) * 8);
225
+ }
226
+ else
227
+ for (var B = 0; B < g; B += 4)
228
+ n[(u + B) >>> 2] = s[B >>> 2];
229
+ return (this.sigBytes += g), this;
230
+ },
231
+ clamp: function () {
232
+ var r = this.words,
233
+ n = this.sigBytes;
234
+ (r[n >>> 2] &= 4294967295 << (32 - (n % 4) * 8)),
235
+ (r.length = c.ceil(n / 4));
236
+ },
237
+ clone: function () {
238
+ var r = d.clone.call(this);
239
+ return (r.words = this.words.slice(0)), r;
240
+ },
241
+ random: function (r) {
242
+ for (var n = [], s = 0; s < r; s += 4) n.push(R());
243
+ return new l.init(n, r);
244
+ },
245
+ })),
246
+ _ = (a.enc = {}),
247
+ f = (_.Hex = {
248
+ stringify: function (r) {
249
+ for (
250
+ var n = r.words, s = r.sigBytes, u = [], g = 0;
251
+ g < s;
252
+ g++
253
+ ) {
254
+ var m = (n[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
255
+ u.push((m >>> 4).toString(16)),
256
+ u.push((m & 15).toString(16));
257
+ }
258
+ return u.join("");
259
+ },
260
+ parse: function (r) {
261
+ for (var n = r.length, s = [], u = 0; u < n; u += 2)
262
+ s[u >>> 3] |=
263
+ parseInt(r.substr(u, 2), 16) << (24 - (u % 8) * 4);
264
+ return new l.init(s, n / 2);
265
+ },
266
+ }),
267
+ v = (_.Latin1 = {
268
+ stringify: function (r) {
269
+ for (
270
+ var n = r.words, s = r.sigBytes, u = [], g = 0;
271
+ g < s;
272
+ g++
273
+ ) {
274
+ var m = (n[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
275
+ u.push(String.fromCharCode(m));
276
+ }
277
+ return u.join("");
278
+ },
279
+ parse: function (r) {
280
+ for (var n = r.length, s = [], u = 0; u < n; u++)
281
+ s[u >>> 2] |=
282
+ (r.charCodeAt(u) & 255) << (24 - (u % 4) * 8);
283
+ return new l.init(s, n);
284
+ },
285
+ }),
286
+ o = (_.Utf8 = {
287
+ stringify: function (r) {
288
+ try {
289
+ return decodeURIComponent(escape(v.stringify(r)));
290
+ } catch {
291
+ throw new Error("Malformed UTF-8 data");
292
+ }
293
+ },
294
+ parse: function (r) {
295
+ return v.parse(unescape(encodeURIComponent(r)));
296
+ },
297
+ }),
298
+ h = (w.BufferedBlockAlgorithm = d.extend({
299
+ reset: function () {
300
+ (this._data = new l.init()), (this._nDataBytes = 0);
301
+ },
302
+ _append: function (r) {
303
+ typeof r == "string" && (r = o.parse(r)),
304
+ this._data.concat(r),
305
+ (this._nDataBytes += r.sigBytes);
306
+ },
307
+ _process: function (r) {
308
+ var n,
309
+ s = this._data,
310
+ u = s.words,
311
+ g = s.sigBytes,
312
+ m = this.blockSize,
313
+ b = m * 4,
314
+ B = g / b;
315
+ r
316
+ ? (B = c.ceil(B))
317
+ : (B = c.max((B | 0) - this._minBufferSize, 0));
318
+ var W = B * m,
319
+ H = c.min(W * 4, g);
320
+ if (W) {
321
+ for (var $ = 0; $ < W; $ += m) this._doProcessBlock(u, $);
322
+ (n = u.splice(0, W)), (s.sigBytes -= H);
323
+ }
324
+ return new l.init(n, H);
325
+ },
326
+ clone: function () {
327
+ var r = d.clone.call(this);
328
+ return (r._data = this._data.clone()), r;
329
+ },
330
+ _minBufferSize: 0,
331
+ }));
332
+ w.Hasher = h.extend({
333
+ cfg: d.extend(),
334
+ init: function (r) {
335
+ (this.cfg = this.cfg.extend(r)), this.reset();
336
+ },
337
+ reset: function () {
338
+ h.reset.call(this), this._doReset();
339
+ },
340
+ update: function (r) {
341
+ return this._append(r), this._process(), this;
342
+ },
343
+ finalize: function (r) {
344
+ r && this._append(r);
345
+ var n = this._doFinalize();
346
+ return n;
347
+ },
348
+ blockSize: 16,
349
+ _createHelper: function (r) {
350
+ return function (n, s) {
351
+ return new r.init(s).finalize(n);
352
+ };
353
+ },
354
+ _createHmacHelper: function (r) {
355
+ return function (n, s) {
356
+ return new C.HMAC.init(r, s).finalize(n);
357
+ };
358
+ },
359
+ });
360
+ var C = (a.algo = {});
361
+ return a;
362
+ })(Math);
363
+ return i;
364
+ });
365
+ })(fe)),
366
+ L
367
+ );
368
+ }
369
+ (function (e, t) {
370
+ (function (i, c) {
371
+ e.exports = c(G());
372
+ })(U, function (i) {
373
+ return (
374
+ (function () {
375
+ var c = i,
376
+ y = c.lib,
377
+ p = y.WordArray,
378
+ R = c.enc;
379
+ R.Base64url = {
380
+ stringify: function (a, w = !0) {
381
+ var d = a.words,
382
+ l = a.sigBytes,
383
+ _ = w ? this._safe_map : this._map;
384
+ a.clamp();
385
+ for (var f = [], v = 0; v < l; v += 3)
386
+ for (
387
+ var o = (d[v >>> 2] >>> (24 - (v % 4) * 8)) & 255,
388
+ h = (d[(v + 1) >>> 2] >>> (24 - ((v + 1) % 4) * 8)) & 255,
389
+ C = (d[(v + 2) >>> 2] >>> (24 - ((v + 2) % 4) * 8)) & 255,
390
+ r = (o << 16) | (h << 8) | C,
391
+ n = 0;
392
+ n < 4 && v + n * 0.75 < l;
393
+ n++
394
+ )
395
+ f.push(_.charAt((r >>> (6 * (3 - n))) & 63));
396
+ var s = _.charAt(64);
397
+ if (s) for (; f.length % 4; ) f.push(s);
398
+ return f.join("");
399
+ },
400
+ parse: function (a, w = !0) {
401
+ var d = a.length,
402
+ l = w ? this._safe_map : this._map,
403
+ _ = this._reverseMap;
404
+ if (!_) {
405
+ _ = this._reverseMap = [];
406
+ for (var f = 0; f < l.length; f++) _[l.charCodeAt(f)] = f;
407
+ }
408
+ var v = l.charAt(64);
409
+ if (v) {
410
+ var o = a.indexOf(v);
411
+ o !== -1 && (d = o);
412
+ }
413
+ return k(a, d, _);
414
+ },
415
+ _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
416
+ _safe_map:
417
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
418
+ };
419
+ function k(a, w, d) {
420
+ for (var l = [], _ = 0, f = 0; f < w; f++)
421
+ if (f % 4) {
422
+ var v = d[a.charCodeAt(f - 1)] << ((f % 4) * 2),
423
+ o = d[a.charCodeAt(f)] >>> (6 - (f % 4) * 2),
424
+ h = v | o;
425
+ (l[_ >>> 2] |= h << (24 - (_ % 4) * 8)), _++;
426
+ }
427
+ return p.create(l, _);
428
+ }
429
+ })(),
430
+ i.enc.Base64url
431
+ );
432
+ });
433
+ })(ce);
434
+ var V = {},
435
+ ve = {
436
+ get exports() {
437
+ return V;
438
+ },
439
+ set exports(e) {
440
+ V = e;
441
+ },
442
+ };
443
+ (function (e, t) {
444
+ (function (i, c) {
445
+ e.exports = c(G());
446
+ })(U, function (i) {
447
+ return (
448
+ (function (c) {
449
+ var y = i,
450
+ p = y.lib,
451
+ R = p.WordArray,
452
+ k = p.Hasher,
453
+ a = y.algo,
454
+ w = [],
455
+ d = [];
456
+ (function () {
457
+ function f(C) {
458
+ for (var r = c.sqrt(C), n = 2; n <= r; n++) if (!(C % n)) return !1;
459
+ return !0;
460
+ }
461
+ function v(C) {
462
+ return ((C - (C | 0)) * 4294967296) | 0;
463
+ }
464
+ for (var o = 2, h = 0; h < 64; )
465
+ f(o) &&
466
+ (h < 8 && (w[h] = v(c.pow(o, 1 / 2))),
467
+ (d[h] = v(c.pow(o, 1 / 3))),
468
+ h++),
469
+ o++;
470
+ })();
471
+ var l = [],
472
+ _ = (a.SHA256 = k.extend({
473
+ _doReset: function () {
474
+ this._hash = new R.init(w.slice(0));
475
+ },
476
+ _doProcessBlock: function (f, v) {
477
+ for (
478
+ var o = this._hash.words,
479
+ h = o[0],
480
+ C = o[1],
481
+ r = o[2],
482
+ n = o[3],
483
+ s = o[4],
484
+ u = o[5],
485
+ g = o[6],
486
+ m = o[7],
487
+ b = 0;
488
+ b < 64;
489
+ b++
490
+ ) {
491
+ if (b < 16) l[b] = f[v + b] | 0;
492
+ else {
493
+ var B = l[b - 15],
494
+ W =
495
+ ((B << 25) | (B >>> 7)) ^
496
+ ((B << 14) | (B >>> 18)) ^
497
+ (B >>> 3),
498
+ H = l[b - 2],
499
+ $ =
500
+ ((H << 15) | (H >>> 17)) ^
501
+ ((H << 13) | (H >>> 19)) ^
502
+ (H >>> 10);
503
+ l[b] = W + l[b - 7] + $ + l[b - 16];
504
+ }
505
+ var Y = (s & u) ^ (~s & g),
506
+ ee = (h & C) ^ (h & r) ^ (C & r),
507
+ re =
508
+ ((h << 30) | (h >>> 2)) ^
509
+ ((h << 19) | (h >>> 13)) ^
510
+ ((h << 10) | (h >>> 22)),
511
+ te =
512
+ ((s << 26) | (s >>> 6)) ^
513
+ ((s << 21) | (s >>> 11)) ^
514
+ ((s << 7) | (s >>> 25)),
515
+ J = m + te + Y + d[b] + l[b],
516
+ ne = re + ee;
517
+ (m = g),
518
+ (g = u),
519
+ (u = s),
520
+ (s = (n + J) | 0),
521
+ (n = r),
522
+ (r = C),
523
+ (C = h),
524
+ (h = (J + ne) | 0);
525
+ }
526
+ (o[0] = (o[0] + h) | 0),
527
+ (o[1] = (o[1] + C) | 0),
528
+ (o[2] = (o[2] + r) | 0),
529
+ (o[3] = (o[3] + n) | 0),
530
+ (o[4] = (o[4] + s) | 0),
531
+ (o[5] = (o[5] + u) | 0),
532
+ (o[6] = (o[6] + g) | 0),
533
+ (o[7] = (o[7] + m) | 0);
534
+ },
535
+ _doFinalize: function () {
536
+ var f = this._data,
537
+ v = f.words,
538
+ o = this._nDataBytes * 8,
539
+ h = f.sigBytes * 8;
540
+ return (
541
+ (v[h >>> 5] |= 128 << (24 - (h % 32))),
542
+ (v[(((h + 64) >>> 9) << 4) + 14] = c.floor(o / 4294967296)),
543
+ (v[(((h + 64) >>> 9) << 4) + 15] = o),
544
+ (f.sigBytes = v.length * 4),
545
+ this._process(),
546
+ this._hash
547
+ );
548
+ },
549
+ clone: function () {
550
+ var f = k.clone.call(this);
551
+ return (f._hash = this._hash.clone()), f;
552
+ },
553
+ }));
554
+ (y.SHA256 = k._createHelper(_)),
555
+ (y.HmacSHA256 = k._createHmacHelper(_));
556
+ })(Math),
557
+ i.SHA256
558
+ );
559
+ });
560
+ })(ve);
561
+ var N = {},
562
+ de = {
563
+ get exports() {
564
+ return N;
565
+ },
566
+ set exports(e) {
567
+ N = e;
568
+ },
569
+ };
570
+ (function (e, t) {
571
+ (function (i, c) {
572
+ e.exports = c(G());
573
+ })(U, function (i) {
574
+ return (
575
+ (function () {
576
+ if (typeof ArrayBuffer == "function") {
577
+ var c = i,
578
+ y = c.lib,
579
+ p = y.WordArray,
580
+ R = p.init,
581
+ k = (p.init = function (a) {
582
+ if (
583
+ (a instanceof ArrayBuffer && (a = new Uint8Array(a)),
584
+ (a instanceof Int8Array ||
585
+ (typeof Uint8ClampedArray < "u" &&
586
+ a instanceof Uint8ClampedArray) ||
587
+ a instanceof Int16Array ||
588
+ a instanceof Uint16Array ||
589
+ a instanceof Int32Array ||
590
+ a instanceof Uint32Array ||
591
+ a instanceof Float32Array ||
592
+ a instanceof Float64Array) &&
593
+ (a = new Uint8Array(a.buffer, a.byteOffset, a.byteLength)),
594
+ a instanceof Uint8Array)
595
+ ) {
596
+ for (var w = a.byteLength, d = [], l = 0; l < w; l++)
597
+ d[l >>> 2] |= a[l] << (24 - (l % 4) * 8);
598
+ R.call(this, d, w);
599
+ } else R.apply(this, arguments);
600
+ });
601
+ k.prototype = p;
602
+ }
603
+ })(),
604
+ i.lib.WordArray
605
+ );
606
+ });
607
+ })(de);
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, se.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 = N.random(64).toString();
641
+ const i = M.stringify(V(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