@monerium/sdk 2.5.1 → 2.5.2

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.5.2](https://github.com/monerium/sdk/compare/v2.5.1...v2.5.2) (2023-07-05)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add state to Account type, closes [#96](https://github.com/monerium/sdk/issues/96) ([5693146](https://github.com/monerium/sdk/commit/5693146d8951e9e7024dcd1f8c262707ade8f642))
9
+ * getBalances always returns an array, closes [#98](https://github.com/monerium/sdk/issues/98) ([144b1f9](https://github.com/monerium/sdk/commit/144b1f944c78269bf9ebed72a5da046511a15aea))
10
+
3
11
  ## [2.5.1](https://github.com/monerium/sdk/compare/v2.5.0...v2.5.1) (2023-06-15)
4
12
 
5
13
 
package/dist/index.d.ts CHANGED
@@ -123,6 +123,11 @@ export declare enum KYCOutcome {
123
123
  rejected = "rejected",
124
124
  unknown = "unknown"
125
125
  }
126
+ export declare enum AccountState {
127
+ requested = "requested",
128
+ approved = "approved",
129
+ pending = "pending"
130
+ }
126
131
  export interface KYC {
127
132
  state: KYCState;
128
133
  outcome: KYCOutcome;
@@ -139,6 +144,7 @@ export interface Account {
139
144
  network: Network;
140
145
  chain: Chain;
141
146
  id?: string;
147
+ state?: AccountState;
142
148
  }
143
149
  export interface Profile {
144
150
  id: string;
@@ -306,7 +312,7 @@ export declare class MoneriumClient {
306
312
  /**
307
313
  * @param {string=} profileId - the id of the profile to fetch balances.
308
314
  */
309
- getBalances(profileId?: string): Promise<Balances> | Promise<Balances[]>;
315
+ getBalances(profileId?: string): Promise<Balances[]>;
310
316
  getOrders(filter?: OrderFilter): Promise<Order[]>;
311
317
  getOrder(orderId: string): Promise<Order>;
312
318
  getTokens(): Promise<Token[]>;
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ var j = (e, r, n) => (ae(e, typeof r != "symbol" ? r + "" : r, n), n), D = (e, r
4
4
  if (!r.has(e))
5
5
  throw TypeError("Cannot " + n);
6
6
  };
7
- var I = (e, r, n) => (D(e, r, "read from private field"), n ? n.call(e) : r.get(e)), $ = (e, r, n) => {
7
+ var q = (e, r, n) => (D(e, r, "read from private field"), n ? n.call(e) : r.get(e)), $ = (e, r, n) => {
8
8
  if (r.has(e))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
10
  r instanceof WeakSet ? r.add(e) : r.set(e, n);
@@ -49,12 +49,12 @@ var G = {}, ue = {
49
49
  function fe(e) {
50
50
  throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
51
51
  }
52
- var W = {}, le = {
52
+ var T = {}, le = {
53
53
  get exports() {
54
- return W;
54
+ return T;
55
55
  },
56
56
  set exports(e) {
57
- W = e;
57
+ T = e;
58
58
  }
59
59
  };
60
60
  const he = {}, pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -560,7 +560,7 @@ function Z() {
560
560
  }(Math);
561
561
  return n;
562
562
  });
563
- }(le)), W;
563
+ }(le)), T;
564
564
  }
565
565
  (function(e, r) {
566
566
  (function(n, i) {
@@ -729,7 +729,7 @@ const ge = () => {
729
729
  return i = Math.abs(i), p + r(Math.floor(i / 60)) + ":" + r(i % 60);
730
730
  };
731
731
  return e.getFullYear() + "-" + r(e.getMonth() + 1) + "-" + r(e.getDate()) + "T" + r(e.getHours()) + ":" + r(e.getMinutes()) + ":" + r(e.getSeconds()) + n(e.getTimezoneOffset());
732
- }, $e = (e, r) => `Send EUR ${e} to ${r} at ${_e(/* @__PURE__ */ new Date())}`, T = (e) => {
732
+ }, ke = (e, r) => `Send EUR ${e} to ${r} at ${_e(/* @__PURE__ */ new Date())}`, I = (e) => {
733
733
  var r;
734
734
  return e && ((r = Object.entries(e)) == null ? void 0 : r.length) > 0 ? Object.entries(e).map(
735
735
  ([n, i]) => `${encodeURIComponent(n)}=${encodeURIComponent(i)}`
@@ -746,12 +746,12 @@ const ge = () => {
746
746
  }
747
747
  }
748
748
  };
749
- var z, E, C, A, q, Q, U, X, L, K;
750
- class ke {
749
+ var z, E, C, A, W, Q, U, X, L, K;
750
+ class Pe {
751
751
  constructor(r = "sandbox") {
752
752
  // -- Helper Methods
753
753
  $(this, C);
754
- $(this, q);
754
+ $(this, W);
755
755
  $(this, U);
756
756
  $(this, L);
757
757
  $(this, z, void 0);
@@ -768,7 +768,7 @@ class ke {
768
768
  // -- Authentication
769
769
  async auth(r) {
770
770
  let n;
771
- if (B(this, q, Q).call(this, r))
771
+ if (B(this, W, Q).call(this, r))
772
772
  n = { ...r, grant_type: "authorization_code" };
773
773
  else if (B(this, U, X).call(this, r))
774
774
  n = { ...r, grant_type: "refresh_token" };
@@ -795,7 +795,7 @@ class ke {
795
795
  code_challenge_method: "S256",
796
796
  response_type: "code"
797
797
  };
798
- return `${I(this, z).api}/auth?${T(i)}`;
798
+ return `${q(this, z).api}/auth?${I(i)}`;
799
799
  }
800
800
  // -- Read Methods
801
801
  getAuthContext() {
@@ -814,7 +814,7 @@ class ke {
814
814
  return r ? B(this, C, A).call(this, "get", `profiles/${r}/balances`) : B(this, C, A).call(this, "get", "balances");
815
815
  }
816
816
  getOrders(r) {
817
- const n = T(r);
817
+ const n = I(r);
818
818
  return B(this, C, A).call(this, "get", `orders?${n}`);
819
819
  }
820
820
  getOrder(r) {
@@ -832,7 +832,7 @@ class ke {
832
832
  return n ? B(this, C, A).call(this, "post", `profiles/${n}/orders`, JSON.stringify(i)) : B(this, C, A).call(this, "post", "orders", JSON.stringify(i));
833
833
  }
834
834
  uploadSupportingDocument(r) {
835
- const n = T(
835
+ const n = I(
836
836
  r
837
837
  );
838
838
  return B(this, C, A).call(this, "post", "files/supporting-document", n, !0);
@@ -840,42 +840,43 @@ class ke {
840
840
  }
841
841
  z = new WeakMap(), E = new WeakMap(), C = new WeakSet(), A = async function(r, n, i, p) {
842
842
  return ye(
843
- `${I(this, z).api}/${n}`,
843
+ `${q(this, z).api}/${n}`,
844
844
  r,
845
- p ? T(i) : i,
845
+ p ? I(i) : i,
846
846
  {
847
- Authorization: I(this, E) || "",
847
+ Authorization: q(this, E) || "",
848
848
  "Content-Type": `application/${p ? "x-www-form-urlencoded" : "json"}`
849
849
  }
850
850
  );
851
- }, q = new WeakSet(), Q = function(r) {
851
+ }, W = new WeakSet(), Q = function(r) {
852
852
  return r.code != null;
853
853
  }, U = new WeakSet(), X = function(r) {
854
854
  return r.refresh_token != null;
855
855
  }, L = new WeakSet(), K = function(r) {
856
856
  return r.client_secret != null;
857
857
  };
858
- var me = /* @__PURE__ */ ((e) => (e.eur = "eur", e))(me || {}), be = /* @__PURE__ */ ((e) => (e.corporate = "corporate", e.personal = "personal", e))(be || {}), Be = /* @__PURE__ */ ((e) => (e.read = "read", e.write = "write", e))(Be || {}), xe = /* @__PURE__ */ ((e) => (e.absent = "absent", e.submitted = "submitted", e.pending = "pending", e.confirmed = "confirmed", e))(xe || {}), Ce = /* @__PURE__ */ ((e) => (e.approved = "approved", e.rejected = "rejected", e.unknown = "unknown", e))(Ce || {}), Se = /* @__PURE__ */ ((e) => (e.iban = "iban", e.scan = "scan", e))(Se || {}), Ae = /* @__PURE__ */ ((e) => (e.redeem = "redeem", e.issue = "issue", e))(Ae || {}), Re = /* @__PURE__ */ ((e) => (e.placed = "placed", e.pending = "pending", e.processed = "processed", e.rejected = "rejected", e))(Re || {});
859
- const Oe = "I hereby declare that I am the address owner.";
858
+ var me = /* @__PURE__ */ ((e) => (e.eur = "eur", e))(me || {}), be = /* @__PURE__ */ ((e) => (e.corporate = "corporate", e.personal = "personal", e))(be || {}), Be = /* @__PURE__ */ ((e) => (e.read = "read", e.write = "write", e))(Be || {}), xe = /* @__PURE__ */ ((e) => (e.absent = "absent", e.submitted = "submitted", e.pending = "pending", e.confirmed = "confirmed", e))(xe || {}), Ce = /* @__PURE__ */ ((e) => (e.approved = "approved", e.rejected = "rejected", e.unknown = "unknown", e))(Ce || {}), Se = /* @__PURE__ */ ((e) => (e.requested = "requested", e.approved = "approved", e.pending = "pending", e))(Se || {}), Ae = /* @__PURE__ */ ((e) => (e.iban = "iban", e.scan = "scan", e))(Ae || {}), Re = /* @__PURE__ */ ((e) => (e.redeem = "redeem", e.issue = "issue", e))(Re || {}), Oe = /* @__PURE__ */ ((e) => (e.placed = "placed", e.pending = "pending", e.processed = "processed", e.rejected = "rejected", e))(Oe || {});
859
+ const He = "I hereby declare that I am the address owner.";
860
860
  var Y = /* @__PURE__ */ ((e) => (e.Goerli = "goerli", e.Chiado = "chiado", e.Mumbai = "mumbai", e.Mainnet = "mainnet", e))(Y || {}), ee = /* @__PURE__ */ ((e) => (e.Ethereum = "ethereum", e.Gnosis = "gnosis", e.Polygon = "polygon", e))(ee || {});
861
- const Pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
861
+ const ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
862
862
  __proto__: null,
863
863
  Chain: ee,
864
- LINK_MESSAGE: Oe,
864
+ LINK_MESSAGE: He,
865
865
  Network: Y
866
866
  }, Symbol.toStringTag, { value: "Module" }));
867
867
  export {
868
+ Se as AccountState,
868
869
  me as Currency,
869
870
  Ce as KYCOutcome,
870
871
  xe as KYCState,
871
- ke as MoneriumClient,
872
- Ae as OrderKind,
873
- Re as OrderState,
874
- Se as PaymentStandard,
872
+ Pe as MoneriumClient,
873
+ Re as OrderKind,
874
+ Oe as OrderState,
875
+ Ae as PaymentStandard,
875
876
  Be as Permission,
876
877
  be as ProfileType,
877
- Pe as constants,
878
- $e as placeOrderMessage,
878
+ ze as constants,
879
+ ke as placeOrderMessage,
879
880
  _e as rfc3339
880
881
  };
881
882
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../__vite-browser-external","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/core.js","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/enc-base64url.js","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/sha256.js","../src/utils.ts","../src/config.ts","../src/client.ts","../src/types.ts","../src/constants.ts"],"sourcesContent":["export default {}",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64url encoding strategy.\n\t */\n\t var Base64url = C_enc.Base64url = {\n\t /**\n\t * Converts a word array to a Base64url string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {string} The Base64url string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);\n\t */\n\t stringify: function (wordArray, urlSafe=true) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = urlSafe ? this._safe_map : this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64url string to a word array.\n\t *\n\t * @param {string} base64Str The Base64url string.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64url.parse(base64String);\n\t */\n\t parse: function (base64Str, urlSafe=true) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = urlSafe ? this._safe_map : this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\t _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\treturn CryptoJS.enc.Base64url;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Initialization and round constants tables\n\t var H = [];\n\t var K = [];\n\n\t // Compute constants\n\t (function () {\n\t function isPrime(n) {\n\t var sqrtN = Math.sqrt(n);\n\t for (var factor = 2; factor <= sqrtN; factor++) {\n\t if (!(n % factor)) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t function getFractionalBits(n) {\n\t return ((n - (n | 0)) * 0x100000000) | 0;\n\t }\n\n\t var n = 2;\n\t var nPrime = 0;\n\t while (nPrime < 64) {\n\t if (isPrime(n)) {\n\t if (nPrime < 8) {\n\t H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t }\n\t K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t nPrime++;\n\t }\n\n\t n++;\n\t }\n\t }());\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-256 hash algorithm.\n\t */\n\t var SHA256 = C_algo.SHA256 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init(H.slice(0));\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\t var f = H[5];\n\t var g = H[6];\n\t var h = H[7];\n\n\t // Computation\n\t for (var i = 0; i < 64; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var gamma0x = W[i - 15];\n\t var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n\t ((gamma0x << 14) | (gamma0x >>> 18)) ^\n\t (gamma0x >>> 3);\n\n\t var gamma1x = W[i - 2];\n\t var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n\t ((gamma1x << 13) | (gamma1x >>> 19)) ^\n\t (gamma1x >>> 10);\n\n\t W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t }\n\n\t var ch = (e & f) ^ (~e & g);\n\t var maj = (a & b) ^ (a & c) ^ (b & c);\n\n\t var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n\t var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n\t var t1 = h + sigma1 + ch + K[i] + W[i];\n\t var t2 = sigma0 + maj;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t H[5] = (H[5] + f) | 0;\n\t H[6] = (H[6] + g) | 0;\n\t H[7] = (H[7] + h) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA256('message');\n\t * var hash = CryptoJS.SHA256(wordArray);\n\t */\n\t C.SHA256 = Hasher._createHelper(SHA256);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA256(message, key);\n\t */\n\t C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA256;\n\n}));","export const generateRandomString = () => {\n let result = '';\n const characters =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charactersLength = characters.length;\n let counter = 0;\n while (counter < 128) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n counter += 1;\n }\n return result;\n};\n\nexport const rest = async <T>(\n url: string,\n method: string,\n body?: BodyInit | Record<string, string>,\n headers?: Record<string, string>,\n): Promise<T> => {\n const res = await fetch(`${url}`, {\n method,\n headers,\n body: body as unknown as BodyInit,\n });\n\n let response;\n const text = await res.text();\n\n try {\n response = JSON.parse(text);\n } catch (err) {\n throw text;\n }\n\n if (!res.ok) {\n throw response;\n }\n\n return response as T;\n};\nexport const rfc3339 = (d: Date) => {\n if (d.toString() === 'Invalid Date') {\n throw d;\n }\n const pad = (n: number) => {\n return n < 10 ? '0' + n : n;\n };\n\n const timezoneOffset = (offset: number) => {\n if (offset === 0) {\n return 'Z';\n }\n const sign = offset > 0 ? '-' : '+';\n offset = Math.abs(offset);\n return sign + pad(Math.floor(offset / 60)) + ':' + pad(offset % 60);\n };\n\n return (\n d.getFullYear() +\n '-' +\n pad(d.getMonth() + 1) +\n '-' +\n pad(d.getDate()) +\n 'T' +\n pad(d.getHours()) +\n ':' +\n pad(d.getMinutes()) +\n ':' +\n pad(d.getSeconds()) +\n timezoneOffset(d.getTimezoneOffset())\n );\n};\n\n/**\n * The message to be signed when placing an order.\n *\n * @returns string\n */\nexport const placeOrderMessage = (amount: string | number, iban: string) =>\n `Send EUR ${amount} to ${iban} at ${rfc3339(new Date())}`;\n\n/**\n * Replacement for URLSearchParams, Metamask snaps do not include node globals.\n * It will not handle all special characters the same way as URLSearchParams, but it will be good enough for our use case.\n * @param body a json format of the body to be encoded\n * @returns 'application/x-www-form-urlencoded' compatible string\n */\nexport const urlEncoded = (\n body: Record<string, string>,\n): string | undefined => {\n return body && Object.entries(body)?.length > 0\n ? Object.entries(body)\n .map(\n ([key, value]) =>\n `${encodeURIComponent(key)}=${encodeURIComponent(value)}`,\n )\n .join('&')\n : '';\n};\n","import type { Config } from './types';\n\nconst MONERIUM_CONFIG: Config = {\n environments: {\n production: {\n api: 'https://api.monerium.app',\n web: 'https://monerium.app',\n },\n sandbox: {\n api: 'https://api.monerium.dev',\n web: 'https://sandbox.monerium.dev',\n },\n },\n};\n\nexport { MONERIUM_CONFIG };\n","import encodeBase64Url from 'crypto-js/enc-base64url';\nimport SHA256 from 'crypto-js/sha256';\nimport { generateRandomString, rest, urlEncoded } from './utils';\nimport { MONERIUM_CONFIG } from './config';\nimport type {\n AuthArgs,\n AuthCode,\n AuthContext,\n Balances,\n BearerProfile,\n ClientCredentials,\n Environment,\n LinkAddress,\n NewOrder,\n Order,\n OrderFilter,\n PKCERequest,\n PKCERequestArgs,\n Profile,\n RefreshToken,\n SupportingDoc,\n Token,\n} from './types';\n// import pjson from \"../package.json\";\n\nexport class MoneriumClient {\n #env: Environment;\n\n #authPayload?: string;\n /** The PKCE code verifier */\n codeVerifier?: string;\n bearerProfile?: BearerProfile;\n\n constructor(env: 'production' | 'sandbox' = 'sandbox') {\n this.#env = MONERIUM_CONFIG.environments[env];\n }\n\n // -- Authentication\n\n async auth(args: AuthArgs): Promise<BearerProfile> {\n let params: AuthCode | RefreshToken | ClientCredentials;\n\n if (this.#isAuthCode(args)) {\n params = { ...args, grant_type: 'authorization_code' };\n } else if (this.#isRefreshToken(args)) {\n params = { ...args, grant_type: 'refresh_token' };\n } else if (this.#isClientCredentials(args)) {\n params = { ...args, grant_type: 'client_credentials' };\n } else {\n throw new Error('Authentication method could not be detected.');\n }\n\n this.bearerProfile = (await this.#api(\n 'post',\n `auth/token`,\n params as unknown as Record<string, string>,\n true,\n )) as BearerProfile;\n\n this.#authPayload = `Bearer ${this.bearerProfile.access_token}`;\n return this.bearerProfile;\n }\n\n /**\n * Construct the url to the authorization code flow,\n * the code verifier is needed afterwards to obtain an access token and is therefore stored in `this.codeVerifier`\n * For automatic wallet link, add the following properties: `address`, `signature`, `chain` & `network`\n * @returns string\n */\n getAuthFlowURI(args: PKCERequestArgs): string {\n // Using crypto-js to generate a random string was causing the following error:\n // `Error: Native crypto module could not be used to get secure random number.`\n this.codeVerifier = generateRandomString();\n const challenge = encodeBase64Url.stringify(\n SHA256(this.codeVerifier as string),\n );\n\n const params: PKCERequest = {\n ...args,\n client_id: args?.client_id,\n code_challenge: challenge,\n code_challenge_method: 'S256',\n response_type: 'code',\n };\n\n return `${this.#env.api}/auth?${urlEncoded(params)}`;\n }\n\n /**\n * @deprecated since v2.0.7, use {@link getAuthFlowURI} instead.\n */\n pkceRequest = (args: PKCERequestArgs) => this.getAuthFlowURI(args);\n\n // -- Read Methods\n\n getAuthContext(): Promise<AuthContext> {\n return this.#api<AuthContext>('get', `auth/context`);\n }\n\n /**\n * @param {string} profileId - the id of the profile to fetch.\n */\n getProfile(profileId: string): Promise<Profile> {\n return this.#api<Profile>('get', `profiles/${profileId}`);\n }\n\n /**\n * @param {string=} profileId - the id of the profile to fetch balances.\n */\n getBalances(profileId?: string): Promise<Balances> | Promise<Balances[]> {\n if (profileId) {\n return this.#api<Balances>('get', `profiles/${profileId}/balances`);\n } else {\n return this.#api<Balances[]>('get', `balances`);\n }\n }\n\n getOrders(filter?: OrderFilter): Promise<Order[]> {\n const searchParams = urlEncoded(filter as Record<string, string>);\n return this.#api<Order[]>('get', `orders?${searchParams}`);\n }\n\n getOrder(orderId: string): Promise<Order> {\n return this.#api<Order>('get', `orders/${orderId}`);\n }\n\n getTokens(): Promise<Token[]> {\n return this.#api<Token[]>('get', 'tokens');\n }\n\n // -- Write Methods\n\n linkAddress(profileId: string, body: LinkAddress) {\n return this.#api(\n 'post',\n `profiles/${profileId}/addresses`,\n JSON.stringify(body),\n );\n }\n\n placeOrder(order: NewOrder, profileId?: string): Promise<Order> {\n const req = { ...order, kind: 'redeem', currency: 'eur' };\n if (profileId) {\n return this.#api<Order>(\n 'post',\n `profiles/${profileId}/orders`,\n JSON.stringify(req),\n );\n } else {\n return this.#api<Order>('post', `orders`, JSON.stringify(req));\n }\n }\n\n uploadSupportingDocument(document: File): Promise<SupportingDoc> {\n const searchParams = urlEncoded(\n document as unknown as Record<string, string>,\n );\n\n return this.#api<SupportingDoc>(\n 'post',\n 'files/supporting-document',\n searchParams,\n true,\n );\n }\n\n // -- Helper Methods\n\n async #api<T>(\n method: string,\n resource: string,\n body?: BodyInit | Record<string, string>,\n isFormEncoded?: boolean,\n ): Promise<T> {\n return rest<T>(\n `${this.#env.api}/${resource}`,\n method,\n isFormEncoded ? urlEncoded(body as Record<string, string>) : body,\n {\n Authorization: this.#authPayload || '',\n 'Content-Type': `application/${\n isFormEncoded ? 'x-www-form-urlencoded' : 'json'\n }`,\n },\n );\n }\n\n #isAuthCode(args: AuthArgs): args is AuthCode {\n return (args as AuthCode).code != undefined;\n }\n\n #isRefreshToken(args: AuthArgs): args is RefreshToken {\n return (args as RefreshToken).refresh_token != undefined;\n }\n\n #isClientCredentials(args: AuthArgs): args is ClientCredentials {\n return (args as ClientCredentials).client_secret != undefined;\n }\n}\n","// --- Config --- //\n\nexport type Environment = { api: string; web: string };\n\nexport type Config = {\n environments: { production: Environment; sandbox: Environment };\n};\n\nexport type ENV = 'sandbox' | 'production';\n\nexport type EthereumTestnet = 'goerli';\nexport type GnosisTestnet = 'chiado';\nexport type PolygonTestnet = 'mumbai';\n\nexport type Chain = 'ethereum' | 'gnosis' | 'polygon';\nexport type Networks =\n | EthereumTestnet\n | GnosisTestnet\n | PolygonTestnet\n | 'mainnet';\n\n// -- Commons\nexport type NetworkSemiStrict<C extends Chain> = C extends 'ethereum'\n ? EthereumTestnet | 'mainnet'\n : C extends 'gnosis'\n ? GnosisTestnet | 'mainnet'\n : C extends 'polygon'\n ? PolygonTestnet | 'mainnet'\n : never;\n\nexport type NetworkStrict<\n C extends Chain,\n E extends ENV,\n> = E extends 'production'\n ? 'mainnet'\n : E extends 'sandbox'\n ? C extends 'ethereum'\n ? EthereumTestnet\n : C extends 'gnosis'\n ? GnosisTestnet\n : C extends 'polygon'\n ? PolygonTestnet\n : never\n : never;\n\n/*\n * -- isValid:\n * const network: Network<'ethereum', 'sandbox'> = 'goerli';\n * const network: Network<'ethereum'> = 'mainnet';\n * const network: Network<'ethereum'> = 'goerli'\n * const network: Network = 'chiado'\n *\n * -- isInValid:\n * const network: Network<'ethereum', 'sandbox'> = 'chiado';\n * const network: Network<'ethereum'> = 'chiado';\n */\nexport type Network<\n C extends Chain = Chain,\n E extends ENV = ENV,\n> = C extends Chain\n ? E extends ENV\n ? NetworkStrict<C, E> & NetworkSemiStrict<C>\n : never\n : never;\n\nexport enum Currency {\n eur = 'eur',\n // usd = 'usd',\n // gbp = 'gbp',\n // isk = 'isk',\n}\n\n// -- auth\n\nexport type AuthArgs =\n | Omit<AuthCode, 'grant_type'>\n | Omit<RefreshToken, 'grant_type'>\n | Omit<ClientCredentials, 'grant_type'>;\n\nexport interface AuthCode {\n grant_type: 'authorization_code';\n client_id: string;\n code: string;\n code_verifier: string;\n redirect_uri: string;\n scope?: string;\n}\n\nexport interface BearerProfile {\n access_token: string;\n token_type: string;\n expires_in: number;\n refresh_token: string;\n profile: string;\n userId: string;\n}\n\nexport interface RefreshToken {\n grant_type: 'refresh_token';\n client_id: string;\n refresh_token: string;\n scope?: string;\n}\n\nexport interface ClientCredentials {\n grant_type: 'client_credentials';\n client_id: string;\n client_secret: string;\n scope?: string;\n}\n\n// -- pkceRequest\n\n/**\n * @returns A {@link PKCERequest} object with properties omitted that are automatically computed in by the SDK.\n */\nexport type PKCERequestArgs = Omit<\n PKCERequest,\n 'code_challenge' | 'code_challenge_method' | 'response_type'\n>;\n\nexport type PKCERequest = {\n /** the authentication flow client id of the application */\n client_id: string;\n /** the code challenge automatically generated by the SDK */\n code_challenge: string;\n /** the code challenge method for the authentication flow , handled by the SDK */\n code_challenge_method: 'S256';\n /** the response type of the authentication flow, handled by the SDK */\n response_type: 'code';\n /** the state of the application */\n state?: string;\n /** the redirect uri of the application */\n redirect_uri?: string;\n /** the scope of the application */\n scope?: string;\n /** the address of the wallet to automatically link */\n address?: string;\n /** the signature of the wallet to automatically link */\n signature?: string;\n /** the network of the wallet to automatically link */\n network?: Network;\n /** the chain of the wallet to automatically link */\n chain?: Chain;\n};\n\n// -- authContext\n\nenum Method {\n password = 'password',\n resource = 'resource',\n jwt = 'jwt',\n apiKey = 'apiKey',\n}\n\nexport enum ProfileType {\n corporate = 'corporate',\n personal = 'personal',\n}\n\nexport enum Permission {\n read = 'read',\n write = 'write',\n}\n\nexport interface AuthProfile {\n id: string;\n type: ProfileType;\n name: string;\n perms: Permission[];\n}\n\nexport interface AuthContext {\n userId: string;\n email: string;\n name: string;\n roles: 'admin'[];\n auth: { method: Method; subject: string; verified: boolean };\n defaultProfile: string;\n profiles: AuthProfile[];\n}\n\n// -- getProfile\n\nexport enum KYCState {\n absent = 'absent',\n submitted = 'submitted',\n pending = 'pending',\n confirmed = 'confirmed',\n}\n\nexport enum KYCOutcome {\n approved = 'approved',\n rejected = 'rejected',\n unknown = 'unknown',\n}\n\nexport interface KYC {\n state: KYCState;\n outcome: KYCOutcome;\n}\n\nexport enum PaymentStandard {\n iban = 'iban',\n scan = 'scan',\n}\n\nexport interface Account {\n address: string;\n currency: Currency;\n standard: PaymentStandard;\n iban?: string;\n // sortCode?: string;\n // accountNumber?: string;\n network: Network;\n chain: Chain;\n id?: string;\n}\n\nexport interface Profile {\n id: string;\n name: string;\n kyc: KYC;\n accounts: Account[];\n}\n\n// -- getBalances\nexport interface Balance {\n currency: Currency;\n amount: string;\n}\n\nexport interface Balances {\n id: string;\n address: string;\n chain: Chain;\n network: Network;\n balances: Balance[];\n}\n\n// --getOrders\n\nexport enum OrderKind {\n redeem = 'redeem',\n issue = 'issue',\n}\n\nexport enum OrderState {\n placed = 'placed',\n pending = 'pending',\n processed = 'processed',\n rejected = 'rejected',\n}\n\nexport interface Fee {\n provider: 'satchel';\n currency: Currency;\n amount: string;\n}\n\nexport interface IBAN {\n standard: PaymentStandard.iban;\n iban: string;\n}\n\nexport interface SCAN {\n standard: PaymentStandard.scan;\n sortCode: string;\n accountNumber: string;\n}\n\nexport interface Individual {\n firstName: string;\n lastName: string;\n country?: string;\n}\n\nexport interface Corporation {\n companyName: string;\n country: string;\n}\n\nexport interface Counterpart {\n identifier: IBAN | SCAN;\n details: Individual | Corporation;\n}\n\nexport interface OrderMetadata {\n approvedAt: string;\n processedAt: string;\n rejectedAt: string;\n state: OrderState;\n placedBy: string;\n placedAt: string;\n receivedAmount: string;\n sentAmount: string;\n}\n\nexport interface OrderFilter {\n address?: string;\n txHash?: string;\n profile?: string;\n memo?: string;\n accountId?: string;\n state?: OrderState;\n}\n\nexport interface Order {\n id: string;\n profile: string;\n accountId: string;\n address: string;\n kind: OrderKind;\n amount: string;\n currency: Currency;\n totalFee: string;\n fees: Fee[];\n counterpart: Counterpart;\n memo: string;\n rejectedReason: string;\n supportingDocumentId: string;\n meta: OrderMetadata;\n}\n\n// -- getTokens\n\nexport interface Token {\n currency: Currency;\n ticker: string;\n symbol: string;\n chain: Chain;\n network: Network;\n address: string;\n decimals: number;\n}\n\n// --placeOrder\n\nexport type NewOrder = NewOrderByAddress | NewOrderByAccountId;\n\nexport interface NewOrderCommon {\n amount: string;\n signature: string;\n // currency: Currency;\n counterpart: Counterpart;\n message: string;\n memo?: string;\n supportingDocumentId?: string;\n}\nexport interface NewOrderByAddress extends NewOrderCommon {\n address: string;\n chain: Chain;\n network: Network;\n}\nexport interface NewOrderByAccountId extends NewOrderCommon {\n accountId: string;\n}\n\n// -- uploadSupportingDocument\n\nexport interface SupportingDocMetadata {\n uploadedBy: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface SupportingDoc {\n id: string;\n name: string;\n type: string;\n size: number;\n hash: string;\n meta: SupportingDocMetadata;\n}\n\n// -- linkAddress\n\nexport interface CurrencyAccounts {\n network: Network;\n chain: Chain;\n currency: Currency;\n}\n\nexport interface LinkAddress {\n address: string;\n message: string;\n signature: string;\n accounts: CurrencyAccounts[];\n network?: Network;\n chain?: Chain;\n}\n","export const LINK_MESSAGE = `I hereby declare that I am the address owner.`;\n\nexport enum Network {\n Goerli = 'goerli',\n Chiado = 'chiado',\n Mumbai = 'mumbai',\n Mainnet = 'mainnet',\n}\n\nexport enum Chain {\n Ethereum = 'ethereum',\n Gnosis = 'gnosis',\n Polygon = 'polygon',\n}\n"],"names":["__viteBrowserExternal","root","factory","module","this","CryptoJS","Math","undefined","crypto","global","require","require$$0","cryptoSecureRandomInt","create","F","obj","subtype","C","C_lib","Base","overrides","instance","properties","propertyName","WordArray","words","sigBytes","encoder","Hex","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","i","thatByte","j","clone","nBytes","C_enc","hexChars","bite","hexStr","hexStrLength","Latin1","latin1Chars","latin1Str","latin1StrLength","Utf8","utf8Str","BufferedBlockAlgorithm","data","doFlush","processedWords","dataWords","dataSigBytes","blockSize","blockSizeBytes","nBlocksReady","nWordsReady","nBytesReady","offset","cfg","messageUpdate","hash","hasher","message","key","C_algo","urlSafe","map","base64Chars","byte1","byte2","byte3","triplet","paddingChar","base64Str","base64StrLength","reverseMap","paddingIndex","parseLoop","bits1","bits2","bitsCombined","Hasher","H","K","isPrime","n","sqrtN","factor","getFractionalBits","nPrime","W","SHA256","M","a","b","c","d","e","f","g","h","gamma0x","gamma0","gamma1x","gamma1","ch","maj","sigma0","sigma1","t1","t2","nBitsTotal","nBitsLeft","generateRandomString","result","characters","charactersLength","counter","rest","url","method","body","headers","res","response","text","rfc3339","pad","timezoneOffset","sign","placeOrderMessage","amount","iban","urlEncoded","_a","value","MONERIUM_CONFIG","MoneriumClient","env","__privateAdd","_api","_isAuthCode","_isRefreshToken","_isClientCredentials","_env","_authPayload","__publicField","args","__privateSet","params","__privateMethod","isAuthCode_fn","isRefreshToken_fn","isClientCredentials_fn","api_fn","challenge","encodeBase64Url","__privateGet","profileId","filter","searchParams","orderId","order","req","document","resource","isFormEncoded","Currency","ProfileType","Permission","KYCState","KYCOutcome","PaymentStandard","OrderKind","OrderState","LINK_MESSAGE","Network","Chain"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAeA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A,CAAA,GA0FAC,uBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,WAAW,YAFDA,IAAAA,MAAA,CAAA,CAAA,GAKAC,uBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAFEA,IAAAA,MAAA,CAAA,CAAA,GAwBAC,uBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,YAAY,aACZA,EAAA,UAAU,WACVA,EAAA,YAAY,aAJFA,IAAAA,MAAA,CAAA,CAAA,GAOAC,uBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,WAAW,YACXA,EAAA,UAAU,WAHAA,IAAAA,MAAA,CAAA,CAAA,GAWAC,uBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,OAAO,QAFGA,IAAAA,MAAA,CAAA,CAAA,GAwCAC,uBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,MAAA,CAAA,CAAA,GAKAC,uBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,YAAY,aACZA,EAAA,WAAW,YAJDA,IAAAA,MAAA,CAAA,CAAA;ACvPL,MAAMC,KAAe;AAEhB,IAAAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,UAAU,WAJAA,IAAAA,KAAA,CAAA,CAAA,GAOAC,uBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,UAAU,WAHAA,IAAAA,MAAA,CAAA,CAAA;;;;;;;","x_google_ignoreList":[1,2,3]}
1
+ {"version":3,"file":"index.mjs","sources":["../__vite-browser-external","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/core.js","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/enc-base64url.js","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/sha256.js","../src/utils.ts","../src/config.ts","../src/client.ts","../src/types.ts","../src/constants.ts"],"sourcesContent":["export default {}",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64url encoding strategy.\n\t */\n\t var Base64url = C_enc.Base64url = {\n\t /**\n\t * Converts a word array to a Base64url string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {string} The Base64url string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);\n\t */\n\t stringify: function (wordArray, urlSafe=true) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = urlSafe ? this._safe_map : this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64url string to a word array.\n\t *\n\t * @param {string} base64Str The Base64url string.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64url.parse(base64String);\n\t */\n\t parse: function (base64Str, urlSafe=true) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = urlSafe ? this._safe_map : this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\t _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\treturn CryptoJS.enc.Base64url;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Initialization and round constants tables\n\t var H = [];\n\t var K = [];\n\n\t // Compute constants\n\t (function () {\n\t function isPrime(n) {\n\t var sqrtN = Math.sqrt(n);\n\t for (var factor = 2; factor <= sqrtN; factor++) {\n\t if (!(n % factor)) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t function getFractionalBits(n) {\n\t return ((n - (n | 0)) * 0x100000000) | 0;\n\t }\n\n\t var n = 2;\n\t var nPrime = 0;\n\t while (nPrime < 64) {\n\t if (isPrime(n)) {\n\t if (nPrime < 8) {\n\t H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t }\n\t K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t nPrime++;\n\t }\n\n\t n++;\n\t }\n\t }());\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-256 hash algorithm.\n\t */\n\t var SHA256 = C_algo.SHA256 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init(H.slice(0));\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\t var f = H[5];\n\t var g = H[6];\n\t var h = H[7];\n\n\t // Computation\n\t for (var i = 0; i < 64; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var gamma0x = W[i - 15];\n\t var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n\t ((gamma0x << 14) | (gamma0x >>> 18)) ^\n\t (gamma0x >>> 3);\n\n\t var gamma1x = W[i - 2];\n\t var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n\t ((gamma1x << 13) | (gamma1x >>> 19)) ^\n\t (gamma1x >>> 10);\n\n\t W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t }\n\n\t var ch = (e & f) ^ (~e & g);\n\t var maj = (a & b) ^ (a & c) ^ (b & c);\n\n\t var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n\t var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n\t var t1 = h + sigma1 + ch + K[i] + W[i];\n\t var t2 = sigma0 + maj;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t H[5] = (H[5] + f) | 0;\n\t H[6] = (H[6] + g) | 0;\n\t H[7] = (H[7] + h) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA256('message');\n\t * var hash = CryptoJS.SHA256(wordArray);\n\t */\n\t C.SHA256 = Hasher._createHelper(SHA256);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA256(message, key);\n\t */\n\t C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA256;\n\n}));","export const generateRandomString = () => {\n let result = '';\n const characters =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charactersLength = characters.length;\n let counter = 0;\n while (counter < 128) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n counter += 1;\n }\n return result;\n};\n\nexport const rest = async <T>(\n url: string,\n method: string,\n body?: BodyInit | Record<string, string>,\n headers?: Record<string, string>,\n): Promise<T> => {\n const res = await fetch(`${url}`, {\n method,\n headers,\n body: body as unknown as BodyInit,\n });\n\n let response;\n const text = await res.text();\n\n try {\n response = JSON.parse(text);\n } catch (err) {\n throw text;\n }\n\n if (!res.ok) {\n throw response;\n }\n\n return response as T;\n};\nexport const rfc3339 = (d: Date) => {\n if (d.toString() === 'Invalid Date') {\n throw d;\n }\n const pad = (n: number) => {\n return n < 10 ? '0' + n : n;\n };\n\n const timezoneOffset = (offset: number) => {\n if (offset === 0) {\n return 'Z';\n }\n const sign = offset > 0 ? '-' : '+';\n offset = Math.abs(offset);\n return sign + pad(Math.floor(offset / 60)) + ':' + pad(offset % 60);\n };\n\n return (\n d.getFullYear() +\n '-' +\n pad(d.getMonth() + 1) +\n '-' +\n pad(d.getDate()) +\n 'T' +\n pad(d.getHours()) +\n ':' +\n pad(d.getMinutes()) +\n ':' +\n pad(d.getSeconds()) +\n timezoneOffset(d.getTimezoneOffset())\n );\n};\n\n/**\n * The message to be signed when placing an order.\n *\n * @returns string\n */\nexport const placeOrderMessage = (amount: string | number, iban: string) =>\n `Send EUR ${amount} to ${iban} at ${rfc3339(new Date())}`;\n\n/**\n * Replacement for URLSearchParams, Metamask snaps do not include node globals.\n * It will not handle all special characters the same way as URLSearchParams, but it will be good enough for our use case.\n * @param body a json format of the body to be encoded\n * @returns 'application/x-www-form-urlencoded' compatible string\n */\nexport const urlEncoded = (\n body: Record<string, string>,\n): string | undefined => {\n return body && Object.entries(body)?.length > 0\n ? Object.entries(body)\n .map(\n ([key, value]) =>\n `${encodeURIComponent(key)}=${encodeURIComponent(value)}`,\n )\n .join('&')\n : '';\n};\n","import type { Config } from './types';\n\nconst MONERIUM_CONFIG: Config = {\n environments: {\n production: {\n api: 'https://api.monerium.app',\n web: 'https://monerium.app',\n },\n sandbox: {\n api: 'https://api.monerium.dev',\n web: 'https://sandbox.monerium.dev',\n },\n },\n};\n\nexport { MONERIUM_CONFIG };\n","import encodeBase64Url from 'crypto-js/enc-base64url';\nimport SHA256 from 'crypto-js/sha256';\nimport { generateRandomString, rest, urlEncoded } from './utils';\nimport { MONERIUM_CONFIG } from './config';\nimport type {\n AuthArgs,\n AuthCode,\n AuthContext,\n Balances,\n BearerProfile,\n ClientCredentials,\n Environment,\n LinkAddress,\n NewOrder,\n Order,\n OrderFilter,\n PKCERequest,\n PKCERequestArgs,\n Profile,\n RefreshToken,\n SupportingDoc,\n Token,\n} from './types';\n// import pjson from \"../package.json\";\n\nexport class MoneriumClient {\n #env: Environment;\n\n #authPayload?: string;\n /** The PKCE code verifier */\n codeVerifier?: string;\n bearerProfile?: BearerProfile;\n\n constructor(env: 'production' | 'sandbox' = 'sandbox') {\n this.#env = MONERIUM_CONFIG.environments[env];\n }\n\n // -- Authentication\n\n async auth(args: AuthArgs): Promise<BearerProfile> {\n let params: AuthCode | RefreshToken | ClientCredentials;\n\n if (this.#isAuthCode(args)) {\n params = { ...args, grant_type: 'authorization_code' };\n } else if (this.#isRefreshToken(args)) {\n params = { ...args, grant_type: 'refresh_token' };\n } else if (this.#isClientCredentials(args)) {\n params = { ...args, grant_type: 'client_credentials' };\n } else {\n throw new Error('Authentication method could not be detected.');\n }\n\n this.bearerProfile = (await this.#api(\n 'post',\n `auth/token`,\n params as unknown as Record<string, string>,\n true,\n )) as BearerProfile;\n\n this.#authPayload = `Bearer ${this.bearerProfile.access_token}`;\n return this.bearerProfile;\n }\n\n /**\n * Construct the url to the authorization code flow,\n * the code verifier is needed afterwards to obtain an access token and is therefore stored in `this.codeVerifier`\n * For automatic wallet link, add the following properties: `address`, `signature`, `chain` & `network`\n * @returns string\n */\n getAuthFlowURI(args: PKCERequestArgs): string {\n // Using crypto-js to generate a random string was causing the following error:\n // `Error: Native crypto module could not be used to get secure random number.`\n this.codeVerifier = generateRandomString();\n const challenge = encodeBase64Url.stringify(\n SHA256(this.codeVerifier as string),\n );\n\n const params: PKCERequest = {\n ...args,\n client_id: args?.client_id,\n code_challenge: challenge,\n code_challenge_method: 'S256',\n response_type: 'code',\n };\n\n return `${this.#env.api}/auth?${urlEncoded(params)}`;\n }\n\n /**\n * @deprecated since v2.0.7, use {@link getAuthFlowURI} instead.\n */\n pkceRequest = (args: PKCERequestArgs) => this.getAuthFlowURI(args);\n\n // -- Read Methods\n\n getAuthContext(): Promise<AuthContext> {\n return this.#api<AuthContext>('get', `auth/context`);\n }\n\n /**\n * @param {string} profileId - the id of the profile to fetch.\n */\n getProfile(profileId: string): Promise<Profile> {\n return this.#api<Profile>('get', `profiles/${profileId}`);\n }\n\n /**\n * @param {string=} profileId - the id of the profile to fetch balances.\n */\n getBalances(profileId?: string): Promise<Balances[]> {\n if (profileId) {\n return this.#api<Balances[]>('get', `profiles/${profileId}/balances`);\n } else {\n return this.#api<Balances[]>('get', `balances`);\n }\n }\n\n getOrders(filter?: OrderFilter): Promise<Order[]> {\n const searchParams = urlEncoded(filter as Record<string, string>);\n return this.#api<Order[]>('get', `orders?${searchParams}`);\n }\n\n getOrder(orderId: string): Promise<Order> {\n return this.#api<Order>('get', `orders/${orderId}`);\n }\n\n getTokens(): Promise<Token[]> {\n return this.#api<Token[]>('get', 'tokens');\n }\n\n // -- Write Methods\n\n linkAddress(profileId: string, body: LinkAddress) {\n return this.#api(\n 'post',\n `profiles/${profileId}/addresses`,\n JSON.stringify(body),\n );\n }\n\n placeOrder(order: NewOrder, profileId?: string): Promise<Order> {\n const req = { ...order, kind: 'redeem', currency: 'eur' };\n if (profileId) {\n return this.#api<Order>(\n 'post',\n `profiles/${profileId}/orders`,\n JSON.stringify(req),\n );\n } else {\n return this.#api<Order>('post', `orders`, JSON.stringify(req));\n }\n }\n\n uploadSupportingDocument(document: File): Promise<SupportingDoc> {\n const searchParams = urlEncoded(\n document as unknown as Record<string, string>,\n );\n\n return this.#api<SupportingDoc>(\n 'post',\n 'files/supporting-document',\n searchParams,\n true,\n );\n }\n\n // -- Helper Methods\n\n async #api<T>(\n method: string,\n resource: string,\n body?: BodyInit | Record<string, string>,\n isFormEncoded?: boolean,\n ): Promise<T> {\n return rest<T>(\n `${this.#env.api}/${resource}`,\n method,\n isFormEncoded ? urlEncoded(body as Record<string, string>) : body,\n {\n Authorization: this.#authPayload || '',\n 'Content-Type': `application/${\n isFormEncoded ? 'x-www-form-urlencoded' : 'json'\n }`,\n },\n );\n }\n\n #isAuthCode(args: AuthArgs): args is AuthCode {\n return (args as AuthCode).code != undefined;\n }\n\n #isRefreshToken(args: AuthArgs): args is RefreshToken {\n return (args as RefreshToken).refresh_token != undefined;\n }\n\n #isClientCredentials(args: AuthArgs): args is ClientCredentials {\n return (args as ClientCredentials).client_secret != undefined;\n }\n}\n","// --- Config --- //\n\nexport type Environment = { api: string; web: string };\n\nexport type Config = {\n environments: { production: Environment; sandbox: Environment };\n};\n\nexport type ENV = 'sandbox' | 'production';\n\nexport type EthereumTestnet = 'goerli';\nexport type GnosisTestnet = 'chiado';\nexport type PolygonTestnet = 'mumbai';\n\nexport type Chain = 'ethereum' | 'gnosis' | 'polygon';\nexport type Networks =\n | EthereumTestnet\n | GnosisTestnet\n | PolygonTestnet\n | 'mainnet';\n\n// -- Commons\nexport type NetworkSemiStrict<C extends Chain> = C extends 'ethereum'\n ? EthereumTestnet | 'mainnet'\n : C extends 'gnosis'\n ? GnosisTestnet | 'mainnet'\n : C extends 'polygon'\n ? PolygonTestnet | 'mainnet'\n : never;\n\nexport type NetworkStrict<\n C extends Chain,\n E extends ENV,\n> = E extends 'production'\n ? 'mainnet'\n : E extends 'sandbox'\n ? C extends 'ethereum'\n ? EthereumTestnet\n : C extends 'gnosis'\n ? GnosisTestnet\n : C extends 'polygon'\n ? PolygonTestnet\n : never\n : never;\n\n/*\n * -- isValid:\n * const network: Network<'ethereum', 'sandbox'> = 'goerli';\n * const network: Network<'ethereum'> = 'mainnet';\n * const network: Network<'ethereum'> = 'goerli'\n * const network: Network = 'chiado'\n *\n * -- isInValid:\n * const network: Network<'ethereum', 'sandbox'> = 'chiado';\n * const network: Network<'ethereum'> = 'chiado';\n */\nexport type Network<\n C extends Chain = Chain,\n E extends ENV = ENV,\n> = C extends Chain\n ? E extends ENV\n ? NetworkStrict<C, E> & NetworkSemiStrict<C>\n : never\n : never;\n\nexport enum Currency {\n eur = 'eur',\n // usd = 'usd',\n // gbp = 'gbp',\n // isk = 'isk',\n}\n\n// -- auth\n\nexport type AuthArgs =\n | Omit<AuthCode, 'grant_type'>\n | Omit<RefreshToken, 'grant_type'>\n | Omit<ClientCredentials, 'grant_type'>;\n\nexport interface AuthCode {\n grant_type: 'authorization_code';\n client_id: string;\n code: string;\n code_verifier: string;\n redirect_uri: string;\n scope?: string;\n}\n\nexport interface BearerProfile {\n access_token: string;\n token_type: string;\n expires_in: number;\n refresh_token: string;\n profile: string;\n userId: string;\n}\n\nexport interface RefreshToken {\n grant_type: 'refresh_token';\n client_id: string;\n refresh_token: string;\n scope?: string;\n}\n\nexport interface ClientCredentials {\n grant_type: 'client_credentials';\n client_id: string;\n client_secret: string;\n scope?: string;\n}\n\n// -- pkceRequest\n\n/**\n * @returns A {@link PKCERequest} object with properties omitted that are automatically computed in by the SDK.\n */\nexport type PKCERequestArgs = Omit<\n PKCERequest,\n 'code_challenge' | 'code_challenge_method' | 'response_type'\n>;\n\nexport type PKCERequest = {\n /** the authentication flow client id of the application */\n client_id: string;\n /** the code challenge automatically generated by the SDK */\n code_challenge: string;\n /** the code challenge method for the authentication flow , handled by the SDK */\n code_challenge_method: 'S256';\n /** the response type of the authentication flow, handled by the SDK */\n response_type: 'code';\n /** the state of the application */\n state?: string;\n /** the redirect uri of the application */\n redirect_uri?: string;\n /** the scope of the application */\n scope?: string;\n /** the address of the wallet to automatically link */\n address?: string;\n /** the signature of the wallet to automatically link */\n signature?: string;\n /** the network of the wallet to automatically link */\n network?: Network;\n /** the chain of the wallet to automatically link */\n chain?: Chain;\n};\n\n// -- authContext\n\nenum Method {\n password = 'password',\n resource = 'resource',\n jwt = 'jwt',\n apiKey = 'apiKey',\n}\n\nexport enum ProfileType {\n corporate = 'corporate',\n personal = 'personal',\n}\n\nexport enum Permission {\n read = 'read',\n write = 'write',\n}\n\nexport interface AuthProfile {\n id: string;\n type: ProfileType;\n name: string;\n perms: Permission[];\n}\n\nexport interface AuthContext {\n userId: string;\n email: string;\n name: string;\n roles: 'admin'[];\n auth: { method: Method; subject: string; verified: boolean };\n defaultProfile: string;\n profiles: AuthProfile[];\n}\n\n// -- getProfile\n\nexport enum KYCState {\n absent = 'absent',\n submitted = 'submitted',\n pending = 'pending',\n confirmed = 'confirmed',\n}\n\nexport enum KYCOutcome {\n approved = 'approved',\n rejected = 'rejected',\n unknown = 'unknown',\n}\n\nexport enum AccountState {\n requested = 'requested',\n approved = 'approved',\n pending = 'pending',\n}\n\nexport interface KYC {\n state: KYCState;\n outcome: KYCOutcome;\n}\n\nexport enum PaymentStandard {\n iban = 'iban',\n scan = 'scan',\n}\n\nexport interface Account {\n address: string;\n currency: Currency;\n standard: PaymentStandard;\n iban?: string;\n // sortCode?: string;\n // accountNumber?: string;\n network: Network;\n chain: Chain;\n id?: string;\n state?: AccountState;\n}\n\nexport interface Profile {\n id: string;\n name: string;\n kyc: KYC;\n accounts: Account[];\n}\n\n// -- getBalances\nexport interface Balance {\n currency: Currency;\n amount: string;\n}\n\nexport interface Balances {\n id: string;\n address: string;\n chain: Chain;\n network: Network;\n balances: Balance[];\n}\n\n// --getOrders\n\nexport enum OrderKind {\n redeem = 'redeem',\n issue = 'issue',\n}\n\nexport enum OrderState {\n placed = 'placed',\n pending = 'pending',\n processed = 'processed',\n rejected = 'rejected',\n}\n\nexport interface Fee {\n provider: 'satchel';\n currency: Currency;\n amount: string;\n}\n\nexport interface IBAN {\n standard: PaymentStandard.iban;\n iban: string;\n}\n\nexport interface SCAN {\n standard: PaymentStandard.scan;\n sortCode: string;\n accountNumber: string;\n}\n\nexport interface Individual {\n firstName: string;\n lastName: string;\n country?: string;\n}\n\nexport interface Corporation {\n companyName: string;\n country: string;\n}\n\nexport interface Counterpart {\n identifier: IBAN | SCAN;\n details: Individual | Corporation;\n}\n\nexport interface OrderMetadata {\n approvedAt: string;\n processedAt: string;\n rejectedAt: string;\n state: OrderState;\n placedBy: string;\n placedAt: string;\n receivedAmount: string;\n sentAmount: string;\n}\n\nexport interface OrderFilter {\n address?: string;\n txHash?: string;\n profile?: string;\n memo?: string;\n accountId?: string;\n state?: OrderState;\n}\n\nexport interface Order {\n id: string;\n profile: string;\n accountId: string;\n address: string;\n kind: OrderKind;\n amount: string;\n currency: Currency;\n totalFee: string;\n fees: Fee[];\n counterpart: Counterpart;\n memo: string;\n rejectedReason: string;\n supportingDocumentId: string;\n meta: OrderMetadata;\n}\n\n// -- getTokens\n\nexport interface Token {\n currency: Currency;\n ticker: string;\n symbol: string;\n chain: Chain;\n network: Network;\n address: string;\n decimals: number;\n}\n\n// --placeOrder\n\nexport type NewOrder = NewOrderByAddress | NewOrderByAccountId;\n\nexport interface NewOrderCommon {\n amount: string;\n signature: string;\n // currency: Currency;\n counterpart: Counterpart;\n message: string;\n memo?: string;\n supportingDocumentId?: string;\n}\nexport interface NewOrderByAddress extends NewOrderCommon {\n address: string;\n chain: Chain;\n network: Network;\n}\nexport interface NewOrderByAccountId extends NewOrderCommon {\n accountId: string;\n}\n\n// -- uploadSupportingDocument\n\nexport interface SupportingDocMetadata {\n uploadedBy: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface SupportingDoc {\n id: string;\n name: string;\n type: string;\n size: number;\n hash: string;\n meta: SupportingDocMetadata;\n}\n\n// -- linkAddress\n\nexport interface CurrencyAccounts {\n network: Network;\n chain: Chain;\n currency: Currency;\n}\n\nexport interface LinkAddress {\n address: string;\n message: string;\n signature: string;\n accounts: CurrencyAccounts[];\n network?: Network;\n chain?: Chain;\n}\n","export const LINK_MESSAGE = `I hereby declare that I am the address owner.`;\n\nexport enum Network {\n Goerli = 'goerli',\n Chiado = 'chiado',\n Mumbai = 'mumbai',\n Mainnet = 'mainnet',\n}\n\nexport enum Chain {\n Ethereum = 'ethereum',\n Gnosis = 'gnosis',\n Polygon = 'polygon',\n}\n"],"names":["__viteBrowserExternal","root","factory","module","this","CryptoJS","Math","undefined","crypto","global","require","require$$0","cryptoSecureRandomInt","create","F","obj","subtype","C","C_lib","Base","overrides","instance","properties","propertyName","WordArray","words","sigBytes","encoder","Hex","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","i","thatByte","j","clone","nBytes","C_enc","hexChars","bite","hexStr","hexStrLength","Latin1","latin1Chars","latin1Str","latin1StrLength","Utf8","utf8Str","BufferedBlockAlgorithm","data","doFlush","processedWords","dataWords","dataSigBytes","blockSize","blockSizeBytes","nBlocksReady","nWordsReady","nBytesReady","offset","cfg","messageUpdate","hash","hasher","message","key","C_algo","urlSafe","map","base64Chars","byte1","byte2","byte3","triplet","paddingChar","base64Str","base64StrLength","reverseMap","paddingIndex","parseLoop","bits1","bits2","bitsCombined","Hasher","H","K","isPrime","n","sqrtN","factor","getFractionalBits","nPrime","W","SHA256","M","a","b","c","d","e","f","g","h","gamma0x","gamma0","gamma1x","gamma1","ch","maj","sigma0","sigma1","t1","t2","nBitsTotal","nBitsLeft","generateRandomString","result","characters","charactersLength","counter","rest","url","method","body","headers","res","response","text","rfc3339","pad","timezoneOffset","sign","placeOrderMessage","amount","iban","urlEncoded","_a","value","MONERIUM_CONFIG","MoneriumClient","env","__privateAdd","_api","_isAuthCode","_isRefreshToken","_isClientCredentials","_env","_authPayload","__publicField","args","__privateSet","params","__privateMethod","isAuthCode_fn","isRefreshToken_fn","isClientCredentials_fn","api_fn","challenge","encodeBase64Url","__privateGet","profileId","filter","searchParams","orderId","order","req","document","resource","isFormEncoded","Currency","ProfileType","Permission","KYCState","KYCOutcome","AccountState","PaymentStandard","OrderKind","OrderState","LINK_MESSAGE","Network","Chain"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAeA,KAAA,CAAA;;;;;;;ACAd,KAAC,SAAUC,GAAMC,GAAS;AAGzB,MAAAC,EAAiB,UAAUD;IAU5B,GAACE,GAAM,WAAY;AAOnB,U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EAAA,OAAO,QACPA,EAAA,QAAQ,SAFEA,IAAAA,MAAA,CAAA,CAAA,GAwBAC,uBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,YAAY,aACZA,EAAA,UAAU,WACVA,EAAA,YAAY,aAJFA,IAAAA,MAAA,CAAA,CAAA,GAOAC,uBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,WAAW,YACXA,EAAA,UAAU,WAHAA,IAAAA,MAAA,CAAA,CAAA,GAMAC,uBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,UAAU,WAHAA,IAAAA,MAAA,CAAA,CAAA,GAWAC,uBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,OAAO,QAFGA,IAAAA,MAAA,CAAA,CAAA,GAyCAC,uBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,QAAQ,SAFEA,IAAAA,MAAA,CAAA,CAAA,GAKAC,uBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WACVA,EAAA,YAAY,aACZA,EAAA,WAAW,YAJDA,IAAAA,MAAA,CAAA,CAAA;AC9PL,MAAMC,KAAe;AAEhB,IAAAC,sBAAAA,OACVA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,UAAU,WAJAA,IAAAA,KAAA,CAAA,CAAA,GAOAC,uBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,SAAS,UACTA,EAAA,UAAU,WAHAA,IAAAA,MAAA,CAAA,CAAA;;;;;;;","x_google_ignoreList":[1,2,3]}
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(c,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(c=typeof globalThis<"u"?globalThis:c||self,u(c["monerium-sdk"]={}))})(this,function(c){var T,j,A,R,U,ue,L,fe,D,le;"use strict";var Re=Object.defineProperty;var He=(c,u,_)=>u in c?Re(c,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):c[u]=_;var F=(c,u,_)=>(He(c,typeof u!="symbol"?u+"":u,_),_),V=(c,u,_)=>{if(!u.has(c))throw TypeError("Cannot "+_)};var G=(c,u,_)=>(V(c,u,"read from private field"),_?_.call(c):u.get(c)),M=(c,u,_)=>{if(u.has(c))throw TypeError("Cannot add the same private member more than once");u instanceof WeakSet?u.add(c):u.set(c,_)},J=(c,u,_,E)=>(V(c,u,"write to private field"),E?E.call(c,_):u.set(c,_),_);var S=(c,u,_)=>(V(c,u,"access private method"),_);var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function o(){if(this instanceof o){var v=[null];v.push.apply(v,arguments);var p=Function.bind.apply(t,v);return new p}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var v=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(i,o,v.get?v:{enumerable:!0,get:function(){return e[o]}})}),i}var E={},he={get exports(){return E},set exports(e){E=e}};function de(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var W={},pe={get exports(){return W},set exports(e){W=e}};const ve=_(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Z;function Q(){return Z||(Z=1,function(e,t){(function(i,o){e.exports=o()})(u,function(){var i=i||function(o,v){var p;if(typeof window<"u"&&window.crypto&&(p=window.crypto),typeof self<"u"&&self.crypto&&(p=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(p=globalThis.crypto),!p&&typeof window<"u"&&window.msCrypto&&(p=window.msCrypto),!p&&typeof u<"u"&&u.crypto&&(p=u.crypto),!p&&typeof de=="function")try{p=ve}catch{}var $=function(){if(p){if(typeof p.getRandomValues=="function")try{return p.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof p.randomBytes=="function")try{return p.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},H=Object.create||function(){function r(){}return function(n){var a;return r.prototype=n,a=new r,r.prototype=null,a}}(),B={},P=B.lib={},b=P.Base=function(){return{extend:function(r){var n=H(this);return r&&n.mixIn(r),(!n.hasOwnProperty("init")||this.init===n.init)&&(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var r=this.extend();return r.init.apply(r,arguments),r},init:function(){},mixIn:function(r){for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=P.WordArray=b.extend({init:function(r,n){r=this.words=r||[],n!=v?this.sigBytes=n:this.sigBytes=r.length*4},toString:function(r){return(r||l).stringify(this)},concat:function(r){var n=this.words,a=r.words,f=this.sigBytes,y=r.sigBytes;if(this.clamp(),f%4)for(var w=0;w<y;w++){var x=a[w>>>2]>>>24-w%4*8&255;n[f+w>>>2]|=x<<24-(f+w)%4*8}else for(var C=0;C<y;C+=4)n[f+C>>>2]=a[C>>>2];return this.sigBytes+=y,this},clamp:function(){var r=this.words,n=this.sigBytes;r[n>>>2]&=4294967295<<32-n%4*8,r.length=o.ceil(n/4)},clone:function(){var r=b.clone.call(this);return r.words=this.words.slice(0),r},random:function(r){for(var n=[],a=0;a<r;a+=4)n.push($());return new g.init(n,r)}}),m=B.enc={},l=m.Hex={stringify:function(r){for(var n=r.words,a=r.sigBytes,f=[],y=0;y<a;y++){var w=n[y>>>2]>>>24-y%4*8&255;f.push((w>>>4).toString(16)),f.push((w&15).toString(16))}return f.join("")},parse:function(r){for(var n=r.length,a=[],f=0;f<n;f+=2)a[f>>>3]|=parseInt(r.substr(f,2),16)<<24-f%8*4;return new g.init(a,n/2)}},d=m.Latin1={stringify:function(r){for(var n=r.words,a=r.sigBytes,f=[],y=0;y<a;y++){var w=n[y>>>2]>>>24-y%4*8&255;f.push(String.fromCharCode(w))}return f.join("")},parse:function(r){for(var n=r.length,a=[],f=0;f<n;f++)a[f>>>2]|=(r.charCodeAt(f)&255)<<24-f%4*8;return new g.init(a,n)}},s=m.Utf8={stringify:function(r){try{return decodeURIComponent(escape(d.stringify(r)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(r){return d.parse(unescape(encodeURIComponent(r)))}},h=P.BufferedBlockAlgorithm=b.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(r){typeof r=="string"&&(r=s.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes},_process:function(r){var n,a=this._data,f=a.words,y=a.sigBytes,w=this.blockSize,x=w*4,C=y/x;r?C=o.ceil(C):C=o.max((C|0)-this._minBufferSize,0);var z=C*w,k=o.min(z*4,y);if(z){for(var I=0;I<z;I+=w)this._doProcessBlock(f,I);n=f.splice(0,z),a.sigBytes-=k}return new g.init(n,k)},clone:function(){var r=b.clone.call(this);return r._data=this._data.clone(),r},_minBufferSize:0});P.Hasher=h.extend({cfg:b.extend(),init:function(r){this.cfg=this.cfg.extend(r),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(r){return this._append(r),this._process(),this},finalize:function(r){r&&this._append(r);var n=this._doFinalize();return n},blockSize:16,_createHelper:function(r){return function(n,a){return new r.init(a).finalize(n)}},_createHmacHelper:function(r){return function(n,a){return new O.HMAC.init(r,a).finalize(n)}}});var O=B.algo={};return B}(Math);return i})}(pe)),W}(function(e,t){(function(i,o){e.exports=o(Q())})(u,function(i){return function(){var o=i,v=o.lib,p=v.WordArray,$=o.enc;$.Base64url={stringify:function(B,P=!0){var b=B.words,g=B.sigBytes,m=P?this._safe_map:this._map;B.clamp();for(var l=[],d=0;d<g;d+=3)for(var s=b[d>>>2]>>>24-d%4*8&255,h=b[d+1>>>2]>>>24-(d+1)%4*8&255,O=b[d+2>>>2]>>>24-(d+2)%4*8&255,r=s<<16|h<<8|O,n=0;n<4&&d+n*.75<g;n++)l.push(m.charAt(r>>>6*(3-n)&63));var a=m.charAt(64);if(a)for(;l.length%4;)l.push(a);return l.join("")},parse:function(B,P=!0){var b=B.length,g=P?this._safe_map:this._map,m=this._reverseMap;if(!m){m=this._reverseMap=[];for(var l=0;l<g.length;l++)m[g.charCodeAt(l)]=l}var d=g.charAt(64);if(d){var s=B.indexOf(d);s!==-1&&(b=s)}return H(B,b,m)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function H(B,P,b){for(var g=[],m=0,l=0;l<P;l++)if(l%4){var d=b[B.charCodeAt(l-1)]<<l%4*2,s=b[B.charCodeAt(l)]>>>6-l%4*2,h=d|s;g[m>>>2]|=h<<24-m%4*8,m++}return p.create(g,m)}}(),i.enc.Base64url})})(he);var N={},ge={get exports(){return N},set exports(e){N=e}};(function(e,t){(function(i,o){e.exports=o(Q())})(u,function(i){return function(o){var v=i,p=v.lib,$=p.WordArray,H=p.Hasher,B=v.algo,P=[],b=[];(function(){function l(O){for(var r=o.sqrt(O),n=2;n<=r;n++)if(!(O%n))return!1;return!0}function d(O){return(O-(O|0))*4294967296|0}for(var s=2,h=0;h<64;)l(s)&&(h<8&&(P[h]=d(o.pow(s,1/2))),b[h]=d(o.pow(s,1/3)),h++),s++})();var g=[],m=B.SHA256=H.extend({_doReset:function(){this._hash=new $.init(P.slice(0))},_doProcessBlock:function(l,d){for(var s=this._hash.words,h=s[0],O=s[1],r=s[2],n=s[3],a=s[4],f=s[5],y=s[6],w=s[7],x=0;x<64;x++){if(x<16)g[x]=l[d+x]|0;else{var C=g[x-15],z=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,k=g[x-2],I=(k<<15|k>>>17)^(k<<13|k>>>19)^k>>>10;g[x]=z+g[x-7]+I+g[x-16]}var Ce=a&f^~a&y,Se=h&O^h&r^O&r,Ae=(h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22),Oe=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),ce=w+Oe+Ce+b[x]+g[x],Pe=Ae+Se;w=y,y=f,f=a,a=n+ce|0,n=r,r=O,O=h,h=ce+Pe|0}s[0]=s[0]+h|0,s[1]=s[1]+O|0,s[2]=s[2]+r|0,s[3]=s[3]+n|0,s[4]=s[4]+a|0,s[5]=s[5]+f|0,s[6]=s[6]+y|0,s[7]=s[7]+w|0},_doFinalize:function(){var l=this._data,d=l.words,s=this._nDataBytes*8,h=l.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=o.floor(s/4294967296),d[(h+64>>>9<<4)+15]=s,l.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var l=H.clone.call(this);return l._hash=this._hash.clone(),l}});v.SHA256=H._createHelper(m),v.HmacSHA256=H._createHmacHelper(m)}(Math),i.SHA256})})(ge);const ye=()=>{let e="";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=t.length;let o=0;for(;o<128;)e+=t.charAt(Math.floor(Math.random()*i)),o+=1;return e},_e=async(e,t,i,o)=>{const v=await fetch(`${e}`,{method:t,headers:o,body:i});let p;const $=await v.text();try{p=JSON.parse($)}catch{throw $}if(!v.ok)throw p;return p},X=e=>{if(e.toString()==="Invalid Date")throw e;const t=o=>o<10?"0"+o:o,i=o=>{if(o===0)return"Z";const v=o>0?"-":"+";return o=Math.abs(o),v+t(Math.floor(o/60))+":"+t(o%60)};return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+i(e.getTimezoneOffset())},me=(e,t)=>`Send EUR ${e} to ${t} at ${X(new Date)}`,q=e=>{var t;return e&&((t=Object.entries(e))==null?void 0:t.length)>0?Object.entries(e).map(([i,o])=>`${encodeURIComponent(i)}=${encodeURIComponent(o)}`).join("&"):""},we={environments:{production:{api:"https://api.monerium.app",web:"https://monerium.app"},sandbox:{api:"https://api.monerium.dev",web:"https://sandbox.monerium.dev"}}};class be{constructor(t="sandbox"){M(this,A);M(this,U);M(this,L);M(this,D);M(this,T,void 0);M(this,j,void 0);F(this,"codeVerifier");F(this,"bearerProfile");F(this,"pkceRequest",t=>this.getAuthFlowURI(t));J(this,T,we.environments[t])}async auth(t){let i;if(S(this,U,ue).call(this,t))i={...t,grant_type:"authorization_code"};else if(S(this,L,fe).call(this,t))i={...t,grant_type:"refresh_token"};else if(S(this,D,le).call(this,t))i={...t,grant_type:"client_credentials"};else throw new Error("Authentication method could not be detected.");return this.bearerProfile=await S(this,A,R).call(this,"post","auth/token",i,!0),J(this,j,`Bearer ${this.bearerProfile.access_token}`),this.bearerProfile}getAuthFlowURI(t){this.codeVerifier=ye();const i=E.stringify(N(this.codeVerifier)),o={...t,client_id:t==null?void 0:t.client_id,code_challenge:i,code_challenge_method:"S256",response_type:"code"};return`${G(this,T).api}/auth?${q(o)}`}getAuthContext(){return S(this,A,R).call(this,"get","auth/context")}getProfile(t){return S(this,A,R).call(this,"get",`profiles/${t}`)}getBalances(t){return t?S(this,A,R).call(this,"get",`profiles/${t}/balances`):S(this,A,R).call(this,"get","balances")}getOrders(t){const i=q(t);return S(this,A,R).call(this,"get",`orders?${i}`)}getOrder(t){return S(this,A,R).call(this,"get",`orders/${t}`)}getTokens(){return S(this,A,R).call(this,"get","tokens")}linkAddress(t,i){return S(this,A,R).call(this,"post",`profiles/${t}/addresses`,JSON.stringify(i))}placeOrder(t,i){const o={...t,kind:"redeem",currency:"eur"};return i?S(this,A,R).call(this,"post",`profiles/${i}/orders`,JSON.stringify(o)):S(this,A,R).call(this,"post","orders",JSON.stringify(o))}uploadSupportingDocument(t){const i=q(t);return S(this,A,R).call(this,"post","files/supporting-document",i,!0)}}T=new WeakMap,j=new WeakMap,A=new WeakSet,R=async function(t,i,o,v){return _e(`${G(this,T).api}/${i}`,t,v?q(o):o,{Authorization:G(this,j)||"","Content-Type":`application/${v?"x-www-form-urlencoded":"json"}`})},U=new WeakSet,ue=function(t){return t.code!=null},L=new WeakSet,fe=function(t){return t.refresh_token!=null},D=new WeakSet,le=function(t){return t.client_secret!=null};var K=(e=>(e.eur="eur",e))(K||{}),Y=(e=>(e.corporate="corporate",e.personal="personal",e))(Y||{}),ee=(e=>(e.read="read",e.write="write",e))(ee||{}),re=(e=>(e.absent="absent",e.submitted="submitted",e.pending="pending",e.confirmed="confirmed",e))(re||{}),te=(e=>(e.approved="approved",e.rejected="rejected",e.unknown="unknown",e))(te||{}),ne=(e=>(e.iban="iban",e.scan="scan",e))(ne||{}),oe=(e=>(e.redeem="redeem",e.issue="issue",e))(oe||{}),ie=(e=>(e.placed="placed",e.pending="pending",e.processed="processed",e.rejected="rejected",e))(ie||{});const Be="I hereby declare that I am the address owner.";var se=(e=>(e.Goerli="goerli",e.Chiado="chiado",e.Mumbai="mumbai",e.Mainnet="mainnet",e))(se||{}),ae=(e=>(e.Ethereum="ethereum",e.Gnosis="gnosis",e.Polygon="polygon",e))(ae||{});const xe=Object.freeze(Object.defineProperty({__proto__:null,Chain:ae,LINK_MESSAGE:Be,Network:se},Symbol.toStringTag,{value:"Module"}));c.Currency=K,c.KYCOutcome=te,c.KYCState=re,c.MoneriumClient=be,c.OrderKind=oe,c.OrderState=ie,c.PaymentStandard=ne,c.Permission=ee,c.ProfileType=Y,c.constants=xe,c.placeOrderMessage=me,c.rfc3339=X,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(c,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(c=typeof globalThis<"u"?globalThis:c||self,u(c["monerium-sdk"]={}))})(this,function(c){var T,j,O,R,U,fe,L,le,D,he;"use strict";var He=Object.defineProperty;var $e=(c,u,_)=>u in c?He(c,u,{enumerable:!0,configurable:!0,writable:!0,value:_}):c[u]=_;var F=(c,u,_)=>($e(c,typeof u!="symbol"?u+"":u,_),_),V=(c,u,_)=>{if(!u.has(c))throw TypeError("Cannot "+_)};var G=(c,u,_)=>(V(c,u,"read from private field"),_?_.call(c):u.get(c)),M=(c,u,_)=>{if(u.has(c))throw TypeError("Cannot add the same private member more than once");u instanceof WeakSet?u.add(c):u.set(c,_)},J=(c,u,_,E)=>(V(c,u,"write to private field"),E?E.call(c,_):u.set(c,_),_);var S=(c,u,_)=>(V(c,u,"access private method"),_);var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var i=function o(){if(this instanceof o){var v=[null];v.push.apply(v,arguments);var p=Function.bind.apply(t,v);return new p}return t.apply(this,arguments)};i.prototype=t.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var v=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(i,o,v.get?v:{enumerable:!0,get:function(){return e[o]}})}),i}var E={},de={get exports(){return E},set exports(e){E=e}};function pe(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var I={},ve={get exports(){return I},set exports(e){I=e}};const ge=_(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Z;function Q(){return Z||(Z=1,function(e,t){(function(i,o){e.exports=o()})(u,function(){var i=i||function(o,v){var p;if(typeof window<"u"&&window.crypto&&(p=window.crypto),typeof self<"u"&&self.crypto&&(p=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(p=globalThis.crypto),!p&&typeof window<"u"&&window.msCrypto&&(p=window.msCrypto),!p&&typeof u<"u"&&u.crypto&&(p=u.crypto),!p&&typeof pe=="function")try{p=ge}catch{}var $=function(){if(p){if(typeof p.getRandomValues=="function")try{return p.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof p.randomBytes=="function")try{return p.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},H=Object.create||function(){function r(){}return function(n){var a;return r.prototype=n,a=new r,r.prototype=null,a}}(),B={},P=B.lib={},b=P.Base=function(){return{extend:function(r){var n=H(this);return r&&n.mixIn(r),(!n.hasOwnProperty("init")||this.init===n.init)&&(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var r=this.extend();return r.init.apply(r,arguments),r},init:function(){},mixIn:function(r){for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);r.hasOwnProperty("toString")&&(this.toString=r.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=P.WordArray=b.extend({init:function(r,n){r=this.words=r||[],n!=v?this.sigBytes=n:this.sigBytes=r.length*4},toString:function(r){return(r||l).stringify(this)},concat:function(r){var n=this.words,a=r.words,f=this.sigBytes,y=r.sigBytes;if(this.clamp(),f%4)for(var w=0;w<y;w++){var x=a[w>>>2]>>>24-w%4*8&255;n[f+w>>>2]|=x<<24-(f+w)%4*8}else for(var C=0;C<y;C+=4)n[f+C>>>2]=a[C>>>2];return this.sigBytes+=y,this},clamp:function(){var r=this.words,n=this.sigBytes;r[n>>>2]&=4294967295<<32-n%4*8,r.length=o.ceil(n/4)},clone:function(){var r=b.clone.call(this);return r.words=this.words.slice(0),r},random:function(r){for(var n=[],a=0;a<r;a+=4)n.push($());return new g.init(n,r)}}),m=B.enc={},l=m.Hex={stringify:function(r){for(var n=r.words,a=r.sigBytes,f=[],y=0;y<a;y++){var w=n[y>>>2]>>>24-y%4*8&255;f.push((w>>>4).toString(16)),f.push((w&15).toString(16))}return f.join("")},parse:function(r){for(var n=r.length,a=[],f=0;f<n;f+=2)a[f>>>3]|=parseInt(r.substr(f,2),16)<<24-f%8*4;return new g.init(a,n/2)}},d=m.Latin1={stringify:function(r){for(var n=r.words,a=r.sigBytes,f=[],y=0;y<a;y++){var w=n[y>>>2]>>>24-y%4*8&255;f.push(String.fromCharCode(w))}return f.join("")},parse:function(r){for(var n=r.length,a=[],f=0;f<n;f++)a[f>>>2]|=(r.charCodeAt(f)&255)<<24-f%4*8;return new g.init(a,n)}},s=m.Utf8={stringify:function(r){try{return decodeURIComponent(escape(d.stringify(r)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(r){return d.parse(unescape(encodeURIComponent(r)))}},h=P.BufferedBlockAlgorithm=b.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(r){typeof r=="string"&&(r=s.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes},_process:function(r){var n,a=this._data,f=a.words,y=a.sigBytes,w=this.blockSize,x=w*4,C=y/x;r?C=o.ceil(C):C=o.max((C|0)-this._minBufferSize,0);var z=C*w,k=o.min(z*4,y);if(z){for(var q=0;q<z;q+=w)this._doProcessBlock(f,q);n=f.splice(0,z),a.sigBytes-=k}return new g.init(n,k)},clone:function(){var r=b.clone.call(this);return r._data=this._data.clone(),r},_minBufferSize:0});P.Hasher=h.extend({cfg:b.extend(),init:function(r){this.cfg=this.cfg.extend(r),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(r){return this._append(r),this._process(),this},finalize:function(r){r&&this._append(r);var n=this._doFinalize();return n},blockSize:16,_createHelper:function(r){return function(n,a){return new r.init(a).finalize(n)}},_createHmacHelper:function(r){return function(n,a){return new A.HMAC.init(r,a).finalize(n)}}});var A=B.algo={};return B}(Math);return i})}(ve)),I}(function(e,t){(function(i,o){e.exports=o(Q())})(u,function(i){return function(){var o=i,v=o.lib,p=v.WordArray,$=o.enc;$.Base64url={stringify:function(B,P=!0){var b=B.words,g=B.sigBytes,m=P?this._safe_map:this._map;B.clamp();for(var l=[],d=0;d<g;d+=3)for(var s=b[d>>>2]>>>24-d%4*8&255,h=b[d+1>>>2]>>>24-(d+1)%4*8&255,A=b[d+2>>>2]>>>24-(d+2)%4*8&255,r=s<<16|h<<8|A,n=0;n<4&&d+n*.75<g;n++)l.push(m.charAt(r>>>6*(3-n)&63));var a=m.charAt(64);if(a)for(;l.length%4;)l.push(a);return l.join("")},parse:function(B,P=!0){var b=B.length,g=P?this._safe_map:this._map,m=this._reverseMap;if(!m){m=this._reverseMap=[];for(var l=0;l<g.length;l++)m[g.charCodeAt(l)]=l}var d=g.charAt(64);if(d){var s=B.indexOf(d);s!==-1&&(b=s)}return H(B,b,m)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function H(B,P,b){for(var g=[],m=0,l=0;l<P;l++)if(l%4){var d=b[B.charCodeAt(l-1)]<<l%4*2,s=b[B.charCodeAt(l)]>>>6-l%4*2,h=d|s;g[m>>>2]|=h<<24-m%4*8,m++}return p.create(g,m)}}(),i.enc.Base64url})})(de);var N={},ye={get exports(){return N},set exports(e){N=e}};(function(e,t){(function(i,o){e.exports=o(Q())})(u,function(i){return function(o){var v=i,p=v.lib,$=p.WordArray,H=p.Hasher,B=v.algo,P=[],b=[];(function(){function l(A){for(var r=o.sqrt(A),n=2;n<=r;n++)if(!(A%n))return!1;return!0}function d(A){return(A-(A|0))*4294967296|0}for(var s=2,h=0;h<64;)l(s)&&(h<8&&(P[h]=d(o.pow(s,1/2))),b[h]=d(o.pow(s,1/3)),h++),s++})();var g=[],m=B.SHA256=H.extend({_doReset:function(){this._hash=new $.init(P.slice(0))},_doProcessBlock:function(l,d){for(var s=this._hash.words,h=s[0],A=s[1],r=s[2],n=s[3],a=s[4],f=s[5],y=s[6],w=s[7],x=0;x<64;x++){if(x<16)g[x]=l[d+x]|0;else{var C=g[x-15],z=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,k=g[x-2],q=(k<<15|k>>>17)^(k<<13|k>>>19)^k>>>10;g[x]=z+g[x-7]+q+g[x-16]}var Se=a&f^~a&y,Oe=h&A^h&r^A&r,Ae=(h<<30|h>>>2)^(h<<19|h>>>13)^(h<<10|h>>>22),Pe=(a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25),ue=w+Pe+Se+b[x]+g[x],Re=Ae+Oe;w=y,y=f,f=a,a=n+ue|0,n=r,r=A,A=h,h=ue+Re|0}s[0]=s[0]+h|0,s[1]=s[1]+A|0,s[2]=s[2]+r|0,s[3]=s[3]+n|0,s[4]=s[4]+a|0,s[5]=s[5]+f|0,s[6]=s[6]+y|0,s[7]=s[7]+w|0},_doFinalize:function(){var l=this._data,d=l.words,s=this._nDataBytes*8,h=l.sigBytes*8;return d[h>>>5]|=128<<24-h%32,d[(h+64>>>9<<4)+14]=o.floor(s/4294967296),d[(h+64>>>9<<4)+15]=s,l.sigBytes=d.length*4,this._process(),this._hash},clone:function(){var l=H.clone.call(this);return l._hash=this._hash.clone(),l}});v.SHA256=H._createHelper(m),v.HmacSHA256=H._createHmacHelper(m)}(Math),i.SHA256})})(ye);const _e=()=>{let e="";const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=t.length;let o=0;for(;o<128;)e+=t.charAt(Math.floor(Math.random()*i)),o+=1;return e},me=async(e,t,i,o)=>{const v=await fetch(`${e}`,{method:t,headers:o,body:i});let p;const $=await v.text();try{p=JSON.parse($)}catch{throw $}if(!v.ok)throw p;return p},X=e=>{if(e.toString()==="Invalid Date")throw e;const t=o=>o<10?"0"+o:o,i=o=>{if(o===0)return"Z";const v=o>0?"-":"+";return o=Math.abs(o),v+t(Math.floor(o/60))+":"+t(o%60)};return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+"T"+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+i(e.getTimezoneOffset())},we=(e,t)=>`Send EUR ${e} to ${t} at ${X(new Date)}`,W=e=>{var t;return e&&((t=Object.entries(e))==null?void 0:t.length)>0?Object.entries(e).map(([i,o])=>`${encodeURIComponent(i)}=${encodeURIComponent(o)}`).join("&"):""},be={environments:{production:{api:"https://api.monerium.app",web:"https://monerium.app"},sandbox:{api:"https://api.monerium.dev",web:"https://sandbox.monerium.dev"}}};class Be{constructor(t="sandbox"){M(this,O);M(this,U);M(this,L);M(this,D);M(this,T,void 0);M(this,j,void 0);F(this,"codeVerifier");F(this,"bearerProfile");F(this,"pkceRequest",t=>this.getAuthFlowURI(t));J(this,T,be.environments[t])}async auth(t){let i;if(S(this,U,fe).call(this,t))i={...t,grant_type:"authorization_code"};else if(S(this,L,le).call(this,t))i={...t,grant_type:"refresh_token"};else if(S(this,D,he).call(this,t))i={...t,grant_type:"client_credentials"};else throw new Error("Authentication method could not be detected.");return this.bearerProfile=await S(this,O,R).call(this,"post","auth/token",i,!0),J(this,j,`Bearer ${this.bearerProfile.access_token}`),this.bearerProfile}getAuthFlowURI(t){this.codeVerifier=_e();const i=E.stringify(N(this.codeVerifier)),o={...t,client_id:t==null?void 0:t.client_id,code_challenge:i,code_challenge_method:"S256",response_type:"code"};return`${G(this,T).api}/auth?${W(o)}`}getAuthContext(){return S(this,O,R).call(this,"get","auth/context")}getProfile(t){return S(this,O,R).call(this,"get",`profiles/${t}`)}getBalances(t){return t?S(this,O,R).call(this,"get",`profiles/${t}/balances`):S(this,O,R).call(this,"get","balances")}getOrders(t){const i=W(t);return S(this,O,R).call(this,"get",`orders?${i}`)}getOrder(t){return S(this,O,R).call(this,"get",`orders/${t}`)}getTokens(){return S(this,O,R).call(this,"get","tokens")}linkAddress(t,i){return S(this,O,R).call(this,"post",`profiles/${t}/addresses`,JSON.stringify(i))}placeOrder(t,i){const o={...t,kind:"redeem",currency:"eur"};return i?S(this,O,R).call(this,"post",`profiles/${i}/orders`,JSON.stringify(o)):S(this,O,R).call(this,"post","orders",JSON.stringify(o))}uploadSupportingDocument(t){const i=W(t);return S(this,O,R).call(this,"post","files/supporting-document",i,!0)}}T=new WeakMap,j=new WeakMap,O=new WeakSet,R=async function(t,i,o,v){return me(`${G(this,T).api}/${i}`,t,v?W(o):o,{Authorization:G(this,j)||"","Content-Type":`application/${v?"x-www-form-urlencoded":"json"}`})},U=new WeakSet,fe=function(t){return t.code!=null},L=new WeakSet,le=function(t){return t.refresh_token!=null},D=new WeakSet,he=function(t){return t.client_secret!=null};var K=(e=>(e.eur="eur",e))(K||{}),Y=(e=>(e.corporate="corporate",e.personal="personal",e))(Y||{}),ee=(e=>(e.read="read",e.write="write",e))(ee||{}),re=(e=>(e.absent="absent",e.submitted="submitted",e.pending="pending",e.confirmed="confirmed",e))(re||{}),te=(e=>(e.approved="approved",e.rejected="rejected",e.unknown="unknown",e))(te||{}),ne=(e=>(e.requested="requested",e.approved="approved",e.pending="pending",e))(ne||{}),oe=(e=>(e.iban="iban",e.scan="scan",e))(oe||{}),ie=(e=>(e.redeem="redeem",e.issue="issue",e))(ie||{}),se=(e=>(e.placed="placed",e.pending="pending",e.processed="processed",e.rejected="rejected",e))(se||{});const xe="I hereby declare that I am the address owner.";var ae=(e=>(e.Goerli="goerli",e.Chiado="chiado",e.Mumbai="mumbai",e.Mainnet="mainnet",e))(ae||{}),ce=(e=>(e.Ethereum="ethereum",e.Gnosis="gnosis",e.Polygon="polygon",e))(ce||{});const Ce=Object.freeze(Object.defineProperty({__proto__:null,Chain:ce,LINK_MESSAGE:xe,Network:ae},Symbol.toStringTag,{value:"Module"}));c.AccountState=ne,c.Currency=K,c.KYCOutcome=te,c.KYCState=re,c.MoneriumClient=Be,c.OrderKind=ie,c.OrderState=se,c.PaymentStandard=oe,c.Permission=ee,c.ProfileType=Y,c.constants=Ce,c.placeOrderMessage=we,c.rfc3339=X,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
2
2
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../__vite-browser-external","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/core.js","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/enc-base64url.js","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/sha256.js","../src/utils.ts","../src/config.ts","../src/client.ts","../src/types.ts","../src/constants.ts"],"sourcesContent":["export default {}",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64url encoding strategy.\n\t */\n\t var Base64url = C_enc.Base64url = {\n\t /**\n\t * Converts a word array to a Base64url string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {string} The Base64url string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);\n\t */\n\t stringify: function (wordArray, urlSafe=true) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = urlSafe ? this._safe_map : this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64url string to a word array.\n\t *\n\t * @param {string} base64Str The Base64url string.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64url.parse(base64String);\n\t */\n\t parse: function (base64Str, urlSafe=true) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = urlSafe ? this._safe_map : this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\t _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\treturn CryptoJS.enc.Base64url;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Initialization and round constants tables\n\t var H = [];\n\t var K = [];\n\n\t // Compute constants\n\t (function () {\n\t function isPrime(n) {\n\t var sqrtN = Math.sqrt(n);\n\t for (var factor = 2; factor <= sqrtN; factor++) {\n\t if (!(n % factor)) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t function getFractionalBits(n) {\n\t return ((n - (n | 0)) * 0x100000000) | 0;\n\t }\n\n\t var n = 2;\n\t var nPrime = 0;\n\t while (nPrime < 64) {\n\t if (isPrime(n)) {\n\t if (nPrime < 8) {\n\t H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t }\n\t K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t nPrime++;\n\t }\n\n\t n++;\n\t }\n\t }());\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-256 hash algorithm.\n\t */\n\t var SHA256 = C_algo.SHA256 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init(H.slice(0));\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\t var f = H[5];\n\t var g = H[6];\n\t var h = H[7];\n\n\t // Computation\n\t for (var i = 0; i < 64; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var gamma0x = W[i - 15];\n\t var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n\t ((gamma0x << 14) | (gamma0x >>> 18)) ^\n\t (gamma0x >>> 3);\n\n\t var gamma1x = W[i - 2];\n\t var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n\t ((gamma1x << 13) | (gamma1x >>> 19)) ^\n\t (gamma1x >>> 10);\n\n\t W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t }\n\n\t var ch = (e & f) ^ (~e & g);\n\t var maj = (a & b) ^ (a & c) ^ (b & c);\n\n\t var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n\t var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n\t var t1 = h + sigma1 + ch + K[i] + W[i];\n\t var t2 = sigma0 + maj;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t H[5] = (H[5] + f) | 0;\n\t H[6] = (H[6] + g) | 0;\n\t H[7] = (H[7] + h) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA256('message');\n\t * var hash = CryptoJS.SHA256(wordArray);\n\t */\n\t C.SHA256 = Hasher._createHelper(SHA256);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA256(message, key);\n\t */\n\t C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA256;\n\n}));","export const generateRandomString = () => {\n let result = '';\n const characters =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charactersLength = characters.length;\n let counter = 0;\n while (counter < 128) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n counter += 1;\n }\n return result;\n};\n\nexport const rest = async <T>(\n url: string,\n method: string,\n body?: BodyInit | Record<string, string>,\n headers?: Record<string, string>,\n): Promise<T> => {\n const res = await fetch(`${url}`, {\n method,\n headers,\n body: body as unknown as BodyInit,\n });\n\n let response;\n const text = await res.text();\n\n try {\n response = JSON.parse(text);\n } catch (err) {\n throw text;\n }\n\n if (!res.ok) {\n throw response;\n }\n\n return response as T;\n};\nexport const rfc3339 = (d: Date) => {\n if (d.toString() === 'Invalid Date') {\n throw d;\n }\n const pad = (n: number) => {\n return n < 10 ? '0' + n : n;\n };\n\n const timezoneOffset = (offset: number) => {\n if (offset === 0) {\n return 'Z';\n }\n const sign = offset > 0 ? '-' : '+';\n offset = Math.abs(offset);\n return sign + pad(Math.floor(offset / 60)) + ':' + pad(offset % 60);\n };\n\n return (\n d.getFullYear() +\n '-' +\n pad(d.getMonth() + 1) +\n '-' +\n pad(d.getDate()) +\n 'T' +\n pad(d.getHours()) +\n ':' +\n pad(d.getMinutes()) +\n ':' +\n pad(d.getSeconds()) +\n timezoneOffset(d.getTimezoneOffset())\n );\n};\n\n/**\n * The message to be signed when placing an order.\n *\n * @returns string\n */\nexport const placeOrderMessage = (amount: string | number, iban: string) =>\n `Send EUR ${amount} to ${iban} at ${rfc3339(new Date())}`;\n\n/**\n * Replacement for URLSearchParams, Metamask snaps do not include node globals.\n * It will not handle all special characters the same way as URLSearchParams, but it will be good enough for our use case.\n * @param body a json format of the body to be encoded\n * @returns 'application/x-www-form-urlencoded' compatible string\n */\nexport const urlEncoded = (\n body: Record<string, string>,\n): string | undefined => {\n return body && Object.entries(body)?.length > 0\n ? Object.entries(body)\n .map(\n ([key, value]) =>\n `${encodeURIComponent(key)}=${encodeURIComponent(value)}`,\n )\n .join('&')\n : '';\n};\n","import type { Config } from './types';\n\nconst MONERIUM_CONFIG: Config = {\n environments: {\n production: {\n api: 'https://api.monerium.app',\n web: 'https://monerium.app',\n },\n sandbox: {\n api: 'https://api.monerium.dev',\n web: 'https://sandbox.monerium.dev',\n },\n },\n};\n\nexport { MONERIUM_CONFIG };\n","import encodeBase64Url from 'crypto-js/enc-base64url';\nimport SHA256 from 'crypto-js/sha256';\nimport { generateRandomString, rest, urlEncoded } from './utils';\nimport { MONERIUM_CONFIG } from './config';\nimport type {\n AuthArgs,\n AuthCode,\n AuthContext,\n Balances,\n BearerProfile,\n ClientCredentials,\n Environment,\n LinkAddress,\n NewOrder,\n Order,\n OrderFilter,\n PKCERequest,\n PKCERequestArgs,\n Profile,\n RefreshToken,\n SupportingDoc,\n Token,\n} from './types';\n// import pjson from \"../package.json\";\n\nexport class MoneriumClient {\n #env: Environment;\n\n #authPayload?: string;\n /** The PKCE code verifier */\n codeVerifier?: string;\n bearerProfile?: BearerProfile;\n\n constructor(env: 'production' | 'sandbox' = 'sandbox') {\n this.#env = MONERIUM_CONFIG.environments[env];\n }\n\n // -- Authentication\n\n async auth(args: AuthArgs): Promise<BearerProfile> {\n let params: AuthCode | RefreshToken | ClientCredentials;\n\n if (this.#isAuthCode(args)) {\n params = { ...args, grant_type: 'authorization_code' };\n } else if (this.#isRefreshToken(args)) {\n params = { ...args, grant_type: 'refresh_token' };\n } else if (this.#isClientCredentials(args)) {\n params = { ...args, grant_type: 'client_credentials' };\n } else {\n throw new Error('Authentication method could not be detected.');\n }\n\n this.bearerProfile = (await this.#api(\n 'post',\n `auth/token`,\n params as unknown as Record<string, string>,\n true,\n )) as BearerProfile;\n\n this.#authPayload = `Bearer ${this.bearerProfile.access_token}`;\n return this.bearerProfile;\n }\n\n /**\n * Construct the url to the authorization code flow,\n * the code verifier is needed afterwards to obtain an access token and is therefore stored in `this.codeVerifier`\n * For automatic wallet link, add the following properties: `address`, `signature`, `chain` & `network`\n * @returns string\n */\n getAuthFlowURI(args: PKCERequestArgs): string {\n // Using crypto-js to generate a random string was causing the following error:\n // `Error: Native crypto module could not be used to get secure random number.`\n this.codeVerifier = generateRandomString();\n const challenge = encodeBase64Url.stringify(\n SHA256(this.codeVerifier as string),\n );\n\n const params: PKCERequest = {\n ...args,\n client_id: args?.client_id,\n code_challenge: challenge,\n code_challenge_method: 'S256',\n response_type: 'code',\n };\n\n return `${this.#env.api}/auth?${urlEncoded(params)}`;\n }\n\n /**\n * @deprecated since v2.0.7, use {@link getAuthFlowURI} instead.\n */\n pkceRequest = (args: PKCERequestArgs) => this.getAuthFlowURI(args);\n\n // -- Read Methods\n\n getAuthContext(): Promise<AuthContext> {\n return this.#api<AuthContext>('get', `auth/context`);\n }\n\n /**\n * @param {string} profileId - the id of the profile to fetch.\n */\n getProfile(profileId: string): Promise<Profile> {\n return this.#api<Profile>('get', `profiles/${profileId}`);\n }\n\n /**\n * @param {string=} profileId - the id of the profile to fetch balances.\n */\n getBalances(profileId?: string): Promise<Balances> | Promise<Balances[]> {\n if (profileId) {\n return this.#api<Balances>('get', `profiles/${profileId}/balances`);\n } else {\n return this.#api<Balances[]>('get', `balances`);\n }\n }\n\n getOrders(filter?: OrderFilter): Promise<Order[]> {\n const searchParams = urlEncoded(filter as Record<string, string>);\n return this.#api<Order[]>('get', `orders?${searchParams}`);\n }\n\n getOrder(orderId: string): Promise<Order> {\n return this.#api<Order>('get', `orders/${orderId}`);\n }\n\n getTokens(): Promise<Token[]> {\n return this.#api<Token[]>('get', 'tokens');\n }\n\n // -- Write Methods\n\n linkAddress(profileId: string, body: LinkAddress) {\n return this.#api(\n 'post',\n `profiles/${profileId}/addresses`,\n JSON.stringify(body),\n );\n }\n\n placeOrder(order: NewOrder, profileId?: string): Promise<Order> {\n const req = { ...order, kind: 'redeem', currency: 'eur' };\n if (profileId) {\n return this.#api<Order>(\n 'post',\n `profiles/${profileId}/orders`,\n JSON.stringify(req),\n );\n } else {\n return this.#api<Order>('post', `orders`, JSON.stringify(req));\n }\n }\n\n uploadSupportingDocument(document: File): Promise<SupportingDoc> {\n const searchParams = urlEncoded(\n document as unknown as Record<string, string>,\n );\n\n return this.#api<SupportingDoc>(\n 'post',\n 'files/supporting-document',\n searchParams,\n true,\n );\n }\n\n // -- Helper Methods\n\n async #api<T>(\n method: string,\n resource: string,\n body?: BodyInit | Record<string, string>,\n isFormEncoded?: boolean,\n ): Promise<T> {\n return rest<T>(\n `${this.#env.api}/${resource}`,\n method,\n isFormEncoded ? urlEncoded(body as Record<string, string>) : body,\n {\n Authorization: this.#authPayload || '',\n 'Content-Type': `application/${\n isFormEncoded ? 'x-www-form-urlencoded' : 'json'\n }`,\n },\n );\n }\n\n #isAuthCode(args: AuthArgs): args is AuthCode {\n return (args as AuthCode).code != undefined;\n }\n\n #isRefreshToken(args: AuthArgs): args is RefreshToken {\n return (args as RefreshToken).refresh_token != undefined;\n }\n\n #isClientCredentials(args: AuthArgs): args is ClientCredentials {\n return (args as ClientCredentials).client_secret != undefined;\n }\n}\n","// --- Config --- //\n\nexport type Environment = { api: string; web: string };\n\nexport type Config = {\n environments: { production: Environment; sandbox: Environment };\n};\n\nexport type ENV = 'sandbox' | 'production';\n\nexport type EthereumTestnet = 'goerli';\nexport type GnosisTestnet = 'chiado';\nexport type PolygonTestnet = 'mumbai';\n\nexport type Chain = 'ethereum' | 'gnosis' | 'polygon';\nexport type Networks =\n | EthereumTestnet\n | GnosisTestnet\n | PolygonTestnet\n | 'mainnet';\n\n// -- Commons\nexport type NetworkSemiStrict<C extends Chain> = C extends 'ethereum'\n ? EthereumTestnet | 'mainnet'\n : C extends 'gnosis'\n ? GnosisTestnet | 'mainnet'\n : C extends 'polygon'\n ? PolygonTestnet | 'mainnet'\n : never;\n\nexport type NetworkStrict<\n C extends Chain,\n E extends ENV,\n> = E extends 'production'\n ? 'mainnet'\n : E extends 'sandbox'\n ? C extends 'ethereum'\n ? EthereumTestnet\n : C extends 'gnosis'\n ? GnosisTestnet\n : C extends 'polygon'\n ? PolygonTestnet\n : never\n : never;\n\n/*\n * -- isValid:\n * const network: Network<'ethereum', 'sandbox'> = 'goerli';\n * const network: Network<'ethereum'> = 'mainnet';\n * const network: Network<'ethereum'> = 'goerli'\n * const network: Network = 'chiado'\n *\n * -- isInValid:\n * const network: Network<'ethereum', 'sandbox'> = 'chiado';\n * const network: Network<'ethereum'> = 'chiado';\n */\nexport type Network<\n C extends Chain = Chain,\n E extends ENV = ENV,\n> = C extends Chain\n ? E extends ENV\n ? NetworkStrict<C, E> & NetworkSemiStrict<C>\n : never\n : never;\n\nexport enum Currency {\n eur = 'eur',\n // usd = 'usd',\n // gbp = 'gbp',\n // isk = 'isk',\n}\n\n// -- auth\n\nexport type AuthArgs =\n | Omit<AuthCode, 'grant_type'>\n | Omit<RefreshToken, 'grant_type'>\n | Omit<ClientCredentials, 'grant_type'>;\n\nexport interface AuthCode {\n grant_type: 'authorization_code';\n client_id: string;\n code: string;\n code_verifier: string;\n redirect_uri: string;\n scope?: string;\n}\n\nexport interface BearerProfile {\n access_token: string;\n token_type: string;\n expires_in: number;\n refresh_token: string;\n profile: string;\n userId: string;\n}\n\nexport interface RefreshToken {\n grant_type: 'refresh_token';\n client_id: string;\n refresh_token: string;\n scope?: string;\n}\n\nexport interface ClientCredentials {\n grant_type: 'client_credentials';\n client_id: string;\n client_secret: string;\n scope?: string;\n}\n\n// -- pkceRequest\n\n/**\n * @returns A {@link PKCERequest} object with properties omitted that are automatically computed in by the SDK.\n */\nexport type PKCERequestArgs = Omit<\n PKCERequest,\n 'code_challenge' | 'code_challenge_method' | 'response_type'\n>;\n\nexport type PKCERequest = {\n /** the authentication flow client id of the application */\n client_id: string;\n /** the code challenge automatically generated by the SDK */\n code_challenge: string;\n /** the code challenge method for the authentication flow , handled by the SDK */\n code_challenge_method: 'S256';\n /** the response type of the authentication flow, handled by the SDK */\n response_type: 'code';\n /** the state of the application */\n state?: string;\n /** the redirect uri of the application */\n redirect_uri?: string;\n /** the scope of the application */\n scope?: string;\n /** the address of the wallet to automatically link */\n address?: string;\n /** the signature of the wallet to automatically link */\n signature?: string;\n /** the network of the wallet to automatically link */\n network?: Network;\n /** the chain of the wallet to automatically link */\n chain?: Chain;\n};\n\n// -- authContext\n\nenum Method {\n password = 'password',\n resource = 'resource',\n jwt = 'jwt',\n apiKey = 'apiKey',\n}\n\nexport enum ProfileType {\n corporate = 'corporate',\n personal = 'personal',\n}\n\nexport enum Permission {\n read = 'read',\n write = 'write',\n}\n\nexport interface AuthProfile {\n id: string;\n type: ProfileType;\n name: string;\n perms: Permission[];\n}\n\nexport interface AuthContext {\n userId: string;\n email: string;\n name: string;\n roles: 'admin'[];\n auth: { method: Method; subject: string; verified: boolean };\n defaultProfile: string;\n profiles: AuthProfile[];\n}\n\n// -- getProfile\n\nexport enum KYCState {\n absent = 'absent',\n submitted = 'submitted',\n pending = 'pending',\n confirmed = 'confirmed',\n}\n\nexport enum KYCOutcome {\n approved = 'approved',\n rejected = 'rejected',\n unknown = 'unknown',\n}\n\nexport interface KYC {\n state: KYCState;\n outcome: KYCOutcome;\n}\n\nexport enum PaymentStandard {\n iban = 'iban',\n scan = 'scan',\n}\n\nexport interface Account {\n address: string;\n currency: Currency;\n standard: PaymentStandard;\n iban?: string;\n // sortCode?: string;\n // accountNumber?: string;\n network: Network;\n chain: Chain;\n id?: string;\n}\n\nexport interface Profile {\n id: string;\n name: string;\n kyc: KYC;\n accounts: Account[];\n}\n\n// -- getBalances\nexport interface Balance {\n currency: Currency;\n amount: string;\n}\n\nexport interface Balances {\n id: string;\n address: string;\n chain: Chain;\n network: Network;\n balances: Balance[];\n}\n\n// --getOrders\n\nexport enum OrderKind {\n redeem = 'redeem',\n issue = 'issue',\n}\n\nexport enum OrderState {\n placed = 'placed',\n pending = 'pending',\n processed = 'processed',\n rejected = 'rejected',\n}\n\nexport interface Fee {\n provider: 'satchel';\n currency: Currency;\n amount: string;\n}\n\nexport interface IBAN {\n standard: PaymentStandard.iban;\n iban: string;\n}\n\nexport interface SCAN {\n standard: PaymentStandard.scan;\n sortCode: string;\n accountNumber: string;\n}\n\nexport interface Individual {\n firstName: string;\n lastName: string;\n country?: string;\n}\n\nexport interface Corporation {\n companyName: string;\n country: string;\n}\n\nexport interface Counterpart {\n identifier: IBAN | SCAN;\n details: Individual | Corporation;\n}\n\nexport interface OrderMetadata {\n approvedAt: string;\n processedAt: string;\n rejectedAt: string;\n state: OrderState;\n placedBy: string;\n placedAt: string;\n receivedAmount: string;\n sentAmount: string;\n}\n\nexport interface OrderFilter {\n address?: string;\n txHash?: string;\n profile?: string;\n memo?: string;\n accountId?: string;\n state?: OrderState;\n}\n\nexport interface Order {\n id: string;\n profile: string;\n accountId: string;\n address: string;\n kind: OrderKind;\n amount: string;\n currency: Currency;\n totalFee: string;\n fees: Fee[];\n counterpart: Counterpart;\n memo: string;\n rejectedReason: string;\n supportingDocumentId: string;\n meta: OrderMetadata;\n}\n\n// -- getTokens\n\nexport interface Token {\n currency: Currency;\n ticker: string;\n symbol: string;\n chain: Chain;\n network: Network;\n address: string;\n decimals: number;\n}\n\n// --placeOrder\n\nexport type NewOrder = NewOrderByAddress | NewOrderByAccountId;\n\nexport interface NewOrderCommon {\n amount: string;\n signature: string;\n // currency: Currency;\n counterpart: Counterpart;\n message: string;\n memo?: string;\n supportingDocumentId?: string;\n}\nexport interface NewOrderByAddress extends NewOrderCommon {\n address: string;\n chain: Chain;\n network: Network;\n}\nexport interface NewOrderByAccountId extends NewOrderCommon {\n accountId: string;\n}\n\n// -- uploadSupportingDocument\n\nexport interface SupportingDocMetadata {\n uploadedBy: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface SupportingDoc {\n id: string;\n name: string;\n type: string;\n size: number;\n hash: string;\n meta: SupportingDocMetadata;\n}\n\n// -- linkAddress\n\nexport interface CurrencyAccounts {\n network: Network;\n chain: Chain;\n currency: Currency;\n}\n\nexport interface LinkAddress {\n address: string;\n message: string;\n signature: string;\n accounts: CurrencyAccounts[];\n network?: Network;\n chain?: Chain;\n}\n","export const LINK_MESSAGE = `I hereby declare that I am the address owner.`;\n\nexport enum Network {\n Goerli = 'goerli',\n Chiado = 'chiado',\n Mumbai = 'mumbai',\n Mainnet = 'mainnet',\n}\n\nexport enum Chain {\n Ethereum = 'ethereum',\n Gnosis = 'gnosis',\n Polygon = 'polygon',\n}\n"],"names":["root","factory","module","this","CryptoJS","Math","undefined","crypto","global","require","require$$0","cryptoSecureRandomInt","create","F","obj","subtype","C","C_lib","Base","overrides","instance","properties","propertyName","WordArray","words","sigBytes","encoder","Hex","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","i","thatByte","j","clone","nBytes","C_enc","hexChars","bite","hexStr","hexStrLength","Latin1","latin1Chars","latin1Str","latin1StrLength","Utf8","utf8Str","BufferedBlockAlgorithm","data","doFlush","processedWords","dataWords","dataSigBytes","blockSize","blockSizeBytes","nBlocksReady","nWordsReady","nBytesReady","offset","cfg","messageUpdate","hash","hasher","message","key","C_algo","urlSafe","map","base64Chars","byte1","byte2","byte3","triplet","paddingChar","base64Str","base64StrLength","reverseMap","paddingIndex","parseLoop","bits1","bits2","bitsCombined","Hasher","H","K","isPrime","n","sqrtN","factor","getFractionalBits","nPrime","W","SHA256","M","a","b","c","d","e","g","h","gamma0x","gamma0","gamma1x","gamma1","ch","maj","sigma0","sigma1","t1","t2","nBitsTotal","nBitsLeft","generateRandomString","result","characters","charactersLength","counter","rest","url","method","body","headers","res","response","text","rfc3339","pad","timezoneOffset","sign","placeOrderMessage","amount","iban","urlEncoded","_a","value","MONERIUM_CONFIG","MoneriumClient","env","__privateAdd","_api","_isAuthCode","_isRefreshToken","_isClientCredentials","_env","_authPayload","__publicField","args","__privateSet","params","__privateMethod","isAuthCode_fn","isRefreshToken_fn","isClientCredentials_fn","api_fn","challenge","encodeBase64Url","__privateGet","profileId","filter","searchParams","orderId","order","req","document","resource","isFormEncoded","Currency","ProfileType","Permission","KYCState","KYCOutcome","PaymentStandard","OrderKind","OrderState","LINK_MESSAGE","Network","Chain"],"mappings":"kyDAAe,CAAA,2FCAb,SAAUA,EAAMC,EAAS,CAGzBC,EAAiB,QAAUD,GAU5B,GAACE,EAAM,UAAY,CAOnB,IAAIC,EAAWA,GAAa,SAAUC,EAAMC,EAAW,CAEnD,IAAIC,EA4BJ,GAzBI,OAAO,OAAW,KAAe,O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VA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,QAAU,UAHAA,IAAAA,IAAA,CAAA,CAAA,EAWAC,IAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,KAAO,OAFGA,IAAAA,IAAA,CAAA,CAAA,EAwCAC,IAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,MAAQ,QAFEA,IAAAA,IAAA,CAAA,CAAA,EAKAC,IAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,SAAW,WAJDA,IAAAA,IAAA,CAAA,CAAA,ECvPL,MAAMC,GAAe,gDAEhB,IAAAC,IAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,QAAU,UAJAA,IAAAA,IAAA,CAAA,CAAA,EAOAC,IAAAA,IACVA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,QAAU,UAHAA,IAAAA,IAAA,CAAA,CAAA","x_google_ignoreList":[1,2,3]}
1
+ {"version":3,"file":"index.umd.js","sources":["../__vite-browser-external","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/core.js","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/enc-base64url.js","../.yarn/cache/crypto-js-npm-4.1.1-38a3b8c19d-b3747c12ee.zip/node_modules/crypto-js/sha256.js","../src/utils.ts","../src/config.ts","../src/client.ts","../src/types.ts","../src/constants.ts"],"sourcesContent":["export default {}",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory();\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\troot.CryptoJS = factory();\n\t}\n}(this, function () {\n\n\t/*globals window, global, require*/\n\n\t/**\n\t * CryptoJS core components.\n\t */\n\tvar CryptoJS = CryptoJS || (function (Math, undefined) {\n\n\t var crypto;\n\n\t // Native crypto from window (Browser)\n\t if (typeof window !== 'undefined' && window.crypto) {\n\t crypto = window.crypto;\n\t }\n\n\t // Native crypto in web worker (Browser)\n\t if (typeof self !== 'undefined' && self.crypto) {\n\t crypto = self.crypto;\n\t }\n\n\t // Native crypto from worker\n\t if (typeof globalThis !== 'undefined' && globalThis.crypto) {\n\t crypto = globalThis.crypto;\n\t }\n\n\t // Native (experimental IE 11) crypto from window (Browser)\n\t if (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n\t crypto = window.msCrypto;\n\t }\n\n\t // Native crypto from global (NodeJS)\n\t if (!crypto && typeof global !== 'undefined' && global.crypto) {\n\t crypto = global.crypto;\n\t }\n\n\t // Native crypto import via require (NodeJS)\n\t if (!crypto && typeof require === 'function') {\n\t try {\n\t crypto = require('crypto');\n\t } catch (err) {}\n\t }\n\n\t /*\n\t * Cryptographically secure pseudorandom number generator\n\t *\n\t * As Math.random() is cryptographically not safe to use\n\t */\n\t var cryptoSecureRandomInt = function () {\n\t if (crypto) {\n\t // Use getRandomValues method (Browser)\n\t if (typeof crypto.getRandomValues === 'function') {\n\t try {\n\t return crypto.getRandomValues(new Uint32Array(1))[0];\n\t } catch (err) {}\n\t }\n\n\t // Use randomBytes method (NodeJS)\n\t if (typeof crypto.randomBytes === 'function') {\n\t try {\n\t return crypto.randomBytes(4).readInt32LE();\n\t } catch (err) {}\n\t }\n\t }\n\n\t throw new Error('Native crypto module could not be used to get secure random number.');\n\t };\n\n\t /*\n\t * Local polyfill of Object.create\n\n\t */\n\t var create = Object.create || (function () {\n\t function F() {}\n\n\t return function (obj) {\n\t var subtype;\n\n\t F.prototype = obj;\n\n\t subtype = new F();\n\n\t F.prototype = null;\n\n\t return subtype;\n\t };\n\t }());\n\n\t /**\n\t * CryptoJS namespace.\n\t */\n\t var C = {};\n\n\t /**\n\t * Library namespace.\n\t */\n\t var C_lib = C.lib = {};\n\n\t /**\n\t * Base object for prototypal inheritance.\n\t */\n\t var Base = C_lib.Base = (function () {\n\n\n\t return {\n\t /**\n\t * Creates a new object that inherits from this object.\n\t *\n\t * @param {Object} overrides Properties to copy into the new object.\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * field: 'value',\n\t *\n\t * method: function () {\n\t * }\n\t * });\n\t */\n\t extend: function (overrides) {\n\t // Spawn\n\t var subtype = create(this);\n\n\t // Augment\n\t if (overrides) {\n\t subtype.mixIn(overrides);\n\t }\n\n\t // Create default initializer\n\t if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {\n\t subtype.init = function () {\n\t subtype.$super.init.apply(this, arguments);\n\t };\n\t }\n\n\t // Initializer's prototype is the subtype object\n\t subtype.init.prototype = subtype;\n\n\t // Reference supertype\n\t subtype.$super = this;\n\n\t return subtype;\n\t },\n\n\t /**\n\t * Extends this object and runs the init method.\n\t * Arguments to create() will be passed to init().\n\t *\n\t * @return {Object} The new object.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var instance = MyType.create();\n\t */\n\t create: function () {\n\t var instance = this.extend();\n\t instance.init.apply(instance, arguments);\n\n\t return instance;\n\t },\n\n\t /**\n\t * Initializes a newly created object.\n\t * Override this method to add some logic when your objects are created.\n\t *\n\t * @example\n\t *\n\t * var MyType = CryptoJS.lib.Base.extend({\n\t * init: function () {\n\t * // ...\n\t * }\n\t * });\n\t */\n\t init: function () {\n\t },\n\n\t /**\n\t * Copies properties into this object.\n\t *\n\t * @param {Object} properties The properties to mix in.\n\t *\n\t * @example\n\t *\n\t * MyType.mixIn({\n\t * field: 'value'\n\t * });\n\t */\n\t mixIn: function (properties) {\n\t for (var propertyName in properties) {\n\t if (properties.hasOwnProperty(propertyName)) {\n\t this[propertyName] = properties[propertyName];\n\t }\n\t }\n\n\t // IE won't copy toString using the loop above\n\t if (properties.hasOwnProperty('toString')) {\n\t this.toString = properties.toString;\n\t }\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = instance.clone();\n\t */\n\t clone: function () {\n\t return this.init.prototype.extend(this);\n\t }\n\t };\n\t }());\n\n\t /**\n\t * An array of 32-bit words.\n\t *\n\t * @property {Array} words The array of 32-bit words.\n\t * @property {number} sigBytes The number of significant bytes in this word array.\n\t */\n\t var WordArray = C_lib.WordArray = Base.extend({\n\t /**\n\t * Initializes a newly created word array.\n\t *\n\t * @param {Array} words (Optional) An array of 32-bit words.\n\t * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.create();\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n\t * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n\t */\n\t init: function (words, sigBytes) {\n\t words = this.words = words || [];\n\n\t if (sigBytes != undefined) {\n\t this.sigBytes = sigBytes;\n\t } else {\n\t this.sigBytes = words.length * 4;\n\t }\n\t },\n\n\t /**\n\t * Converts this word array to a string.\n\t *\n\t * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n\t *\n\t * @return {string} The stringified word array.\n\t *\n\t * @example\n\t *\n\t * var string = wordArray + '';\n\t * var string = wordArray.toString();\n\t * var string = wordArray.toString(CryptoJS.enc.Utf8);\n\t */\n\t toString: function (encoder) {\n\t return (encoder || Hex).stringify(this);\n\t },\n\n\t /**\n\t * Concatenates a word array to this word array.\n\t *\n\t * @param {WordArray} wordArray The word array to append.\n\t *\n\t * @return {WordArray} This word array.\n\t *\n\t * @example\n\t *\n\t * wordArray1.concat(wordArray2);\n\t */\n\t concat: function (wordArray) {\n\t // Shortcuts\n\t var thisWords = this.words;\n\t var thatWords = wordArray.words;\n\t var thisSigBytes = this.sigBytes;\n\t var thatSigBytes = wordArray.sigBytes;\n\n\t // Clamp excess bits\n\t this.clamp();\n\n\t // Concat\n\t if (thisSigBytes % 4) {\n\t // Copy one byte at a time\n\t for (var i = 0; i < thatSigBytes; i++) {\n\t var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n\t }\n\t } else {\n\t // Copy one word at a time\n\t for (var j = 0; j < thatSigBytes; j += 4) {\n\t thisWords[(thisSigBytes + j) >>> 2] = thatWords[j >>> 2];\n\t }\n\t }\n\t this.sigBytes += thatSigBytes;\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Removes insignificant bits.\n\t *\n\t * @example\n\t *\n\t * wordArray.clamp();\n\t */\n\t clamp: function () {\n\t // Shortcuts\n\t var words = this.words;\n\t var sigBytes = this.sigBytes;\n\n\t // Clamp\n\t words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n\t words.length = Math.ceil(sigBytes / 4);\n\t },\n\n\t /**\n\t * Creates a copy of this word array.\n\t *\n\t * @return {WordArray} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = wordArray.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone.words = this.words.slice(0);\n\n\t return clone;\n\t },\n\n\t /**\n\t * Creates a word array filled with random bytes.\n\t *\n\t * @param {number} nBytes The number of random bytes to generate.\n\t *\n\t * @return {WordArray} The random word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.lib.WordArray.random(16);\n\t */\n\t random: function (nBytes) {\n\t var words = [];\n\n\t for (var i = 0; i < nBytes; i += 4) {\n\t words.push(cryptoSecureRandomInt());\n\t }\n\n\t return new WordArray.init(words, nBytes);\n\t }\n\t });\n\n\t /**\n\t * Encoder namespace.\n\t */\n\t var C_enc = C.enc = {};\n\n\t /**\n\t * Hex encoding strategy.\n\t */\n\t var Hex = C_enc.Hex = {\n\t /**\n\t * Converts a word array to a hex string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The hex string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var hexChars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t hexChars.push((bite >>> 4).toString(16));\n\t hexChars.push((bite & 0x0f).toString(16));\n\t }\n\n\t return hexChars.join('');\n\t },\n\n\t /**\n\t * Converts a hex string to a word array.\n\t *\n\t * @param {string} hexStr The hex string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n\t */\n\t parse: function (hexStr) {\n\t // Shortcut\n\t var hexStrLength = hexStr.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < hexStrLength; i += 2) {\n\t words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n\t }\n\n\t return new WordArray.init(words, hexStrLength / 2);\n\t }\n\t };\n\n\t /**\n\t * Latin1 encoding strategy.\n\t */\n\t var Latin1 = C_enc.Latin1 = {\n\t /**\n\t * Converts a word array to a Latin1 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The Latin1 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\n\t // Convert\n\t var latin1Chars = [];\n\t for (var i = 0; i < sigBytes; i++) {\n\t var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t latin1Chars.push(String.fromCharCode(bite));\n\t }\n\n\t return latin1Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Latin1 string to a word array.\n\t *\n\t * @param {string} latin1Str The Latin1 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n\t */\n\t parse: function (latin1Str) {\n\t // Shortcut\n\t var latin1StrLength = latin1Str.length;\n\n\t // Convert\n\t var words = [];\n\t for (var i = 0; i < latin1StrLength; i++) {\n\t words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n\t }\n\n\t return new WordArray.init(words, latin1StrLength);\n\t }\n\t };\n\n\t /**\n\t * UTF-8 encoding strategy.\n\t */\n\t var Utf8 = C_enc.Utf8 = {\n\t /**\n\t * Converts a word array to a UTF-8 string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @return {string} The UTF-8 string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n\t */\n\t stringify: function (wordArray) {\n\t try {\n\t return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n\t } catch (e) {\n\t throw new Error('Malformed UTF-8 data');\n\t }\n\t },\n\n\t /**\n\t * Converts a UTF-8 string to a word array.\n\t *\n\t * @param {string} utf8Str The UTF-8 string.\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n\t */\n\t parse: function (utf8Str) {\n\t return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n\t }\n\t };\n\n\t /**\n\t * Abstract buffered block algorithm template.\n\t *\n\t * The property blockSize must be implemented in a concrete subtype.\n\t *\n\t * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0\n\t */\n\t var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({\n\t /**\n\t * Resets this block algorithm's data buffer to its initial state.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm.reset();\n\t */\n\t reset: function () {\n\t // Initial values\n\t this._data = new WordArray.init();\n\t this._nDataBytes = 0;\n\t },\n\n\t /**\n\t * Adds new data to this block algorithm's buffer.\n\t *\n\t * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.\n\t *\n\t * @example\n\t *\n\t * bufferedBlockAlgorithm._append('data');\n\t * bufferedBlockAlgorithm._append(wordArray);\n\t */\n\t _append: function (data) {\n\t // Convert string to WordArray, else assume WordArray already\n\t if (typeof data == 'string') {\n\t data = Utf8.parse(data);\n\t }\n\n\t // Append\n\t this._data.concat(data);\n\t this._nDataBytes += data.sigBytes;\n\t },\n\n\t /**\n\t * Processes available data blocks.\n\t *\n\t * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n\t *\n\t * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n\t *\n\t * @return {WordArray} The processed data.\n\t *\n\t * @example\n\t *\n\t * var processedData = bufferedBlockAlgorithm._process();\n\t * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n\t */\n\t _process: function (doFlush) {\n\t var processedWords;\n\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\t var dataSigBytes = data.sigBytes;\n\t var blockSize = this.blockSize;\n\t var blockSizeBytes = blockSize * 4;\n\n\t // Count blocks ready\n\t var nBlocksReady = dataSigBytes / blockSizeBytes;\n\t if (doFlush) {\n\t // Round up to include partial blocks\n\t nBlocksReady = Math.ceil(nBlocksReady);\n\t } else {\n\t // Round down to include only full blocks,\n\t // less the number of blocks that must remain in the buffer\n\t nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n\t }\n\n\t // Count words ready\n\t var nWordsReady = nBlocksReady * blockSize;\n\n\t // Count bytes ready\n\t var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n\t // Process blocks\n\t if (nWordsReady) {\n\t for (var offset = 0; offset < nWordsReady; offset += blockSize) {\n\t // Perform concrete-algorithm logic\n\t this._doProcessBlock(dataWords, offset);\n\t }\n\n\t // Remove processed words\n\t processedWords = dataWords.splice(0, nWordsReady);\n\t data.sigBytes -= nBytesReady;\n\t }\n\n\t // Return processed words\n\t return new WordArray.init(processedWords, nBytesReady);\n\t },\n\n\t /**\n\t * Creates a copy of this object.\n\t *\n\t * @return {Object} The clone.\n\t *\n\t * @example\n\t *\n\t * var clone = bufferedBlockAlgorithm.clone();\n\t */\n\t clone: function () {\n\t var clone = Base.clone.call(this);\n\t clone._data = this._data.clone();\n\n\t return clone;\n\t },\n\n\t _minBufferSize: 0\n\t });\n\n\t /**\n\t * Abstract hasher template.\n\t *\n\t * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n\t */\n\t var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({\n\t /**\n\t * Configuration options.\n\t */\n\t cfg: Base.extend(),\n\n\t /**\n\t * Initializes a newly created hasher.\n\t *\n\t * @param {Object} cfg (Optional) The configuration options to use for this hash computation.\n\t *\n\t * @example\n\t *\n\t * var hasher = CryptoJS.algo.SHA256.create();\n\t */\n\t init: function (cfg) {\n\t // Apply config defaults\n\t this.cfg = this.cfg.extend(cfg);\n\n\t // Set initial values\n\t this.reset();\n\t },\n\n\t /**\n\t * Resets this hasher to its initial state.\n\t *\n\t * @example\n\t *\n\t * hasher.reset();\n\t */\n\t reset: function () {\n\t // Reset data buffer\n\t BufferedBlockAlgorithm.reset.call(this);\n\n\t // Perform concrete-hasher logic\n\t this._doReset();\n\t },\n\n\t /**\n\t * Updates this hasher with a message.\n\t *\n\t * @param {WordArray|string} messageUpdate The message to append.\n\t *\n\t * @return {Hasher} This hasher.\n\t *\n\t * @example\n\t *\n\t * hasher.update('message');\n\t * hasher.update(wordArray);\n\t */\n\t update: function (messageUpdate) {\n\t // Append\n\t this._append(messageUpdate);\n\n\t // Update the hash\n\t this._process();\n\n\t // Chainable\n\t return this;\n\t },\n\n\t /**\n\t * Finalizes the hash computation.\n\t * Note that the finalize operation is effectively a destructive, read-once operation.\n\t *\n\t * @param {WordArray|string} messageUpdate (Optional) A final message update.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @example\n\t *\n\t * var hash = hasher.finalize();\n\t * var hash = hasher.finalize('message');\n\t * var hash = hasher.finalize(wordArray);\n\t */\n\t finalize: function (messageUpdate) {\n\t // Final message update\n\t if (messageUpdate) {\n\t this._append(messageUpdate);\n\t }\n\n\t // Perform concrete-hasher logic\n\t var hash = this._doFinalize();\n\n\t return hash;\n\t },\n\n\t blockSize: 512/32,\n\n\t /**\n\t * Creates a shortcut function to a hasher's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to create a helper for.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHelper: function (hasher) {\n\t return function (message, cfg) {\n\t return new hasher.init(cfg).finalize(message);\n\t };\n\t },\n\n\t /**\n\t * Creates a shortcut function to the HMAC's object interface.\n\t *\n\t * @param {Hasher} hasher The hasher to use in this HMAC helper.\n\t *\n\t * @return {Function} The shortcut function.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n\t */\n\t _createHmacHelper: function (hasher) {\n\t return function (message, key) {\n\t return new C_algo.HMAC.init(hasher, key).finalize(message);\n\t };\n\t }\n\t });\n\n\t /**\n\t * Algorithm namespace.\n\t */\n\t var C_algo = C.algo = {};\n\n\t return C;\n\t}(Math));\n\n\n\treturn CryptoJS;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function () {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var C_enc = C.enc;\n\n\t /**\n\t * Base64url encoding strategy.\n\t */\n\t var Base64url = C_enc.Base64url = {\n\t /**\n\t * Converts a word array to a Base64url string.\n\t *\n\t * @param {WordArray} wordArray The word array.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {string} The Base64url string.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);\n\t */\n\t stringify: function (wordArray, urlSafe=true) {\n\t // Shortcuts\n\t var words = wordArray.words;\n\t var sigBytes = wordArray.sigBytes;\n\t var map = urlSafe ? this._safe_map : this._map;\n\n\t // Clamp excess bits\n\t wordArray.clamp();\n\n\t // Convert\n\t var base64Chars = [];\n\t for (var i = 0; i < sigBytes; i += 3) {\n\t var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n\t var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n\t var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n\t var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n\t for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\n\t base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n\t }\n\t }\n\n\t // Add padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t while (base64Chars.length % 4) {\n\t base64Chars.push(paddingChar);\n\t }\n\t }\n\n\t return base64Chars.join('');\n\t },\n\n\t /**\n\t * Converts a Base64url string to a word array.\n\t *\n\t * @param {string} base64Str The Base64url string.\n\t *\n\t * @param {boolean} urlSafe Whether to use url safe\n\t *\n\t * @return {WordArray} The word array.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var wordArray = CryptoJS.enc.Base64url.parse(base64String);\n\t */\n\t parse: function (base64Str, urlSafe=true) {\n\t // Shortcuts\n\t var base64StrLength = base64Str.length;\n\t var map = urlSafe ? this._safe_map : this._map;\n\t var reverseMap = this._reverseMap;\n\n\t if (!reverseMap) {\n\t reverseMap = this._reverseMap = [];\n\t for (var j = 0; j < map.length; j++) {\n\t reverseMap[map.charCodeAt(j)] = j;\n\t }\n\t }\n\n\t // Ignore padding\n\t var paddingChar = map.charAt(64);\n\t if (paddingChar) {\n\t var paddingIndex = base64Str.indexOf(paddingChar);\n\t if (paddingIndex !== -1) {\n\t base64StrLength = paddingIndex;\n\t }\n\t }\n\n\t // Convert\n\t return parseLoop(base64Str, base64StrLength, reverseMap);\n\n\t },\n\n\t _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n\t _safe_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n\t };\n\n\t function parseLoop(base64Str, base64StrLength, reverseMap) {\n\t var words = [];\n\t var nBytes = 0;\n\t for (var i = 0; i < base64StrLength; i++) {\n\t if (i % 4) {\n\t var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n\t var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n\t var bitsCombined = bits1 | bits2;\n\t words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n\t nBytes++;\n\t }\n\t }\n\t return WordArray.create(words, nBytes);\n\t }\n\t}());\n\n\treturn CryptoJS.enc.Base64url;\n\n}));",";(function (root, factory) {\n\tif (typeof exports === \"object\") {\n\t\t// CommonJS\n\t\tmodule.exports = exports = factory(require(\"./core\"));\n\t}\n\telse if (typeof define === \"function\" && define.amd) {\n\t\t// AMD\n\t\tdefine([\"./core\"], factory);\n\t}\n\telse {\n\t\t// Global (browser)\n\t\tfactory(root.CryptoJS);\n\t}\n}(this, function (CryptoJS) {\n\n\t(function (Math) {\n\t // Shortcuts\n\t var C = CryptoJS;\n\t var C_lib = C.lib;\n\t var WordArray = C_lib.WordArray;\n\t var Hasher = C_lib.Hasher;\n\t var C_algo = C.algo;\n\n\t // Initialization and round constants tables\n\t var H = [];\n\t var K = [];\n\n\t // Compute constants\n\t (function () {\n\t function isPrime(n) {\n\t var sqrtN = Math.sqrt(n);\n\t for (var factor = 2; factor <= sqrtN; factor++) {\n\t if (!(n % factor)) {\n\t return false;\n\t }\n\t }\n\n\t return true;\n\t }\n\n\t function getFractionalBits(n) {\n\t return ((n - (n | 0)) * 0x100000000) | 0;\n\t }\n\n\t var n = 2;\n\t var nPrime = 0;\n\t while (nPrime < 64) {\n\t if (isPrime(n)) {\n\t if (nPrime < 8) {\n\t H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));\n\t }\n\t K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));\n\n\t nPrime++;\n\t }\n\n\t n++;\n\t }\n\t }());\n\n\t // Reusable object\n\t var W = [];\n\n\t /**\n\t * SHA-256 hash algorithm.\n\t */\n\t var SHA256 = C_algo.SHA256 = Hasher.extend({\n\t _doReset: function () {\n\t this._hash = new WordArray.init(H.slice(0));\n\t },\n\n\t _doProcessBlock: function (M, offset) {\n\t // Shortcut\n\t var H = this._hash.words;\n\n\t // Working variables\n\t var a = H[0];\n\t var b = H[1];\n\t var c = H[2];\n\t var d = H[3];\n\t var e = H[4];\n\t var f = H[5];\n\t var g = H[6];\n\t var h = H[7];\n\n\t // Computation\n\t for (var i = 0; i < 64; i++) {\n\t if (i < 16) {\n\t W[i] = M[offset + i] | 0;\n\t } else {\n\t var gamma0x = W[i - 15];\n\t var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^\n\t ((gamma0x << 14) | (gamma0x >>> 18)) ^\n\t (gamma0x >>> 3);\n\n\t var gamma1x = W[i - 2];\n\t var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^\n\t ((gamma1x << 13) | (gamma1x >>> 19)) ^\n\t (gamma1x >>> 10);\n\n\t W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n\t }\n\n\t var ch = (e & f) ^ (~e & g);\n\t var maj = (a & b) ^ (a & c) ^ (b & c);\n\n\t var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n\t var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n\t var t1 = h + sigma1 + ch + K[i] + W[i];\n\t var t2 = sigma0 + maj;\n\n\t h = g;\n\t g = f;\n\t f = e;\n\t e = (d + t1) | 0;\n\t d = c;\n\t c = b;\n\t b = a;\n\t a = (t1 + t2) | 0;\n\t }\n\n\t // Intermediate hash value\n\t H[0] = (H[0] + a) | 0;\n\t H[1] = (H[1] + b) | 0;\n\t H[2] = (H[2] + c) | 0;\n\t H[3] = (H[3] + d) | 0;\n\t H[4] = (H[4] + e) | 0;\n\t H[5] = (H[5] + f) | 0;\n\t H[6] = (H[6] + g) | 0;\n\t H[7] = (H[7] + h) | 0;\n\t },\n\n\t _doFinalize: function () {\n\t // Shortcuts\n\t var data = this._data;\n\t var dataWords = data.words;\n\n\t var nBitsTotal = this._nDataBytes * 8;\n\t var nBitsLeft = data.sigBytes * 8;\n\n\t // Add padding\n\t dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n\t dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n\t data.sigBytes = dataWords.length * 4;\n\n\t // Hash final blocks\n\t this._process();\n\n\t // Return final computed hash\n\t return this._hash;\n\t },\n\n\t clone: function () {\n\t var clone = Hasher.clone.call(this);\n\t clone._hash = this._hash.clone();\n\n\t return clone;\n\t }\n\t });\n\n\t /**\n\t * Shortcut function to the hasher's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t *\n\t * @return {WordArray} The hash.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hash = CryptoJS.SHA256('message');\n\t * var hash = CryptoJS.SHA256(wordArray);\n\t */\n\t C.SHA256 = Hasher._createHelper(SHA256);\n\n\t /**\n\t * Shortcut function to the HMAC's object interface.\n\t *\n\t * @param {WordArray|string} message The message to hash.\n\t * @param {WordArray|string} key The secret key.\n\t *\n\t * @return {WordArray} The HMAC.\n\t *\n\t * @static\n\t *\n\t * @example\n\t *\n\t * var hmac = CryptoJS.HmacSHA256(message, key);\n\t */\n\t C.HmacSHA256 = Hasher._createHmacHelper(SHA256);\n\t}(Math));\n\n\n\treturn CryptoJS.SHA256;\n\n}));","export const generateRandomString = () => {\n let result = '';\n const characters =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const charactersLength = characters.length;\n let counter = 0;\n while (counter < 128) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n counter += 1;\n }\n return result;\n};\n\nexport const rest = async <T>(\n url: string,\n method: string,\n body?: BodyInit | Record<string, string>,\n headers?: Record<string, string>,\n): Promise<T> => {\n const res = await fetch(`${url}`, {\n method,\n headers,\n body: body as unknown as BodyInit,\n });\n\n let response;\n const text = await res.text();\n\n try {\n response = JSON.parse(text);\n } catch (err) {\n throw text;\n }\n\n if (!res.ok) {\n throw response;\n }\n\n return response as T;\n};\nexport const rfc3339 = (d: Date) => {\n if (d.toString() === 'Invalid Date') {\n throw d;\n }\n const pad = (n: number) => {\n return n < 10 ? '0' + n : n;\n };\n\n const timezoneOffset = (offset: number) => {\n if (offset === 0) {\n return 'Z';\n }\n const sign = offset > 0 ? '-' : '+';\n offset = Math.abs(offset);\n return sign + pad(Math.floor(offset / 60)) + ':' + pad(offset % 60);\n };\n\n return (\n d.getFullYear() +\n '-' +\n pad(d.getMonth() + 1) +\n '-' +\n pad(d.getDate()) +\n 'T' +\n pad(d.getHours()) +\n ':' +\n pad(d.getMinutes()) +\n ':' +\n pad(d.getSeconds()) +\n timezoneOffset(d.getTimezoneOffset())\n );\n};\n\n/**\n * The message to be signed when placing an order.\n *\n * @returns string\n */\nexport const placeOrderMessage = (amount: string | number, iban: string) =>\n `Send EUR ${amount} to ${iban} at ${rfc3339(new Date())}`;\n\n/**\n * Replacement for URLSearchParams, Metamask snaps do not include node globals.\n * It will not handle all special characters the same way as URLSearchParams, but it will be good enough for our use case.\n * @param body a json format of the body to be encoded\n * @returns 'application/x-www-form-urlencoded' compatible string\n */\nexport const urlEncoded = (\n body: Record<string, string>,\n): string | undefined => {\n return body && Object.entries(body)?.length > 0\n ? Object.entries(body)\n .map(\n ([key, value]) =>\n `${encodeURIComponent(key)}=${encodeURIComponent(value)}`,\n )\n .join('&')\n : '';\n};\n","import type { Config } from './types';\n\nconst MONERIUM_CONFIG: Config = {\n environments: {\n production: {\n api: 'https://api.monerium.app',\n web: 'https://monerium.app',\n },\n sandbox: {\n api: 'https://api.monerium.dev',\n web: 'https://sandbox.monerium.dev',\n },\n },\n};\n\nexport { MONERIUM_CONFIG };\n","import encodeBase64Url from 'crypto-js/enc-base64url';\nimport SHA256 from 'crypto-js/sha256';\nimport { generateRandomString, rest, urlEncoded } from './utils';\nimport { MONERIUM_CONFIG } from './config';\nimport type {\n AuthArgs,\n AuthCode,\n AuthContext,\n Balances,\n BearerProfile,\n ClientCredentials,\n Environment,\n LinkAddress,\n NewOrder,\n Order,\n OrderFilter,\n PKCERequest,\n PKCERequestArgs,\n Profile,\n RefreshToken,\n SupportingDoc,\n Token,\n} from './types';\n// import pjson from \"../package.json\";\n\nexport class MoneriumClient {\n #env: Environment;\n\n #authPayload?: string;\n /** The PKCE code verifier */\n codeVerifier?: string;\n bearerProfile?: BearerProfile;\n\n constructor(env: 'production' | 'sandbox' = 'sandbox') {\n this.#env = MONERIUM_CONFIG.environments[env];\n }\n\n // -- Authentication\n\n async auth(args: AuthArgs): Promise<BearerProfile> {\n let params: AuthCode | RefreshToken | ClientCredentials;\n\n if (this.#isAuthCode(args)) {\n params = { ...args, grant_type: 'authorization_code' };\n } else if (this.#isRefreshToken(args)) {\n params = { ...args, grant_type: 'refresh_token' };\n } else if (this.#isClientCredentials(args)) {\n params = { ...args, grant_type: 'client_credentials' };\n } else {\n throw new Error('Authentication method could not be detected.');\n }\n\n this.bearerProfile = (await this.#api(\n 'post',\n `auth/token`,\n params as unknown as Record<string, string>,\n true,\n )) as BearerProfile;\n\n this.#authPayload = `Bearer ${this.bearerProfile.access_token}`;\n return this.bearerProfile;\n }\n\n /**\n * Construct the url to the authorization code flow,\n * the code verifier is needed afterwards to obtain an access token and is therefore stored in `this.codeVerifier`\n * For automatic wallet link, add the following properties: `address`, `signature`, `chain` & `network`\n * @returns string\n */\n getAuthFlowURI(args: PKCERequestArgs): string {\n // Using crypto-js to generate a random string was causing the following error:\n // `Error: Native crypto module could not be used to get secure random number.`\n this.codeVerifier = generateRandomString();\n const challenge = encodeBase64Url.stringify(\n SHA256(this.codeVerifier as string),\n );\n\n const params: PKCERequest = {\n ...args,\n client_id: args?.client_id,\n code_challenge: challenge,\n code_challenge_method: 'S256',\n response_type: 'code',\n };\n\n return `${this.#env.api}/auth?${urlEncoded(params)}`;\n }\n\n /**\n * @deprecated since v2.0.7, use {@link getAuthFlowURI} instead.\n */\n pkceRequest = (args: PKCERequestArgs) => this.getAuthFlowURI(args);\n\n // -- Read Methods\n\n getAuthContext(): Promise<AuthContext> {\n return this.#api<AuthContext>('get', `auth/context`);\n }\n\n /**\n * @param {string} profileId - the id of the profile to fetch.\n */\n getProfile(profileId: string): Promise<Profile> {\n return this.#api<Profile>('get', `profiles/${profileId}`);\n }\n\n /**\n * @param {string=} profileId - the id of the profile to fetch balances.\n */\n getBalances(profileId?: string): Promise<Balances[]> {\n if (profileId) {\n return this.#api<Balances[]>('get', `profiles/${profileId}/balances`);\n } else {\n return this.#api<Balances[]>('get', `balances`);\n }\n }\n\n getOrders(filter?: OrderFilter): Promise<Order[]> {\n const searchParams = urlEncoded(filter as Record<string, string>);\n return this.#api<Order[]>('get', `orders?${searchParams}`);\n }\n\n getOrder(orderId: string): Promise<Order> {\n return this.#api<Order>('get', `orders/${orderId}`);\n }\n\n getTokens(): Promise<Token[]> {\n return this.#api<Token[]>('get', 'tokens');\n }\n\n // -- Write Methods\n\n linkAddress(profileId: string, body: LinkAddress) {\n return this.#api(\n 'post',\n `profiles/${profileId}/addresses`,\n JSON.stringify(body),\n );\n }\n\n placeOrder(order: NewOrder, profileId?: string): Promise<Order> {\n const req = { ...order, kind: 'redeem', currency: 'eur' };\n if (profileId) {\n return this.#api<Order>(\n 'post',\n `profiles/${profileId}/orders`,\n JSON.stringify(req),\n );\n } else {\n return this.#api<Order>('post', `orders`, JSON.stringify(req));\n }\n }\n\n uploadSupportingDocument(document: File): Promise<SupportingDoc> {\n const searchParams = urlEncoded(\n document as unknown as Record<string, string>,\n );\n\n return this.#api<SupportingDoc>(\n 'post',\n 'files/supporting-document',\n searchParams,\n true,\n );\n }\n\n // -- Helper Methods\n\n async #api<T>(\n method: string,\n resource: string,\n body?: BodyInit | Record<string, string>,\n isFormEncoded?: boolean,\n ): Promise<T> {\n return rest<T>(\n `${this.#env.api}/${resource}`,\n method,\n isFormEncoded ? urlEncoded(body as Record<string, string>) : body,\n {\n Authorization: this.#authPayload || '',\n 'Content-Type': `application/${\n isFormEncoded ? 'x-www-form-urlencoded' : 'json'\n }`,\n },\n );\n }\n\n #isAuthCode(args: AuthArgs): args is AuthCode {\n return (args as AuthCode).code != undefined;\n }\n\n #isRefreshToken(args: AuthArgs): args is RefreshToken {\n return (args as RefreshToken).refresh_token != undefined;\n }\n\n #isClientCredentials(args: AuthArgs): args is ClientCredentials {\n return (args as ClientCredentials).client_secret != undefined;\n }\n}\n","// --- Config --- //\n\nexport type Environment = { api: string; web: string };\n\nexport type Config = {\n environments: { production: Environment; sandbox: Environment };\n};\n\nexport type ENV = 'sandbox' | 'production';\n\nexport type EthereumTestnet = 'goerli';\nexport type GnosisTestnet = 'chiado';\nexport type PolygonTestnet = 'mumbai';\n\nexport type Chain = 'ethereum' | 'gnosis' | 'polygon';\nexport type Networks =\n | EthereumTestnet\n | GnosisTestnet\n | PolygonTestnet\n | 'mainnet';\n\n// -- Commons\nexport type NetworkSemiStrict<C extends Chain> = C extends 'ethereum'\n ? EthereumTestnet | 'mainnet'\n : C extends 'gnosis'\n ? GnosisTestnet | 'mainnet'\n : C extends 'polygon'\n ? PolygonTestnet | 'mainnet'\n : never;\n\nexport type NetworkStrict<\n C extends Chain,\n E extends ENV,\n> = E extends 'production'\n ? 'mainnet'\n : E extends 'sandbox'\n ? C extends 'ethereum'\n ? EthereumTestnet\n : C extends 'gnosis'\n ? GnosisTestnet\n : C extends 'polygon'\n ? PolygonTestnet\n : never\n : never;\n\n/*\n * -- isValid:\n * const network: Network<'ethereum', 'sandbox'> = 'goerli';\n * const network: Network<'ethereum'> = 'mainnet';\n * const network: Network<'ethereum'> = 'goerli'\n * const network: Network = 'chiado'\n *\n * -- isInValid:\n * const network: Network<'ethereum', 'sandbox'> = 'chiado';\n * const network: Network<'ethereum'> = 'chiado';\n */\nexport type Network<\n C extends Chain = Chain,\n E extends ENV = ENV,\n> = C extends Chain\n ? E extends ENV\n ? NetworkStrict<C, E> & NetworkSemiStrict<C>\n : never\n : never;\n\nexport enum Currency {\n eur = 'eur',\n // usd = 'usd',\n // gbp = 'gbp',\n // isk = 'isk',\n}\n\n// -- auth\n\nexport type AuthArgs =\n | Omit<AuthCode, 'grant_type'>\n | Omit<RefreshToken, 'grant_type'>\n | Omit<ClientCredentials, 'grant_type'>;\n\nexport interface AuthCode {\n grant_type: 'authorization_code';\n client_id: string;\n code: string;\n code_verifier: string;\n redirect_uri: string;\n scope?: string;\n}\n\nexport interface BearerProfile {\n access_token: string;\n token_type: string;\n expires_in: number;\n refresh_token: string;\n profile: string;\n userId: string;\n}\n\nexport interface RefreshToken {\n grant_type: 'refresh_token';\n client_id: string;\n refresh_token: string;\n scope?: string;\n}\n\nexport interface ClientCredentials {\n grant_type: 'client_credentials';\n client_id: string;\n client_secret: string;\n scope?: string;\n}\n\n// -- pkceRequest\n\n/**\n * @returns A {@link PKCERequest} object with properties omitted that are automatically computed in by the SDK.\n */\nexport type PKCERequestArgs = Omit<\n PKCERequest,\n 'code_challenge' | 'code_challenge_method' | 'response_type'\n>;\n\nexport type PKCERequest = {\n /** the authentication flow client id of the application */\n client_id: string;\n /** the code challenge automatically generated by the SDK */\n code_challenge: string;\n /** the code challenge method for the authentication flow , handled by the SDK */\n code_challenge_method: 'S256';\n /** the response type of the authentication flow, handled by the SDK */\n response_type: 'code';\n /** the state of the application */\n state?: string;\n /** the redirect uri of the application */\n redirect_uri?: string;\n /** the scope of the application */\n scope?: string;\n /** the address of the wallet to automatically link */\n address?: string;\n /** the signature of the wallet to automatically link */\n signature?: string;\n /** the network of the wallet to automatically link */\n network?: Network;\n /** the chain of the wallet to automatically link */\n chain?: Chain;\n};\n\n// -- authContext\n\nenum Method {\n password = 'password',\n resource = 'resource',\n jwt = 'jwt',\n apiKey = 'apiKey',\n}\n\nexport enum ProfileType {\n corporate = 'corporate',\n personal = 'personal',\n}\n\nexport enum Permission {\n read = 'read',\n write = 'write',\n}\n\nexport interface AuthProfile {\n id: string;\n type: ProfileType;\n name: string;\n perms: Permission[];\n}\n\nexport interface AuthContext {\n userId: string;\n email: string;\n name: string;\n roles: 'admin'[];\n auth: { method: Method; subject: string; verified: boolean };\n defaultProfile: string;\n profiles: AuthProfile[];\n}\n\n// -- getProfile\n\nexport enum KYCState {\n absent = 'absent',\n submitted = 'submitted',\n pending = 'pending',\n confirmed = 'confirmed',\n}\n\nexport enum KYCOutcome {\n approved = 'approved',\n rejected = 'rejected',\n unknown = 'unknown',\n}\n\nexport enum AccountState {\n requested = 'requested',\n approved = 'approved',\n pending = 'pending',\n}\n\nexport interface KYC {\n state: KYCState;\n outcome: KYCOutcome;\n}\n\nexport enum PaymentStandard {\n iban = 'iban',\n scan = 'scan',\n}\n\nexport interface Account {\n address: string;\n currency: Currency;\n standard: PaymentStandard;\n iban?: string;\n // sortCode?: string;\n // accountNumber?: string;\n network: Network;\n chain: Chain;\n id?: string;\n state?: AccountState;\n}\n\nexport interface Profile {\n id: string;\n name: string;\n kyc: KYC;\n accounts: Account[];\n}\n\n// -- getBalances\nexport interface Balance {\n currency: Currency;\n amount: string;\n}\n\nexport interface Balances {\n id: string;\n address: string;\n chain: Chain;\n network: Network;\n balances: Balance[];\n}\n\n// --getOrders\n\nexport enum OrderKind {\n redeem = 'redeem',\n issue = 'issue',\n}\n\nexport enum OrderState {\n placed = 'placed',\n pending = 'pending',\n processed = 'processed',\n rejected = 'rejected',\n}\n\nexport interface Fee {\n provider: 'satchel';\n currency: Currency;\n amount: string;\n}\n\nexport interface IBAN {\n standard: PaymentStandard.iban;\n iban: string;\n}\n\nexport interface SCAN {\n standard: PaymentStandard.scan;\n sortCode: string;\n accountNumber: string;\n}\n\nexport interface Individual {\n firstName: string;\n lastName: string;\n country?: string;\n}\n\nexport interface Corporation {\n companyName: string;\n country: string;\n}\n\nexport interface Counterpart {\n identifier: IBAN | SCAN;\n details: Individual | Corporation;\n}\n\nexport interface OrderMetadata {\n approvedAt: string;\n processedAt: string;\n rejectedAt: string;\n state: OrderState;\n placedBy: string;\n placedAt: string;\n receivedAmount: string;\n sentAmount: string;\n}\n\nexport interface OrderFilter {\n address?: string;\n txHash?: string;\n profile?: string;\n memo?: string;\n accountId?: string;\n state?: OrderState;\n}\n\nexport interface Order {\n id: string;\n profile: string;\n accountId: string;\n address: string;\n kind: OrderKind;\n amount: string;\n currency: Currency;\n totalFee: string;\n fees: Fee[];\n counterpart: Counterpart;\n memo: string;\n rejectedReason: string;\n supportingDocumentId: string;\n meta: OrderMetadata;\n}\n\n// -- getTokens\n\nexport interface Token {\n currency: Currency;\n ticker: string;\n symbol: string;\n chain: Chain;\n network: Network;\n address: string;\n decimals: number;\n}\n\n// --placeOrder\n\nexport type NewOrder = NewOrderByAddress | NewOrderByAccountId;\n\nexport interface NewOrderCommon {\n amount: string;\n signature: string;\n // currency: Currency;\n counterpart: Counterpart;\n message: string;\n memo?: string;\n supportingDocumentId?: string;\n}\nexport interface NewOrderByAddress extends NewOrderCommon {\n address: string;\n chain: Chain;\n network: Network;\n}\nexport interface NewOrderByAccountId extends NewOrderCommon {\n accountId: string;\n}\n\n// -- uploadSupportingDocument\n\nexport interface SupportingDocMetadata {\n uploadedBy: string;\n createdAt: string;\n updatedAt: string;\n}\n\nexport interface SupportingDoc {\n id: string;\n name: string;\n type: string;\n size: number;\n hash: string;\n meta: SupportingDocMetadata;\n}\n\n// -- linkAddress\n\nexport interface CurrencyAccounts {\n network: Network;\n chain: Chain;\n currency: Currency;\n}\n\nexport interface LinkAddress {\n address: string;\n message: string;\n signature: string;\n accounts: CurrencyAccounts[];\n network?: Network;\n chain?: Chain;\n}\n","export const LINK_MESSAGE = `I hereby declare that I am the address owner.`;\n\nexport enum Network {\n Goerli = 'goerli',\n Chiado = 'chiado',\n Mumbai = 'mumbai',\n Mainnet = 'mainnet',\n}\n\nexport enum Chain {\n Ethereum = 'ethereum',\n Gnosis = 'gnosis',\n Polygon = 'polygon',\n}\n"],"names":["root","factory","module","this","CryptoJS","Math","undefined","crypto","global","require","require$$0","cryptoSecureRandomInt","create","F","obj","subtype","C","C_lib","Base","overrides","instance","properties","propertyName","WordArray","words","sigBytes","encoder","Hex","wordArray","thisWords","thatWords","thisSigBytes","thatSigBytes","i","thatByte","j","clone","nBytes","C_enc","hexChars","bite","hexStr","hexStrLength","Latin1","latin1Chars","latin1Str","latin1StrLength","Utf8","utf8Str","BufferedBlockAlgorithm","data","doFlush","processedWords","dataWords","dataSigBytes","blockSize","blockSizeBytes","nBlocksReady","nWordsReady","nBytesReady","offset","cfg","messageUpdate","hash","hasher","message","key","C_algo","urlSafe","map","base64Chars","byte1","byte2","byte3","triplet","paddingChar","base64Str","base64StrLength","reverseMap","paddingIndex","parseLoop","bits1","bits2","bitsCombined","Hasher","H","K","isPrime","n","sqrtN","factor","getFractionalBits","nPrime","W","SHA256","M","a","b","c","d","e","g","h","gamma0x","gamma0","gamma1x","gamma1","ch","maj","sigma0","sigma1","t1","t2","nBitsTotal","nBitsLeft","generateRandomString","result","characters","charactersLength","counter","rest","url","method","body","headers","res","response","text","rfc3339","pad","timezoneOffset","sign","placeOrderMessage","amount","iban","urlEncoded","_a","value","MONERIUM_CONFIG","MoneriumClient","env","__privateAdd","_api","_isAuthCode","_isRefreshToken","_isClientCredentials","_env","_authPayload","__publicField","args","__privateSet","params","__privateMethod","isAuthCode_fn","isRefreshToken_fn","isClientCredentials_fn","api_fn","challenge","encodeBase64Url","__privateGet","profileId","filter","searchParams","orderId","order","req","document","resource","isFormEncoded","Currency","ProfileType","Permission","KYCState","KYCOutcome","AccountState","PaymentStandard","OrderKind","OrderState","LINK_MESSAGE","Network","Chain"],"mappings":"kyDAAe,CAAA,2FCAb,SAAUA,EAAMC,EAAS,CAGzBC,EAAiB,QAAUD,GAU5B,GAACE,EAAM,UAAY,CAOnB,IAAIC,EAAWA,GAAa,SAAUC,EAAMC,EAAW,CAEnD,IAAIC,EA4BJ,GAzBI,OAAO,OAAW,KAAe,OAAO,SACxCA,EAAS,OAAO,QAIhB,OAAO,KAAS,KAAe,KAAK,SACpCA,EAAS,KAAK,QAId,OAAO,WAAe,KAAe,WAAW,SAChDA,EAAS,WAAW,QAIpB,CAACA,GAAU,OAAO,OAAW,KAAe,OAAO,WACnDA,EAAS,OAAO,UAIhB,CAACA,GAAU,OAAOC,EAAW,KAAeA,EAAO,SACnDD,EAASC,EAAO,QAIhB,CAACD,GAAU,OAAOE,IAAY,WAC9B,GAAI,CACAF,EAASG,EACtB,MAAW,CAAc,CAQpB,IAAIC,EAAwB,UAAY,CAC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KAC,IAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,SAAW,WAJDA,IAAAA,IAAA,CAAA,CAAA,EC9PL,MAAMC,GAAe,gDAEhB,IAAAC,IAAAA,IACVA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,OAAS,SACTA,EAAA,QAAU,UAJAA,IAAAA,IAAA,CAAA,CAAA,EAOAC,IAAAA,IACVA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,QAAU,UAHAA,IAAAA,IAAA,CAAA,CAAA","x_google_ignoreList":[1,2,3]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monerium/sdk",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "Everything you need to interact with the Monerium API - an electronic money issuer.",
5
5
  "license": "MIT",
6
6
  "repository": {