New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@monerium/sdk

Package Overview
Dependencies
Maintainers
2
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@monerium/sdk - npm Package Compare versions

Comparing version 2.0.0-alpha.10 to 2.0.0

819

dist/index.es.js
var ie = Object.defineProperty;
var se = (e, r, i) =>
r in e
? ie(e, r, { enumerable: !0, configurable: !0, writable: !0, value: i })
: (e[r] = i);
var q = (e, r, i) => (se(e, typeof r != "symbol" ? r + "" : r, i), i),
M = (e, r, i) => {
if (!r.has(e)) throw TypeError("Cannot " + i);
var oe = (e, t, i) =>
t in e
? ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: i })
: (e[t] = i);
var j = (e, t, i) => (oe(e, typeof t != "symbol" ? t + "" : t, i), i),
F = (e, t, i) => {
if (!t.has(e)) throw TypeError("Cannot " + i);
};
var T = (e, r, i) => (
M(e, r, "read from private field"), i ? i.call(e) : r.get(e)
var E = (e, t, i) => (
F(e, t, "read from private field"), i ? i.call(e) : t.get(e)
),
R = (e, r, i) => {
if (r.has(e))
P = (e, t, i) => {
if (t.has(e))
throw TypeError("Cannot add the same private member more than once");
r instanceof WeakSet ? r.add(e) : r.set(e, i);
t instanceof WeakSet ? t.add(e) : t.set(e, i);
},
F = (e, r, i, c) => (
M(e, r, "write to private field"), c ? c.call(e, i) : r.set(e, i), i
D = (e, t, i, c) => (
F(e, t, "write to private field"), c ? c.call(e, i) : t.set(e, i), i
);
var B = (e, r, i) => (M(e, r, "access private method"), i);
const oe = {
var x = (e, t, i) => (F(e, t, "access private method"), i);
const se = {
environments: {

@@ -34,3 +34,3 @@ production: {

};
var P =
var U =
typeof globalThis < "u"

@@ -47,4 +47,4 @@ ? globalThis

if (e.__esModule) return e;
var r = e.default;
if (typeof r == "function") {
var t = e.default;
if (typeof t == "function") {
var i = function c() {

@@ -54,8 +54,8 @@ if (this instanceof c) {

y.push.apply(y, arguments);
var d = Function.bind.apply(r, y);
return new d();
var p = Function.bind.apply(t, y);
return new p();
}
return r.apply(this, arguments);
return t.apply(this, arguments);
};
i.prototype = r.prototype;
i.prototype = t.prototype;
} else i = {};

@@ -82,9 +82,9 @@ return (

}
var D = {},
var M = {},
ce = {
get exports() {
return D;
return M;
},
set exports(e) {
D = e;
M = e;
},

@@ -99,13 +99,13 @@ };

}
var $ = {},
var L = {},
fe = {
get exports() {
return $;
return L;
},
set exports(e) {
$ = e;
L = e;
},
};
const le = {},
pe = /* @__PURE__ */ Object.freeze(
he = /* @__PURE__ */ Object.freeze(
/* @__PURE__ */ Object.defineProperty(

@@ -120,41 +120,41 @@ {

),
de = /* @__PURE__ */ ae(pe);
var X;
function N() {
pe = /* @__PURE__ */ ae(he);
var Q;
function G() {
return (
X ||
((X = 1),
(function (e, r) {
Q ||
((Q = 1),
(function (e, t) {
(function (i, c) {
e.exports = c();
})(P, function () {
})(U, function () {
var i =
i ||
(function (c, y) {
var d;
var p;
if (
(typeof window < "u" && window.crypto && (d = window.crypto),
typeof self < "u" && self.crypto && (d = self.crypto),
(typeof window < "u" && window.crypto && (p = window.crypto),
typeof self < "u" && self.crypto && (p = self.crypto),
typeof globalThis < "u" &&
globalThis.crypto &&
(d = globalThis.crypto),
!d &&
(p = globalThis.crypto),
!p &&
typeof window < "u" &&
window.msCrypto &&
(d = window.msCrypto),
!d && typeof P < "u" && P.crypto && (d = P.crypto),
!d && typeof ue == "function")
(p = window.msCrypto),
!p && typeof U < "u" && U.crypto && (p = U.crypto),
!p && typeof ue == "function")
)
try {
d = de;
p = pe;
} catch {}
var A = function () {
if (d) {
if (typeof d.getRandomValues == "function")
var R = function () {
if (p) {
if (typeof p.getRandomValues == "function")
try {
return d.getRandomValues(new Uint32Array(1))[0];
return p.getRandomValues(new Uint32Array(1))[0];
} catch {}
if (typeof d.randomBytes == "function")
if (typeof p.randomBytes == "function")
try {
return d.randomBytes(4).readInt32LE();
return p.randomBytes(4).readInt32LE();
} catch {}

@@ -166,13 +166,13 @@ }

},
j =
k =
Object.create ||
(function () {
function t() {}
function r() {}
return function (n) {
var o;
var s;
return (
(t.prototype = n),
(o = new t()),
(t.prototype = null),
o
(r.prototype = n),
(s = new r()),
(r.prototype = null),
s
);

@@ -183,8 +183,8 @@ };

w = (a.lib = {}),
v = (w.Base = (function () {
d = (w.Base = (function () {
return {
extend: function (t) {
var n = j(this);
extend: function (r) {
var n = k(this);
return (
t && n.mixIn(t),
r && n.mixIn(r),
(!n.hasOwnProperty("init") || this.init === n.init) &&

@@ -200,10 +200,10 @@ (n.init = function () {

create: function () {
var t = this.extend();
return t.init.apply(t, arguments), t;
var r = this.extend();
return r.init.apply(r, arguments), r;
},
init: function () {},
mixIn: function (t) {
for (var n in t) t.hasOwnProperty(n) && (this[n] = t[n]);
t.hasOwnProperty("toString") &&
(this.toString = t.toString);
mixIn: function (r) {
for (var n in r) r.hasOwnProperty(n) && (this[n] = r[n]);
r.hasOwnProperty("toString") &&
(this.toString = r.toString);
},

@@ -215,86 +215,86 @@ clone: function () {

})()),
l = (w.WordArray = v.extend({
init: function (t, n) {
(t = this.words = t || []),
l = (w.WordArray = d.extend({
init: function (r, n) {
(r = this.words = r || []),
n != y
? (this.sigBytes = n)
: (this.sigBytes = t.length * 4);
: (this.sigBytes = r.length * 4);
},
toString: function (t) {
return (t || f).stringify(this);
toString: function (r) {
return (r || f).stringify(this);
},
concat: function (t) {
concat: function (r) {
var n = this.words,
o = t.words,
s = r.words,
u = this.sigBytes,
g = t.sigBytes;
g = r.sigBytes;
if ((this.clamp(), u % 4))
for (var _ = 0; _ < g; _++) {
var b = (o[_ >>> 2] >>> (24 - (_ % 4) * 8)) & 255;
n[(u + _) >>> 2] |= b << (24 - ((u + _) % 4) * 8);
for (var m = 0; m < g; m++) {
var b = (s[m >>> 2] >>> (24 - (m % 4) * 8)) & 255;
n[(u + m) >>> 2] |= b << (24 - ((u + m) % 4) * 8);
}
else
for (var x = 0; x < g; x += 4)
n[(u + x) >>> 2] = o[x >>> 2];
for (var B = 0; B < g; B += 4)
n[(u + B) >>> 2] = s[B >>> 2];
return (this.sigBytes += g), this;
},
clamp: function () {
var t = this.words,
var r = this.words,
n = this.sigBytes;
(t[n >>> 2] &= 4294967295 << (32 - (n % 4) * 8)),
(t.length = c.ceil(n / 4));
(r[n >>> 2] &= 4294967295 << (32 - (n % 4) * 8)),
(r.length = c.ceil(n / 4));
},
clone: function () {
var t = v.clone.call(this);
return (t.words = this.words.slice(0)), t;
var r = d.clone.call(this);
return (r.words = this.words.slice(0)), r;
},
random: function (t) {
for (var n = [], o = 0; o < t; o += 4) n.push(A());
return new l.init(n, t);
random: function (r) {
for (var n = [], s = 0; s < r; s += 4) n.push(R());
return new l.init(n, r);
},
})),
m = (a.enc = {}),
f = (m.Hex = {
stringify: function (t) {
_ = (a.enc = {}),
f = (_.Hex = {
stringify: function (r) {
for (
var n = t.words, o = t.sigBytes, u = [], g = 0;
g < o;
var n = r.words, s = r.sigBytes, u = [], g = 0;
g < s;
g++
) {
var _ = (n[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
u.push((_ >>> 4).toString(16)),
u.push((_ & 15).toString(16));
var m = (n[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
u.push((m >>> 4).toString(16)),
u.push((m & 15).toString(16));
}
return u.join("");
},
parse: function (t) {
for (var n = t.length, o = [], u = 0; u < n; u += 2)
o[u >>> 3] |=
parseInt(t.substr(u, 2), 16) << (24 - (u % 8) * 4);
return new l.init(o, n / 2);
parse: function (r) {
for (var n = r.length, s = [], u = 0; u < n; u += 2)
s[u >>> 3] |=
parseInt(r.substr(u, 2), 16) << (24 - (u % 8) * 4);
return new l.init(s, n / 2);
},
}),
h = (m.Latin1 = {
stringify: function (t) {
v = (_.Latin1 = {
stringify: function (r) {
for (
var n = t.words, o = t.sigBytes, u = [], g = 0;
g < o;
var n = r.words, s = r.sigBytes, u = [], g = 0;
g < s;
g++
) {
var _ = (n[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
u.push(String.fromCharCode(_));
var m = (n[g >>> 2] >>> (24 - (g % 4) * 8)) & 255;
u.push(String.fromCharCode(m));
}
return u.join("");
},
parse: function (t) {
for (var n = t.length, o = [], u = 0; u < n; u++)
o[u >>> 2] |=
(t.charCodeAt(u) & 255) << (24 - (u % 4) * 8);
return new l.init(o, n);
parse: function (r) {
for (var n = r.length, s = [], u = 0; u < n; u++)
s[u >>> 2] |=
(r.charCodeAt(u) & 255) << (24 - (u % 4) * 8);
return new l.init(s, n);
},
}),
s = (m.Utf8 = {
stringify: function (t) {
o = (_.Utf8 = {
stringify: function (r) {
try {
return decodeURIComponent(escape(h.stringify(t)));
return decodeURIComponent(escape(v.stringify(r)));
} catch {

@@ -304,31 +304,31 @@ throw new Error("Malformed UTF-8 data");

},
parse: function (t) {
return h.parse(unescape(encodeURIComponent(t)));
parse: function (r) {
return v.parse(unescape(encodeURIComponent(r)));
},
}),
p = (w.BufferedBlockAlgorithm = v.extend({
h = (w.BufferedBlockAlgorithm = d.extend({
reset: function () {
(this._data = new l.init()), (this._nDataBytes = 0);
},
_append: function (t) {
typeof t == "string" && (t = s.parse(t)),
this._data.concat(t),
(this._nDataBytes += t.sigBytes);
_append: function (r) {
typeof r == "string" && (r = o.parse(r)),
this._data.concat(r),
(this._nDataBytes += r.sigBytes);
},
_process: function (t) {
_process: function (r) {
var n,
o = this._data,
u = o.words,
g = o.sigBytes,
_ = this.blockSize,
b = _ * 4,
x = g / b;
t
? (x = c.ceil(x))
: (x = c.max((x | 0) - this._minBufferSize, 0));
var U = x * _,
H = c.min(U * 4, g);
if (U) {
for (var O = 0; O < U; O += _) this._doProcessBlock(u, O);
(n = u.splice(0, U)), (o.sigBytes -= H);
s = this._data,
u = s.words,
g = s.sigBytes,
m = this.blockSize,
b = m * 4,
B = g / b;
r
? (B = c.ceil(B))
: (B = c.max((B | 0) - this._minBufferSize, 0));
var W = B * m,
H = c.min(W * 4, g);
if (W) {
for (var $ = 0; $ < W; $ += m) this._doProcessBlock(u, $);
(n = u.splice(0, W)), (s.sigBytes -= H);
}

@@ -338,20 +338,20 @@ return new l.init(n, H);

clone: function () {
var t = v.clone.call(this);
return (t._data = this._data.clone()), t;
var r = d.clone.call(this);
return (r._data = this._data.clone()), r;
},
_minBufferSize: 0,
}));
w.Hasher = p.extend({
cfg: v.extend(),
init: function (t) {
(this.cfg = this.cfg.extend(t)), this.reset();
w.Hasher = h.extend({
cfg: d.extend(),
init: function (r) {
(this.cfg = this.cfg.extend(r)), this.reset();
},
reset: function () {
p.reset.call(this), this._doReset();
h.reset.call(this), this._doReset();
},
update: function (t) {
return this._append(t), this._process(), this;
update: function (r) {
return this._append(r), this._process(), this;
},
finalize: function (t) {
t && this._append(t);
finalize: function (r) {
r && this._append(r);
var n = this._doFinalize();

@@ -361,10 +361,10 @@ return n;

blockSize: 16,
_createHelper: function (t) {
return function (n, o) {
return new t.init(o).finalize(n);
_createHelper: function (r) {
return function (n, s) {
return new r.init(s).finalize(n);
};
},
_createHmacHelper: function (t) {
return function (n, o) {
return new C.HMAC.init(t, o).finalize(n);
_createHmacHelper: function (r) {
return function (n, s) {
return new C.HMAC.init(r, s).finalize(n);
};

@@ -379,9 +379,9 @@ },

})(fe)),
$
L
);
}
(function (e, r) {
(function (e, t) {
(function (i, c) {
e.exports = c(N());
})(P, function (i) {
e.exports = c(G());
})(U, function (i) {
return (

@@ -391,39 +391,39 @@ (function () {

y = c.lib,
d = y.WordArray,
A = c.enc;
A.Base64url = {
p = y.WordArray,
R = c.enc;
R.Base64url = {
stringify: function (a, w = !0) {
var v = a.words,
var d = a.words,
l = a.sigBytes,
m = w ? this._safe_map : this._map;
_ = w ? this._safe_map : this._map;
a.clamp();
for (var f = [], h = 0; h < l; h += 3)
for (var f = [], v = 0; v < l; v += 3)
for (
var s = (v[h >>> 2] >>> (24 - (h % 4) * 8)) & 255,
p = (v[(h + 1) >>> 2] >>> (24 - ((h + 1) % 4) * 8)) & 255,
C = (v[(h + 2) >>> 2] >>> (24 - ((h + 2) % 4) * 8)) & 255,
t = (s << 16) | (p << 8) | C,
var o = (d[v >>> 2] >>> (24 - (v % 4) * 8)) & 255,
h = (d[(v + 1) >>> 2] >>> (24 - ((v + 1) % 4) * 8)) & 255,
C = (d[(v + 2) >>> 2] >>> (24 - ((v + 2) % 4) * 8)) & 255,
r = (o << 16) | (h << 8) | C,
n = 0;
n < 4 && h + n * 0.75 < l;
n < 4 && v + n * 0.75 < l;
n++
)
f.push(m.charAt((t >>> (6 * (3 - n))) & 63));
var o = m.charAt(64);
if (o) for (; f.length % 4; ) f.push(o);
f.push(_.charAt((r >>> (6 * (3 - n))) & 63));
var s = _.charAt(64);
if (s) for (; f.length % 4; ) f.push(s);
return f.join("");
},
parse: function (a, w = !0) {
var v = a.length,
var d = a.length,
l = w ? this._safe_map : this._map,
m = this._reverseMap;
if (!m) {
m = this._reverseMap = [];
for (var f = 0; f < l.length; f++) m[l.charCodeAt(f)] = f;
_ = this._reverseMap;
if (!_) {
_ = this._reverseMap = [];
for (var f = 0; f < l.length; f++) _[l.charCodeAt(f)] = f;
}
var h = l.charAt(64);
if (h) {
var s = a.indexOf(h);
s !== -1 && (v = s);
var v = l.charAt(64);
if (v) {
var o = a.indexOf(v);
o !== -1 && (d = o);
}
return j(a, v, m);
return k(a, d, _);
},

@@ -434,11 +434,11 @@ _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

};
function j(a, w, v) {
for (var l = [], m = 0, f = 0; f < w; f++)
function k(a, w, d) {
for (var l = [], _ = 0, f = 0; f < w; f++)
if (f % 4) {
var h = v[a.charCodeAt(f - 1)] << ((f % 4) * 2),
s = v[a.charCodeAt(f)] >>> (6 - (f % 4) * 2),
p = h | s;
(l[m >>> 2] |= p << (24 - (m % 4) * 8)), m++;
var v = d[a.charCodeAt(f - 1)] << ((f % 4) * 2),
o = d[a.charCodeAt(f)] >>> (6 - (f % 4) * 2),
h = v | o;
(l[_ >>> 2] |= h << (24 - (_ % 4) * 8)), _++;
}
return d.create(l, m);
return p.create(l, _);
}

@@ -451,3 +451,3 @@ })(),

var V = {},
he = {
ve = {
get exports() {

@@ -460,46 +460,46 @@ return V;

};
(function (e, r) {
(function (e, t) {
(function (i, c) {
e.exports = c(N());
})(P, function (i) {
e.exports = c(G());
})(U, function (i) {
return (
(function (c) {
var y = i,
d = y.lib,
A = d.WordArray,
j = d.Hasher,
p = y.lib,
R = p.WordArray,
k = p.Hasher,
a = y.algo,
w = [],
v = [];
d = [];
(function () {
function f(C) {
for (var t = c.sqrt(C), n = 2; n <= t; n++) if (!(C % n)) return !1;
for (var r = c.sqrt(C), n = 2; n <= r; n++) if (!(C % n)) return !1;
return !0;
}
function h(C) {
function v(C) {
return ((C - (C | 0)) * 4294967296) | 0;
}
for (var s = 2, p = 0; p < 64; )
f(s) &&
(p < 8 && (w[p] = h(c.pow(s, 1 / 2))),
(v[p] = h(c.pow(s, 1 / 3))),
p++),
s++;
for (var o = 2, h = 0; h < 64; )
f(o) &&
(h < 8 && (w[h] = v(c.pow(o, 1 / 2))),
(d[h] = v(c.pow(o, 1 / 3))),
h++),
o++;
})();
var l = [],
m = (a.SHA256 = j.extend({
_ = (a.SHA256 = k.extend({
_doReset: function () {
this._hash = new A.init(w.slice(0));
this._hash = new R.init(w.slice(0));
},
_doProcessBlock: function (f, h) {
_doProcessBlock: function (f, v) {
for (
var s = this._hash.words,
p = s[0],
C = s[1],
t = s[2],
n = s[3],
o = s[4],
u = s[5],
g = s[6],
_ = s[7],
var o = this._hash.words,
h = o[0],
C = o[1],
r = o[2],
n = o[3],
s = o[4],
u = o[5],
g = o[6],
m = o[7],
b = 0;

@@ -509,56 +509,56 @@ b < 64;

) {
if (b < 16) l[b] = f[h + b] | 0;
if (b < 16) l[b] = f[v + b] | 0;
else {
var x = l[b - 15],
U =
((x << 25) | (x >>> 7)) ^
((x << 14) | (x >>> 18)) ^
(x >>> 3),
var B = l[b - 15],
W =
((B << 25) | (B >>> 7)) ^
((B << 14) | (B >>> 18)) ^
(B >>> 3),
H = l[b - 2],
O =
$ =
((H << 15) | (H >>> 17)) ^
((H << 13) | (H >>> 19)) ^
(H >>> 10);
l[b] = U + l[b - 7] + O + l[b - 16];
l[b] = W + l[b - 7] + $ + l[b - 16];
}
var Y = (o & u) ^ (~o & g),
ee = (p & C) ^ (p & t) ^ (C & t),
var Y = (s & u) ^ (~s & g),
ee = (h & C) ^ (h & r) ^ (C & r),
re =
((h << 30) | (h >>> 2)) ^
((h << 19) | (h >>> 13)) ^
((h << 10) | (h >>> 22)),
te =
((p << 30) | (p >>> 2)) ^
((p << 19) | (p >>> 13)) ^
((p << 10) | (p >>> 22)),
re =
((o << 26) | (o >>> 6)) ^
((o << 21) | (o >>> 11)) ^
((o << 7) | (o >>> 25)),
J = _ + re + Y + v[b] + l[b],
ne = te + ee;
(_ = g),
((s << 26) | (s >>> 6)) ^
((s << 21) | (s >>> 11)) ^
((s << 7) | (s >>> 25)),
J = m + te + Y + d[b] + l[b],
ne = re + ee;
(m = g),
(g = u),
(u = o),
(o = (n + J) | 0),
(n = t),
(t = C),
(C = p),
(p = (J + ne) | 0);
(u = s),
(s = (n + J) | 0),
(n = r),
(r = C),
(C = h),
(h = (J + ne) | 0);
}
(s[0] = (s[0] + p) | 0),
(s[1] = (s[1] + C) | 0),
(s[2] = (s[2] + t) | 0),
(s[3] = (s[3] + n) | 0),
(s[4] = (s[4] + o) | 0),
(s[5] = (s[5] + u) | 0),
(s[6] = (s[6] + g) | 0),
(s[7] = (s[7] + _) | 0);
(o[0] = (o[0] + h) | 0),
(o[1] = (o[1] + C) | 0),
(o[2] = (o[2] + r) | 0),
(o[3] = (o[3] + n) | 0),
(o[4] = (o[4] + s) | 0),
(o[5] = (o[5] + u) | 0),
(o[6] = (o[6] + g) | 0),
(o[7] = (o[7] + m) | 0);
},
_doFinalize: function () {
var f = this._data,
h = f.words,
s = this._nDataBytes * 8,
p = f.sigBytes * 8;
v = f.words,
o = this._nDataBytes * 8,
h = f.sigBytes * 8;
return (
(h[p >>> 5] |= 128 << (24 - (p % 32))),
(h[(((p + 64) >>> 9) << 4) + 14] = c.floor(s / 4294967296)),
(h[(((p + 64) >>> 9) << 4) + 15] = s),
(f.sigBytes = h.length * 4),
(v[h >>> 5] |= 128 << (24 - (h % 32))),
(v[(((h + 64) >>> 9) << 4) + 14] = c.floor(o / 4294967296)),
(v[(((h + 64) >>> 9) << 4) + 15] = o),
(f.sigBytes = v.length * 4),
this._process(),

@@ -569,8 +569,8 @@ this._hash

clone: function () {
var f = j.clone.call(this);
var f = k.clone.call(this);
return (f._hash = this._hash.clone()), f;
},
}));
(y.SHA256 = j._createHelper(m)),
(y.HmacSHA256 = j._createHmacHelper(m));
(y.SHA256 = k._createHelper(_)),
(y.HmacSHA256 = k._createHmacHelper(_));
})(Math),

@@ -580,16 +580,16 @@ i.SHA256

});
})(he);
var G = {},
ve = {
})(ve);
var N = {},
de = {
get exports() {
return G;
return N;
},
set exports(e) {
G = e;
N = e;
},
};
(function (e, r) {
(function (e, t) {
(function (i, c) {
e.exports = c(N());
})(P, function (i) {
e.exports = c(G());
})(U, function (i) {
return (

@@ -600,5 +600,5 @@ (function () {

y = c.lib,
d = y.WordArray,
A = d.init,
j = (d.init = function (a) {
p = y.WordArray,
R = p.init,
k = (p.init = function (a) {
if (

@@ -618,8 +618,8 @@ (a instanceof ArrayBuffer && (a = new Uint8Array(a)),

) {
for (var w = a.byteLength, v = [], l = 0; l < w; l++)
v[l >>> 2] |= a[l] << (24 - (l % 4) * 8);
A.call(this, v, w);
} else A.apply(this, arguments);
for (var w = a.byteLength, d = [], l = 0; l < w; l++)
d[l >>> 2] |= a[l] << (24 - (l % 4) * 8);
R.call(this, d, w);
} else R.apply(this, arguments);
});
j.prototype = d;
k.prototype = p;
}

@@ -630,86 +630,26 @@ })(),

});
})(ve);
const ge = "@monerium/sdk",
ye = "2.0.0-alpha.10",
me = "Vite TypeScript library npm package template",
_e = "ISC",
we = "dist/index.cjs.js",
be = "dist/index.es.js",
xe = "dist/index.d.ts",
Be = ["dist"],
Ce = {
node: "18.x",
},
ke = {
build:
"tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",
clean: "rm -rf dist",
docs: "typedoc src/index.ts --out docs",
format: "prettier . --write",
lint: "eslint . --ext .ts",
prepare: "husky install",
prepublish: "yarn lint && yarn format && yarn test",
start: "vite --host --open",
test: "jest",
"test:coverage": "jest --coverage",
watch: "tsc && vite build --watch",
},
Se = {
"@types/crypto-js": "^4.1.1",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0",
"crypto-js": "^4.1.1",
"dts-bundle-generator": "^7.1.0",
eslint: "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^27.1.7",
"eslint-plugin-prettier": "^4.2.1",
husky: "^8.0.2",
jest: "^29.3.1",
prettier: "^2.8.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
tslib: "^2.4.1",
typedoc: "^0.23.23",
typescript: "^4.9.4",
vite: "^4.0.0",
},
Ae = {
name: ge,
version: ye,
description: me,
license: _e,
main: we,
module: be,
types: xe,
files: Be,
engines: Ce,
scripts: ke,
devDependencies: Se,
};
var W, z, k, S, L, Q, E, Z, I, K;
class Ee {
constructor(r = "sandbox") {
R(this, k);
R(this, L);
R(this, E);
R(this, I);
R(this, W, void 0);
R(this, z, void 0);
q(this, "codeVerifier");
q(this, "bearerProfile");
F(this, W, oe.environments[r]);
})(de);
var O, z, S, A, T, X, q, Z, I, K;
class Re {
constructor(t = "sandbox") {
P(this, S);
P(this, T);
P(this, q);
P(this, I);
P(this, O, void 0);
P(this, z, void 0);
j(this, "codeVerifier");
j(this, "bearerProfile");
D(this, O, se.environments[t]);
}
async auth(r) {
async auth(t) {
let i;
if (B(this, L, Q).call(this, r))
i = { ...r, grant_type: "authorization_code" };
else if (B(this, E, Z).call(this, r))
i = { ...r, grant_type: "refresh_token" };
else if (B(this, I, K).call(this, r))
i = { ...r, grant_type: "client_credentials" };
if (x(this, T, X).call(this, t))
i = { ...t, grant_type: "authorization_code" };
else if (x(this, q, Z).call(this, t))
i = { ...t, grant_type: "refresh_token" };
else if (x(this, I, K).call(this, t))
i = { ...t, grant_type: "client_credentials" };
else throw new Error("Authentication method could not be detected.");
(this.bearerProfile = await B(this, k, S).call(
(this.bearerProfile = await x(this, S, A).call(
this,

@@ -721,9 +661,9 @@ "post",

)),
F(this, z, `Bearer ${this.bearerProfile.access_token}`);
D(this, z, `Bearer ${this.bearerProfile.access_token}`);
}
pkceRequest(r) {
this.codeVerifier = G.random(64).toString();
const i = D.stringify(V(this.codeVerifier)),
pkceRequest(t) {
this.codeVerifier = N.random(64).toString();
const i = M.stringify(V(this.codeVerifier)),
c = {
...r,
...t,
code_challenge: i,

@@ -733,89 +673,86 @@ code_challenge_method: "S256",

};
return `${T(this, W).api}/auth?${new URLSearchParams(c)}`;
return `${E(this, O).api}/auth?${new URLSearchParams(c)}`;
}
getAuthContext() {
return B(this, k, S).call(this, "get", "auth/context");
return x(this, S, A).call(this, "get", "auth/context");
}
getProfile(r) {
return B(this, k, S).call(this, "get", `profiles/${r}`);
getProfile(t) {
return x(this, S, A).call(this, "get", `profiles/${t}`);
}
getBalances(r) {
return r
? B(this, k, S).call(this, "get", `profiles/${r}/balances`)
: B(this, k, S).call(this, "get", "balances");
getBalances(t) {
return t
? x(this, S, A).call(this, "get", `profiles/${t}/balances`)
: x(this, S, A).call(this, "get", "balances");
}
getOrders(r) {
const i = new URLSearchParams(r);
return B(this, k, S).call(this, "get", `orders?${i}`);
getOrders(t) {
const i = new URLSearchParams(t);
return x(this, S, A).call(this, "get", `orders?${i}`);
}
getOrder(r) {
return B(this, k, S).call(this, "get", `orders/${r}`);
getOrder(t) {
return x(this, S, A).call(this, "get", `orders/${t}`);
}
getTokens() {
return B(this, k, S).call(this, "get", "tokens");
return x(this, S, A).call(this, "get", "tokens");
}
linkAddress(r, i) {
return B(this, k, S).call(
linkAddress(t, i) {
return x(this, S, A).call(
this,
"post",
`profiles/${r}/addresses`,
`profiles/${t}/addresses`,
JSON.stringify(i)
);
}
placeOrder(r, i) {
placeOrder(t, i) {
return i
? B(this, k, S).call(
? x(this, S, A).call(
this,
"post",
`profiles/${i}/orders`,
JSON.stringify(r)
JSON.stringify(t)
)
: B(this, k, S).call(this, "post", "orders", JSON.stringify(r));
: x(this, S, A).call(this, "post", "orders", JSON.stringify(t));
}
uploadSupportingDocument(r) {
const i = new URLSearchParams(r);
return B(this, k, S).call(this, "post", "files/supporting-document", i, !0);
uploadSupportingDocument(t) {
const i = new URLSearchParams(t);
return x(this, S, A).call(this, "post", "files/supporting-document", i, !0);
}
}
(W = new WeakMap()),
(O = new WeakMap()),
(z = new WeakMap()),
(k = new WeakSet()),
(S = async function (r, i, c, y) {
const d = await fetch(`${T(this, W).api}/${i}`, {
method: r,
(S = new WeakSet()),
(A = async function (t, i, c, y) {
const p = await fetch(`${E(this, O).api}/${i}`, {
method: t,
headers: {
"Content-Type": `application/${y ? "x-www-form-urlencoded" : "json"}`,
Authorization: T(this, z) || "",
"user-agent":
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 sdk/" +
Ae.version,
Authorization: E(this, z) || "",
},
body: c,
}),
A = await d.json();
if (d.ok) return A;
throw A;
R = await p.json();
if (p.ok) return R;
throw R;
}),
(L = new WeakSet()),
(Q = function (r) {
return r.code != null;
(T = new WeakSet()),
(X = function (t) {
return t.code != null;
}),
(E = new WeakSet()),
(Z = function (r) {
return r.refresh_token != null;
(q = new WeakSet()),
(Z = function (t) {
return t.refresh_token != null;
}),
(I = new WeakSet()),
(K = function (r) {
return r.client_secret != null;
(K = function (t) {
return t.client_secret != null;
});
var je = /* @__PURE__ */ ((e) => (
var ge = /* @__PURE__ */ ((e) => (
(e.eur = "eur"), (e.usd = "usd"), (e.gbp = "gbp"), (e.isk = "isk"), e
))(je || {}),
He = /* @__PURE__ */ ((e) => (
))(ge || {}),
ye = /* @__PURE__ */ ((e) => (
(e.corporate = "corporate"), (e.personal = "personal"), e
))(He || {}),
Re = /* @__PURE__ */ ((e) => ((e.read = "read"), (e.write = "write"), e))(
Re || {}
))(ye || {}),
_e = /* @__PURE__ */ ((e) => ((e.read = "read"), (e.write = "write"), e))(
_e || {}
),
Pe = /* @__PURE__ */ ((e) => (
me = /* @__PURE__ */ ((e) => (
(e.absent = "absent"),

@@ -826,4 +763,4 @@ (e.submitted = "submitted"),

e
))(Pe || {}),
Ue = /* @__PURE__ */ ((e) => (
))(me || {}),
we = /* @__PURE__ */ ((e) => (
(e.approved = "approved"),

@@ -833,10 +770,10 @@ (e.rejected = "rejected"),

e
))(Ue || {}),
We = /* @__PURE__ */ ((e) => ((e.iban = "iban"), (e.scan = "scan"), e))(
We || {}
))(we || {}),
be = /* @__PURE__ */ ((e) => ((e.iban = "iban"), (e.scan = "scan"), e))(
be || {}
),
Oe = /* @__PURE__ */ ((e) => (
Be = /* @__PURE__ */ ((e) => (
(e.polygon = "polygon"), (e.ethereum = "ethereum"), (e.gnosis = "gnosis"), e
))(Oe || {}),
ze = /* @__PURE__ */ ((e) => (
))(Be || {}),
xe = /* @__PURE__ */ ((e) => (
(e.mainnet = "mainnet"),

@@ -847,7 +784,7 @@ (e.chiado = "chiado"),

e
))(ze || {}),
Te = /* @__PURE__ */ ((e) => ((e.redeem = "redeem"), (e.issue = "issue"), e))(
Te || {}
))(xe || {}),
Ce = /* @__PURE__ */ ((e) => ((e.redeem = "redeem"), (e.issue = "issue"), e))(
Ce || {}
),
$e = /* @__PURE__ */ ((e) => (
Se = /* @__PURE__ */ ((e) => (
(e.placed = "placed"),

@@ -858,16 +795,16 @@ (e.pending = "pending"),

e
))($e || {});
))(Se || {});
export {
Oe as Chain,
je as Currency,
Ue as KYCOutcome,
Pe as KYCState,
Ee as MoneriumClient,
ze as Network,
Te as OrderKind,
$e as OrderState,
We as PaymentStandard,
Re as Permission,
He as ProfileType,
Be as Chain,
ge as Currency,
we as KYCOutcome,
me as KYCState,
Re as MoneriumClient,
xe as Network,
Ce as OrderKind,
Se as OrderState,
be as PaymentStandard,
_e as Permission,
ye as ProfileType,
};
//# sourceMappingURL=index.es.js.map

@@ -1,33 +0,33 @@

var Se = Object.defineProperty;
var ke = (a, h, y) =>
h in a
? Se(a, h, { enumerable: !0, configurable: !0, writable: !0, value: y })
: (a[h] = y);
var J = (a, h, y) => (ke(a, typeof h != "symbol" ? h + "" : h, y), y),
X = (a, h, y) => {
if (!h.has(a)) throw TypeError("Cannot " + y);
var Ce = Object.defineProperty;
var Se = (s, p, y) =>
p in s
? Ce(s, p, { enumerable: !0, configurable: !0, writable: !0, value: y })
: (s[p] = y);
var J = (s, p, y) => (Se(s, typeof p != "symbol" ? p + "" : p, y), y),
Q = (s, p, y) => {
if (!p.has(s)) throw TypeError("Cannot " + y);
};
var D = (a, h, y) => (
X(a, h, "read from private field"), y ? y.call(a) : h.get(a)
var M = (s, p, y) => (
Q(s, p, "read from private field"), y ? y.call(s) : p.get(s)
),
T = (a, h, y) => {
if (h.has(a))
U = (s, p, y) => {
if (p.has(s))
throw TypeError("Cannot add the same private member more than once");
h instanceof WeakSet ? h.add(a) : h.set(a, y);
p instanceof WeakSet ? p.add(s) : p.set(s, y);
},
K = (a, h, y, E) => (
X(a, h, "write to private field"), E ? E.call(a, y) : h.set(a, y), y
X = (s, p, y, L) => (
Q(s, p, "write to private field"), L ? L.call(s, y) : p.set(s, y), y
);
var k = (a, h, y) => (X(a, h, "access private method"), y);
(function (a, h) {
var P = (s, p, y) => (Q(s, p, "access private method"), y);
(function (s, p) {
typeof exports == "object" && typeof module < "u"
? h(exports)
? p(exports)
: typeof define == "function" && define.amd
? define(["exports"], h)
: ((a = typeof globalThis < "u" ? globalThis : a || self),
h((a["monerium-sdk"] = {})));
})(this, function (a) {
var U, $, j, A, I, ue, M, fe, q, le;
? define(["exports"], p)
: ((s = typeof globalThis < "u" ? globalThis : s || self),
p((s["monerium-sdk"] = {})));
})(this, function (s) {
var W, E, k, R, q, fe, I, ce, F, le;
("use strict");
const h = {
const p = {
environments: {

@@ -54,8 +54,8 @@ production: {

: {};
function E(t) {
if (t.__esModule) return t;
var n = t.default;
function L(r) {
if (r.__esModule) return r;
var n = r.default;
if (typeof n == "function") {
var o = function u() {
if (this instanceof u) {
var a = function f() {
if (this instanceof f) {
var w = [null];

@@ -68,11 +68,11 @@ w.push.apply(w, arguments);

};
o.prototype = n.prototype;
} else o = {};
a.prototype = n.prototype;
} else a = {};
return (
Object.defineProperty(o, "__esModule", { value: !0 }),
Object.keys(t).forEach(function (u) {
var w = Object.getOwnPropertyDescriptor(t, u);
Object.defineProperty(a, "__esModule", { value: !0 }),
Object.keys(r).forEach(function (f) {
var w = Object.getOwnPropertyDescriptor(r, f);
Object.defineProperty(
o,
u,
a,
f,
w.get

@@ -83,3 +83,3 @@ ? w

get: function () {
return t[u];
return r[f];
},

@@ -89,31 +89,31 @@ }

}),
o
a
);
}
var F = {},
de = {
var D = {},
he = {
get exports() {
return F;
return D;
},
set exports(t) {
F = t;
set exports(r) {
D = r;
},
};
function pe(t) {
function de(r) {
throw new Error(
'Could not dynamically require "' +
t +
r +
'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'
);
}
var L = {},
he = {
var j = {},
pe = {
get exports() {
return L;
return j;
},
set exports(t) {
L = t;
set exports(r) {
j = r;
},
};
const ve = E(
const ve = L(
Object.freeze(

@@ -127,14 +127,14 @@ Object.defineProperty(

);
var Q;
var Z;
function V() {
return (
Q ||
((Q = 1),
(function (t, n) {
(function (o, u) {
t.exports = u();
Z ||
((Z = 1),
(function (r, n) {
(function (a, f) {
r.exports = f();
})(y, function () {
var o =
o ||
(function (u, w) {
var a =
a ||
(function (f, w) {
var v;

@@ -152,3 +152,3 @@ if (

!v && typeof y < "u" && y.crypto && (v = y.crypto),
!v && typeof pe == "function")
!v && typeof de == "function")
)

@@ -173,31 +173,31 @@ try {

},
R =
O =
Object.create ||
(function () {
function e() {}
return function (r) {
var s;
return function (t) {
var o;
return (
(e.prototype = r),
(s = new e()),
(e.prototype = t),
(o = new e()),
(e.prototype = null),
s
o
);
};
})(),
c = {},
x = (c.lib = {}),
u = {},
x = (u.lib = {}),
m = (x.Base = (function () {
return {
extend: function (e) {
var r = R(this);
var t = O(this);
return (
e && r.mixIn(e),
(!r.hasOwnProperty("init") || this.init === r.init) &&
(r.init = function () {
r.$super.init.apply(this, arguments);
e && t.mixIn(e),
(!t.hasOwnProperty("init") || this.init === t.init) &&
(t.init = function () {
t.$super.init.apply(this, arguments);
}),
(r.init.prototype = r),
(r.$super = this),
r
(t.init.prototype = t),
(t.$super = this),
t
);

@@ -211,4 +211,4 @@ },

mixIn: function (e) {
for (var r in e)
e.hasOwnProperty(r) && (this[r] = e[r]);
for (var t in e)
e.hasOwnProperty(t) && (this[t] = e[t]);
e.hasOwnProperty("toString") &&

@@ -222,7 +222,7 @@ (this.toString = e.toString);

})()),
d = (x.WordArray = m.extend({
init: function (e, r) {
h = (x.WordArray = m.extend({
init: function (e, t) {
(e = this.words = e || []),
r != w
? (this.sigBytes = r)
t != w
? (this.sigBytes = t)
: (this.sigBytes = e.length * 4);

@@ -234,14 +234,14 @@ },

concat: function (e) {
var r = this.words,
s = e.words,
f = this.sigBytes,
var t = this.words,
o = e.words,
c = this.sigBytes,
_ = e.sigBytes;
if ((this.clamp(), f % 4))
if ((this.clamp(), c % 4))
for (var B = 0; B < _; B++) {
var C = (s[B >>> 2] >>> (24 - (B % 4) * 8)) & 255;
r[(f + B) >>> 2] |= C << (24 - ((f + B) % 4) * 8);
var C = (o[B >>> 2] >>> (24 - (B % 4) * 8)) & 255;
t[(c + B) >>> 2] |= C << (24 - ((c + B) % 4) * 8);
}
else
for (var S = 0; S < _; S += 4)
r[(f + S) >>> 2] = s[S >>> 2];
t[(c + S) >>> 2] = o[S >>> 2];
return (this.sigBytes += _), this;

@@ -251,5 +251,5 @@ },

var e = this.words,
r = this.sigBytes;
(e[r >>> 2] &= 4294967295 << (32 - (r % 4) * 8)),
(e.length = u.ceil(r / 4));
t = this.sigBytes;
(e[t >>> 2] &= 4294967295 << (32 - (t % 4) * 8)),
(e.length = f.ceil(t / 4));
},

@@ -261,25 +261,25 @@ clone: function () {

random: function (e) {
for (var r = [], s = 0; s < e; s += 4) r.push(H());
return new d.init(r, e);
for (var t = [], o = 0; o < e; o += 4) t.push(H());
return new h.init(t, e);
},
})),
b = (c.enc = {}),
b = (u.enc = {}),
l = (b.Hex = {
stringify: function (e) {
for (
var r = e.words, s = e.sigBytes, f = [], _ = 0;
_ < s;
var t = e.words, o = e.sigBytes, c = [], _ = 0;
_ < o;
_++
) {
var B = (r[_ >>> 2] >>> (24 - (_ % 4) * 8)) & 255;
f.push((B >>> 4).toString(16)),
f.push((B & 15).toString(16));
var B = (t[_ >>> 2] >>> (24 - (_ % 4) * 8)) & 255;
c.push((B >>> 4).toString(16)),
c.push((B & 15).toString(16));
}
return f.join("");
return c.join("");
},
parse: function (e) {
for (var r = e.length, s = [], f = 0; f < r; f += 2)
s[f >>> 3] |=
parseInt(e.substr(f, 2), 16) << (24 - (f % 8) * 4);
return new d.init(s, r / 2);
for (var t = e.length, o = [], c = 0; c < t; c += 2)
o[c >>> 3] |=
parseInt(e.substr(c, 2), 16) << (24 - (c % 8) * 4);
return new h.init(o, t / 2);
},

@@ -290,16 +290,16 @@ }),

for (
var r = e.words, s = e.sigBytes, f = [], _ = 0;
_ < s;
var t = e.words, o = e.sigBytes, c = [], _ = 0;
_ < o;
_++
) {
var B = (r[_ >>> 2] >>> (24 - (_ % 4) * 8)) & 255;
f.push(String.fromCharCode(B));
var B = (t[_ >>> 2] >>> (24 - (_ % 4) * 8)) & 255;
c.push(String.fromCharCode(B));
}
return f.join("");
return c.join("");
},
parse: function (e) {
for (var r = e.length, s = [], f = 0; f < r; f++)
s[f >>> 2] |=
(e.charCodeAt(f) & 255) << (24 - (f % 4) * 8);
return new d.init(s, r);
for (var t = e.length, o = [], c = 0; c < t; c++)
o[c >>> 2] |=
(e.charCodeAt(c) & 255) << (24 - (c % 4) * 8);
return new h.init(o, t);
},

@@ -319,5 +319,5 @@ }),

}),
p = (x.BufferedBlockAlgorithm = m.extend({
d = (x.BufferedBlockAlgorithm = m.extend({
reset: function () {
(this._data = new d.init()), (this._nDataBytes = 0);
(this._data = new h.init()), (this._nDataBytes = 0);
},

@@ -330,6 +330,6 @@ _append: function (e) {

_process: function (e) {
var r,
s = this._data,
f = s.words,
_ = s.sigBytes,
var t,
o = this._data,
c = o.words,
_ = o.sigBytes,
B = this.blockSize,

@@ -339,12 +339,12 @@ C = B * 4,

e
? (S = u.ceil(S))
: (S = u.max((S | 0) - this._minBufferSize, 0));
var W = S * B,
O = u.min(W * 4, _);
if (W) {
for (var z = 0; z < W; z += B)
this._doProcessBlock(f, z);
(r = f.splice(0, W)), (s.sigBytes -= O);
? (S = f.ceil(S))
: (S = f.max((S | 0) - this._minBufferSize, 0));
var $ = S * B,
T = f.min($ * 4, _);
if ($) {
for (var z = 0; z < $; z += B)
this._doProcessBlock(c, z);
(t = c.splice(0, $)), (o.sigBytes -= T);
}
return new d.init(r, O);
return new h.init(t, T);
},

@@ -357,3 +357,3 @@ clone: function () {

}));
x.Hasher = p.extend({
x.Hasher = d.extend({
cfg: m.extend(),

@@ -364,3 +364,3 @@ init: function (e) {

reset: function () {
p.reset.call(this), this._doReset();
d.reset.call(this), this._doReset();
},

@@ -372,71 +372,71 @@ update: function (e) {

e && this._append(e);
var r = this._doFinalize();
return r;
var t = this._doFinalize();
return t;
},
blockSize: 16,
_createHelper: function (e) {
return function (r, s) {
return new e.init(s).finalize(r);
return function (t, o) {
return new e.init(o).finalize(t);
};
},
_createHmacHelper: function (e) {
return function (r, s) {
return new P.HMAC.init(e, s).finalize(r);
return function (t, o) {
return new A.HMAC.init(e, o).finalize(t);
};
},
});
var P = (c.algo = {});
return c;
var A = (u.algo = {});
return u;
})(Math);
return o;
return a;
});
})(he)),
L
})(pe)),
j
);
}
(function (t, n) {
(function (o, u) {
t.exports = u(V());
})(y, function (o) {
(function (r, n) {
(function (a, f) {
r.exports = f(V());
})(y, function (a) {
return (
(function () {
var u = o,
w = u.lib,
var f = a,
w = f.lib,
v = w.WordArray,
H = u.enc;
H = f.enc;
H.Base64url = {
stringify: function (c, x = !0) {
var m = c.words,
d = c.sigBytes,
stringify: function (u, x = !0) {
var m = u.words,
h = u.sigBytes,
b = x ? this._safe_map : this._map;
c.clamp();
for (var l = [], g = 0; g < d; g += 3)
u.clamp();
for (var l = [], g = 0; g < h; g += 3)
for (
var i = (m[g >>> 2] >>> (24 - (g % 4) * 8)) & 255,
p = (m[(g + 1) >>> 2] >>> (24 - ((g + 1) % 4) * 8)) & 255,
P = (m[(g + 2) >>> 2] >>> (24 - ((g + 2) % 4) * 8)) & 255,
e = (i << 16) | (p << 8) | P,
r = 0;
r < 4 && g + r * 0.75 < d;
r++
d = (m[(g + 1) >>> 2] >>> (24 - ((g + 1) % 4) * 8)) & 255,
A = (m[(g + 2) >>> 2] >>> (24 - ((g + 2) % 4) * 8)) & 255,
e = (i << 16) | (d << 8) | A,
t = 0;
t < 4 && g + t * 0.75 < h;
t++
)
l.push(b.charAt((e >>> (6 * (3 - r))) & 63));
var s = b.charAt(64);
if (s) for (; l.length % 4; ) l.push(s);
l.push(b.charAt((e >>> (6 * (3 - t))) & 63));
var o = b.charAt(64);
if (o) for (; l.length % 4; ) l.push(o);
return l.join("");
},
parse: function (c, x = !0) {
var m = c.length,
d = x ? this._safe_map : this._map,
parse: function (u, x = !0) {
var m = u.length,
h = x ? this._safe_map : this._map,
b = this._reverseMap;
if (!b) {
b = this._reverseMap = [];
for (var l = 0; l < d.length; l++) b[d.charCodeAt(l)] = l;
for (var l = 0; l < h.length; l++) b[h.charCodeAt(l)] = l;
}
var g = d.charAt(64);
var g = h.charAt(64);
if (g) {
var i = c.indexOf(g);
var i = u.indexOf(g);
i !== -1 && (m = i);
}
return R(c, m, b);
return O(u, m, b);
},

@@ -447,17 +447,17 @@ _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

};
function R(c, x, m) {
for (var d = [], b = 0, l = 0; l < x; l++)
function O(u, x, m) {
for (var h = [], b = 0, l = 0; l < x; l++)
if (l % 4) {
var g = m[c.charCodeAt(l - 1)] << ((l % 4) * 2),
i = m[c.charCodeAt(l)] >>> (6 - (l % 4) * 2),
p = g | i;
(d[b >>> 2] |= p << (24 - (b % 4) * 8)), b++;
var g = m[u.charCodeAt(l - 1)] << ((l % 4) * 2),
i = m[u.charCodeAt(l)] >>> (6 - (l % 4) * 2),
d = g | i;
(h[b >>> 2] |= d << (24 - (b % 4) * 8)), b++;
}
return v.create(d, b);
return v.create(h, b);
}
})(),
o.enc.Base64url
a.enc.Base64url
);
});
})(de);
})(he);
var N = {},

@@ -468,37 +468,37 @@ ge = {

},
set exports(t) {
N = t;
set exports(r) {
N = r;
},
};
(function (t, n) {
(function (o, u) {
t.exports = u(V());
})(y, function (o) {
(function (r, n) {
(function (a, f) {
r.exports = f(V());
})(y, function (a) {
return (
(function (u) {
var w = o,
(function (f) {
var w = a,
v = w.lib,
H = v.WordArray,
R = v.Hasher,
c = w.algo,
O = v.Hasher,
u = w.algo,
x = [],
m = [];
(function () {
function l(P) {
for (var e = u.sqrt(P), r = 2; r <= e; r++)
if (!(P % r)) return !1;
function l(A) {
for (var e = f.sqrt(A), t = 2; t <= e; t++)
if (!(A % t)) return !1;
return !0;
}
function g(P) {
return ((P - (P | 0)) * 4294967296) | 0;
function g(A) {
return ((A - (A | 0)) * 4294967296) | 0;
}
for (var i = 2, p = 0; p < 64; )
for (var i = 2, d = 0; d < 64; )
l(i) &&
(p < 8 && (x[p] = g(u.pow(i, 1 / 2))),
(m[p] = g(u.pow(i, 1 / 3))),
p++),
(d < 8 && (x[d] = g(f.pow(i, 1 / 2))),
(m[d] = g(f.pow(i, 1 / 3))),
d++),
i++;
})();
var d = [],
b = (c.SHA256 = R.extend({
var h = [],
b = (u.SHA256 = O.extend({
_doReset: function () {

@@ -510,8 +510,8 @@ this._hash = new H.init(x.slice(0));

var i = this._hash.words,
p = i[0],
P = i[1],
d = i[0],
A = i[1],
e = i[2],
r = i[3],
s = i[4],
f = i[5],
t = i[3],
o = i[4],
c = i[5],
_ = i[6],

@@ -523,43 +523,43 @@ B = i[7],

) {
if (C < 16) d[C] = l[g + C] | 0;
if (C < 16) h[C] = l[g + C] | 0;
else {
var S = d[C - 15],
W =
var S = h[C - 15],
$ =
((S << 25) | (S >>> 7)) ^
((S << 14) | (S >>> 18)) ^
(S >>> 3),
O = d[C - 2],
T = h[C - 2],
z =
((O << 15) | (O >>> 17)) ^
((O << 13) | (O >>> 19)) ^
(O >>> 10);
d[C] = W + d[C - 7] + z + d[C - 16];
((T << 15) | (T >>> 17)) ^
((T << 13) | (T >>> 19)) ^
(T >>> 10);
h[C] = $ + h[C - 7] + z + h[C - 16];
}
var we = (s & f) ^ (~s & _),
be = (p & P) ^ (p & e) ^ (P & e),
var _e = (o & c) ^ (~o & _),
we = (d & A) ^ (d & e) ^ (A & e),
be =
((d << 30) | (d >>> 2)) ^
((d << 19) | (d >>> 13)) ^
((d << 10) | (d >>> 22)),
Be =
((p << 30) | (p >>> 2)) ^
((p << 19) | (p >>> 13)) ^
((p << 10) | (p >>> 22)),
xe =
((s << 26) | (s >>> 6)) ^
((s << 21) | (s >>> 11)) ^
((s << 7) | (s >>> 25)),
ce = B + xe + we + m[C] + d[C],
Ce = Be + be;
((o << 26) | (o >>> 6)) ^
((o << 21) | (o >>> 11)) ^
((o << 7) | (o >>> 25)),
ue = B + Be + _e + m[C] + h[C],
xe = be + we;
(B = _),
(_ = f),
(f = s),
(s = (r + ce) | 0),
(r = e),
(e = P),
(P = p),
(p = (ce + Ce) | 0);
(_ = c),
(c = o),
(o = (t + ue) | 0),
(t = e),
(e = A),
(A = d),
(d = (ue + xe) | 0);
}
(i[0] = (i[0] + p) | 0),
(i[1] = (i[1] + P) | 0),
(i[0] = (i[0] + d) | 0),
(i[1] = (i[1] + A) | 0),
(i[2] = (i[2] + e) | 0),
(i[3] = (i[3] + r) | 0),
(i[4] = (i[4] + s) | 0),
(i[5] = (i[5] + f) | 0),
(i[3] = (i[3] + t) | 0),
(i[4] = (i[4] + o) | 0),
(i[5] = (i[5] + c) | 0),
(i[6] = (i[6] + _) | 0),

@@ -572,7 +572,7 @@ (i[7] = (i[7] + B) | 0);

i = this._nDataBytes * 8,
p = l.sigBytes * 8;
d = l.sigBytes * 8;
return (
(g[p >>> 5] |= 128 << (24 - (p % 32))),
(g[(((p + 64) >>> 9) << 4) + 14] = u.floor(i / 4294967296)),
(g[(((p + 64) >>> 9) << 4) + 15] = i),
(g[d >>> 5] |= 128 << (24 - (d % 32))),
(g[(((d + 64) >>> 9) << 4) + 14] = f.floor(i / 4294967296)),
(g[(((d + 64) >>> 9) << 4) + 15] = i),
(l.sigBytes = g.length * 4),

@@ -584,10 +584,10 @@ this._process(),

clone: function () {
var l = R.clone.call(this);
var l = O.clone.call(this);
return (l._hash = this._hash.clone()), l;
},
}));
(w.SHA256 = R._createHelper(b)),
(w.HmacSHA256 = R._createHmacHelper(b));
(w.SHA256 = O._createHelper(b)),
(w.HmacSHA256 = O._createHmacHelper(b));
})(Math),
o.SHA256
a.SHA256
);

@@ -601,178 +601,131 @@ });

},
set exports(t) {
G = t;
set exports(r) {
G = r;
},
};
(function (t, n) {
(function (o, u) {
t.exports = u(V());
})(y, function (o) {
(function (r, n) {
(function (a, f) {
r.exports = f(V());
})(y, function (a) {
return (
(function () {
if (typeof ArrayBuffer == "function") {
var u = o,
w = u.lib,
var f = a,
w = f.lib,
v = w.WordArray,
H = v.init,
R = (v.init = function (c) {
O = (v.init = function (u) {
if (
(c instanceof ArrayBuffer && (c = new Uint8Array(c)),
(c instanceof Int8Array ||
(u instanceof ArrayBuffer && (u = new Uint8Array(u)),
(u instanceof Int8Array ||
(typeof Uint8ClampedArray < "u" &&
c instanceof Uint8ClampedArray) ||
c instanceof Int16Array ||
c instanceof Uint16Array ||
c instanceof Int32Array ||
c instanceof Uint32Array ||
c instanceof Float32Array ||
c instanceof Float64Array) &&
(c = new Uint8Array(c.buffer, c.byteOffset, c.byteLength)),
c instanceof Uint8Array)
u instanceof Uint8ClampedArray) ||
u instanceof Int16Array ||
u instanceof Uint16Array ||
u instanceof Int32Array ||
u instanceof Uint32Array ||
u instanceof Float32Array ||
u instanceof Float64Array) &&
(u = new Uint8Array(u.buffer, u.byteOffset, u.byteLength)),
u instanceof Uint8Array)
) {
for (var x = c.byteLength, m = [], d = 0; d < x; d++)
m[d >>> 2] |= c[d] << (24 - (d % 4) * 8);
for (var x = u.byteLength, m = [], h = 0; h < x; h++)
m[h >>> 2] |= u[h] << (24 - (h % 4) * 8);
H.call(this, m, x);
} else H.apply(this, arguments);
});
R.prototype = v;
O.prototype = v;
}
})(),
o.lib.WordArray
a.lib.WordArray
);
});
})(ye);
const me = {
name: "@monerium/sdk",
version: "2.0.0-alpha.10",
description: "Vite TypeScript library npm package template",
license: "ISC",
main: "dist/index.cjs.js",
module: "dist/index.es.js",
types: "dist/index.d.ts",
files: ["dist"],
engines: { node: "18.x" },
scripts: {
build:
"tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts",
clean: "rm -rf dist",
docs: "typedoc src/index.ts --out docs",
format: "prettier . --write",
lint: "eslint . --ext .ts",
prepare: "husky install",
prepublish: "yarn lint && yarn format && yarn test",
start: "vite --host --open",
test: "jest",
"test:coverage": "jest --coverage",
watch: "tsc && vite build --watch",
},
devDependencies: {
"@types/crypto-js": "^4.1.1",
"@types/jest": "^29.2.4",
"@types/node": "^18.11.18",
"@typescript-eslint/eslint-plugin": "^5.46.0",
"@typescript-eslint/parser": "^5.46.0",
"crypto-js": "^4.1.1",
"dts-bundle-generator": "^7.1.0",
eslint: "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-jest": "^27.1.7",
"eslint-plugin-prettier": "^4.2.1",
husky: "^8.0.2",
jest: "^29.3.1",
prettier: "^2.8.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
tslib: "^2.4.1",
typedoc: "^0.23.23",
typescript: "^4.9.4",
vite: "^4.0.0",
},
};
class _e {
class me {
constructor(n = "sandbox") {
T(this, j);
T(this, I);
T(this, M);
T(this, q);
T(this, U, void 0);
T(this, $, void 0);
U(this, k);
U(this, q);
U(this, I);
U(this, F);
U(this, W, void 0);
U(this, E, void 0);
J(this, "codeVerifier");
J(this, "bearerProfile");
K(this, U, h.environments[n]);
X(this, W, p.environments[n]);
}
async auth(n) {
let o;
if (k(this, I, ue).call(this, n))
o = { ...n, grant_type: "authorization_code" };
else if (k(this, M, fe).call(this, n))
o = { ...n, grant_type: "refresh_token" };
else if (k(this, q, le).call(this, n))
o = { ...n, grant_type: "client_credentials" };
let a;
if (P(this, q, fe).call(this, n))
a = { ...n, grant_type: "authorization_code" };
else if (P(this, I, ce).call(this, n))
a = { ...n, grant_type: "refresh_token" };
else if (P(this, F, le).call(this, n))
a = { ...n, grant_type: "client_credentials" };
else throw new Error("Authentication method could not be detected.");
(this.bearerProfile = await k(this, j, A).call(
(this.bearerProfile = await P(this, k, R).call(
this,
"post",
"auth/token",
new URLSearchParams(o),
new URLSearchParams(a),
!0
)),
K(this, $, `Bearer ${this.bearerProfile.access_token}`);
X(this, E, `Bearer ${this.bearerProfile.access_token}`);
}
pkceRequest(n) {
this.codeVerifier = G.random(64).toString();
const o = F.stringify(N(this.codeVerifier)),
u = {
const a = D.stringify(N(this.codeVerifier)),
f = {
...n,
code_challenge: o,
code_challenge: a,
code_challenge_method: "S256",
response_type: "code",
};
return `${D(this, U).api}/auth?${new URLSearchParams(u)}`;
return `${M(this, W).api}/auth?${new URLSearchParams(f)}`;
}
getAuthContext() {
return k(this, j, A).call(this, "get", "auth/context");
return P(this, k, R).call(this, "get", "auth/context");
}
getProfile(n) {
return k(this, j, A).call(this, "get", `profiles/${n}`);
return P(this, k, R).call(this, "get", `profiles/${n}`);
}
getBalances(n) {
return n
? k(this, j, A).call(this, "get", `profiles/${n}/balances`)
: k(this, j, A).call(this, "get", "balances");
? P(this, k, R).call(this, "get", `profiles/${n}/balances`)
: P(this, k, R).call(this, "get", "balances");
}
getOrders(n) {
const o = new URLSearchParams(n);
return k(this, j, A).call(this, "get", `orders?${o}`);
const a = new URLSearchParams(n);
return P(this, k, R).call(this, "get", `orders?${a}`);
}
getOrder(n) {
return k(this, j, A).call(this, "get", `orders/${n}`);
return P(this, k, R).call(this, "get", `orders/${n}`);
}
getTokens() {
return k(this, j, A).call(this, "get", "tokens");
return P(this, k, R).call(this, "get", "tokens");
}
linkAddress(n, o) {
return k(this, j, A).call(
linkAddress(n, a) {
return P(this, k, R).call(
this,
"post",
`profiles/${n}/addresses`,
JSON.stringify(o)
JSON.stringify(a)
);
}
placeOrder(n, o) {
return o
? k(this, j, A).call(
placeOrder(n, a) {
return a
? P(this, k, R).call(
this,
"post",
`profiles/${o}/orders`,
`profiles/${a}/orders`,
JSON.stringify(n)
)
: k(this, j, A).call(this, "post", "orders", JSON.stringify(n));
: P(this, k, R).call(this, "post", "orders", JSON.stringify(n));
}
uploadSupportingDocument(n) {
const o = new URLSearchParams(n);
return k(this, j, A).call(
const a = new URLSearchParams(n);
return P(this, k, R).call(
this,
"post",
"files/supporting-document",
o,
a,
!0

@@ -782,7 +735,7 @@ );

}
(U = new WeakMap()),
($ = new WeakMap()),
(j = new WeakSet()),
(A = async function (n, o, u, w) {
const v = await fetch(`${D(this, U).api}/${o}`, {
(W = new WeakMap()),
(E = new WeakMap()),
(k = new WeakSet()),
(R = async function (n, a, f, w) {
const v = await fetch(`${M(this, W).api}/${a}`, {
method: n,

@@ -793,8 +746,5 @@ headers: {

}`,
Authorization: D(this, $) || "",
"user-agent":
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 sdk/" +
me.version,
Authorization: M(this, E) || "",
},
body: u,
body: f,
}),

@@ -805,69 +755,69 @@ H = await v.json();

}),
(I = new WeakSet()),
(ue = function (n) {
(q = new WeakSet()),
(fe = function (n) {
return n.code != null;
}),
(M = new WeakSet()),
(fe = function (n) {
(I = new WeakSet()),
(ce = function (n) {
return n.refresh_token != null;
}),
(q = new WeakSet()),
(F = new WeakSet()),
(le = function (n) {
return n.client_secret != null;
});
var Z = ((t) => (
(t.eur = "eur"), (t.usd = "usd"), (t.gbp = "gbp"), (t.isk = "isk"), t
))(Z || {}),
Y = ((t) => ((t.corporate = "corporate"), (t.personal = "personal"), t))(
var K = ((r) => (
(r.eur = "eur"), (r.usd = "usd"), (r.gbp = "gbp"), (r.isk = "isk"), r
))(K || {}),
Y = ((r) => ((r.corporate = "corporate"), (r.personal = "personal"), r))(
Y || {}
),
ee = ((t) => ((t.read = "read"), (t.write = "write"), t))(ee || {}),
te = ((t) => (
(t.absent = "absent"),
(t.submitted = "submitted"),
(t.pending = "pending"),
(t.confirmed = "confirmed"),
t
ee = ((r) => ((r.read = "read"), (r.write = "write"), r))(ee || {}),
re = ((r) => (
(r.absent = "absent"),
(r.submitted = "submitted"),
(r.pending = "pending"),
(r.confirmed = "confirmed"),
r
))(re || {}),
te = ((r) => (
(r.approved = "approved"),
(r.rejected = "rejected"),
(r.unknown = "unknown"),
r
))(te || {}),
re = ((t) => (
(t.approved = "approved"),
(t.rejected = "rejected"),
(t.unknown = "unknown"),
t
))(re || {}),
ne = ((t) => ((t.iban = "iban"), (t.scan = "scan"), t))(ne || {}),
ie = ((t) => (
(t.polygon = "polygon"),
(t.ethereum = "ethereum"),
(t.gnosis = "gnosis"),
t
ne = ((r) => ((r.iban = "iban"), (r.scan = "scan"), r))(ne || {}),
ie = ((r) => (
(r.polygon = "polygon"),
(r.ethereum = "ethereum"),
(r.gnosis = "gnosis"),
r
))(ie || {}),
se = ((t) => (
(t.mainnet = "mainnet"),
(t.chiado = "chiado"),
(t.goerli = "goerli"),
(t.mumbai = "mumbai"),
t
))(se || {}),
oe = ((t) => ((t.redeem = "redeem"), (t.issue = "issue"), t))(oe || {}),
ae = ((t) => (
(t.placed = "placed"),
(t.pending = "pending"),
(t.processed = "processed"),
(t.rejected = "rejected"),
t
))(ae || {});
(a.Chain = ie),
(a.Currency = Z),
(a.KYCOutcome = re),
(a.KYCState = te),
(a.MoneriumClient = _e),
(a.Network = se),
(a.OrderKind = oe),
(a.OrderState = ae),
(a.PaymentStandard = ne),
(a.Permission = ee),
(a.ProfileType = Y),
Object.defineProperty(a, Symbol.toStringTag, { value: "Module" });
oe = ((r) => (
(r.mainnet = "mainnet"),
(r.chiado = "chiado"),
(r.goerli = "goerli"),
(r.mumbai = "mumbai"),
r
))(oe || {}),
ae = ((r) => ((r.redeem = "redeem"), (r.issue = "issue"), r))(ae || {}),
se = ((r) => (
(r.placed = "placed"),
(r.pending = "pending"),
(r.processed = "processed"),
(r.rejected = "rejected"),
r
))(se || {});
(s.Chain = ie),
(s.Currency = K),
(s.KYCOutcome = te),
(s.KYCState = re),
(s.MoneriumClient = me),
(s.Network = oe),
(s.OrderKind = ae),
(s.OrderState = se),
(s.PaymentStandard = ne),
(s.Permission = ee),
(s.ProfileType = Y),
Object.defineProperty(s, Symbol.toStringTag, { value: "Module" });
});
//# sourceMappingURL=index.umd.js.map
{
"name": "@monerium/sdk",
"version": "2.0.0-alpha.10",
"description": "Vite TypeScript library npm package template",
"license": "ISC",
"version": "2.0.0",
"description": "Everything you need to interact with the Monerium API - an electronic money issuer.",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/monerium/sdk.git"
},
"bugs": {
"url": "https://github.com/monerium/sdk/issues"
},
"main": "dist/index.cjs.js",

@@ -7,0 +14,0 @@ "module": "dist/index.es.js",

@@ -27,11 +27,2 @@ # @monerium/sdk

If you want to make any code contributions, make sure to run the following commands before you pr
them:
```sh
yarn format
yarn lint
yarn test
```
Once ready to submit your package to the NPM Registry, execute the following tasks via `yarn`:

@@ -38,0 +29,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc