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