@monerium/sdk 2.0.9 → 2.0.12

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