@monerium/sdk 2.0.14 → 2.0.16

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