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