@monerium/sdk 2.0.15 → 2.0.17

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 Be = Object.defineProperty;
2
+ var xe = (s, u, g) =>
3
+ u in s
4
+ ? Be(s, u, { enumerable: !0, configurable: !0, writable: !0, value: g })
5
+ : (s[u] = g);
6
+ var I = (s, u, g) => (xe(s, typeof u != "symbol" ? u + "" : u, g), g),
7
+ N = (s, u, g) => {
8
+ if (!u.has(s)) throw TypeError("Cannot " + g);
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, u, g) => (
11
+ N(s, u, "read from private field"), g ? g.call(s) : u.get(s)
12
12
  ),
13
- O = (u, f, w) => {
14
- if (f.has(u))
13
+ T = (s, u, g) => {
14
+ if (u.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
+ u instanceof WeakSet ? u.add(s) : u.set(s, g);
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
+ G = (s, u, g, z) => (
19
+ N(s, u, "write to private field"), z ? z.call(s, g) : u.set(s, g), g
20
20
  );
21
- var P = (u, f, w) => (Q(u, f, "access private method"), w);
22
- (function (u, f) {
21
+ var S = (s, u, g) => (N(s, u, "access private method"), g);
22
+ (function (s, u) {
23
23
  typeof exports == "object" && typeof module < "u"
24
- ? f(exports)
24
+ ? u(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"], u)
27
+ : ((s = typeof globalThis < "u" ? globalThis : s || self),
28
+ u((s["monerium-sdk"] = {})));
29
+ })(this, function (s) {
30
+ var E, W, A, k, q, ae, F, ue, M, ce;
31
31
  ("use strict");
32
- var f =
32
+ var u =
33
33
  typeof globalThis < "u"
34
34
  ? globalThis
35
35
  : typeof window < "u"
@@ -39,67 +39,67 @@ 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 g(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 l() {
47
+ if (this instanceof l) {
48
+ var b = [null];
49
+ b.push.apply(b, arguments);
50
+ var p = Function.bind.apply(n, b);
51
+ return new p();
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 (l) {
60
+ var b = Object.getOwnPropertyDescriptor(r, l);
61
61
  Object.defineProperty(
62
- o,
63
- i,
64
- _.get
65
- ? _
62
+ a,
63
+ l,
64
+ b.get
65
+ ? b
66
66
  : {
67
67
  enumerable: !0,
68
68
  get: function () {
69
- return r[i];
69
+ return r[l];
70
70
  },
71
71
  }
72
72
  );
73
73
  }),
74
- o
74
+ a
75
75
  );
76
76
  }
77
- var U = {},
78
- ye = {
77
+ var z = {},
78
+ fe = {
79
79
  get exports() {
80
- return U;
80
+ return z;
81
81
  },
82
82
  set exports(r) {
83
- U = r;
83
+ z = r;
84
84
  },
85
85
  };
86
- function ge(r) {
86
+ function de(r) {
87
87
  throw new Error(
88
88
  'Could not dynamically require "' +
89
89
  r +
90
90
  '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'
91
91
  );
92
92
  }
93
- var L = {},
94
- me = {
93
+ var U = {},
94
+ le = {
95
95
  get exports() {
96
- return L;
96
+ return U;
97
97
  },
98
98
  set exports(r) {
99
- L = r;
99
+ U = r;
100
100
  },
101
101
  };
102
- const K = w(
102
+ const he = g(
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 J;
112
+ function Q() {
113
113
  return (
114
- Y ||
115
- ((Y = 1),
114
+ J ||
115
+ ((J = 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, l) {
118
+ r.exports = l();
119
+ })(u, function () {
120
+ var a =
121
+ a ||
122
+ (function (l, b) {
123
+ var p;
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 && (p = window.crypto),
126
+ typeof self < "u" && self.crypto && (p = self.crypto),
127
127
  typeof globalThis < "u" &&
128
128
  globalThis.crypto &&
129
- (c = globalThis.crypto),
130
- !c &&
129
+ (p = globalThis.crypto),
130
+ !p &&
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
+ (p = window.msCrypto),
134
+ !p && typeof u < "u" && u.crypto && (p = u.crypto),
135
+ !p && typeof de == "function")
136
136
  )
137
137
  try {
138
- c = K;
138
+ p = he;
139
139
  } catch {}
140
- var y = function () {
141
- if (c) {
142
- if (typeof c.getRandomValues == "function")
140
+ var H = function () {
141
+ if (p) {
142
+ if (typeof p.getRandomValues == "function")
143
143
  try {
144
- return c.getRandomValues(new Uint32Array(1))[0];
144
+ return p.getRandomValues(new Uint32Array(1))[0];
145
145
  } catch {}
146
- if (typeof c.randomBytes == "function")
146
+ if (typeof p.randomBytes == "function")
147
147
  try {
148
- return c.randomBytes(4).readInt32LE();
148
+ return p.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
+ B = {},
170
+ R = (B.lib = {}),
171
+ w = (R.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,135 +199,135 @@ 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
+ v = (R.WordArray = w.extend({
203
203
  init: function (e, t) {
204
204
  (e = this.words = e || []),
205
- t != _
205
+ t != b
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 || f).stringify(this);
211
211
  },
212
212
  concat: function (e) {
213
213
  var t = this.words,
214
- a = 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 A = (a[B >>> 2] >>> (24 - (B % 4) * 8)) & 255;
220
- t[(l + B) >>> 2] |= A << (24 - ((l + B) % 4) * 8);
214
+ o = e.words,
215
+ c = this.sigBytes,
216
+ y = e.sigBytes;
217
+ if ((this.clamp(), c % 4))
218
+ for (var _ = 0; _ < y; _++) {
219
+ var x = (o[_ >>> 2] >>> (24 - (_ % 4) * 8)) & 255;
220
+ t[(c + _) >>> 2] |= x << (24 - ((c + _) % 4) * 8);
221
221
  }
222
222
  else
223
- for (var R = 0; R < m; R += 4)
224
- t[(l + R) >>> 2] = a[R >>> 2];
225
- return (this.sigBytes += m), this;
223
+ for (var C = 0; C < y; C += 4)
224
+ t[(c + C) >>> 2] = o[C >>> 2];
225
+ return (this.sigBytes += y), 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 = l.ceil(t / 4));
232
232
  },
233
233
  clone: function () {
234
- var e = C.clone.call(this);
234
+ var e = w.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 v.init(t, e);
240
240
  },
241
241
  })),
242
- b = (h.enc = {}),
243
- p = (b.Hex = {
242
+ m = (B.enc = {}),
243
+ f = (m.Hex = {
244
244
  stringify: function (e) {
245
245
  for (
246
- var t = e.words, a = e.sigBytes, l = [], m = 0;
247
- m < a;
248
- m++
246
+ var t = e.words, o = e.sigBytes, c = [], y = 0;
247
+ y < o;
248
+ y++
249
249
  ) {
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));
250
+ var _ = (t[y >>> 2] >>> (24 - (y % 4) * 8)) & 255;
251
+ c.push((_ >>> 4).toString(16)),
252
+ c.push((_ & 15).toString(16));
253
253
  }
254
- return l.join("");
254
+ return c.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] |=
259
- parseInt(e.substr(l, 2), 16) << (24 - (l % 8) * 4);
260
- return new g.init(a, t / 2);
257
+ for (var t = e.length, o = [], c = 0; c < t; c += 2)
258
+ o[c >>> 3] |=
259
+ parseInt(e.substr(c, 2), 16) << (24 - (c % 8) * 4);
260
+ return new v.init(o, t / 2);
261
261
  },
262
262
  }),
263
- v = (b.Latin1 = {
263
+ h = (m.Latin1 = {
264
264
  stringify: function (e) {
265
265
  for (
266
- var t = e.words, a = e.sigBytes, l = [], m = 0;
267
- m < a;
268
- m++
266
+ var t = e.words, o = e.sigBytes, c = [], y = 0;
267
+ y < o;
268
+ y++
269
269
  ) {
270
- var B = (t[m >>> 2] >>> (24 - (m % 4) * 8)) & 255;
271
- l.push(String.fromCharCode(B));
270
+ var _ = (t[y >>> 2] >>> (24 - (y % 4) * 8)) & 255;
271
+ c.push(String.fromCharCode(_));
272
272
  }
273
- return l.join("");
273
+ return c.join("");
274
274
  },
275
275
  parse: function (e) {
276
- for (var t = e.length, a = [], l = 0; l < t; l++)
277
- a[l >>> 2] |=
278
- (e.charCodeAt(l) & 255) << (24 - (l % 4) * 8);
279
- return new g.init(a, t);
276
+ for (var t = e.length, o = [], c = 0; c < t; c++)
277
+ o[c >>> 2] |=
278
+ (e.charCodeAt(c) & 255) << (24 - (c % 4) * 8);
279
+ return new v.init(o, t);
280
280
  },
281
281
  }),
282
- s = (b.Utf8 = {
282
+ i = (m.Utf8 = {
283
283
  stringify: function (e) {
284
284
  try {
285
- return decodeURIComponent(escape(v.stringify(e)));
285
+ return decodeURIComponent(escape(h.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 h.parse(unescape(encodeURIComponent(e)));
292
292
  },
293
293
  }),
294
- d = (S.BufferedBlockAlgorithm = C.extend({
294
+ d = (R.BufferedBlockAlgorithm = w.extend({
295
295
  reset: function () {
296
- (this._data = new g.init()), (this._nDataBytes = 0);
296
+ (this._data = new v.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,
308
- B = this.blockSize,
309
- A = B * 4,
310
- R = m / A;
305
+ o = this._data,
306
+ c = o.words,
307
+ y = o.sigBytes,
308
+ _ = this.blockSize,
309
+ x = _ * 4,
310
+ C = y / x;
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);
312
+ ? (C = l.ceil(C))
313
+ : (C = l.max((C | 0) - this._minBufferSize, 0));
314
+ var j = C * _,
315
+ $ = l.min(j * 4, y);
316
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);
317
+ for (var L = 0; L < j; L += _)
318
+ this._doProcessBlock(c, L);
319
+ (t = c.splice(0, j)), (o.sigBytes -= $);
320
320
  }
321
- return new g.init(t, H);
321
+ return new v.init(t, $);
322
322
  },
323
323
  clone: function () {
324
- var e = C.clone.call(this);
324
+ var e = w.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
+ R.Hasher = d.extend({
330
+ cfg: w.extend(),
331
331
  init: function (e) {
332
332
  (this.cfg = this.cfg.extend(e)), this.reset();
333
333
  },
@@ -344,219 +344,219 @@ 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 P.HMAC.init(e, o).finalize(t);
354
354
  };
355
355
  },
356
356
  });
357
- var k = (h.algo = {});
358
- return h;
357
+ var P = (B.algo = {});
358
+ return B;
359
359
  })(Math);
360
- return o;
360
+ return a;
361
361
  });
362
- })(me)),
363
- L
362
+ })(le)),
363
+ U
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, l) {
368
+ r.exports = l(Q());
369
+ })(u, 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 l = a,
373
+ b = l.lib,
374
+ p = b.WordArray,
375
+ H = l.enc;
376
+ H.Base64url = {
377
+ stringify: function (B, R = !0) {
378
+ var w = B.words,
379
+ v = B.sigBytes,
380
+ m = R ? this._safe_map : this._map;
381
+ B.clamp();
382
+ for (var f = [], h = 0; h < v; h += 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 = (w[h >>> 2] >>> (24 - (h % 4) * 8)) & 255,
385
+ d = (w[(h + 1) >>> 2] >>> (24 - ((h + 1) % 4) * 8)) & 255,
386
+ P = (w[(h + 2) >>> 2] >>> (24 - ((h + 2) % 4) * 8)) & 255,
387
+ e = (i << 16) | (d << 8) | P,
388
388
  t = 0;
389
- t < 4 && v + t * 0.75 < g;
389
+ t < 4 && h + t * 0.75 < v;
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
+ f.push(m.charAt((e >>> (6 * (3 - t))) & 63));
393
+ var o = m.charAt(64);
394
+ if (o) for (; f.length % 4; ) f.push(o);
395
+ return f.join("");
396
396
  },
397
- parse: function (h, S = !0) {
398
- var C = h.length,
399
- g = S ? this._safe_map : this._map,
400
- b = this._reverseMap;
401
- if (!b) {
402
- b = this._reverseMap = [];
403
- for (var p = 0; p < g.length; p++) b[g.charCodeAt(p)] = p;
397
+ parse: function (B, R = !0) {
398
+ var w = B.length,
399
+ v = R ? this._safe_map : this._map,
400
+ m = this._reverseMap;
401
+ if (!m) {
402
+ m = this._reverseMap = [];
403
+ for (var f = 0; f < v.length; f++) m[v.charCodeAt(f)] = f;
404
404
  }
405
- var v = g.charAt(64);
406
- if (v) {
407
- var s = h.indexOf(v);
408
- s !== -1 && (C = s);
405
+ var h = v.charAt(64);
406
+ if (h) {
407
+ var i = B.indexOf(h);
408
+ i !== -1 && (w = i);
409
409
  }
410
- return x(h, C, b);
410
+ return O(B, w, m);
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(B, R, w) {
417
+ for (var v = [], m = 0, f = 0; f < R; f++)
418
+ if (f % 4) {
419
+ var h = w[B.charCodeAt(f - 1)] << ((f % 4) * 2),
420
+ i = w[B.charCodeAt(f)] >>> (6 - (f % 4) * 2),
421
+ d = h | i;
422
+ (v[m >>> 2] |= d << (24 - (m % 4) * 8)), m++;
423
423
  }
424
- return c.create(g, b);
424
+ return p.create(v, m);
425
425
  }
426
426
  })(),
427
- o.enc.Base64url
427
+ a.enc.Base64url
428
428
  );
429
429
  });
430
- })(ye);
431
- var G = {},
432
- we = {
430
+ })(fe);
431
+ var V = {},
432
+ pe = {
433
433
  get exports() {
434
- return G;
434
+ return V;
435
435
  },
436
436
  set exports(r) {
437
- G = r;
437
+ V = 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, l) {
442
+ r.exports = l(Q());
443
+ })(u, 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 (l) {
446
+ var b = a,
447
+ p = b.lib,
448
+ H = p.WordArray,
449
+ O = p.Hasher,
450
+ B = b.algo,
451
+ R = [],
452
+ w = [];
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 f(P) {
455
+ for (var e = l.sqrt(P), t = 2; t <= e; t++)
456
+ if (!(P % t)) return !1;
457
457
  return !0;
458
458
  }
459
- function v(k) {
460
- return ((k - (k | 0)) * 4294967296) | 0;
459
+ function h(P) {
460
+ return ((P - (P | 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))),
462
+ for (var i = 2, d = 0; d < 64; )
463
+ f(i) &&
464
+ (d < 8 && (R[d] = h(l.pow(i, 1 / 2))),
465
+ (w[d] = h(l.pow(i, 1 / 3))),
466
466
  d++),
467
- s++;
467
+ i++;
468
468
  })();
469
- var g = [],
470
- b = (h.SHA256 = x.extend({
469
+ var v = [],
470
+ m = (B.SHA256 = O.extend({
471
471
  _doReset: function () {
472
- this._hash = new y.init(S.slice(0));
472
+ this._hash = new H.init(R.slice(0));
473
473
  },
474
- _doProcessBlock: function (p, v) {
474
+ _doProcessBlock: function (f, h) {
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
+ d = i[0],
478
+ P = i[1],
479
+ e = i[2],
480
+ t = i[3],
481
+ o = i[4],
482
+ c = i[5],
483
+ y = i[6],
484
+ _ = i[7],
485
+ x = 0;
486
+ x < 64;
487
+ x++
488
488
  ) {
489
- if (A < 16) g[A] = p[v + A] | 0;
489
+ if (x < 16) v[x] = f[h + x] | 0;
490
490
  else {
491
- var R = g[A - 15],
491
+ var C = v[x - 15],
492
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];
493
+ ((C << 25) | (C >>> 7)) ^
494
+ ((C << 14) | (C >>> 18)) ^
495
+ (C >>> 3),
496
+ $ = v[x - 2],
497
+ L =
498
+ (($ << 15) | ($ >>> 17)) ^
499
+ (($ << 13) | ($ >>> 19)) ^
500
+ ($ >>> 10);
501
+ v[x] = j + v[x - 7] + L + v[x - 16];
502
502
  }
503
- var Re = (a & l) ^ (~a & m),
504
- Pe = (d & k) ^ (d & e) ^ (k & e),
505
- Ee =
503
+ var ge = (o & c) ^ (~o & y),
504
+ me = (d & P) ^ (d & e) ^ (P & e),
505
+ _e =
506
506
  ((d << 30) | (d >>> 2)) ^
507
507
  ((d << 19) | (d >>> 13)) ^
508
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;
515
- (B = m),
516
- (m = l),
517
- (l = a),
518
- (a = (t + pe) | 0),
509
+ we =
510
+ ((o << 26) | (o >>> 6)) ^
511
+ ((o << 21) | (o >>> 11)) ^
512
+ ((o << 7) | (o >>> 25)),
513
+ se = _ + we + ge + w[x] + v[x],
514
+ be = _e + me;
515
+ (_ = y),
516
+ (y = c),
517
+ (c = o),
518
+ (o = (t + se) | 0),
519
519
  (t = e),
520
- (e = k),
521
- (k = d),
522
- (d = (pe + Te) | 0);
520
+ (e = P),
521
+ (P = d),
522
+ (d = (se + be) | 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] + d) | 0),
525
+ (i[1] = (i[1] + P) | 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] + c) | 0),
530
+ (i[6] = (i[6] + y) | 0),
531
+ (i[7] = (i[7] + _) | 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 f = this._data,
535
+ h = f.words,
536
+ i = this._nDataBytes * 8,
537
+ d = f.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
+ (h[d >>> 5] |= 128 << (24 - (d % 32))),
540
+ (h[(((d + 64) >>> 9) << 4) + 14] = l.floor(i / 4294967296)),
541
+ (h[(((d + 64) >>> 9) << 4) + 15] = i),
542
+ (f.sigBytes = h.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 f = O.clone.call(this);
549
+ return (f._hash = this._hash.clone()), f;
550
550
  },
551
551
  }));
552
- (_.SHA256 = x._createHelper(b)),
553
- (_.HmacSHA256 = x._createHmacHelper(b));
552
+ (b.SHA256 = O._createHelper(m)),
553
+ (b.HmacSHA256 = O._createHmacHelper(m));
554
554
  })(Math),
555
- o.SHA256
555
+ a.SHA256
556
556
  );
557
557
  });
558
- })(we);
559
- const _e = {
558
+ })(pe);
559
+ const ve = {
560
560
  environments: {
561
561
  production: {
562
562
  api: "https://api.monerium.app",
@@ -568,268 +568,184 @@ var P = (u, f, w) => (Q(u, f, "access private method"), w);
568
568
  },
569
569
  },
570
570
  };
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 {
571
+ class ye {
658
572
  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]);
573
+ T(this, A);
574
+ T(this, q);
575
+ T(this, F);
576
+ T(this, M);
577
+ T(this, E, void 0);
578
+ T(this, W, void 0);
579
+ I(this, "codeVerifier");
580
+ I(this, "bearerProfile");
581
+ I(this, "pkceRequest", (n) => this.getAuthFlowURI(n));
582
+ G(this, E, ve.environments[n]);
669
583
  }
670
584
  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" };
585
+ let a;
586
+ if (S(this, q, ae).call(this, n))
587
+ a = { ...n, grant_type: "authorization_code" };
588
+ else if (S(this, F, ue).call(this, n))
589
+ a = { ...n, grant_type: "refresh_token" };
590
+ else if (S(this, M, ce).call(this, n))
591
+ a = { ...n, grant_type: "client_credentials" };
678
592
  else throw new Error("Authentication method could not be detected.");
679
- (this.bearerProfile = await P(this, E, T).call(
593
+ (this.bearerProfile = await S(this, A, k).call(
680
594
  this,
681
595
  "post",
682
596
  "auth/token",
683
- new URLSearchParams(o),
597
+ new URLSearchParams(a),
684
598
  !0
685
599
  )),
686
- Z(this, W, `Bearer ${this.bearerProfile.access_token}`);
600
+ G(this, W, `Bearer ${this.bearerProfile.access_token}`);
687
601
  }
688
602
  getAuthFlowURI(n) {
689
- this.codeVerifier = J(64).toString("hex");
690
- const o = U.stringify(G(this.codeVerifier)),
691
- i = {
603
+ this.codeVerifier = new Array(128).join().replace(/(.|$)/g, function () {
604
+ return ((Math.random() * 36) | 0).toString(36);
605
+ });
606
+ const a = z.stringify(V(this.codeVerifier)),
607
+ l = {
692
608
  ...n,
693
609
  client_id: n == null ? void 0 : n.client_id,
694
- code_challenge: o,
610
+ code_challenge: a,
695
611
  code_challenge_method: "S256",
696
612
  response_type: "code",
697
613
  };
698
- return `${N(this, $).api}/auth?${new URLSearchParams(i)}`;
614
+ return `${D(this, E).api}/auth?${new URLSearchParams(l)}`;
699
615
  }
700
616
  getAuthContext() {
701
- return P(this, E, T).call(this, "get", "auth/context");
617
+ return S(this, A, k).call(this, "get", "auth/context");
702
618
  }
703
619
  getProfile(n) {
704
- return P(this, E, T).call(this, "get", `profiles/${n}`);
620
+ return S(this, A, k).call(this, "get", `profiles/${n}`);
705
621
  }
706
622
  getBalances(n) {
707
623
  return n
708
- ? P(this, E, T).call(this, "get", `profiles/${n}/balances`)
709
- : P(this, E, T).call(this, "get", "balances");
624
+ ? S(this, A, k).call(this, "get", `profiles/${n}/balances`)
625
+ : S(this, A, k).call(this, "get", "balances");
710
626
  }
711
627
  getOrders(n) {
712
- const o = new URLSearchParams(n);
713
- return P(this, E, T).call(this, "get", `orders?${o}`);
628
+ const a = new URLSearchParams(n);
629
+ return S(this, A, k).call(this, "get", `orders?${a}`);
714
630
  }
715
631
  getOrder(n) {
716
- return P(this, E, T).call(this, "get", `orders/${n}`);
632
+ return S(this, A, k).call(this, "get", `orders/${n}`);
717
633
  }
718
634
  getTokens() {
719
- return P(this, E, T).call(this, "get", "tokens");
635
+ return S(this, A, k).call(this, "get", "tokens");
720
636
  }
721
- linkAddress(n, o) {
722
- return P(this, E, T).call(
637
+ linkAddress(n, a) {
638
+ return S(this, A, k).call(
723
639
  this,
724
640
  "post",
725
641
  `profiles/${n}/addresses`,
726
- JSON.stringify(o)
642
+ JSON.stringify(a)
727
643
  );
728
644
  }
729
- placeOrder(n, o) {
730
- return o
731
- ? P(this, E, T).call(
645
+ placeOrder(n, a) {
646
+ return a
647
+ ? S(this, A, k).call(
732
648
  this,
733
649
  "post",
734
- `profiles/${o}/orders`,
650
+ `profiles/${a}/orders`,
735
651
  JSON.stringify(n)
736
652
  )
737
- : P(this, E, T).call(this, "post", "orders", JSON.stringify(n));
653
+ : S(this, A, k).call(this, "post", "orders", JSON.stringify(n));
738
654
  }
739
655
  uploadSupportingDocument(n) {
740
- const o = new URLSearchParams(n);
741
- return P(this, E, T).call(
656
+ const a = new URLSearchParams(n);
657
+ return S(this, A, k).call(
742
658
  this,
743
659
  "post",
744
660
  "files/supporting-document",
745
- o,
661
+ a,
746
662
  !0
747
663
  );
748
664
  }
749
665
  }
750
- ($ = new WeakMap()),
666
+ (E = new WeakMap()),
751
667
  (W = new WeakMap()),
752
- (E = new WeakSet()),
753
- (T = async function (n, o, i, _) {
754
- const c = await fetch(`${N(this, $).api}/${o}`, {
668
+ (A = new WeakSet()),
669
+ (k = async function (n, a, l, b) {
670
+ const p = await fetch(`${D(this, E).api}/${a}`, {
755
671
  method: n,
756
672
  headers: {
757
673
  "Content-Type": `application/${
758
- _ ? "x-www-form-urlencoded" : "json"
674
+ b ? "x-www-form-urlencoded" : "json"
759
675
  }`,
760
- Authorization: N(this, W) || "",
676
+ Authorization: D(this, W) || "",
761
677
  },
762
- body: i,
678
+ body: l,
763
679
  }),
764
- y = await c.json();
765
- if (c.ok) return y;
766
- throw y;
680
+ H = await p.json();
681
+ if (p.ok) return H;
682
+ throw H;
767
683
  }),
768
- (M = new WeakSet()),
769
- (de = function (n) {
684
+ (q = new WeakSet()),
685
+ (ae = function (n) {
770
686
  return n.code != null;
771
687
  }),
772
- (V = new WeakSet()),
773
- (he = function (n) {
688
+ (F = new WeakSet()),
689
+ (ue = function (n) {
774
690
  return n.refresh_token != null;
775
691
  }),
776
- (z = new WeakSet()),
777
- (ve = function (n) {
692
+ (M = new WeakSet()),
693
+ (ce = function (n) {
778
694
  return n.client_secret != null;
779
695
  });
780
- var te = ((r) => (
696
+ var X = ((r) => (
781
697
  (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 || {}
698
+ ))(X || {}),
699
+ Z = ((r) => ((r.corporate = "corporate"), (r.personal = "personal"), r))(
700
+ Z || {}
785
701
  ),
786
- oe = ((r) => ((r.read = "read"), (r.write = "write"), r))(oe || {}),
787
- ie = ((r) => (
702
+ K = ((r) => ((r.read = "read"), (r.write = "write"), r))(K || {}),
703
+ Y = ((r) => (
788
704
  (r.absent = "absent"),
789
705
  (r.submitted = "submitted"),
790
706
  (r.pending = "pending"),
791
707
  (r.confirmed = "confirmed"),
792
708
  r
793
- ))(ie || {}),
794
- se = ((r) => (
709
+ ))(Y || {}),
710
+ ee = ((r) => (
795
711
  (r.approved = "approved"),
796
712
  (r.rejected = "rejected"),
797
713
  (r.unknown = "unknown"),
798
714
  r
799
- ))(se || {}),
800
- ae = ((r) => ((r.iban = "iban"), (r.scan = "scan"), r))(ae || {}),
801
- ue = ((r) => (
715
+ ))(ee || {}),
716
+ re = ((r) => ((r.iban = "iban"), (r.scan = "scan"), r))(re || {}),
717
+ te = ((r) => (
802
718
  (r.polygon = "polygon"),
803
719
  (r.ethereum = "ethereum"),
804
720
  (r.gnosis = "gnosis"),
805
721
  r
806
- ))(ue || {}),
807
- fe = ((r) => (
722
+ ))(te || {}),
723
+ ne = ((r) => (
808
724
  (r.mainnet = "mainnet"),
809
725
  (r.chiado = "chiado"),
810
726
  (r.goerli = "goerli"),
811
727
  (r.mumbai = "mumbai"),
812
728
  r
813
- ))(fe || {}),
814
- ce = ((r) => ((r.redeem = "redeem"), (r.issue = "issue"), r))(ce || {}),
815
- le = ((r) => (
729
+ ))(ne || {}),
730
+ ie = ((r) => ((r.redeem = "redeem"), (r.issue = "issue"), r))(ie || {}),
731
+ oe = ((r) => (
816
732
  (r.placed = "placed"),
817
733
  (r.pending = "pending"),
818
734
  (r.processed = "processed"),
819
735
  (r.rejected = "rejected"),
820
736
  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" });
737
+ ))(oe || {});
738
+ (s.Chain = te),
739
+ (s.Currency = X),
740
+ (s.KYCOutcome = ee),
741
+ (s.KYCState = Y),
742
+ (s.MoneriumClient = ye),
743
+ (s.Network = ne),
744
+ (s.OrderKind = ie),
745
+ (s.OrderState = oe),
746
+ (s.PaymentStandard = re),
747
+ (s.Permission = K),
748
+ (s.ProfileType = Z),
749
+ Object.defineProperty(s, Symbol.toStringTag, { value: "Module" });
834
750
  });
835
751
  //# sourceMappingURL=index.umd.js.map