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